/* printGo — mobile-first kiosk UI.
   Every colour and radius is a variable so the brand can be re-themed here. */

:root {
  /* Brand */
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eff4ff;

  /* Neutrals */
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #10151f;
  --text-muted: #66708a;
  --border: #e4e7ee;
  --border-strong: #cfd5e2;
  --muted-bg: #eef0f4;
  --on-accent: #ffffff;

  /* Status */
  --success: #12915a;
  --success-soft: #e8f6ef;
  --danger: #d13438;
  --danger-soft: #fdeded;
  --warning: #a86400;
  --warning-soft: #fdf3e3;

  /* Shape */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(16, 21, 31, .05), 0 6px 20px rgba(16, 21, 31, .05);
  --shadow-sm: 0 1px 2px rgba(16, 21, 31, .06);

  /* Layout */
  --shell: 480px;
  --gap: 16px;
  --tap: 52px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ structure */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  text-decoration: none;
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}

.brand .mark svg { width: 15px; height: 15px; }

.lang { display: flex; gap: 2px; }

.lang a {
  min-width: 30px;
  padding: 6px 0;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.lang a[aria-current="true"] { background: var(--accent-soft); color: var(--accent-dark); }

.shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 20px 20px 40px;
}

/* The direct child of .shell fills it, so a sticky action bar can be pushed
   to the bottom of short pages instead of floating in the middle. */
.shell > .stack { flex: 1 1 auto; }

.shell.has-bottom-bar { padding-bottom: 0; }

.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

