/* Barcode Maker — premium dark/gold theme (Scent Journey visual language) */
* { box-sizing: border-box; }
:root {
  --bg: #0c0a08;
  --bg2: #14100c;
  --surface: #1a1510;
  --surface2: #221b13;
  --gold: #c9a24b;
  --gold-bright: #e8c874;
  --gold-dim: #8f7434;
  --cream: #f3ead7;
  --muted: #a89a7e;
  --line: rgba(201, 162, 75, .22);
  --line-strong: rgba(201, 162, 75, .45);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --radius: 16px;
  --danger: #fca5a5;
  --danger-bg: rgba(185, 28, 28, .16);
  --danger-border: rgba(248, 113, 113, .4);
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  background:
    radial-gradient(ellipse 70% 40% at 50% -8%, rgba(201, 162, 75, .16), transparent 60%),
    linear-gradient(180deg, #100d09, var(--bg) 240px);
  background-color: var(--bg);
  color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, a, input, select, textarea { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; }
h1 em, h2 em { color: var(--gold-bright); font-style: italic; }
.eyebrow { color: var(--gold); letter-spacing: .28em; text-transform: uppercase; font-size: .68rem; font-weight: 500; margin: 0 0 4px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 10, 8, .86);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 14px 0 12px;
}
.header-inner { display: flex; align-items: center; gap: 14px; }
.logo {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2a2113, #14100c);
  border: 1px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
}
.logo-bars {
  display: block; width: 28px; height: 26px;
  background: repeating-linear-gradient(90deg, #e8c874 0 2px, transparent 2px 5px, #e8c874 5px 6px, transparent 6px 9px, #e8c874 9px 12px, transparent 12px 14px, #e8c874 14px 15px, transparent 15px 18px, #e8c874 18px 21px, transparent 21px 23px, #e8c874 23px 24px, transparent 24px 26px, #e8c874 26px 28px);
}
.site-header h1 { margin: 0; font-size: 26px; letter-spacing: .01em; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

main { padding-bottom: 40px; }

/* Tabs — dark pill rail, gold active */
.tabs {
  display: flex; gap: 6px; margin: 20px 0 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.tab {
  flex: 1; min-width: 0; min-height: 48px; padding: 6px 2px;
  border: 1px solid transparent; border-radius: 999px;
  background: transparent; font-size: 15px; font-weight: 500; font-family: var(--sans);
  color: var(--muted); cursor: pointer; letter-spacing: .02em;
  transition: color .2s, background .2s, box-shadow .2s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tab.active {
  background: linear-gradient(135deg, #d9b45f, #b08a2e);
  color: #171204; border-color: transparent; font-weight: 600;
  box-shadow: 0 6px 18px rgba(201, 162, 75, .35);
}
.tab:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

.panel { padding-top: 16px; }
.hidden { display: none !important; }

/* Fields */
.field-label { display: block; font-weight: 500; margin: 16px 0 6px; font-size: 15px; letter-spacing: .04em; color: var(--cream); }
.field-help { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
input[type="text"], input[type="search"], select, textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; font-size: 17px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--cream);
  font-family: var(--sans); font-weight: 300;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold-bright); outline-offset: 1px; border-color: var(--gold);
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23e8c874' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.6; }

/* Error */
.error {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border);
  font-size: 15px; white-space: pre-line;
}

/* Preview — barcode stays black bars on white (scannability) */
.preview-card {
  margin-top: 16px; background: #ffffff; border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 22px 12px; text-align: center;
  overflow-x: auto; min-height: 150px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
}
.barcode-svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.preview-card .muted { color: #6b7280; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Buttons */
.btn {
  min-height: 52px; padding: 12px 22px; border-radius: 999px; border: 1px solid var(--gold);
  font-size: 16px; font-weight: 500; letter-spacing: .04em; cursor: pointer; font-family: var(--sans);
  background: transparent; color: var(--cream);
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-gold {
  background: linear-gradient(135deg, #d9b45f, #b08a2e);
  color: #171204; border-color: transparent; font-weight: 600;
  box-shadow: 0 8px 24px rgba(201, 162, 75, .28);
}
.btn-ghost { color: var(--gold-bright); }
.btn-ghost:active { background: rgba(201, 162, 75, .12); }
.btn-block { width: 100%; margin-top: 14px; }
.btn-small { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.actions .btn { flex: 1; }

/* Options */
.options {
  margin-top: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.options summary { font-weight: 500; cursor: pointer; min-height: 44px; display: flex; align-items: center; font-family: var(--serif); font-size: 17px; color: var(--cream); }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-top: 12px; }
.opt-grid label { font-size: 14px; font-weight: 500; display: block; color: var(--cream); }
.opt-grid input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--gold); }
.opt-grid input[type="color"] {
  width: 100%; min-height: 44px; padding: 2px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: var(--bg2);
}
.opt-val { font-weight: 300; color: var(--muted); margin-left: 6px; }
.opt-grid .check { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opt-grid .check input { width: 24px; height: 24px; accent-color: var(--gold); }

/* Bulk */
.bulk-status { margin: 12px 0 0; font-size: 14px; }
.bulk-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.bulk-item {
  background: #ffffff; border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 14px 12px; text-align: center; overflow-x: auto;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}
.bulk-item .barcode-svg { margin-bottom: 8px; }
.bulk-item .bulk-value { font-weight: 500; font-size: 15px; word-break: break-all; margin: 0 0 10px; color: #111827; }
.bulk-item .btn { min-height: 44px; font-size: 15px; }

/* Stations / Carts / Totes */
.station-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.station-list li { position: relative; }
.station-list li button {
  position: relative;
  width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 40px 12px 16px; font-size: 16px; cursor: pointer;
  display: flex; justify-content: space-between; gap: 10px; font-family: var(--sans);
  min-height: 54px; align-items: center; color: var(--cream);
  transition: border-color .2s, background .2s;
}
.station-list li button::after {
  content: "›"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--gold); font-size: 22px; line-height: 1; pointer-events: none;
}
.station-list li:has(.station-del) button::after { display: none; }
.station-list li button:active { background: var(--surface2); border-color: var(--line-strong); }
.station-list .r-format { color: var(--gold-bright); font-size: 14px; font-weight: 500; white-space: nowrap; letter-spacing: .04em; }
.station-list .r-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-count { margin: 10px 0 0; color: var(--muted); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.station-card { margin-top: 14px; }
.station-name { margin: 0 0 14px; font-size: 24px; color: #111827; }
.station-code { font-size: 20px; font-weight: 600; letter-spacing: .08em; margin: 14px 0 0; color: #111827; }
#station-back, #cart-back, #tote-back { margin-top: 14px; }

/* Station category headers */
.station-cat {
  font-family: var(--sans); font-weight: 600; font-size: 12px; color: var(--gold);
  padding: 16px 4px 2px; letter-spacing: .18em; text-transform: uppercase;
}

/* Delete button for user-added entries */
.station-del {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(248, 113, 113, .45); background: transparent;
  color: #fca5a5; font-size: .85rem; cursor: pointer; z-index: 2;
}

/* Add-your-own form */
.add-station {
  margin-top: 28px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 18px;
}
.add-station h3 { font-size: 1.25rem; margin: 0 0 14px; color: var(--cream); }
.add-station input, .add-station select { width: 100%; margin-bottom: 10px; min-height: 48px; }
.add-station .btn { width: 100%; min-height: 48px; }

/* Recent */
.recent { margin-top: 32px; }
.recent-head { display: flex; align-items: center; justify-content: space-between; }
.recent h2 { font-size: 1.5rem; margin: 0; color: var(--cream); }
.recent-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.recent-list li button {
  width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; font-size: 15px; cursor: pointer;
  display: flex; justify-content: space-between; gap: 10px; font-family: var(--sans);
  min-height: 50px; align-items: center; color: var(--cream);
  transition: border-color .2s, background .2s;
}
.recent-list li button:active { background: var(--surface2); }
.recent-list .r-format { color: var(--gold-bright); font-size: 13px; white-space: nowrap; letter-spacing: .04em; }
.recent-list .r-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.site-footer { padding: 8px 0 36px; border-top: 1px solid var(--line); margin-top: 8px; }
.site-footer p { margin: 16px 0 0; }

@media (hover: none) {
  .btn:hover, .tab:hover { transform: none; }
  .btn-gold:hover { transform: none; box-shadow: 0 8px 24px rgba(201, 162, 75, .28); }
}
@media (hover: hover) {
  .tab:hover { color: var(--cream); }
  .btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(201, 162, 75, .4); }
  .btn-ghost:hover { background: rgba(201, 162, 75, .12); }
  .station-list li button:hover, .recent-list li button:hover { border-color: var(--line-strong); background: var(--surface2); }
}

/* Print: only the barcode(s) */
@media print {
  body { background: #fff; }
  .site-header, .tabs, .field-label, input, select, textarea, .field-help,
  .actions, .options, .recent, .site-footer, #single-error, #bulk-errors,
  .bulk-status, .bulk-item .btn, #bulk-actions { display: none !important; }
  .preview-card, .bulk-item { border: none; padding: 0; margin: 0 0 24px; box-shadow: none; }
  body.printing-single #panel-bulk, body.printing-single #panel-stations, body.printing-single #panel-carts, body.printing-single #panel-totes { display: none !important; }
  body.printing-bulk #panel-single, body.printing-bulk #panel-stations, body.printing-bulk #panel-carts, body.printing-bulk #panel-totes { display: none !important; }
  body.printing-stations #panel-single, body.printing-stations #panel-bulk, body.printing-stations #panel-carts, body.printing-stations #panel-totes { display: none !important; }
  body.printing-stations #station-list-view, body.printing-stations #station-back { display: none !important; }
  body.printing-carts #panel-single, body.printing-carts #panel-bulk, body.printing-carts #panel-stations, body.printing-carts #panel-totes { display: none !important; }
  body.printing-carts #cart-list-view, body.printing-carts #cart-back { display: none !important; }
  body.printing-totes #panel-single, body.printing-totes #panel-bulk, body.printing-totes #panel-stations, body.printing-totes #panel-carts { display: none !important; }
  body.printing-totes #tote-list-view, body.printing-totes #tote-back { display: none !important; }
}
