  body { font-family: system-ui, sans-serif; margin: 20px; color: #222; background: #fafafa; }
  h2 { margin-bottom: 16px; }
  .puzzle-list { max-width: 750px; display: flex; flex-direction: column; gap: 14px; }
  .puzzle-card { background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 14px 18px; }
  .puzzle-card h3 { margin: 0 0 6px 0; font-size: 17px; }
  .puzzle-card h3 a { color: #0066cc; text-decoration: none; }
  .puzzle-card h3 a:hover { text-decoration: underline; }
  .puzzle-card p { margin: 0; color: #444; line-height: 1.5; }
  .error { color: #d9534f; font-weight: bold; }

  .top-nav { margin-bottom: 14px; font-size: 14px; }
  .top-nav a { color: #0066cc; text-decoration: none; }
  .top-nav a:hover { text-decoration: underline; }
  #puzzle-desc { max-width: 750px; margin: -6px 0 20px 0; color: #444; line-height: 1.5; }
  #status-msg { font-weight: bold; margin-left: 8px; }
  .workspace { display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap; }
  .grid-pane { display: flex; flex-direction: column; gap: 12px; }
  .grid-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .sidebar { max-width: 400px; display: flex; flex-direction: column; gap: 24px; }

  /* Grid Layout */
  table.logic-grid { border-collapse: collapse; user-select: none; background: #fff; }
  th, td { border: 1px solid #ccc; text-align: center; }

  /* Headers */
  .cat-header { background: #333; color: #fff; font-weight: bold; padding: 6px; font-size: 13px; }
  .top-item { writing-mode: vertical-rl; transform: rotate(180deg); height: 95px; width: 26px; padding: 4px 0; font-weight: normal; font-size: 12px; background: #f4f4f4; }
  .left-item { text-align: right; padding: 0 8px; height: 26px; white-space: nowrap; font-weight: normal; font-size: 12px; background: #f4f4f4; }
  .empty-corner { border: none; background: transparent; }

  /* Sub-grid thick borders */
  .block-top { border-top: 2px solid #222; }
  .block-left { border-left: 2px solid #222; }
  .block-bottom { border-bottom: 2px solid #222; }
  .block-right { border-right: 2px solid #222; }

  /* Playable Cells */
  td.cell { width: 26px; height: 26px; cursor: pointer; font-weight: bold; font-size: 15px; }
  td.cell:hover { background-color: #eef6ff; }
  td.cell[data-state="dot"]::after { content: "●"; color: #0066cc; }
  td.cell[data-state="x"]::after { content: "×"; color: #d9534f; }
  td.cell[data-locked-by]:not([data-locked-by=""]) { cursor: not-allowed; background-color: #fdf6f6; }
  td.cell.error { background-color: #ffd6d6 !important; }

  /* Clues & Move Log */
  .clues ol, .history ul { padding-left: 20px; line-height: 1.6; margin: 8px 0 0 0; }
  .clues li { cursor: pointer; margin-bottom: 6px; }
  .clues li.done { text-decoration: line-through; color: #888; }
  .history ul { list-style: none; padding-left: 0; font-size: 13px; color: #444; max-height: 220px; overflow-y: auto; border: 1px solid #ddd; background: #fff; padding: 8px 12px; border-radius: 4px; }
  .history li { padding: 3px 0; border-bottom: 1px solid #f0f0f0; }
  .history li:last-child { border-bottom: none; }

  /* Solved Pop-up Modal */
  .modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: none; align-items: center; justify-content: center; z-index: 100; }
  .modal-backdrop.open { display: flex; }
  .modal-box { background: #fff; padding: 24px 28px; border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); max-width: 360px; text-align: center; }
  .modal-box h3 { margin: 0 0 10px 0; color: #28a745; }
  .modal-box p { margin: 0 0 18px 0; color: #444; }
  .modal-box button { padding: 6px 16px; cursor: pointer; }