/* Ferheng – Stil. Farben als Variablen; dunkles Farbschema über prefers-color-scheme. */
:root {
  --paper: #fbfaf6;
  --surface: #ffffff;
  --ink: #1b2420;
  --ink-2: #4a5550;
  --muted: #7a847f;
  --line: #e4e2da;
  --accent: #17693f;        /* Grün */
  --accent-ink: #ffffff;
  --accent-soft: #e5f1ea;
  --sun: #f2b705;           /* Sonne */
  --sun-soft: #fff3c7;
  --red: #b3261e;
  --radius: 12px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 16px rgba(20, 30, 25, .06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121614;
    --surface: #1a201d;
    --ink: #e9ece8;
    --ink-2: #bcc4bf;
    --muted: #8b958f;
    --line: #2c3430;
    --accent: #5cc58d;
    --accent-ink: #0d1a13;
    --accent-soft: #1d3326;
    --sun: #f5c542;
    --sun-soft: #3a3217;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink);
  font: 17px/1.55 var(--sans);
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
mark { background: var(--sun-soft); color: inherit; padding: 0 1px; border-radius: 3px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* ---- Kopfzeile ---- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 700 22px/1 var(--serif); letter-spacing: .01em; flex: none; }
.brand-sun { width: 28px; height: 28px; }
.brand-sun circle { fill: var(--sun); }
.brand-sun line { stroke: var(--sun); stroke-width: 1.6; stroke-linecap: round; }
.nav { display: flex; align-items: center; gap: 16px; margin-left: auto; font-size: 15px; }
.nav > a { color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.nav > a:hover { color: var(--accent); }
.ui-lang { position: relative; }
.ui-lang summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: var(--pill); padding: 3px 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ui-lang summary::-webkit-details-marker { display: none; }
.ui-lang-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 140px; }
.ui-lang-menu a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.ui-lang-menu a:hover, .ui-lang-menu a[aria-current] { background: var(--accent-soft); }

/* ---- Suche ---- */
.searchbox { width: 100%; }
.searchbox.compact { max-width: 560px; flex: 1; }
.search-row { position: relative; display: flex; background: var(--surface); border: 2px solid var(--line); border-radius: var(--pill); transition: border-color .15s; }
.search-row:focus-within { border-color: var(--accent); }
.search-input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 20px; padding: 14px 8px 14px 22px; outline: none; }
.search-input::-webkit-search-cancel-button { cursor: pointer; }
.compact .search-input { font-size: 16px; padding: 8px 6px 8px 16px; }
.search-dir { border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--ink-2); font: inherit; font-size: 14px; padding: 0 10px; max-width: 170px; cursor: pointer; }
.compact .search-dir { max-width: 130px; font-size: 13px; }
.search-btn { display: flex; align-items: center; gap: 8px; border: 0; background: var(--accent); color: var(--accent-ink); font: 600 16px var(--sans); padding: 0 22px; border-radius: 0 999px 999px 0; cursor: pointer; }
.compact .search-btn { padding: 0 14px; }
.search-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.suggest { text-align: left; position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 20; max-height: 70vh; overflow: auto; }
.suggest li { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--accent-soft); }
.suggest .s-word { font-weight: 650; white-space: nowrap; }
.suggest .s-gloss { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.suggest .s-lang { color: var(--muted); font-size: 12px; white-space: nowrap; }
.suggest .s-rev .s-word::before { content: "↩ "; color: var(--muted); font-weight: 400; }
.charpad { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; justify-content: center; }
.charpad button { font: 500 16px var(--sans); min-width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
.charpad button:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Startseite ---- */
.hero { text-align: center; padding: 56px 0 40px; max-width: 760px; margin: 0 auto; }
.hero-title { font: 700 clamp(44px, 8vw, 72px)/1 var(--serif); margin: 0 0 12px; letter-spacing: -.01em; }
.hero-tagline { color: var(--ink-2); margin: 0 auto 28px; max-width: 560px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin: 16px 0 56px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card-kicker { margin: 0 0 10px; font: 700 12px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wotd { border-top: 4px solid var(--sun); }
.wotd-word { display: block; font: 700 36px/1.15 var(--serif); color: var(--ink); text-decoration: none; margin-bottom: 4px; }
.wotd-gloss { font-size: 18px; margin: 8px 0 12px; }
.more { font-weight: 600; text-decoration: none; }
.dict-list { list-style: none; margin: 0; padding: 0; }
.dict-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dict-list li:last-child { border-bottom: 0; }
.dict-pair { font-weight: 650; }
.dict-title { grid-column: 1; color: var(--ink-2); font-size: 14px; }
.dict-count { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.letters a { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; }
.letters a:hover, .letters a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pos { color: var(--muted); font-style: italic; font-size: .92em; }

/* ---- Wortseite ---- */
.word-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; padding: 32px 0 56px; }
.lemma { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 16px; position: relative; }
.lemma + .facts { margin-top: 0; }
.word-main > .lemma:not(:first-child) { margin-top: 48px; padding-top: 24px; border-top: 3px double var(--line); }
.lemma-lang { margin: 0; font: 700 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.lemma-word { font: 700 clamp(36px, 6vw, 54px)/1.1 var(--serif); margin: 4px 0 6px; overflow-wrap: anywhere; }
.lemma-alt { font-size: 28px; margin: 0 0 6px; color: var(--ink-2); text-align: left; }
.lemma-pos { margin: 0; color: var(--ink-2); }
.lemma-pos .label { color: var(--muted); }
.copy-link { position: absolute; right: 0; top: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: var(--pill); padding: 4px 12px; font: 13px var(--sans); cursor: pointer; }
.copy-link:hover { border-color: var(--accent); color: var(--accent); }
.facts dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0 0 24px; }
.facts dl > div { display: contents; }
.facts dt { color: var(--muted); font-size: 15px; }
.facts dd { margin: 0; }
.syl { letter-spacing: .02em; }
.wf a { font-weight: 600; }
.wf-plus { color: var(--muted); margin: 0 6px; }
.wf-affix { font-style: italic; color: var(--ink-2); border-bottom: 1px dotted var(--muted); }
.dict-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px; }
.dict-block-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 12px; font: 700 18px var(--sans); }
.dict-block-title .dict-name { font: 400 14px var(--sans); color: var(--muted); }
.entry + .entry { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.entry-head { font: 700 20px var(--serif); margin: 0 0 6px; }
.entry-head sup { font-size: .6em; color: var(--muted); margin-left: 1px; }
.entry-head .pos { font: italic 400 14px var(--sans); margin-left: 8px; }
.sense { font-size: 19px; margin: 0; }
.senses { margin: 0; padding-left: 1.6em; font-size: 18px; }
.senses li { padding: 2px 0; }
.senses li::marker { color: var(--accent); font-weight: 700; }
.examples { margin-top: 10px; }
.examples-label { margin: 0 0 4px; font: 700 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.examples blockquote { margin: 4px 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--sun); font-family: var(--serif); font-style: italic; color: var(--ink-2); }
.src { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.related { margin-top: 28px; }
.related h2, .section-label { font: 700 13px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.related-list { list-style: none; margin: 0; padding: 0; columns: 2 280px; column-gap: 32px; }
.related-list li { break-inside: avoid; padding: 5px 0; border-bottom: 1px solid var(--line); }
.related-list a { font-weight: 600; }
.gloss { color: var(--ink-2); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.chip { display: inline-block; padding: 4px 12px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 1px 6px; vertical-align: middle; }
.word-aside { position: sticky; top: 80px; align-self: start; }
.browse-nav ul { list-style: none; margin: 0 0 12px; padding: 0; }
.browse-nav li a { display: block; padding: 3px 0; text-decoration: none; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browse-nav li a:hover { color: var(--accent); }
.browse-current { font-weight: 700; margin: 0 0 12px; padding: 6px 10px; background: var(--accent-soft); border-radius: 6px; }

/* ---- Suchergebnisse / Alphabet ---- */
.search-page, .browse-page, .notfound, .about { padding: 32px 0 56px; }
.page-title { font: 700 clamp(28px, 5vw, 40px)/1.2 var(--serif); margin: 0 0 16px; }
.page-title q { quotes: "„" "“"; }
.dir-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 20px; scrollbar-width: thin; }
.dir-tabs a { flex: none; padding: 6px 14px; border-radius: var(--pill); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: 14px; background: var(--surface); }
.dir-tabs a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.results { list-style: none; margin: 0 0 32px; padding: 0; }
.result { padding: 12px 0; border-bottom: 1px solid var(--line); }
.result-word { font: 700 22px var(--serif); text-decoration: none; margin-right: 8px; }
.results-compact .result-word { font-size: 19px; }
.result-gloss { margin: 4px 0 0; color: var(--ink); }
.result-dict { color: var(--muted); font-size: 13px; }
.empty { font-size: 18px; color: var(--ink-2); }
.letters-big { margin-bottom: 24px; }
.word-columns { list-style: none; margin: 0; padding: 0; columns: 4 180px; column-gap: 24px; }
.word-columns li { padding: 3px 0; break-inside: avoid; }
.word-columns a { text-decoration: none; }
.word-columns a:hover { text-decoration: underline; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.pager a, .pager span { min-width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; }
.pager span { border: 0; }
.pager a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dict-table { width: 100%; border-collapse: collapse; }
.dict-table td { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
.dict-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.prose { max-width: 760px; }

/* ---- Fußzeile ---- */
main { flex: 1; width: 100%; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0; font-size: 14px; color: var(--ink-2); }
.footer-inner p { margin: 4px 0; }

/* ---- Mobil ---- */
@media (max-width: 860px) {
  .word-layout { grid-template-columns: 1fr; }
  .word-aside { position: static; }
  .header-inner { flex-wrap: wrap; padding: 8px 0; gap: 8px 12px; }
  .searchbox.compact { order: 3; max-width: none; flex-basis: 100%; }
  .nav { gap: 12px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .search-dir { max-width: 110px; font-size: 13px; padding: 0 6px; }
  .search-btn span { display: none; }
  .search-btn { padding: 0 16px; }
  .search-input { font-size: 18px; padding-left: 16px; }
  .compact .search-dir { display: none; }
  .copy-link { position: static; margin-top: 10px; }
  .nav > a:nth-child(2) { display: none; }
  .dict-block { padding: 14px 16px; }
}
@media print {
  .site-header, .site-footer, .word-aside, .copy-link { display: none; }
  .word-layout { display: block; }
}

/* ---- Fehler melden / Bearbeiten / Beta ---- */
.entry-tools { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.edit-link { font-weight: 600; text-decoration: none; }
.report-box summary { cursor: pointer; color: var(--muted); list-style: none; }
.report-box summary::-webkit-details-marker { display: none; }
.report-box summary:hover { color: var(--accent); }
.report-box[open] summary { color: var(--ink); font-weight: 600; margin-bottom: 8px; }
.report-box form { display: flex; flex-direction: column; gap: 8px; max-width: 460px; }
.report-box label { display: flex; flex-direction: column; gap: 3px; color: var(--ink-2); }
.report-box textarea, .report-box input { font: 15px var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.report-box button { align-self: flex-start; border: 0; background: var(--accent); color: var(--accent-ink); font: 600 14px var(--sans); padding: 7px 16px; border-radius: var(--pill); cursor: pointer; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { margin: 20px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent); }
.notice-error { background: var(--sun-soft); border-color: var(--sun); }
.tag-beta { background: var(--sun-soft); color: var(--ink); }
.beta-note { margin: -6px 0 12px; font-size: 13px; color: var(--ink-2); }

/* ---- Logo, Kontakt, eigene Seiten ---- */
.brand-logo { height: 34px; width: auto; max-width: 180px; display: block; }
.brand-logo_name .brand-logo { height: 30px; }
.hero-logo { display: block; margin: 0 auto 14px; max-height: 110px; max-width: 70%; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.contact-page, .static-page { padding: 32px 0 56px; }
.static-page h2 { font: 700 20px var(--serif); margin: 28px 0 8px; }
.contact-form { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.contact-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.contact-form input:not([type=checkbox]), .contact-form select, .contact-form textarea { font: 16px/1.4 var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form label.cf-consent { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 14px; }
.cf-consent input { margin-top: 3px; }
.cf-submit { align-self: flex-start; border: 0; background: var(--accent); color: var(--accent-ink); font: 600 16px var(--sans); padding: 10px 24px; border-radius: var(--pill); cursor: pointer; }
.field-error { color: var(--red); font-weight: 500; font-size: 13px; }
@media (max-width: 560px) { .cf-row { grid-template-columns: 1fr; } }
