/* iOS-style look, built for readers 45+: large type, strong contrast, one obvious action. */
:root {
  --bg: #f2f2f7;            /* iOS grouped background */
  --card: #fff;
  --text: #000;
  --muted: #3c3c43;         /* iOS secondary label, solid for contrast */
  --sep: #c6c6c8;
  --blue: #0062cc;          /* system blue, darkened for 45+ contrast */
  --blue-tint: #e3eefc;
  --blue-fill: #0062cc;     /* filled buttons keep white text readable in both modes */
  --red: #d70015;           /* iOS accessible red */
  --red-tint: #fdecee;
  --yellow: #ffcc00;
  --yellow-ink: #8a5a00;
  --yellow-tint: #fff7d6;
  --green: #1b7a33;         /* darker than iOS green so «GRÜN» reaches 4.5:1 on its tint */
  --green-tint: #e7f5ea;
  --gray: #8e8e93;
  --placeholder: #6e6e73;   /* 5.1:1 on white, WCAG AA for placeholder text */
  --lamp-case: #1c1c1e;
  --focus: #0040a0;
  --radius: 20px;
  --bar: rgba(242, 242, 247, .8);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --card: #1c1c1e;
    --text: #fff;
    --muted: #d1d1d6;
    --sep: #38383a;
    --blue: #409cff;
    --blue-tint: #0b2a4d;
    --red: #ff6961;
    --red-tint: #3a1414;
    --yellow-ink: #ffd60a;
    --yellow-tint: #3a3000;
    --green: #30d158;
    --green-tint: #0f2e17;
    --bar: rgba(0, 0, 0, .75);
    --placeholder: #98989d; /* 5.9:1 on the dark card */
    --lamp-case: #3a3a3c;
    --focus: #ffb340;
  }
  /* Light symbols on the bright dark-mode colors fall below 3:1, so draw them black. */
  .verdict.rot .verdict-icon, .verdict.gruen .verdict-icon,
  .sq.red, .sq.green, .sq.blue, .num { color: #000; }
}

* { box-sizing: border-box; }

html { font-size: 20px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.label { display: block; font-weight: 700; font-size: .95rem; margin: 0 0 .4rem; }

/* Large system text sizes: long German words must wrap instead of overflowing the card. */
.verdict h2, .next-step, .next-step-extra, .explanation, .signs li, .row-text, .help-list h3,
.large-title h1, .footnote {
  overflow-wrap: anywhere;
  hyphens: auto;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { width: 1.2em; height: 1.2em; flex: none; }

/* Translucent navigation bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: calc(.55rem + env(safe-area-inset-top)) 1rem .55rem;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep);
}
.navbar img { width: 1.5rem; height: 1.5rem; border-radius: 7px; }
.nav-title { font-size: .9rem; font-weight: 600; letter-spacing: -.01em; }

main { max-width: 600px; margin: 0 auto; padding: 0 1rem 1rem; container-type: inline-size; }

.large-title { padding: 1.3rem .2rem 1rem; }
.large-title.hero { padding-top: .8rem; }
.large-title h1 { margin: 0; font-size: 2rem; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.large-title h1:focus { outline: none; }
.hero h1 { font-size: min(2rem, 14vw); overflow-wrap: break-word; }  /* «Betrug?» stays on one line even at 200 % text */
.large-title p { margin: .5rem 0 0; color: var(--muted); font-size: 1rem; }

/* Start page: a small traffic light beside the headline shows what the app answers with. */
.hero { display: grid; grid-template-columns: 1fr auto; column-gap: 1rem; align-items: start; }
.hero > :not(.hero-light) { grid-column: 1; min-width: 0; }
.hero-light {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: min(.4rem, 2vw);
  border-radius: 1rem;
  background: var(--lamp-case);
  border: 1px solid var(--sep);
}
/* Capped by viewport width so it never pushes the page sideways at 200 % text. */
.lamp { width: min(1.3rem, 6vw); height: min(1.3rem, 6vw); border-radius: 50%; }
.lamp.red { background: var(--red); }
.lamp.yellow { background: var(--yellow); }
.lamp.green { background: var(--green); }
/* Large text or narrow phones: lay the light on its side above the headline so «Betrug?» keeps its line. */
@container (max-width: 15rem) {
  .hero { grid-template-columns: 1fr; }
  .hero-light { grid-column: 1; grid-row: auto; flex-direction: row; justify-self: start; margin-bottom: .6rem; }
}
@media (prefers-color-scheme: dark) { .hero-light { border-color: #636366; } }
@media (forced-colors: active) { .hero-light { forced-color-adjust: none; } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0 0 1.1rem;
}

.section-head {
  margin: 1.4rem .9rem .45rem;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

/* Input */
textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: .2rem .1rem;
  border: none;
  resize: none;
  background: transparent;
  color: var(--text);
  min-height: 6rem;
}
textarea:focus { outline: none; }
textarea::placeholder { color: var(--placeholder); opacity: 1; }
.input-card:focus-within { box-shadow: 0 0 0 3px var(--blue); }

button, .tinted { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.input-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; padding-top: .8rem; border-top: .5px solid var(--sep); }

.tinted {
  flex: 1 1 7rem;   /* side by side normally, stacked at very large text sizes */
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 3rem;
  padding: .5rem .7rem;
  border: none;
  border-radius: 14px;
  background: var(--blue-tint);
  color: var(--blue);
  font-weight: 600;
  font-size: .95rem;
}
.tinted.wide { width: 100%; margin-top: .7rem; font-size: 1rem; }
.tinted:active, .filled:active, .row-btn:active { opacity: .7; }
.file-btn { position: relative; }
.file-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.filled {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.6rem;
  border: none;
  border-radius: 16px;
  background: var(--blue-fill);
  color: #fff;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -.01em;
}
.filled:disabled { opacity: .5; cursor: wait; }
#result .filled { margin-top: 1.4rem; }
#result-help { margin-top: .9rem; }

.plain-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 1rem;
  min-height: 2.8rem;
  padding: .3rem .5rem;
}
.plain-btn.center { display: block; margin: .3rem auto .8rem; }

.facts { margin: .6rem 0 0; text-align: center; color: var(--muted); font-size: .85rem; }
.facts span { white-space: nowrap; }  /* wrap only between the items */

:focus-visible, .file-btn:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--card);
}

.preview { margin-top: .8rem; text-align: center; }
.preview img { max-width: 100%; max-height: 260px; border-radius: 12px; }

.error { color: var(--red); font-weight: 600; margin: .7rem .3rem 0; }

/* Grouped lists (Settings-style rows) */
.list { list-style: none; padding: 0; overflow: hidden; }
.list > li { display: flex; align-items: center; gap: .8rem; padding: .75rem 1rem; position: relative; }
.list > li + li::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  left: 3.6rem;
  border-top: .5px solid var(--sep);
}
.row-text { flex: 1; min-width: 0; }
.sub { display: block; color: var(--muted); font-size: .9rem; }

