:root {
  color-scheme: light;
  --ink: #18201d;
  --muted: #66706c;
  --line: #d9dfdc;
  --surface: #ffffff;
  --soft: #f4f6f5;
  --accent: #0c6b58;
  --accent-dark: #084e41;
  --warning: #9a5b12;
  --warning-soft: #fff6e8;
  --danger: #a33434;
  --danger-soft: #fff0ef;
  --success: #176845;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0;
}

button, input, textarea { font: inherit; letter-spacing: 0; }

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.review-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 64px;
}

.lead-heading { padding-bottom: 28px; }

.eyebrow {
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: 30px; line-height: 1.25; }
h2 { margin: 0 0 12px; font-size: 17px; line-height: 1.35; }
p { margin: 0; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.source-link { color: var(--accent); font-weight: 650; }
.source-link:not([href]) { display: none; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge.pending { border-color: #e0bd89; background: var(--warning-soft); color: var(--warning); }
.badge.approved { border-color: #94c7b1; background: #edf8f3; color: var(--success); }
.badge.rejected { border-color: #e1aaaa; background: var(--danger-soft); color: var(--danger); }

.content-section, .review-actions {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.discussion { white-space: pre-wrap; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.chip {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: #44504b;
  font-size: 12px;
}

.analysis-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 4px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }

.policy-section { border-left: 3px solid #d49543; padding-left: 18px; }
.risk-list { margin: 12px 0 0; padding-left: 20px; color: var(--danger); }
.risk-list:empty { display: none; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-heading h2 { margin: 0; }

textarea, input[type="text"] {
  width: 100%;
  border: 1px solid #bfc8c3;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

textarea { padding: 11px 12px; resize: vertical; }
input[type="text"] { min-height: 42px; padding: 8px 11px; }
textarea:focus, input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(12, 107, 88, 0.12); }

.check-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; color: #3e4945; }
.check-row input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }

.field-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 18px; align-items: start; margin: 14px 0; }
.field-row label { padding-top: 8px; color: var(--muted); font-weight: 650; }

.button-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}
.button:disabled { cursor: not-allowed; opacity: 0.48; }
.button.primary { background: var(--accent); color: white; }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button.danger { border-color: #d5a3a3; background: var(--surface); color: var(--danger); }

.message { margin-bottom: 20px; padding: 10px 12px; border-radius: 6px; }
.message.error { border: 1px solid #e1aaaa; background: var(--danger-soft); color: var(--danger); }
.message.success { border: 1px solid #94c7b1; background: #edf8f3; color: var(--success); }
.muted { margin-top: 10px; color: var(--muted); font-size: 13px; }

.status-shell {
  width: min(520px, calc(100% - 32px));
  margin: 12vh auto 0;
  text-align: center;
}
.status-shell .brand-mark { margin: 0 auto 18px; width: 48px; height: 48px; }
.status-shell h1 { margin-bottom: 6px; }
.status-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; font-weight: 700; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); }

[hidden] { display: none !important; }

@media (max-width: 680px) {
  .topbar { padding: 10px 16px; }
  .review-shell { width: min(100% - 24px, 980px); padding-top: 26px; }
  h1 { font-size: 24px; }
  .analysis-grid { grid-template-columns: 1fr; gap: 24px; }
  .field-row { grid-template-columns: 1fr; gap: 6px; }
  .field-row label { padding-top: 0; }
  .button-row { display: grid; grid-template-columns: 1fr 1fr; }
  .section-heading { align-items: flex-start; }
}

