/* Sift — team inbox. Ops-ledger direction: ink banner, lime signal, mono labels. */
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400 600; font-style: normal; font-display: swap;
}

:root {
  --ink: #16162e;
  --ink-2: #22224a;
  --paper: #edeef2;
  --card: #ffffff;
  --line: #d7d8e2;
  --line-strong: #16162e;
  --lime: #ddf247;
  --peri: #7c7cff;
  --peri-deep: #4a4ae0;
  --rose: #ff5d5d;
  --amber: #ff9f1c;
  --mint: #1f9d63;
  --muted: #585a72;
  --radius: 18px;
  --font-display: "Space Grotesk", "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background:
    linear-gradient(var(--paper), var(--paper)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(22,22,46,.045) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(22,22,46,.045) 31px 32px);
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px;
  text-decoration: none; font-weight: 700; transition: top .15s ease;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--peri);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(237,238,242,.9);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--ink);
}
.topbar-in {
  display: flex; align-items: center; gap: 18px;
  padding-block: 12px;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -.02em; }
.brand-sub {
  font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .14em;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 3px 9px; background: #fff;
}
.topnav { display: flex; gap: 4px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 3px; }
.topnav-link {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: .86rem;
  padding: 6px 14px; border-radius: 999px;
}
.topnav-link.is-active, .topnav-link:hover { background: var(--ink); color: #fff; }
.top-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.date-pill {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em;
  background: var(--ink); color: var(--lime); border-radius: 999px; padding: 6px 12px; white-space: nowrap;
}
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .av {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: #fff;
  border: 2px solid var(--paper); margin-left: -8px;
}
.avatar-stack .av:first-child { margin-left: 0; }

/* ---------- Hero ---------- */
.hero {
  margin-top: 22px;
  background: var(--ink);
  color: #f2f2fa;
  border: 2px solid var(--ink);
  border-radius: 26px;
  padding: clamp(22px, 4vw, 44px);
  display: grid; grid-template-columns: 1.35fr .9fr; gap: clamp(20px, 4vw, 48px);
  position: relative; overflow: hidden;
  box-shadow: 7px 7px 0 var(--lime);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(100deg, transparent 55%, #000 100%);
}
.eyebrow {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--lime); display: flex; align-items: center; gap: 9px; margin: 0 0 12px;
}
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(221,242,71,.22); }
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.02; letter-spacing: -.03em;
  margin: 0 0 12px; text-wrap: balance;
}
.hero-sub { color: #c9c9e4; font-size: 1.02rem; max-width: 46ch; margin: 0 0 22px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.btn {
  appearance: none; border: 2px solid var(--ink); border-radius: 999px;
  font-weight: 700; font-size: .92rem; padding: 11px 20px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lime { background: var(--lime); color: var(--ink); box-shadow: 3px 3px 0 rgba(0,0,0,.55); }
.btn-lime:hover { box-shadow: 1px 1px 0 rgba(0,0,0,.55); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-ghost:hover { border-color: #fff; }
.btn-ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-ink:hover { background: var(--ink-2); }

.hero-meter {
  background: #f4f4f8; color: var(--ink); border-radius: 18px; padding: 18px;
  align-self: center; position: relative; z-index: 1;
  border: 2px solid #fff;
}
.meter-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.meter-label { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.meter-count { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.meter-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; border: 2px solid var(--ink); background: #e2e3ec; }
.meter-bar span { display: block; height: 100%; min-width: 0; }
.seg-todo { background: #a8a9c4; } .seg-in-progress { background: var(--peri); }
.seg-blocked { background: var(--rose); } .seg-done { background: var(--mint); }
.meter-legend { list-style: none; margin: 12px 0 8px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.meter-legend li { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.meter-legend b { margin-left: auto; font-family: var(--font-mono); }
.meter-note { margin: 4px 0 0; font-size: .82rem; color: var(--muted); }

/* ---------- Toolbar ---------- */
.toolbar {
  margin-top: 20px;
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 16px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; align-items: end;
  box-shadow: 5px 5px 0 var(--ink);
}
.field { display: grid; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.input-wrap { position: relative; display: block; }
.input-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
input[type="search"], select {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink);
  background: #f6f6fa; border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px;
}
input[type="search"] { padding-left: 36px; }
input[type="search"]:focus, select:focus { background: #fff; }
select { cursor: pointer; appearance: auto; }
.toolbar-meta { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; border-top: 1.5px dashed var(--line); padding-top: 10px; }
.result-count { margin: 0; font-size: .88rem; color: var(--muted); }
.result-count strong { color: var(--ink); }
.link-btn {
  background: none; border: none; padding: 4px 2px; cursor: pointer;
  color: var(--peri-deep); font-weight: 700; font-size: .86rem; text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- Workspace ---------- */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; margin-top: 20px; align-items: start; }
.queue-section { min-width: 0; }
.queue-head { display: flex; align-items: baseline; gap: 14px; margin: 2px 2px 12px; flex-wrap: wrap; }
.queue-head h2 { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -.02em; margin: 0; }
.queue-hint { margin: 0; font-size: .86rem; color: var(--muted); font-family: var(--font-mono); }

.queue {
  list-style: none; margin: 0; padding: 0;
  background: var(--card); border: 2px solid var(--ink); border-radius: 20px; overflow: hidden;
  box-shadow: 5px 5px 0 var(--ink);
}
.queue > li + li { border-top: 2px solid var(--ink); }

.row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 6px 16px; align-items: center;
  padding: 15px 16px 15px 14px;
  border-left: 8px solid transparent;
  position: relative;
}
.row:hover { background: #f6f6fb; }
.row.pri-high { border-left-color: var(--rose); }
.row.pri-medium { border-left-color: var(--amber); }
.row.pri-low { border-left-color: var(--mint); }
.row-index { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.row-index::before { content: attr(data-n); display: block; font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.row-main { min-width: 0; }
.row-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 3px 10px 3px 8px; background: #fff;
  white-space: nowrap;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip-todo { color: #4d4f6e; } .chip-todo i { background: #8d8fae; }
.chip-in-progress { color: var(--peri-deep); } .chip-in-progress i { background: var(--peri); }
.chip-blocked { color: #b3261e; background: #ffe9e9; } .chip-blocked i { background: var(--rose); }
.chip-done { color: #0c6b3f; background: #e2f5e9; } .chip-done i { background: var(--mint); }
.pri {
  font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.row-title { font-family: var(--font-display); font-weight: 700; font-size: 1.06rem; letter-spacing: -.01em; margin: 0 0 3px; }
.row-title a { color: inherit; text-decoration: none; }
.row-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.row-summary { margin: 0; color: #3d3e58; font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-meta {
  margin: 9px 0 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  font-size: .8rem; color: var(--muted);
}
.row-meta .who { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 600; }
.mini-av {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 700; color: #fff; flex: none;
}
.tag { background: #eef0ff; border: 1px solid #c9ccff; border-radius: 6px; padding: 1px 7px; font-size: .74rem; color: var(--peri-deep); font-weight: 600; }
.row-open { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.open-btn {
  border: 2px solid var(--ink); background: var(--ink); color: #fff; border-radius: 999px;
  font-weight: 700; font-size: .82rem; padding: 9px 16px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.open-btn:hover { background: var(--peri-deep); border-color: var(--peri-deep); }
.due-flag { font-family: var(--font-mono); font-size: .7rem; color: var(--muted); white-space: nowrap; }
.due-flag.over { color: #b3261e; font-weight: 600; }

/* Empty state */
.empty {
  background: var(--card); border: 2px dashed var(--ink); border-radius: 20px;
  padding: 44px 24px; text-align: center; margin-top: 14px; color: var(--ink);
}
.empty-art { color: var(--peri-deep); margin-bottom: 8px; }
.empty h3 { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 6px; }
.empty p { color: var(--muted); margin: 0 0 18px; }

/* Side panels */
.side { display: grid; gap: 16px; position: sticky; top: 76px; }
.panel {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 16px; box-shadow: 4px 4px 0 var(--ink);
}
.panel h2 { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; margin: 0 0 4px; }
.panel-sub { margin: 0 0 12px; font-size: .84rem; color: var(--muted); }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.team-list li { display: flex; align-items: center; gap: 10px; font-size: .87rem; }
.team-list .t-av {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700; color: #fff; border: 2px solid var(--ink);
}
.team-list small { display: block; color: var(--muted); font-size: .75rem; }
.team-list b { margin-left: auto; font-family: var(--font-mono); font-size: .75rem; background: #f0f0f6; border-radius: 8px; padding: 2px 8px; }
.key-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .85rem; }
.key-list li { display: grid; grid-template-columns: auto auto 1fr; gap: 4px 8px; align-items: center; }
.key-list span:last-child { grid-column: 3; color: var(--muted); }
.dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); }
.dot-todo { background: #a8a9c4; } .dot-in-progress { background: var(--peri); }
.dot-blocked { background: var(--rose); } .dot-done { background: var(--mint); }
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .86rem; color: #3d3e58; }
.guide-list li { display: flex; gap: 10px; align-items: flex-start; }
.guide-list span {
  flex: none; width: 24px; height: 24px; border-radius: 8px; background: var(--ink); color: var(--lime);
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}

.footer {
  margin: 26px 2px 40px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  font-size: .84rem; color: var(--muted);
}
.footer p { margin: 0; }
.footer strong { color: var(--ink); }

/* ---------- Drawer ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(22,22,46,.5); z-index: 80; }
.backdrop[hidden] { display: none; }
.drawer {
  position: fixed; z-index: 90; top: 0; right: 0; height: 100dvh; width: min(480px, 100vw);
  background: #f7f7fb; border-left: 3px solid var(--ink);
  box-shadow: -12px 0 40px rgba(22,22,46,.3);
  overflow-y: auto; padding: 0;
}
.drawer[hidden] { display: none; }
.detail { padding: 22px 22px 30px; }
.detail-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.detail-kicker { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.close-btn {
  margin-left: auto; border: 2px solid var(--ink); background: #fff; border-radius: 999px;
  font-weight: 700; font-size: .82rem; padding: 8px 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.close-btn:hover { background: var(--ink); color: #fff; }
.detail h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; line-height: 1.1; margin: 8px 0 10px; text-wrap: balance; }
.detail-summary { font-size: 1rem; color: #3d3e58; margin: 0 0 14px; border-left: 4px solid var(--lime); background: #fff; padding: 10px 12px; border-radius: 0 12px 12px 0; }
.detail-body { background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; }
.detail-body p { margin: 0 0 10px; font-size: .94rem; }
.detail-body p:last-child { margin-bottom: 0; }
.detail-body .lbl { font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); display: block; margin-bottom: 8px; }
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.spec li { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 11px; font-size: .84rem; }
.spec li b { display: block; font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.status-box { background: var(--ink); color: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.status-box label { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--lime); display: block; margin-bottom: 8px; }
.status-box select { background: #fff; }
.status-note { font-size: .82rem; color: #c9c9e4; margin: 8px 0 0; min-height: 1.2em; }
.status-note.ok { color: var(--lime); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.detail-foot { display: flex; gap: 10px; align-items: center; font-size: .82rem; color: var(--muted); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 999px; padding: 11px 18px;
  font-size: .88rem; font-weight: 600; z-index: 120; max-width: min(520px, calc(100vw - 32px));
  border: 2px solid var(--lime); box-shadow: 0 8px 30px rgba(0,0,0,.35);
  display: flex; gap: 9px; align-items: center;
}
.toast[hidden] { display: none; }
.toast .tick { background: var(--lime); color: var(--ink); border-radius: 50%; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; flex: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .field-search { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .topnav { display: none; }
  .toolbar { grid-template-columns: 1fr; }
  .row { grid-template-columns: 40px minmax(0, 1fr); }
  .row-open { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; margin-top: 6px; }
  .open-btn { width: auto; }
  .drawer { width: 100vw; border-left: none; }
  .spec { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
