/* Base : couleurs, mise en page, en-tête, onglets, boutons, champs, pied de page (commun à toutes les pages) */

/* Layout: one reading column — a top bar with three tabs, a thin stats line, then the active view (card / add / list). */
:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --ink: #1b2430;
  --muted: #5d6877;
  --line: #d6dce4;
  --accent: #1f5f73;
  --accent-ink: #ffffff;
  --accent-soft: #dcebef;
  --der: #2459b8;
  --die: #b8323a;
  --das: #2f7d45;
  --again: #b8323a;
  --hard: #9a6a10;
  --easy: #2f7d45;
  --nom: #3a4fb5;
  --akk: #b45a10;
  --dat: #7b3fa3;
  --gen: #5c7a12;
  --verb: #5d6877;
  --shadow: 0 1px 2px rgba(27,36,48,.06), 0 8px 24px rgba(27,36,48,.07);
  --f-display: "Literata", Georgia, "Times New Roman", serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131920; --surface: #1c242e; --ink: #e6ebf1; --muted: #9aa6b4; --line: #2e3a47;
    --accent: #6fb3c7; --accent-ink: #0f1a20; --accent-soft: #1f3640;
    --der: #7aa5f0; --die: #f08a8f; --das: #7cc98f;
    --again: #f08a8f; --hard: #e0b45a; --easy: #7cc98f;
    --nom: #8fa0f5; --akk: #f0a060; --dat: #c79af0; --gen: #b5d36a; --verb: #9aa6b4;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131920; --surface: #1c242e; --ink: #e6ebf1; --muted: #9aa6b4; --line: #2e3a47;
  --accent: #6fb3c7; --accent-ink: #0f1a20; --accent-soft: #1f3640;
  --der: #7aa5f0; --die: #f08a8f; --das: #7cc98f;
  --again: #f08a8f; --hard: #e0b45a; --easy: #7cc98f;
    --nom: #8fa0f5; --akk: #f0a060; --dat: #c79af0; --gen: #b5d36a; --verb: #9aa6b4;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 720px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 48px; display: flex; flex-direction: column; gap: 18px; }

