:root {
  color-scheme: light;
  --ink: #16231f;
  --muted: #66746f;
  --green-950: #0d2c22;
  --green-900: #12372a;
  --green-800: #1b4a39;
  --green-700: #28634d;
  --green-100: #dfeee7;
  --green-50: #eef7f2;
  --paper: #fbfaf6;
  --white: #ffffff;
  --line: #dce2de;
  --line-dark: #bdc9c3;
  --amber: #b96b20;
  --amber-bg: #fff2df;
  --shadow: 0 24px 70px rgba(25, 48, 39, 0.13);
  --shadow-soft: 0 8px 28px rgba(25, 48, 39, 0.08);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 12px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(192, 224, 208, 0.34), transparent 28rem),
    linear-gradient(180deg, #faf9f4 0, #f7f6f1 100%);
}

button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.skip-link {
  position: fixed;
  left: 18px;
  top: -60px;
  z-index: 99;
  padding: 10px 14px;
  background: var(--green-950);
  color: white;
  border-radius: 8px;
}

.skip-link:focus { top: 18px; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 0.95fr) minmax(560px, 1.45fr);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 6vw, 82px);
  background: var(--green-950);
  color: white;
  position: relative;
  overflow: hidden;
}

.login-panel::after {
  content: "";
  width: 420px;
  height: 420px;
  position: absolute;
  right: -220px;
  bottom: -190px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 62px rgba(255, 255, 255, 0.035), 0 0 0 124px rgba(255, 255, 255, 0.025);
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; letter-spacing: -0.01em; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #e9f4ee;
  color: var(--green-950);
  font-family: Georgia, serif;
  font-weight: 800;
}

