:root {
  color-scheme: light;
  --canvas: #f3f5ef;
  --surface: #ffffff;
  --surface-soft: #edf3ee;
  --ink: #142c29;
  --muted: #6d7d78;
  --line: #dbe4df;
  --brand: #063f3a;
  --brand-bright: #0a5b52;
  --lime: #dff36c;
  --lime-deep: #cbe452;
  --lime-soft: #f1f7cd;
  --orange: #ff7043;
  --danger: #b53838;
  --warning: #a35a15;
  --shadow: 0 18px 55px rgb(20 44 41 / 10%);
  --shadow-small: 0 7px 22px rgb(20 44 41 / 8%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  background: var(--canvas);
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 100% 0%, rgb(223 243 108 / 14%), transparent 34rem),
    var(--canvas);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-touch-callout: none; }
button { cursor: pointer; }
a { color: var(--brand-bright); }

.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] { display: none !important; }

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid rgb(219 228 223 / 78%);
  background: rgb(243 245 239 / 88%);
  backdrop-filter: blur(18px) saturate(1.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 15px;
  background: var(--brand);
  color: var(--lime);
  box-shadow: 0 7px 18px rgb(6 63 58 / 20%);
  font-size: 23px;
  font-weight: 900;
}

.brand strong,
.brand small { display: block; }
.brand strong { font-size: 17px; line-height: 1.15; }
.brand small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions { display: flex; align-items: center; gap: 7px; }

.icon-button,
.sync-button,
.round-button {
  border: 0;
  color: var(--brand);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(255 255 255 / 72%);
  font-size: 21px;
}
.add-voucher-button { border-color: var(--brand); background: var(--brand); color: var(--lime); }

.sync-button {
  display: flex;
  height: 44px;
  align-items: center;
  gap: 7px;
  padding-inline: 14px;
  border-radius: 15px;
  background: var(--lime);
  box-shadow: 0 8px 20px rgb(134 159 33 / 18%);
  font-weight: 900;
}

.sync-button:active { transform: translateY(1px); }
.sync-button-icon { font-size: 18px; }

main { padding: 16px; }
.screen { animation: screen-in 180ms ease-out; }

.web-ad-slot {
  position: relative;
  min-height: 90px;
  margin-top: 16px;
  padding: 20px 8px 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 255 255 / 60%);
}

.web-ad-slot .adsbygoogle { display: block; min-height: 50px; }
.web-ad-label {
  position: absolute;
  inset: 5px auto auto 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(3px); }
}

.stats {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.stat-card {
  min-width: 0;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 255 255 / 82%);
  box-shadow: var(--shadow-small);
}

.stat-card span,
.stat-card strong { display: block; }
.stat-card span { color: var(--muted); font-size: 11px; font-weight: 700; }
.stat-card strong {
  margin-top: 5px;
  overflow: hidden;
  color: var(--brand);
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-primary {
  border-color: var(--brand);
  background: var(--brand);
}
.stat-primary span { color: rgb(255 255 255 / 65%); }
.stat-primary strong { color: var(--lime); }

.empty-state {
  padding: 35px 24px;
  border: 1px dashed #b8c8c1;
  border-radius: 28px;
  background: rgb(255 255 255 / 58%);
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 22px;
  background: var(--surface-soft);
  color: var(--brand);
  font-size: 32px;
}

.empty-state h2 { margin: 0 0 7px; font-size: 21px; }
.empty-state p { margin: 0 auto 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.voucher-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 29px;
  background: var(--surface);
  box-shadow: var(--shadow);
  touch-action: pan-y;
  user-select: none;
  will-change: transform, opacity;
}

.voucher-card.sliding-left { animation: slide-left 230ms ease; }
.voucher-card.sliding-right { animation: slide-right 230ms ease; }
@keyframes slide-left { 45% { opacity: .25; transform: translateX(-28px); } }
@keyframes slide-right { 45% { opacity: .25; transform: translateX(28px); } }

.voucher-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 8px;
}

.voucher-amount { color: var(--brand); font-size: 35px; font-weight: 950; letter-spacing: -1px; }
.voucher-amount.no-amount { margin-top: 3px; font-size: 17px; letter-spacing: 0; }
.voucher-title { max-width: 52vw; color: var(--brand); font-size: 23px; font-weight: 950; line-height: 1.2; overflow-wrap: anywhere; }
.voucher-meta { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.voucher-head-actions { display: grid; justify-items: end; gap: 7px; }
.folder-pill { max-width: 145px; padding: 7px 10px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); color: var(--brand); font-size: 10px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.card-edit { padding: 6px 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--brand); font-size: 10px; font-weight: 900; }

