/* ONYX components — carried from the approved prototype (app.css/surfaces.css).
   U1 ships the components its pages render; behavior-bound components
   (slide-over, palette internals, chat, quick-fill, agent panel) land with
   their phases under these reserved class names. */

/* ---------- status pills + AI flag ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-tint); }
.pill.info { color: var(--info); background: var(--info-tint); }
.pill.warn { color: var(--warn); background: var(--warn-tint); }
.pill.bad { color: var(--bad); background: var(--bad-tint); }
.pill.neutral { color: var(--ink-2); background: var(--surface-2); }
.pill.ai { color: var(--ai-ink); background: var(--ai-tint); }

.ai-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ai-ink);
  background: var(--ai-tint);
  border: 1px solid var(--ai-tint-2);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ---------- island top bar (always dark, ignores mode) ---------- */
.island {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 14px 20px 0;
  padding: 0 18px;
  height: 54px;
  background: #131316;
  color: #ebeae6;
  border-radius: var(--radius-island);
  box-shadow: var(--shadow-2);
  position: relative;
  z-index: 20;
}
html[data-mode="dark"] .island { background: #0c0c0e; border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) {
  html[data-mode="system"] .island { background: #0c0c0e; border: 1px solid var(--line); }
}
.island .logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.22em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.island .logo::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--ai);
  transform: rotate(45deg);
  transition: transform 0.4s ease;
}
.island .logo:hover::before { transform: rotate(225deg); }
.island .tabs {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.island .tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 15px;
  font-size: 13px;
  font-weight: 500;
  color: #8d8b85;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: color 0.12s ease;
}
.island .tab:hover { color: #d6d4ce; }
.island .tab.on { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; }
.island .tab .count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #131316;
  background: var(--ai);
  border-radius: var(--radius-pill);
  padding: 0 7px;
}
.island .cmd {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 380px;
  height: 36px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  color: #8d8b85;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.island .cmd:hover { border-color: var(--ai); }
.island .cmd .kbd {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: #8d8b85;
  margin-left: auto;
}
.island .avatar { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.18); color: #d6d4ce; }

/* avatar menu — <details> based so it works without JS */
.avatar-menu-host { position: relative; }
.avatar-menu-host > summary { list-style: none; cursor: pointer; display: inline-flex; }
.avatar-menu-host > summary::-webkit-details-marker { display: none; }
.avatar-menu-host:hover .avatar, .avatar-menu-host[open] .avatar { border-color: var(--ai); }
.avatar-menu {
  position: absolute;
  top: 44px;
  right: 0;
  width: 210px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-menu);
  box-shadow: var(--shadow-3);
  padding: 6px;
  z-index: 50;
  color: var(--ink);
}
.avatar-menu .who { padding: 8px 12px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.avatar-menu .who .nm { font-weight: 600; font-size: 13.5px; }
.avatar-menu .who .em { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.avatar-menu .mi {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--ink-2);
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.avatar-menu .mi:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-input);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: 0.86; }
.btn.accent { background: var(--ai); border-color: var(--ai); color: #fff; }
.btn.accent:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: color-mix(in oklab, var(--bad) 40%, var(--line-2)); }
.btn.danger:hover { background: var(--bad-tint); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: 0.45; pointer-events: none; }

/* ---------- page header ---------- */
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.pagehead { display: flex; align-items: flex-end; gap: 16px; row-gap: 8px; flex-wrap: wrap; }
.pagehead h1 {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
}
.pagehead .meta { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); padding-bottom: 5px; }
.pagehead .actions { margin-left: auto; display: flex; gap: 9px; }
.pagehead .sub { width: 100%; color: var(--ink-2); font-size: 14px; margin-top: 4px; }

