:root {
  --bf-yellow: #FAEB31;
  --bf-yellow-dim: #e6d62c;
  --ink: #111111;
  --ink-soft: #374151;
  --muted: #6B7280;
  --line: #E5E7EB;
  --bg: #FAFAF7;
  --card: #FFFFFF;
  --warn-bg: #FFF7ED;
  --warn-border: #FDBA74;
  --info-bg: #EFF6FF;
  --info-border: #93C5FD;
  --ok-bg: #ECFDF5;
  --chip-bg: #F3F4F6;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.06), 0 8px 24px rgba(17, 17, 17, 0.04);
  --radius: 14px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: #1D4ED8; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #1E3A8A; }

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 18px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bf-yellow);
  border: 1px solid #111;
  box-shadow: inset 0 0 0 2px #fff;
}
.brand span { font-size: 15px; }
.crumb {
  color: var(--muted);
  font-size: 13px;
  margin-left: auto;
}

.hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--bf-yellow);
}
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 62ch;
}

.callout {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  border: 1px solid var(--info-border);
  background: var(--info-bg);
}
.callout strong { color: var(--ink); }
.callout.warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.stat .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat .v { font-size: 18px; font-weight: 700; margin-top: 2px; letter-spacing: -0.02em; }
.stat .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.card-link {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.card-link:hover {
  transform: translateY(-2px);
  border-color: #111;
}
.card-link .eyebrow {
  display: inline-block;
  background: var(--bf-yellow);
  color: #111;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 10px;
  border: 1px solid #111;
}
.card-link h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.card-link p { margin: 0; color: var(--muted); font-size: 13.5px; }
.card-link .go {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #111;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.controls {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1.4fr;
  gap: 10px;
}
@media (max-width: 720px) {
  .controls { grid-template-columns: 1fr; }
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
input[type="search"], select {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  text-transform: none;
  letter-spacing: 0;
}
input[type="search"]:focus, select:focus {
  outline: 2px solid var(--bf-yellow);
  border-color: #111;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--ink-soft);
}
.chip.accent {
  background: var(--bf-yellow);
  border-color: #111;
  color: #111;
  font-weight: 700;
}
.chip.warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: #9A3412;
}

.detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}
.detail-head h2 {
  margin: 0;
  font-size: clamp(18px, 3vw, 24px);
  letter-spacing: -0.03em;
  max-width: 42ch;
}
.flags { display: flex; flex-wrap: wrap; gap: 6px; }

.section {
  margin-top: 18px;
}
.section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.section .hint {
  margin: -2px 0 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.props {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 14px;
}
.prop {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.prop .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.prop .v { font-size: 14px; font-weight: 560; margin-top: 2px; word-break: break-word; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 520px;
}
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  background: #F9FAFB;
}
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.note-list, .voice-list { display: grid; gap: 10px; }
.note, .voice {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px 12px 14px;
  background: #fff;
  position: relative;
}
.note::before, .voice::before {
  content: attr(data-n);
  position: absolute;
  left: -1px; top: -1px;
  background: var(--bf-yellow);
  border: 1px solid #111;
  border-bottom-right-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
}
.note { padding-left: 36px; }
.voice { padding-left: 36px; }
.note .by, .voice .by {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.note .text, .voice .text {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.voice .points {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--ok-bg);
  border-radius: 8px;
  font-size: 13.5px;
}
.voice .audio-only {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--chip-bg);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.link-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  min-height: 72px;
}
.link-card:hover { border-color: #111; background: #FFFEF5; }
.link-card .n {
  font-size: 11px;
  font-weight: 800;
  color: #111;
  background: var(--bf-yellow);
  border: 1px solid #111;
  border-radius: 999px;
  width: fit-content;
  padding: 1px 7px;
}
.link-card .t {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.link-card .m {
  font-size: 11.5px;
  color: var(--muted);
}

.empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fff;
}

.footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.footer a { color: inherit; }

.cat-line {
  font-size: 14.5px;
  font-weight: 560;
  line-height: 1.45;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F9FAFB;
    --ink-soft: #D1D5DB;
    --muted: #9CA3AF;
    --line: #2A2F3A;
    --bg: #0F1115;
    --card: #171A21;
    --chip-bg: #222632;
    --info-bg: #111827;
    --info-border: #1E3A8A;
    --warn-bg: #1C1410;
    --warn-border: #9A3412;
    --ok-bg: #0F1F18;
    --shadow: none;
  }
  input[type="search"], select, .stat, .note, .voice, .link-card, th {
    background: #12151C;
    color: var(--ink);
  }
  .link-card:hover { background: #1C1F28; }
  .empty { background: #12151C; }
}
