/* Rechnungseditor – Gestaltung. Alle Farben und Schriften stehen oben; es werden keine fremden Schriften geladen. */
:root {
  /* Layout: one sheet of paper on a quiet desk, filled in directly like a form.
     A narrow rail on the right carries the till receipt (totals), the actions and the building blocks. */
  --desk: #E1E7E2;
  --panel: #F5F8F5;
  --field: #FFFFFF;
  --ink: #15231C;
  --ink-soft: #54655B;
  --line: #C2CDC5;
  --green: #0B6B4B;
  --on-green: #FFFFFF;
  --green-tint: #D8EADE;
  --bon: #FFFFFF;
  --ok: #1D6B34; --ok-bg: #DDF0E1;
  --warn: #7A4F00; --warn-bg: #FBEBC8;
  --crit: #A8261C; --crit-bg: #FADFDB;
  --shadow: 0 1px 2px rgba(21, 35, 28, .10), 0 14px 34px -14px rgba(21, 35, 28, .30);
  --font-display: "Sofia Sans Condensed", "DIN Alternate", "Bahnschrift", "Arial Narrow", sans-serif;
  --font-body: "Sofia Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-doc: Helvetica, Arial, "Liberation Sans", sans-serif;
  /* The sheet stays paper in both themes: these never change. */
  --paper: #FFFFFF; --doc-ink: #16181A; --doc-soft: #5F656B; --doc-line: #C9CED3; --doc-band: #EEF1F2;
  --doc-hover: #F2F6F3; --doc-focus: #0B6B4B; --doc-focus-bg: #E4F1E9; --doc-bad: #A8261C;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --desk: #111916; --panel: #19231E; --field: #101713; --ink: #E4ECE7; --ink-soft: #9CB0A5; --line: #33423A;
    --green: #56C795; --on-green: #062116; --green-tint: #1D382C; --bon: #212D27;
    --ok: #7FD69A; --ok-bg: #173323; --warn: #F0C36A; --warn-bg: #3A2D10; --crit: #FF9C8F; --crit-bg: #40201C;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 36px -12px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --desk: #111916; --panel: #19231E; --field: #101713; --ink: #E4ECE7; --ink-soft: #9CB0A5; --line: #33423A;
  --green: #56C795; --on-green: #062116; --green-tint: #1D382C; --bon: #212D27;
  --ok: #7FD69A; --ok-bg: #173323; --warn: #F0C36A; --warn-bg: #3A2D10; --crit: #FF9C8F; --crit-bg: #40201C;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 36px -12px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--desk); color: var(--ink); font: 400 15px/1.45 var(--font-body); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }

/* ---------- top bar ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; padding: 8px clamp(16px, 3vw, 28px) 0; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; color: inherit; font: 800 24px/1 var(--font-display); letter-spacing: .01em; text-decoration: none; }
.brand svg { flex: none; }
.top-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-left: auto; padding-bottom: 8px; }
.nav { display: flex; flex-wrap: wrap; align-self: flex-end; gap: 0 2px; }
.nav a { display: inline-flex; align-items: baseline; gap: 6px; padding: 9px 11px 10px; border-bottom: 3px solid transparent; color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { border-bottom-color: var(--green); color: var(--ink); }
.nav .n { font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.nav .n.flag { color: var(--warn); font-weight: 700; }
.who { max-width: 22ch; overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; text-underline-offset: 3px; }
.who[aria-current="page"] { text-decoration-color: var(--green); text-decoration-thickness: 2px; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline > span { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg-b { border: 0; background: var(--field); padding: 0 10px; min-height: 32px; font-size: 14px; font-weight: 600; }
.seg-b + .seg-b { border-left: 1px solid var(--line); }
.seg-b[aria-pressed="true"] { background: var(--ink); color: var(--panel); }

/* ---------- controls of the tool itself ---------- */
.inp { width: 100%; min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); }
.inp:hover { border-color: var(--ink-soft); }
.inp[aria-invalid="true"] { border-color: var(--crit); }
textarea.inp { resize: vertical; min-height: 76px; }
.fld { display: grid; gap: 4px; min-width: 0; }
.fld > span, .fld > .lbl { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.err { color: var(--crit); font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); font-weight: 600; text-align: center; }
.btn:hover { border-color: var(--ink-soft); }
a.btn { color: inherit; text-decoration: none; }
.btn:disabled, .icon-btn:disabled { opacity: .5; cursor: default; }
.inp:disabled { opacity: .65; }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--on-green); }
.btn-primary:hover { border-color: var(--green); filter: brightness(1.1); }
.btn-warn { background: var(--crit); border-color: var(--crit); color: var(--panel); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-soft); font-weight: 500; padding: 0 8px; }
.btn-quiet:hover { border-color: var(--line); color: var(--ink); }
.btn-quiet.danger:hover { color: var(--crit); }
.btn-small { min-height: 32px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; min-height: 46px; font-size: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink-soft); flex: none; }
.icon-btn:hover { border-color: var(--line); color: var(--ink); }
.switch { position: relative; flex: none; width: 42px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--field); }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-soft); transition: transform .15s ease; }
.switch[aria-checked="true"] { background: var(--green); border-color: var(--green); }
.switch[aria-checked="true"] .knob { transform: translateX(18px); background: var(--on-green); }
.check { display: flex; align-items: flex-start; gap: 10px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green); flex: none; }

