:root {
    --bg: #f3f5f8;
    --card: #ffffff;
    --text: #1d2733;
    --muted: #6a7686;
    --line: #dfe4ea;
    --accent: #1f5fd1;
    --accent-d: #174aa5;
    --danger: #b3261e;
    --ok: #1c7a45;
    --warn: #a76100;
    --src-bg: #f6f8fb;
    --radius: 8px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
code { font-family: var(--mono); font-size: .9em; background: #eef1f5; padding: .05em .35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.hidden { display: none !important; }
.filtered { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.strong { font-weight: 600; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.warn-text { color: var(--warn); font-weight: 600; }
.ok-text { color: var(--ok); font-weight: 600; }

/* ---------- Kopfleiste ---------- */
.topbar { background: #14202e; color: #fff; }
.topbar-in { max-width: 1100px; margin: 0 auto; padding: 0 16px; height: 46px; display: flex; align-items: center; gap: 22px; }
.topbar a { color: #dbe5f1; text-decoration: none; }
.topbar a:hover { color: #fff; }
.brand { font-weight: 700; letter-spacing: .01em; color: #fff !important; }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.who { display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.who a { color: #fff; font-weight: 600; }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; color: #9db4d1; cursor: pointer; font: inherit; padding: 0; }
button.link:hover { color: #fff; text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 22px 16px 60px; }
.wrap.wide { max-width: 1500px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- Karten, Formulare ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.card.narrow-lg { max-width: 680px; }
.card.flush { padding: 0; overflow-x: auto; }
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
label .muted { font-weight: 400; }
input[type=text], input[type=password], input[type=email], input[type=search], input[type=file], select {
    display: block; width: 100%; margin-top: 5px; padding: 8px 10px; font: inherit; color: inherit;
    border: 1px solid #c3ccd7; border-radius: 6px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9db9ee; outline-offset: 0; border-color: var(--accent); }
label.inl { display: inline-block; margin: 0 10px 0 0; font-weight: 500; }
label.inl input, label.inl select { display: inline-block; width: auto; margin-top: 0; }
label.radio { display: flex; gap: 9px; align-items: flex-start; font-weight: 400; margin-bottom: 10px; }
label.radio input { margin-top: 5px; flex: none; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 16px; padding: 12px 14px 4px; }
legend { font-weight: 600; padding: 0 6px; font-size: .9rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
    display: inline-block; padding: 7px 14px; font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.35;
    color: var(--text); background: #fff; border: 1px solid #c3ccd7; border-radius: 6px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #f1f4f8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-d); }
.btn.danger { color: var(--danger); border-color: #e3b8b4; }
.btn.danger:hover { background: #fdf0ef; }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.danger.solid:hover { background: #8f1e18; }
.btn.small { padding: 3px 9px; font-size: .8rem; }
.mini {
    padding: 1px 7px; min-width: 28px; font: inherit; font-size: .85rem; color: #34465c; background: #fff;
    border: 1px solid #c3ccd7; border-radius: 5px; cursor: pointer;
}
.mini:hover { background: #eaf0fa; border-color: #9db9ee; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: #eaf7ef; border-color: #b6dfc4; color: #14532d; }
.flash.err { background: #fdeceb; border-color: #f0b9b5; color: #7a1a15; }

.chip {
    display: inline-block; padding: 0 7px; font-size: .75rem; font-weight: 600; line-height: 1.55;
    background: #e8eef7; color: #2f4466; border-radius: 10px; white-space: nowrap;
}
.chip.fmt { background: #fff3d6; color: #7a5200; }
.chip.br { background: #e6f2ea; color: #1c5d36; }
.chip.tech-chip { background: #eceff3; color: #5a6675; }

/* ---------- Tabellen ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfc; }
.table tr:last-child td { border-bottom: 0; }
.table .btn { margin-left: 4px; }
.progcell progress { width: 150px; display: block; margin-bottom: 3px; }
progress { height: 10px; border-radius: 6px; overflow: hidden; vertical-align: middle; accent-color: var(--accent); }
.logtable td { padding: 8px 12px; }
.old { background: #fdeceb; text-decoration: line-through; padding: 0 3px; border-radius: 3px; }
.new { background: #eaf7ef; padding: 0 3px; border-radius: 3px; }
.openlist { margin: 0; padding-left: 18px; }
.openlist li { margin-bottom: 4px; }

.toolbar.filters { position: static; margin-bottom: 10px; }

/* ---------- Editor ---------- */
.stickybox { position: sticky; top: 0; z-index: 30; background: var(--bg); padding-top: 4px; margin: -4px 0 8px; }
.edithead { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; padding: 12px 16px 10px; }
.edithead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.edithead h1 { font-size: 1.25rem; }
.edithead-actions { display: flex; align-items: center; gap: 10px; }
.status { font-size: .85rem; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.dirty { color: var(--warn); }
.status.err { color: var(--danger); font-weight: 600; }
.progressline { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.progressline progress { width: 260px; max-width: 50vw; }
#conflictBar { margin: 0; border-radius: 0; }
#conflictBar .btn { margin-left: 6px; }
.toolbar { row-gap: 6px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 16px;
    background: #fafbfc; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
}
.toolbar input[type=search] { width: 260px; margin: 0; padding: 6px 10px; }
.toolbar label.chk { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; font-size: .88rem; }
.chars { display: inline-flex; gap: 4px; margin-left: auto; }

.pagetitle { margin: 22px 0 8px; font-size: 1.05rem; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; overflow: hidden; }
.item.tech { display: none; border-style: dashed; background: #fbfbfc; }
#editor.show-tech .item.tech { display: block; }
.itemhead {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 12px;
    background: #f1f4f8; border-bottom: 1px solid var(--line); cursor: pointer; font-size: .85rem;
}
.itemhead .tbl { color: var(--muted); font-family: var(--mono); font-size: .8rem; }
.itemhead .uid { font-weight: 700; }
.itemhead .fld { font-weight: 600; color: #26384f; }
.itemhead .itemcount { margin-left: auto; }
.item.collapsed .itembody { display: none; }
.block { padding: 6px 0 4px; border-top: 1px solid #edf0f4; }
.block:first-child { border-top: 0; }
.blockhead { padding: 2px 14px 0; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 4px 12px; align-items: start; }
.row.flash-row .dst textarea { box-shadow: 0 0 0 3px #ffd36b; }
.src { background: var(--src-bg); border: 1px solid #e8ecf1; border-radius: 6px; padding: 6px 10px; min-height: 36px; overflow-wrap: anywhere; }
.src .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.src .chips:empty { display: none; }
.src .chips + .txt { margin-top: 2px; }
.nb { display: inline-block; min-width: .55em; background: #ffe08a; border-radius: 2px; line-height: .9; vertical-align: -1px; }
.dst { display: flex; gap: 6px; align-items: flex-start; }
.dst textarea {
    flex: 1; min-width: 0; resize: none; overflow: hidden; min-height: 36px; padding: 6px 10px; font: inherit; color: inherit;
    border: 1px solid #c3ccd7; border-radius: 6px; background: #fff; line-height: 1.5;
}
.dst textarea::placeholder { color: #a3adba; }
.row.done .dst textarea { border-color: #8fd0a5; background: #f5fbf7; }
/* Prüfstatus: orange = unveränderter DeepL-Vorschlag, blau = von Hand bearbeitet, grün = von einem Menschen freigegeben */
.row.st-machine .dst textarea { border-color: #e8890c; background: #fff3df; box-shadow: inset 5px 0 0 #e8890c; }
.row.st-approved .dst textarea { border-color: #2f9e5b; background: #f1faf4; box-shadow: inset 5px 0 0 #2f9e5b; }
.badge { display: none; font-size: .68rem; line-height: 1.3; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.row.st-machine .badge { display: inline-block; background: #e8890c; color: #fff; font-weight: 700; }
.row.st-manual .badge { display: inline-block; background: #e6edf6; color: #3b5575; }
.row.st-approved .badge { display: inline-block; background: #2f9e5b; color: #fff; font-weight: 700; }
.appr { font-size: .74rem; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; cursor: pointer; white-space: nowrap; }
.appr input:disabled + * , .appr input:disabled { cursor: not-allowed; }
.chip.attr { background: #e7f0ff; color: #234a8c; }
.deeplpanel { margin-top: 8px; padding: 10px 12px; border: 1px solid #e8c37a; background: #fff8ea; border-radius: 8px; font-size: .88rem; }
.deeplpanel .err { color: var(--danger); font-weight: 600; }
.deeplpanel .ok { color: var(--ok); }
.deeplpanel progress { width: 100%; margin: 6px 0; }
.deeplbtns { display: flex; gap: 8px; margin-top: 8px; }
.reviewtext.warn { color: #b25e00; font-weight: 600; }
.row.dirty .dst textarea { border-color: #e9b53b; background: #fffbee; }
.row.conflict .dst textarea { border-color: #d9534f; background: #fff4f3; }
.row.nocount .src { background: #f9fafb; color: #6d7886; }
.tools { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 112px; flex: none; }
.dupe { font-size: .72rem; line-height: 1.2; }

.props summary { cursor: pointer; font-weight: 600; }
.props form { margin-top: 12px; max-width: 520px; }

@media (max-width: 860px) {
    .row { grid-template-columns: 1fr; gap: 4px; }
    .toolbar input[type=search] { width: 100%; }
    .chars { margin-left: 0; }
    .topbar-in { gap: 12px; }
}

/* Version */
.topbar .ver { font-size: .72rem; color: #9fb0c3; margin-left: 8px; text-decoration: none; align-self: center; }
.topbar .ver:hover { color: #fff; text-decoration: underline; }
.sitefoot { text-align: center; font-size: .75rem; color: var(--muted); padding: 18px 12px 24px; }
.sitefoot a { color: inherit; }
.verinfo { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; margin: 0 0 12px; }
.verinfo dt { color: var(--muted); }
.verinfo dd { margin: 0; }
.changelog { white-space: pre-wrap; font: .85rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: #f6f8fa; padding: 12px; border-radius: 8px; max-height: 60vh; overflow: auto; }

/* Sprachköpfe über den Spalten */
.langhead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 8px 12px 10px; background: var(--bg, #fff); }
.lh { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-radius: 10px; font-size: 1.3rem; font-weight: 800; line-height: 1.1; }
.lh-src { background: #eceff3; color: #2b3644; border: 2px solid #cdd5df; }
.lh-dst { background: #e3eeff; color: #123f8c; border: 2px solid #9fc0f3; }
.lh .flag { width: 36px; height: 24px; flex: none; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); object-fit: cover; }
.lh-role { font-weight: 500; font-size: 1rem; opacity: .85; }
.lh-role::before { content: "– "; }
@media (max-width: 760px) { .langhead { grid-template-columns: 1fr 1fr; gap: 6px; } .lh { font-size: 1rem; padding: 6px 8px; gap: 8px; } .lh-role { display: none; } }

/* Gespiegelte Felder */
.item.mirror { background: #fafbfc; }
.mirrornote { padding: 8px 14px 10px; font-size: .86rem; color: var(--muted); }
.chip.mirror-chip { background: #ece6fb; color: #4a2f94; }

/* HTML-Vorschau */
.preview { margin: 4px 12px 10px; border-top: 1px dashed #d4dbe4; padding-top: 6px; }
.preview > summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: #1d4f9c; padding: 4px 0; }
.pvgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 6px; }
.pvh { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: 3px; }
.pv { margin: 0; white-space: pre-wrap; word-break: break-word; font: .8rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #f6f8fa; border: 1px solid #dde3ea; border-radius: 6px; padding: 8px 10px; max-height: 380px; overflow: auto; }
.pv mark.pv-t { background: #d3f0dd; color: inherit; border-radius: 2px; }
.pv mark.pv-o { background: #ffe6bd; color: inherit; border-radius: 2px; }
.pvnote { margin-top: 6px; }
@media (max-width: 760px) { .pvgrid { grid-template-columns: 1fr; } }

/* Kleine Flaggen vor jedem Eingabefeld */
.mini-flag { width: 20px; height: 14px; flex: none; margin-top: 11px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); object-fit: cover; }
.src { display: flex; gap: 8px; align-items: flex-start; }
.src .mini-flag { margin-top: 3px; }
.srcbody { flex: 1; min-width: 0; }
.dst textarea { min-width: 0; }

.progressline .chars { margin-left: auto; }
.stickybox .edithead { padding-bottom: 6px; }
.stickybox .langhead { padding-top: 6px; padding-bottom: 8px; }
.lh { font-size: 1.15rem; padding: 6px 12px; }
