:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1b2233;
  --ink-2: #5a6478;
  --line: #e4e8f0;
  --brand: #1f2a4d;
  --brand-2: #27345f;
  --accent: #3b6ef5;
  --accent-soft: #e8efff;
  --marker: #8a93a6;
  --warn: #b26a00;
  --warn-soft: #fff4e0;
  --danger: #b3261e;
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 22px; margin: 0; font-weight: 650; }
h2 { font-size: 14px; margin: 0 0 10px; font-weight: 650; letter-spacing: 0.01em; }
.muted { color: var(--ink-2); }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--brand); color: #dfe5f5; padding: 16px 12px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: #fff; padding: 4px 8px 10px; font-size: 15px; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #fff; color: var(--brand); font-size: 12px; font-weight: 800; }
.nav-group { margin-bottom: 10px; }
.nav-label { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #9aa6c7; padding: 10px 10px 6px; }
.nav-item { display: block; padding: 8px 10px; border-radius: 8px; color: #dfe5f5; }
.nav-item:hover { background: var(--brand-2); color: #fff; }
.sidebar-foot { margin-top: auto; font-size: 11px; padding: 8px 10px; color: #9aa6c7; }
.sidebar-foot .muted { color: #9aa6c7; display: block; margin-top: 6px; }
.foot-link { display: inline-block; color: #dfe5f5; padding: 4px 0; }
.foot-link:hover { color: #fff; text-decoration: underline; }

/* Sign-in and account pages share the shell; the card holds a short form. */
.page-auth .card { max-width: 520px; }
.page-auth form.search { flex: none; }

.content { padding: 24px 28px 48px; max-width: 1240px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.page-details { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: #2a4db8; }
.badge.muted { background: #e9ecf3; color: var(--ink-2); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.marker { color: var(--marker); font-style: italic; }
.marker-not_registered, .marker-not_offered { color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: 0 4px; font-style: normal; font-size: 12px; }
.marker-card { padding: 10px 14px; }
.val-link { color: var(--accent); }
.val-link:hover { text-decoration: underline; }

.table-card { padding: 0; overflow: hidden; }
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search { display: flex; gap: 6px; flex: 1; min-width: 260px; max-width: 520px; }
.search input { flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.search button { padding: 8px 12px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font: inherit; cursor: pointer; }
.table-meta { display: flex; gap: 12px; align-items: center; color: var(--ink-2); font-size: 12.5px; }
.cols { display: flex; gap: 6px; align-items: center; }
.chip { padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; }
.chip.on { background: var(--accent-soft); border-color: transparent; color: #2a4db8; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.row-link { font-weight: 600; color: var(--ink); }
.row-link:hover { color: var(--accent); }

.hero { padding: 18px 20px; }
.hero-top { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #5b7cfa, #2a4db8); color: #fff; display: grid; place-items: center; font-weight: 700; }
.crumb { display: block; font-size: 12px; color: var(--accent); margin-bottom: 2px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 18px; margin: 0; }
.fact dt { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; }
.fact dd { margin: 2px 0 0; }

.depth-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; margin: 0 0 14px; }
.seg { padding: 7px 14px; font-size: 13px; color: var(--ink-2); border-right: 1px solid var(--line); }
.seg:last-child { border-right: 0; }
.seg.on { background: var(--brand); color: #fff; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { margin: 0; }
.tile-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.tile-value { font-size: 22px; font-weight: 700; margin-top: 6px; }
.tile-value .marker { font-size: 14px; font-weight: 400; }
.tile-sub { font-size: 12px; color: var(--ink-2); margin-top: 6px; display: block; }
.tile-link:hover { border-color: var(--accent); }

.fieldlist dl { margin: 0; display: grid; grid-template-columns: 220px 1fr; gap: 0; }
.fieldlist .row { display: contents; }
.fieldlist dt { color: var(--ink-2); padding: 7px 0; border-top: 1px solid var(--line); }
.fieldlist dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--line); }
.fieldlist .row:first-child dt, .fieldlist .row:first-child dd { border-top: 0; }
.depth-tag { font-size: 10.5px; color: var(--ink-2); font-weight: 500; margin-left: 6px; background: #eef1f7; padding: 1px 6px; border-radius: 999px; }

.overview-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
.overview-grid .card { margin: 0; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 6px 0; border-top: 1px solid var(--line); }
.plain li:first-child { border-top: 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content { padding: 16px; }
  .fieldlist dl { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
}
