/* AstroSignature / Image Finalizer (Web) – Look der Desktop-Version (CustomTkinter, LCARS/Gold) */
@font-face { font-family: "Final Frontier"; src: url(../fonts/FinalFrontier.ttf) format("truetype"); font-display: block; }
@font-face { font-family: "Antonio"; font-weight: 400; font-display: block; src: url(../fonts/antonio-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Antonio"; font-weight: 700; font-display: block; src: url(../fonts/antonio-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Antonio"; font-weight: 400; font-display: block; src: url(../fonts/antonio-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Antonio"; font-weight: 700; font-display: block; src: url(../fonts/antonio-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --accent: #F5C987; --accent-h: #D9A95E; --accent-dim: #8a6d3b; --txt-dark: #1a1408;
  --bg: #121318; --panel: #1b1d24; --card: #23262f; --line: #3a3d48; --btn2: #343846; --btn2-h: #454a5c;
  --txt: #e8e2d6; --txt-2: #c9c2b4; --txt-3: #a9a39a; --txt-4: #8e897f; --warn: #c9a36a;
  --ui: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ui-b: "Segoe UI Semibold", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --head: "Antonio", "Swiss911 UCm BT", "Arial Narrow", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--txt); font: 13px/1.35 var(--ui); display: flex; flex-direction: column; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Kopfzeile */
.top { flex: 0 0 auto; min-height: 58px; background: var(--panel); display: flex; align-items: center; gap: 8px; padding: 0 14px; flex-wrap: wrap; }
.pill-xl { width: 60px; height: 34px; border-radius: 17px; background: var(--accent); flex: 0 0 auto; }
.brand { font: 700 32px/1 var(--head); color: var(--accent); letter-spacing: -0.5px; margin-left: 2px; }
.brand-2 { font-size: 21px; letter-spacing: 0; white-space: nowrap; }
.brand-sub { font: 400 17px/1 var(--head); color: var(--accent-dim); margin: 10px 14px 0 0; white-space: nowrap; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.gear { margin-left: auto; padding: 0 14px; }
.langsw { display: flex; gap: 4px; margin-left: 10px; padding: 3px; border-radius: 16px; border: 1px solid var(--accent-dim); }
.langsw button { display: flex; align-items: center; gap: 6px; border: 0; border-radius: 13px; padding: 4px 10px; background: transparent; color: var(--txt-3); cursor: pointer; font-weight: 600; opacity: .55; }
.langsw button svg { border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.langsw button:hover { opacity: .85; }
.langsw button.on { background: var(--btn2); color: var(--accent); opacity: 1; }
.langpick { display: flex; gap: 18px; justify-content: center; padding: 10px 4px 4px; }
.langpick button { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 26px; border-radius: 14px; border: 2px solid var(--accent-dim); background: var(--btn2); color: var(--txt); font-size: 18px; font-weight: 600; cursor: pointer; }
.langpick button:hover { border-color: var(--accent); }
.langpick svg { width: 96px; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.legal { margin-left: 14px; white-space: nowrap; color: var(--txt-3); }
.legal a { color: var(--txt-2); text-decoration: none; }
.legal a:hover { color: var(--accent); text-decoration: underline; }
.gear2 { width: 40px; padding: 0; font-size: 16px; margin-left: 8px; }
.help { display: grid; gap: 8px; max-height: 65vh; overflow: auto; }
.help-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; }
.help-row b { color: var(--accent); font-weight: 600; }

/* Buttons */
.btn { border: 0; border-radius: 14px; background: var(--btn2); color: var(--txt); padding: 6px 16px; min-height: 30px; cursor: pointer; font-family: var(--ui); white-space: nowrap; }
.btn:hover { background: var(--btn2-h); }
.btn.primary { background: var(--accent); color: var(--txt-dark); font-family: var(--ui-b); font-weight: 600; }
.btn.primary:hover { background: var(--accent-h); }
.btn.block { width: 100%; }
.btn.danger { background: #7a2f2f; color: #fff; font-weight: 600; }
.btn.danger:hover { background: #9a3a3a; }
.btn.x { background: #3a2a2a; padding: 0; width: 30px; border-radius: 6px; }
.btn.x:hover { background: #6b3434; }
.btn.sm { padding: 0; width: 28px; min-height: 26px; border-radius: 6px; }
.btn.active { background: var(--accent); color: var(--txt-dark); }

/* Hauptbereich */
.main { flex: 1 1 auto; display: flex; min-height: 0; }
.side { width: 430px; flex: 0 0 430px; background: var(--panel); overflow-y: auto; padding: 4px 6px 12px; scrollbar-color: var(--line) transparent; }
.side::-webkit-scrollbar { width: 10px; }
.side::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
.side::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }
.stage { flex: 1 1 auto; min-width: 0; padding: 8px; display: flex; position: relative; }
/* feste Signalfarben, unabhängig von der Oberflächenfarbe */
.mark-banner { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 5; max-width: calc(100% - 40px);
  background: #FFD400; color: #000; border: 2px solid #000; border-radius: 18px; padding: 7px 18px; font: 700 14px/1.2 var(--ui-b);
  box-shadow: 0 0 0 3px rgba(255,212,0,.35), 0 6px 20px rgba(0,0,0,.6); cursor: pointer; text-align: center; animation: markpulse 1.6s ease-in-out infinite; }
.mark-banner[hidden] { display: none; }
@keyframes markpulse { 50% { box-shadow: 0 0 0 7px rgba(255,212,0,.15), 0 6px 20px rgba(0,0,0,.6); } }
#view { flex: 1 1 auto; width: 100%; height: 100%; background: #0a0b0e; display: block; outline: none; touch-action: none; }

/* Karten / Abschnitte */
.card { background: var(--card); border-radius: 12px; margin: 4px 0 8px; padding: 8px 10px 10px; }
.card-head { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.card-head .pill { width: 26px; height: 14px; border-radius: 7px; background: var(--accent); }
.card-head.fold { cursor: pointer; user-select: none; }
.card-head .chev { margin-left: auto; color: var(--accent); font-size: 16px; transition: transform .15s; }
.card.closed .chev { transform: rotate(-90deg); }
.card.closed .card-body { display: none; }
.card.closed .card-head { margin-bottom: 0; }
.card-head h2 { margin: 0; font: 700 22px/1.1 var(--head); color: var(--accent); text-transform: uppercase; letter-spacing: -0.3px; }
.lbl { display: block; margin: 4px 0 2px; }
.hint { font-size: 11px; color: var(--txt-4); }
.hint.warn { color: var(--warn); }
.hint.dim { color: var(--txt-3); }
.row { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.row > .lbl, .row > .lw { width: 118px; flex: 0 0 118px; margin: 0; }
.grow { flex: 1 1 auto; min-width: 0; }

input[type=text], input[type=password], textarea, select {
  background: var(--panel); border: 2px solid var(--line); border-radius: 6px; padding: 4px 8px; width: 100%; min-height: 30px; outline: none;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus { border-color: var(--accent-dim); }
input::placeholder, textarea::placeholder { color: #6f6c66; }
textarea { resize: vertical; white-space: pre; overflow: auto; }
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; border: 0; padding-right: 40px; background-color: var(--btn2);
  background-image: linear-gradient(45deg, transparent 50%, var(--txt) 50%), linear-gradient(135deg, var(--txt) 50%, transparent 50%), linear-gradient(var(--accent-dim), var(--accent-dim));
  background-position: calc(100% - 19px) 13px, calc(100% - 14px) 13px, 100% 0;
  background-size: 5px 5px, 5px 5px, 34px 100%; background-repeat: no-repeat;
}
select:hover { background-image: linear-gradient(45deg, transparent 50%, var(--txt) 50%), linear-gradient(135deg, var(--txt) 50%, transparent 50%), linear-gradient(var(--accent-h), var(--accent-h)); }
select option { background: var(--card); color: var(--txt); }

/* Checkbox */
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 4px 0; user-select: none; }
.chk input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border: 3px solid #6b6f7d; border-radius: 6px; margin: 0; flex: 0 0 auto; cursor: pointer; display: grid; place-content: center; }
.chk input:hover { border-color: var(--accent-h); }
.chk input:checked { background: var(--accent); border-color: var(--accent); }
.chk input:checked::after { content: ""; width: 10px; height: 6px; border: solid var(--txt-dark); border-width: 0 0 3px 3px; transform: translateY(-2px) rotate(-45deg); }

/* Segment-Buttons */
.seg { display: flex; background: var(--btn2); border-radius: 6px; padding: 3px; gap: 2px; flex: 1 1 auto; }
.seg button { flex: 1 1 0; border: 0; border-radius: 4px; background: transparent; padding: 4px 6px; cursor: pointer; color: var(--txt); }
.seg button:hover { background: var(--btn2-h); }
.seg button.on { background: var(--accent-dim); }

/* Schieberegler */
.slider { display: flex; align-items: center; gap: 4px; margin: 2px 0; }
.slider .lbl { width: 118px; flex: 0 0 118px; margin: 0; }
.slider .val { width: 40px; text-align: right; font-size: 11px; }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1 1 auto; height: 16px; background: transparent; margin: 0 4px; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent-dim) var(--p, 50%), var(--line) var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent-dim); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); margin-top: -6px; border: 0; }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 0; }
input[type=range]:hover::-webkit-slider-thumb { background: var(--accent-h); }

.swatch { width: 28px; height: 28px; border-radius: 14px; border: 0; cursor: pointer; padding: 0; }
.swatch.big { width: 46px; border-radius: 8px; position: relative; overflow: hidden; }
.swatch.big input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.preview { display: block; height: 34px; margin: 2px 0 6px; max-width: 100%; object-fit: contain; object-position: left center; }

.anchors { display: grid; grid-template-columns: repeat(3, 44px); gap: 4px; justify-content: center; margin: 4px 0; }
.anchors button { height: 32px; border: 0; border-radius: 14px; background: var(--btn2); color: var(--txt); cursor: pointer; font-family: var(--ui-b); }
.anchors button:hover { background: var(--accent-dim); }

.labels-list .item { display: flex; align-items: center; gap: 4px; background: var(--panel); border-radius: 8px; padding: 2px 4px 2px 8px; margin: 2px 0; }
.labels-list .item span { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Statuszeile */
.bar { flex: 0 0 26px; background: var(--panel); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; padding: 0 14px 0 8px; white-space: nowrap; overflow: hidden; }
#status { color: var(--txt-2); overflow: hidden; text-overflow: ellipsis; }
#info { color: var(--txt-3); overflow: hidden; text-overflow: ellipsis; }

/* Dialoge */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.dlg { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; width: 470px; max-width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.dlg.wide { width: 980px; height: 640px; }
.dlg-title { font: 700 20px/1 var(--head); color: var(--accent); padding: 14px 16px 6px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.dlg-title .pill { width: 26px; height: 14px; border-radius: 7px; background: var(--accent); }
.dlg-body { padding: 4px 16px; overflow: auto; flex: 1 1 auto; }
.dlg-body .card { margin: 4px 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 16px 14px; flex-wrap: wrap; }
.dlg hr { border: 0; height: 1px; background: var(--line); margin: 8px 0; }
.summary { white-space: pre-line; color: var(--txt-2); font-size: 11px; margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.meta-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.meta-table th { position: sticky; top: 0; background: var(--card); text-align: left; padding: 4px 6px; color: var(--accent); font-weight: 600; }
.meta-table td { padding: 3px 6px; border-bottom: 1px solid #262931; vertical-align: top; word-break: break-word; }
.meta-table tr:nth-child(even) td { background: #16171d; }
.changelog { white-space: pre-wrap; background: var(--panel); border-radius: 8px; padding: 10px 12px; font-size: 13px; }

.menu { position: fixed; z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 4px 0; min-width: 180px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.menu div { padding: 5px 14px; cursor: pointer; }
.menu div:hover { background: var(--accent-dim); }
.menu hr { border: 0; height: 1px; background: var(--line); margin: 4px 0; }

.tip { position: fixed; z-index: 70; background: #2b2e38; color: var(--txt); border: 1px solid #555; padding: 3px 6px; font-size: 12px; max-width: 320px; pointer-events: none; }
.dropping #view { outline: 2px dashed var(--accent); outline-offset: -6px; }

/* Schmale Fenster / Handy */
@media (max-width: 900px) {
  body { overflow: auto; height: auto; }
  .main { flex-direction: column-reverse; }
  .side { width: 100%; flex: 0 0 auto; overflow: visible; }
  .stage { height: 62vh; flex: 0 0 auto; }
  .brand { font-size: 26px; }
  .brand-sub { display: none; }
  .bar { flex-wrap: wrap; height: auto; padding: 4px 8px; }
}

/* Zurück zur Homepage */
.homebtn { flex: 0 0 auto; align-self: center; border: 2px solid var(--accent); border-radius: 14px; color: var(--accent); padding: 5px 14px; font-family: var(--ui-b); font-weight: 600; text-decoration: none; white-space: nowrap; margin-right: 6px; }
.homebtn:hover { background: var(--accent); color: var(--txt-dark); }