/* ---------- work area ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 332px; gap: 24px; align-items: start; max-width: 1240px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 28px) 56px; }
.desk { min-width: 0; grid-column: 1; grid-row: 1; }
.rail { grid-column: 2; grid-row: 1; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; scrollbar-width: thin; display: flex; flex-direction: column; gap: 16px; margin: 0 -10px; padding: 0 10px 14px; }
.rail-a, .rail-b { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 940px) {
  .work { display: flex; flex-direction: column; gap: 16px; }
  .rail { display: contents; }
  .rail-a { order: 1; }
  .desk { order: 2; }
  .rail-b { order: 3; }
}

/* ---------- the sheet ---------- */
.sheet { display: flex; flex-direction: column; gap: 28px; max-width: 820px; margin: 0 auto; padding: clamp(18px, 6vw, 48px); background: var(--paper); color: var(--doc-ink); color-scheme: light; font: 400 14px/1.45 var(--font-doc); border-radius: 2px; box-shadow: var(--shadow); }
.sheet input, .sheet select, .sheet textarea { width: 100%; min-width: 0; padding: 4px 3px; border: 0; border-bottom: 1px solid var(--doc-line); border-radius: 0; background-color: transparent; color: inherit; font: inherit; }
.sheet select { appearance: none; -webkit-appearance: none; padding-right: 20px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235F656B' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 4px center; background-size: 10px 7px; text-overflow: ellipsis; }
.sheet textarea { display: block; resize: none; overflow: hidden; line-height: 1.45; }
.sheet input:hover, .sheet select:hover, .sheet textarea:hover { background-color: var(--doc-hover); }
.sheet input:focus-visible, .sheet select:focus-visible, .sheet textarea:focus-visible { outline: none; background-color: var(--doc-focus-bg); border-bottom-color: var(--doc-focus); box-shadow: 0 1px 0 var(--doc-focus); }
.sheet [aria-invalid="true"] { border-bottom-color: var(--doc-bad); box-shadow: 0 1px 0 var(--doc-bad); }
.sheet ::placeholder { color: #9AA1A7; opacity: 1; }
.sheet button:focus-visible { outline-color: var(--doc-focus); }
.sheet .num { text-align: right; font-variant-numeric: tabular-nums; }

.sh-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 24px; align-items: start; }
.logo-zone { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 290px; min-height: 86px; padding: 12px 14px; border: 1px dashed var(--doc-line); border-radius: 4px; background: transparent; color: var(--doc-soft); text-align: left; }
.logo-zone:hover, .logo-zone.over { border-color: var(--doc-focus); background: var(--doc-focus-bg); color: var(--doc-ink); }
.logo-zone svg { flex: none; }
.logo-has { display: grid; gap: 6px; justify-items: start; }
.logo-has img { display: block; width: auto; height: auto; max-width: min(100%, 250px); max-height: 96px; }
.logo-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mini { padding: 0; border: 0; background: none; color: var(--doc-soft); font-size: 12.5px; text-decoration: underline; text-underline-offset: 2px; }
.mini:hover { color: var(--doc-ink); }
.meta { display: grid; gap: 8px; }
.meta-type { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 8px; align-items: end; }
.meta-type select { font-size: 20px; font-weight: 700; }
.meta-type input { font-size: 16px; text-align: right; }
.meta-row { display: grid; grid-template-columns: minmax(0, 1fr) 148px; gap: 8px; align-items: center; }
.meta-row label { text-align: right; color: var(--doc-soft); font-size: 13px; }

.parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.party-col { display: grid; gap: 10px; min-width: 0; margin: 0 -10px; }
.sheet > .cf { width: calc(100% + 20px); margin: 0 -10px; }
.party { display: grid; gap: 2px; width: 100%; padding: 10px; border: 1px dashed transparent; border-radius: 4px; background: transparent; color: inherit; font: inherit; text-align: left; overflow-wrap: anywhere; }
.party:hover { border-color: var(--doc-line); background: var(--doc-hover); }
.party-role { font-size: 12px; font-weight: 700; color: var(--doc-soft); }
.party-name { font-size: 16px; font-weight: 700; }
.party-lines { display: grid; }
.party .ph { color: #8B9298; }
.party .party-name.ph { text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 4px; }
.cf { display: grid; gap: 4px; width: 100%; padding: 6px 10px; border: 1px dashed transparent; border-radius: 4px; background: transparent; color: inherit; font: inherit; font-size: 13px; text-align: left; overflow-wrap: anywhere; }
.cf:hover { border-color: var(--doc-line); background: var(--doc-hover); }
.cf-row { white-space: pre-line; }
.cf-row b { color: var(--doc-soft); }

.items { display: grid; }
.it-head, .it-row { display: grid; grid-template-columns: minmax(0, 1fr) 60px 100px 108px 100px 28px; gap: 8px; align-items: start; padding: 8px; }
.it-head { background: var(--doc-band); color: var(--doc-soft); font-size: 12px; font-weight: 700; }
.it-head > span { padding: 0 3px; }
.it-row { border-bottom: 1px solid var(--doc-line); }
.it-main { display: grid; gap: 2px; min-width: 0; }
.it-name { font-weight: 700; }
.sheet textarea.it-desc { font-size: 13px; color: var(--doc-soft); }
.cell { display: block; min-width: 0; }
.cap { display: none; font-size: 11.5px; color: var(--doc-soft); }
.it-sub { display: block; padding: 4px 3px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.it-del { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--doc-soft); }
.it-del:hover { background: #F6E3E0; color: var(--doc-bad); }
.it-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 42px; margin-top: 10px; border: 1px dashed var(--doc-line); border-radius: 4px; background: transparent; color: var(--doc-soft); font: inherit; font-weight: 700; }
.it-add:hover { border-color: var(--doc-focus); background: var(--doc-focus-bg); color: var(--doc-ink); }

.sum { display: grid; gap: 5px; width: min(100%, 310px); margin-left: auto; font-variant-numeric: tabular-nums; }
.sum-row { display: flex; justify-content: space-between; gap: 16px; }
.sum-row > span:first-child { color: var(--doc-soft); }
.sum-row > span:last-child { white-space: nowrap; }
.sum-strong { margin-top: 4px; padding-top: 7px; border-top: 1.5px solid var(--doc-ink); font-size: 17px; font-weight: 700; }
.sum-strong > span:first-child { color: inherit; }
.terms { display: grid; gap: 4px; }
.terms > label { padding-left: 3px; font-size: 12px; font-weight: 700; color: var(--doc-soft); }

@media (max-width: 640px) {
  .sh-head, .parties { grid-template-columns: minmax(0, 1fr); }
  .meta-row label { text-align: left; }
  .it-head { display: none; }
  .it-row { grid-template-columns: repeat(3, minmax(0, 1fr)) 28px; grid-template-areas: "main main main del" "qty price tax tax" "sub sub sub sub"; padding: 12px 0; }
  .it-main { grid-area: main; }
  .c-qty { grid-area: qty; }
  .c-price { grid-area: price; }
  .c-tax { grid-area: tax; }
  .c-sub { grid-area: sub; display: flex; justify-content: space-between; align-items: baseline; }
  .it-del { grid-area: del; }
  .cap { display: block; }
  .sheet .num { text-align: left; }
}

/* ---------- rail ---------- */
.bon-wrap { filter: drop-shadow(0 6px 10px rgba(21, 35, 28, .16)); }
.bon { display: grid; gap: 12px; padding: 16px 18px 28px; background: var(--bon);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%; }
.bon-figures { display: grid; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 2px 10px; border: 1px solid transparent; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pill.plain { border-color: var(--line); color: var(--ink-soft); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.crit { background: var(--crit-bg); color: var(--crit); }
.pill-btn { padding: 0; border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.bon-total { display: grid; gap: 2px; }
.bon-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.bon-amount { font: 800 40px/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: .005em; overflow-wrap: anywhere; }
.bon-rows { display: grid; gap: 4px; font-size: 14px; }
.lead { display: flex; align-items: baseline; gap: 6px; }
.lead i { flex: 1; min-width: 12px; border-bottom: 1px dotted var(--ink-soft); transform: translateY(-3px); }
.lead .fig { font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions { display: grid; gap: 8px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.panel { display: grid; gap: 12px; padding: 14px 16px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.panel h2 { font: 700 18px/1.2 var(--font-display); letter-spacing: .01em; }
.blk { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; }

/* ---------- start, sign-in, first setup ---------- */
.boot { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 100vh; padding: 24px; color: var(--ink-soft); text-align: center; }
.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.auth-card { display: grid; gap: 18px; width: min(460px, 100%); padding: 28px 28px 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.auth-card .brand { padding: 0; font-size: 20px; color: var(--ink-soft); }
.auth-card h1 { font: 800 32px/1.08 var(--font-display); text-wrap: balance; }
.auth-card form { display: grid; gap: 14px; }
.auth-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.steps { display: grid; gap: 8px; margin: 0; padding-left: 22px; }
code { padding: 1px 5px; border-radius: 4px; background: var(--green-tint); font: 500 .92em/1.3 ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.hint { font-size: 13px; color: var(--ink-soft); }
.link { padding: 0; border: 0; background: none; color: var(--green); font-weight: 600; text-align: left; text-decoration: underline; text-underline-offset: 2px; }
a.link:hover, .link:hover { text-decoration-thickness: 2px; }

/* ---------- an admin looking into another account ---------- */
.banner { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; padding: 8px 16px; border-bottom: 1px solid var(--warn); background: var(--warn-bg); color: var(--warn); font-weight: 600; text-align: center; }
.banner .btn { border-color: var(--warn); background: transparent; color: inherit; }

/* ---------- list pages ---------- */
.page { display: grid; gap: 20px; align-content: start; max-width: 1240px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 28px) 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.page-head > div { display: grid; gap: 8px; }
.list .line { display: block; }
.page-head h1 { font: 800 36px/1.05 var(--font-display); letter-spacing: .005em; }
.page h2 { font: 700 23px/1.15 var(--font-display); }
.lede { max-width: 70ch; color: var(--ink-soft); }
.section { display: grid; gap: 12px; align-content: start; min-width: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar .inp { width: auto; }
.toolbar .grow { flex: 1 1 240px; min-width: 0; }
.toolbar .push { margin-left: auto; }
.sums { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.sums b { color: var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--field); }
table.list { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 14.5px; }   /* on a narrow screen the table scrolls inside its frame */
table.list.imp { min-width: 1040px; }
.list .link { white-space: nowrap; }
.list th { padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); font-size: 12.5px; font-weight: 700; text-align: left; white-space: nowrap; }
.list td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr:hover td { background: var(--panel); }
.list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list .nowrap { white-space: nowrap; }
.list .pick { width: 34px; padding-right: 0; }
.list .pick input, .list th input { display: block; width: 17px; height: 17px; margin: 0; accent-color: var(--green); }
.list .acts { text-align: right; white-space: nowrap; }
.list .acts > * { margin-left: 4px; vertical-align: middle; }
.list .sub { display: block; font-size: 12.5px; color: var(--ink-soft); }
.list .pill { margin: 1px 4px 1px 0; white-space: nowrap; }
.empty { display: grid; justify-items: center; gap: 12px; padding: 44px 20px; border: 1px dashed var(--line); border-radius: 8px; color: var(--ink-soft); text-align: center; }
.empty strong { color: var(--ink); font: 700 22px/1.2 var(--font-display); }
.more { display: flex; justify-content: center; }
.kv { display: grid; grid-template-columns: minmax(150px, max-content) minmax(0, 1fr); gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--field); overflow: hidden; }
.kv dt, .kv dd { margin: 0; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--ink-soft); font-size: 13.5px; font-weight: 600; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.kv .state { font-weight: 600; }
.kv .state.ok { color: var(--ok); }
.kv .state.warn { color: var(--warn); }
.kv .state.crit { color: var(--crit); }
.narrow-form { display: grid; gap: 14px; max-width: 420px; }
.with-btn { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
@media (max-width: 560px) { .kv { grid-template-columns: minmax(0, 1fr); } .kv dt { padding-bottom: 0; border-bottom: 0; } }

/* ---------- import ---------- */
.drop { display: grid; justify-items: center; gap: 10px; padding: 36px 20px; border: 2px dashed var(--line); border-radius: 10px; background: var(--panel); text-align: center; }
.drop.over { border-color: var(--green); background: var(--green-tint); }
.drop strong { font: 700 24px/1.2 var(--font-display); }
.drop.slim { grid-auto-flow: column; justify-content: center; align-items: center; gap: 14px; padding: 14px 16px; }
.drop.slim strong { font-size: 18px; }
.opts { display: grid; gap: 8px; }
.progress { display: grid; gap: 6px; }
progress { display: block; width: 100%; height: 8px; accent-color: var(--green); }
.imp td { padding: 6px 8px; }
.imp .inp { min-height: 32px; padding: 3px 8px; }
.imp .c-file { min-width: 150px; max-width: 220px; }
.imp .c-no .inp { width: 9.5em; }
.imp .c-date .inp { width: 9.6em; }
.imp .c-cust .inp { min-width: 13em; }
.imp .c-amt { white-space: nowrap; }
.imp .c-amt .inp { width: 7.5em; text-align: right; }
.imp .c-amt select.inp { width: 5.2em; text-align: left; }
.imp tr.is-done td, .imp tr.is-skip td { background: var(--panel); color: var(--ink-soft); }
.hints { display: flex; flex-wrap: wrap; gap: 4px; min-width: 150px; }
.hints .pill { margin: 0; font-size: 12.5px; white-space: normal; }
.result { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 8px; background: var(--panel); }
.result.warn { border-left-color: var(--warn); }
.result ul { margin: 0; padding-left: 20px; }

/* ---------- dialogs and toasts ---------- */
dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 64px -16px rgba(0, 0, 0, .5); }
dialog.narrow { width: min(440px, calc(100vw - 32px)); }
dialog.wide { width: min(860px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 18, 14, .55); }
.dlg { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 4px; }
.dlg-head h2 { font: 700 24px/1.15 var(--font-display); text-wrap: balance; }
.dlg-body { display: grid; gap: 14px; padding: 12px 20px 18px; overflow: auto; }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid2 .full { grid-column: 1 / -1; }
.phone { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 6px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 12px; }
.cf-edit { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); }
.cf-edit-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
@media (max-width: 560px) { .cf-edit-top { grid-template-columns: minmax(0, 1fr) auto; } .cf-edit-top .fld:first-child { grid-column: 1 / -1; } }
.pv-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.pv-opts .inp { width: auto; }
.pv { display: grid; gap: 16px; justify-items: center; min-height: 120px; padding: 16px; background: var(--desk); border-radius: 6px; }
.pv canvas { display: block; width: 100%; max-width: 700px; height: auto; box-shadow: var(--shadow); }
.toasts { position: fixed; left: 50%; bottom: 20px; z-index: 40; display: grid; gap: 8px; width: min(460px, calc(100vw - 32px)); transform: translateX(-50%); pointer-events: none; }
.toast { padding: 10px 14px; border-radius: 8px; background: var(--ink); color: var(--panel); font-weight: 500; box-shadow: var(--shadow); }
.toast.crit { background: var(--crit); }
@media (prefers-reduced-motion: reduce) { .switch .knob { transition: none; } }
