@font-face {
  font-family: "Anton";
  src: url("/fonts/anton-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #16233A;
  --paper: #E6EADF;
  --card: #FBFBF5;
  --mint: #A9C0AE;
  --red: #E23A22;
  --amber: #C87A1E;
  --green: #2F7A55;
  --display: "Anton", Impact, "Arial Black", "Haettenschweiler", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

.aic {
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(22,35,58,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22,35,58,.045) 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--ink);
  font-family: "Courier New", Courier, monospace;
  padding: 28px 16px 80px;
}

.wrap { max-width: 620px; margin: 0 auto; }

.sheet {
  background: var(--card);
  border: 1.5px solid var(--ink);
  box-shadow: 4px 4px 0 var(--mint);
  padding: 20px;
  margin-bottom: 20px;
}

.bar {
  background: var(--ink);
  color: var(--card);
  margin: -20px -20px 18px;
  padding: 7px 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  letter-spacing: .14em;
}

.title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(46px, 15vw, 86px);
  line-height: .84;
  letter-spacing: -.01em;
  margin: 6px 0 8px;
}

.sub { font-size: 13px; line-height: 1.5; max-width: 42ch; margin: 0; }

.field {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  letter-spacing: .12em;
  margin: 22px 0 6px;
}

textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  background: repeating-linear-gradient(var(--card), var(--card) 25px, rgba(22,35,58,.13) 26px);
  border: 1.5px solid var(--ink);
  padding: 4px 10px;
  font: inherit;
  font-size: 15px;
  line-height: 26px;
  color: var(--ink);
}
textarea::placeholder { color: rgba(22,35,58,.42); }

textarea:focus-visible,
button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--card); }

.go {
  width: 100%;
  margin-top: 22px;
  padding: 16px;
  background: var(--red);
  color: #fff;
  border: 1.5px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: .04em;
  cursor: pointer;
}
.go:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.go:disabled { background: var(--mint); color: var(--ink); cursor: not-allowed; box-shadow: 4px 4px 0 var(--ink); }

.samples { margin: 10px 0 0; font-size: 12px; line-height: 1.9; }
.samples button {
  background: none;
  border: none;
  border-bottom: 1px dashed var(--ink);
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}

.readout { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.score {
  font-family: var(--display);
  font-size: clamp(72px, 24vw, 128px);
  line-height: .8;
}
.scorelabel { font-size: 12px; letter-spacing: .14em; color: var(--ink); }

.stamp {
  border: 3px double var(--red);
  color: var(--red);
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: .06em;
  padding: 6px 12px;
  transform: rotate(-4deg);
  text-align: center;
}
.stamp small { font-family: "Courier New", Courier, monospace; font-size: 10px; letter-spacing: .1em; display: block; }

.meter { display: flex; gap: 3px; height: 34px; margin-top: 18px; }
.seg { flex: 1; border: 1px solid rgba(22,35,58,.22); transition: background 340ms ease; }

.diagnosis { font-size: 19px; line-height: 1.3; }

.obs { list-style: none; padding: 0; margin: 14px 0 0; font-size: 13px; line-height: 1.6; }
.obs li { border-top: 1px solid rgba(22,35,58,.2); padding: 9px 0 9px 20px; position: relative; }
.obs li::before { content: "—"; position: absolute; left: 0; }

.rx {
  margin-top: 16px;
  padding: 10px 12px;
  background: rgba(169,192,174,.35);
  border-left: 4px solid var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.pay {
  width: 100%;
  padding: 15px;
  background: var(--ink);
  color: var(--card);
  border: 1.5px solid var(--ink);
  box-shadow: 4px 4px 0 var(--mint);
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: .03em;
  cursor: pointer;
}
.pay:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--mint); }

.ghost {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: transparent;
  border: 1.5px dashed var(--ink);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.fine { font-size: 11px; line-height: 1.6; margin-top: 12px; opacity: .7; }

.fix { border: 1.5px solid var(--ink); padding: 12px; margin-top: 12px; background: #fff; }
.fixhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11px; letter-spacing: .12em; margin-bottom: 8px; }
.fixhead button { background: var(--ink); color: var(--card); border: none; font: inherit; font-size: 11px; letter-spacing: .1em; padding: 5px 9px; cursor: pointer; }
.fixtext { font-size: 15px; line-height: 1.6; white-space: pre-wrap; }

.err { border: 1.5px solid var(--red); color: var(--red); padding: 10px 12px; font-size: 13px; margin-top: 14px; }

.foot { font-size: 11px; line-height: 1.7; text-align: center; opacity: .65; max-width: 46ch; margin: 0 auto; }

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

/* ---------- ad slots ---------- */
/* Content column is 620px. Two 160px rails + 32px gutters need ~1180px
   before they fit without crowding, so that's the single breakpoint:
   above it the rails show, below it the mobile banner shows. */

body { background: var(--paper); }

.adslot {
  border: 1px dashed rgba(22,35,58,.35);
  color: rgba(22,35,58,.45);
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: .1em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.adbanner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
  padding: 8px 0 0;
}

.rail {
  display: none;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  min-height: 600px;
}
.rail-left  { left: calc(50% - 502px); }
.rail-right { left: calc(50% + 342px); }

@media (min-width: 1180px) {
  .rail { display: block; }
  .adbanner { display: none; }
}

/* ---------- install prompt ---------- */

.install { text-align: center; margin-bottom: 20px; }
.install .ghost { max-width: 340px; margin: 0 auto; }

.installhelp {
  max-width: 340px;
  margin: 10px auto 0;
  border: 1.5px solid var(--ink);
  background: var(--card);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.65;
  text-align: left;
}
.installhelp strong { display: block; margin-bottom: 4px; letter-spacing: .06em; font-size: 11px; }
.installhelp ol { margin: 0; padding-left: 18px; }
.installhelp li { margin-bottom: 3px; }

/* ---------- static pages (about, privacy) ---------- */

.pagetitle {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 7vw, 44px);
  line-height: .95;
  letter-spacing: -.005em;
  margin: 6px 0 18px;
}