header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand h1 { font-family: var(--f-display); font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.logo-w { width: 1.08em; height: 1.08em; vertical-align: -.17em; margin-right: .06em; border-radius: .26em; }
.brand span { color: var(--muted); font-size: 13px; }
nav { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
nav button { font: inherit; font-size: 14px; font-weight: 500; border: 0; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 7px; cursor: pointer; }
nav button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
nav button:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.stats { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: 13px; }
.stats b { font-family: var(--f-mono); font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

.label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.btn { font: inherit; font-weight: 600; font-size: 15px; border-radius: 9px; padding: 11px 16px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.keys { text-align: center; font-size: 12px; color: var(--muted); }
kbd { font-family: var(--f-mono); font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.tag { display: inline-block; font-size: 11px; letter-spacing: .04em; padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); text-transform: none; }
.empty { text-align: center; margin: auto; display: flex; flex-direction: column; gap: 12px; align-items: center; max-width: 42ch; }
.empty h2 { font-family: var(--f-display); font-size: 24px; margin: 0; }
.empty p { color: var(--muted); margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-family: var(--f-display); font-size: 22px; margin: 0; }
.panel p { margin: 0; color: var(--muted); }
textarea { font: inherit; font-size: 15px; width: 100%; min-height: 150px; resize: vertical; padding: 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.status { font-size: 14px; color: var(--muted); }
.status.err { color: var(--again); }
.search { font: inherit; width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.del { font: inherit; font-size: 13px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.del.confirm { border-color: var(--again); color: var(--again); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend b { font-weight: 600; }
.wrap.wide { max-width: 1040px; }
.gen-field label, .flabel { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 7px 12px; border-radius: 99px; cursor: pointer; }
.seg button[aria-checked="true"], .seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* Read aloud */
.say { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.say svg { width: 17px; height: 17px; }
.say:hover { border-color: var(--accent); }
.say.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.say.sm { width: 28px; height: 28px; }
.say.sm svg { width: 13px; height: 13px; }
.lvl { font-family: var(--f-mono); font-size: 12px; font-weight: 500; letter-spacing: .02em; padding: 2px 7px; border-radius: 6px; border: 1px solid currentColor; line-height: 1.4; }
.lvl-A { color: var(--easy); } .lvl-B { color: var(--accent); } .lvl-C { color: var(--dat); }
.lvl.ch { color: var(--die); }
.word-line { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.ex-line { display: flex; align-items: flex-start; gap: 10px; }
.ex-line > :first-child { flex: 1; min-width: 0; }
select { font: inherit; font-size: 14px; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-width: 0; width: 100%; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.count { font-size: 13px; color: var(--muted); }
/* Language switch */
header { gap: 12px; }
.lang-pick select { width: auto; padding: 7px 8px; font-size: 13px; border-radius: 10px; background: var(--surface); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tag.lang { background: var(--bg); color: var(--muted); font-family: var(--f-mono); }
.trnote { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
/* header: logo + language, sign in on the right (above Premium) / tabs full width */
.hdr-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-basis: 100%; min-width: 0; }
header .brand { align-items: center; gap: 12px; min-width: 0; }
header nav { flex-basis: 100%; }
header nav button { flex: 1; padding: 7px 6px; white-space: nowrap; }
@media (max-width: 560px) { header nav { display: grid; grid-template-columns: repeat(3, 1fr); } header nav button { padding: 7px 2px; font-size: 13px; white-space: nowrap; } } /* six tabs on a phone: two rows of three */
@media (max-width: 380px) { header nav button { font-size: 12px; } }
@media (min-width: 561px) and (max-width: 760px) { header nav button { padding: 7px 3px; font-size: 13px; } } /* six tabs on a phone */
.brand .lang-pick { min-width: 0; display: flex; }
.brand .lang-pick select { width: 13.5em; max-width: 100%; }
.hdr-acc { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.hdr-acc .hdr-mail { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-acc .btn { white-space: nowrap; }
#hdr-login { background: transparent; border-color: transparent; color: var(--accent); font-weight: 600; padding-right: 2px; }
#hdr-login:hover { color: var(--ink); }
@media (max-width: 480px) {
  header .brand { gap: 8px; }
  .brand h1 { font-size: 23px; }
  .brand .lang-pick select { width: auto; padding: 6px 4px; }
  .brand h1 { white-space: nowrap; }
  #hdr-login { padding-left: 4px; }
  .hdr-acc { gap: 4px; }
  .hdr-acc .hdr-mail { display: none; }
}

/* Public site: base, account, sign-in, ads */
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.btn.sm { font-size: 13px; padding: 6px 11px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }
.notice { border: 1px solid var(--accent); border-radius: 10px; padding: 10px 14px; font-size: 14px; background: var(--accent-soft); color: var(--ink); }
.about { margin-top: 28px; padding: 18px 4px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.about h2 { margin: 0; font-family: var(--f-display); font-size: 18px; }
.about p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.6; }
.site-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 16px; padding: 22px 0 8px; font-size: 13px; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--ink); }
.say.load { animation: say-pulse 1s ease-in-out infinite; }
@keyframes say-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .say.load { animation: none; opacity: .6; } }

/* header: German or Swiss German, next to the language */
.brand .var-pick select { width: 12.5em; }
.auto-lang { font-size: 13px; }
@media (max-width: 480px) { .brand .var-pick select { width: auto; padding: 6px 4px; } }
/* Arabic and Persian: right to left */
[dir="rtl"] .entry-head .del, [dir="rtl"] .entry-head .tag, [dir="rtl"] .tr-del, [dir="rtl"] .ex-acts { margin-left: 0; margin-right: auto; }
[dir="rtl"] [lang="de"], [dir="rtl"] .ex-sent, [dir="rtl"] .sx, [dir="rtl"] .fam-ring, [dir="rtl"] .ring, [dir="rtl"] table.g { direction: ltr; }
[dir="rtl"] .brand h1 { direction: ltr; }

/* 💬 suggestion icon in each part of the site (js/features/feedback.js) */
.fb-host { position: relative; }
.fb-btn { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; color: var(--accent); opacity: .7; cursor: pointer; display: grid; place-items: center; padding: 0; z-index: 2; }
.fb-btn:hover, .fb-btn:focus-visible { opacity: 1; color: var(--accent); background: var(--bg); }
[dir="rtl"] .fb-btn { right: auto; left: 8px; }
.fb-dlg { position: fixed; inset: 0; background: rgba(10, 14, 20, .45); display: grid; place-items: center; z-index: 1000; padding: 16px; }
.fb-dlg[hidden] { display: none; }
.fb-box { background: var(--surface); color: var(--ink); border-radius: 14px; padding: 20px; width: min(520px, 100%); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.fb-box h3 { margin: 0; font-family: var(--f-display); font-size: 20px; }
.fb-box p { margin: 0; color: var(--muted); font-size: 14px; }
.fb-box textarea { min-height: 120px; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); resize: vertical; }

/* header: logo · my language → German (narrower menus, the logo never wraps) */
header .brand { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; min-width: 0; }
.brand h1 { flex: none; white-space: nowrap; display: flex; align-items: center; }
.brand .lang-pick select { width: auto; max-width: 10.5em; padding: 6px 6px; }
.brand .var-pick select { max-width: 12em; }
.lang-arrow { flex: none; color: var(--muted); font-size: 16px; line-height: 1; }
[dir="rtl"] .lang-arrow { transform: scaleX(-1); }
@media (max-width: 480px) { header .brand { gap: 5px; } .brand .lang-pick select { padding: 5px 2px; font-size: 12.5px; } .lang-arrow { font-size: 13px; } }
@media (max-width: 360px) { .brand h1 { font-size: 20px; } .brand .logo-w { width: 24px; height: 24px; } .hdr-acc .btn { padding: 5px 8px; font-size: 12.5px; } }
