/* WSA Call Board. Same direction as the portal designs (designs/README.md): navy ink on
   paper, the navy marks the one action and the selection, figures in IBM Plex Mono.
   Signature: the readiness ledger, three marks per call (CV, reached, Chase).
   Unslop pass by Claude, following unslop by Damir Sokolovsky (@heydamir), CC BY 4.0. */

:root {
  --page: #f5f6f8;
  --card: #ffffff;
  --raised: #eef0f3;
  --text: #121722;
  --text-2: #4a5263;
  --text-3: #687083;
  --line: rgba(18, 23, 34, 0.08);
  --line-2: rgba(18, 23, 34, 0.14);
  --accent: #142a6b;
  --accent-hover: #0e2058;
  --accent-ink: #ffffff;
  --accent-text: #142a6b;
  --accent-soft: rgba(20, 42, 107, 0.07);
  --good: #15803d;
  --watch: #b45309;
  --bad: #c62828;
  --watch-soft: rgba(180, 83, 9, 0.08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0b0d14;
    --card: #11141c;
    --raised: #1a1e28;
    --text: #eef0f5;
    --text-2: #a3a9b8;
    --text-3: #8a91a3;
    --line: rgba(238, 240, 245, 0.08);
    --line-2: rgba(238, 240, 245, 0.14);
    --accent: #c9d6f2;
    --accent-hover: #dde6f8;
    --accent-ink: #0a1830;
    --accent-text: #a9c1ea;
    --accent-soft: rgba(169, 193, 234, 0.1);
    --good: #4cc38a;
    --watch: #e9be6a;
    --bad: #e5484d;
    --watch-soft: rgba(233, 190, 106, 0.1);
    --shadow-sm: none;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .lockup { filter: invert(1) hue-rotate(180deg) brightness(1.15); }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--text); font: 400 14px/20px var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.sec { color: var(--text-2); }
.icon { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }
.link { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.link:hover { text-decoration-color: currentColor; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease), transform 120ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--card); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--raised); }
.btn-ghost { background: transparent; color: var(--text-2); padding: 0 12px; }
.btn-ghost:hover:not(:disabled) { background: var(--raised); color: var(--text); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.icon-btn { width: 32px; padding: 0; }

.loading { margin: 0; min-height: 100vh; display: grid; place-items: center; color: var(--text-3); font-size: 13px; }

/* ------------------------------------------------------------ sign-in gate */
.gate-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow-sm); }
.gate .lockup { display: block; height: auto; margin-bottom: 32px; }
.gate h1 { font-size: 24px; line-height: 32px; font-weight: 500; margin: 0 0 8px; }
.gate p { margin: 0 0 24px; }
.gate form { display: grid; gap: 12px; }
.gate label { font-size: 13px; color: var(--text-2); }
.gate input[type="email"] {
  height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card);
  transition: border-color 140ms var(--ease);
}
.gate input[type="email"]:focus { outline: none; border-color: var(--accent-text); }
.gate .btn { height: 40px; }
.gate .note { margin: 16px 0 0; font-size: 13px; color: var(--text-2); }
.gate .note.bad { color: var(--bad); }

/* ------------------------------------------------------------ top bar */
.top { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1440px; margin: 0 auto; height: 56px; padding: 0 32px; display: flex; align-items: center; gap: 16px; }
.top .lockup { height: 28px; width: auto; display: block; }
.top .product { font-weight: 500; padding-left: 16px; border-left: 1px solid var(--line-2); }
.top .grow { flex: 1; }
.top .fresh { font-size: 13px; color: var(--text-3); }
.top .who { font-size: 13px; color: var(--text-2); }

/* ------------------------------------------------------------ page */
.wrap { max-width: 1440px; margin: 0 auto; padding: 32px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; color: var(--text-3); margin-bottom: 4px; }
h1.title { font-size: 28px; line-height: 36px; font-weight: 500; margin: 0; }
.problems { margin: 0 0 24px; padding: 12px 16px; border-radius: 10px; background: var(--watch-soft); color: var(--text-2); font-size: 13px; }
.problems p { margin: 0; }
.problems p + p { margin-top: 4px; }