.sq {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.9rem; height: 1.9rem;
  border-radius: 8px;
  color: #fff;
}
.sq .ico { width: 1.1rem; height: 1.1rem; }
.sq.green { background: var(--green); }
.sq.blue { background: var(--blue); }
.sq.red { background: var(--red); }

.num {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.9rem; height: 1.9rem;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
}
.steps > li { align-items: flex-start; }

.list > li:has(.row-btn) { padding: 0; }
.row-btn {
  display: flex;
  align-items: center;
  gap: .8rem;
  width: 100%;
  padding: .85rem 1rem;
  border: none;
  background: none;
  color: var(--text);
  text-align: left;
}
.chev { width: 1rem; height: 1rem; color: var(--gray); flex: none; }

.footnote { margin: -.5rem .9rem 1.1rem; color: var(--muted); font-size: .85rem; }
.footnote.center { text-align: center; margin-top: .4rem; }
.footnote a { color: var(--blue); }

/* Waiting */
.loading { text-align: center; font-size: 1.15rem; font-weight: 600; padding: 2.6rem 1rem; margin-top: 1.4rem; }
.pulse { display: flex; justify-content: center; gap: .6rem; margin-bottom: 1rem; }
.pulse span { width: 1.2rem; height: 1.2rem; border-radius: 50%; animation: pulse 1.2s ease-in-out infinite; }
.pulse span:nth-child(1) { background: var(--red); }
.pulse span:nth-child(2) { background: var(--yellow); animation-delay: .2s; }
.pulse span:nth-child(3) { background: var(--green); animation-delay: .4s; }
@keyframes pulse { 0%, 100% { transform: scale(.6); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pulse span { animation: none; } }

/* Verdict */
.verdict { text-align: center; padding: 1.6rem 1.2rem 1.4rem; margin-top: 1.2rem; }
.verdict-icon {
  display: grid;
  place-items: center;
  width: 4.6rem; height: 4.6rem;
  margin: 0 auto .8rem;
  border-radius: 50%;
  color: #fff;
}
.verdict-icon svg { width: 2.6rem; height: 2.6rem; }
.verdict-kicker { margin: 0; font-size: .95rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.verdict h2 { margin: .2rem 0 .6rem; font-size: min(1.65rem, 9vw); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.verdict h2:focus { outline: none; }
.explanation { margin: 0; font-size: 1.08rem; color: var(--muted); }
.verdict.rot { background: var(--red-tint); }
.verdict.rot .verdict-icon { background: var(--red); }
.verdict.rot .verdict-kicker, .verdict.rot h2 { color: var(--red); }
.verdict.gelb { background: var(--yellow-tint); }
.verdict.gelb .verdict-icon { background: var(--yellow); color: #1c1c1e; }
.verdict.gelb .verdict-kicker, .verdict.gelb h2 { color: var(--yellow-ink); }
.verdict.gruen { background: var(--green-tint); }
.verdict.gruen .verdict-icon { background: var(--green); }
.verdict.gruen .verdict-kicker, .verdict.gruen h2 { color: var(--green); }

.next-step { font-size: 1.15rem; font-weight: 700; margin: 0; }
.next-step-extra { margin: .5rem 0 0; color: var(--muted); }
.next-step-extra:empty { display: none; }
.next-step-extra a { color: var(--blue); font-weight: 600; }

.signs .list > li::after {
  content: "";
  order: -1;
  flex: none;
  width: .75rem; height: .75rem;
  margin: 0 .55rem;
  border-radius: 50%;
  background: var(--sign, var(--red));
}
.signs.gelb { --sign: var(--yellow); }
.signs.gruen { --sign: var(--green); }

/* Help */
.back-btn {
  display: inline-flex; align-items: center; gap: .15rem;
  margin-top: .6rem;
  background: none; border: none; color: var(--blue);
  min-height: 2.8rem; padding: 0 .3rem 0 0; font-size: 1rem;
}
.help-list > li { display: block; padding: .95rem 1rem; }
.help-list > li + li::before { left: 1rem; }
.help-list h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.help-list p { margin: 0; color: var(--muted); }
.help-list strong { color: var(--text); }

footer {
  max-width: 600px;
  margin: 0 auto;
  padding: .5rem 1.6rem calc(2rem + env(safe-area-inset-bottom));
  font-size: .78rem;
  color: var(--muted);
  text-align: center;
}

[hidden] { display: none !important; }
#loading:focus { outline: none; box-shadow: none; }
