:root {
  color-scheme: light;
  --bg: #eef2f7;
  --bg2: #f8fafc;
  --panel: rgba(255,255,255,.92);
  --solid: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(148,163,184,.28);
  --primary: #0f172a;
  --primaryText: #ffffff;
  --accent: #7c3aed;
  --accent2: #06b6d4;
  --danger: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --infoBg: #eff6ff;
  --errorBg: #fef2f2;
  --successBg: #ecfdf5;
  --shadow: 0 24px 80px rgba(15, 23, 42, .14);
  --softShadow: 0 12px 36px rgba(15, 23, 42, .08);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, "Noto Sans Hebrew", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(124,58,237,.18), transparent 34%),
    radial-gradient(circle at 86% 10%, rgba(6,182,212,.16), transparent 30%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  color: var(--text);
  min-height: 100vh;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.light { color: rgba(255,255,255,.78); }
.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 900; }

.app-shell { min-height: 100vh; }
.glass { background: rgba(255,255,255,.78); backdrop-filter: blur(18px); }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: calc(12px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-left)) 12px max(18px, env(safe-area-inset-right));
  border-bottom: 1px solid var(--border);
}
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-badge { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, #0f172a, #4c1d95); color: white; box-shadow: var(--softShadow); font-size: 22px; }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.container { width: min(1160px, 100%); margin: 0 auto; padding: 22px 16px 104px; }

.panel, .auth-card, .gift-card, .stat-card, .premium-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--softShadow);
}
.panel { background: var(--panel); padding: 18px; }
.premium-card { position: relative; overflow: hidden; color: #fff; background: linear-gradient(135deg, #0f172a 0%, #312e81 50%, #155e75 100%); }
.hero-shine { position: absolute; inset: -40% -20% auto auto; width: 360px; height: 360px; border-radius: 50%; background: rgba(255,255,255,.18); filter: blur(12px); }

.unlock-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: stretch; margin-top: 28px; }
.hero-card { min-height: 440px; display: flex; align-items: end; padding: 32px; }
.hero-content { position: relative; z-index: 1; max-width: 620px; }
.hero-pill { display: inline-flex; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); font-weight: 800; font-size: 13px; }
.hero-card h2 { margin: 18px 0 12px; font-size: clamp(34px, 6vw, 66px); line-height: .96; letter-spacing: -.05em; }
.hero-card p { color: rgba(255,255,255,.76); font-size: 17px; line-height: 1.7; }
.hero-checks { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.hero-checks span { padding: 10px 12px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.14); font-weight: 800; }
.unlock-card { align-self: center; padding: 26px; }
.unlock-card h2 { margin: 0 0 4px; font-size: 28px; }

