/* Base reset (the artifact shell used to supply this). */
*, *::before, *::after { box-sizing: border-box }
html, body { margin: 0 }
[hidden] { display: none !important }
img { max-width: 100% }

/* Layout: sticky toolbar, page rail on the left, one page's blocks as aligned HU | EN | DE rows. */
:root {
  --bg: #f4f6f8; --surface: #ffffff; --sunken: #eef1f4; --fg: #17202a; --muted: #5b6875;
  --line: #d9dfe5; --accent: #1f5c7a; --accent-soft: #e3eef4; --ok: #1d7a4c; --ok-soft: #e2f3ea;
  --warn: #8a5a00; --warn-soft: #fbf0d9; --focus: #2b7fb0;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-read: "Literata", Georgia, "Times New Roman", serif;
  --ctl-h: 36px; --radius: 6px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #11161b; --surface: #182028; --sunken: #141b21; --fg: #e6ebef; --muted: #98a6b3;
  --line: #2a3540; --accent: #7cc0e0; --accent-soft: #1b3442; --ok: #6fd3a0; --ok-soft: #173327;
  --warn: #f0c26a; --warn-soft: #3a2e14; --focus: #7cc0e0; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #11161b; --surface: #182028; --sunken: #141b21; --fg: #e6ebef; --muted: #98a6b3;
  --line: #2a3540; --accent: #7cc0e0; --accent-soft: #1b3442; --ok: #6fd3a0; --ok-soft: #173327;
  --warn: #f0c26a; --warn-soft: #3a2e14; --focus: #7cc0e0; color-scheme: dark }
* { box-sizing: border-box }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font-ui); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface) }
.wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* one control height for every input, select and button */
.ctl, .btn { height: var(--ctl-h); padding: 0 12px; font: 500 13px/1 var(--font-ui); border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
.btn { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: transform 120ms ease-out, background-color 120ms ease }
.btn:active { transform: scale(0.97) }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--surface) }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px }

header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line) }
.top-in { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding-block: 12px }
.brand { display: flex; flex-direction: column; min-width: 0; margin-right: auto }
.brand h1 { font: 600 17px/1.2 var(--font-ui); margin: 0; text-wrap: balance }
.brand span { color: var(--muted); font-size: 12.5px }
.progress { display: grid; grid-template-columns: auto minmax(90px, 140px) auto; gap: 4px 8px; align-items: center; font-size: 12.5px; font-variant-numeric: tabular-nums }
.bar { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden }
.bar i { display: block; height: 100%; background: var(--ok); width: 0; transition: width 300ms ease-out }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-bottom: 12px }
.tools .ctl[type=search] { flex: 1 1 220px; min-width: 0 }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden }
.seg button { height: calc(var(--ctl-h) - 2px); padding: 0 12px; border: 0; background: var(--surface); color: var(--muted); font: 500 13px/1 var(--font-ui); cursor: pointer }
.seg button[aria-pressed=true] { background: var(--accent-soft); color: var(--fg) }
.seg button + button { border-left: 1px solid var(--line) }

.banner { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--fg); font-size: 13px }
.intro { margin: 16px 0 0; max-width: 80ch; color: var(--muted); font-size: 13.5px }
.intro b { color: var(--fg); font-weight: 600 }

.main { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; padding-block: 16px 64px }
nav.rail { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--top-h, 120px)); align-self: start; max-height: calc(100vh - var(--top-h, 120px) - 24px); overflow: auto }
nav.rail h2 { font: 600 11px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 8px 8px 8px }
nav.rail ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 2px }
nav.rail a { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 8px; align-items: center; padding: 7px 8px; border-radius: var(--radius); color: var(--fg); text-decoration: none; font-size: 13px }
nav.rail a span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
nav.rail a .cnt { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px }
nav.rail a.done .cnt { color: var(--ok) }
nav.rail a[aria-current=true] { background: var(--accent-soft) }
nav.rail a:hover { background: var(--sunken) }
.rail-select { display: none; width: 100% }

