/* Wild Talent — design system
   Desktop: sidebar + dense panes. Mobile: bottom nav + one-thing-at-a-time.
   Reviewing on a phone is a first-class flow, not a fallback. */

:root {
  /* Palette: cool violet-grey neutrals with a raspberry accent. Shared
     with the layout proposal the team chose from. */
  --bg:        #f4f3f7;
  --surface:   #ffffff;
  --surface-2: #eceaf2;
  --surface-3: #e1deea;
  --line:      #dcd9e6;
  --line-soft: #e9e6f0;

  --ink:    #1b1922;
  --ink-2:  #676274;
  --ink-3:  #8f8a9c;

  --accent:    #a81f5a;
  --accent-2:  #f8e4ee;
  --on-accent: #ffffff;
  --ok:        #17734a;
  --ok-bg:     #dff3e8;
  --warn:      #8a5a00;
  --warn-bg:   #fbeed3;
  --bad:       #b0271f;
  --bad-bg:    #fbe5e3;
  --info:      #5b4bb0;
  --info-bg:   #ebe8fa;

  --s-new:    #8f8a9c;
  --s-active: #a81f5a;
  --s-wait:   #8a5a00;
  --s-done:   #17734a;
  --s-dead:   #a9a4b5;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;

  --shadow-1: 0 1px 2px rgba(27,25,34,.06), 0 1px 3px rgba(27,25,34,.05);
  --shadow-2: 0 4px 12px rgba(27,25,34,.09), 0 2px 4px rgba(27,25,34,.05);
  --shadow-3: -12px 0 40px rgba(27,25,34,.16);

  --sidebar-w: 232px;
  --drawer-w: 560px;
  --topbar-h: 56px;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #131118;
    --surface:   #1c1924;
    --surface-2: #262231;
    --surface-3: #312c3f;
    --line:      #353043;
    --line-soft: #2a2636;

    --ink:   #ece9f3;
    --ink-2: #a09aae;
    --ink-3: #7b7589;

    --accent:    #f2709f;
    --accent-2:  #3a1c2b;
    --on-accent: #1d0b14;
    --ok:        #62d39c;
    --ok-bg:     #14301f;
    --warn:      #e3b55c;
    --warn-bg:   #33270f;
    --bad:       #ff8f86;
    --bad-bg:    #361b19;
    --info:      #a79cff;
    --info-bg:   #211d3a;

    --s-new:    #a09aae;
    --s-active: #f2709f;
    --s-wait:   #e3b55c;
    --s-done:   #62d39c;
    --s-dead:   #5f596d;

    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 4px 14px rgba(0,0,0,.45);
    --shadow-3: -14px 0 48px rgba(0,0,0,.55);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14.5px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0; letter-spacing: -.015em; font-weight: 650; }
h2 { font-size: 14px; margin: 22px 0 10px; letter-spacing: .02em;
     text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 620; }
p  { margin: 0 0 10px; }
.muted { color: var(--ink-3); font-size: 13px; }
.sub   { color: var(--ink-2); font-size: 13.5px; margin: 2px 0 0; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side .brand {
  display: flex; align-items: center; gap: 9px;
  padding: 16px 18px 14px; font-weight: 680; letter-spacing: -.02em; font-size: 15px;
}
.side .brand .dot {
  width: 9px; height: 9px; border-radius: 3px; background: var(--accent);
}
.side nav { display: flex; flex-direction: column; gap: 1px; padding: 4px 10px; }
.side nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.side nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.side nav a.on { background: var(--accent-2); color: var(--accent); font-weight: 600; }
.side nav a .ico { width: 17px; text-align: center; opacity: .85; font-size: 14px; }
.side nav a .count {
  margin-left: auto; font-size: 11.5px; font-variant-numeric: tabular-nums;
  background: var(--surface-3); color: var(--ink-2);
  padding: 1px 7px; border-radius: 999px; font-weight: 600;
}
.side nav a.on .count { background: var(--accent); color: var(--on-accent); }
.side .foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line-soft); }
.side .who { font-size: 13px; font-weight: 600; }
.side .role { font-size: 11.5px; color: var(--ink-3); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar .spacer { flex: 1; }
.content { padding: 20px; flex: 1; min-width: 0; }
.content.flush { padding: 0; display: flex; flex-direction: column; min-height: 0; }

/* mode chip */
.mode { font-size: 11px; font-weight: 700; letter-spacing: .04em;
        padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.mode.dry  { background: var(--warn-bg); color: var(--warn); }
.mode.live { background: var(--bad-bg);  color: var(--bad); }

/* ---------------------------------------------------------------- bits */
.card { background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--r); padding: 16px; margin-bottom: 14px;
        box-shadow: var(--shadow-1); }
.card.tight { padding: 0; overflow: hidden; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
         gap: 10px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow-1); }