/* ---------- rule-top stats ---------- */
.stats { display: flex; margin: 22px 0 26px; border-top: 2px solid var(--ink); }
.stat {
  flex: 1;
  padding: 13px 18px 2px 0;
  border-right: 1px solid var(--line);
  margin-right: 18px;
  text-align: left;
  color: inherit;
  text-decoration: none;
}
.stat:last-child { border-right: none; margin-right: 0; }
.stat .n {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  transition: color 0.12s ease;
}
a.stat:hover .n { color: var(--ai-ink); }
.stat .l { font-size: 13px; font-weight: 600; margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.stat .s { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.stat.ai .n, .stat.ai .l { color: var(--ai-ink); }
.stat .warn-mark { color: var(--warn); }

/* ---------- card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 16px; font-weight: 600; }
.card-head .total { font-size: 13px; color: var(--ink-3); }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px 20px; }

/* ---------- data table ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-align: left;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface-2) 50%, var(--surface));
  white-space: nowrap;
}
.tbl th a { color: inherit; text-decoration: none; }
.tbl th a:hover { color: var(--ink); }
.tbl td { padding: 13px 20px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.rowlink { cursor: pointer; transition: background 0.12s ease; }
.tbl tbody tr.rowlink:hover { background: color-mix(in oklab, var(--surface-2) 55%, var(--surface)); }
.tbl .name { font-weight: 600; }
.tbl .sub { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.tbl .num { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.tbl .none { color: var(--ink-3); }
.sort-arrow { font-size: 10px; vertical-align: 1px; opacity: 0.9; }
.tbl .go {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.15s ease;
}
.tbl tr:hover .go { opacity: 1; transform: translateX(0); }
.tbl tr.ai-row td { background: var(--ai-tint); }
.tbl tr.ai-row td:first-child { box-shadow: inset 3px 0 0 var(--ai); }
.tbl tr.ai-row:hover td { background: var(--ai-tint-2); }

/* ---------- form fields ---------- */
.field { margin-bottom: 16px; }
.field > label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-input);
  padding: 9px 12px;
  transition: border-color 0.12s ease, background 0.3s ease;
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ai); outline: none; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.field.error input { border-color: var(--bad); }
.field .err { font-size: 12px; color: var(--bad); margin-top: 4px; }
.frow { display: flex; gap: 12px; }
.frow .field { flex: 1; }

/* ---------- settings controls ---------- */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-top: 22px; }
.set-row { margin-bottom: 20px; }
.set-row:last-child { margin-bottom: 0; }
.set-row .sl { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.set-row .sd { font-size: 12.5px; color: var(--ink-3); margin-top: -4px; margin-bottom: 10px; }

/* segmented control — label-wrapped radios */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 6px 16px;
  border-radius: 8px;
  cursor: pointer;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }

/* typography preview cards */
.type-cards { display: flex; gap: 10px; }
.type-card {
  flex: 1;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-menu);
  padding: 12px 14px;
  cursor: pointer;
  background: var(--surface);
  text-align: left;
  color: var(--ink);
  transition: border-color 0.12s ease;
}
.type-card:hover { border-color: var(--ink-3); }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card:has(input:checked) { border-color: var(--ai); box-shadow: 0 0 0 1px var(--ai); }
.type-card .tc-prev { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.type-card .tc-name { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* accent swatches */
.swatches { display: flex; gap: 10px; }
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  display: inline-block;
}
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch:has(input:checked) { border-color: var(--ink); }
.swatch:has(input:checked)::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* radio rows */
.radio-rows { display: flex; flex-direction: column; gap: 8px; }
.radio-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--surface);
  text-align: left;
  color: var(--ink);
}
.radio-row input { margin-top: 3px; accent-color: var(--ai); }
.radio-row:has(input:checked) { border-color: var(--ai); box-shadow: 0 0 0 1px var(--ai); }
.radio-row .rr-t { font-size: 13.5px; font-weight: 600; }
.radio-row .rr-d { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

/* checkbox row */
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check-row input { accent-color: var(--ai); }

/* ---------- empty state ---------- */
.empty { padding: 48px 20px 52px; text-align: center; }
.empty .big {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.empty .why { color: var(--ink-3); font-size: 13.5px; margin: 6px 0 18px; }
.empty .acts { display: flex; gap: 10px; justify-content: center; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed;
  left: 24px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 16px;
  border-radius: var(--radius-menu);
  box-shadow: var(--shadow-3);
  animation: toast-in 0.25s ease;
  max-width: 420px;
}
.toast .tick { color: var(--ok); font-weight: 700; }
.toast.ai .tick { color: var(--ai); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- U2: filter row ---------- */
.filter-row { margin-bottom: 14px; }
.filter-row > summary { list-style: none; cursor: pointer; display: inline-flex; }
.filter-row > summary::-webkit-details-marker { display: none; }
.filter-row[open] > summary { border-color: var(--ai); color: var(--ink); }
.filter-form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: 12px;
}
.filter-form select {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 6px 10px;
}

/* ---------- U2: table utilities ---------- */
.tbl .right { text-align: right; }
.tbl .clip {
  max-width: 360px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tbl tfoot td {
  border-top: 1px solid var(--line-2);
  border-bottom: none;
  color: var(--ink-2);
  font-size: 13px;
}
.tbl .row-acts { white-space: nowrap; }
.tbl .row-acts .btn { margin-right: 6px; }
.tbl .row-acts .btn:last-child { margin-right: 0; }
.tbl .ai-action {
  color: var(--ai-ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: nowrap;
}
.tbl .row-main-link { color: inherit; text-decoration: none; }
.ai-sub { color: var(--ai-ink); text-decoration: none; }
.warn-mark { color: var(--warn); }

/* ---------- U2: detail sub-tabs ---------- */
.subtabs {
  display: flex;
  gap: 4px;
  margin: 4px 0 16px;
  border-bottom: 1px solid var(--line);
}
.subtab {
  padding: 9px 13px 11px;
  font-size: 13.5px;
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.subtab:hover { color: var(--ink); }
.subtab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.subtab .count { font-size: 12px; color: var(--ink-3); margin-left: 3px; }

/* ---------- U2: documents grid ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.doc-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.doc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.doc-ext {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.doc-ext.ai { background: var(--ai-tint); color: var(--ai-ink); }
.doc-card .name { font-weight: 600; font-size: 13.5px; }
.doc-card .sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.dropzone {
  margin-top: 16px;
  border: 1.5px dashed var(--line-2);
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- U2: notes editor ---------- */
.note-editor {
  width: 100%;
  min-height: 320px;
  border: none;
  resize: vertical;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: transparent;
  outline: none;
}
.note-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.note-foot [data-autosave-status] { font-size: 12px; color: var(--ink-3); }

/* ---------- U3: slide-over panel ---------- */
.slide-over { position: fixed; inset: 0; z-index: 60; }
.so-scrim {
  position: absolute;
  inset: 0;
  background: rgba(12, 12, 14, 0.34);
  opacity: 0;
  transition: opacity 250ms ease;
}
.so-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(580px, 94vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(12, 12, 14, 0.18);
  transform: translateX(100%);
  transition: transform 250ms cubic-bezier(0.25, 1, 0.4, 1);
  overflow-y: auto;
  outline: none;
}
.slide-over.open .so-scrim { opacity: 1; }
.slide-over.open .so-panel { transform: translateX(0); }
.so-x {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--ink-3);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.so-x:hover { color: var(--ink); background: var(--surface-2); }
.so-body { padding: 20px; }
.so-body .record-card { border: none; box-shadow: none; padding: 0; }
.panel-only { display: none; }
.so-body .panel-only { display: inline; }
@media (prefers-reduced-motion: reduce) {
  .so-scrim, .so-panel { transition: none; }
}

/* ---------- U3: record form ---------- */
.record-page { max-width: 640px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.form-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.form-foot .reassure { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.field .err { color: var(--bad); font-size: 12px; margin-top: 4px; }
.field.error input, .field.error textarea, .field.error select { border-color: var(--bad); }
.field.ai-filled input, .field.ai-filled textarea, .field.ai-filled select { background: var(--ai-tint); }
.field .f-mark { color: var(--ai-ink); font-size: 11px; margin-left: 6px; }

/* ---------- U3: quick-fill strip (hidden until B3) ---------- */
.quick-fill {
  background: var(--ai-tint);
  border: 1px solid var(--ai-tint-2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.quick-fill .qf-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ai-ink);
  margin-bottom: 8px;
}
.quick-fill .qf-row { display: flex; gap: 8px; }
.quick-fill .qf-row input { flex: 1; }
.quick-fill .qf-status { font-size: 12px; color: var(--ai-ink); margin-top: 6px; }

/* ---------- U3: record view ---------- */
.rv-fields { margin-top: 4px; }
.rv-row {
  display: flex;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.rv-row:last-child { border-bottom: none; }
.rv-label { width: 150px; flex-shrink: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.rv-value { font-size: 13.5px; color: var(--ink); }
.rv-docs, .rv-timeline { margin-top: 18px; }
.rv-docs > .rv-label, .rv-timeline > .rv-label { width: auto; margin-bottom: 8px; }
.doc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--ink);
  text-decoration: none;
}
.doc-chip:hover { background: var(--surface-2); }
.doc-chip .ext { font-size: 10.5px; font-weight: 600; color: var(--ink-3); }

/* ---------- U3: timeline ---------- */
.timeline { border-left: 2px dotted var(--line-2); margin-left: 5px; padding-left: 16px; }
.tl-entry { position: relative; padding: 7px 0; }
.tl-dot {
  position: absolute;
  left: -22px;
  top: 13px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
}
.tl-dot.warn { background: var(--warn); }
.tl-dot.accent { background: var(--ai); }
.tl-text { font-size: 13px; color: var(--ink); }
.tl-text.ai-action { color: var(--ai-ink); }
.tl-when { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- U3: staged-work callout ---------- */
.staged-callout {
  background: var(--ai-tint);
  border: 1px solid var(--ai-tint-2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.staged-callout .sc-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ai-ink);
}
.staged-callout .sc-summary { font-size: 13px; color: var(--ink); margin-top: 6px; }
.staged-callout .sc-acts { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- U3: dropzone form + go link ---------- */
form.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
form.dropzone.drag { border-color: var(--ai); background: var(--ai-tint); }
form.dropzone input[type="file"] { font-size: 12.5px; }
a.doc-card { display: block; text-decoration: none; color: inherit; }
a.doc-card:hover { border-color: var(--line-2); background: var(--surface-2); }
a.go { text-decoration: none; }

/* ---------- U3.5: lifecycle actions + stale callout ---------- */
.record-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.record-actions > .rv-label { width: auto; margin-bottom: 10px; }

.record-action {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.record-action:last-child { margin-bottom: 0; }

/* Native controls -> match the .field control language */
.record-action select,
.record-action input[type="date"] {
  height: 38px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-input);
  padding: 0 12px;
  transition: border-color 0.12s ease;
}
.record-action select:hover,
.record-action input[type="date"]:hover { border-color: var(--ink-3); }
.record-action select:focus,
.record-action input[type="date"]:focus { border-color: var(--ai); outline: none; }

/* Select: drop the OS chrome, add a token-coloured chevron */
.record-action select {
  max-width: 240px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%238d897f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* Date label stack */
.record-action .ra-date { display: flex; flex-direction: column; gap: 5px; }
.record-action .ra-date span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
}

/* Action button: full control height so it sits flush with the inputs */
.record-action .btn.sm {
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  border-radius: var(--radius-input);
}

/* Dark mode: lighten the chevron */
html[data-mode="dark"] .record-action select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%236f6d67' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  html[data-mode="system"] .record-action select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%236f6d67' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

.warn-callout {
  background: var(--warn-tint);
  border: 1px solid var(--warn);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--ink);
}