.status-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #e9f6ef;
  color: #167047;
  font-size: 11px;
  font-weight: 900;
}

.status-pill.used { background: #f6eaea; color: var(--danger); }
.status-pill.missingFromTenbis { background: #fff1df; color: var(--warning); }

.barcode-frame {
  position: relative;
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  margin: 8px 14px 6px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: #fff;
}

.barcode-frame img,
.barcode-frame svg {
  display: block;
  width: 100%;
  max-width: 620px;
  max-height: 255px;
  object-fit: contain;
}

.barcode-placeholder { color: var(--muted); text-align: center; }
.barcode-placeholder strong { display: block; margin-bottom: 7px; color: var(--ink); }
.barcode-label { min-height: 17px; color: var(--muted); font-size: 10px; text-align: center; }
.barcode-number {
  min-height: 26px;
  margin-top: 6px;
  direction: ltr;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1px;
  text-align: center;
  unicode-bidi: plaintext;
  word-break: break-all;
}
.code-copy-button {
  display: flex;
  width: max-content;
  max-width: calc(100% - 28px);
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-inline: auto;
  padding: 3px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
}
.code-copy-button::after {
  flex: 0 0 auto;
  color: var(--brand-bright);
  content: '⧉ העתק';
  direction: rtl;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0;
}
.code-copy-button:active { background: var(--surface-soft); }

.voucher-position { display: flex; min-height: 28px; align-items: center; justify-content: center; gap: 8px; margin: 5px 0 0; }
.voucher-counter { color: var(--muted); font-size: 11px; text-align: center; }
.voucher-first { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); color: var(--brand); font-size: 10px; font-weight: 900; }
.voucher-controls,
.checkout-actions {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  gap: 9px;
}
.voucher-controls { padding: 12px 14px 16px; }
.voucher-nav,
.voucher-use,
.checkout-nav,
.checkout-use { min-height: 55px; border-radius: 17px; font-weight: 900; }
.voucher-nav,
.checkout-nav { border: 1px solid var(--line); background: #f7faf8; color: var(--brand); font-size: 24px; }
.voucher-nav:disabled { cursor: default; opacity: .35; }
.voucher-use,
.checkout-use { border: 0; background: var(--brand); color: #fff; font-size: 17px; box-shadow: 0 9px 20px rgb(6 63 58 / 20%); }

.checkout-launch {
  width: 100%;
  min-height: 52px;
  margin-top: 11px;
  border: 0;
  border-radius: 17px;
  background: var(--lime);
  color: var(--brand);
  font-weight: 900;
}
.checkout-launch span { margin-inline-end: 7px; font-size: 19px; }

.privacy-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.privacy-note > span:first-child { color: #2d8b61; }
.privacy-note strong { color: var(--ink); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 3px 1px 15px;
}
.section-heading h1 { margin: 3px 0 0; font-size: 28px; letter-spacing: -.7px; }
.eyebrow { color: var(--brand-bright); font-size: 10px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.count-badge { padding: 7px 11px; border-radius: 999px; background: var(--surface-soft); color: var(--brand); font-size: 12px; font-weight: 900; }
.history-heading-actions { display: flex; align-items: center; gap: 6px; }
.sort-toggle { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--brand); font-size: 10px; font-weight: 900; }

.filter-bar {
  display: flex;
  gap: 7px;
  margin-bottom: 13px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.voucher-search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-small);
}
.voucher-search > span { font-size: 22px; line-height: 1; transform: rotate(-20deg); }
.voucher-search input {
  min-width: 0;
  min-height: 47px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}
.voucher-search input::placeholder { color: var(--muted); opacity: .85; }
.voucher-search input::-webkit-search-cancel-button { display: none; }
.voucher-search button { width: 31px; height: 31px; border-radius: 10px; background: var(--surface-soft); color: var(--brand); font-size: 20px; }
.voucher-search button[hidden] { display: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.filter.active { border-color: var(--brand); background: var(--brand); color: #fff; }

.folder-filter-bar {
  display: flex;
  gap: 7px;
  margin: 0 0 13px;
  padding-bottom: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}
.folder-filter-bar::-webkit-scrollbar { display: none; }
.folder-chip { display: inline-flex; flex: 0 0 auto; min-height: 36px; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 13px; background: rgb(255 255 255 / 76%); color: var(--brand); font-size: 11px; font-weight: 900; }
.folder-chip small { display: grid; min-width: 20px; height: 20px; place-items: center; padding-inline: 5px; border-radius: 99px; background: var(--surface-soft); color: var(--muted); font-size: 9px; }
.folder-chip.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.folder-chip.active small { background: rgb(255 255 255 / 16%); color: var(--lime); }
.history-folders { margin-top: -3px; }

.voucher-list { display: grid; gap: 16px; }
.voucher-group { min-width: 0; }
.voucher-group > h2 { display: flex; align-items: center; gap: 7px; margin: 0 2px 8px; color: var(--brand); font-size: 14px; }
.voucher-group > h2 > span { color: var(--lime-deep); }
.voucher-group > h2 small { margin-inline-start: auto; color: var(--muted); font-size: 10px; }
.voucher-group-list { display: grid; gap: 9px; }
.voucher-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
}
.voucher-row.is-used { opacity: .66; }
.row-title { display: flex; align-items: center; gap: 8px; }
.row-amount { color: var(--brand); font-size: 20px; font-weight: 950; }
.row-meta { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.row-name { margin-top: 4px; color: var(--ink); font-size: 12px; font-weight: 850; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.small-button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: #f7faf8; color: var(--brand); font-size: 11px; font-weight: 900; }
.small-button.danger { color: var(--danger); }
.small-button.copy-code { border-color: rgb(6 63 58 / 18%); background: var(--lime-soft); }

.panel {
  margin-bottom: 11px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}
.panel h2 { margin: 0 0 6px; font-size: 17px; }
.panel p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.setup-panel { display: grid; grid-template-columns: auto 1fr; gap: 11px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.setup-status { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: #fff1df; color: var(--warning); font-size: 9px; font-weight: 900; }
.setup-status.verified { background: #e9f6ef; color: #167047; }
.panel-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; background: var(--lime); color: var(--brand); font-size: 23px; font-weight: 900; }
.full-row { grid-column: 1 / -1; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.button {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  padding-inline: 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}
.button.primary { background: var(--brand); color: #fff; }
.button.secondary { border-color: var(--line); background: #f6f9f7; color: var(--brand); }
.file-label { cursor: pointer; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 12px;
  border-top: 1px solid var(--line);
}
.setting-row:first-of-type { margin-top: 8px; }
.setting-row span strong,
.setting-row span small { display: block; }
.setting-row span strong { font-size: 13px; }
.setting-row span small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.setting-row input { width: 23px; height: 23px; accent-color: var(--brand); }
.setting-row input[type="time"],
.setting-row select { width: auto; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 11px; background: #f7faf8; color: var(--brand); font-size: 11px; font-weight: 800; }

.debug-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}
.debug-panel summary::-webkit-details-marker { display: none; }
.debug-panel summary strong { display: block; margin-top: 3px; }
.debug-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 15px 0; }
.debug-grid div { min-width: 0; padding: 10px; border-radius: 13px; background: var(--surface-soft); }
.debug-grid .wide { grid-column: 1 / -1; }
.debug-grid dt { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.debug-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 11px; font-weight: 800; }
.danger-link { display: block; margin: 20px auto 8px; border: 0; background: transparent; color: var(--danger); font-size: 12px; text-decoration: underline; }

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 760px);
  margin-inline: auto;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(18px) saturate(1.25);
}
.nav-item { padding: 8px 5px; border: 0; border-radius: 14px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; }
.nav-item span { display: block; margin-bottom: 3px; font-size: 20px; line-height: 1; }
.nav-item.active { background: var(--surface-soft); color: var(--brand); }

.checkout {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  overflow: hidden;
  background: #fff;
}
.checkout.visible { display: flex; }
.checkout-header { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; min-height: 48px; text-align: center; }
.round-button { width: 44px; height: 44px; border-radius: 15px; background: var(--surface-soft); font-size: 25px; }
.checkout-header span,
.checkout-header strong { display: block; }
.checkout-header span { color: var(--muted); font-size: 10px; }
.checkout-header strong { margin-top: 2px; color: var(--brand); font-size: 14px; }
.checkout-track { display: flex; flex: 1; min-height: 0; align-items: stretch; justify-content: center; padding: 7px 0; overflow: hidden; }
.checkout-card { display: flex; width: min(100%, 720px); flex-direction: column; touch-action: pan-y; user-select: none; will-change: transform, opacity; }
.checkout-card.slide-out-left { animation: checkout-left 230ms ease; }
.checkout-card.slide-out-right { animation: checkout-right 230ms ease; }
@keyframes checkout-left { 45% { opacity: .2; transform: translateX(-36px); } }
@keyframes checkout-right { 45% { opacity: .2; transform: translateX(36px); } }
.checkout-amount { color: var(--brand); font-size: 33px; font-weight: 950; letter-spacing: -1px; text-align: center; }
.checkout-meta { min-height: 18px; margin: 2px 0 6px; color: var(--muted); font-size: 11px; text-align: center; }
.checkout-barcode {
  display: flex;
  flex: 1;
  min-height: 270px;
  max-height: 58vh;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 5vw, 34px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: #fff;
}
.checkout-barcode img,
.checkout-barcode svg { display: block; width: 100%; height: 100%; max-height: 52vh; object-fit: contain; }
.checkout-number { min-height: 27px; margin-top: 8px; direction: ltr; font-size: 19px; font-weight: 950; letter-spacing: 1px; text-align: center; unicode-bidi: plaintext; word-break: break-all; }
.barcode-source { min-height: 17px; color: var(--muted); font-size: 10px; text-align: center; }
.checkout-jump { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; margin: 5px 3px 7px; color: var(--muted); font-size: 10px; }
.checkout-jump input { width: 100%; accent-color: var(--brand); }
.checkout-actions { flex: 0 0 auto; }
.checkout-actions button { min-height: 59px; }
.checkout-use { font-size: 18px; }

.sync-overlay {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(243 245 239 / 94%);
  backdrop-filter: blur(12px);
}
.sync-overlay.visible { display: flex; }
.sync-dialog { width: min(100%, 380px); text-align: center; }
.sync-orbit { display: grid; width: 70px; height: 70px; margin: 0 auto 18px; place-items: center; border-radius: 25px; background: var(--brand); color: var(--lime); box-shadow: var(--shadow); }
.sync-orbit span { font-size: 34px; animation: rotate 1.25s linear infinite; }
@keyframes rotate { to { transform: rotate(-360deg); } }
.sync-dialog h2 { margin: 6px 0 7px; font-size: 23px; }
.sync-dialog p { min-height: 42px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.sync-progress-bar { height: 5px; margin: 18px auto 14px; overflow: hidden; border-radius: 99px; background: #dce5e0; }
.sync-progress-bar span { display: block; width: 42%; height: 100%; border-radius: inherit; background: var(--lime-deep); animation: indeterminate 1.4s ease-in-out infinite; }
@keyframes indeterminate { 0% { transform: translateX(150%); } 100% { transform: translateX(-340%); } }
.sync-browser-launch { display: flex; width: 100%; margin: 4px 0 9px; font-size: 15px; box-shadow: var(--shadow-small); }
.sync-browser-launch[hidden], .sync-copy-browser[hidden], .sync-browser-note[hidden], .sync-regular-browser[hidden] { display: none; }
.sync-dialog .sync-browser-note { min-height: 0; margin: 0 5px 9px; color: var(--warning); font-size: 11px; }
.sync-regular-browser { display: inline-flex; margin: 0 0 10px; }
.sync-copy-browser { width: 100%; margin-bottom: 11px; }
.text-button { border: 0; background: transparent; color: var(--brand); font-size: 12px; font-weight: 800; text-decoration: underline; }

.setup-dialog {
  width: min(calc(100% - 26px), 500px);
  max-height: calc(100dvh - 26px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 27px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 90px rgb(6 63 58 / 28%);
  overflow: auto;
}
.setup-dialog::backdrop { background: rgb(6 35 32 / 58%); backdrop-filter: blur(6px); }
.dialog-close { float: left; width: 40px; height: 40px; border: 0; border-radius: 13px; background: var(--surface-soft); color: var(--brand); font-size: 24px; }
.setup-dialog h2 { margin: 5px 0 15px; font-size: 23px; }
.platform-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border-radius: 14px; background: var(--surface-soft); }
.platform-tab { min-height: 39px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 900; }
.platform-tab.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-small); }
.setup-steps { display: grid; gap: 9px; margin: 15px 0; color: var(--muted); font-size: 12px; }
.setup-step { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 16px; background: #fafcfb; }
.setup-step > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; background: var(--brand); color: var(--lime); font-weight: 950; }
.setup-step strong, .setup-step small { display: block; }
.setup-step strong { color: var(--ink); }
.setup-step small { margin-top: 3px; line-height: 1.45; }
.setup-step .setup-fallback-note { margin-top: 8px; padding: 8px 9px; border-radius: 10px; background: var(--surface-soft); }
.setup-step .button { width: max-content; margin-top: 9px; }
.setup-download-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 12px; }
.inline-link { margin-top: 9px; color: var(--brand); font-weight: 850; text-decoration: underline; text-underline-offset: 3px; }
.dialog-note { margin: 0; padding: 11px; border-radius: 13px; background: #f8f7e9; color: #725d1f; font-size: 11px; line-height: 1.5; }

.button:disabled { cursor: not-allowed; opacity: .45; }

.manual-voucher-dialog { width: min(calc(100% - 20px), 560px); }
.manual-voucher-dialog form { display: grid; gap: 12px; }
.form-field { display: grid; gap: 6px; min-width: 0; color: var(--ink); font-size: 12px; font-weight: 850; }
.form-field > small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.45; }
.form-field input,
.form-field select,
.form-field textarea { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; outline: none; background: #fafcfb; color: var(--ink); font-size: 14px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--brand-bright); box-shadow: 0 0 0 3px rgb(10 91 82 / 10%); }
.form-field textarea { resize: vertical; }
.field-with-button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.field-with-button .button { min-height: 43px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.or-divider { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; }
.or-divider::before, .or-divider::after { height: 1px; flex: 1; background: var(--line); content: ''; }
.upload-row { display: flex; align-items: center; gap: 11px; }
.upload-row .button { margin: 0; }
.remove-image { color: var(--danger); }
.manual-barcode-preview { display: flex; min-height: 125px; max-height: 210px; align-items: center; justify-content: center; padding: 12px; overflow: hidden; border: 1px dashed #b8c8c1; border-radius: 17px; background: #fff; }
.manual-barcode-preview img,
.manual-barcode-preview svg { display: block; width: 100%; max-height: 180px; object-fit: contain; }
.form-error { margin: 0; padding: 9px 11px; border-radius: 11px; background: #fbeaea; color: var(--danger); font-size: 11px; font-weight: 800; line-height: 1.45; }
.manual-form-actions .button { flex: 1 1 170px; }
.danger-button { border-color: #e8bebe !important; color: var(--danger) !important; }
.new-folder-form { margin-bottom: 14px; }
.folder-manager-list { display: grid; gap: 8px; margin: 12px 0 15px; }
.folder-manager-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfb; }
.folder-manager-row strong, .folder-manager-row small { display: block; }
.folder-manager-row strong { overflow-wrap: anywhere; font-size: 13px; }
.folder-manager-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.empty-folder-list { padding: 22px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 12px; text-align: center; }

.toast {
  position: fixed;
  z-index: 200;
  right: 50%;
  bottom: calc(94px + env(safe-area-inset-bottom));
  max-width: min(90vw, 430px);
  padding: 11px 16px;
  border-radius: 999px;
  background: #102f2b;
  color: #fff;
  box-shadow: 0 13px 35px rgb(0 0 0 / 22%);
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(50%, 14px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.visible { opacity: 1; transform: translate(50%, 0); }
.toast { display: flex; align-items: center; gap: 10px; }
.toast button { flex: 0 0 auto; padding: 5px 9px; border: 0; border-radius: 999px; background: var(--lime); color: var(--brand); font-size: 11px; font-weight: 900; }

@media (max-width: 390px) {
  .app-header { padding-inline: 12px; }
  main { padding-inline: 12px; }
  .brand small { display: none; }
  .brand strong { font-size: 15px; }
  .stats { grid-template-columns: 1.3fr 1fr 1fr; }
  .stat-card { padding-inline: 9px; }
  .stat-card strong { font-size: 19px; }
  .voucher-amount { font-size: 31px; }
  .barcode-frame { min-height: 205px; }
  .header-actions { gap: 5px; }
  .icon-button { width: 39px; height: 39px; }
  .sync-button { width: 41px; height: 41px; justify-content: center; padding: 0; }
  .sync-button-label { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .folder-manager-row { grid-template-columns: 1fr; }
  .folder-manager-row .row-actions { justify-content: start; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .checkout-header { min-height: 38px; }
  .checkout-track { padding-block: 3px; }
  .checkout-amount { position: absolute; z-index: 2; top: 13px; right: 70px; font-size: 25px; }
  .checkout-meta { display: none; }
  .checkout-barcode { min-height: 0; max-height: none; }
  .checkout-number { margin-top: 3px; font-size: 15px; }
  .checkout-actions button { min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
