:root {
  --ink: #121410;
  --panel: #1b1f18;
  --raise: #262b22;
  --line: #34392f;
  --paper: #f4f0e6;
  --mute: #9b9c92;
  --faint: #6f7168;
  --brass: #e0a85a;
  --cinnabar: #e06a4f;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --display: "Noto Serif SC", "Songti SC", "Noto Serif CJK SC", serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.25; margin: 0; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button:not(:disabled), [role="button"] { cursor: pointer; }
::selection { background: color-mix(in oklab, var(--brass) 40%, transparent); }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem 6rem; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--ink) 90%, transparent);
  backdrop-filter: blur(12px);
}
.bar-row, .brand, .actions, .filters, .pills, .between {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.bar-row, .between { justify-content: space-between; }
.brand { gap: 0.75rem; }
.kicker, .section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--faint);
}
.lede, .muted { color: var(--mute); font-size: 0.875rem; }
.lede { max-width: 40rem; margin-top: 0.75rem; }
.alert { color: var(--cinnabar); font-size: 0.875rem; margin-top: 1rem; }
.note { color: var(--mute); font-size: 0.875rem; margin-top: 1rem; }
.stack { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.stack label, .check-inline { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.875rem; color: var(--mute); }
.check-inline { flex-direction: row; align-items: center; }
.block { padding: 1rem 1.1rem; margin-top: 1rem; }
.admin-card { max-width: 28rem; margin: 12vh auto; padding: 1.5rem; }
.admin-list { display: flex; flex-direction: column; }
.logout { margin-top: 1.5rem; }

.radar-mark {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, var(--brass) 0 1.5px, transparent 2px),
    repeating-radial-gradient(circle at center, transparent 0 6px, color-mix(in oklab, var(--brass) 45%, transparent) 7px 7.5px, transparent 8px);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--brass) 55%, transparent);
}
.radar-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: conic-gradient(from 20deg, transparent 0 68%, var(--brass) 92%, transparent 100%);
  mask: radial-gradient(circle, transparent 42%, #000 43%);
}
@media (prefers-reduced-motion: no-preference) {
  .radar-mark::after { animation: sweep 5.6s linear infinite; }
}
@keyframes sweep { to { transform: rotate(360deg); } }

.btn {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding-inline: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
}
.btn:active:not(:disabled) { scale: 0.96; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, .chip:focus-visible, .field:focus-visible, .lead:focus-visible, .icon-btn:focus-visible, .check:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
.btn-brass { background: var(--brass); color: var(--ink); }
.btn-brass:hover:not(:disabled) { background: color-mix(in oklab, var(--brass) 86%, white); }
.btn-ghost { background: var(--raise); color: var(--paper); }
.btn-line { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.btn-line:hover:not(:disabled) { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--paper) 35%, var(--line)); }

.chip {
  display: inline-flex;
  min-height: 2.5rem;
  flex: none;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding-inline: 0.85rem;
  font-size: 0.875rem;
}
.chip-on { background: var(--paper); color: var(--ink); }
.chip-off { background: var(--raise); color: var(--paper); }
.field {
  height: 2.75rem;
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--raise);
  color: var(--paper);
  padding-inline: 0.9rem;
  font-size: 0.875rem;
}
.field-search { padding-left: 2.5rem; }
.field-area { height: auto; min-height: 5.5rem; border-radius: 1rem; padding-block: 0.75rem; resize: vertical; }
select.field { width: auto; min-width: 9rem; }

.lead {
  width: 100%;
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: 1rem;
  text-align: left;
  color: inherit;
}
.lead:hover { background: var(--raise); }
.lead-on { background: var(--raise); box-shadow: inset 3px 0 0 var(--brass), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.icon-btn {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--paper);
}
.icon-btn:hover { background: var(--raise); }
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
}
.tag-brass { color: var(--brass); background: color-mix(in oklab, var(--brass) 16%, transparent); }
.tag-risk { color: var(--cinnabar); background: color-mix(in oklab, var(--cinnabar) 16%, transparent); }
.tag-mute { color: var(--mute); background: color-mix(in oklab, var(--paper) 6%, transparent); }
.panel { border-radius: 1.25rem; background: var(--panel); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06); }
.check {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 0.9rem;
  padding: 0.75rem;
  text-align: left;
}
.check:hover { background: var(--raise); }
.box {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
  border-radius: 0.3rem;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 0.75rem;
}
.box-on { background: var(--brass); color: var(--ink); box-shadow: none; }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--line);
}
.stat { background: var(--panel); padding: 0.75rem 1rem; }
.stat b { display: block; margin-top: 0.25rem; font-family: var(--display); font-size: 1.6rem; font-weight: 500; }
.stat span { color: var(--faint); font-size: 0.75rem; }
.leads { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.25rem; }
.leads .lead { min-width: 16rem; }
.filters { overflow-x: auto; padding-bottom: 0.25rem; }
.tools { display: flex; flex-direction: column; gap: 0.5rem; }
.search { position: relative; flex: 1; min-width: 0; }
.search svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--faint); }
.list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }
.item { display: flex; gap: 0.5rem; align-items: flex-start; }
.item .lead { flex: 1; min-width: 0; }
.split { min-width: 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border-radius: 1rem; background: var(--line); }
.fact { background: var(--panel); padding: 0.75rem; }
.fact span { display: block; color: var(--faint); font-size: 0.75rem; }
.fact b { font-weight: 500; }
.steps { list-style: none; margin: 0; padding: 0; }
.strike { color: var(--mute); text-decoration: line-through; }
.lead .title,
.lead .muted,
.lead > .kicker { display: block; }
.lead > .between { display: flex; }
.foot { margin-top: 1.5rem; color: var(--faint); font-size: 0.75rem; }
.mt { margin-top: 0.75rem; }
.mt-lg { margin-top: 1.5rem; }
.title { margin-top: 0.35rem; }
.sub { color: var(--mute); }
.foot { margin-top: 1.5rem; color: var(--faint); font-size: 0.75rem; }

@media (min-width: 40rem) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .leads { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .leads .lead { min-width: 0; }
  .tools { flex-direction: row; }
  h1 { font-size: 1.7rem; }
}
@media (min-width: 64rem) {
  .split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2rem; align-items: start; }
  .detail-col { position: sticky; top: 7rem; max-height: calc(100dvh - 7rem); overflow-y: auto; }
  .back-btn { display: none; }
}
@media (max-width: 63.99rem) {
  .list-col.is-hidden { display: none; }
  .detail-col.is-open {
    position: fixed;
    inset: 0;
    z-index: 40;
    overflow-y: auto;
    background: var(--ink);
    padding: 1rem;
  }
  .detail-col:not(.is-open) { display: none; }
}
