﻿/* ---------- fonts ---------- */
@font-face { font-family: "Jakarta"; src: url("../fonts/ui/jakarta-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("../fonts/ui/jakarta-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("../fonts/ui/jakarta-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("../fonts/ui/jakarta-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --bg: #f5f1e8; --surface: #fffdf8; --surface-2: #f0ebdf; --text: #1d2721; --muted: #69725f;
  --border: #e1d9c8; --accent: #2f6b45; --accent-strong: #234f34; --accent-soft: #e2eedf;
  --track: #c8372d; --water: #2b6cb0; --warn: #b7791f; --danger: #c53030; --ok: #2f855a;
  --radius: 16px; --radius-sm: 10px; --shadow: 0 8px 28px rgba(40, 46, 30, .10);
  --contour: rgba(47, 107, 69, .07); --header-h: 60px; --gap: 12px;
  --viewer-bg: #f3f0e9;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111613; --surface: #19201b; --surface-2: #212a24; --text: #e7ebe4; --muted: #9aa597;
  --border: #2d3830; --accent: #63b07f; --accent-strong: #84c79c; --accent-soft: #1f3327;
  --track: #e5594e; --water: #63a4e8; --shadow: 0 8px 28px rgba(0, 0, 0, .45); --contour: rgba(99, 176, 127, .06); --viewer-bg: #6b736d;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111613; --surface: #19201b; --surface-2: #212a24; --text: #e7ebe4; --muted: #9aa597;
    --border: #2d3830; --accent: #63b07f; --accent-strong: #84c79c; --accent-soft: #1f3327;
    --track: #e5594e; --water: #63a4e8; --shadow: 0 8px 28px rgba(0, 0, 0, .45); --contour: rgba(99, 176, 127, .06); --viewer-bg: #6b736d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Jakarta", system-ui, sans-serif; font-size: 15px; line-height: 1.5; color: var(--text);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520' viewBox='0 0 520 520'%3E%3Cg fill='none' stroke='%232f6b45' stroke-opacity='.08' stroke-width='1.2'%3E%3Cpath d='M-20 120c80-40 150 30 230 0s140-90 230-40 120 60 120 60'/%3E%3Cpath d='M-20 160c90-40 150 40 240 6s150-90 230-36 110 50 110 50'/%3E%3Cpath d='M-20 200c90-30 160 50 250 14s150-80 220-36 110 44 110 44'/%3E%3Cellipse cx='380' cy='360' rx='70' ry='44'/%3E%3Cellipse cx='380' cy='360' rx='110' ry='72'/%3E%3Cellipse cx='380' cy='360' rx='150' ry='102'/%3E%3Cellipse cx='110' cy='400' rx='40' ry='26'/%3E%3Cellipse cx='110' cy='400' rx='76' ry='50'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-weight: 800; }
h2, h3 { font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.app-header {
  position: fixed; z-index: 50; top: var(--gap); left: var(--gap); right: var(--gap); height: var(--header-h);
  display: flex; align-items: center; gap: 14px; padding: 0 12px 0 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; text-decoration: none; color: var(--text); white-space: nowrap; }
.logo svg { width: 30px; height: 30px; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap;
}
.tabs a:hover { background: var(--surface-2); color: var(--text); }
.tabs a.active { background: var(--accent); color: #fff; }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text);
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.badge {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--track); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.login-link { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 10px; }
.login-link:hover { background: var(--surface-2); color: var(--text); }
/* logged in as admin: clearly visible amber frame around the header and a badge */
.is-admin .app-header { box-shadow: 0 0 0 2px var(--warn), var(--shadow); }
.user-menu { position: relative; }
.guest #cartBtn, .guest .menu-select { display: none !important; }
/* login: nothing but the form, centred on the page */
.login-page .app-header { display: none; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 18px; }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login-box .field input { padding: 12px 14px; font-size: 16px; background: var(--surface-2);
  border: 1.5px solid color-mix(in srgb, var(--text) 22%, transparent); }
.login-box .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.login-box .btn { padding: 12px; }
.pw-once { font-family: ui-monospace, monospace; font-size: 20px; letter-spacing: .06em; user-select: all; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 10px; font-weight: 700; font-size: 13px; background: color-mix(in srgb, var(--warn) 18%, var(--surface)); }
.user-menu summary::-webkit-details-marker { display: none; }
.admin-badge { background: var(--warn); color: #fff; border-radius: 6px; padding: 2px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.user-menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 6px; display: flex; flex-direction: column; z-index: 60; }
.user-menu-pop a { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14px; }
.user-menu-pop a:hover { background: var(--surface-2); }
.user-menu-pop hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
.menu-select { display: none; }

/* ---------- generic ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--text);
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.danger { color: var(--danger); }
.notice { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.notice.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.notice.err { background: color-mix(in srgb, var(--danger) 13%, var(--surface)); }
.notice.ok { background: var(--accent-soft); }

/* ---------- page layouts ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: calc(var(--header-h) + 2 * var(--gap) + 18px) 18px 30px; }
.hero { text-align: center; padding: 56px 18px 36px; }
.hero h1 { font-size: clamp(34px, 6vw, 64px); }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 660px; margin: 0 auto 28px; }
.searchbar { display: flex; gap: 8px; max-width: 720px; margin: 0 auto; padding: 8px; }
.searchbar input { flex: 1; border: 0; background: transparent; padding: 12px 14px; font-size: 17px; outline: none; min-width: 0; }
.search-results { max-width: 720px; margin: 8px auto 0; text-align: left; }
.search-results button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: none; cursor: pointer; border-radius: 10px; }
.search-results button:hover { background: var(--surface-2); }
.hero-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 30px; }
.tool-card { padding: 20px; text-decoration: none; color: var(--text); display: flex; justify-content: center; transition: transform .15s; }
.tool-card-inner { width: min(100%, 320px); display: flex; flex-direction: column; gap: 10px; text-align: left; }
.tool-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.tool-card svg { width: 100%; height: 90px; }
.tool-card h3 { margin: 0; }
.page { min-height: calc(100vh - 90px); }      /* keeps the footer at the very bottom */
.footer { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; padding: 30px 18px; color: var(--muted); font-size: 13px; }
.footer a { color: var(--muted); }
.prose { max-width: 820px; }
.prose h2 { margin-top: 1.4em; }

/* ---------- editor (generator pages) ---------- */
.editor {
  position: fixed; top: calc(var(--header-h) + 2 * var(--gap)); bottom: var(--gap); left: var(--gap); right: var(--gap);
  display: grid; grid-template-columns: minmax(330px, 29%) 1fr; gap: var(--gap);
}
.panel { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.panel-tools { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); align-items: center; }
.panel-tools .spacer { flex: 1; }
.panel-body { flex: 1; overflow-y: auto; padding: 4px 4px 12px; min-height: 0; }
.panel-foot { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.price-line { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.price-line .price { font-size: 20px; }
.stage { position: relative; overflow: hidden; min-height: 0; }
.stage-hint { position: absolute; left: 14px; top: 12px; font-size: 12px; color: var(--muted); z-index: 3; }
.attrib { position: absolute; right: 8px; bottom: 6px; z-index: 4; font-size: 10.5px; color: var(--muted); background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 2px 6px; border-radius: 6px; max-width: 70%; text-align: right; }

.sec { border-bottom: 1px solid var(--border); padding: 0 10px; }
.sec:last-child { border-bottom: 0; }
.sec-title { padding: 13px 4px 10px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sec-title .switch { font-size: 13px; font-weight: 600; color: var(--muted); }
details.sec { border-bottom: 1px solid var(--border); padding: 0 10px; }
details.sec:last-child { border-bottom: 0; }
details.sec > summary {
  list-style: none; cursor: pointer; padding: 13px 4px; font-weight: 700; display: flex; align-items: center; justify-content: space-between;
}
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; margin-right: 4px; }
details.sec[open] > summary::after { transform: rotate(-135deg); }
.sec-body { padding: 0 4px 14px; display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.field input[type=text], .field input[type=number], .field input[type=search], .field input[type=password], .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.range-row { display: flex; gap: 10px; align-items: center; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); }
.range-row input[type=number] { width: 84px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 10px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { appearance: none; width: 40px; height: 23px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(17px); }
.sub { padding-left: 12px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 10px; }

/* colour swatches */
.swatch-btn { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; width: 100%; text-align: left; }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.18); flex: none; }
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 6px; padding: 8px; }
.swatch-grid button { width: 100%; aspect-ratio: 1; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch-grid button.on { border-color: var(--accent); outline: 2px solid var(--surface); outline-offset: -4px; }
.popover { position: fixed; z-index: 90; width: 300px; max-height: 360px; overflow: auto; }
.popover .pop-title { padding: 10px 12px 0; font-weight: 700; font-size: 13px; }
.color-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; }
.color-row .label { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- cart drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer { position: fixed; z-index: 81; top: var(--gap); right: var(--gap); bottom: var(--gap); width: min(430px, calc(100% - 2 * var(--gap))); transform: translateX(110%); transition: transform .25s; display: flex; flex-direction: column; }
body.cart-open .drawer { transform: none; }
body.cart-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 18px; display: flex; flex-direction: column; gap: 10px; }
.drawer-foot { border-top: 1px solid var(--border); padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.cart-item .title { font-weight: 700; }
.cart-item .qty { display: flex; gap: 6px; align-items: center; }
.cart-item .qty input { width: 56px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); }

/* ---------- letters ---------- */
.type-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 40px; overflow: auto; }
/* Light "paper" behind the typography so dark filaments stay visible in dark mode, too. */
.paper .type-stage { inset: 14px; border-radius: 12px; background: #f3efe6; color: #5d6457; }
.paper .type-stage .muted { color: #6b7266; }
.type-stage .typed { font-size: clamp(40px, 9vw, 150px); line-height: 1.15; word-break: break-word; text-align: center; }
.charset { font-size: 22px; line-height: 1.5; word-break: break-all; padding: 6px 2px; }
.font-list { display: flex; flex-direction: column; gap: 4px; max-height: 270px; overflow: auto; padding: 2px; }
.font-list button { text-align: left; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 21px; }
.font-list button.on { border-color: var(--accent); background: var(--accent-soft); }
.flag { color: var(--danger); font-weight: 600; font-size: 13px; }

/* ---------- svg stage ---------- */
.shape-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 30px; }
.shape-stage svg { width: 100%; height: 100%; }
.dropzone { border: 2px dashed var(--border); border-radius: 14px; padding: 18px; text-align: center; cursor: pointer; color: var(--muted); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- 3D viewer ---------- */
.viewer { position: absolute; inset: 0; }
.viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.viewer-ui { position: absolute; left: 12px; top: 12px; z-index: 5; display: flex; flex-direction: column; gap: 8px; max-width: 280px; }
.viewer-ui .card { padding: 10px 12px; font-size: 13px; }
.part-toggles label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* ---------- map workspace ---------- */
.map-wrap { position: absolute; inset: 0; }
.map-wrap .maplibregl-map { position: absolute; inset: 0; }
.map-overlay { position: absolute; z-index: 6; }
.map-topbar { top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; }
.map-topbar > * { pointer-events: auto; }
.size-pill { padding: 8px 12px; font-weight: 700; font-size: 13px; border-radius: 999px; }
.layer-status { bottom: 30px; left: 12px; display: flex; flex-direction: column; gap: 6px; max-width: 360px; }
.layer-status .card { padding: 8px 12px; font-size: 13px; display: flex; gap: 10px; align-items: center; }
.spinner { width: 15px; height: 15px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.track-list { display: flex; flex-direction: column; gap: 6px; }
.track-item { border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px; cursor: pointer; }
.track-item.on { border-color: var(--accent); background: var(--accent-soft); }
.track-item .name { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; gap: 6px; }
.track-item .st { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.color-counter { display: flex; flex-wrap: wrap; gap: 6px; }
.color-counter span { padding: 4px 9px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 700; }
.color-counter span.over { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); color: var(--danger); }
.first-hint { top: 64px; left: 50%; transform: translateX(-50%); max-width: 460px; padding: 12px 14px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.stage-switch { position: absolute; z-index: 9; top: 12px; right: 12px; }
.map-handle { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: grab; }
.map-handle.rot { background: var(--accent); border-color: #fff; }
.map-handle.move { width: 30px; height: 30px; background: color-mix(in srgb, var(--accent) 85%, transparent); border-color: #fff; display: flex; align-items: center; justify-content: center; color: #fff; cursor: move; }

.stepper { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; padding: 10px 10px 8px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.stepper button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; cursor: pointer; padding: 4px 2px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.stepper button:disabled { opacity: .45; cursor: default; }
.stepper .num { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); font-size: 12px; background: var(--surface); }
.stepper button.on { color: var(--text); }
.stepper button.on .num { border-color: var(--accent); background: var(--accent); color: #fff; }
.stepper button.done .num { border-color: var(--accent); color: var(--accent); }
.step-nav { display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; }

/* ---------- admin ---------- */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-nav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; border: 1px solid var(--border); background: var(--surface); }
.admin-nav a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.box { padding: 16px 18px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { padding: 8px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.tbl th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tbl-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); }
.pill.done, .pill.ok { background: var(--accent-soft); color: var(--accent-strong); }
.pill.error { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); color: var(--danger); }
.pill.running, .pill.queued, .pill.in_production { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); }
.letter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.letter-chips button { min-width: 44px; height: 52px; border-radius: 10px; border: 1px solid var(--border); font-size: 26px; cursor: pointer; background: var(--surface-2); display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.settings-form .field { max-width: 520px; }
.settings-form fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; }
.settings-form legend { font-weight: 700; padding: 0 6px; }
.color-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.color-checks label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.price-tbl input { width: 100%; min-width: 80px; max-width: 140px; }
.price-tbl td { vertical-align: middle; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.preset-tbl td { vertical-align: middle; padding: 4px 6px; }
.preset-cell { display: flex; align-items: center; gap: 6px; }
.preset-cell select { min-width: 150px; }
.admin-map { height: 460px; border-radius: var(--radius); overflow: hidden; position: relative; }
pre.log { max-height: 220px; overflow: auto; background: var(--surface-2); padding: 10px; border-radius: 10px; font-size: 12px; white-space: pre-wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .tabs { display: none; }
  .menu-select { display: block; flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; }
  .user-menu summary { padding: 6px 8px; }
}
@media (max-width: 900px) {
  .editor { position: static; display: flex; flex-direction: column; padding: calc(var(--header-h) + 2 * var(--gap)) var(--gap) var(--gap); }
  .stage { order: -1; height: 58vh; min-height: 340px; }
  .panel { overflow: visible; }
  .panel-body { overflow: visible; }
  .panel-foot { position: sticky; bottom: 0; z-index: 10; border-radius: 0 0 var(--radius) var(--radius); }
  .logo span { display: none; }
}

.sec-title .switch span { white-space: nowrap; }


.big-text { width: 100%; font-size: 26px; line-height: 1.25; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); outline: none; resize: vertical; }
.big-text:focus { border-color: var(--accent); }
.charset { display: flex; flex-direction: column; gap: 6px; font-size: 28px; line-height: 1.3; }
.charset-row { display: grid; grid-template-columns: 62px 1fr; align-items: baseline; gap: 8px; }
.charset-label { font-family: "Jakarta", sans-serif; font-size: 12px; font-weight: 700; color: var(--muted); }
.charset-chars { letter-spacing: .06em; word-break: break-all; }

.group-title { margin-top: 12px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
body.dropping::after { content: "Datei hier ablegen"; position: fixed; inset: 12px; z-index: 200; border: 3px dashed var(--accent); border-radius: 18px; background: color-mix(in srgb, var(--accent) 12%, transparent); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; color: var(--accent); pointer-events: none; }
.stage-switch { top: 12px; right: auto; left: 50%; transform: translateX(-50%); }

.paper .stage-hint { top: 22px; left: 28px; z-index: 4; color: #8a8f82; }


.status-btn { cursor: pointer; border: 0; font: inherit; font-size: 12px; font-weight: 700; padding: 4px 12px; }
.letter-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.letter-chips button.letter { min-width: 46px; height: 54px; border-radius: 10px; border: 2px solid var(--border); font-size: 28px; cursor: pointer; background: #f3efe6; display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.letter-chips button.letter.ok { background: #bfe5c4; border-color: #2f855a; }
.letter-chips button.letter.bad { background: #f6c4c0; border-color: #c53030; }
.swatch-mini { width: 22px; height: 10px; border-radius: 4px; border: 1px solid rgba(0,0,0,.25); cursor: pointer; padding: 0; }
