/* Fonts are served from ./fonts (SIL Open Font License). Missing files fall
   back to the system fonts. */
@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --subtle: #fafaf9;
  --sunken: #f3f2ef;
  --line: #e7e5e1;
  --line-soft: #efedea;
  --line-strong: #e0ddd8;
  --dash: #d6d3ce;
  --ink: #1a1a19;
  --ink-2: #2b2a28;
  --ink-3: #4a4844;
  --muted: #6b6863;
  --faint: #a8a49d;
  --accent: #4338ca;
  --accent-ink: #3730a3;
  --accent-soft: #eef2ff;
  --accent-line: #c7d2fe;
  --danger: #b42318;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 8px;
  --r-lg: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------ buttons */

.btn {
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { color: var(--ink); border-color: #c9c5be; }
.btn.lg { height: 40px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-3); }
.btn.ghost:hover { background: var(--sunken); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.icon-only { width: 36px; padding: 0; }
.icon-btn {
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.link-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 6px; color: var(--accent); text-decoration: none; font-size: 13px; }
.link-btn:hover { background: var(--accent-soft); }

/* ------------------------------------------------ people, actions, chips */

.av {
  width: 24px; height: 24px; flex: none;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
}
.av.sm { width: 24px; height: 24px; }
.av.md { width: 32px; height: 32px; font-size: 12px; }
.av.lg { width: 32px; height: 32px; font-size: 12px; }
.av.c0 { background: #e0e7ff; color: #3730a3; }
.av.c1 { background: #d1fae5; color: #065f46; }
.av.c2 { background: #fef3c7; color: #92400e; }
.av.c3 { background: #fce7f3; color: #9d174d; }
.av.c4 { background: #e0f2fe; color: #075985; }
.av.c5 { background: #ede9fe; color: #5b21b6; }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sunken);
  color: #3f3d39;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.d0 { background: #2563eb; } .d1 { background: #7c3aed; } .d2 { background: #d97706; }
.d3 { background: #059669; } .d4 { background: #db2777; } .d5 { background: #0891b2; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px; color: var(--muted);
}
.chip .ic, .chip svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
.chip a { color: #3f3d39; text-decoration: underline; text-decoration-color: #c9c5be; text-underline-offset: 2px; }

/* ------------------------------------------------ header */

.bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-in { min-height: 60px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.logo { width: 24px; height: 24px; border-radius: 6px; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.logo span { width: 10px; height: 10px; border: 2px solid #fff; border-radius: 3px; }
.views { display: flex; gap: 4px; align-self: stretch; }
.views a { display: flex; align-items: center; gap: 8px; padding: 0 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.views a[aria-current] { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }
.count-badge {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
}
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.flash {
  margin: 16px 0 0;
  padding: 10px 14px;
  border: 1px solid #fecaca;
  border-radius: var(--r);
  background: #fef2f2;
  color: var(--danger);
}

/* ------------------------------------------------ list */

.page { padding-top: 32px; padding-bottom: 64px; }
.sec { margin-top: 40px; }
.sec-h { margin: 0 0 12px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.sec-h-row { display: flex; align-items: baseline; gap: 10px; }
.sec-h-row .muted { font-size: 13px; }
.empty-note { color: var(--muted); }

.table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.thead, .tr { display: grid; gap: 16px; align-items: center; padding: 0 20px; }
.thead { padding-top: 10px; padding-bottom: 10px; background: var(--subtle); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--muted); }
.tr { padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.tbody > .tr:last-child { border-bottom: 0; }
.t-active .thead, .t-active .tr { grid-template-columns: minmax(0, 1fr) 170px 170px 80px 100px; }
.t-queue .thead, .t-queue .tr { grid-template-columns: 20px minmax(0, 1fr) 170px 80px 100px; padding-left: 14px; }
.t-done .tr { grid-template-columns: minmax(0, 1fr) 100px; }
.t-done .tr:last-child { border-bottom: 0; }
.tr[draggable] { cursor: grab; }
.tr[draggable]:hover { background: var(--subtle); }
.lbl { display: none; }
.c-time, .c-req { color: var(--ink-3); }
.c-who, .c-req { min-width: 0; }

.item-cell { min-width: 0; display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 12px; row-gap: 6px; align-items: baseline; }
.key { font-family: var(--mono); font-size: 12px; color: var(--muted); text-decoration: none; }
.ttl { min-width: 0; font-weight: 500; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-row { grid-column: 2; min-width: 0; }
.handle { display: flex; justify-content: center; }
.handle svg { fill: var(--faint); }

.slots { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.slot {
  height: 48px;
  border: 1.5px dashed var(--dash);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px;
}
.empty-row { margin: 0; padding: 18px 20px; color: var(--muted); }

.done-sec summary { display: flex; align-items: center; gap: 10px; padding: 8px 4px; cursor: pointer; list-style: none; }
.done-sec summary::-webkit-details-marker { display: none; }
.done-sec summary .sec-h { margin: 0; }
.done-sec summary .ic { color: var(--muted); transition: transform 0.15s; }
.done-sec[open] summary .ic { transform: rotate(90deg); }
.done-sec summary .muted { font-size: 13px; }
.done-sec .table { margin-top: 8px; }
.t-done .ttl { font-weight: 400; color: var(--ink-3); }

/* drag and drop */
.dragging { opacity: 0.4; }
.drop-before { box-shadow: inset 0 2px 0 0 var(--accent); }
.drop-after { box-shadow: inset 0 -2px 0 0 var(--accent); }
.slot.drop-in { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.zone.drop-end { box-shadow: inset 0 -2px 0 0 var(--accent); }

/* ------------------------------------------------ item page */

.crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .mono { font-size: 12px; }
.page > .crumbs:first-child { margin-top: -8px; }

.item-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; margin: 14px 0 28px; }
.item-title { flex: 1 1 480px; min-width: 0; }
.meta-line { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.key-lg { font-size: 13px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sunken); color: var(--ink-3); }
.status .sdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.s-active { background: var(--accent-soft); color: var(--accent); }
.status.s-done { background: #ecfdf5; color: #047857; }
h1 { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 650; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.head-actions { display: flex; gap: 8px; }

.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 10;
  min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(26, 26, 25, 0.12);
}
.menu-pop form { margin: 0; }
.menu-pop button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer;
}
.menu-pop button:hover { background: var(--sunken); }
.menu-pop .danger { color: var(--danger); }

.cols { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.main-col { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.side-col { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.turn { background: var(--surface); border: 1px solid var(--accent-line); border-radius: var(--r-lg); box-shadow: 0 0 0 4px var(--accent-soft); }
.turn-body { padding: 18px 20px 16px; }
.turn-label { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--accent); }
.turn-actions { padding: 14px 20px 18px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-form { margin: 0; }
.req { display: flex; gap: 12px; align-items: flex-start; }
.req-text { min-width: 0; flex: 1; }
.req-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.req-line b { font-weight: 600; }
.req-line .pill { font-size: 13px; padding: 1px 10px; }
.quote { margin-top: 8px; padding: 10px 14px; background: var(--bg); border-radius: var(--r); color: var(--ink-2); }

.panel-form { display: none; padding: 18px 20px 20px; border-top: 1px solid var(--line-soft); flex-direction: column; gap: 16px; }
.panel-form:target { display: flex; }
.panel-form h3 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-form p { margin: 2px 0 0; font-size: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.opt { font-weight: 400; color: var(--muted); }
input:not([type]), input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 14px; font-weight: 400;
  color: var(--ink);
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #e0e7ff; }
.form-foot { display: flex; align-items: center; gap: 8px; }
.form-foot .btn.ghost { margin-left: auto; }

.attach { flex-direction: row; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 6px; color: var(--ink-3); font-weight: 400; cursor: pointer; position: relative; }
.attach:hover { background: var(--sunken); }
.attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.attach:focus-within { outline: 2px solid var(--accent); }

.state-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.state-card p { margin: 8px 0 0; }
.card-h { margin: 0; font-size: 13px; font-weight: 600; }
.start-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0; }
.start-form label { flex: 1 1 180px; }
.done-card { flex-direction: row; align-items: center; justify-content: space-between; }
.done-card form { margin: 0; }

.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; }
.md h2, .md h3, .md h4 { margin: 22px 0 10px; font-size: 15px; font-weight: 600; color: var(--ink); }
.md h2 { font-size: 17px; }
.md ol, .md ul { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.md li { padding-left: 4px; }
.md code { font-family: var(--mono); font-size: 0.88em; padding: 1px 5px; border-radius: 4px; background: var(--sunken); }
.md pre { margin: 0 0 14px; padding: 12px 14px; background: var(--sunken); border-radius: var(--r); overflow-x: auto; }
.md pre code { padding: 0; background: none; }
.md blockquote { margin: 0 0 14px; padding-left: 14px; border-left: 3px solid var(--line-strong); color: var(--ink-3); }
.md a { color: var(--accent); }
.description { font-size: 15px; line-height: 1.6; color: var(--ink-2); max-width: 72ch; }

.description .thumbs { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.description .thumbs li { padding: 0; }
.thumbs a { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); }
.thumb { aspect-ratio: 3 / 4; border: 1px solid var(--line); border-radius: 10px; background: #efedea; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--faint); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.thumb-name { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ev { display: flex; gap: 12px; align-items: center; padding: 0 0 16px 4px; font-size: 13px; color: var(--muted); }
.ev b { color: var(--ink); font-weight: 600; }
.ev time, .bubble-head time { margin-left: auto; white-space: nowrap; color: var(--muted); }
.ev-text { min-width: 0; }
.bubble-row { display: flex; gap: 12px; align-items: flex-start; padding: 0 0 16px 4px; }
.bubble { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.bubble-head { display: flex; gap: 8px; font-size: 13px; color: var(--muted); }
.bubble-head b { color: var(--ink); font-weight: 600; }
.bubble .md { margin-top: 6px; }
.files { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.files a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; font-size: 13px; }
.files .ic { color: var(--muted); }

.composer-row { display: flex; gap: 12px; align-items: flex-start; padding-left: 4px; margin: 0; }
.composer { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #e0e7ff; }
.composer textarea { display: block; border: 0; border-radius: 0; box-shadow: none; padding: 12px 14px; }
.composer-foot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line-soft); background: var(--subtle); }
.composer-foot .btn { margin-left: auto; }

.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.side-card .card-h { margin-bottom: 12px; }
.side-card > .muted.small { margin: -8px 0 14px; font-size: 12px; }
.card-h-row { display: flex; align-items: center; margin-bottom: 10px; }
.card-h-row .card-h { margin: 0; }
.card-h-row .link-btn { margin-left: auto; }
.details { margin: 0; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; font-size: 13px; align-items: center; }
.details dt { color: var(--muted); }
.details dd { margin: 0; min-width: 0; }
.details .av { width: 22px; height: 22px; }

.chain { list-style: none; margin: 0; padding: 0; }
.chain li { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.chain li:last-child { padding-bottom: 0; }
.chain li:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 20px; bottom: 2px; width: 2px; background: var(--line); }
.chain .node { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; border: 2px solid var(--faint); background: var(--surface); }
.chain .now .node { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px #e0e7ff; }
.chain-who { font-size: 13px; font-weight: 500; }
.chain .now .chain-who { font-weight: 600; }
.chain-when { font-size: 12px; color: var(--muted); }
.chain .now .chain-when { color: var(--accent); }

.add-dep { display: none; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.add-dep:target { display: flex; }
.row-input { display: flex; gap: 6px; }
.row-input input { min-width: 0; flex: 1; min-height: 32px; padding: 4px 10px; }
.dep-label { font-size: 12px; font-weight: 500; color: var(--muted); margin: 16px 0 8px; }
.dep-label:first-of-type { margin-top: 0; }
.dep-none { margin: 0; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 13px; color: var(--muted); }
.dep-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dep-cards li { border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 10px 12px; }
.dep-top { display: flex; align-items: center; gap: 8px; }
.dep-top form { margin: 0 0 0 auto; }
.mini { padding: 0 8px; border-radius: 999px; background: var(--sunken); color: var(--ink-3); font-size: 11px; font-weight: 600; line-height: 20px; }
.mini.s-active { background: var(--accent-soft); color: var(--accent); }
.mini.s-done { background: #ecfdf5; color: #047857; }
.dep-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; text-decoration: none; font-size: 13px; font-weight: 500; line-height: 1.4; }

/* ------------------------------------------------ new and edit */

.narrow-page { max-width: 720px; padding-top: 24px; }
.narrow-page.wide { max-width: 820px; }
.page-h { margin: 14px 0 6px; }
.lead { margin: 0 0 24px; }
.narrow-page.wide .page-h { margin-bottom: 24px; }
.page-h .mono { font-size: 22px; font-weight: 500; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.form-card > label input { min-height: 42px; font-size: 15px; }
.field-head { display: flex; align-items: flex-end; gap: 12px; }
.seg { margin-left: auto; display: flex; padding: 2px; border-radius: var(--r); background: var(--sunken); }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: none; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); color: var(--ink); font-weight: 500; }
.mono-area { font-family: var(--mono); font-size: 13px; line-height: 1.6; }
.preview { min-height: 160px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); font-size: 15px; line-height: 1.6; font-weight: 400; color: var(--ink-2); }
.hint { margin: 0; font-size: 12px; font-weight: 400; color: var(--muted); }
.hint code { font-family: var(--mono); }

.drop {
  position: relative;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 22px; border: 1.5px dashed var(--dash); border-radius: 10px; background: var(--subtle);
  color: var(--muted); font-size: 13px; font-weight: 400; text-align: center; cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-within { outline: 2px solid var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.accent { color: var(--accent); font-weight: 500; }

.att-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.att-list li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-weight: 400; }
.att-thumb { flex: none; width: 32px; height: 40px; border-radius: 6px; background: #efedea; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--faint); }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-name { min-width: 0; flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-remove { position: relative; flex: none; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--muted); cursor: pointer; }
.att-remove:hover { background: var(--sunken); color: var(--danger); }
.att-remove input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.att-list li:has(input:checked) { background: #fef2f2; border-color: #fecaca; }
.att-list li:has(input:checked) .att-name { text-decoration: line-through; color: var(--muted); }
.att-list li:has(input:checked) .att-remove { color: var(--danger); }
.form-end { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

/* ------------------------------------------------ narrow screens */

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .bar-in { padding-top: 8px; padding-bottom: 8px; }
  .views { order: 3; width: 100%; }
  .views a { padding: 10px 12px; }
  .page { padding-top: 20px; }
  .thead { display: none; }
  .tr, .t-active .tr, .t-queue .tr { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 16px; }
  .t-queue .handle { display: none; }
  .c-item { grid-column: 1 / -1; }
  .item-cell { grid-template-columns: auto minmax(0, 1fr); }
  .lbl { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
  .c-time { text-align: right; }
  .c-prog:has(> .muted) { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .turn-actions .btn { flex: 1 1 auto; }
  .form-card { padding: 18px; }
}

/* ------------------------------------------------ account, people, sign-in */

.account summary { list-style: none; cursor: pointer; border-radius: 50%; display: block; }
.account summary::-webkit-details-marker { display: none; }
.account .menu-pop a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; text-decoration: none; }
.account .menu-pop a:hover { background: var(--sunken); color: var(--ink); }
.menu-who { display: flex; flex-direction: column; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.menu-who .muted { font-size: 12px; overflow-wrap: anywhere; }

.people-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 20px; }
.narrow-page .people-head .page-h { margin: 0; }
.invite-form { display: none; margin-bottom: 20px; }
.invite-form:target { display: flex; }
.people .tr { grid-template-columns: minmax(0, 1fr) auto auto; padding-left: 16px; padding-right: 16px; }
.people .tr:last-child { border-bottom: 0; }
.p-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.p-text b { font-weight: 600; }
.p-text .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.p-tags { display: flex; gap: 6px; }
.p-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.p-actions form { margin: 0; }
.p-actions .row-input input { width: 200px; min-height: 32px; }
.danger-text { color: var(--danger); }
.you { margin-top: 24px; gap: 10px; }
.you .row-input input { max-width: 320px; min-height: 36px; }

body.bare { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; }
.auth { width: 100%; max-width: 400px; padding: 12vh 20px 40px; display: flex; flex-direction: column; gap: 20px; }
.auth-brand { justify-content: center; font-size: 18px; }
.auth .flash { margin: 0; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; gap: 16px; margin: 0; }
.auth-card h1 { font-size: 22px; }
.auth-card p { margin: 0; }
.auth-card input { min-height: 44px; font-size: 15px; }
.auth-card .btn { width: 100%; }

@media (max-width: 760px) {
  .people .tr { grid-template-columns: minmax(0, 1fr) auto; }
  .p-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
}
.btn.ghost.danger-text { color: var(--danger); }
.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check b { font-weight: 600; }
.menu-version { padding: 8px 10px 4px; margin-top: 4px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); }
.notice { margin: 0 0 20px; padding: 10px 14px; border: 1px solid #fde68a; border-radius: var(--r); background: #fffbeb; color: #78350f; font-size: 13px; }
.link-card { margin-bottom: 20px; gap: 10px; border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.link-card input { font-size: 12px; min-height: 36px; }
.link-card ~ .invite-form { display: none; }
.panel-form.open, .add-dep.open, .invite-form.open { display: flex; }
.turn-actions .btn[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.link-btn[aria-expanded="true"] { background: var(--accent-soft); }

/* ------------------------------------------------ checklists */

.prog { font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.prog.full { color: #15803d; }
.md ul.checklist, .md ol.checklist { list-style: none; padding-left: 0; gap: 6px; }
.md li.task { display: flex; align-items: flex-start; gap: 10px; padding-left: 0; }
.md li.task > input { margin: 4px 0 0; accent-color: var(--accent); flex: none; }
.md li.task.done > span { color: var(--muted); text-decoration: line-through; }
.md ul:not(.checklist) li.task, .md ol:not(.checklist) li.task { margin-left: -22px; }
.tick { margin: 0; flex: none; display: flex; }
.tick .box { width: 18px; height: 18px; margin-top: 2px; padding: 0; border: 1.5px solid #bdb8b1; border-radius: 5px; background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.tick .box:hover { border-color: var(--accent); }
.tick .box[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.tick .box[aria-checked="true"]::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translate(0, -1px) rotate(45deg); }
.tick .box:disabled { opacity: .6; cursor: progress; }
.gate-hint { flex-basis: 100%; margin: 0; }
.gate-hint a { color: inherit; }

/* ------------------------------------------------ changed by someone else */

.stale { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 10px 14px 10px 16px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
  animation: stale-in .2s ease-out; }
.stale:hover { border-color: var(--accent-line); }
.stale-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.stale-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stale-text b { font-weight: 600; }
.stale-act { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--sunken); font-weight: 600; font-size: 13px; }
.stale.you { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 8px 24px rgba(0, 0, 0, .12); }
.stale.you .stale-dot { background: var(--accent); }
.stale.you .stale-act { background: var(--accent); color: #fff; }
@keyframes stale-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.count-badge.bump { animation: bump .6s ease-out; }
@keyframes bump { 30% { transform: scale(1.35); background: var(--accent); color: #fff; } }
@media (prefers-reduced-motion: reduce) { .stale, .count-badge.bump { animation: none; } }

/* ------------------------------------------------ done with a message, drop */

.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-fill:hover { background: #912018; border-color: #912018; color: #fff; }
.drop-form { margin-bottom: 20px; background: var(--surface); border: 1px solid #fecdca; border-radius: var(--r-lg); box-shadow: 0 0 0 4px #fef3f2; }
.menu-pop a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: inherit; text-decoration: none; }
.menu-pop a:hover { background: var(--sunken); color: var(--ink); }
.status.s-dropped, .mini.s-dropped { background: var(--sunken); color: var(--ink-3); }
.turn-actions .btn.primary[aria-expanded="true"] { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }

/* ------------------------------------------------ quieter activity */

/* Minor entries line up with the text of the others (4px + avatar 24px + gap 12px). */
.ev.minor { padding: 0 0 12px 40px; font-size: 12px; }
.ev.minor b { font-weight: 500; color: var(--ink-3); }
.fold { padding: 0 0 12px 40px; }
.fold summary { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary:hover span { color: var(--ink-3); }
.fold summary time { margin-left: auto; white-space: nowrap; }
.fold-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px dashed var(--line-strong); flex: none; }
.fold[open] .fold-dot, .fold details[open] .fold-dot { border-style: solid; }
.fold .feed { margin-top: 10px; }
.fold .ev.minor { padding-left: 22px; }

/* ------------------------------------------------ item created */

.flash.ok { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
.flash.ok a { color: inherit; font-weight: 600; text-underline-offset: 2px; }
.tr.fresh { animation: fresh 3s ease-out; }
@keyframes fresh { 0%, 40% { background: var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .tr.fresh { animation: none; background: var(--accent-soft); } }

/* ------------------------------------------------ free slots */

.slot b { font-weight: 600; color: var(--ink-3); }
.slot.drop-in b { color: var(--accent); }
.slot.full { border-style: solid; border-color: var(--line-soft); background: var(--sunken); }
@media (max-width: 760px) { .slot-hint { display: none; } }
.slot { gap: 6px; }
.slot.full { height: 40px; }

/* ------------------------------------------------ help */

.help { font-size: 15px; line-height: 1.6; }
.help h2 { margin: 6px 0 20px; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.help h3 { margin: 36px 0 12px; font-size: 19px; }
.help ul, .help ol { gap: 6px; }
.help pre { line-height: 1.45; font-size: 13.5px; }