.tile .n { font-size: 25px; font-weight: 680; letter-spacing: -.025em;
           font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile .k { font-size: 11px; color: var(--ink-3); text-transform: uppercase;
           letter-spacing: .05em; font-weight: 650; margin-top: 2px; }
.tile.alert .n { color: var(--warn); }

.pill { display: inline-flex; align-items: center; gap: 4px;
        font-size: 11.5px; font-weight: 600; padding: 2px 8px;
        border-radius: 999px; background: var(--surface-3); color: var(--ink-2);
        white-space: nowrap; }
.pill.ok   { background: var(--ok-bg);   color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad  { background: var(--bad-bg);  color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.ghost{ background: transparent; border: 1px solid var(--line); }

button, .btn {
  font: inherit; font-size: 13.5px; font-weight: 550; cursor: pointer;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  padding: 7px 13px; display: inline-flex; align-items: center;
  gap: 7px; justify-content: center; line-height: 1.3;
  transition: background .12s, border-color .12s;
}
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover { filter: brightness(1.07); background: var(--accent); }
button.ok   { background: var(--ok-bg);   color: var(--ok);   border-color: transparent; }
button.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
button.bad  { background: var(--bad-bg);  color: var(--bad);  border-color: transparent; }
button.big  { padding: 11px 18px; font-size: 15px; font-weight: 640; }
button.sm   { padding: 4px 9px; font-size: 12.5px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

input, select, textarea {
  font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 7px 9px; max-width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-2); outline-offset: -1px; border-color: var(--accent);
}
textarea { width: 100%; min-height: 140px; font-family: var(--mono);
           font-size: 13px; line-height: 1.55; resize: vertical; }
label { font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
     color: var(--ink-3); font-weight: 650; background: var(--surface-2); }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.banner { border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px;
          margin-bottom: 12px; border: 1px solid transparent; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad  { background: var(--bad-bg);  color: var(--bad); }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner ul { margin: 6px 0 0; padding-left: 18px; }
.banner strong { font-weight: 680; }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty .big { font-size: 15px; color: var(--ink-2); margin-bottom: 6px; font-weight: 550; }

/* ------------------------------------------------------------ mock chip */
/* Anything the system cannot actually do yet. Visible on purpose, so the
   team can see where it will live, and never mistake it for working. */
button.mock, .btn.mock {
  background: repeating-linear-gradient(
    -45deg, var(--surface-2), var(--surface-2) 6px,
    transparent 6px, transparent 12px);
  border: 1px dashed var(--line); color: var(--ink-2);
}
button.mock:hover { border-color: var(--ink-3); }
button.mock::after {
  content: "soon"; font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; background: var(--surface-3); color: var(--ink-3);
  padding: 1px 5px; border-radius: 3px;
}

/* ----------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; background: var(--surface-2);
        border: 1px solid var(--line); border-radius: var(--r);
        padding: 3px; margin-bottom: 14px; overflow-x: auto;
        scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: flex; align-items: center; gap: 7px; white-space: nowrap;
          padding: 7px 13px; border-radius: 7px; font-size: 13.5px;
          font-weight: 560; color: var(--ink-2); }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { background: var(--surface); color: var(--ink); font-weight: 650;
             box-shadow: var(--shadow-1); }
.tabs a .n { font-size: 11.5px; font-variant-numeric: tabular-nums;
             background: var(--surface-3); color: var(--ink-2);
             padding: 1px 7px; border-radius: 999px; font-weight: 650; }
.tabs a.on .n { background: var(--accent); color: var(--on-accent); }

/* -------------------------------------------------- card grid (board) */
.grid-cards { display: grid; gap: 12px;
              grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.gcard { background: var(--surface); border: 1px solid var(--line);
         border-radius: var(--r); overflow: hidden; cursor: pointer;
         box-shadow: var(--shadow-1); transition: border-color .12s, transform .12s; }
.gcard:hover { border-color: var(--accent); transform: translateY(-1px); }
.gcard .face { position: relative; background: var(--surface-3); }
.gcard .face img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.gcard .noface { width: 100%; aspect-ratio: 3/4; display: grid; place-items: center;
                 color: var(--ink-3); font-size: 12px; }
.gcard .more { position: absolute; top: 7px; right: 7px;
               background: rgba(10,13,20,.72); color: #fff; font-size: 11px;
               font-weight: 650; padding: 2px 7px; border-radius: 999px; }
.gcard .fl { position: absolute; left: 6px; bottom: 6px; right: 6px;
             display: flex; gap: 4px; flex-wrap: wrap; }
.gcard .body { padding: 9px 10px 10px; }
.gcard .nm { font-size: 14px; font-weight: 640; line-height: 1.25;
             overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard .meta { font-size: 12px; color: var(--ink-3); margin-top: 2px;
               overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard .foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.gcard .age { margin-left: auto; font-size: 11.5px; font-weight: 650;
              color: var(--ink-3); }
.gcard .age.warn { color: var(--warn); }
.gcard .age.bad  { color: var(--bad); }

/* -------------------------------------------------------------- drawer */
.scrim { position: fixed; inset: 0; background: rgba(10,13,20,.42);
         opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 60; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: var(--drawer-w);
  max-width: 100vw; background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-3); z-index: 70;
  transform: translateX(100%); transition: transform .2s cubic-bezier(.3,.8,.4,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
               padding: 12px 16px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.drawer-foot { flex: 0 0 auto; border-top: 1px solid var(--line);
               padding: 10px 14px; background: var(--surface); }
.drawer .x { margin-left: auto; }

/* --------------------------------------------------------- person panel */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px,1fr));
          gap: 6px; }
.photos a { display: block; }
.photos img { width: 100%; aspect-ratio: 3/4; object-fit: cover;
              border-radius: var(--r-sm); background: var(--surface-3); display: block; }

.kv { display: grid; grid-template-columns: 112px 1fr; gap: 4px 10px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); font-size: 12.5px; }
.kv dd { margin: 0; }

.thread { display: flex; flex-direction: column; gap: 9px; }
.msg { border: 1px solid var(--line); border-radius: var(--r-sm);
       padding: 10px 12px; background: var(--surface-2); }
.msg.out { border-left: 3px solid var(--accent); }
.msg.in  { border-left: 3px solid var(--ok); }
.msg .meta { display: flex; gap: 7px; align-items: center; flex-wrap: wrap;
             font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; }
.msg .subj { font-weight: 620; font-size: 13.5px; margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; margin: 0; }

.actionbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actionbar .grow { flex: 1; min-width: 120px; }

/* checklist used by the document / integration blocks */
.steps { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.steps li { display: flex; gap: 9px; align-items: flex-start;
            padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.steps li:last-child { border-bottom: 0; }
.steps .st { flex: 0 0 16px; height: 16px; border-radius: 99px; margin-top: 1px;
             border: 1.5px solid var(--line); display: grid; place-items: center;
             font-size: 10px; color: var(--ink-3); }
.steps .st.done { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.steps .st.now  { background: var(--accent-2); border-color: transparent; color: var(--accent); }
.steps .lbl { flex: 1; }
.steps .lbl small { display: block; color: var(--ink-3); font-size: 11.5px; }

/* ------------------------------------------------------------- outbox */
.split { display: grid; grid-template-columns: 330px 1fr; flex: 1; min-height: 0; }
.split .list { border-right: 1px solid var(--line); overflow-y: auto;
               background: var(--surface); }
.split .pane { overflow-y: auto; padding: 20px 24px; min-width: 0; }
.row {
  display: block; padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; color: inherit;
}
.row:hover { background: var(--surface-2); text-decoration: none; }
.row.on { background: var(--accent-2); box-shadow: inset 3px 0 0 var(--accent); }
.row .l1 { display: flex; align-items: center; gap: 7px; }
.row .nm { font-weight: 620; font-size: 13.5px; }
.row .when { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.row .l2 { font-size: 12.5px; color: var(--ink-2); margin-top: 2px;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.letter { max-width: 680px; }
.letter .subject { font-size: 18px; font-weight: 650; letter-spacing: -.01em;
                   margin-bottom: 4px; }
.letter .addr { font-size: 12.5px; color: var(--ink-3); margin-bottom: 16px; }
.letter .sheet {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 22px 26px;
  font-size: 14.5px; line-height: 1.68; white-space: pre-wrap;
  box-shadow: var(--shadow-1);
}
.letter textarea { min-height: 320px; font-size: 14px; line-height: 1.68;
                   font-family: var(--sans); padding: 20px 24px; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-sm);
       padding: 2px; gap: 2px; border: 1px solid var(--line); }
.seg a { padding: 5px 11px; border-radius: 5px; font-size: 12.5px;
         color: var(--ink-2); font-weight: 550; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.filters { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------- mobile review */
.mob-review { display: none; }
.kbd { font: 11px var(--mono); background: var(--surface-3); color: var(--ink-2);
       padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }

.mobile-nav { display: none; }

/* ---------------------------------------------------------------- phone */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .content { padding: 14px; padding-bottom: 84px; }
  .content.flush { padding-bottom: 68px; }
  .topbar { padding: 0 14px; }

  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center;
                  gap: 2px; padding: 5px 2px; color: var(--ink-3);
                  font-size: 10.5px; font-weight: 600; }
  .mobile-nav a:hover { text-decoration: none; }
  .mobile-nav a.on { color: var(--accent); }
  .mobile-nav .ico { font-size: 17px; line-height: 1; }

  .drawer { width: 100vw; border-left: 0; }
  .split { grid-template-columns: 1fr; }
  .split .list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .split .pane { padding: 16px; }
  .letter .sheet { padding: 16px; font-size: 15px; }


  .grid-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kv { grid-template-columns: 96px 1fr; }
  .photos { grid-template-columns: repeat(2, 1fr); }
  table { font-size: 13px; }
  th, td { padding: 8px 9px; }

  /* the phone review flow: one person, big photos, thumb-reach buttons */
  .mob-review { display: block; }
  .desk-only { display: none !important; }

  .swipe {
    display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -14px; padding: 0 14px; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .swipe::-webkit-scrollbar { display: none; }
  /* Big enough to judge from, small enough that the facts and the buttons
     are not a scroll away. */
  .swipe img { flex: 0 0 auto; width: 78vw; height: 46vh;
               scroll-snap-align: center; object-fit: cover;
               border-radius: var(--r); background: var(--surface-3); }
  .dots { display: flex; gap: 5px; justify-content: center; margin-top: 8px; }
  .dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--surface-3); }
  .dots i.on { background: var(--accent); }

  /* The decide buttons follow you down the page instead of hiding at the
     bottom of it. Thumb reach is the whole point on a phone. */
  [data-decide-form] {
    position: sticky; z-index: 45;
    background: var(--surface);
    margin: 14px -14px 0; padding: 10px 14px;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 20px rgba(0,0,0,.14);
  }
  .content [data-decide-form] { bottom: 58px; }
  .drawer-body [data-decide-form] {
    bottom: 0; margin: 14px -16px 0; padding: 10px 16px
      calc(10px + env(safe-area-inset-bottom));
  }
  [data-decide-form] .big { padding: 14px 6px; font-size: 15px; }
  /* the reason + note row only matters once reject has been tapped, and
     the keyboard hints mean nothing on a phone */
  [data-decide-form] .reason-row { display: none; }
  [data-decide-form].show-reason .reason-row { display: flex; }
  [data-decide-form] p { display: none; }
}

@media (min-width: 861px) {
  .mob-only { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* desktop keeps the reason row visible beside the buttons */
@media (min-width: 861px) {
  .reason-row { display: flex; gap: 6px; flex-wrap: wrap; }
}


/* ====================================================================
   Layout v2 — inbox for the day's work, table and board for everyone,
   and a person record with the next step on top.
   ==================================================================== */

/* progress marks: one per requirement, on every row and card */
.marks { display: inline-flex; gap: 2px; flex: 0 0 auto; }
.marks i { width: 6px; height: 12px; border-radius: 2px; background: var(--surface-3); display: block; }
.marks i.y { background: var(--ok); }

.av { width: 34px; height: 44px; border-radius: 5px; object-fit: cover;
      background: var(--surface-3); display: block; flex: 0 0 auto; }
.av.none { border: 1px dashed var(--line); }
.pill.acc { background: var(--accent-2); color: var(--accent); }

/* ------------------------------------------------------------- inbox */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr);
         grid-template-rows: minmax(0, 1fr); overflow: hidden;
         flex: 1; min-height: 0; height: calc(100vh - var(--topbar-h)); }
.inbox-list { overflow-y: auto; border-right: 1px solid var(--line);
              background: var(--surface); }
.group-label { display: flex; align-items: center; gap: 8px;
               padding: 12px 14px 6px; position: sticky; top: 0;
               background: var(--surface); z-index: 2; }
.group-label .n { font-size: 11.5px; color: var(--ink-3); font-weight: 650; }
.irow { display: flex; align-items: center; gap: 10px; padding: 8px 14px;
        border-bottom: 1px solid var(--line-soft); color: inherit; cursor: pointer; }
.irow:hover { background: var(--surface-2); text-decoration: none; }
.irow.on { background: var(--accent-2); box-shadow: inset 3px 0 0 var(--accent); }
.irow .txt { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.irow .nm { font-weight: 620; font-size: 13.5px; white-space: nowrap;
            overflow: hidden; text-overflow: ellipsis; }
.irow .why { font-size: 12px; color: var(--ink-3); white-space: nowrap;
             overflow: hidden; text-overflow: ellipsis; }
.irow.more { justify-content: center; color: var(--accent); font-size: 13px;
             font-weight: 600; padding: 14px; }
.irow.gone { opacity: 0; height: 0; padding-block: 0; border: 0; overflow: hidden;
             transition: opacity .15s, height .2s, padding .2s; }

/* the panel: beside the list on a desktop, over it on a phone */
@media (min-width: 861px) {
  .drawer.pane { position: static; transform: none; width: auto; height: 100%;
                 min-height: 0;
                 border-left: 0; box-shadow: none; z-index: auto; min-width: 0;
                 background: var(--bg); overflow: hidden; }
  .drawer.pane .drawer-body { padding: 20px 26px 0; max-width: 820px; }
}

/* ------------------------------------------------------------- table */
.ptable tr[data-person] { cursor: pointer; }
.ptable tr.on td { background: var(--accent-2); }
.ptable td { vertical-align: middle; }
.ptable strong { margin-right: 6px; }

/* ------------------------------------------------------------- board */
.phases { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px;
          align-items: start; }
.phase { background: var(--surface-2); border: 1px solid var(--line-soft);
         border-radius: var(--r); min-width: 0; }
.phase > header { display: flex; justify-content: space-between; align-items: center;
                  padding: 10px 12px; font-size: 12px; font-weight: 680;
                  letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.phase > header .n { background: var(--surface); border: 1px solid var(--line);
                     border-radius: 999px; padding: 1px 8px; font-size: 11.5px;
                     letter-spacing: 0; color: var(--ink); }
.phase .stack { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 8px; }
.pcard { display: flex; gap: 9px; align-items: center; background: var(--surface);
         border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px;
         cursor: pointer; box-shadow: var(--shadow-1); min-width: 0; }
.pcard:hover, .pcard.on { border-color: var(--accent); }
.pcard img, .pcard .noimg { width: 38px; height: 50px; border-radius: 5px; object-fit: cover;
                            background: var(--surface-3); flex: 0 0 auto; display: block; }
.pcard .t { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pcard .nm { font-size: 13px; font-weight: 630; white-space: nowrap; overflow: hidden;
             text-overflow: ellipsis; }
.pcard .meta { font-size: 11.5px; color: var(--ink-3); white-space: nowrap;
               overflow: hidden; text-overflow: ellipsis; }
.col-more { display: block; text-align: center; font-size: 12px; padding: 8px 4px;
            color: var(--accent); font-weight: 600; }

/* ------------------------------------------------------------ record */
.record { display: flex; flex-direction: column; gap: 14px; }
.rec-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.rec-head h1 { font-size: 21px; }
.rec-pills { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.record .banner { margin: 0; }

.next { background: var(--surface); border: 1px solid var(--line);
        border-left: 3px solid var(--accent); border-radius: var(--r);
        padding: 14px 16px; box-shadow: var(--shadow-1); }
.next h2 { margin: 0 0 8px; }
.next p { margin: 0 0 8px; }
.next .needs { margin: 0 0 8px; padding-left: 18px; font-size: 13.5px; }
.next .big { width: 100%; }
details.inline { margin-top: 10px; }
details.inline summary { cursor: pointer; font-size: 12.5px; color: var(--ink-3); }

details.sec { background: var(--surface); border: 1px solid var(--line);
              border-radius: var(--r); padding: 0 16px; }
details.sec > summary { cursor: pointer; padding: 13px 0; font-weight: 650;
                        font-size: 14px; list-style: none; display: flex;
                        align-items: center; gap: 8px; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::before { content: "▸"; color: var(--ink-3); font-size: 11px;
                                transition: transform .12s; }
details.sec[open] > summary::before { transform: rotate(90deg); }
details.sec > summary .n { margin-left: auto; font-size: 12px; font-weight: 600;
                           color: var(--ink-3); }
details.sec[open] { padding-bottom: 16px; }
details.sec h3 { font-size: 12px; letter-spacing: .05em; text-transform: uppercase;
                 color: var(--ink-3); }
.quote { margin: 12px 0 0; padding: 10px 12px; background: var(--surface-2);
         border-radius: var(--r-sm); font-size: 13.5px; }
.subform { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }

/* the decide bar stays in reach on every screen size */
[data-decide-form] { position: sticky; bottom: 0; z-index: 45; background: var(--surface);
                     border: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0;
                     padding: 10px 12px; box-shadow: 0 -8px 20px rgba(0,0,0,.10);
                     margin: 0; }
.decide-row { display: flex; gap: 6px; }
.decide-row button { flex: 1; }
.reason-row { margin-top: 8px; }

@media (max-width: 860px) {
  .inbox { display: block; height: auto; overflow: visible; }
  .inbox-list { border-right: 0; }
  .phases { display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
            margin: 0 -14px; padding: 0 14px 8px; }
  .phase { flex: 0 0 78vw; scroll-snap-align: center; }
  .rec-pills { margin-left: 0; }
  [data-decide-form] { border-radius: 0; border-inline: 0; }
  .ptable th, .ptable td { padding: 8px 8px; }
}


/* internal notes: ours, not theirs */
.notes { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.note { background: var(--warn-bg); border-radius: var(--r-sm); padding: 9px 12px; }
.note .meta { font-size: 11.5px; color: var(--warn); font-weight: 600; margin-bottom: 3px; }
.note .body { margin: 0; white-space: pre-wrap; font-size: 13.5px; color: var(--ink); }


/* how long someone has sat at their current step */
.wait { font-size: 12px; font-weight: 650; color: var(--ink-3);
        font-variant-numeric: tabular-nums; }
.wait.warn { color: var(--warn); }
.wait.bad { color: var(--bad); }
@media (max-width: 860px) { .mobile-nav a { font-size: 9.5px; } }


/* ====================================================================
   Type: a display face for names and headings, a plain one for reading
   ==================================================================== */
h1, .side .brand, .rec-head h1, .tile .n, .letter .subject, .empty .big {
  font-family: var(--display);
}
h1 { font-weight: 700; letter-spacing: -.02em; }
.side .brand { font-size: 16px; font-weight: 700; }
.side .brand .dot { border-radius: 99px; }
.topbar h1 { font-size: 21px; }
.tile .n { font-weight: 700; }

/* a little more presence for the things people act on */
.side nav a.on { box-shadow: inset 3px 0 0 var(--accent); }
.next { border-left-width: 4px; }
button.primary:hover { filter: brightness(1.08); }
a.btn[style*="background:var(--accent)"] { color: var(--on-accent) !important; }


/* ============================================= standouts and ratings */
.star { color: var(--warn); }
.standout { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
            background: var(--surface); border: 1px dashed var(--line);
            border-radius: var(--r); padding: 10px 12px; }
.standout.on { background: var(--warn-bg); border: 1px solid transparent;
               justify-content: space-between; }
.standout.on strong { color: var(--warn); }
.standout .why { font-size: 13.5px; margin-top: 2px; }

.rate-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0;
            border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.rate-row:first-of-type { border-top: 0; padding-top: 0; }
.rate-row .what { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.rate-row small { color: var(--ink-3); font-size: 12px; }
.rate-row small.suggest { color: var(--info); }
.rate-row .score { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.stars { display: flex; gap: 2px; margin: 0; }
.stars button { border: 0; background: transparent; padding: 2px 3px; font-size: 22px;
                line-height: 1; color: var(--surface-3); cursor: pointer; }
.stars button.y { color: var(--warn); }
.stars button:hover, .stars button:focus-visible { color: var(--warn); background: transparent; }
@media (max-width: 860px) {
  .rate-row .score { align-items: flex-start; }
  .stars button { font-size: 28px; padding: 2px 5px; }
}