.login-message { max-width: 520px; position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: #91c6ad;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }

.login-message h1 {
  margin: 0;
  max-width: 520px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.login-message p { margin: 26px 0 0; max-width: 450px; color: #c0d4ca; font-size: 17px; line-height: 1.65; }
.login-foot { color: #89a59a; font-size: 12px; position: relative; z-index: 1; }

.login-form-wrap { display: grid; place-items: center; padding: 36px; }
.login-card {
  width: min(100%, 470px);
  padding: clamp(28px, 4.5vw, 50px);
  border: 1px solid rgba(185, 198, 191, 0.8);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.login-card h2 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 34px; font-weight: 500; letter-spacing: -0.025em; }
.login-card > p { margin: 0 0 32px; color: var(--muted); line-height: 1.55; }
.field-label { display: block; margin-bottom: 8px; color: #34483f; font-size: 13px; font-weight: 750; }
.field {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field:focus { border-color: var(--green-700); box-shadow: 0 0 0 4px rgba(40, 99, 77, .12); }
.field::placeholder { color: #97a39e; }
.primary-button {
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  border: 0;
  border-radius: 11px;
  background: var(--green-900);
  color: white;
  font-weight: 750;
  box-shadow: 0 9px 20px rgba(18, 55, 42, .18);
  transition: transform .15s, background .15s;
}
.primary-button:hover { background: var(--green-800); transform: translateY(-1px); }
.primary-button:disabled { opacity: .56; cursor: wait; transform: none; }
.form-note { display: flex; gap: 9px; margin-top: 22px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-note .lock { color: var(--green-700); font-weight: 900; }
.form-error { min-height: 20px; margin: 12px 0 -4px; color: #a3362b; font-size: 13px; }
.back-button { margin: 0 0 22px; padding: 0; border: 0; background: transparent; color: var(--green-700); font-weight: 700; }
.demo-callout { margin-top: 22px; padding: 12px 14px; border-radius: 10px; background: var(--amber-bg); color: #704113; font-size: 12px; line-height: 1.5; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 64px);
  color: white;
  background: var(--green-950);
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.viewer { color: #b8cdc3; font-size: 13px; }
.ghost-button {
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 9px;
  background: transparent;
  color: white;
  font-size: 13px;
  font-weight: 700;
}
.ghost-button:hover { background: rgba(255,255,255,.08); }

.hero {
  padding: clamp(38px, 6vw, 76px) clamp(20px, 7vw, 110px) 112px;
  color: white;
  background: var(--green-950);
}
.hero-inner { max-width: 1240px; margin: auto; display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.hero h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(38px, 5vw, 64px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.hero p { margin: 18px 0 0; max-width: 620px; color: #b9cec4; line-height: 1.6; }
.verified-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 999px; color: #dff1e8; background: rgba(89, 163, 127, .17); border: 1px solid rgba(137, 199, 166, .25); font-size: 12px; font-weight: 750; white-space: nowrap; }
.verified-pill::before { content: "✓"; width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: #66a986; color: #08291e; font-size: 11px; }

.content { max-width: 1240px; margin: -66px auto 0; padding: 0 clamp(20px, 4vw, 52px) 80px; position: relative; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.summary-card { padding: 23px 25px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow-soft); }
.summary-card .label { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .075em; }
.summary-card .value { margin-top: 8px; font-family: Georgia, serif; font-size: 32px; letter-spacing: -.025em; }
.summary-card .sub { margin-top: 5px; color: var(--muted); font-size: 12px; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 42px 0 17px; }
.section-head h2 { margin: 0; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.opportunity-list { display: grid; gap: 12px; }
.opportunity-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 28px;
  padding: 22px 24px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  color: inherit;
  box-shadow: 0 3px 12px rgba(25,48,39,.035);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.opportunity-card:hover { transform: translateY(-2px); border-color: #adc1b7; box-shadow: var(--shadow-soft); }
.opportunity-name { font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.opportunity-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 7px; color: var(--muted); font-size: 12px; }
.status { padding: 6px 9px; border-radius: 999px; background: var(--green-50); color: var(--green-700); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.score-block { min-width: 92px; text-align: right; }
.score-block strong { font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.score-block span { color: var(--muted); font-size: 13px; }
.chevron { color: var(--green-700); font-size: 21px; }

.detail-hero { padding-bottom: 98px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 30px; padding: 0; border: 0; background: none; color: #a9c4b7; font-weight: 700; }
.detail-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.detail-title h1 { font-size: clamp(35px, 4vw, 56px); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 18px; color: #b7cbc1; font-size: 13px; }
.score-medallion { min-width: 160px; padding: 22px; text-align: center; border: 1px solid rgba(255,255,255,.18); border-radius: 22px; background: rgba(255,255,255,.06); }
.score-medallion .number { font-family: Georgia, serif; font-size: 54px; line-height: .9; }
.score-medallion .denom { margin-top: 8px; color: #a9beb4; font-size: 12px; }
.score-medallion .bonus { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); color: #bfe4d1; font-size: 12px; font-weight: 750; }

.audit-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow-soft); }
.audit-fact { padding: 18px 20px; border-right: 1px solid var(--line); }
.audit-fact:last-child { border-right: 0; }
.audit-fact span { display: block; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.audit-fact strong { display: block; margin-top: 6px; font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }

.score-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.component { padding: 23px 22px; border-bottom: 1px solid var(--line); }
.component:last-child { border-bottom: 0; }
.component-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.component h3 { margin: 0; font-size: 15px; }
.component p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.points { white-space: nowrap; font-family: Georgia, serif; font-size: 21px; color: var(--green-800); }
.points small { color: var(--muted); font-family: inherit; font-size: 12px; }
.progress { height: 5px; margin: 16px 0 12px; overflow: hidden; border-radius: 99px; background: #edf0ee; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--green-700); }
.rule { color: #87938e; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.evidence-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.evidence-button { padding: 8px 10px; border: 1px solid #c9d8d1; border-radius: 9px; background: var(--green-50); color: var(--green-800); font-size: 11px; font-weight: 750; }
.evidence-button:hover { background: var(--green-100); }
.subscores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 15px; }
.subscore { padding: 9px; border-radius: 8px; background: #f6f7f5; }
.subscore span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.subscore strong { display: block; margin-top: 3px; font-size: 12px; }
.bonus-tag { display: inline-block; margin-left: 7px; padding: 3px 6px; border-radius: 5px; color: #79501c; background: var(--amber-bg); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }

.side-stack { display: grid; gap: 16px; }
.side-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; }
.side-card h3 { margin: 0 0 14px; font-family: Georgia, serif; font-size: 19px; font-weight: 500; }
.side-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.integrity { display: flex; align-items: center; gap: 11px; }
.integrity-mark { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--green-100); color: var(--green-800); font-weight: 900; }
.hash { margin-top: 13px; padding: 10px; border-radius: 8px; background: #f5f6f4; color: #6c7973; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; overflow-wrap: anywhere; }
.zero-list { display: grid; gap: 12px; }
.zero-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.zero-row:last-child { padding-bottom: 0; border-bottom: 0; }
.zero-row strong { font-size: 12px; }
.zero-row span { color: var(--muted); font-size: 11px; }
.zero-row p { grid-column: 1 / -1; font-size: 11px; }
.history-list { display: grid; gap: 8px; }
.history-button {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  padding: 11px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbf9;
  color: inherit;
}
.history-button:hover, .history-button.active { border-color: #a9c1b5; background: var(--green-50); }
.history-button strong { font-size: 12px; }
.history-button .history-score { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-family: Georgia, serif; font-size: 20px; color: var(--green-800); }
.history-button small { color: var(--muted); font-size: 10px; }
.archive-panel { margin-top: 28px; }
.archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.archive-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 17px 20px;
  text-align: left;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: white;
  color: inherit;
}
.archive-item:nth-child(2n) { border-right: 0; }
.archive-item:hover { background: var(--green-50); }
.archive-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--green-100); color: var(--green-800); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.archive-copy { min-width: 0; }
.archive-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.archive-copy small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.archive-arrow { color: var(--green-700); font-size: 18px; }
.transcript { display: grid; gap: 12px; }
.transcript-line { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.transcript-line strong { color: var(--green-800); font-size: 11px; }
.transcript-line p { margin: 0; white-space: pre-wrap; font-family: Georgia, serif; font-size: 14px; line-height: 1.55; }
.coverage-note { margin: 0; padding: 15px 20px; color: var(--muted); background: #f7f8f6; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.5; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(5, 22, 16, .72); backdrop-filter: blur(5px); }
.modal { width: min(820px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: var(--paper); box-shadow: 0 38px 100px rgba(0,0,0,.36); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 25px; color: white; background: var(--green-950); }
.modal-head h2 { margin: 0; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.modal-head p { margin: 7px 0 0; color: #b5c9bf; font-size: 12px; }
.modal-close { width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; background: transparent; color: white; font-size: 18px; }
.modal-body { overflow: auto; padding: 25px; }
.evidence-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.meta-cell { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.meta-cell span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.meta-cell strong { display: block; margin-top: 5px; font-size: 12px; overflow-wrap: anywhere; }
.email-paper { padding: 25px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.email-paper h3 { margin: 0; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.email-routing { margin-top: 15px; padding-bottom: 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.7; }
.email-body { margin: 22px 0 0; white-space: pre-wrap; font-family: Georgia, serif; font-size: 16px; line-height: 1.72; color: #27332e; }
.source-note { margin-top: 18px; padding: 11px 13px; border-radius: 9px; background: var(--amber-bg); color: #6d471a; font-size: 11px; line-height: 1.5; }
.record-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.record-item { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.record-item span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.record-item strong { display: block; margin-top: 5px; font-size: 13px; overflow-wrap: anywhere; }
.verified-hash { margin-top: 16px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; overflow-wrap: anywhere; }
.loading { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; max-width: 360px; padding: 12px 15px; border-radius: 10px; background: var(--green-950); color: white; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-panel { min-height: 42vh; gap: 70px; }
  .login-form-wrap { padding: 32px 20px 55px; }
  .hero-inner, .detail-title-row { align-items: flex-start; flex-direction: column; }
  .score-layout { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .audit-strip { grid-template-columns: repeat(2, 1fr); }
  .audit-fact:nth-child(2) { border-right: 0; }
  .audit-fact:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .login-panel { min-height: 48vh; padding: 28px 22px 42px; }
  .login-message h1 { font-size: 43px; }
  .topbar { height: 66px; padding: 0 16px; }
  .viewer { display: none; }
  .hero { padding-left: 20px; padding-right: 20px; }
  .content { padding-left: 14px; padding-right: 14px; }
  .opportunity-card { grid-template-columns: 1fr auto; gap: 14px; padding: 18px; }
  .opportunity-card .status { display: none; }
  .chevron { display: none; }
  .score-medallion { width: 100%; }
  .audit-strip { grid-template-columns: 1fr; }
  .audit-fact { border-right: 0; border-bottom: 1px solid var(--line); }
  .audit-fact:last-child { border-bottom: 0; }
  .subscores { grid-template-columns: repeat(2, 1fr); }
  .evidence-meta, .record-grid { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: 1fr; }
  .archive-item, .archive-item:nth-child(2n) { border-right: 0; }
  .transcript-line { grid-template-columns: 1fr; gap: 6px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 20px 20px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
