:root {
  color-scheme: light;
  --ink: #162521;
  --muted: #60706b;
  --paper: #f5f2e9;
  --surface: #fffdf7;
  --line: #d9ded7;
  --green: #0d654c;
  --green-dark: #084838;
  --green-soft: #dcece4;
  --amber: #9a5a12;
  --amber-soft: #f8e8cd;
  --red: #9f342c;
  --red-soft: #f7dfdc;
  --unknown: #59636e;
  --shadow: 0 20px 55px rgb(27 55 46 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgb(255 255 255 / 90%), transparent 34rem),
    linear-gradient(150deg, #f7f4ec 0%, #edf3ed 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 720;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: var(--green);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-view {
  display: grid;
  min-height: calc(100vh - 150px);
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 440px);
  gap: clamp(48px, 8vw, 120px);
  align-items: center;
  padding: 40px 0 100px;
}

.login-copy {
  max-width: 650px;
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.99;
}

.login-copy > p:last-child {
  max-width: 580px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.login-card,
.overview-card,
.priority-card,
.area-card,
.evidence-panel {
  border: 1px solid rgb(217 222 215 / 90%);
  background: rgb(255 253 247 / 93%);
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 11px;
  padding: clamp(28px, 5vw, 44px);
  border-radius: 24px;
}

.login-card h2 {
  margin-bottom: 18px;
  font-size: 1.45rem;
}

.login-card label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  height: 50px;
  margin-bottom: 8px;
  padding: 0 14px;
  border: 1px solid #bcc8c1;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}

.login-card input:focus-visible,
.button:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(13 101 76 / 25%);
  outline-offset: 2px;
}

.button {
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 10px;
  font-weight: 720;
}

.button-primary {
  min-height: 50px;
  margin-top: 9px;
  color: #fff;
  background: var(--green);
}

.button-primary:hover {
  background: var(--green-dark);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-quiet {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgb(255 255 255 / 55%);
}

.form-error,
.error-state {
  color: var(--red);
}

.form-error {
  margin: 2px 0 0;
  font-size: 0.9rem;
}

.dashboard-view {
  padding: 38px 0 100px;
}

.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.dashboard-heading h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.7rem);
}

.freshness-badge,
.state-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.freshness-badge {
  min-height: 34px;
  padding: 0 13px;
  color: var(--green);
  background: var(--green-soft);
}

.freshness-badge.is-stale {
  color: var(--amber);
  background: var(--amber-soft);
}

.loading-state,
.error-state {
  padding: 80px 0;
  text-align: center;
}

.overview-card {
  padding: clamp(24px, 5vw, 42px);
  border-radius: 22px;
}

.overview-headline {
  max-width: 900px;
  margin-bottom: 34px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  line-height: 1.35;
}

.snapshot-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.snapshot-meta div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.snapshot-meta dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 730;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.snapshot-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.priority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.priority-card {
  padding: 26px;
  border-radius: 18px;
  box-shadow: none;
}

.priority-card h2,
.area-card h2 {
  margin-bottom: 18px;
  font-size: 1.14rem;
}

.claim-list,
.source-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.claim-list li {
  padding-left: 16px;
  border-left: 3px solid var(--line);
  color: #34433e;
  line-height: 1.55;
}

.claim-owner {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.areas {
  display: grid;
  gap: 20px;
  margin-top: 38px;
}

.area-card {
  padding: clamp(24px, 5vw, 38px);
  border-radius: 20px;
  box-shadow: none;
}

.area-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.area-summary {
  max-width: 850px;
  color: var(--muted);
  line-height: 1.6;
}

.state-badge {
  min-height: 29px;
  flex: none;
  padding: 0 11px;
}

.state-on_track {
  color: var(--green);
  background: var(--green-soft);
}

.state-at_risk {
  color: var(--amber);
  background: var(--amber-soft);
}

.state-blocked {
  color: var(--red);
  background: var(--red-soft);
}

.state-unknown {
  color: var(--unknown);
  background: #e7eaed;
}

.area-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 26px;
}

.area-section h3 {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.evidence-panel {
  margin-top: 30px;
  padding: 22px 26px;
  border-radius: 18px;
  box-shadow: none;
}

.evidence-panel summary {
  cursor: pointer;
  font-weight: 720;
}

.sources {
  margin-top: 22px;
}

.source-list li {
  display: grid;
  gap: 3px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.source-label {
  font-weight: 690;
}

.source-detail {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 28px, 680px);
  }

  .login-view {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 48px;
    padding-top: 55px;
  }

  .login-copy {
    text-align: center;
  }

  .login-copy > p:last-child {
    margin-right: auto;
    margin-left: auto;
  }

  .dashboard-heading {
    align-items: start;
    flex-direction: column;
  }

  .snapshot-meta,
  .priority-grid,
  .area-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .site-header {
    min-height: 76px;
  }

  .user-controls {
    gap: 8px;
  }

  #signed-in-user {
    display: none;
  }

  .login-view {
    padding-top: 30px;
  }

  .login-card {
    padding: 25px 20px;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .login-card,
  .overview-card,
  .area-card {
    animation: settle 420ms ease-out both;
  }

  @keyframes settle {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