.page-title {
  margin: 4px 0 2px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.page-sub { margin: 0 0 4px; color: var(--text-muted); font-size: 15px; }

.section-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card.tight { padding: 14px 16px; }
.center { text-align: center; }
.muted { color: var(--text-muted); }
.small { font-size: 14px; }

/* --------------------------------------------------------------- kiosk */

.kiosk-head { text-align: center; padding: 8px 0 4px; }

.kiosk-head h1 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.kiosk-head .kiosk-id { margin: 0 0 12px; color: var(--text-muted); font-size: 15px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.online { background: var(--success-soft); color: var(--success); }
.status-pill.offline { background: var(--danger-soft); color: var(--danger); }

.action-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 84px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.action-tile:active { transform: scale(.995); }
.action-tile .tile-body { flex: 1; min-width: 0; }
.action-tile .tile-title { display: block; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.action-tile .tile-hint { display: block; margin-top: 2px; color: var(--text-muted); font-size: 14px; }
.action-tile .chevron { color: var(--border-strong); flex: none; }
.action-tile[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.tile-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.tile-icon svg { width: 24px; height: 24px; }
.tile-icon.plain { background: var(--muted-bg); color: var(--text-muted); }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.chip {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 550;
}

/* Block, not flex: with a flex row the icon strands itself on the left as
   soon as the sentence wraps (visible in RU/UZ, which run longer). */
.privacy-note {
  display: block;
  max-width: 36ch;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 13.5px;
  text-align: center;
}

.privacy-note svg {
  width: 15px;
  height: 15px;
  margin-right: 6px;
  vertical-align: -2px;
}

/* --------------------------------------------------------------- steps */

.steps { display: flex; align-items: center; gap: 0; margin: 2px 0 6px; }

.steps li { display: flex; align-items: center; flex: 1; list-style: none; }
.steps li:last-child { flex: none; }

.steps .bead {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--muted-bg);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.steps .bar { flex: 1; height: 2px; margin: 0 6px; background: var(--muted-bg); border-radius: 2px; }
.steps li.done .bead, .steps li.current .bead { background: var(--accent); color: #fff; }
.steps li.done .bar { background: var(--accent); }
.steps .bead svg { width: 13px; height: 13px; }

.step-caption { margin: 0; color: var(--text-muted); font-size: 13px; font-weight: 600; }

/* -------------------------------------------------------------- upload */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 190px;
  padding: 24px;
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
}

.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-icon { color: var(--accent); }
.dropzone .dz-icon svg { width: 34px; height: 34px; }
.dropzone .dz-title { font-size: 17px; font-weight: 650; }
.dropzone .dz-hint { color: var(--text-muted); font-size: 14px; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

.file-row { display: flex; align-items: center; gap: 14px; }
.file-row .file-name { font-weight: 600; word-break: break-word; }
.file-row .file-meta { margin-top: 2px; color: var(--text-muted); font-size: 14px; }

/* --------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 8px; }

.field > label, .field-label {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--muted-bg);
  border-radius: var(--radius);
}

.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented label {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.segmented input:disabled + label { opacity: .45; cursor: not-allowed; }

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px;
  background: var(--muted-bg);
  border-radius: var(--radius);
}

.stepper button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 22px;
  font-weight: 500;
  cursor: pointer;
}

.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper output { flex: 1; text-align: center; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }

input[type="text"], input[type="tel"], input[type="password"], input[type="email"],
body:not(.admin) input[type="number"], body:not(.admin) select {
  width: 100%;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
}

input[type="text"]:focus, input[type="tel"]:focus, input[type="password"]:focus,
input[type="email"]:focus, body:not(.admin) input[type="number"]:focus, body:not(.admin) select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

input:disabled { background: var(--muted-bg); color: var(--text-muted); }

.hint { color: var(--text-muted); font-size: 13.5px; }

[hidden] { display: none !important; }

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap);
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
}

.btn:active { transform: scale(.99); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: var(--border-strong); color: #fff; cursor: not-allowed; }

.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-muted); font-weight: 600; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--surface); border-color: var(--border-strong); color: var(--danger); }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.btn-row .btn.narrow { flex: 0 0 34%; }

.bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  margin: auto -20px 0;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(16, 21, 31, .06);
}

.bottom-bar .total-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bottom-bar .total-line .label { color: var(--text-muted); font-size: 14px; font-weight: 600; }
.bottom-bar .total-line .value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- summary */

.summary { display: flex; flex-direction: column; }

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.summary-row:last-child { border-bottom: 0; }
.summary-row .k { color: var(--text-muted); }
.summary-row .v { font-weight: 600; text-align: right; word-break: break-word; }

.total-block {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 2px solid var(--text);
}

.total-block .k { font-size: 16px; font-weight: 650; }
.total-block .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.amount-hero { text-align: center; padding: 10px 0 4px; }
.amount-hero .label { color: var(--text-muted); font-size: 14px; font-weight: 600; }
.amount-hero .value { margin-top: 4px; font-size: 40px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- alerts */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius);
  font-size: 14.5px;
}

.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-error { background: var(--danger-soft); color: #9a2226; }
.alert-info { background: var(--accent-soft); color: var(--accent-dark); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert strong { display: block; font-weight: 700; }

/* ------------------------------------------------------------ progress */

.progress-track { height: 8px; border-radius: 999px; background: var(--muted-bg); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .5s ease; }

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.status-badge {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 6px;
  border-radius: 50%;
}

.status-badge svg { width: 38px; height: 38px; }
.status-badge.success { background: var(--success-soft); color: var(--success); }
.status-badge.error { background: var(--danger-soft); color: var(--danger); }
.status-badge.neutral { background: var(--accent-soft); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
  .progress-fill { transition: none; }
  .btn:active, .action-tile:active { transform: none; }
}

/* -------------------------------------------------------- printers */

.printer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.printer-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 140px;
  padding: 16px;
  border: 1px solid var(--border);
  border-top: 6px solid var(--printer, var(--border-strong));
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
}

.printer-tile.color-red { --printer: #e0483c; }
.printer-tile.color-green { --printer: #2f9e56; }
.printer-tile.color-yellow { --printer: #e5b721; }
.printer-tile.color-blue { --printer: #2f6bd8; }

.printer-tile.disabled {
  background: var(--muted-bg);
  box-shadow: none;
  pointer-events: none;
}

.printer-tile.busy { opacity: .75; }
.printer-tile.broken { opacity: .55; border-top-color: var(--border-strong); }

.printer-swatch {
  width: 26px;
  height: 26px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: var(--printer, var(--border-strong));
}

.printer-tile.broken .printer-swatch { background: var(--border-strong); }
.printer-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.printer-code { color: var(--text-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.printer-state {
  margin-top: auto;
  padding-top: 8px;
  font-size: 14px;
  font-weight: 650;
  color: var(--success);
}

.printer-tile.disabled .printer-state { color: var(--text-muted); }
.printer-caps { color: var(--text-muted); font-size: 12px; }

.printer-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--printer, var(--accent));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.printer-badge.color-red { --printer: #e0483c; }
.printer-badge.color-green { --printer: #2f9e56; }
.printer-badge.color-yellow { --printer: #b8880a; }
.printer-badge.color-blue { --printer: #2f6bd8; }

.action-tile.disabled {
  background: var(--muted-bg);
  box-shadow: none;
  opacity: .65;
  pointer-events: none;
}

/* --------------------------------------------------------- account */

.topbar-right { display: flex; align-items: center; gap: 8px; }

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.account-chip svg { width: 15px; height: 15px; }
.account-chip.signed-in { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

.code-input {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .32em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.btn.package {
  flex-direction: column;
  gap: 2px;
  min-height: 64px;
  padding: 12px 20px;
}

.package-amount { font-size: 18px; font-weight: 700; }
.package-tier { color: var(--text-muted); font-size: 13px; font-weight: 600; }

.summary-row.discount .v { color: var(--success); }

/* ----------------------------------------------------- session bar */

.session-bar {
  position: sticky;
  top: 57px;
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 20px;
  background: var(--success-soft);
  border-bottom: 1px solid var(--border);
  color: var(--success);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.session-bar .session-state { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.session-bar .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; }

.session-bar .session-finish {
  flex: none;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.session-bar.warning { background: var(--warning-soft); color: var(--warning); }

.status-pill.busy { background: var(--warning-soft); color: var(--warning); }

.countdown {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------- file strip */

.filestrip {
  display: flex;
  gap: 8px;
  margin: 0 -20px;
  padding: 2px 20px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filestrip::-webkit-scrollbar { display: none; }

.filechip {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  max-width: 210px;
  min-height: 56px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
}

.filechip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.filechip.excluded { opacity: .5; }
.filechip-icon { flex: none; display: grid; place-items: center; }
.filechip-icon svg { width: 18px; height: 18px; }
.filechip-body { min-width: 0; }

.filechip-name {
  display: block;
  max-width: 150px;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filechip.active .filechip-name { color: var(--accent-dark); }
.filechip-meta { display: block; font-size: 12.5px; }

/* ------------------------------------------------------ document reader */

.viewer {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted-bg);
}

.viewer img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
}

.viewer object {
  display: block;
  width: 100%;
  height: 52vh;
  min-height: 280px;
  border: 0;
}

/* --------------------------------------------------- include / subtotal */

.doc-head { display: flex; flex-direction: column; gap: 12px; }

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.switch-row input {
  width: 22px;
  height: 22px;
  flex: none;
  accent-color: var(--accent);
}

.doc-panel.excluded .field,
.doc-panel.excluded .more,
.doc-panel.excluded .subtotal-row { opacity: .45; pointer-events: none; }

.subtotal-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
}

.subtotal-row [data-role="sheets"] { margin-right: 8px; font-weight: 500; }

/* -------------------------------------------------------- how-to list */

.howto {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  list-style: none;
}

.howto li { display: flex; align-items: center; gap: 12px; font-size: 15.5px; }

.howto .num {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

/* ---------------------------------------------------- more options */

details.more {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

details.more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
  padding: 0 16px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .chevron { transition: transform .15s ease; color: var(--text-muted); }
details.more[open] > summary .chevron { transform: rotate(90deg); }
details.more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
details.more .more-body { display: flex; flex-direction: column; gap: var(--gap); padding: 4px 16px 18px; }

/* --------------------------------------------------------------- misc */

.site-footer {
  padding: 8px 20px 28px;
  color: var(--text-muted);
  font-size: 12.5px;
  text-align: center;
}

.dev-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Wider screens: keep the phone column, just give it more breathing room. */
@media (min-width: 600px) {
  .shell { flex: 0 0 auto; padding-top: 32px; }
  .shell > .stack { flex: 0 0 auto; }
  .bottom-bar {
    position: static;
    box-shadow: none;
    margin: 8px 0 0;
    padding: 0;
    background: none;
    border-top: 0;
  }
  .shell.has-bottom-bar { padding-bottom: 40px; }
}

/* Kiosk page: the printer this phone is holding. */
.connected-banner { border-left: 6px solid var(--accent); }
.connected-banner.color-red { border-left-color: #e0483c; }
.connected-banner.color-green { border-left-color: #2f9e56; }
.connected-banner.color-yellow { border-left-color: #e5b721; }
.connected-banner.color-blue { border-left-color: #2f6bd8; }
.connected-banner .btn-row { display: flex; gap: 10px; }
.connected-banner .btn-row > * { flex: 1; }
.printer-tile.is-mine { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Scan / copy session: one sheet at a time. */
.session-count { margin: 4px 0 0; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }

/* Dev page: effective device mode. */
.mode-line { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.mode { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--muted-bg); color: var(--text-muted); font-weight: 600; }
.mode.real { background: var(--danger-soft); color: var(--danger); }

/* Settings: validation. */
.error-line { display: block; margin-top: 2px; }
.filechip.has-error { border-color: var(--danger); }
input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Very narrow phones (320–370 px): the header must not overflow in any
   language.  The account button keeps its icon and its accessible name. */
.topbar { min-width: 0; }
.topbar-right { min-width: 0; }
@media (max-width: 370px) {
  .topbar { padding: 10px 10px; gap: 6px; }
  .brand { font-size: 15px; gap: 6px; }
  .lang a { min-width: 24px; font-size: 12px; }
  .account-chip { padding: 0 8px; }
  .account-chip span { display: none; }
}

.back-link { justify-content: flex-start; width: auto; padding-left: 0; }
body:not(.admin) select { appearance: auto; }


/* ------------------------------------------------------------- themes
   Chosen in Admin → Settings.  Each theme only redefines variables; the
   printer sticker colours (red/green/yellow/blue) never change, because
   they must match the physical machines. */
[data-theme="emerald"] {
  --accent: #0f8a5f; --accent-dark: #0a6b49; --accent-soft: #e6f5ee;
  --bg: #f3f7f4; --border: #e0e8e3; --border-strong: #c7d6cd; --muted-bg: #eaf1ec;
}
[data-theme="sunset"] {
  --accent: #e2611b; --accent-dark: #bf4d0e; --accent-soft: #fff0e5;
  --bg: #faf6f1; --border: #ece3da; --border-strong: #ddcfc2; --muted-bg: #f4ece4;
}
[data-theme="royal"] {
  --accent: #6d3fd6; --accent-dark: #5630b2; --accent-soft: #f1ebff;
  --bg: #f6f4fb; --border: #e6e1f2; --border-strong: #d2c9ea; --muted-bg: #eeeaf7;
}
[data-theme="midnight"] {
  --accent: #5b9dff; --accent-dark: #3d82f0; --accent-soft: #1c2a40; --on-accent: #ffffff;
  --bg: #0f141c; --surface: #18202b; --text: #e8edf5; --text-muted: #9aa6ba;
  --border: #273244; --border-strong: #36445a; --muted-bg: #202a38;
  --success: #3fcf8e; --success-soft: #123224;
  --danger: #ff6b6e; --danger-soft: #3a1b1d;
  --warning: #f5b34a; --warning-soft: #3a2d14;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
[data-theme="midnight"] .alert-error { color: #ffb4b5; }
[data-theme="midnight"] .topbar, [data-theme="midnight"] .bottom-bar { background: var(--surface); }
[data-theme="midnight"] input, [data-theme="midnight"] select { color-scheme: dark; }

/* Customer pages: which printer am I using?  A big block in its colour. */
.printer-banner {
  --printer: var(--accent);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 22px 18px; border-radius: 20px;
  background: var(--printer); color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--printer) 30%, transparent);
}
.printer-banner.color-red { --printer: #e0483c; }
.printer-banner.color-green { --printer: #2f9e56; }
.printer-banner.color-yellow { --printer: #e5b721; color: #2b2100; }
.printer-banner.color-blue { --printer: #2f6bd8; }
.printer-banner-name { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.printer-banner-icon svg { width: 30px; height: 30px; display: block; }
.pick-title { margin: 6px 0 2px; color: var(--text); font-size: 19px; font-weight: 600; text-align: center; }

/* printGo logo: the dark-text version on light themes, the light one on Midnight. */
.brand-logo { display: block; height: 29px; width: auto; }
.brand-logo-light { display: none; }
:root[data-theme="midnight"] .brand-logo-dark { display: none; }
:root[data-theme="midnight"] .brand-logo-light { display: block; }

/* Payment choice: Payme, Click, Hayot Bank */
.pay-choose { margin: 4px 0 0; font-weight: 600; font-size: 16px; text-align: center; }
.pay-options { display: grid; gap: 10px; }
.pay-option {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--border-strong, #d5dae2);
  background: var(--surface, #fff); color: var(--text); font: inherit; font-size: 17px; font-weight: 600;
  cursor: pointer; text-align: left; min-height: 64px;
}
.pay-option:hover:not([disabled]) { border-color: var(--accent); }
.pay-option[disabled] { opacity: .55; cursor: not-allowed; }
.pay-option .pay-name { flex: 1; }
.pay-option svg.icon { width: 18px; height: 18px; color: var(--text-muted); }
.pay-logo { display: grid; place-items: center; width: 72px; height: 36px; flex: none; }
.pay-logo img { max-width: 100%; max-height: 100%; display: block; }
.pay-hayot .pay-logo img { height: 34px; }
.pay-logo.big { width: 120px; height: 48px; margin: 0 auto; }
.pay-soon { font-size: 12.5px; font-weight: 600; color: var(--text-muted); background: var(--muted-bg, #f1f3f7);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pay-pending { border-left: 4px solid var(--accent); }
.hayot-card { padding-top: 26px; padding-bottom: 22px; }
.hayot-mark { width: 96px; height: 96px; margin: 0 auto; display: block; }
.pay-spinner { width: 34px; height: 34px; margin: 8px auto; border-radius: 50%;
  border: 3px solid var(--muted-bg, #e6e9ef); border-top-color: var(--accent); animation: pay-spin .9s linear infinite; }
@keyframes pay-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pay-spinner { animation: none; } }
.package-pick { display: grid; gap: 8px; }
.package-choice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid var(--border-strong, #d5dae2); background: var(--surface, #fff); cursor: pointer; }
.package-choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.package-choice .package-amount { flex: 1; font-weight: 700; }
.package-choice .package-tier { color: var(--text-muted); font-size: 14px; }
