:root {
  --ink: #1c1914;
  --ink-soft: #5c564c;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #e3d9c8;
  --sidebar: #13211e;
  --sidebar-text: #e4efe9;
  --sidebar-muted: #8eaaa2;
  --teal: #0e6b62;
  --teal-deep: #0b3f3a;
  --amber: #a86412;
  --rose: #8d3434;
  --green: #246443;
  --shadow: 0 16px 40px rgba(48, 36, 18, 0.06);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--teal-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 2.4rem; line-height: 1.1; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand strong { display: block; font-family: var(--serif); font-size: 1.15rem; }
.brand em { display: block; font-style: normal; color: var(--sidebar-muted); font-size: 0.85rem; }
.mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: #e7c27a; color: #1c1914;
  font-family: var(--serif); font-weight: 640;
}
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 10px;
}
.sidebar nav a.active, .sidebar nav a:hover { background: rgba(255,255,255,0.08); }
.sidebar-foot { margin-top: auto; color: var(--sidebar-muted); font-size: 0.9rem; }
.sidebar-foot .muted { margin-bottom: 8px; }
.canvas { padding: 36px 48px 72px; max-width: 1180px; }

.page-head { margin-bottom: 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; color: var(--amber); margin-bottom: 8px; }
.lede { max-width: 62ch; color: var(--ink-soft); margin-top: 10px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stats article, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.stats article { padding: 18px 18px 14px; }
.stats span { display: block; color: var(--ink-soft); font-size: 0.85rem; }
.stats strong { font-family: var(--serif); font-size: 2.2rem; }
.stats .attention { outline: 2px solid #e7c7c7; }
.card { padding: 18px 20px 16px; margin-bottom: 16px; }
.card-head, .card-meta, .actions, .form-row, .toolbar, .filters {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
}
.card-head { margin-bottom: 12px; }
.card-meta { justify-content: flex-start; color: var(--ink-soft); margin-top: 12px; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; }
.rows, .activity { list-style: none; margin: 0; padding: 0; }
.rows li, .activity li {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.rows a, .finding-card { text-decoration: none; color: inherit; }
.rows strong, .activity strong { display: block; }
.rows span, .activity span, .sub, .hint { color: var(--ink-soft); font-size: 0.9rem; }
.activity time { color: var(--ink-soft); font-size: 0.82rem; min-width: 92px; }

.finding-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.finding-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 18px; box-shadow: var(--shadow);
}
.finding-card h2 { font-size: 1.25rem; margin: 8px 0; }
.finding-card p { color: var(--ink-soft); }
.finding-card footer { display: flex; justify-content: space-between; margin-top: 14px; color: var(--ink-soft); font-size: 0.82rem; }
.finding-card blockquote, .lead-quote { margin: 8px 0 0; color: var(--ink); font-family: var(--serif); }
.badge { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 0.75rem; letter-spacing: 0.04em; background: var(--teal-deep); color: white; }
.badge.strong { background: var(--green); }
.badge.medium { background: var(--amber); }
.badge.weak { background: var(--ink-soft); }
.briefing { display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.assessment { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.assessment article { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.assessment .recommendation { grid-column: 1 / -1; background: #f4f7f2; }
.assessment h2, .evidence-block h4, .evidence-row h3 { font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }

.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: 0.78rem; background: #eee7da; color: var(--ink); }
.pill.ok { background: #e3f1e6; color: var(--green); }
.pill.bad { background: #f8e4e4; color: var(--rose); }
.pill.wait { background: #f8ecd6; color: var(--amber); }
.pill.mute { background: #eceae4; color: var(--ink-soft); }

.primary, .secondary, .text-button, .chip {
  border-radius: 999px; border: 1px solid transparent; padding: 8px 14px;
}
.primary { background: var(--teal); color: white; }
.secondary, .chip { background: transparent; border-color: var(--line); }
.chip.on { background: var(--teal-deep); color: white; border-color: var(--teal-deep); }
.text-button { background: none; border: 0; color: var(--teal-deep); padding: 0; }
.sidebar .text-button { color: #e7c27a; }
.filters { justify-content: flex-start; margin-bottom: 16px; }
.toolbar, .form-row { justify-content: flex-start; margin-bottom: 16px; }
.toolbar input, .form-row input, .login-form input, select, textarea, label input {
  width: 100%; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.toolbar input { flex: 1; }
.form-row label, .login-form label, .approval label { display: grid; gap: 6px; font-size: 0.85rem; color: var(--ink-soft); flex: 1; }
.file input { display: none; }
.file { display: inline-flex; align-items: center; }
.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; }
.grid td, .grid th { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.error-row td { color: var(--rose); font-size: 0.9rem; }
.empty, .loading { color: var(--ink-soft); padding: 12px 0; }
.notice { background: #eef6f3; border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.notice.bad { background: #f8e4e4; color: var(--rose); }
.evidence-block { padding: 14px 0; border-top: 1px solid var(--line); }
.evidence-block header, .evidence-row header { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid #e7c27a; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 10px 0; }
.meta-grid dt, .registry dt { color: var(--ink-soft); font-size: 0.78rem; }
.registry dl, .registry pre { margin: 10px 0 0; }
.registry pre { white-space: pre-wrap; background: #f6f1e8; padding: 10px; border-radius: 10px; font-size: 0.82rem; }
.approval { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
code { font-size: 0.85rem; background: #f6f1e8; padding: 2px 6px; border-radius: 6px; }

.account-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px; background:
  radial-gradient(circle at top left, #efe4cc, transparent 40%), var(--paper); }
.account-panel { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 32px; box-shadow: var(--shadow); }
.account-brand { margin-bottom: 18px; }
.account-brand em { color: var(--ink-soft); }
.login-form, .external { display: grid; gap: 12px; margin-top: 18px; }
.external { margin-top: 18px; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .canvas { padding: 24px 16px 48px; }
  .stats, .split, .finding-grid, .assessment { grid-template-columns: 1fr; }
  .briefing { flex-direction: column; align-items: stretch; }
}