/* the three counts */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  text-align: left; cursor: pointer; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px; box-shadow: var(--shadow-sm);
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
}
.stat:hover { border-color: var(--line-2); }
.stat[aria-pressed="true"] { border-color: var(--accent-text); background: var(--accent-soft); }
.stat .label { font-size: 13px; color: var(--text-2); }
.stat .fig { font: 500 28px/36px var(--mono); font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat .fig.zero { color: var(--text-3); }
.stat .hint { font-size: 12px; line-height: 16px; color: var(--text-3); margin-top: 4px; }

/* week strip */
.week { display: flex; align-items: stretch; gap: 8px; margin-bottom: 16px; }
.days { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; background: var(--raised); padding: 4px; border-radius: 12px; }
.day {
  display: grid; gap: 2px; padding: 8px 12px; border-radius: 8px; border: 0; background: transparent; text-align: left; cursor: pointer;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.day:hover:not(:disabled) { background: var(--card); }
.day:disabled { cursor: default; opacity: 0.45; }
.day .d { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.day .n { font: 400 12px/16px var(--mono); color: var(--text-3); white-space: nowrap; }
.day .flag { width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
.day.today .d { color: var(--accent-text); font-weight: 500; }
.day[aria-pressed="true"] { background: var(--card); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.day[aria-pressed="true"] .d { color: var(--text); }
.week-nav { display: flex; flex-direction: column; justify-content: center; gap: 4px; }

/* filter row */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--raised); border-radius: 10px; }
.seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 500; transition: background-color 140ms var(--ease), color 140ms var(--ease); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button { padding: 10px 0; border: 0; background: none; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tabs button[aria-pressed="true"] { color: var(--text); border-color: var(--accent-text); }
.tabs .n { font: 400 12px/16px var(--mono); color: var(--text-3); margin-left: 4px; }
.filter-note { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------ call cards */
.list { display: grid; gap: 12px; }
.group-label { font-size: 13px; color: var(--text-3); margin: 12px 0 0; }
.group-label:first-child { margin-top: 0; }
.call {
  display: grid; grid-template-columns: 104px minmax(0, 1fr); background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
  animation: rise 360ms var(--ease) both;
}
.call.past { background: transparent; box-shadow: none; }
.call.past .when .t { color: var(--text-2); }
.when { padding: 20px 0 20px 20px; display: flex; flex-direction: column; gap: 4px; }
.when .t { font: 500 15px/20px var(--mono); font-variant-numeric: tabular-nums; }
.when .len { font: 400 12px/16px var(--mono); color: var(--text-3); }

/* the readiness ledger: CV, reached, Chase */
.ledger { display: flex; gap: 3px; margin-top: 12px; }
.ledger i { width: 6px; height: 16px; border-radius: 2px; background: var(--line-2); }
.ledger i.on { background: var(--accent-text); }
.ledger i.part { background: var(--watch); }
.ledger i.no { background: var(--bad); }
.ledger-n { font: 400 12px/16px var(--mono); color: var(--text-3); }

.body { padding: 20px 20px 20px 0; min-width: 0; }
.who-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.who-line h3 { font-size: 16px; line-height: 24px; font-weight: 500; margin: 0; }
.meta { font-size: 13px; color: var(--text-3); }
.tag { font-size: 12px; line-height: 16px; color: var(--text-2); padding: 2px 6px; border-radius: 4px; background: var(--raised); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex: none; }
.status.good::before { background: var(--good); }
.status.watch::before { background: var(--watch); }
.status.bad::before { background: var(--bad); }
.facts { display: grid; gap: 6px; margin-top: 12px; }
.fact { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); min-width: 0; }
.fact .sep { color: var(--text-3); }
.points { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.points li { position: relative; padding-left: 16px; color: var(--text); }
.points li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); }
.no-notes { margin: 16px 0 0; color: var(--text-3); font-size: 13px; }
details.notes { margin-top: 8px; }
details.notes summary { cursor: pointer; font-size: 13px; color: var(--text-2); list-style: none; display: inline-flex; align-items: center; gap: 4px; }
details.notes summary::-webkit-details-marker { display: none; }
details.notes summary .icon { width: 14px; height: 14px; transition: transform 160ms var(--ease); }
details.notes[open] summary .icon { transform: rotate(90deg); }
.note-list { margin-top: 8px; display: grid; gap: 12px; padding: 12px 16px; border-radius: 10px; background: var(--raised); }
.note-list .nh { font: 400 12px/16px var(--mono); color: var(--text-3); margin-bottom: 2px; }
.note-list .nt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: var(--text); }

.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.links { display: flex; gap: 4px; flex-wrap: wrap; }
.links a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; font-size: 13px; color: var(--text-2); text-decoration: none; transition: background-color 140ms var(--ease), color 140ms var(--ease); }
.links a:hover { background: var(--raised); color: var(--text); }
.links a .icon { width: 14px; height: 14px; }
.chase { display: flex; align-items: center; gap: 12px; }
.chase .said { font-size: 13px; color: var(--text-2); }
.vote { display: inline-flex; padding: 2px; gap: 2px; background: var(--raised); border-radius: 10px; }
.vote button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 500; transition: background-color 140ms var(--ease), color 140ms var(--ease); }
.vote button:hover:not(:disabled) { color: var(--text); }
.vote button:disabled { cursor: default; }
.vote button[aria-pressed="true"].yes { background: var(--accent); color: var(--accent-ink); }
.vote button[aria-pressed="true"].no { background: var(--card); color: var(--bad); box-shadow: inset 0 0 0 1px var(--line-2); }

.empty { padding: 48px 24px; text-align: center; color: var(--text-2); background: var(--card); border: 1px dashed var(--line-2); border-radius: 14px; }
.empty b { display: block; color: var(--text); font-weight: 500; margin-bottom: 4px; }

/* ------------------------------------------------------------ CV uploads */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 400; font-size: 12px; line-height: 16px; color: var(--text-3); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.links-cell { text-align: right; white-space: nowrap; }
.table .sub { font-size: 12px; line-height: 16px; color: var(--text-3); }

.list > :nth-child(2) { animation-delay: 40ms; }
.list > :nth-child(3) { animation-delay: 80ms; }
.list > :nth-child(4) { animation-delay: 120ms; }
.list > :nth-child(5) { animation-delay: 160ms; }
.list > :nth-child(n + 6) { animation-delay: 200ms; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .call { animation: none; } * { transition: none !important; } }

/* ------------------------------------------------------------ small screens */
@media (max-width: 900px) {
  .top-in { padding: 0 16px; gap: 12px; }
  .top .product, .top .fresh-label, .top .who { display: none; }
  .wrap { padding: 24px 16px; }
  .stats { grid-template-columns: 1fr; gap: 8px; }
  .stat { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 16px; }
  .stat .fig { margin: 0; font-size: 22px; line-height: 28px; }
  .stat .hint { display: none; }
  .days { display: flex; overflow-x: auto; scrollbar-width: none; }
  .day { flex: 0 0 auto; min-width: 84px; }
  .call { grid-template-columns: 1fr; }
  .when { padding: 16px 16px 0; flex-direction: row; align-items: center; gap: 12px; }
  .ledger { margin: 0 0 0 auto; }
  .body { padding: 8px 16px 16px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table td { padding: 2px 0; border: 0; }
  .table td.links-cell { text-align: left; margin-top: 4px; }
}
