:root {
  --ink: #16231f;
  --muted: #66716c;
  --paper: #f6f3eb;
  --card: #fffdf8;
  --line: #d9ddd7;
  --green: #176b52;
  --green-dark: #0f4938;
  --mint: #dcece5;
  --orange: #e66a36;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 6%, rgba(230, 106, 54, .09), transparent 24rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, textarea { font: inherit; }
button { color: inherit; }

.topbar {
  height: 76px;
  padding: 0 max(24px, calc((100% - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 243, 235, .86);
  backdrop-filter: blur(14px);
}

.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: white; background: var(--green); font: 700 21px Georgia, serif; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, serif; font-size: 19px; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dictionary-link { color: var(--green-dark); font-size: 14px; font-weight: 650; text-underline-offset: 4px; }

main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0 90px; }
.intro { max-width: 680px; margin-bottom: 42px; }
.eyebrow, .section-label { margin: 0 0 14px; color: var(--green); font-size: 12px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font: 500 clamp(46px, 7vw, 78px)/.98 Georgia, serif; letter-spacing: -.045em; }
h1 em { color: var(--green); font-weight: 400; }
.intro > p:last-child { max-width: 620px; margin: 24px 0 0; color: var(--muted); font-size: 17px; line-height: 1.65; }

.translator { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 24px 70px rgba(20, 43, 34, .08); }
.language-bar { height: 64px; display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; border-bottom: 1px solid var(--line); }
.language { height: 100%; border: 0; background: transparent; font-size: 15px; font-weight: 700; }
.language.active { color: var(--green); }
.swap { justify-self: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--green); font-size: 20px; cursor: pointer; transition: .18s ease; }
.swap:hover { transform: rotate(180deg); border-color: var(--green); }
.translation-grid { display: grid; grid-template-columns: 1fr 1fr; min-height: 300px; }
.editor { display: flex; min-width: 0; flex-direction: column; padding: 26px 28px 20px; }
.source-editor { position: relative; z-index: 1; border-right: 1px solid var(--line); cursor: text; }
.editor label, .result-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
textarea { position: relative; z-index: 2; width: 100%; min-height: 190px; flex: 1; resize: none; border: 0; outline: 0; padding: 18px 0; color: var(--ink); background: transparent; pointer-events: auto; user-select: text; touch-action: manipulation; cursor: text; font-size: clamp(25px, 3vw, 34px); line-height: 1.35; }
textarea::placeholder, .result-text.placeholder { color: #aeb5b1; }
.result-editor { background: #edf5f1; }
.result-text { flex: 1; padding: 18px 0; font: 500 clamp(25px, 3vw, 34px)/1.35 Georgia, serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.editor-footer { min-height: 34px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.examples { display: flex; flex-wrap: wrap; gap: 7px; }
.examples button { border: 1px solid var(--line); border-radius: 99px; padding: 6px 10px; background: transparent; cursor: pointer; font-size: 12px; }
.examples button:hover { border-color: var(--green); color: var(--green); }
.result-actions button { border: 1px solid #bfd4ca; border-radius: 8px; padding: 7px 12px; background: white; cursor: pointer; font-size: 12px; font-weight: 700; }
.result-actions button:disabled { cursor: default; opacity: .45; }
.status { color: var(--green-dark); }
.status.suggestion { color: #8b5a22; }
.review-summary {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(230, 106, 54, 0.08);
  color: var(--orange);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.review-summary:not(.has-review) {
  background: rgba(23, 107, 82, 0.08);
  color: var(--green-dark);
}

.evidence { margin-top: 28px; display: grid; grid-template-columns: .55fr 1.45fr; gap: 30px; align-items: start; }
.evidence h2 { margin: 0; font: 500 30px/1.1 Georgia, serif; }
.analysis-card { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.tokens { display: flex; flex-wrap: wrap; gap: 9px; }
.token { padding: 9px 11px; border-radius: 9px; background: var(--mint); }
.token b, .token small { display: block; }
.token .part-of-speech { display: inline-block; margin-bottom: 6px; padding: 3px 6px; border-radius: 99px; background: rgba(15, 111, 83, .12); color: var(--green-dark); font: 700 9px/1.1 Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.token b { font: 600 18px Georgia, serif; }
.token small { margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.analysis-card p { margin: 18px 0 0; color: var(--muted); line-height: 1.6; }
.notice { margin-top: 30px; display: flex; gap: 16px; padding: 20px 22px; border-left: 3px solid var(--orange); background: rgba(255,255,255,.45); }
.notice > span { color: var(--orange); font: 600 24px Georgia, serif; }
.notice p { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media (max-width: 720px) {
  .topbar { height: 66px; padding: 0 20px; }
  main { width: min(100% - 24px, 1120px); padding-top: 48px; }
  .translation-grid { grid-template-columns: 1fr; }
  .source-editor { border-right: 0; border-bottom: 1px solid var(--line); }
  .editor { min-height: 260px; padding: 22px 20px 18px; }
  .evidence { grid-template-columns: 1fr; }
  .dictionary-link { font-size: 12px; }
}
.aligned-english {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted, #66716d);
}
