/* BelegPilot Web – schlichtes, sauberes Layout ohne Frameworks. */
:root {
  --bg: #f4f6f9; --card: #ffffff; --line: #dfe4ea;
  --text: #1f2733; --muted: #6b7686;
  --accent: #2563eb; --accent-dark: #1d4ed8;
  --ok: #16a34a; --bad: #dc2626; --warn: #b45309;
  --soft: #eef2f7; --panel: #f8fafc; --inputbg: #ffffff;
}
:root[data-theme="dark"] {
  --bg: #0f172a; --card: #1e293b; --line: #334155;
  --text: #e5e9f0; --muted: #94a3b8;
  --accent: #3b82f6; --accent-dark: #2563eb;
  --ok: #34d399; --bad: #f87171; --warn: #fbbf24;
  --soft: #334155; --panel: #0b1220; --inputbg: #0b1220;
}
/* Dunkel-Overrides fuer sonst hell-hartkodierte Stellen */
:root[data-theme="dark"] input[type=password],
:root[data-theme="dark"] input[type=text],
:root[data-theme="dark"] select,
:root[data-theme="dark"] .rangein,
:root[data-theme="dark"] .cz-projrow input,
:root[data-theme="dark"] .formcard input {
  background: var(--inputbg); color: var(--text); border-color: var(--line);
}
:root[data-theme="dark"] .thumb { background: var(--panel); }
:root[data-theme="dark"] .complist { background: var(--panel); }
:root[data-theme="dark"] .dropmenu { background: var(--card); }
:root[data-theme="dark"] .dropmenu a:hover,
:root[data-theme="dark"] .compitem:hover { background: #24344d; }
:root[data-theme="dark"] button.secondary { background: var(--soft); color: var(--text); border-color: #475569; }
:root[data-theme="dark"] button.secondary:hover { background: #3f4d63; }
:root[data-theme="dark"] code, :root[data-theme="dark"] .cond, :root[data-theme="dark"] .status { background: var(--soft); color: var(--muted); }
:root[data-theme="dark"] .flash { background: #05372a; border-color: #0f5e46; color: #a7f3d0; }
:root[data-theme="dark"] .error { background: #3f1d1d; border-color: #7f2626; color: #fecaca; }
:root[data-theme="dark"] .statusbar,
:root[data-theme="dark"] .compitem.sel,
:root[data-theme="dark"] .complist.dropactive,
:root[data-theme="dark"] .dropzone.dragover { background: #0b2447; border-color: #1e3a8a; }
:root[data-theme="dark"] .status.s-verarbeitet { background: #05372a; color: #34d399; }
:root[data-theme="dark"] .status.s-fehler { background: #3f1d1d; color: #f87171; }
:root[data-theme="dark"] .status.s-analysiert { background: #0b2447; color: #60a5fa; }
:root[data-theme="dark"] .cards .stat.bad b { color: var(--bad); }
.themebtn { font-size: 15px; line-height: 1; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; width: min(1100px, 94%); margin: 24px auto; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 14px; }
footer a { color: var(--muted); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 8px 0 16px; }
h1 small { font-weight: 400; font-size: 14px; }
h2 { font-size: 15px; margin: 0 0 10px; }
.muted { color: var(--muted); }

/* Kopfleiste */
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  color: #e5e7eb; padding: 10px 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25); position: sticky; top: 0; z-index: 50;
}
.topbar .brand { font-weight: 700; font-size: 16px; white-space: nowrap; }
.topbar .brand small {
  color: #cbd5e1; font-weight: 600; font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; background: rgba(255, 255, 255, .1);
  padding: 2px 6px; border-radius: 5px; margin-left: 2px;
}
.topbar nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; flex: 1; }

/* Pill-Schaltflaechen */
.navlink {
  display: inline-block; color: #cbd5e1; padding: 7px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  transition: background .12s, color .12s;
}
.navlink:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.navlink.active { background: var(--accent); color: #fff; box-shadow: 0 1px 3px rgba(37, 99, 235, .4); }
.topbar .logout { margin-left: auto; color: #fca5a5; }
.topbar .logout:hover { background: rgba(239, 68, 68, .18); color: #fecaca; }

/* Export-Aufklappmenue */
.dropdown { position: relative; display: inline-block; }
.dropdown .caret { font-size: 10px; opacity: .8; }
.dropmenu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 170px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); display: none;
}
.dropdown:hover .dropmenu,
.dropdown:focus-within .dropmenu,
.dropdown.open .dropmenu { display: block; }
.dropmenu a {
  display: block; color: var(--text); padding: 8px 12px; border-radius: 7px;
  font-size: 14px; font-weight: 500;
}
.dropmenu a:hover { background: #eff6ff; color: var(--accent); text-decoration: none; }

/* Karten */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 16px;
}
.cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cards .stat { flex: 1 1 120px; text-align: center; margin-bottom: 0; }
.cards .stat b { display: block; font-size: 24px; }
.cards .stat span { color: var(--muted); font-size: 13px; }
.cards .stat.bad b { color: var(--bad); }

/* Formulare */
form label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 13px; }
input[type=password], input[type=text] {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 15px;
}
input[type=file] { flex: 1; }
button {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
}
button:hover { background: var(--accent-dark); }
.uploadrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
button.secondary { background: #eef2f7; color: var(--text); border: 1px solid var(--line); }
button.secondary:hover { background: #e2e8f0; }
button.linkbtn { background: none; border: 0; color: var(--bad); padding: 0; font-weight: 600; cursor: pointer; }
button.linkbtn:hover { text-decoration: underline; }
a.btnlink { display: inline-block; background: var(--accent); color: #fff; padding: 9px 16px;
  border-radius: 8px; font-weight: 600; font-size: 14px; }
a.btnlink:hover { background: var(--accent-dark); text-decoration: none; }
.newname { font-size: 15px; font-weight: 600; color: var(--ok); word-break: break-all; margin: 4px 0 12px; }
.statusbar { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 14px; }
.vncframe { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 8px; background: #111; }

/* Login/Setup */
.authbox {
  width: min(420px, 94%); margin: 8vh auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 28px 30px;
}
.authbox h1 { text-align: center; }
.authbox h2 { text-align: center; color: var(--muted); font-weight: 400; margin-bottom: 18px; }
.authbox button { width: 100%; }

/* Meldungen */
.flash {
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px;
}
.error {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px;
}
.hint { color: var(--warn); font-size: 13px; }

/* Tabelle */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; }
.status {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  background: #eef2f7; color: var(--muted);
}
.status.s-verarbeitet { background: #ecfdf5; color: var(--ok); }
.status.s-fehler { background: #fef2f2; color: var(--bad); }
.status.s-analysiert { background: #eff6ff; color: var(--accent); }

/* Drag & Drop */
.dropzone {
  border: 2px dashed var(--line); border-radius: 10px; padding: 16px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--accent); background: #eff6ff; }
.dropzone.rejected { border-color: var(--bad); background: #fef2f2; }
.dropzone .drophint { color: var(--muted); margin: 0 0 10px; }
.dropzone .uploadrow { justify-content: center; }
.dropzone .dropcount { color: var(--accent); font-size: 13px; margin: 8px 0 0; min-height: 1em; }

/* Zusammenstellen (visueller Composer, nach Desktop-Vorbild) */
.cz-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cz-toolbar .tlbl { color: var(--muted); font-size: 13px; margin-left: 6px; }
.cz-toolbar select { padding: 7px 8px; }
.rangein { width: 96px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
button.small { padding: 4px 9px; font-size: 12px; }

.composer { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.composer-left { max-height: 74vh; overflow-y: auto; }
.composer-right { position: sticky; top: 70px; }
.composer-right.dragover, .composer-left.dragover { outline: 2px dashed var(--accent); outline-offset: -4px; }

.filegroup { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 12px; cursor: grab; }
.filegroup.dragging { opacity: .5; }
.filehead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.filehead .fname { font-size: 13px; margin-right: auto; word-break: break-all; }
.filehead .grip { color: var(--muted); cursor: grab; }
.complist.dropactive { border-color: var(--accent); background: #eff6ff; }
.thumbgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.thumb { position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  cursor: pointer; background: #fff; padding: 0; transition: border-color .12s, box-shadow .12s; }
.thumb:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(37, 99, 235, .25); }
.thumb img { display: block; width: 100%; height: auto; }
.thumb .pgno { position: absolute; bottom: 2px; right: 2px; background: rgba(17, 24, 39, .8);
  color: #fff; font-size: 10px; padding: 0 5px; border-radius: 4px; }

.complabel { font-weight: 600; margin-bottom: 8px; }
.complist { list-style: none; margin: 0; padding: 6px; min-height: 120px; max-height: 46vh; overflow-y: auto;
  border: 1px dashed var(--line); border-radius: 8px; background: #f8fafc; }
.compitem { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px;
  cursor: grab; border: 1px solid transparent; }
.compitem:hover { background: #eef2f7; }
.compitem.sel { background: #eff6ff; border-color: #bfdbfe; }
.compitem.dragging { opacity: .4; }
.compitem img { width: 34px; height: auto; border: 1px solid var(--line); border-radius: 3px; }
.compitem .clabel { font-size: 13px; word-break: break-all; }

.cz-btnrow, .cz-projrow { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.cz-btnrow button { flex: 1; }
.cz-projrow input { flex: 1; min-width: 120px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }
.cz-result { color: var(--muted); font-size: 13px; margin-top: 8px; min-height: 1em; }
@media (max-width: 860px) { .composer { grid-template-columns: 1fr; } .composer-right { position: static; } }

/* Ampel (Bestellungen) */
.ampel { display: inline-block; white-space: nowrap; font-size: 13px; font-weight: 600; }
.ampel.a-rot { color: var(--bad); }
.ampel.a-gelb { color: #ca8a04; }
.ampel.a-hellgruen { color: #65a30d; }
.ampel.a-gruen { color: var(--ok); }
.ampel.a-grau { color: var(--muted); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700;
}
.badge.warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* Formular-Karte (Einstellungen) */
.formcard label { display: block; margin-bottom: 16px; font-weight: 600; }
.formcard label small { display: block; font-weight: 400; color: var(--muted); margin-top: 3px; }
.formcard label.check { font-weight: 400; }
.formcard label.check input { width: auto; display: inline; margin-right: 6px; }
.inlinelbl { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; }
.inlinelbl.checkinline { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.inlinelbl.checkinline input { width: auto; }
fieldset.subsection { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 8px 0 16px; }
fieldset.subsection legend { font-weight: 600; padding: 0 6px; }
.mono, td.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; }
.cond { background: #eef2f7; border-radius: 6px; padding: 1px 7px; font-size: 12px; white-space: nowrap; }
select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: 13px; }

/* Detailseite */
.detail { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.detail dd.path { word-break: break-all; font-size: 12px; color: var(--muted); }
.viewer iframe { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 800px) { .detail { grid-template-columns: 1fr; } }

/* ---------------- PDF-Editor (/edit) ---------------- */
.ed-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ed-toolbar .tlbl { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.ed-toolbar .tsep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 2px; }
.ed-toolbar input[type="number"] { width: 62px; }
.ed-tools { display: inline-flex; gap: 6px; }
.edtool { background: var(--soft); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.edtool:hover { border-color: var(--accent); }
.edtool.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.ed-enhpanel { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ed-enhpanel .tlbl { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.ed-drop { text-align: center; padding: 40px 16px; border: 2px dashed var(--line); cursor: pointer; }
.ed-drop.dragover { border-color: var(--accent); background: var(--soft); }
.ed-dropbig { font-size: 20px; font-weight: 600; margin: 0 0 4px; }

.editor { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.ed-strip { max-height: 74vh; overflow-y: auto; padding: 10px; }
.ed-pcard { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 6px; background: var(--panel); cursor: pointer; display: grid; grid-template-columns: 46px 1fr; grid-template-areas: "thumb meta" "ctr ctr"; gap: 6px 8px; align-items: center; }
.ed-pcard.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37,99,235,.25); }
.ed-pcard.dropinto { border-color: var(--accent); background: var(--soft); }
.ed-pthumb { grid-area: thumb; width: 46px; height: 60px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.ed-pmeta { grid-area: meta; display: flex; flex-direction: column; gap: 3px; }
.ed-pnum { font-size: 12px; font-weight: 600; }
.ed-badge { font-size: 10px; color: var(--accent); background: var(--soft); border: 1px solid var(--line); border-radius: 20px; padding: 1px 7px; width: fit-content; }
.ed-pctr { grid-area: ctr; display: flex; gap: 4px; }
.ed-mini { flex: 1; background: var(--soft); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 3px 0; cursor: pointer; font-size: 13px; line-height: 1; }
.ed-mini:hover { border-color: var(--accent); }
.ed-mini.danger:hover { border-color: var(--bad); color: var(--bad); }
.ed-cut { display: block; width: 100%; border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 6px; padding: 3px 0; margin: 0 0 8px; cursor: pointer; font-size: 11px; }
.ed-cut:hover { border-color: var(--warn); color: var(--warn); }
.ed-cut.on { border-style: solid; border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); font-weight: 600; }

.ed-canvaswrap { min-height: 200px; display: flex; justify-content: center; align-items: flex-start; }
.ed-canvashint { padding: 40px; }
.ed-stage { position: relative; display: inline-block; line-height: 0; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
#ed-page { display: block; max-width: 100%; max-height: 74vh; user-select: none; }
.ed-overlay { position: absolute; inset: 0; touch-action: none; }
.ed-stage.drawing .ed-overlay { cursor: crosshair; }
.ed-grid { position: absolute; inset: 0; pointer-events: none; background-image:
  linear-gradient(to right, rgba(120,130,145,.40) 1px, transparent 1px),
  linear-gradient(to bottom, rgba(120,130,145,.40) 1px, transparent 1px); }
.ed-anno { position: absolute; box-sizing: border-box; }
.ed-anno.cover { opacity: 1; }
.ed-anno.marker { opacity: .35; }
.ed-anno.redact { background: #000 !important; outline: 2px dashed var(--bad); outline-offset: -2px; }
.ed-anno.img img { width: 100%; display: block; user-select: none; }
.ed-stamplist { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ed-stampchip { border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px; font-size: 12px; background: var(--panel); white-space: nowrap; }
.ed-chipx { border: 0; background: transparent; color: var(--bad); cursor: pointer; font-size: 13px; padding: 0 2px; }
.ed-anno.text { line-height: 1.1; white-space: pre; font-family: Helvetica, Arial, sans-serif; }
.ed-annox { position: absolute; top: -9px; right: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--bad); color: #fff; font-size: 12px; line-height: 18px; text-align: center; cursor: pointer; opacity: 0; transition: opacity .1s; }
.ed-anno:hover .ed-annox, .ed-cropbox:hover .ed-annox { opacity: 1; }
.ed-rubber { position: absolute; box-sizing: border-box; }
.ed-rubber.cover { background: rgba(0,0,0,.55); }
.ed-rubber.redact { background: rgba(0,0,0,.7); outline: 2px dashed var(--bad); outline-offset: -2px; }
.ed-rubber.marker { background: rgba(250,204,21,.4); }
.ed-rubber.crop { border: 2px dashed var(--accent); background: rgba(37,99,235,.1); }
.ed-rubber.move { border: 2px dashed var(--ok); background: rgba(22,163,74,.15); }
.ed-movehole { position: absolute; box-sizing: border-box; border: 1px dashed var(--muted); background: repeating-linear-gradient(45deg, rgba(127,127,127,.10), rgba(127,127,127,.10) 5px, transparent 5px, transparent 10px); }
.ed-move { position: absolute; box-sizing: border-box; border: 2px solid var(--ok); cursor: move; background-repeat: no-repeat; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.ed-move:hover .ed-annox { opacity: 1; }
.ed-cropbox { position: absolute; box-sizing: border-box; border: 2px dashed var(--accent); box-shadow: 0 0 0 9999px rgba(0,0,0,.35); }
.ed-perspsvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ed-perspoly { fill: rgba(37,99,235,.12); stroke: var(--accent); stroke-width: 2; }
.ed-perhandle { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.5); cursor: move; pointer-events: auto; touch-action: none; }
.ed-croplbl { position: absolute; top: 2px; left: 2px; font-size: 11px; background: var(--accent); color: #fff; padding: 0 5px; border-radius: 4px; line-height: 16px; }

/* ---------------- Listen-Aktionen (löschen, erinnern) ---------------- */
.inlineform { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.minibtn { display: inline-block; background: var(--soft); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 12px; cursor: pointer; text-decoration: none; line-height: 1.6; }
.minibtn:hover { border-color: var(--accent); }
.minibtn.danger:hover { border-color: var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.acts { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.delfile { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.rowbtns { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.rowbtns .navlink { text-decoration: none; }

/* ---------------- Beleg scannen (/scan) ---------------- */
.sc-big { width: 100%; font-size: 17px; padding: 16px; }
.sc-opt { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; color: var(--muted); font-size: 14px; }
.sc-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.sc-page { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.sc-page img { display: block; width: 100%; height: 120px; object-fit: cover; }
.sc-page figcaption { position: absolute; left: 4px; top: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; border-radius: 4px; padding: 0 5px; }
.sc-del { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; line-height: 1; font-size: 14px; }
.sc-splitrow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.sc-splitrow .tlbl { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.sc-device { display: flex; flex-direction: column; gap: 10px; }
.sc-devhead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sc-devrow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.sc-devrow .tlbl { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.sc-crop { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sc-stage { position: relative; display: inline-block; line-height: 0; max-width: 100%; }
#sc-cropimg { display: block; max-width: 100%; max-height: 62vh; user-select: none; }
.sc-btnrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
@media (max-width: 640px) { .sc-btnrow button { flex: 1 1 45%; } }

.ed-modalback { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 1000; }
.ed-modal { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; width: 520px; max-width: 100%; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.ed-modal h2 { margin: 0 0 10px; font-size: 18px; }
.ed-reviewcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 10px 0; background: var(--panel); }
.ed-reviewtitle { font-weight: 600; margin-bottom: 8px; }
.ed-dupwarn { background: color-mix(in srgb, var(--warn) 15%, transparent); border: 1px solid var(--warn); color: var(--warn); border-radius: 8px; padding: 7px 10px; font-size: 13px; margin-bottom: 8px; }
.ed-fld { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 8px; margin: 6px 0; }
.ed-fld span { color: var(--muted); font-size: 13px; }
.ed-fld input { width: 100%; }
.ed-modalbtns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.ed-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ed-actions input[type="text"] { flex: 1; min-width: 160px; }
.ed-result { color: var(--muted); font-size: 13px; }
.ed-result.err { color: var(--bad); }
@media (max-width: 800px) { .editor { grid-template-columns: 1fr; } .ed-strip { max-height: 40vh; } }