.pagehead { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-bottom: 12px }
.pagehead h2 { font: 600 20px/1.25 var(--font-ui); margin: 0; text-wrap: balance }
.pagehead a { color: var(--accent); font-size: 13px }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0 16px 8px; font: 600 11px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 8px }
.row { padding: 14px 16px; display: grid; gap: 10px; border-top: 1px solid var(--line) }
.row:first-child { border-top: 0 }
.cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px }
.cell { min-width: 0; display: grid; gap: 4px; align-content: start }
.lang { display: none; font: 600 11px/1 var(--font-ui); letter-spacing: .08em; color: var(--muted) }
.hu { font: 15px/1.55 var(--font-read); white-space: pre-line; overflow-wrap: anywhere; padding: 7px 0 }
textarea.tr { width: 100%; resize: vertical; min-height: var(--ctl-h); padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--sunken); color: var(--fg); font: 15px/1.55 var(--font-read); field-sizing: content; overflow-wrap: anywhere }
textarea.tr:focus { background: var(--surface) }
textarea.tr[readonly] { border-color: transparent }
.cell.changed textarea.tr { border-color: var(--accent) }
.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: center }
.meta-left { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0 }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--sunken); color: var(--muted); font-size: 11.5px; font-weight: 500; white-space: nowrap }
.ok-btn { height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 500 12px/1 var(--font-ui); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-self: start; transition: transform 120ms ease-out }
.ok-btn:active { transform: scale(0.97) }
.ok-btn[aria-pressed=true] { background: var(--ok-soft); border-color: var(--ok); color: var(--ok) }
.ok-btn svg { width: 14px; height: 14px }
.note { grid-column: 1 / -1; display: grid; gap: 6px }
.tnote { font-size: 13px; padding: 8px 10px; border-radius: var(--radius); background: var(--warn-soft) }
.tnote b { font-weight: 600 }
.comment { width: 100%; height: var(--ctl-h); padding: 0 10px; border: 1px dashed var(--line); border-radius: var(--radius); background: transparent; color: var(--fg); font: 13px/1 var(--font-ui) }
.who { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums }
.empty { padding: 40px 16px; text-align: center; color: var(--muted) }
.saving { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); padding: 8px 12px; border-radius: var(--radius); background: var(--fg); color: var(--bg); font-size: 12.5px; opacity: 0; transform: translateY(6px); transition: opacity 160ms ease-out, transform 160ms ease-out; pointer-events: none }
.saving.on { opacity: 1; transform: none }
.hl { background: var(--warn-soft); border-radius: 2px }
.hide-en .c-en, .hide-de .c-de { display: none }
.hide-en .cells, .hide-de .cells, .hide-en .meta, .hide-de .meta, .hide-en .cols, .hide-de .cols { grid-template-columns: repeat(2, minmax(0, 1fr)) }

@media (max-width: 860px) {
  .main { grid-template-columns: minmax(0, 1fr) }
  nav.rail { display: none }
  .rail-select { display: block }
  .cols { display: none }
  .cells, .meta, .hide-en .cells, .hide-de .cells, .hide-en .meta, .hide-de .meta { grid-template-columns: minmax(0, 1fr) }
  .lang { display: block }
  .meta .spacer { display: none }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }

/* Room at the bottom: the last row never sits on the window edge. */
body { padding-bottom: 3rem }
a.btn { text-decoration: none; color: inherit }

/* Sign-in */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 28px 24px; display: grid; gap: 10px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.06) }
.login-card h1 { margin: 0; font: 600 18px/1.3 var(--font-ui) }
.login-card p { margin: 0 0 6px; color: var(--muted) }
.login-card label { font: 500 13px/1.3 var(--font-ui); margin-top: 6px }
.login-card .opt { color: var(--muted); font-weight: 400 }
.login-card .ctl { width: 100% }
.login-card .btn { justify-content: center; margin-top: 10px }
.login-card .btn:disabled { opacity: 0.6; cursor: progress }
.login-err { color: #a3261c; margin: 4px 0 0 !important }
