/* Reused from well.software project board. */

  /* page-specific only — the shell owns .topbar/.sidebar/.nav-item */
  :root{ --panel:#fff; --line:#e2ded6; --muted:#6b6b6b;
         /* status colours are the house paint codes */
         --c-download:#F7C600; --c-downloaded:#8A97A3; --c-progress:#45BCE2;
         --c-qc:#D40000; --c-ready:#1C8051; }
  .content{ padding:18px 22px 60px; text-transform:none; }
  a{ color:inherit; text-decoration:none; }

  .head{ display:flex; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:16px; }
  .breadcrumb{ font-size:12px; color:var(--muted); margin-bottom:4px; }
  .breadcrumb a:hover{ text-decoration:underline; }
  h1.title{ font-size:22px; margin:0; font-weight:700; }
  .subtitle{ font-size:13px; color:var(--muted); margin-top:3px; }
  .head-actions{ margin-left:auto; display:flex; gap:8px; align-items:center; }
  .btn{
    font:inherit; font-size:13px; padding:7px 13px; border-radius:7px; cursor:pointer;
    background:#fff; border:1px solid rgba(0,0,0,0.18); color:inherit;
  }
  .btn:hover{ border-color:rgba(0,0,0,0.4); }
  .btn.primary{ background:#1a1a1a; color:#f4f3f1; border-color:#1a1a1a; }
  .btn.primary:hover{ background:#000; }

  /* ── status tiles double as filters ─────────────────────────────────── */
  .tiles{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px; margin-bottom:16px; }
  .tile{
    background:var(--panel); border:1px solid rgba(0,0,0,0.10); border-left:5px solid var(--tc,#ccc);
    border-radius:9px; padding:12px 14px; cursor:pointer; transition:border-color .15s, box-shadow .15s;
  }
  .tile:hover{ box-shadow:0 2px 10px rgba(0,0,0,0.07); }
  .tile.on{ border-color:rgba(0,0,0,0.45); border-left-color:var(--tc,#ccc); box-shadow:0 2px 10px rgba(0,0,0,0.08); }
  .tile-n{ font-size:24px; font-weight:700; line-height:1; }
  .tile-l{ font-size:12px; color:var(--muted); margin-top:5px; }

  .toolbar{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:14px; }
  .toolbar label{ font-size:13px; color:var(--muted); display:flex; align-items:center; gap:6px; cursor:pointer; }

  /* ── one bucket ─────────────────────────────────────────────────────── */
  .bucket{ margin-bottom:26px; }
  .bucket-head{
    display:flex; align-items:center; gap:9px; margin:0 0 9px;
    font-size:14px; font-weight:700; letter-spacing:.01em;
  }
  .dot{ width:10px; height:10px; border-radius:50%; background:var(--tc,#ccc); flex-shrink:0; }
  .bucket-n{ font-weight:400; color:var(--muted); font-size:12px; }
  .bucket-empty{ font-size:13px; color:#9a958c; padding:10px 2px 0; }

  .row{
    background:var(--panel); border:1px solid rgba(0,0,0,0.10); border-left:5px solid var(--tc,#ccc);
    border-radius:9px; margin-bottom:8px;
  }
  .row-main{
    display:grid; align-items:center; gap:14px; padding:11px 16px;
    /* every row the same height whatever bucket it is in — the taller cells
       (progress bar + continue, chips + build runsheet) lay out inline rather
       than stacking, and this floor keeps the sparse rows level with them */
    min-height:66px;
    /* minmax(0, …) so the row shrinks with the window instead of overflowing
       it — see the sizing contract in LAYOUT.md */
    /* The section column is sized to hold "05-11N-63W CO ☆ 💬" without
       truncating — a section number cut to "17-12N…" is the one thing on this
       row nobody can afford to lose. minmax(0, …) still lets it shrink rather
       than overflow when the window is small. */
    grid-template-columns: minmax(0,200px) minmax(0,1.4fr) minmax(0,.85fr)
                           minmax(0,1.35fr) minmax(0,150px) 26px;
  }
  /* A cell clips its own content rather than spilling into its neighbour —
     this is what stopped "build runsheet" landing on top of "continue". The
     people cell is left out on purpose: the claim menu is positioned inside it
     and overflow:hidden would cut the menu off. */
  .cell-sec, .cell-meta, .cell-prog, .cell-status{ min-width:0; overflow:hidden; }
  .cell-people{ min-width:0; }
  /* The name is the only part allowed to shrink; the state badge, star and
     comment icon never do, so a long section name truncates instead of pushing
     them over the coverage text in the next column. */
  .sec-title{ display:flex; align-items:center; min-width:0; }
  .sec-name{
    font-size:15px; font-weight:700; min-width:0;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  .sec-title > .sec-state, .sec-title > .star, .sec-title > .cmt{ flex:0 0 auto; }
  .sec-state{
    display:inline-block; margin-left:7px; padding:2px 6px; border-radius:4px;
    font-size:10px; font-weight:700; letter-spacing:.04em; vertical-align:2px;
  }
  .sec-state-wy{ background:#e6f0f6; color:#2b5f7d; }
  .sec-state-co{ background:#f2ece2; color:#7a5a2e; }
  .sec-sub{ font-size:11px; color:var(--muted); margin-top:2px; }
  /* name + state + star + comments stay on one line — the star wrapping under
     the section number read like a second field */
  .sec-title{ white-space:nowrap; gap:0; }
  .star{
    background:none; border:0; cursor:pointer; font-size:14px; line-height:1;
    color:#cfc9bd; padding:0 0 0 4px;
  }
  .star.on{ color:#F7C600; }
  .star:hover{ color:#b9a86a; }
  /* comments: outline when read, filled red when there is something unread */
  .cmt{
    background:none; border:0; cursor:pointer; padding:0 0 0 5px; line-height:1;
    display:inline-flex; align-items:center; gap:2px; vertical-align:-2px;
  }
  .cmt svg{ width:14px; height:14px; fill:none; stroke:#b8b2a7; }
  .cmt.has svg{ stroke:#6b6b6b; }
  .cmt.unread svg{ stroke:var(--c-qc); fill:var(--c-qc); }
  .cmt:hover svg{ stroke:#1a1a1a; }
  .cmt.unread:hover svg{ stroke:var(--c-qc); }
  .cmt-n{ font-size:10px; color:var(--muted); }
  .cmt.unread .cmt-n{ color:var(--c-qc); font-weight:700; }
  .row.is-priority .sec-name{ text-decoration-color:#F7C600; }
  .cov{ font-size:12px; color:#555; }
  /* one line, ellipsised — the full text is in the tooltip and the drawer */
  .hold{
    font-size:12px; color:var(--muted); margin-top:2px;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }

  .prog-bar{ height:5px; border-radius:3px; background:#ececea; overflow:hidden; }
  .prog-fill{ height:100%; background:var(--c-ready); }
  .prog-txt{
    font-size:11px; color:var(--muted); margin-top:4px;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .prog-none{ font-size:12px; color:#9a958c; }
  /* max-width so the label can never run out of its column and sit under the
     buttons in the next one — it truncates, and the tooltip carries the rest */
  .continue{
    display:inline-block; max-width:100%; margin-top:5px; padding:3px 9px;
    border-radius:6px; font-size:11px; font-weight:700;
    background:var(--c-progress); color:#08384a; border:1px solid rgba(0,0,0,0.10);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; vertical-align:bottom;
  }
  .continue:hover{ filter:brightness(1.06); }

  /* ── claims ─────────────────────────────────────────────────────────── */
  .claims{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
  .chip{
    display:inline-flex; align-items:center; gap:5px; padding:3px 8px; border-radius:20px;
    background:#f1efec; border:1px solid rgba(0,0,0,0.08); font-size:12px; white-space:nowrap;
  }
  .chip.mine{ background:#e6f5ee; border-color:#bfe0d0; }
  /* someone who has actually worked the section but never claimed it — a fact
     off the review log rather than a statement of intent, so it reads quieter */
  .chip.worked{ background:#fff; border-style:dashed; }
  .chip .task{ color:var(--muted); }
  .chip .when{ color:#a8a49c; font-size:11px; }
  .chip .x{ cursor:pointer; color:#999; font-size:13px; line-height:1; }
  .chip .x:hover{ color:var(--c-qc); }
  .chip-none{ font-size:12px; color:#a8a49c; }
  .claim-wrap{ position:relative; display:inline-block; }
  .claim-btn{
    font:inherit; font-size:12px; padding:4px 9px; border-radius:20px; cursor:pointer;
    background:#fff; border:1px dashed rgba(0,0,0,0.28); color:#444;
  }
  .claim-btn:hover{ border-style:solid; border-color:rgba(0,0,0,0.5); }
  .claim-btn.compact{ padding:3px 8px; font-weight:700; line-height:1.1; }
  .menu{
    position:absolute; z-index:30; top:calc(100% + 5px); left:0; min-width:150px;
    background:#fff; border:1px solid rgba(0,0,0,0.16); border-radius:8px;
    box-shadow:0 6px 20px rgba(0,0,0,0.13); padding:5px; display:none;
  }
  .menu.open{ display:block; }
  .menu button{
    display:block; width:100%; text-align:left; font:inherit; font-size:13px;
    padding:7px 9px; border:0; background:none; border-radius:6px; cursor:pointer;
  }
  .menu button:hover{ background:#f1efec; }
  .menu-sep{ height:1px; background:var(--line); margin:4px 2px; }

  /* build runsheet — in the chip row, so it costs the card no extra height */
  .runsheet-btn{
    font:inherit; font-size:11px; font-weight:700; padding:4px 10px; border-radius:20px;
    cursor:pointer; background:#1a1a1a; color:#f4f3f1; border:1px solid #1a1a1a;
    white-space:nowrap;
  }
  .runsheet-btn:hover{ background:#000; }
  .runsheet-btn[disabled]{ opacity:.55; cursor:progress; }

  select.status{
    font:inherit; font-size:12px; padding:6px 8px; border-radius:7px; width:100%;
    border:1px solid rgba(0,0,0,0.18); background:#fff; cursor:pointer;
  }
  /* a status nobody has set by hand reads lighter, rather than carrying a
     caption that makes its row taller than the others */
  select.status.is-auto{ color:#8a857c; font-style:italic; }

  .expand{ background:none; border:0; cursor:pointer; font-size:18px; color:#bbb; padding:0; }
  .expand:hover{ color:#666; }

  /* ── the expanded drawer: note + tool deep links ────────────────────── */
  .drawer{ display:none; border-top:1px solid var(--line); padding:14px 16px 16px; }
  .row.open .drawer{ display:block; }
  .drawer-note{ display:flex; gap:8px; align-items:center; margin-bottom:14px; }
  .drawer-note input{
    flex:1; font:inherit; font-size:13px; padding:7px 10px; border-radius:7px;
    border:1px solid rgba(0,0,0,0.18); background:#fff;
  }
  .note-meta{ font-size:11px; color:#a8a49c; white-space:nowrap; }
  .note-preview{ color:#6b6b6b; font-style:italic; }
  .run-block{ margin-bottom:14px; }
  .run-head{ font-size:12px; font-weight:700; margin-bottom:7px; }
  .run-count{ font-weight:400; color:var(--muted); }
  .tool-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:8px; }
  .tool-btn{
    display:flex; flex-direction:column; gap:2px; padding:10px 12px; border-radius:8px;
    background:#fff; border:1px solid rgba(0,0,0,0.12);
  }
  .tool-btn:hover{ border-color:rgba(0,0,0,0.4); }
  .tool-btn-name{ font-size:13px; font-weight:700; }
  .tool-btn-meta{ font-size:11px; color:var(--muted); }
  .tool-btn.is-off{ background:#f6f6f5; border-style:dashed; opacity:.55; }
  .no-data{ font-size:12px; color:#7a6a3a; background:#fbf6e8; border:1px solid #ecdcae;
            border-radius:7px; padding:9px 12px; }

  /* ── the comment thread, in the drawer ──────────────────────────────── */
  .cmt-block{ margin-top:14px; border-top:1px solid var(--line); padding-top:12px; }
  .cmt-head{ font-size:12px; font-weight:700; margin-bottom:8px; }
  .cmt-item{ font-size:12px; padding:6px 0; border-bottom:1px solid #f2efe9; }
  .cmt-who{ font-weight:700; }
  .cmt-when{ color:#a8a49c; font-size:11px; margin-left:5px; }
  .cmt-del{ cursor:pointer; color:#c4bfb4; margin-left:6px; }
  .cmt-del:hover{ color:var(--c-qc); }
  .cmt-body{ color:#333; margin-top:2px; white-space:pre-wrap; }
  .cmt-empty, .cmt-loading{ font-size:12px; color:#a8a49c; padding:2px 0 6px; }
  .cmt-new{ display:flex; gap:8px; margin-top:10px; }
  .cmt-new input{
    flex:1; min-width:0; font:inherit; font-size:13px; padding:7px 10px;
    border-radius:7px; border:1px solid rgba(0,0,0,0.18); background:#fff;
  }

  /* ── activity ───────────────────────────────────────────────────────── */
  .activity{ margin-top:10px; border-top:1px solid var(--line); padding-top:14px; }
  .activity h2{ font-size:14px; margin:0 0 9px; }
  .ev{ font-size:12px; color:#555; padding:3px 0; }
  .ev .who{ font-weight:700; color:#1a1a1a; }
  .ev .when{ color:#a8a49c; }

  .msg{ font-size:13px; color:var(--muted); padding:20px 0; }

  /* Six columns stop being readable well before they stop fitting — fold to two
     columns, then one, at the same type sizes. The cells are placed explicitly:
     letting them reflow on their own dropped the progress bar into the 26px
     chevron column and stretched every row to the height of a paragraph. */
  @media (max-width: 1250px){
    .row-main{ grid-template-columns:minmax(0,1fr) minmax(0,1fr) 26px; row-gap:12px; align-items:start; }
    .cell-sec   { grid-column:1/2; grid-row:1; }
    .cell-meta  { grid-column:2/3; grid-row:1; }
    .cell-prog  { grid-column:1/2; grid-row:2; }
    .cell-people{ grid-column:2/3; grid-row:2; }
    .cell-status{ grid-column:1/2; grid-row:3; }
    .row-main > .expand{ grid-column:3/4; grid-row:1/4; justify-self:end; }
  }
  @media (max-width: 640px){
    .row-main{ grid-template-columns:minmax(0,1fr) 26px; }
    .cell-sec, .cell-meta, .cell-prog, .cell-people, .cell-status{ grid-column:1/2; }
    .cell-meta{ grid-row:2; } .cell-prog{ grid-row:3; }
    .cell-people{ grid-row:4; } .cell-status{ grid-row:5; }
    .row-main > .expand{ grid-column:2/3; grid-row:1/6; }
  }
