    /* ── Reset ── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    /* ─────────────────────────────────────────────────────────────────────
       DESIGN TOKENS (CSS custom properties)
       Dark theme is the default; light theme follows prefers-color-scheme.
       Priority colors follow the pattern: --p-{level}-{bg|t|b}
         bg = background, t = text color, b = border/accent color
    ───────────────────────────────────────────────────────────────────── */
    body {
      font-family: 'DM Mono', 'Courier New', monospace;
      min-height: 100vh;
      background: var(--bg);
      color: var(--text);

      --bg:               #0a0a0a;
      --header-border:    #1f1f1f;
      --col-bg:           #0d0d0d;
      --col-bg-hover:     #111111;
      --col-border:       #1a1a1a;
      --card-bg:          #141414;
      --card-bg-drag:     #1a1a1a;
      --card-border:      #1f1f1f;
      --text:             #e5e5e5;
      --text-muted:       #6b7280;
      --text-desc:        #9ca3af;
      --text-title:       #f0f0f0;
      --input-bg:         #111111;
      --input-border:     #2a2a2a;
      --filter-btn-color: #6b7280;
      --footer-bg:        #080808;
      --footer-border:    #1a1a1a;
      --footer-text:      #4b5563;
      --footer-val:       #9ca3af;
      --stat-bg:          #111111;
      --stat-border:      #2a2a2a;
      --modal-bg:         #111111;
      --modal-border:     #2a2a2a;
      --modal-overlay:    rgba(0,0,0,.85);
      --grain-opacity:    0.6;

      --p-crit-bg: #450a0a; --p-crit-t: #fca5a5; --p-crit-b: #ef4444;
      --p-high-bg: #1c1917; --p-high-t: #fbbf24; --p-high-b: #d97706;
      --p-med-bg:  #0f172a; --p-med-t:  #93c5fd; --p-med-b:  #3b82f6;
      --p-low-bg:  #0f1f0f; --p-low-t:  #86efac; --p-low-b:  #22c55e;
    }

    /* ── Light theme – follows system preference ── */
    @media (prefers-color-scheme: light) {
    body {
      --bg:               #f5f4f0;
      --header-border:    #d4d0c8;
      --col-bg:           #eceae4;
      --col-bg-hover:     #e2e0d8;
      --col-border:       #d4d0c8;
      --card-bg:          #faf9f6;
      --card-bg-drag:     #f0ede6;
      --card-border:      #d4d0c8;
      --text:             #1a1a1a;
      --text-muted:       #6b7280;
      --text-desc:        #4b5563;
      --text-title:       #111111;
      --input-bg:         #ffffff;
      --input-border:     #c8c4bb;
      --filter-btn-color: #6b7280;
      --footer-bg:        #ece9e2;
      --footer-border:    #d4d0c8;
      --footer-text:      #9ca3af;
      --footer-val:       #4b5563;
      --stat-bg:          #ffffff;
      --stat-border:      #d4d0c8;
      --modal-bg:         #faf9f6;
      --modal-border:     #c8c4bb;
      --modal-overlay:    rgba(0,0,0,.4);
      --grain-opacity:    0.2;

      --p-crit-bg: #fee2e2; --p-crit-t: #b91c1c; --p-crit-b: #ef4444;
      --p-high-bg: #fef3c7; --p-high-t: #92400e; --p-high-b: #d97706;
      --p-med-bg:  #dbeafe; --p-med-t:  #1e40af; --p-med-b:  #3b82f6;
      --p-low-bg:  #dcfce7; --p-low-t:  #15803d; --p-low-b:  #22c55e;
    }
    }

    /* ── Grain overlay – decorative noise texture, pointer-events off ── */
    #grain {
      position: fixed; inset: 0; pointer-events: none; z-index: 0;
      opacity: var(--grain-opacity);
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    }

    /* ─────────────────────────────────────────────────────────────────────
       LAYOUT REGIONS
    ───────────────────────────────────────────────────────────────────── */

    /* ── Header – sticky top bar with project title + controls ── */
    #header {
      position: sticky; top: 0; z-index: 50;
      background: var(--bg);
      border-bottom: 1px solid var(--header-border);
      padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
      padding-top: env(safe-area-inset-top);
      transition: transform 0.25s ease;
    }
    .header-inner {
      max-width: 1600px; margin: 0 auto;
      padding: 14px 0 10px;
      display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    }
    .header-sub {
      font-size: 11px; color: var(--text-muted);
      letter-spacing: .2em; text-transform: uppercase; margin-bottom: 2px;
    }
    .header-sub button {
      all: unset; font: inherit; font-size: 11px; color: var(--text-muted);
      letter-spacing: .2em; text-transform: uppercase;
      cursor: pointer; transition: color .15s;
    }
    .header-sub button:hover { color: var(--text); }
    .header-sub a {
      font-size: 11px; color: var(--text-muted); text-decoration: none;
      letter-spacing: .2em; text-transform: uppercase;
    }
    .header-sub a:hover { color: var(--text); }
    #header h1 { font-size: 20px; font-weight: 600; color: var(--text-title); letter-spacing: -.03em; }
    .header-controls { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
    #stats-badge {
      background: var(--stat-bg); border: 1px solid var(--stat-border); border-radius: 8px;
      padding: 5px 12px; font-size: 12px; display: flex; gap: 8px; align-items: center;
    }

    /* ─────────────────────────────────────────────────────────────────────
       FORM CONTROLS
       All inputs share the same base style. Textarea gets font-size 16px
       minimum so iOS Safari does NOT auto-zoom the viewport on focus.
    ───────────────────────────────────────────────────────────────────── */
    input, select, button, textarea {
      font-family: inherit;
      background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 6px;
      color: var(--text); padding: 5px 10px; font-size: 11px; outline: none; cursor: pointer;
      min-height: 32px;
    }
    input[type="text"], textarea { cursor: text; }
    input::placeholder, textarea::placeholder { color: var(--text-muted); }
    /* font-size: 16px prevents iOS Safari from zooming the viewport on focus */
    textarea { resize: vertical; min-height: 72px; width: 100%; line-height: 1.5; font-size: 16px; }
    #search { width: 150px; }
    #btn-user { font-size: 10px; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
    #btn-data { font-size: 10px; white-space: nowrap; }
    select option { background: var(--input-bg); color: var(--text); }
    body.light select option { background: #fff; color: #1a1a1a; }

    /* ─────────────────────────────────────────────────────────────────────
       BOARD COMPONENTS
    ───────────────────────────────────────────────────────────────────── */

    /* ── Label pills – filter bar below header ── */
    #label-pills {
      max-width: 1600px; margin: 0 auto;
      display: flex; gap: 6px; flex-wrap: wrap;
      padding: 8px 0 12px;
      min-height: 36px;
    }
    .label-pill {
      background: transparent; border-radius: 4px; padding: 2px 8px; font-size: 10px;
      letter-spacing: .05em; transition: all .15s;
      color: var(--filter-btn-color); border-color: var(--input-border);
    }

    /* ── Board – horizontal scrolling flex container of kanban columns ── */
    #board {
      display: flex; overflow-x: auto;
      padding: 16px max(24px, env(safe-area-inset-right)) max(80px, calc(env(safe-area-inset-bottom) + 64px)) max(24px, env(safe-area-inset-left));
      max-width: 1600px; margin: 0 auto;
    }
    #board.single-view {
      display: block; overflow-x: visible;
    }
    #board::-webkit-scrollbar { height: 4px; }
    #board::-webkit-scrollbar-thumb { background: var(--col-border); border-radius: 2px; }

    .kanban-col {
      flex: 0 0 280px; margin-right: 12px;
      background: var(--col-bg); border: 1px solid var(--col-border); border-radius: 10px;
      display: flex; flex-direction: column; transition: background .15s, border-color .15s;
      max-height: calc(100vh - 185px);
    }
    .kanban-col.drag-over { background: var(--col-bg-hover); }

    .col-header {
      padding: 12px 14px 10px;
      display: flex; justify-content: space-between; align-items: center;
      flex-shrink: 0;
    }
    .col-header-left { display: flex; align-items: center; gap: 8px; }
    .col-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
    .col-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
    .col-count { border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
    .col-add-btn {
      background: transparent; border: 1px dashed var(--input-border); border-radius: 4px;
      color: var(--text-muted); font-size: 15px; padding: 0 6px; line-height: 1.4;
      cursor: pointer; transition: all .15s;
    }
    .col-add-btn:hover { background: var(--col-bg-hover); border-color: var(--text-muted); color: var(--text); }

    .col-tasks { overflow-y: auto; padding: 8px; flex: 1; }
    .col-tasks::-webkit-scrollbar { width: 3px; }
    .col-tasks::-webkit-scrollbar-thumb { background: var(--col-border); border-radius: 2px; }

    .empty-col { color: var(--text-muted); font-size: 11px; text-align: center; margin-top: 24px; letter-spacing: .05em; }

    /* ── Task card – draggable card inside a kanban column ── */
    .task-card {
      background: var(--card-bg); border-radius: 7px; margin-bottom: 6px;
      padding: 10px 10px 8px; cursor: grab; transition: opacity .1s, filter .1s;
      user-select: none; border: 1px solid var(--card-border); border-left-width: 3px;
    }
    .task-card:hover { filter: brightness(1.06); }
    .task-card.dragging { opacity: .4; cursor: grabbing; }

    .card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; margin-bottom: 6px; }
    .card-module { font-size: 9px; border-radius: 3px; padding: 1px 5px; letter-spacing: .08em; flex-shrink: 0; }
    .card-type { font-size: 9px; color: var(--text-muted); }
    .card-title { font-size: 12px; font-weight: 600; color: var(--text-title); line-height: 1.4; margin-bottom: 6px; }
    .card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 4px; flex-wrap: wrap; }
    .card-priority { font-size: 9px; border-radius: 3px; padding: 1px 5px; border: 1px solid transparent; }
    .card-assignee { font-size: 10px; border-radius: 10px; padding: 1px 7px; }
    .card-assignee.has-display { display: flex; flex-direction: column; padding: 2px 7px; gap: 0; line-height: 1; border-radius: 7px; }
    .assignee-fullname { font-size: 10px; font-weight: 600; line-height: 1.3; }
    .assignee-nick { font-size: 9px; opacity: 0.6; line-height: 1.2; }
    .card-comments { font-size: 9px; color: var(--text-muted); display: flex; align-items: center; gap: 3px; margin-left: auto; }
    .card-comments svg { opacity: .6; }

    /* ─────────────────────────────────────────────────────────────────────
       FOOTER
       Fixed bottom bar with project stats. Hides on mobile scroll.
    ───────────────────────────────────────────────────────────────────── */
    #footer {
      position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
      background: var(--footer-bg); border-top: 1px solid var(--footer-border);
      padding: 8px max(24px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
      display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
      font-size: 10px; letter-spacing: .05em;
      transition: transform 0.25s ease;
    }
    .footer-hint { margin-left: auto; color: var(--footer-text); }

    /* ─────────────────────────────────────────────────────────────────────
       MODALS
       .modal-overlay  – full-screen backdrop (z-index 100)
       .modal-box      – centered content card (max 560px wide by default)
       Specific modals (#identity-modal, #task-modal, etc.) override width.
    ───────────────────────────────────────────────────────────────────── */
    .modal-overlay {
      position: fixed; inset: 0; z-index: 100;
      background: var(--modal-overlay);
      display: flex; align-items: center; justify-content: center; padding: 16px;
    }
    .modal-overlay.hidden { display: none; }
    .hidden { display: none !important; }

    .modal-box {
      background: var(--modal-bg); border: 1px solid var(--modal-border);
      border-radius: 12px; padding: 24px;
      max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto;
    }
    .modal-box::-webkit-scrollbar { width: 4px; }
    .modal-box::-webkit-scrollbar-thumb { background: var(--col-border); border-radius: 2px; }

    /* ── Identity modal ── */
    #login-modal .modal-box { z-index: 101; }
    #login-modal .modal-box h3 { font-size: 16px; color: var(--text-title); margin-bottom: 6px; font-weight: 600; }
    #login-modal .modal-box p { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
    #i-error { font-size: 11px; color: #ef4444; margin-top: -8px; margin-bottom: 8px; display: none; }

    /* ── Task modal ── */
    .modal-task { max-width: 620px; position: relative; }
    .modal-close {
      position: absolute; top: 12px; right: 12px;
      background: transparent; border: none; color: var(--text-muted);
      font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 4px; line-height: 1;
    }
    .modal-close:hover { background: var(--col-bg-hover); color: var(--text); }

    .modal-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
    .modal-title { font-size: 15px; font-weight: 600; color: var(--text-title); line-height: 1.45; margin-bottom: 8px; }
    .modal-desc { font-size: 12px; color: var(--text-desc); line-height: 1.65; white-space: pre-wrap; margin-bottom: 16px; }

    .modal-section { border-top: 1px solid var(--modal-border); padding-top: 14px; margin-top: 14px; }
    .modal-section-label { font-size: 10px; color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }

    .col-move-btn {
      font-size: 10px; border-radius: 4px; padding: 3px 8px; border: 1px solid;
      background: transparent; transition: all .15s;
    }
    .col-move-btn:hover { opacity: .8; }

    .comment {
      background: var(--col-bg); border: 1px solid var(--col-border);
      border-radius: 6px; padding: 8px 10px; margin-bottom: 6px;
    }
    .comment-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
    .comment-author { font-size: 10px; font-weight: 600; color: var(--text-title); }
    .comment-time { font-size: 10px; color: var(--text-muted); }
    .comment-body { font-size: 12px; color: var(--text-desc); line-height: 1.5; white-space: pre-wrap; }

    .btn-del-comment {
      background: transparent; border: none; color: var(--text-muted);
      font-size: 10px; cursor: pointer; padding: 0 3px; border-radius: 3px; line-height: 1;
    }
    .btn-del-comment:hover { color: #ef4444; background: #ef444420; }

    .comment-form { margin-top: 8px; }
    .btn-comment {
      margin-top: 6px; padding: 5px 12px; font-size: 11px; border-radius: 5px;
      background: #3b82f620; border-color: #3b82f666; color: #60a5fa;
    }
    .btn-comment:hover { background: #3b82f640; }

    /* ── Edit form – reusable field/label/action layout inside modals ── */
    .edit-field { margin-bottom: 12px; }
    .edit-label { display: block; font-size: 10px; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
    .edit-field input, .edit-field select, .edit-field textarea { width: 100%; }
    .edit-actions { display: flex; gap: 8px; margin-top: 16px; }

    .btn-primary {
      padding: 6px 14px; font-size: 11px; border-radius: 5px;
      background: #3b82f6; border-color: #3b82f6; color: #fff;
    }
    .btn-primary:hover { background: #2563eb; }
    .btn-ghost {
      padding: 6px 14px; font-size: 11px; border-radius: 5px;
      background: transparent; border-color: var(--input-border); color: var(--text-muted);
    }
    .btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
    .btn-sm-edit {
      font-size: 10px; padding: 2px 7px; border-radius: 4px;
      background: transparent; border-color: var(--input-border); color: var(--text-muted);
      margin-left: auto;
    }
    .btn-sm-edit:hover { color: var(--text); }
    .btn-danger {
      padding: 6px 14px; font-size: 11px; border-radius: 5px;
      background: transparent; border: 1px solid #ef444466; color: #ef4444;
    }
    .btn-danger:hover { background: #450a0a66; }

    /* ── Project settings modal ── */
    #proj-settings-modal .modal-box h3 { font-size: 14px; font-weight: 600; color: var(--text-title); margin-bottom: 16px; }
    #proj-settings-modal .modal-box p  { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; }
    #ps-name-error, #ps-error { font-size: 11px; color: #ef4444; margin-top: -8px; margin-bottom: 8px; display: none; }

    /* ── Clickable project title ── */
    #header-title.proj-link { cursor: pointer; transition: opacity .15s; }
    #header-title.proj-link:hover { opacity: .7; }

    /* ── Add Task / Import modals – width overrides ── */
    #add-task-modal .modal-box { max-width: 500px; }
    #add-task-modal h3 { font-size: 14px; font-weight: 600; color: var(--text-title); margin-bottom: 16px; }
    .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

    /* ── Data modal ─── */
    #data-modal .modal-box h3 { font-size: 14px; font-weight: 600; color: var(--text-title); margin-bottom: 6px; }
    #data-modal .modal-box p { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.6; }
    #data-text { font-family: monospace; font-size: 12px; min-height: 300px; white-space: pre; }
    #data-result { font-size: 12px; margin-bottom: 12px; padding: 8px 12px; border-radius: 6px; }
    #data-result.ok { background: #10b98120; border: 1px solid #10b98166; color: #10b981; }
    #data-result.err { background: #ef444420; border: 1px solid #ef444466; color: #ef4444; }

    /* ── File attachments ── */
    .file-item {
      display: flex; align-items: center; gap: 8px;
      background: var(--col-bg); border: 1px solid var(--col-border);
      border-radius: 6px; padding: 5px 8px 5px 6px; margin-bottom: 4px; font-size: 11px;
    }
    /* Icon badge for non-image files */
    .file-icon-badge {
      flex-shrink: 0; width: 36px; height: 36px; border-radius: 5px;
      display: flex; align-items: center; justify-content: center;
      font-size: 9px; font-weight: 700; letter-spacing: .02em; color: #fff;
    }
    /* Image thumbnail */
    .file-thumb {
      flex-shrink: 0; width: 36px; height: 36px; border-radius: 5px; overflow: hidden;
      cursor: zoom-in; background: var(--col-border);
    }
    .file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .file-thumb:hover { opacity: .85; }
    /* Filename */
    .file-name {
      flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      color: var(--text-title); font-weight: 500;
    }
    /* Size */
    .file-size { color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
    /* Action buttons */
    .file-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
    .file-btn {
      display: inline-flex; align-items: center; justify-content: center;
      width: 24px; height: 24px; border-radius: 4px; border: none; background: none;
      color: var(--text-muted); font-size: 13px; cursor: pointer;
      text-decoration: none; transition: background .12s, color .12s;
    }
    .file-btn:hover { background: var(--col-border); color: var(--text-title); }
    .file-btn-del:hover { background: #ef444420; color: #ef4444; }
    /* Uploading spinner */
    .file-spinner {
      flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
      border: 3.5px solid transparent;
      animation: file-spin .75s linear infinite;
    }
    @keyframes file-spin { to { transform: rotate(360deg); } }
    .file-item-pending { opacity: .85; }
    /* Cancel button */
    .file-btn-cancel {
      background: none; border: none; cursor: pointer; padding: 0 4px;
      color: #f97316; font-size: 11px; font-weight: 600; white-space: nowrap;
      transition: opacity .12s;
    }
    .file-btn-cancel:hover { opacity: .7; }
    /* Drop zone */
    .file-drop-zone {
      border: 1px dashed var(--input-border); border-radius: 5px;
      padding: 10px 12px; margin-top: 6px; cursor: default;
      display: flex; align-items: center; justify-content: center; gap: 6px;
      transition: border-color .15s, background .15s;
    }
    .file-drop-zone.drag-over { border-color: #3b82f6; background: rgba(59,130,246,.08); }
    .file-upload-label { cursor: pointer; }

    /* ── Image lightbox ── */
    .img-preview-overlay {
      position: fixed; inset: 0; z-index: 200;
      background: rgba(0,0,0,.92);
      display: flex; align-items: center; justify-content: center;
      animation: img-preview-fadein .15s ease;
    }
    .img-preview-overlay > img {
      max-width: calc(100vw - 120px); max-height: calc(100vh - 80px);
      object-fit: contain; border-radius: 6px;
      box-shadow: 0 4px 40px rgba(0,0,0,.6); cursor: zoom-out;
    }
    /* Close button */
    .img-preview-close {
      position: absolute; top: 16px; right: 16px; z-index: 201;
      width: 36px; height: 36px; border-radius: 50%; border: none;
      background: rgba(255,255,255,.12); color: #fff; font-size: 16px;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: background .12s;
    }
    .img-preview-close:hover { background: rgba(255,255,255,.24); }
    /* Prev / Next nav */
    .img-preview-nav {
      position: absolute; top: 50%; transform: translateY(-50%);
      width: 44px; height: 44px; border-radius: 50%; border: none;
      background: rgba(255,255,255,.12); color: #fff; font-size: 28px; line-height: 1;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: background .12s; z-index: 201; user-select: none;
    }
    .img-preview-nav:hover { background: rgba(255,255,255,.26); }
    .img-preview-prev { left: 16px; }
    .img-preview-next { right: 16px; }
    /* Bottom bar: filename + counter */
    .img-preview-bar {
      position: absolute; bottom: 0; left: 0; right: 0; z-index: 201;
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
      padding: 10px 20px; background: rgba(0,0,0,.5);
    }
    .img-preview-fname {
      color: rgba(255,255,255,.85); font-size: 12px;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .img-preview-counter { color: rgba(255,255,255,.5); font-size: 11px; white-space: nowrap; }
    @keyframes img-preview-fadein {
      from { opacity: 0; transform: scale(.97); }
      to   { opacity: 1; transform: scale(1); }
    }

    /* ─────────────────────────────────────────────────────────────────────
       PAGES  (non-board routes)
    ───────────────────────────────────────────────────────────────────── */

    /* ── Loading state ── */
    .loading { color: var(--text-muted); font-size: 12px; padding: 40px; text-align: center; letter-spacing: .05em; }

    /* ── Project picker – "/" route ── */
    .project-picker-wrap {
      max-width: 600px; margin: 60px auto; padding: 32px;
      background: var(--col-bg); border: 1px solid var(--col-border); border-radius: 12px;
    }
    .project-picker-wrap h2 { font-size: 18px; font-weight: 600; color: var(--text-title); margin-bottom: 6px; }
    .project-picker-wrap p { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
    .board-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 24px; }
    .board-list-title { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 24px; margin-bottom: 8px; }
    .board-card {
      display: flex; flex-direction: column; gap: 6px;
      padding: 14px 14px 12px; border-radius: 8px;
      background: var(--task-bg); border: 1px solid var(--col-border);
      cursor: pointer; text-decoration: none; color: inherit;
      transition: border-color .15s, box-shadow .15s;
    }
    .board-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
    .board-card-name { font-size: 13px; font-weight: 600; color: var(--text-title); word-break: break-word; }
    .board-card-meta { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

    /* ── Profile page – "/@username" route ── */
    .profile-page { max-width: 680px; margin: 0 auto; padding: 0 8px 80px; }
    .profile-hero {
      padding: 40px 0 24px; border-bottom: 1px solid var(--col-border); margin-bottom: 24px;
      display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
    }
    .profile-fullname { font-size: 26px; font-weight: 600; color: var(--text-title); line-height: 1.2; }
    .profile-username { font-size: 14px; color: var(--text-muted); }
    .profile-stats { display: flex; gap: 20px; font-size: 11px; color: var(--text-muted); }
    .profile-follow-btn {
      padding: 5px 16px; font-size: 11px; border-radius: 20px;
      border: 1px solid var(--input-border); background: transparent; color: var(--text-muted);
    }
    .profile-follow-btn.following { background: #3b82f622; border-color: #3b82f666; color: #60a5fa; }
    .profile-follow-btn:hover { opacity: .8; }
    .profile-project-header {
      font-size: 10px; color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase;
      padding: 10px 0 8px; border-bottom: 1px solid var(--col-border); margin-bottom: 10px; margin-top: 24px;
    }
    .profile-project-header a { color: var(--text-muted); text-decoration: none; }
    .profile-project-header a:hover { color: var(--text); }
    .profile-task-card {
      background: var(--card-bg); border: 1px solid var(--card-border); border-left-width: 3px;
      border-radius: 7px; padding: 10px; margin-bottom: 6px; cursor: default;
    }

    /* ─────────────────────────────────────────────────────────────────────
       RESPONSIVE / MOBILE  (≤ 640px)
       Header and footer collapse to toggle buttons.
       Board switches from horizontal scroll to vertical stack.
       Inputs get font-size 16px so iOS Safari won't zoom on focus.
    ───────────────────────────────────────────────────────────────────── */
    #btn-header-toggle {
      display: none;
      background: transparent; border: 1px solid var(--input-border); border-radius: 4px;
      padding: 3px 8px; font-size: 14px; color: var(--text-muted); cursor: pointer; flex-shrink: 0;
    }
    #btn-controls-close { display: none; }
    .footer-details { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
    #btn-footer-toggle { display: none; }

    @media (max-width: 640px) {
      #header { padding: 0 10px; padding-top: env(safe-area-inset-top); }
      #header.hid { transform: translateY(-100%); }
      #footer.hid { transform: translateY(100%); }
      .header-inner { padding: 5px 0; gap: 8px; flex-wrap: nowrap; }
      .header-inner > div:first-child { flex: 1; min-width: 0; overflow: hidden; }
      #header h1 { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      .header-sub { font-size: 9px; margin-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      #btn-header-toggle { display: flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 32px; }
      #btn-user { display: flex; align-items: center; flex-shrink: 0; min-width: 32px; max-width: 120px; }
      .header-controls { display: none; width: 100%; flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; padding-right: 38px; border-top: 1px solid var(--header-border); position: relative; }
      .header-controls.open { display: flex; }
      #search { flex: 1; min-width: 80px; font-size: 16px; }
      select, input[type="text"] { font-size: 16px; }
      #stats-badge { display: none; }
      #label-pills { padding: 4px 0 6px; }

      #btn-controls-close {
        display: none; position: absolute; top: 8px; right: 0;
        min-width: 32px; min-height: 32px; align-items: center; justify-content: center;
        background: transparent; border-color: var(--input-border); color: var(--text-muted);
      }
      .header-controls.open #btn-controls-close { display: flex; }

      #board { flex-direction: column; overflow-x: hidden; padding: 10px max(10px, env(safe-area-inset-right)) max(56px, calc(env(safe-area-inset-bottom) + 40px)) max(10px, env(safe-area-inset-left)); }
      .kanban-col { flex: none; width: 100%; margin-right: 0; margin-bottom: 10px; max-height: none; }

      #footer { flex-wrap: wrap; gap: 10px; padding: 5px max(10px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
      #btn-footer-toggle { display: flex; align-items: center; gap: 4px; font-size: 10px; margin-left: auto; flex-shrink: 0; }
      .footer-details { display: none; }
      #footer.open .footer-details { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; padding-top: 4px; }
      .footer-hint { display: none; }
    }