.prose { font-size: 14px; line-height: 1.65; max-width: 62ch; }
.prose p { margin: 0 0 14px; }
.prose .lede { font-size: 15px; border-left: 4px solid var(--ink); background: rgba(169,192,174,.35); padding: 10px 12px; }
.prose h2 {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: lowercase;
  margin: 26px 0 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(22,35,58,.2);
  font-weight: 700;
}
.prose a, .stampline a { color: var(--ink); border-bottom: 1px solid var(--red); text-decoration: none; }
.prose a:hover, .stampline a:hover { background: rgba(226,58,34,.12); }

.stampline { font-size: 11px; letter-spacing: .1em; opacity: .7; margin: 20px 0 0; }

.nav { text-align: center; font-size: 12px; margin-bottom: 22px; opacity: .8; }
.nav a { color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--ink); }
.nav a:hover { border-bottom-style: solid; }

/* ---------- consent banner ---------- */

.consent {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--card);
  border-top: 1.5px solid var(--ink);
  box-shadow: 0 -4px 0 var(--mint);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
}
.consent[hidden] { display: none; }

.consent-inner {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.consent-text { font-size: 12px; line-height: 1.6; margin: 0; flex: 1 1 260px; }
.consent-text a { color: var(--ink); border-bottom: 1px solid var(--red); text-decoration: none; }

.consent-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.consent-btns button {
  font: inherit;
  font-size: 13px;
  padding: 9px 16px;
  cursor: pointer;
  border: 1.5px solid var(--ink);
}
.consent-no  { background: transparent; color: var(--ink); }
.consent-yes { background: var(--ink); color: var(--card); }
.consent-btns button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

@media (max-width: 520px) {
  .consent-inner { gap: 10px; }
  .consent-btns { width: 100%; }
  .consent-btns button { flex: 1; }
}

/* ---------- language picker ---------- */

.langwrap { display: inline-block; margin-left: 6px; }
.langpick {
  font: inherit;
  font-size: 11px;
  font-family: "Courier New", Courier, monospace;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 1px 4px;
  cursor: pointer;
  max-width: 11em;
}
.langpick:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.langnote {
  font-size: 12px;
  line-height: 1.55;
  border: 1px dashed rgba(22,35,58,.4);
  padding: 8px 10px;
  margin: 0 0 16px;
}

/* right-to-left languages: the layout is symmetric, so only the
   text-aligned bits need flipping */
[dir="rtl"] .prose,
[dir="rtl"] .installhelp { text-align: right; }
[dir="rtl"] .obs li { padding: 9px 20px 9px 0; }
[dir="rtl"] .obs li::before { left: auto; right: 0; }
[dir="rtl"] .rx,
[dir="rtl"] .prose .lede { border-left: none; border-right: 4px solid var(--ink); }
[dir="rtl"] .installhelp ol { padding-left: 0; padding-right: 18px; }

/* ---------- share row ---------- */

.sharerow { display: flex; flex-wrap: wrap; gap: 8px; }

.sharebtn {
  font: inherit;
  font-size: 13px;
  padding: 10px 14px;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  flex: 1 1 auto;
}
.sharebtn:hover { background: rgba(169,192,174,.35); }
.sharebtn:active { transform: translate(1px, 1px); }
.sharebtn:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.sharebtn-primary {
  background: var(--ink);
  color: var(--card);
  box-shadow: 3px 3px 0 var(--mint);
  flex: 1 1 100%;
}
.sharebtn-primary:hover { background: var(--ink); }

#shareNote:empty { display: none; }

/* ---------- jmaa.tv mark ---------- */

.jmaa {
  display: block;
  text-align: center;
  margin: 4px auto 8px;
  opacity: .85;
}
.jmaa:hover { opacity: 1; }
.jmaa img { width: 64px; height: auto; display: inline-block; }
