:root {
  --paper: #f3eadb;
  --ink: #1f2a24;
  --muted: #5d675f;
  --card: #fffaf2;
  --line: #d7cbb8;
  --terra: #b4451b;
  --terra-dark: #8d3010;
  --pine: #2c5a4c;
  --warn: #8a5a12;
  --warn-bg: #f4e4c4;
  --good-bg: #dce8e2;
  --bad-bg: #f3d8d0;
  --shadow: 0 18px 40px rgba(47, 36, 22, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top left, #f7f0e4 0%, transparent 40%),
    linear-gradient(180deg, #f7f1e6 0%, var(--paper) 100%);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.5;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.mark {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a[aria-current="page"],
.nav a:hover {
  color: var(--ink);
}

.hero h1,
.attention h1,
.attention h2,
.more-details h2,
.more-details h3,
.meaning-col h2,
.evidence-col h2,
.today-board h2,
.reply h2,
.today-strip h2 {
  font-family: Georgia, "Iowan Old Style", serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0.2rem 0 0.75rem; }
.hero { margin: 2rem 0 1.5rem; }
.hero.compact { margin: 1.5rem 0; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--terra);
  margin: 0;
}
.lede { font-size: 1.1rem; max-width: 40rem; color: var(--muted); }
.quiet, .foot, small { color: var(--muted); }
.quality {
  display: inline-block;
  margin: 0.5rem 0;
  padding: 0.35rem 0.7rem;
  background: var(--warn-bg);
  border-radius: 999px;
}

.upload-card,
.file-well,
.intake,
.ask-form,
.reply,
.today-board section,
.segment {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.upload-card {
  display: block;
  padding: 2rem;
  border-radius: 1.5rem;
  text-decoration: none;
  color: inherit;
}

.upload-card strong {
  display: block;
  font-size: 1.8rem;
  font-family: Georgia, serif;
  margin: 0.3rem 0 0.5rem;
}

.upload-kicker {
  color: var(--terra);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.today-strip {
  margin-top: 1.5rem;
}

.counts {
  display: flex;
  gap: 1.5rem;
  padding: 0;
  list-style: none;
}

.counts b { display: block; font-size: 1.6rem; }

.intake, .ask-form {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 1.25rem;
}

.file-well, .stack, textarea, select, input[type="file"] {
  width: 100%;
}

.file-well {
  display: grid;
  gap: 0.4rem;
  padding: 1.25rem;
  border-radius: 1rem;
  cursor: pointer;
}

textarea, select,
input[type="email"],
input[type="password"],
input[type="text"] {
  font: inherit;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #fff;
  color: var(--ink);
  width: 100%;
}

.logout-form {
  display: inline;
  margin: 0;
}

.nav-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}

.nav-button:hover {
  color: var(--ink);
}

.session-name {
  color: var(--muted);
}

.primary {
  justify-self: start;
  background: var(--terra);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  font: inherit;
  cursor: pointer;
}

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

.secondary {
  display: inline-block;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.secondary:hover { background: #f6f0e6; }

.auth-divider {
  margin: 1rem 0 0.5rem;
}

.account-auth,
.connect-google-form {
  margin-top: 1.25rem;
}

.privacy, .banner {
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
}

.privacy { background: #efe6d6; }
.banner.error { background: var(--bad-bg); }
.banner.success { background: var(--good-bg); }

.proposal-card {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fffaf3;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

.proposal-card h3 {
  margin: 0 0 0.4rem;
}

.proposal-action {
  font-size: 1.05rem;
  margin: 0.35rem 0 0.6rem;
}

.document-deadline {
  margin: 0 0 0.55rem;
  font-weight: 600;
}

.proposal-form fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 0.75rem;
}

.proposal-form .choice {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.35rem 0;
}

.verification-card .choice span {
  line-height: 1.35;
}

.proposal-form .stack {
  display: grid;
  gap: 0.35rem;
  margin: 0.65rem 0;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.25rem;
  align-items: start;
}

.evidence-col, .meaning-col { min-width: 0; }
.segment {
  padding: 1rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
}

.segment pre, .reply pre {
  white-space: pre-wrap;
  font-family: Georgia, serif;
  font-size: 0.95rem;
}

.claim-list { list-style: none; padding: 0; }
.claim-list li {
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

.claim-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.pill {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.pill.from_document { background: var(--good-bg); }
.pill.read_from_scan { background: var(--warn-bg); }
.pill.ai_explanation, .pill.ai_inference { background: #e7e3f2; }
.pill.needs_checking, .pill.could_not_read_clearly { background: var(--warn-bg); }
.pill.not_found_in_source { background: var(--bad-bg); }

.meaning-col[dir="rtl"] .claim-head {
  flex-direction: row-reverse;
}

bdi {
  unicode-bidi: isolate;
}

.empty-deadline,
.empty-state {
  font-size: 1.05rem;
  padding: 0.8rem 0;
}

.attention {
  margin: 1.25rem 0 2rem;
  padding: 1.25rem 1.35rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  box-shadow: var(--shadow);
}

.attention h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 0.55rem;
}

.attention h2 {
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  margin: 0 0 0.45rem;
}

.attention .filename {
  margin: 0.15rem 0 0.35rem;
  font-weight: 600;
}

.attention-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.attention-list li {
  border-top: 0;
  padding: 0.45rem 0 0.7rem;
}

.do-this .claim strong,
.deadline-block .claim strong {
  font-size: 1.25rem;
}

.deadline-block .claim strong {
  color: var(--terra-dark);
}

.check-this {
  background: var(--warn-bg);
  margin-left: -0.85rem;
  margin-right: -0.85rem;
  padding: 1rem 0.85rem 1.15rem;
  border-radius: 1rem;
  border-top: 0;
}

.more-details {
  margin: 0 0 2rem;
}

.more-details h2 {
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.more-details h3 {
  font-size: 1.08rem;
  margin: 1.1rem 0 0.4rem;
}

.more-details .quote {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--muted);
}

.meaning-col[dir="rtl"],
.hero[dir="rtl"],
.attention[dir="rtl"],
.more-details[dir="rtl"] {
  text-align: right;
}

.meaning-col[dir="rtl"] .claim-head,
.attention[dir="rtl"] .claim-head,
.more-details[dir="rtl"] .claim-head {
  flex-direction: row-reverse;
}

.today-board {
  display: grid;
  gap: 1rem;
}

.today-board section,
.reply {
  padding: 1.1rem 1.2rem;
  border-radius: 1.1rem;
}

.schedule { list-style: none; padding: 0; }
.schedule li { display: grid; gap: 0.15rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }

.text-link { color: var(--pine); }
.foot { margin-top: 3rem; font-size: 0.9rem; }

@media (max-width: 800px) {
  .top, .counts, .claim-head { flex-direction: column; }
  .result-grid { grid-template-columns: 1fr; }
}