label { display: block; margin: 13px 0; font-weight: 900; }
input, select, textarea {
  width: 100%; margin-top: 8px; border: 1px solid rgba(148,163,184,.48); border-radius: 16px;
  padding: 14px 15px; font: inherit; background: #fff; color: var(--text); transition: .18s ease;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 4px solid rgba(124,58,237,.13); border-color: var(--accent); box-shadow: 0 0 0 1px rgba(124,58,237,.16); }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.password-row input { margin-top: 8px; }

button, .button, a.ghost {
  border: 0; border-radius: 16px; padding: 13px 16px; font: inherit; font-weight: 900; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}
button:hover, a.ghost:hover { transform: translateY(-1px); }
button:active { transform: translateY(0); opacity: .88; }
.primary { background: linear-gradient(135deg, #0f172a, #312e81); color: var(--primaryText); box-shadow: 0 12px 30px rgba(49,46,129,.22); }
.secondary { background: #eef2f7; color: #0f172a; }
.ghost { background: rgba(255,255,255,.72); color: #0f172a; border: 1px solid var(--border); }
.danger { background: var(--danger); color: #fff; }
.compact { padding: 10px 12px; border-radius: 13px; font-size: 14px; }
.full { width: 100%; }
.big { padding: 16px 20px; font-size: 16px; }
.small { padding: 9px 12px; border-radius: 12px; font-size: 14px; }
.icon { width: 44px; height: 44px; padding: 0; font-size: 26px; background: #f1f5f9; color: #0f172a; }
.mini-button { padding: 10px 12px; border-radius: 13px; background: #f1f5f9; color: #0f172a; }
.glass-button { color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); }

.alert { padding: 12px 14px; border-radius: 16px; margin: 14px 0; border: 1px solid transparent; }
.alert.error { background: var(--errorBg); color: #7f1d1d; border-color: #fecaca; }
.alert.success { background: var(--successBg); color: #064e3b; border-color: #bbf7d0; }
.alert.info { background: var(--infoBg); color: #1e3a8a; border-color: #bfdbfe; }

.wallet-hero { min-height: 220px; display: flex; justify-content: space-between; gap: 18px; align-items: end; padding: 26px; margin-bottom: 16px; }
.wallet-hero h2 { margin: 0; font-size: clamp(28px, 4vw, 48px); letter-spacing: -.04em; }
.wallet-hero .eyebrow { color: rgba(255,255,255,.62); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: rgba(255,255,255,.84); padding: 18px; }
.stat-card span { display: block; color: var(--muted); font-weight: 900; font-size: 13px; }
.stat-card strong { display: block; margin-top: 6px; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.03em; }
.stat-card em { display: block; margin-top: 5px; color: var(--muted); font-style: normal; font-size: 13px; }
.stat-card.warning strong { color: var(--warning); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 18px 2px 12px; }
.section-head h3 { margin: 0; font-size: 22px; }
.section-head p { margin: 4px 0 0; }
.soon-panel { margin-bottom: 16px; }
.mini-card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.mini-card { background: #fff7ed; color: #7c2d12; border: 1px solid #fed7aa; text-align: right; display: block; padding: 14px; }
.mini-card strong { display: block; }
.mini-card span { display: block; margin-top: 4px; font-size: 13px; }

.control-panel { display: grid; gap: 12px; margin-bottom: 10px; }
.search-wrap { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 0 12px; }
.search-wrap input { border: 0; margin: 0; padding: 15px 0; }
.search-wrap input:focus { outline: none; box-shadow: none; }
.filter-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.filter-line select { margin: 0; }
.chips { display: flex; gap: 8px; overflow: auto; padding-bottom: 2px; }
.chip { white-space: nowrap; padding: 9px 13px; border-radius: 999px; background: #f8fafc; color: #334155; border: 1px solid var(--border); }
.chip.active { background: #0f172a; color: #fff; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.gift-card { overflow: hidden; background: var(--solid); display: grid; grid-template-rows: 112px 1fr; min-height: 286px; }
.gift-card.archived { opacity: .58; filter: grayscale(.25); }
.card-art { position: relative; padding: 18px; display: flex; justify-content: space-between; align-items: start; color: #fff; background: linear-gradient(135deg, #0f172a, #4c1d95); }
.card-art.ok { background: linear-gradient(135deg, #0f172a, #0f766e); }
.card-art.warn { background: linear-gradient(135deg, #7c2d12, #d97706); }
.card-art.bad { background: linear-gradient(135deg, #7f1d1d, #dc2626); }
.card-art.neutral { background: linear-gradient(135deg, #334155, #64748b); }
.card-art::after { content: ''; position: absolute; inset: auto -30px -56px auto; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.15); }
.card-art span { font-size: 30px; }
.card-art em { font-style: normal; font-weight: 900; opacity: .86; max-width: 180px; text-align: left; direction: ltr; }
.card-body { padding: 15px; display: grid; gap: 12px; }
.card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.card-head strong { font-size: 19px; line-height: 1.25; }
.status-badge { border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.status-badge.ok { background: #ecfdf5; color: #065f46; }
.status-badge.warn { background: #fff7ed; color: #9a3412; }
.status-badge.bad { background: #fef2f2; color: #991b1b; }
.status-badge.neutral { background: #f1f5f9; color: #475569; }
.card-meta { display: grid; gap: 6px; color: #334155; font-size: 14px; }
.card-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: auto; }
.pay-button { min-height: 50px; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 36px 18px; border: 1px dashed rgba(100,116,139,.4); border-radius: var(--radius); background: rgba(255,255,255,.72); }
.empty-state div { font-size: 46px; }
.empty-state h3 { margin: 8px 0 4px; }
.empty-state p { margin: 0 0 16px; color: var(--muted); }

.modal { position: fixed; inset: 16px; z-index: 40; width: min(820px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow: auto; margin: auto; box-shadow: var(--shadow); background: rgba(255,255,255,.96); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 28px; }
.wizard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.sensitive-box { margin-top: 14px; border: 1px solid rgba(124,58,237,.22); background: linear-gradient(180deg, rgba(124,58,237,.06), rgba(6,182,212,.05)); border-radius: 22px; padding: 14px; }
.sensitive-head { display: flex; justify-content: space-between; gap: 10px; color: #312e81; }
.sensitive-head span { color: var(--muted); font-size: 13px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.sticky-actions { position: sticky; bottom: -18px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); padding: 12px 0 0; }

.payment-modal { width: min(980px, calc(100% - 24px)); background: #f8fafc; }
body.payment-open .topbar, body.payment-open .mobile-dock { display: none; }
.payment-head { margin-bottom: 10px; }
.pay-card { color: #fff; padding: clamp(14px, 3vw, 28px); border-radius: 28px; }
.pay-topline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.pay-topline div { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 18px; padding: 12px; }
.pay-topline span, .big-code-wrap span, .cvv-tile span { display: block; color: rgba(255,255,255,.65); font-size: 12px; font-weight: 900; margin-bottom: 5px; }
.pay-topline strong { font-size: clamp(17px, 3vw, 26px); }
.barcode-wrap { background: #fff; border-radius: 22px; padding: clamp(8px, 2vw, 14px); text-align: center; overflow: hidden; border: 1px solid rgba(255,255,255,.35); }
#barcodeCanvas { display: block; width: 100%; max-width: 1100px; height: auto; margin: 0 auto; }
.code-text { direction: ltr; font-size: clamp(28px, 10vw, 72px); font-weight: 1000; letter-spacing: 3px; word-break: break-all; color: #0f172a; }
.big-code-wrap, .cvv-tile { margin-top: 12px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 20px; padding: 14px; }
.big-code-wrap strong, .cvv-tile strong { display: block; direction: ltr; unicode-bidi: plaintext; font-size: clamp(22px, 6vw, 46px); letter-spacing: .08em; word-break: break-all; margin-bottom: 10px; }
.breakable { direction: ltr; unicode-bidi: plaintext; word-break: break-all; }
.cvv-tile { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.cvv-tile span { grid-column: 1 / -1; }
.cvv-tile strong { margin: 0; }
.notes { margin-top: 12px; white-space: pre-wrap; color: #334155; background: rgba(255,255,255,.78); border: 1px solid var(--border); border-radius: 16px; padding: 12px; }
.payment-actions { justify-content: center; }

.toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); right: 18px; z-index: 80; background: #0f172a; color: #fff; padding: 13px 16px; border-radius: 16px; box-shadow: var(--shadow); max-width: min(430px, calc(100vw - 36px)); font-weight: 800; }
.toast.error { background: var(--danger); }
code { direction: ltr; unicode-bidi: plaintext; background: #f1f5f9; border-radius: 8px; padding: 2px 6px; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at top, #ffffff, #eef2ff 42%, #f3f4f6 100%); }
.auth-card { width: min(460px, 100%); padding: 28px; background: var(--panel); box-shadow: var(--shadow); }
.auth-card.installer { width: min(720px, 100%); }
.brand-mark { font-size: 48px; line-height: 1; }
.auth-card h1 { margin: 12px 0 4px; }

.mobile-dock { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; display: none; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 22px; background: rgba(255,255,255,.86); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.mobile-dock button { padding: 11px 8px; border-radius: 16px; background: #fff; color: #0f172a; border: 1px solid var(--border); font-size: 13px; }

@media (max-width: 850px) {
  .unlock-layout { grid-template-columns: 1fr; }
  .hero-card { min-height: 320px; }
  .wallet-hero { align-items: start; flex-direction: column; }
  .stats-grid, .filter-line, .wizard-grid, .pay-topline { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .modal { inset: 8px; width: calc(100% - 16px); max-height: calc(100vh - 16px); border-radius: 20px; }
  .cvv-tile { grid-template-columns: 1fr; }
  .mobile-dock { display: grid; }
  .container { padding-bottom: 112px; }
}

@media (max-width: 520px) {
  .brand-badge { width: 40px; height: 40px; border-radius: 14px; }
  .topbar h1 { font-size: 18px; }
  .topbar p { font-size: 12px; }
  .compact { padding: 9px 10px; font-size: 12px; }
  .hero-card, .wallet-hero { padding: 22px; }
  .card-actions { grid-template-columns: 1fr; }
}
