/* Auftragsbuch – Werkstatt-Oberfläche: ruhiges Papiergrau, Stempelblau als einzige Akzentfarbe,
   große Mengenangaben in der Produktion, Adressen wie echte Versandetiketten. */
html { color-scheme: light; }
:root {
  /* Werkstatt: kühles Grüngrau, Eukalyptus als Hauptfarbe, Filament-Gelb nur für Zähler */
  --paper: #EDF0EC;
  --card: #FFFFFF;
  --ink: #1E2A28;
  --muted: #5A6763;
  --line: #D3DBD6;
  --blue: #2E6A5C;          /* Eukalyptus (Name bleibt für bestehende Regeln) */
  --blue-soft: #DCEBE5;
  --blue-dark: #22524A;
  --kopf: #1F3B35;          /* Kopfzeile */
  --gelb: #F2C14E;          /* Filament-Gelb */
  --amber-soft: #FBEFC8;
  --amber-ink: #7A5A00;
  --green: #2F7A4D;
  --green-soft: #DCEFE3;
  --red: #B3261E;
  --red-soft: #FBE4E2;
  --radius: 12px;
  --kopf-h: 3.6rem;
  --tabbar-h: 0px;
  --font: "Atkinson Hyperlegible", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: "Bricolage Grotesque", "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.5; }
a { color: var(--blue); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
code { font-size: .9em; background: rgba(0,0,0,.06); padding: .1em .35em; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Kopfzeile */
.topbar { display: flex; align-items: center; gap: 2rem; padding: .75rem clamp(1rem, 4vw, 2.5rem); background: var(--ink); color: #fff; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.topbar nav a { color: #D7DEDB; text-decoration: none; padding: .45rem .8rem; border-radius: 6px; display: inline-flex; align-items: center; gap: .45rem; }
.topbar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.topbar nav a[aria-current] { background: #fff; color: var(--ink); font-weight: 700; }
.count { font-variant-numeric: tabular-nums; font-size: .8rem; min-width: 1.6em; text-align: center; padding: .05rem .4rem; border-radius: 99px; background: rgba(255,255,255,.16); }
.topbar nav a[aria-current] .count { background: var(--blue); color: #fff; }

main { max-width: 1120px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem; }
.page-head { margin-bottom: 1.75rem; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.15; margin: 0 0 .35rem; }
.lead { color: var(--muted); margin: 0; max-width: 70ch; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.section-title { font-size: 1.3rem; margin: 2.75rem 0 .3rem; }
.section-title + .lead { margin-bottom: 1rem; }

/* Hinweise */
.notice { padding: .8rem 1rem; border-radius: 8px; margin: 0 0 1.25rem; border-left: 4px solid; }
.notice-ok { background: var(--green-soft); border-color: var(--green); }
.notice-error { background: var(--red-soft); border-color: var(--red); }
.notice-warn { background: var(--amber-soft); border-color: #D9A400; }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2rem; max-width: 60ch; }
.empty p { margin: 0 0 .5rem; }

/* Buttons & Formulare */
.btn { font: inherit; font-weight: 700; cursor: pointer; border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); padding: .6rem 1rem; border-radius: 8px; white-space: nowrap; }
.btn:hover { background: var(--paper); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #2230A6; }
.btn-quiet { border-color: var(--line); font-weight: 400; padding: .35rem .75rem; font-size: .9rem; margin-top: .6rem; }
input, select { font: inherit; font-weight: 400; padding: .55rem .7rem; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; font-weight: 700; }
.optional { font-weight: 400; color: var(--muted); }

/* Quelle & Status */
.src { font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); background: var(--card); }
.src-etsy { color: #A8430F; border-color: #EBC7B3; }
.src-woocommerce { color: #6B3FA0; border-color: #D6C6EA; }
.status { font-size: .85rem; font-weight: 700; padding: .15rem .6rem; border-radius: 99px; }
.status-neu { background: var(--blue-soft); color: var(--blue); }
.status-in_produktion { background: var(--amber-soft); color: var(--amber-ink); }
.status-versandbereit { background: #DDF0F1; color: #1C6A70; }
.status-versendet { background: var(--green-soft); color: var(--green); }
.status-storniert { background: #E6E8E7; color: var(--muted); text-decoration: line-through; }

/* Produktion: Pickliste mit großen Mengen */
.picklist { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pick { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 1.25rem; align-items: start; padding: 1.1rem 1.25rem; }
.pick + .pick { border-top: 1px solid var(--line); }
.pick-qty { font-size: 1.4rem; font-weight: 700; color: var(--blue); line-height: 1; font-variant-numeric: tabular-nums; text-align: right; }
.pick-qty span { font-size: 3rem; letter-spacing: -.03em; }
.pick-body h2 { font-size: 1.15rem; margin: .2rem 0 .1rem; }
.variant { color: var(--muted); margin: 0; }
.pick-orders { margin-top: .4rem; font-size: .92rem; }
.pick-orders summary { cursor: pointer; color: var(--muted); }
.pick-orders ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.pick-orders li { margin: .2rem 0; }
.pick-action { align-self: center; }
.wish { margin: .6rem 0 .4rem; padding: .6rem .85rem; background: var(--amber-soft); border-left: 3px solid #D9A400; border-radius: 0 6px 6px 0; font-size: 1.1rem; white-space: pre-wrap; }
.wish-inline { display: inline-block; background: var(--amber-soft); padding: 0 .35rem; border-radius: 4px; }
.meta { color: var(--muted); font-size: .9rem; margin: .2rem 0 0; display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }

/* Versand: Pakete mit Adressetikett */
.parcels { display: grid; gap: 1.25rem; }
.parcel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.parcel-head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.parcel-no { font-weight: 700; font-size: 1.15rem; }
.parcel-method { margin-left: auto; color: var(--muted); }
.parcel-grid { display: grid; grid-template-columns: minmax(240px, 1fr) 1.3fr; gap: 1.5rem; }
.label { border: 2px solid var(--ink); border-radius: 3px; padding: .9rem 1.1rem; font-size: 1.12rem; line-height: 1.45; background: #fff; max-width: 26rem; }
.contents { margin: 0; padding-left: 1.1rem; }
.contents li { margin: .25rem 0; }
.buyer-note { background: var(--paper); padding: .6rem .8rem; border-radius: 6px; font-size: .95rem; }
.ship-form { display: flex; gap: .9rem; align-items: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: 1rem; }
.ship-form label:nth-of-type(2) { flex: 1 1 14rem; }

/* Kopierhilfe für DHL- und Hermes-Paketscheine */
.helper { margin-top: 1.25rem; padding: 1rem 1.1rem 1.1rem; background: var(--paper); border-radius: 8px; }
.helper-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.helper h3 { font-size: 1rem; margin: 0; }
.helper-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.helper-links .btn { margin-top: 0; text-decoration: none; background: var(--card); }
.helper-hint { color: var(--muted); font-size: .88rem; margin: .5rem 0 .8rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .5rem; }
.field { font: inherit; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: .1rem;
  padding: .5rem .75rem; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); border-radius: 8px; min-width: 0; position: relative; }
.field:hover { border-color: var(--blue); }
.field-label { font-size: .78rem; color: var(--muted); font-weight: 700; }
.field-value { font-weight: 700; overflow-wrap: anywhere; }
.field.done::after { content: "✓"; position: absolute; top: .35rem; right: .55rem; color: var(--green); font-weight: 700; }
.field.copied { border-color: var(--green); background: var(--green-soft); }
.field.copied .field-label { color: var(--green); }
.field-missing { cursor: default; border-style: dashed; border-color: #D9A400; background: var(--amber-soft); }
.field-missing .field-value { font-weight: 400; font-size: .88rem; color: var(--amber-ink); }

/* Liste aller Bestellungen */
.filters { display: flex; gap: .6rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.filters input { flex: 1 1 18rem; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num, th.num { text-align: right; }
.items td.num:first-child { text-align: left; }
.orders td:first-child { white-space: nowrap; }
.orders td:first-child a { font-weight: 700; margin-right: .4rem; }
.has-problem { background: #FFF6F5; }
.problem { display: inline-block; color: var(--red); font-weight: 700; font-size: .9rem; }
.problem-box { background: var(--red-soft); border-left: 4px solid var(--red); padding: .6rem .8rem; border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }

/* Detailansicht */
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.25rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; min-width: 0; }
.panel h2 { font-size: 1.1rem; margin: 0 0 .9rem; }
.panel h3 { font-size: 1rem; margin: 1.25rem 0 .4rem; }
.panel-wide { grid-column: 1 / -1; }
.panel .table-wrap { border: 0; border-radius: 0; margin: 0 -1.25rem; }
.panel .ship-form { border-top: 0; margin-top: 0; padding-top: 0; }
.status-form { display: flex; gap: .6rem; align-items: flex-end; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.status-form label { font-weight: 400; }
.links { display: flex; gap: 1rem; flex-wrap: wrap; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.timeline li { padding: .35rem 0; border-bottom: 1px dotted var(--line); }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: .6rem; }

@media (max-width: 760px) {
  .pick { grid-template-columns: 4.5rem 1fr; gap: .9rem; }
  .pick-qty span { font-size: 2.3rem; }
  .pick-action { grid-column: 2; justify-self: start; }
  .parcel-grid, .detail-grid { grid-template-columns: 1fr; }
  .parcel-method { margin-left: 0; width: 100%; }
  .ship-form .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Druckbedarf und Druckprofile */
.demand { display: grid; grid-template-columns: minmax(12rem, auto) 1fr; gap: 1rem 2rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.demand-label { display: block; font-size: .85rem; color: var(--muted); font-weight: 700; margin-bottom: .2rem; }
.demand-time strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.demand-hint { display: block; color: var(--muted); font-size: .85rem; margin: .2rem 0 0; }
.demand-filament ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.demand-filament li { background: var(--paper); border-radius: 99px; padding: .3rem .8rem; font-size: .95rem; }
.demand-warn { grid-column: 1 / -1; margin: 0; padding: .55rem .8rem; background: var(--amber-soft); border-radius: 6px; font-size: .92rem; }
.print-info { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin: .45rem 0 0; font-size: .9rem; color: var(--muted); }
.print-info span { font-variant-numeric: tabular-nums; }
.print-file { color: var(--ink); font-weight: 700; }
.print-missing { color: var(--amber-ink); }
.print-note { margin: .25rem 0 0; font-size: .88rem; color: var(--muted); font-style: italic; }
.head-with-action { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.head-with-action .btn { text-decoration: none; }
.profile-form { max-width: 46rem; display: grid; gap: 1.25rem; }
.profile-form fieldset { border: 0; padding: 0; margin: 0; }
.profile-form legend { font-weight: 700; font-size: 1.05rem; margin-bottom: .6rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.profile-form input { width: 100%; }
.filament-rows { display: grid; gap: .5rem; }
.filament-row { display: grid; grid-template-columns: 1fr 7rem; gap: .6rem; }
.filament-row label span { font-weight: 400; font-size: .82rem; color: var(--muted); }
.form-actions { display: flex; gap: 1rem; align-items: center; }
.delete-form { margin-top: 1rem; }
@media (max-width: 760px) {
  .demand { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* Drucker */
.printer-compact:empty { display: none; }
.printer-compact { margin-bottom: 1.25rem; }
.printer-compact .printer { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.25rem; }
.printer-empty { margin: 0; color: var(--muted); font-size: .92rem; }
.printer-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.printer-dot { width: .7rem; height: .7rem; border-radius: 50%; background: #B8C0BD; flex: none; }
.printer-dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.printer-state { color: var(--muted); }
.printer-running .printer-state, .printer-prepare .printer-state { color: var(--blue); font-weight: 700; }
.printer-finish .printer-state { color: var(--green); font-weight: 700; }
.printer-failed .printer-state, .printer-pause .printer-state { color: var(--red); font-weight: 700; }
.printer-warn { font-size: .8rem; font-weight: 700; color: var(--red); background: var(--red-soft); padding: .1rem .5rem; border-radius: 99px; }
.printer-more { margin-left: auto; font-size: .9rem; }
.printer-error { margin: .6rem 0 0; padding: .5rem .75rem; background: var(--amber-soft); border-radius: 6px; font-size: .92rem; }
.printer-job { margin: .6rem 0 .45rem; font-weight: 700; overflow-wrap: anywhere; }
.printer-finish .printer-job { color: var(--green); }
.progress { height: .6rem; background: var(--paper); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--blue); border-radius: 99px; transition: width .6s ease; }
.printer-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .45rem 0 0; color: var(--muted); font-size: .92rem; font-variant-numeric: tabular-nums; }
.printer-meta strong { color: var(--ink); }
.printer-temps { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 1rem 0 0; }
.printer-temps dt { font-size: .8rem; color: var(--muted); font-weight: 700; }
.printer-temps dd { margin: 0; font-variant-numeric: tabular-nums; }
.printer-sub { font-size: .95rem; margin: 1.1rem 0 .5rem; }
.ams { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .5rem; }
.ams li { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: .6rem; align-items: center; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; }
.ams .swatch { grid-row: 1 / 3; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); }
.ams li.empty .swatch { background: repeating-linear-gradient(45deg, #fff 0 4px, #E3E7E5 4px 8px); }
.ams-slot { font-size: .78rem; color: var(--muted); font-weight: 700; }
.ams-type { grid-column: 2; font-weight: 700; font-size: .92rem; }
.ams-rest { grid-row: 1 / 3; grid-column: 3; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.printer-grid { margin-top: 1.25rem; }
.stack-form { display: grid; gap: .7rem; margin: .5rem 0 1rem; }
.stack-form input { width: 100%; }
.stack-form .btn { justify-self: start; }
.relogin, .token-manual { margin: .75rem 0; }
.relogin summary, .token-manual summary { cursor: pointer; color: var(--blue); }
.events .event-fertig { color: var(--green); }
.events .event-abgebrochen, .events .event-fehler { color: var(--red); }
.events .event-new { font-weight: 700; }
.count-alert { background: var(--red) !important; color: #fff !important; }

/* Druckdateien, Vorschaubilder, AMS-Zuordnung */
.dot { display: inline-block; width: .8em; height: .8em; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); margin-right: .35em; vertical-align: -.05em; }
.file-pick { display: flex; gap: 1rem; align-items: flex-start; }
.file-fields { flex: 1; }
.file-action { display: flex; align-items: flex-end; }
.file-thumb { width: 7rem; height: 7rem; object-fit: contain; background: var(--paper); border-radius: 8px; flex: none; }
.file-status { margin: .6rem 0 0; font-size: .9rem; padding: .45rem .7rem; border-radius: 6px; }
.file-status.ok { background: var(--green-soft); color: var(--green); }
.file-status.warn { background: var(--amber-soft); color: var(--amber-ink); }
.filament-row { grid-template-columns: 1fr 7rem; align-items: center; }
.filament-head span { font-size: .8rem; color: var(--muted); font-weight: 700; }
.color-cell input[type=color] { width: 2.6rem; height: 2.4rem; padding: .15rem; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.color-cell input[data-unset] { opacity: .35; }
.list-thumb { width: 3.5rem; height: 3.5rem; object-fit: contain; background: var(--paper); border-radius: 6px; display: block; }
.thumb-cell { width: 4rem; }
.print-block { display: flex; gap: .9rem; align-items: flex-start; margin-top: .5rem; }
.pick-thumb { width: 4.5rem; height: 4.5rem; object-fit: contain; background: var(--paper); border-radius: 8px; flex: none; }
.print-block .print-info:first-child { margin-top: 0; }
.ams-match { list-style: none; margin: .45rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.ams-match li { font-size: .88rem; padding: .2rem .6rem; border-radius: 99px; border: 1px solid var(--line); background: var(--card); }
.ams-match li.ok { border-color: #A9D3B8; background: var(--green-soft); }
.ams-match li.missing { border-color: #EAC0BC; background: var(--red-soft); }
.ams-match .slot { font-weight: 700; margin-left: .25rem; }
.connect-btn { display: inline-block; margin-top: .6rem; text-decoration: none; }
@media (max-width: 760px) {
  .file-pick { flex-direction: column; }
  .filament-head { display: none; }
}

/* Farben */
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.head-actions .btn { text-decoration: none; }
.color-list { list-style: none; margin: 0; padding: 0; }
.color-list li + li { border-top: 1px solid var(--line); }
.color-row { display: grid; grid-template-columns: 3rem 8.5rem 1fr auto auto; gap: .7rem; align-items: center; padding: .55rem 0; }
.color-row .btn-quiet { margin-top: 0; }
.swatch-lg { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); }
.color-meta { font-size: .85rem; color: var(--muted); }
.panel.spaced { margin-top: 1.25rem; }
.panel h3 { margin-top: 1.5rem; }
.check { flex-direction: row; align-items: flex-start; gap: .7rem; font-weight: 400; background: var(--blue-soft); padding: .75rem .9rem; border-radius: 8px; margin-bottom: .8rem; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .15rem; flex: none; }
.print-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.print-actions .btn { margin-top: 0; text-decoration: none; }
@media (max-width: 760px) {
  .color-row { grid-template-columns: 2.8rem 1fr auto; }
  .color-row .color-meta { display: none; }
  .color-row label { grid-column: 2; }
}

/* Anmeldung, Abmelden, Helfer */
.logout { margin-left: auto; }
.logout button { font: inherit; background: none; border: 0; color: #D7DEDB; cursor: pointer; padding: .45rem .8rem; border-radius: 6px; }
.logout button:hover { background: rgba(255,255,255,.08); color: #fff; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--paper); }
.login-wrap { width: 100%; max-width: 24rem; padding: 1.5rem; margin: 0; }
.login-card { display: grid; gap: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 2rem 1.75rem; box-shadow: 0 10px 30px rgba(26, 33, 32, .08); }
.login-card input:not([type=checkbox]) { width: 100%; font-size: 1.05rem; padding: .7rem .8rem; }
.login-card .btn { padding: .8rem; font-size: 1.05rem; }
.login-card .notice { margin: 0; }
.login-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: .25rem; }
.login-brand h1 { font-size: 1.5rem; margin: 0; }
.login-mark { width: 2.4rem; height: 2.4rem; color: var(--blue); }
.login-mark svg { width: 100%; height: 100%; display: block; }
.login-remember { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
.login-remember input { width: 1.1rem; height: 1.1rem; }
.helper-steps ol { padding-left: 1.3rem; display: grid; gap: .9rem; margin: 0 0 1rem; }
.helper-steps .btn { text-decoration: none; display: inline-block; }
.print-help { font-size: .85rem; align-self: center; }

.code-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.code-actions .btn { margin-top: 0; }

.no-profile { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; margin-top: .45rem; }
.no-profile .print-info { margin: 0; }
.assign-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.assign-form select { font-size: .88rem; padding: .35rem .5rem; max-width: 18rem; }
.assign-form .btn { margin-top: 0; padding: .35rem .7rem; font-size: .88rem; }
.profile-form textarea { width: 100%; font: inherit; padding: .55rem .7rem; border: 1.5px solid var(--line); border-radius: 8px; resize: vertical; }

/* Versandfrist */
.due { display: inline-block; font-size: .78rem; font-weight: 700; padding: .12rem .55rem; border-radius: 99px; background: var(--paper); color: var(--muted); }
.pick-body > .due { margin-bottom: .25rem; }
.due-gelb { background: var(--amber-soft); color: var(--amber-ink); }
.due-rot { background: var(--red-soft); color: var(--red); }
.due-inline { font-weight: 700; color: var(--muted); }
.due-inline.due-gelb { background: none; color: var(--amber-ink); }
.due-inline.due-rot { background: none; color: var(--red); }

.wish-label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--amber-ink); margin-bottom: .15rem; }

/* Finanzen */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: -.5rem 0 1.5rem; flex-wrap: wrap; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; font-weight: 700; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--blue); border-bottom-color: var(--blue); }
.year-pick select { font-weight: 700; }
.kpis { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 1rem; margin-bottom: 1.25rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; display: grid; gap: .2rem; }
.kpi-label { font-size: .85rem; color: var(--muted); font-weight: 700; }
.kpi strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.kpi-in { color: var(--green); }
.kpi-out { color: var(--red); }
.kpi-main.pos { background: var(--green-soft); border-color: #A9D3B8; }
.kpi-main.neg { background: var(--red-soft); border-color: #EAC0BC; }
.kpi-main.pos strong { color: var(--green); }
.kpi-main.neg strong { color: var(--red); }
.chart-panel { margin-bottom: 1.25rem; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.chart-head h2 { margin: 0; }
.legend { margin: 0; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .35rem .5rem; flex-wrap: wrap; }
.lg { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-left: .5rem; }
.lg-in, .lg-plus { background: var(--green); }
.lg-out, .lg-minus { background: var(--red); }
.lg-line { height: 3px; background: var(--blue); border-radius: 2px; }
.chart-wrap { overflow-x: auto; margin-top: .75rem; }
.chart { width: 100%; min-width: 560px; height: auto; display: block; font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: var(--ink); stroke-width: 1.5; }
.chart .axis { font-size: 11px; fill: var(--muted); }
.chart .bar-in, .chart .bar-plus { fill: var(--green); }
.chart .bar-out, .chart .bar-minus { fill: var(--red); }
.chart .line-cum { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; }
.chart .dot-plus { fill: var(--blue); }
.chart .dot-minus { fill: var(--red); stroke: var(--blue); stroke-width: 1.5; }
.month-table { margin-top: 1rem; border-radius: 8px; }
td.neg, .neg { color: var(--red); }
.fin-grid { grid-template-columns: 1fr 1fr; }
.catbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.catbars li { display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; }
.cat-name { font-weight: 700; }
.cat-val { font-variant-numeric: tabular-nums; }
.cat-bar { grid-column: 1 / -1; height: .45rem; background: var(--paper); border-radius: 99px; overflow: hidden; }
.cat-bar span { display: block; height: 100%; background: var(--red); border-radius: 99px; opacity: .75; }
.catlist { list-style: none; margin: 0; padding: 0; }
.catlist li { display: flex; justify-content: space-between; padding: .3rem 0; border-bottom: 1px dotted var(--line); }
.limit { margin: .9rem 0; }
.limit-head { display: flex; justify-content: space-between; }
.limit-bar { height: .6rem; background: var(--paper); border-radius: 99px; overflow: hidden; margin: .35rem 0 .2rem; }
.limit-bar span { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.limit-bar.warn span { background: #D9A400; }
.limit-bar.over span { background: var(--red); }
.etsy-sync { margin-top: 1rem; }
.entry-form-panel { margin-bottom: 1.25rem; }
.entry-form { display: grid; grid-template-columns: auto 10rem 8rem 1fr; gap: .8rem; align-items: end; }
.entry-form .wide { grid-column: 1 / -1; }
.entry-form input { width: 100%; }
.entry-form .form-actions { grid-column: 1 / -1; }
.art-switch { border: 0; padding: 0; margin: 0; display: flex; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; align-self: end; }
.art-switch label { flex-direction: row; font-weight: 700; cursor: pointer; }
.art-switch input { position: absolute; opacity: 0; }
.art-switch span { padding: .55rem .9rem; }
.art-switch input:checked + span { background: var(--ink); color: #fff; }
.art-switch input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: -3px; }
.sum-line { color: var(--muted); }
.journal td { vertical-align: middle; }
.amount.einnahme { color: var(--green); font-weight: 700; }
.amount.ausgabe { color: var(--red); font-weight: 700; }
.row-actions { white-space: nowrap; display: flex; gap: .6rem; align-items: center; }
.linkbtn { background: none; border: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.upload-form { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.import-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; }
.import-map { display: grid; gap: 1.1rem; }
.preview { max-height: 22rem; overflow: auto; }
.preview td, .preview th { white-space: nowrap; font-size: .88rem; padding: .4rem .6rem; }
.spaced-top { margin-top: 1rem; }
.skipped summary { cursor: pointer; color: var(--amber-ink); }
@media (max-width: 760px) {
  .kpis, .fin-grid { grid-template-columns: 1fr; }
  .entry-form { grid-template-columns: 1fr 1fr; }
  .art-switch { grid-column: 1 / -1; }
}

.row-skip td { opacity: .5; text-decoration: line-through; }
.row-skip td:last-child { text-decoration: none; }

.mode-panel { margin-bottom: 1.25rem; }
.mode-form { display: grid; gap: .6rem; }
.mode-opt { flex-direction: row; align-items: flex-start; gap: .7rem; font-weight: 400; padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; }
.mode-opt:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.mode-opt input { margin-top: .2rem; }
.mode-form .btn { justify-self: start; }
.vz { font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 99px; }
.vz-plus { background: var(--green-soft); color: var(--green); }
.vz-minus { background: var(--red-soft); color: var(--red); }
.check input[type=date] { margin: .35rem 0; }
.check { display: flex; }
.abgleich { margin: 1rem 0 .4rem; }
.abgleich .kpi strong { font-size: 1.3rem; }

.split-table { margin-top: .75rem; border-radius: 8px; }
.split-table tfoot td { border-top: 2px solid var(--ink); }
.split-table td a { text-decoration: none; }

/* Nur für die Steuer */
.tax-toggle { display: flex; align-items: center; gap: .3rem 1rem; flex-wrap: wrap; margin: 0 0 1rem; }
.switch { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 700; }
.switch-knob { width: 2.4rem; height: 1.35rem; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch-knob::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.switch.on .switch-knob { background: var(--blue); }
.switch.on .switch-knob::after { transform: translateX(1.05rem); }
.tax-check { flex-direction: row; align-items: center; gap: .55rem; font-weight: 400; }
.tax-check input { width: 1.1rem; height: 1.1rem; flex: none; }
.tax-badge { display: inline-block; margin-left: .4rem; font-size: .72rem; font-weight: 700; padding: .05rem .45rem; border-radius: 99px; background: var(--blue-soft); color: var(--blue); vertical-align: .1em; }
.row-tax td { background: #F7F8FE; }
.bulk-bar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.bulk-bar .btn { margin-top: 0; }
.journal .sel { width: 2rem; text-align: center; }
.journal .sel input { width: 1.05rem; height: 1.05rem; }
@media (prefers-reduced-motion: reduce) { .switch-knob, .switch-knob::after { transition: none; } }

/* Listen pflegen */
.lists-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.25rem; align-items: start; }
.list-add { display: flex; gap: .5rem; margin-bottom: .8rem; }
.list-add label { flex: 1; }
.list-add input { width: 100%; }
.list-add .btn { margin-top: 0; }
.list-items { list-style: none; margin: 0; padding: 0; }
.list-items li + li { border-top: 1px solid var(--line); }
.list-row { display: grid; grid-template-columns: 1fr auto; gap: .35rem .5rem; align-items: center; padding: .5rem 0; }
.list-row input[name=neu] { width: 100%; }
.list-row .list-count { text-align: right; }
.list-row .list-also { flex-direction: row; align-items: center; gap: .3rem; font-weight: 400; font-size: .82rem; color: var(--muted); }
.list-row .btn { margin-top: 0; padding: .3rem .6rem; font-size: .85rem; }
.list-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.list-missing { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.kat[hidden] { display: none; }
.catlist li a { text-decoration: none; }

/* Artikel */
.crumb { margin: 0 0 .2rem; font-size: .9rem; }
.art-nav { position: sticky; top: 0; background: var(--paper); z-index: 5; padding-top: .3rem; }
.art-form { display: grid; gap: 1.25rem; }
.art-form textarea, .art-form input:not([type=checkbox]):not([type=radio]), .art-form select { width: 100%; }
.art-form textarea { font: inherit; padding: .55rem .7rem; border: 1.5px solid var(--line); border-radius: 8px; resize: vertical; }
.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.attr-rows { display: grid; gap: .6rem; }
.attr-row { display: grid; grid-template-columns: 1fr 2fr; gap: .8rem; }
.var-table input[name=v_sku] { min-width: 11rem; }
.var-table .price-in { width: 6.5rem !important; text-align: right; }
.var-table td { vertical-align: middle; }
.check-inline { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; align-self: end; }
.check-inline input { width: auto !important; }
.druck-rows { display: grid; gap: .5rem; margin: .8rem 0; }
.druck-row { display: grid; grid-template-columns: 11rem 1fr 5rem; gap: .6rem; align-items: center; }
.druck-wert { font-weight: 700; }
.sticky-save { position: sticky; bottom: 0; background: var(--paper); padding: .8rem 0; display: flex; gap: 1rem; align-items: center; border-top: 1px solid var(--line); z-index: 4; }
.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .8rem; }
.photo-grid li { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--paper); }
.photo-actions { display: flex; gap: .3rem; align-items: center; padding: .4rem; flex-wrap: wrap; }
.photo-actions .btn { margin-top: 0; padding: .2rem .5rem; font-size: .82rem; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .8rem; }
.shop-card { border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; }
.shop-card h3 { margin: 0 0 .4rem; }
#fotos { margin-top: 1.25rem; }
section[id] { scroll-margin-top: 4rem; }
@media (max-width: 760px) {
  .attr-row, .dims { grid-template-columns: 1fr; }
  .druck-row { grid-template-columns: 1fr 4.5rem; }
  .druck-wert { grid-column: 1 / -1; }
}
.etsy-p { color: var(--muted); font-size: .9rem; }
.list-reload { margin: .5rem 0 0; font-size: .88rem; }
.shop-card label { margin-top: .6rem; }
.shop-card select, .shop-card input { width: 100%; }
.topbar { gap: 1rem; }
.topbar nav a { padding: .45rem .6rem; }

/* Kalkulation */
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.field-hint { font-weight: 400; font-size: .8rem; color: var(--muted); }
.mat-rows { display: grid; gap: .4rem; }
.mat-row { display: grid; grid-template-columns: 1fr 7rem auto; gap: .6rem; align-items: center; }
.calc { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.calc h3 { margin: 0 0 .6rem; }
.calc-grid { display: grid; grid-template-columns: minmax(14rem, 1fr) 2fr; gap: 1.25rem; align-items: start; }
.calc-cost { margin: 0; display: grid; gap: .25rem; }
.calc-cost div { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.calc-cost dt { color: var(--muted); }
.calc-cost dd { margin: 0; font-variant-numeric: tabular-nums; }
.calc-cost .sum { border-top: 1.5px solid var(--ink); padding-top: .35rem; margin-top: .2rem; font-weight: 700; }
.calc-cost .sum dt { color: var(--ink); }
.calc-plat { font-size: .92rem; }
td.pos, .pos { color: var(--green); }
.calc-line { white-space: nowrap; padding: .1rem 0; }
.calc-line + .calc-line { border-top: 1px dotted var(--line); }
@media (max-width: 760px) { .calc-grid, .form-grid.three { grid-template-columns: 1fr; } }
.ausf-table input { width: 100%; }
.ausf-table .w-s { width: 5rem; } .ausf-table .w-xs { width: 4rem; } .ausf-table .w-m { width: 6.5rem; text-align: right; } .ausf-table .w-l { min-width: 14rem; }
.dims-cell { white-space: nowrap; }
.dims-cell input { width: 4.2rem !important; display: inline-block; }
.sub-row td { border-top: 1px dotted var(--line); }
.calc h3 .meta { font-weight: 400; font-size: .85rem; margin-left: .5rem; }
.produkt-pick { display: flex; gap: .6rem; align-items: flex-end; }
.produkt-pick label { flex: 1; }
.produkt-pick .btn { margin-top: 0; }

/* Produkte: Ausführungen als Karten */
.ausf-card { border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; margin: 0 0 .8rem; display: grid; gap: .7rem; }
.ausf-head label { max-width: 20rem; }
.platten { display: grid; gap: .5rem; }
.platte-row { display: grid; grid-template-columns: 1fr 5rem 7rem 7rem; gap: .6rem; align-items: end; }
.platte-row .pfad input { font-size: 1rem; padding: .65rem .75rem; }
.ausf-foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: .8rem; align-items: end; }
.ausf-foot .dims-cell { display: flex; flex-direction: column; gap: .3rem; }
.ausf-foot .lbl { font-size: .9rem; font-weight: 700; }
.ausf-foot input[name=a_woo], .ausf-foot input[name=a_etsy] { text-align: right; }
.komp-rows { display: grid; gap: .5rem; }
.komp-row { display: grid; grid-template-columns: 2fr 1fr 5rem; gap: .6rem; align-items: end; }
.typ-badge { font-size: .72rem; font-weight: 700; padding: .05rem .45rem; border-radius: 99px; background: var(--blue-soft); color: var(--blue); margin-left: .35rem; vertical-align: .1em; }
.offsite { font-size: .82rem; color: var(--muted); }
@media (max-width: 760px) { .platte-row, .ausf-foot, .komp-row { grid-template-columns: 1fr 1fr; } .platte-row .pfad { grid-column: 1 / -1; } }
.plate-list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .35rem; }
.plate-list li { display: flex; flex-wrap: wrap; gap: .4rem .7rem; align-items: center; font-size: .9rem; }
.plate-list .plate-name { font-weight: 700; }
.plate-list .btn { margin-top: 0; padding: .2rem .55rem; font-size: .82rem; text-decoration: none; }
.file-input { font-size: 1rem; padding: .65rem .75rem; }
.file-fields .span-2 { grid-column: 1 / -1; }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .form-grid.four { grid-template-columns: 1fr 1fr; } }
s.alt-preis { display: block; color: var(--muted); font-size: .8rem; line-height: 1.1; }
.calc-plat-wrap { border: 0; background: none; min-width: 0; }
.calc-grid > * { min-width: 0; }
.calc .notice { overflow-wrap: anywhere; margin-top: .8rem; }
.add-platte { justify-self: start; font-size: .9rem; }
#add-ausf, #add-komp { margin-top: .2rem; }

/* Margen */
.pl-pick { display: flex; gap: .4rem 1rem; flex-wrap: wrap; }
.pl-pick .check-inline { font-size: .9rem; }
.swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; vertical-align: -.05em; }
.chart-scroll { overflow-x: auto; }
.margen-chart { width: 100%; min-width: 600px; height: auto; }
.margen-chart .label { font-size: 12px; fill: var(--ink); }
.margen-chart .wert { font-size: 10px; fill: var(--muted); }
.margen-chart .axis { font-size: 10px; fill: var(--muted); }
.margen-chart .grid { stroke: var(--line); stroke-width: 1; }
.margen-chart .zero { stroke: var(--ink); stroke-width: 1; }
.margen-chart .schwelle { stroke: var(--amber, #B7791F); stroke-width: 1.2; stroke-dasharray: 4 3; }
.margen-table th.grp { text-align: center; border-bottom: 3px solid; }
.margen-table th.sortable { cursor: pointer; user-select: none; }
.margen-table th.sortable:hover { color: var(--blue); }
.margen-table th[aria-sort=ascending]::after { content: " ▲"; font-size: .7em; }
.margen-table th[aria-sort=descending]::after { content: " ▼"; font-size: .7em; }
.margen-table td { white-space: nowrap; }
.m-pill { display: inline-block; min-width: 4.2rem; text-align: right; padding: .1rem .45rem; border-radius: 99px; font-weight: 700; font-size: .85rem; }
.m-gut { color: var(--green); } .m-pill.m-gut { background: var(--green-soft); }
.m-mittel { color: #8A6100; } .m-pill.m-mittel { background: #FBF0D0; }
.m-niedrig { color: #B4540A; } .m-pill.m-niedrig { background: #FDE5D2; }
.m-schlecht { color: var(--red); } .m-pill.m-schlecht { background: var(--red-soft); }
.legend-m .m-pill { min-width: 0; }

/* Medien */
.pick-grid li { position: relative; opacity: .55; transition: opacity .15s; }
.pick-grid li.on { opacity: 1; outline: 3px solid var(--blue); outline-offset: -3px; }
.pick-photo { display: block; cursor: pointer; margin: 0; }
.pick-photo input { position: absolute; top: .5rem; left: .5rem; width: 1.3rem; height: 1.3rem; z-index: 1; }
.media-block { margin-bottom: 1rem; }
.media-strip { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; gap: .5rem; overflow-x: auto; }
.media-strip img { width: 6.5rem; height: 6.5rem; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
@media (prefers-reduced-motion: reduce) { .pick-grid li { transition: none; } }

/* =====================================================================================
   Gestaltung: Schriften, feste Kopfzeile, Handy-Navigation
   ===================================================================================== */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-hyperlegible-latin-700-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

html { scroll-padding-top: calc(var(--kopf-h) + 1rem); }
body { font-size: 1.0625rem; line-height: 1.55; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px); }
h1, h2, h3, .brand, .topbar nav a, .tabs a, .kpi strong, .pick-qty, .qty, .parcel-no, .btn {
  font-family: var(--font-display); }
h1 { font-weight: 800; font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); letter-spacing: -.025em; line-height: 1.05; margin-bottom: .5rem; }
h2, .panel h2 { font-weight: 700; letter-spacing: -.01em; }
.panel h2 { font-size: 1.2rem; }
h3, .panel h3 { font-weight: 600; }
.lead { font-size: 1rem; line-height: 1.5; }
td, th, .num, .kpi strong { font-variant-numeric: tabular-nums; }
a { text-underline-offset: .18em; }

/* --- Kopfzeile: immer sichtbar, mit Schichtlinien wie ein 3D-Druck --- */
.topbar {
  position: sticky; top: 0; z-index: 50; min-height: var(--kopf-h); flex-wrap: nowrap; gap: 1.5rem;
  padding: .5rem clamp(1rem, 4vw, 2.5rem); padding-top: max(.5rem, env(safe-area-inset-top, 0px));
  background-color: var(--kopf);
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.045) 0 1px, transparent 1px 4px);
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; flex: none; }
.brand-mark { width: 1.6rem; height: 1.6rem; flex: none; }
.topbar nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: .15rem; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a { font-weight: 600; font-size: .98rem; color: #CFE0DA; padding: .5rem .8rem; border-radius: 8px; white-space: nowrap; }
.topbar nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.topbar nav a[aria-current] { background: #F4F8F6; color: var(--kopf); }
.count { background: rgba(242,193,78,.18); color: var(--gelb); font-weight: 700; font-family: var(--font); }
.count:empty, .count[data-null] { display: none; }
.topbar nav a[aria-current] .count { background: var(--gelb); color: var(--kopf); }
.count-alert { background: #E5533D; color: #fff; }
.logout { margin-left: auto; flex: none; }
.logout button { font: inherit; font-size: .9rem; color: #CFE0DA; background: none; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: .4rem .8rem; cursor: pointer; }
.logout button:hover { color: #fff; border-color: rgba(255,255,255,.5); }
.topbar :focus-visible { outline-color: var(--gelb); }

/* bestehende „klebende“ Leisten unter die Kopfzeile bzw. über die Handy-Navigation setzen */
.art-nav { top: var(--kopf-h); }
.sticky-save { bottom: var(--tabbar-h); }

/* --- Flächen, Tabellen, Knöpfe --- */
main { padding-top: 2.25rem; }
.panel, .kpi, .table-wrap, .parcel, .picklist, .empty { border-color: var(--line); box-shadow: 0 1px 2px rgba(30,42,40,.05); }
.panel .table-wrap, .calc-plat-wrap { box-shadow: none; }
th { font-family: var(--font-display); font-weight: 600; font-size: .82rem; letter-spacing: .01em; color: var(--muted); background: #F6F8F6; }
tbody tr:hover td { background: #F8FAF8; }
.btn { font-weight: 600; border-radius: 9px; min-height: 2.6rem; }
.btn-primary { background: var(--blue); border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-quiet { min-height: 0; }
input, select, textarea { border-radius: 9px; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px var(--blue-soft); border-color: var(--blue); }
.tabs a { font-weight: 600; }
.kpi strong { font-weight: 700; font-size: 1.75rem; letter-spacing: -.01em; }
.notice { border-radius: 10px; }

/* --- Handy-Navigation unten --- */
.tabbar { display: none; }
@media (max-width: 760px) {
  :root { --kopf-h: 3.1rem; --tabbar-h: calc(4rem + env(safe-area-inset-bottom, 0px)); }
  body { font-size: 1rem; padding-bottom: var(--tabbar-h); }
  .topbar { gap: .75rem; padding-left: 1rem; padding-right: 1rem; }
  .topbar nav { display: none; }
  .brand { font-size: 1.1rem; }
  main { padding: 1.4rem 1rem 3rem; }
  h1 { font-size: 1.75rem; }
  .panel, .kpi, .parcel { padding: 1rem; border-radius: 10px; }
  .panel .table-wrap { margin: 0 -1rem; }
  .form-grid, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .kpis { grid-template-columns: 1fr; }
  input, select, textarea, .btn { min-height: 2.9rem; font-size: 1rem; }   /* 16px verhindert das Zoomen bei iOS */
  .head-with-action { align-items: stretch; }
  .head-with-action .btn, .head-actions .btn { flex: 1; text-align: center; }
  .head-actions { display: flex; gap: .5rem; width: 100%; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs a { white-space: nowrap; }
  th, td { padding: .6rem .7rem; }
  .sticky-save { padding: .7rem 0; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--kopf); box-shadow: 0 -1px 0 rgba(0,0,0,.2);
  }
  .tabbar > a, .tabbar summary {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    color: #B9CFC8; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: .72rem;
    position: relative; cursor: pointer; list-style: none; min-height: 3.6rem;
  }
  .tabbar summary::-webkit-details-marker { display: none; }
  .tabbar svg { width: 1.45rem; height: 1.45rem; }
  .tabbar > a[aria-current], .tabbar details[open] summary, .tabbar details.aktiv summary { color: #fff; }
  .tabbar > a[aria-current]::before, .tabbar details.aktiv summary::before {
    content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gelb); }
  .tabbar .count { position: absolute; top: .35rem; left: calc(50% + .45rem); font-size: .68rem; min-width: 1.3rem; padding: 0 .3rem;
    background: var(--gelb); color: var(--kopf); }
  .tabbar details { position: static; }
  .mehr-menue { position: fixed; left: .75rem; right: .75rem; bottom: calc(var(--tabbar-h) + .5rem); background: var(--card);
    border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: .4rem; display: grid; }
  .mehr-menue a, .mehr-menue button { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: .9rem 1rem; color: var(--ink); text-decoration: none; font: inherit; font-weight: 700; border-radius: 10px;
    background: none; border: 0; text-align: left; cursor: pointer; width: 100%; }
  .mehr-menue a[aria-current] { background: var(--blue-soft); color: var(--blue-dark); }
  .mehr-menue form { margin: 0; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .3rem; }
  .mehr-menue .count { position: static; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.login-page { background-color: var(--kopf); background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.045) 0 1px, transparent 1px 4px); padding-bottom: 0; }
.login-card { border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.login-brand h1 { font-size: 1.8rem; }
@media (max-width: 760px) {
  :root { --tabbar-h: calc(4.4rem + env(safe-area-inset-bottom, 0px)); }
  .tabbar > a, .tabbar summary { justify-content: flex-start; padding-top: .55rem; font-size: .68rem; line-height: 1.1; min-height: 0; height: 4.4rem; }
  .tabbar .count { top: .3rem; }
  .pick { grid-template-columns: 3.4rem minmax(0, 1fr); gap: .3rem .9rem; padding: 1rem; }
  .pick-qty { text-align: left; }
  .pick-qty span { font-size: 2.1rem; }
  .pick-body { min-width: 0; }
  .pick-action { grid-column: 1 / -1; }
  .pick-action .btn { width: 100%; }
  .pick-body select { max-width: 100%; width: 100%; }
  .pick-body form { flex-wrap: wrap; }
}
@media (max-width: 760px) { .pick-action { display: grid; } .pick-action .btn { width: 100%; } }
@media (max-width: 760px) { .chart-panel { overflow-x: auto; } .chart-panel .chart { min-width: 520px; } }
.rabatt-panel { margin-bottom: 1.25rem; }
.rabatt-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem 1.5rem; }
.rabatt-feld { width: 8.5rem; }
.input-suffix { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 9px; background: var(--card); }
.input-suffix:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.input-suffix input { border: 0; box-shadow: none !important; width: 100%; text-align: right; font-size: 1.15rem; font-weight: 700; }
.input-suffix span { padding: 0 .7rem 0 .2rem; font-weight: 700; color: var(--muted); }
.rabatt-shops { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.rabatt-shops legend { font-size: .9rem; font-weight: 700; padding: 0; margin-bottom: .35rem; }
.rabatt-knoepfe { display: flex; gap: .5rem; margin-left: auto; }
.rabatt-panel .meta { display: block; margin-top: .8rem; }
@media (max-width: 760px) { .rabatt-feld { width: 100%; } .rabatt-knoepfe { margin-left: 0; width: 100%; } .rabatt-knoepfe .btn { flex: 1; } }
.einst-panel { margin-bottom: 1.25rem; display: grid; gap: 1rem; }
.einst-panel .rabatt-form { align-items: flex-end; }
.rabatt-info { flex-basis: 100%; margin: 0; display: block; }
.kat-form fieldset { border: 0; margin: 0; padding: 1rem 0 0; border-top: 1px solid var(--line); }
.kat-form legend { font-weight: 700; font-size: .9rem; padding: 0; margin-bottom: .5rem; float: left; width: 100%; }
.kat-liste { display: flex; flex-wrap: wrap; gap: .5rem; clear: both; }
.kat-chip { flex-direction: row; align-items: center; gap: .45rem; font-weight: 600; font-size: .9rem; padding: .4rem .75rem; border: 1.5px solid var(--line); border-radius: 99px; cursor: pointer; background: var(--card); }
.kat-chip:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.kat-chip input { width: 1rem; height: 1rem; margin: 0; }
.kat-chip.rabatt { border-style: dashed; }
.kat-chip.rabatt:has(input:checked) { border-style: solid; }
.kpis-flex { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.kpi-label .swatch { margin-right: .2rem; }
.sort-form { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.sort-form label { font-size: .85rem; }
@media (max-width: 760px) { .sort-form { width: 100%; } .sort-form label { flex: 1; } }
.ship-hint { flex-basis: 100%; margin: .2rem 0 0; }

/* Bibliothek und Großansicht */
.zoom { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; width: 100%; }
.zoom img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.upload-panel { margin-bottom: 1rem; }
.upload-zeile { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: flex-end; }
.upload-zeile .upload-datei { flex: 1 1 18rem; }
.upload-zeile select { min-width: 14rem; }
.filter-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.filter-chips a { padding: .35rem .8rem; border: 1.5px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--ink); background: var(--card); font-weight: 600; font-size: .9rem; }
.filter-chips a[aria-current] { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.filter-chips .meta { font-weight: 400; margin-left: .2rem; }
.bib-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; }
.bib-karte { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(30,42,40,.05); }
.bib-info { padding: .7rem .8rem .8rem; display: grid; gap: .55rem; }
.bib-name { margin: 0; font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bib-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag-form { display: inline-flex; align-items: center; gap: .1rem; background: var(--blue-soft); border-radius: 99px; padding: .1rem .2rem .1rem .6rem; font-size: .82rem; margin: 0; }
.tag-form a { color: var(--blue-dark); text-decoration: none; font-weight: 600; }
.tag-form button { border: 0; background: none; cursor: pointer; color: var(--blue-dark); font-size: 1rem; line-height: 1; padding: .1rem .35rem; border-radius: 99px; }
.tag-form button:hover { background: rgba(0,0,0,.08); }
.zuordnen { display: flex; gap: .4rem; }
.zuordnen select { flex: 1; min-width: 0; font-size: .88rem; }
.zuordnen .btn { margin: 0; min-height: 0; padding: .35rem .6rem; font-size: .85rem; }
.bib-aktionen { display: flex; justify-content: space-between; align-items: center; }
.bib-aktionen form { margin: 0; }
.bib-aktionen .btn { margin: 0; font-size: .85rem; }
.btn.danger { color: var(--red); }
.bib-pick summary { cursor: pointer; padding: .4rem 0; }
.pick-cap { margin: .3rem .4rem .4rem; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; }
.lightbox::backdrop { background: rgba(10,18,16,.88); }
.lightbox[open] { display: flex; flex-direction: column; }
.lb-kopf { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; padding-top: max(.8rem, env(safe-area-inset-top, 0px)); color: #fff; }
.lb-titel { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-kopf .btn { margin: 0; background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); min-height: 2.4rem; text-decoration: none; }
.lb-bild { flex: 1; display: flex; align-items: center; justify-content: center; gap: .5rem; padding: 0 .5rem 1rem; min-height: 0; }
.lb-bild img { max-width: calc(100vw - 7rem); max-height: calc(100vh - 6rem); object-fit: contain; border-radius: 6px; background: #fff; }
.lb-nav { flex: none; width: 2.8rem; height: 2.8rem; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lb-nav:hover { background: rgba(255,255,255,.25); }
@media (max-width: 760px) {
  .bib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .bib-info { padding: .5rem; }
  .zuordnen { flex-direction: column; }
  .lb-bild img { max-width: 100vw; }
  .lb-bild { position: relative; padding: 0 0 1rem; }
  .lb-nav { position: absolute; bottom: 1.5rem; }
  .lb-zurueck { left: 1rem; } .lb-weiter { right: 1rem; }
}
.chip-zahl { font-weight: 400; color: var(--muted); margin-left: .25rem; }
.bib-info > * { min-width: 0; }
.zuordnen { flex-direction: column; align-items: stretch; }
.zuordnen select { width: 100%; }
.zuordnen .btn { width: 100%; }
.bib-aktionen { gap: .4rem; }
.bib-aktionen .btn { white-space: nowrap; padding: .3rem .55rem; }

/* Version 2: Hauptnavigation mit Bereichen */
.druck-chip { display: inline-flex; align-items: center; gap: .4rem; flex: none; color: #fff; text-decoration: none; font-weight: 700; font-size: .85rem;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 99px; padding: .25rem .7rem; margin-left: auto; }
.druck-punkt { width: .55rem; height: .55rem; border-radius: 50%; background: var(--gelb); box-shadow: 0 0 0 3px rgba(242,193,78,.25); }
.einst-link { display: inline-flex; align-items: center; gap: .4rem; color: #CFE0DA; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: .95rem; padding: .45rem .7rem; border-radius: 8px; flex: none; margin-left: auto; }
.druck-chip + .einst-link { margin-left: .2rem; }
.einst-link svg { width: 1.2rem; height: 1.2rem; }
.einst-link:hover { background: rgba(255,255,255,.09); color: #fff; }
.einst-link.aktiv { background: #F4F8F6; color: var(--kopf); }
.logout { margin-left: .2rem; }
.bereich-tabs { margin-top: -.25rem; }
.fuss { text-align: center; padding: 1rem 1rem 2rem; font-size: .8rem; }
.fuss a { color: var(--muted); text-decoration: none; }
@media (max-width: 1100px) { .einst-text { display: none; } }
@media (max-width: 760px) {
  .einst-link, .logout { display: none; }
  .druck-chip { margin-left: auto; }
  .fuss { padding-bottom: calc(var(--tabbar-h) + 1rem); }
}
.listen-status { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .45rem; }
.listen-status li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.listen-status strong { font-variant-numeric: tabular-nums; }
.neustart { text-align: center; padding: 2.5rem 1rem; }
.spinner { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 4px solid var(--blue-soft); border-top-color: var(--blue); margin: 0 auto 1rem; animation: dreh 1s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Videos in Bibliothek und Auswahl */
.video-vorschau { position: relative; display: block; width: 100%; aspect-ratio: 1; background: #1E2A28; }
.video-vorschau video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.video-vorschau .play { position: absolute; inset: 0; margin: auto; width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center;
  background: rgba(30,42,40,.72); color: #fff; font-size: 1.1rem; padding-left: .2rem; }
.photo-grid .video-vorschau, .pick-photo .video-vorschau { aspect-ratio: 1; }
.lb-bild video { max-width: calc(100vw - 7rem); max-height: calc(100vh - 6rem); border-radius: 6px; background: #000; }
@media (max-width: 760px) { .lb-bild video { max-width: 100vw; } }

/* Margen: erste Spalte (Produkt) bleibt beim seitlichen Scrollen stehen */
.margen-table thead tr:first-child th:first-child, .margen-table td:first-child { position: sticky; left: 0; z-index: 2; background: var(--card);
  box-shadow: 1px 0 0 var(--line), 6px 0 8px -6px rgba(30,42,40,.18); min-width: 12rem; max-width: 16rem; white-space: normal; }
.margen-table thead tr:first-child th:first-child { background: #F6F8F6; z-index: 3; }
.margen-table tbody tr:hover td:first-child { background: #F8FAF8; }
@media (max-width: 760px) { .margen-table thead tr:first-child th:first-child, .margen-table td:first-child { min-width: 8.5rem; max-width: 10rem; } }

/* Von Etsy übernehmen */
.import-optionen { display: grid; gap: .9rem; margin-bottom: 1rem; }
.import-leiste { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; justify-content: space-between; }
.import-leiste .filter-chips { margin: 0; }
.chip-btn { padding: .35rem .8rem; border: 1.5px solid var(--line); border-radius: 99px; background: var(--card); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--ink); }
.chip-btn.an { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.etsy-liste { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.etsy-zeile { display: flex; align-items: center; gap: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; }
.etsy-zeile[hidden] { display: none; }
.etsy-zeile.schon { opacity: .7; }
.etsy-wahl { flex: 1; display: flex; flex-direction: row; align-items: center; gap: .8rem; font-weight: 400; cursor: pointer; min-width: 0; margin: 0; }
.etsy-wahl input { width: 1.2rem; height: 1.2rem; flex: none; }
.etsy-wahl img, .ohne-bild { width: 4.2rem; height: 3.3rem; object-fit: cover; border-radius: 6px; flex: none; background: var(--paper); }
.etsy-text { display: flex; flex-direction: column; min-width: 0; }
.etsy-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etsy-zeile .btn { margin: 0; white-space: nowrap; }
.fortschritt { height: .7rem; border-radius: 99px; background: var(--blue-soft); overflow: hidden; max-width: 28rem; margin: 0 auto 1rem; }
.fortschritt span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .4s; }
@media (prefers-reduced-motion: reduce) { .fortschritt span { transition: none; } }
@media (max-width: 760px) { .etsy-zeile { flex-wrap: wrap; } .etsy-text strong { white-space: normal; } }
.lead-aktion { float: right; margin: .4rem 0 0 1rem; font-weight: 700; }
.danger-btn { background: var(--red) !important; border-color: var(--red) !important; }
