:root {
  --blue: #0a6cff;
  --blue-600: #0058d6;
  --blue-50: #eef4ff;
  --blue-100: #dbe8ff;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #e5e9f0;
  --border-2: #d3dae5;
  --green: #12a150;
  --green-50: #e8f7ee;
  --red: #e5383b;
  --red-50: #fdecec;
  --amber: #f5a524;
  --radius: 16px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .1);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "IBM Plex Sans Arabic", -apple-system, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  max-width: 100vw;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 32px 20px 72px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.35; font-weight: 700; letter-spacing: -.2px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
::selection { background: var(--blue-100); }

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: #fff;
  transition: opacity .5s ease, visibility .5s ease;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { text-align: center; }
.splash-logo { width: 96px; height: 96px; border-radius: 50%; box-shadow: 0 12px 32px rgba(10, 108, 255, .25); animation: pop .7s var(--ease) both; }
.splash-title { font-size: 44px; margin: 18px 0 0; animation: rise .6s .15s var(--ease) both; }
.splash-slogan { font-size: 19px; margin: 0; color: var(--muted); animation: rise .6s .3s var(--ease) both; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 32px);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.brand.small { font-size: 16px; }
.brand.small img { width: 26px; height: 26px; border-radius: 8px; }
.nav { display: flex; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 10px; font-weight: 500; font-size: 15px; color: var(--muted);
  transition: color .2s, background .2s;
}
.nav a i { font-size: 18px; }
.nav a:hover { color: var(--text); background: #f1f4f8; }
.nav a.active { color: var(--blue); background: var(--blue-50); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid transparent; border-radius: 12px; padding: 11px 20px; color: var(--text);
  transition: background .2s, border-color .2s, box-shadow .2s, transform .1s;
}
.btn i { font-size: 18px; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .65; cursor: wait; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(10, 108, 255, .3); }
.btn-primary:hover { background: var(--blue-600); }
.btn-secondary { background: var(--surface); border-color: var(--border-2); }
.btn-secondary:hover { background: #f8fafc; border-color: #c2cbd8; }
.btn-soft { background: #f1f4f8; padding: 9px 16px; font-size: 14px; }
.btn-soft:hover { background: #e7ebf1; }
.btn-block { width: 100%; margin-top: 28px; }
.btn-lg { font-size: 17px; padding: 15px; border-radius: 14px; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Home ---------- */
#view-home { max-width: 720px; margin: 0 auto; }
.home-head { padding: 26px 0 20px; }
.home-head small { color: var(--muted); font-size: 14px; font-weight: 500; }
.home-head h1 { font-size: clamp(28px, 5vw, 36px); margin: 2px 0 2px; letter-spacing: -.4px; line-height: 1.35; }
.home-head p { margin: 0; color: var(--muted); font-size: 16px; }

.today-card {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 22px; border-radius: 22px; color: #fff; background: var(--blue);
  box-shadow: 0 10px 28px rgba(10, 108, 255, .22); position: relative; overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s, opacity .6s var(--ease);
}
.today-card::after {
  content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%;
  inset-inline-end: -70px; top: -90px; background: rgba(255, 255, 255, .09); pointer-events: none;
}
.today-card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(10, 108, 255, .28); }
.today-card > div { display: flex; flex-direction: column; }
.today-card > div > span { font-size: 14px; color: rgba(255, 255, 255, .85); font-weight: 500; }
.today-card b { font-size: 34px; line-height: 1.3; align-self: flex-start; }
.today-card b small { font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, .8); }
.today-card > div > small { font-size: 13px; color: rgba(255, 255, 255, .75); }
.today-link {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; position: relative; z-index: 1;
  padding: 7px 14px; border-radius: 99px; font-size: 14px; font-weight: 600; background: rgba(255, 255, 255, .18);
}

.home-label { font-size: 17px; margin: 28px 0 12px; }
.quick { display: grid; gap: 10px; }
.quick-item {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s, transform .25s var(--ease), opacity .6s var(--ease);
}
.quick-item:hover { border-color: var(--blue-100); box-shadow: var(--shadow); }
.quick-item:active { transform: scale(.985); }
.quick-ico { width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--blue-50); color: var(--blue); }
.quick-ico.green { background: var(--green-50); color: var(--green); }
.quick-ico.violet { background: #eef2ff; color: #4f6ef7; }
.quick-ico.amber { background: #fff4e0; color: #d98a0b; }
.quick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.quick-text b { font-size: 16px; font-weight: 600; }
.quick-text small { color: var(--muted); font-size: 14px; }
.quick-go { color: #a3afc0; font-size: 16px; transition: transform .25s var(--ease), color .2s; }
.quick-item:hover .quick-go { color: var(--blue); transform: translateX(-3px); }
html[dir="ltr"] .quick-item:hover .quick-go { transform: scaleX(-1) translateX(-3px); }

.tip-card {
  display: flex; gap: 14px; align-items: flex-start; margin-top: 16px; padding: 16px 18px;
  border-radius: 18px; background: #fffaf0; border: 1px solid #f6e7c8;
}
.tip-ico { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: #fff0cf; color: #d98a0b; }
.tip-card b { font-size: 14px; color: #a86a05; }
.tip-card p { margin: 2px 0 0; color: var(--text-2); font-size: 15px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--blue-50); color: var(--blue);
}
.accent { color: var(--blue); }

.how { margin-top: 64px; text-align: center; }
.section-title { font-size: 24px; margin: 0 0 20px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.step { position: relative; padding: 24px 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.step > i { font-size: 32px; color: var(--blue); }
.step h3 { margin: 8px 0 0; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.step-num {
  position: absolute; top: 12px; inset-inline-start: 12px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; background: #f1f4f8; color: var(--muted);
}

/* ---------- Page head & panel ---------- */
.page-head { display: flex; align-items: center; gap: 16px; margin: 4px 0 22px; }
.page-head h1 { margin: 0; font-size: clamp(24px, 4vw, 30px); }
.page-head p { margin: 0; color: var(--muted); }
.page-icon { flex-shrink: 0; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; background: var(--blue); color: #fff; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 32px);
  box-shadow: var(--shadow);
}
.panel-step { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; margin: 26px 0 12px; }
.panel-step:first-child { margin-top: 0; }
.panel-step span {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; background: var(--blue-50); color: var(--blue);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 24px; }

/* ---------- Inputs ---------- */
input, select {
  font: inherit; color: var(--text);
  padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--border-2); background: #fff;
  outline: none; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder { color: #94a3b8; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 108, 255, .15); }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; }
.field { position: relative; margin-top: 16px; }
.field > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.input-wrap { position: relative; }
.input-wrap > i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); font-size: 20px; color: #94a3b8; pointer-events: none; }
.input-wrap input { padding-inline-start: 44px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; color: var(--text-2);
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-2); background: #fff;
  transition: background .2s, border-color .2s, color .2s;
}
.chip i { font-size: 18px; color: var(--muted); transition: color .2s; }
.chip:hover { border-color: #b8c3d3; background: #fafbfd; }
.chip.active { background: var(--blue-50); border-color: var(--blue); color: var(--blue); }
.chip.active i { color: var(--blue); }

.segmented { display: flex; padding: 3px; border-radius: 12px; background: #f1f4f8; }
.segmented button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 500; font-size: 14px; color: var(--muted); cursor: pointer;
  padding: 9px; border: none; border-radius: 10px; background: none; transition: all .2s;
}
.segmented button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

/* Upload */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 36px 20px; border-radius: var(--radius); cursor: pointer; text-align: center;
  border: 1.5px dashed var(--border-2); background: #fafbfd;
  transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: var(--blue-50); }
.dz-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; background: #fff; color: var(--blue); box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 8px; }
.dropzone strong { font-size: 16px; font-weight: 600; }
.dropzone span { color: var(--muted); font-size: 14px; }
.dz-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 10px; }
.counter { color: var(--muted); font-size: 14px; }
.counter b { color: var(--text); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 14px; }
.thumb {
  position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: #f1f4f8; border: 1px solid var(--border);
  animation: fadeIn .3s ease both;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .num {
  position: absolute; bottom: 6px; inset-inline-start: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .92); color: var(--text);
}
.thumb .del {
  position: absolute; top: 6px; inset-inline-end: 6px; width: 26px; height: 26px; border: none; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--text); font-size: 13px;
  background: rgba(255, 255, 255, .92); box-shadow: var(--shadow-sm); transition: background .2s, color .2s;
}
.thumb .del:hover { background: var(--red); color: #fff; }
.thumbs-head { margin-top: 18px; font-size: 14px; }
.thumbs-head + .thumbs { margin-top: 8px; }

.save-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.save-row .switch { width: 42px; height: 26px; }
.save-row .switch span::after { width: 20px; height: 20px; }
html[dir="rtl"] .save-row .switch input:checked + span::after { transform: translateX(-16px); }
html[dir="ltr"] .save-row .switch input:checked + span::after { transform: translateX(16px); }

.wardrobe { margin-top: 18px; padding: 14px; border-radius: 16px; background: #f8fafc; border: 1px solid var(--border); }
.wardrobe-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wardrobe-head b { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.wardrobe-head b i { color: var(--blue); font-size: 18px; }
.wardrobe-head small { min-width: 22px; padding: 0 7px; border-radius: 99px; background: var(--blue-50); color: var(--blue); font-size: 12px; text-align: center; }
.wardrobe-hint { margin: 2px 0 10px; font-size: 13px; color: var(--muted); }
.wardrobe-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px;
  max-height: 290px; overflow-y: auto; padding: 2px; margin: -2px;
}
.w-item {
  position: relative; aspect-ratio: 1; padding: 0; border-radius: 12px; overflow: hidden; cursor: pointer;
  background: #fff; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--border);
  transition: border-color .15s, transform .15s var(--ease);
}
.w-item:active { transform: scale(.96); }
.w-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.w-item.on { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 108, 255, .15); }
.w-item .num {
  position: absolute; top: 5px; inset-inline-start: 5px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--blue); color: #fff;
}
.w-cat {
  position: absolute; bottom: 5px; inset-inline-end: 5px; width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center; font-size: 12px; background: rgba(255, 255, 255, .92); color: var(--text-2);
}
.w-del {
  position: absolute; inset: 0; display: none; place-items: center; font-size: 22px; color: #fff;
  background: rgba(229, 56, 59, .55);
}
.wardrobe.editing .w-del { display: grid; }
.wardrobe.editing .w-item { animation: wiggle .3s ease; }
@keyframes wiggle { 30% { transform: rotate(-2deg); } 70% { transform: rotate(2deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Budget */
.budget-box { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.budget-input {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px;
  padding: 5px; padding-inline-start: 16px; border-radius: 14px;
  border: 1px solid var(--border-2); background: #fff; transition: border-color .2s, box-shadow .2s;
}
.budget-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 108, 255, .15); }
.budget-input > i { font-size: 24px; color: var(--blue); }
.budget-input input { border: none; box-shadow: none; font-size: 24px; font-weight: 700; padding: 8px 4px; }
.budget-input input:focus { box-shadow: none; }
.cur-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: 15px; color: var(--text); cursor: pointer;
  padding: 9px 11px; border: none; border-radius: 10px; background: #f1f4f8; transition: background .15s;
}
.cur-btn:hover { background: #e7ecf3; }
.cur-btn img { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.cur-btn i { font-size: 13px; color: var(--muted); }
#currencySheet { z-index: 280; }
#currencySheet .cdial { font-weight: 600; font-family: Inter, sans-serif; }
.presets { display: flex; gap: 6px; }
.presets button {
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text-2);
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border-2); background: #fff; transition: all .2s;
}
.presets button:hover { background: #fafbfd; }
.presets button.active { color: var(--blue); border-color: var(--blue); background: var(--blue-50); }

.stepper { display: flex; align-items: center; justify-content: space-between; padding: 5px; border-radius: 14px; border: 1px solid var(--border-2); background: #fff; }
.stepper button {
  width: 40px; height: 40px; border-radius: 10px; border: none; cursor: pointer;
  background: #f1f4f8; color: var(--text); font-size: 16px; display: grid; place-items: center; transition: background .2s;
}
.stepper button:hover { background: #e7ebf1; }
.stepper div { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.stepper div i { color: var(--blue); font-size: 22px; }
.stepper b { min-width: 22px; text-align: center; }

.loc-btn {
  position: relative; width: 100%; display: flex; align-items: center; gap: 10px;
  font: inherit; font-weight: 500; color: var(--text); cursor: pointer; text-align: start;
  padding: 13px 16px; border-radius: 14px; border: 1px solid var(--border-2); background: #fff;
  transition: border-color .2s, background .2s;
}
.loc-btn i { font-size: 20px; color: var(--blue); }
.loc-btn:hover { border-color: var(--blue); }
.loc-dot { position: absolute; inset-inline-end: 16px; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.loc-btn.loading .loc-dot { background: var(--amber); animation: blink 1s infinite; }
.loc-btn.ok { border-color: var(--green); background: var(--green-50); }
.loc-btn.ok .loc-dot { background: var(--green); }
.loc-btn.ok i { color: var(--green); }
@keyframes blink { 50% { opacity: .3; } }

.country-pick {
  width: 100%; display: flex; align-items: center; gap: 12px;
  font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-align: start;
  padding: 12px 16px; border-radius: 14px; border: 1px solid var(--border-2); background: #fff;
  transition: border-color .2s, background .2s;
}
.country-pick:hover { border-color: var(--blue); }
.country-pick img { width: 28px; height: 20px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.country-pick span { flex: 1; }
.country-pick i { font-size: 16px; color: var(--muted); }
#countrySheet.names-only .cdial { display: none; }

.book-steps { margin: 4px 0 8px; padding-inline-start: 22px; }
.book-steps li { margin: 8px 0; color: var(--text-2); }
.exp-ico.event { background: #eef2ff; color: #4f6ef7; }

/* ---------- Loading ---------- */
.result-area { scroll-margin-top: 80px; }
.loader { margin-top: 24px; padding: 40px 24px; text-align: center; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); animation: fadeIn .3s ease both; }
.orb {
  position: relative; width: 64px; height: 64px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--blue-50);
}
.orb::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--blue); border-right-color: var(--blue); animation: spin .9s linear infinite; }
.orb i { font-size: 28px; line-height: 1; color: var(--blue); animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); } }
.loader-msg { font-weight: 600; font-size: 17px; min-height: 30px; transition: opacity .25s; }
.loader-steps { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.loader-steps span {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted);
  padding: 5px 12px; border-radius: 999px; background: #f1f4f8; transition: all .3s;
}
.loader-steps span.now { color: var(--blue); background: var(--blue-50); }
.loader-steps span.now i { animation: spin 1s linear infinite; }
.loader-steps span.done { color: var(--green); background: var(--green-50); }
.loader-bar { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeletons { display: grid; gap: 14px; margin-top: 14px; }
.skeleton { height: 140px; border-radius: var(--radius-lg); background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 50%, #eef1f5 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.error-box {
  margin-top: 24px; display: flex; gap: 14px; align-items: flex-start;
  padding: 20px; border-radius: var(--radius-lg); background: #fff; border: 1px solid #f5c2c3;
  animation: fadeIn .3s ease both;
}
.error-box > i { font-size: 28px; color: var(--red); }
.error-box h4 { margin: 0; font-size: 16px; }
.error-box p { margin: 2px 0 12px; color: var(--muted); }

/* ---------- Results ---------- */
.result-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 40px 0 16px; }
.result-head h2 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 8px; }
.result-head h2 i { color: var(--blue); }
.results { display: grid; gap: 16px; }
.anim-in { opacity: 0; animation: cardIn .5s var(--ease) forwards; }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.card {
  position: relative; border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 24px);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.card.best { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50), var(--shadow); }
.ribbon {
  position: absolute; top: -11px; inset-inline-start: 20px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--blue); color: #fff;
}

.info-banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; border-radius: var(--radius); margin-top: 14px;
  background: var(--blue-50); color: var(--text-2); font-size: 15px;
}
.info-banner > i { font-size: 22px; color: var(--blue); flex-shrink: 0; margin-top: 2px; }
.info-banner.purple { background: #f4f6f9; }
.info-banner.purple > i { color: var(--text-2); }

/* Outfit */
.outfit-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.outfit-top h3 { margin: 0; font-size: 19px; }
.vibe { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: var(--muted); }
.score-ring {
  --p: 80; flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--blue) calc(var(--p) * 1%), #e8edf4 0);
}
.score-ring span { width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; line-height: 1; }
.score-ring small { font-size: 10px; color: var(--muted); font-weight: 500; }
.look { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin: 18px 0; }
.look-item { text-align: center; }
.look-item .img { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #f1f4f8; border: 1px solid var(--border); }
.look-item img { width: 100%; height: 100%; object-fit: cover; }
.look-item b { display: block; font-size: 14px; font-weight: 600; margin-top: 8px; line-height: 1.4; }
.look-item small { color: var(--muted); font-size: 12px; }
.palette { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.palette span { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(15, 23, 42, .12); }
.note { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; }
.note i { font-size: 20px; flex-shrink: 0; margin-top: 3px; color: var(--blue); }
.note.tip i { color: var(--muted); }
.note p { margin: 0; color: var(--text-2); }

/* Places */
.toolbar { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: #eef1f5; }
.toolbar button {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer;
  padding: 6px 12px; border: none; border-radius: 9px; background: none; transition: all .2s;
}
.toolbar button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.place-top { display: flex; gap: 14px; align-items: flex-start; }
.rank {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 700; font-size: 17px; background: #f1f4f8; color: var(--text-2);
}
.card.best .rank { background: var(--blue); color: #fff; }
.place-main { flex: 1; min-width: 0; }
.place-main h3 { margin: 0; font-size: 18px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 14px; margin-top: 4px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta i { font-size: 15px; }
.meta .star { color: var(--text-2); }
.meta .star i { color: var(--amber); }
.meta .open { color: var(--green); }
.meta .closed { color: var(--red); }
.meta .open i, .meta .closed i { font-size: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #f1f4f8; color: var(--text-2); }
.price { text-align: center; flex-shrink: 0; }
.price strong { display: block; font-size: 22px; line-height: 1.2; color: var(--text); }
.price small { color: var(--muted); font-size: 12px; }
.place-why { color: var(--text-2); margin: 12px 0 0; font-size: 15px; }

.budget-meter { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #f8fafc; }
.budget-meter .row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.budget-meter .row b { color: var(--text); }
.meter { height: 6px; border-radius: 99px; background: #e5e9f0; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--green); transition: width 1s var(--ease); }
.meter.over i { background: var(--red); }
.fit { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; }
.fit.yes { color: var(--green); }
.fit.no { color: var(--red); }

.tabs { display: flex; gap: 4px; margin-top: 16px; border-bottom: 1px solid var(--border); }
.tabs button {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 500; font-size: 14px; color: var(--muted); cursor: pointer;
  padding: 10px 12px; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s, border-color .2s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-panel { padding-top: 10px; animation: fadeIn .25s ease both; }
.menu-section { font-weight: 600; color: var(--blue); font-size: 13px; margin: 12px 0 2px; }
.menu-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f0f2f6; font-size: 15px; }
.menu-row:last-child { border-bottom: none; }
.menu-row span:last-child { white-space: nowrap; font-weight: 600; }
.menu-row.total { font-weight: 700; border-top: 1px solid var(--border); border-bottom: none; margin-top: 2px; padding-top: 12px; }
.menu-row.total span:last-child { color: var(--blue); }
.fine { color: var(--muted); font-size: 12px; margin-top: 8px; }
.empty-tab { color: var(--muted); display: flex; align-items: center; gap: 8px; padding: 10px 0; font-size: 14px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.actions .btn i { font-size: 16px; }
.actions .btn-icon { padding-inline: 13px; }
.actions .btn-icon i { font-size: 18px; }
.map-frame { margin: 0 -4px; height: 300px; border-radius: 16px; overflow: hidden; background: #eef2f7; border: 1px solid var(--border); }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

.sources { font-size: 13px; color: var(--muted); margin-top: 18px; }
.sources a { color: var(--blue); }

/* ---------- Toasts / to-top / footer ---------- */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: max-content; max-width: 92vw; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 12px; font-weight: 500; font-size: 14px;
  background: #0f172a; color: #fff; box-shadow: var(--shadow-lg);
  animation: rise .3s var(--ease) both;
}
.toast i { font-size: 20px; color: #7fb2ff; }
.toast.success i { color: #4ade80; }
.toast.out { animation: fadeOut .3s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateY(6px); } }

.to-top {
  position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 30;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); cursor: pointer;
  background: #fff; color: var(--text); font-size: 18px; box-shadow: var(--shadow);
  display: grid; place-items: center;
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: all .25s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--blue); }

/* ---------- Language / direction ---------- */
html[lang="en"] body { font-family: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif; }
html[dir="ltr"] .flip { transform: scaleX(-1); }
html[dir="ltr"] .feature:hover .feature-cta i { transform: scaleX(-1) translateX(-4px); }

/* ---------- Small controls ---------- */
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: none; cursor: pointer;
  display: grid; place-items: center; font-size: 20px; color: var(--text); background: #f1f4f8;
  transition: background .2s;
}
.icon-btn:hover { background: #e7ebf1; }
.link-btn {
  font: inherit; font-weight: 600; font-size: 14px; color: var(--blue); cursor: pointer;
  border: none; background: none; padding: 8px 4px;
}
.link-btn:disabled { color: var(--muted); cursor: default; }
.link-btn.center { display: block; margin: 8px auto 0; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 14px; color: var(--text-2); cursor: pointer;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border-2); background: #fff;
  transition: border-color .2s, color .2s;
}
.lang-btn:hover { border-color: var(--blue); color: var(--blue); }
.lang-btn i { font-size: 17px; }
.btn.loading { pointer-events: none; }
.btn.loading > i { display: none; }
.btn.loading::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; opacity: .9;
  animation: spin .8s linear infinite;
}

/* ---------- Gate (intro + auth) ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  background: #fff;
  padding: 0 0 env(safe-area-inset-bottom);
}
.gate-top { display: flex; align-items: center; gap: 10px; padding: 14px 20px; padding-top: calc(14px + env(safe-area-inset-top)); }
.gate-spacer { flex: 1; }
.screen {
  flex: 1; display: flex; flex-direction: column;
  width: 100%; max-width: 440px; margin: 0 auto; padding: 0 24px 24px; min-height: 0;
}
.screen.enter { animation: screenIn .45s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.gate-bottom { display: grid; gap: 10px; padding-top: 16px; }
.gate-bottom .btn-block { margin-top: 0; }

.slides { position: relative; flex: 1; min-height: 380px; }
.slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  opacity: 0; transform: translateX(-40px); pointer-events: none;
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
html[dir="ltr"] .slide { transform: translateX(40px); }
.slide.before { transform: translateX(40px); }
html[dir="ltr"] .slide.before { transform: translateX(-40px); }
.slide.active { opacity: 1; transform: none; pointer-events: auto; }
.slide h2 { font-size: 26px; margin: 34px 0 8px; }
.slide p { color: var(--muted); font-size: 16px; margin: 0; max-width: 330px; }

.art { position: relative; width: 210px; height: 210px; display: grid; place-items: center; }
.art-ring { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, var(--blue-50) 0%, var(--blue-50) 58%, transparent 59%), radial-gradient(circle, transparent 66%, #f3f7ff 67%); }
.art-main {
  position: relative; width: 104px; height: 104px; border-radius: 32px;
  display: grid; place-items: center; font-size: 54px; color: #fff; background: var(--blue);
  box-shadow: 0 18px 40px rgba(10, 108, 255, .3);
}
.art-chip {
  position: absolute; width: 46px; height: 46px; border-radius: 15px;
  display: grid; place-items: center; font-size: 22px; color: var(--blue);
  background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .1);
  animation: floaty 4s ease-in-out infinite;
}
.art-chip.c1 { top: 12px; inset-inline-start: 6px; }
.art-chip.c2 { bottom: 18px; inset-inline-end: 0; animation-delay: -1.3s; }
.art-chip.c3 { top: 30px; inset-inline-end: 4px; width: 36px; height: 36px; font-size: 17px; border-radius: 12px; animation-delay: -2.6s; }
@keyframes floaty { 50% { transform: translateY(-8px); } }

.dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.dots span { width: 7px; height: 7px; border-radius: 99px; background: #d6deea; cursor: pointer; transition: width .3s var(--ease), background .3s; }
.dots span.active { width: 24px; background: var(--blue); }

.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.welcome-logo { width: 92px; height: 92px; border-radius: 50%; box-shadow: 0 14px 34px rgba(10, 108, 255, .25); }
.welcome h2 { font-size: 28px; margin: 26px 0 6px; }
.welcome p { color: var(--muted); margin: 0; max-width: 320px; }
.terms { text-align: center; color: var(--muted); font-size: 12px; margin: 4px 0 0; }

.form-screen { flex: 1; padding-top: 8px; }
.screen-icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  font-size: 30px; color: #fff; background: var(--blue); box-shadow: 0 10px 24px rgba(10, 108, 255, .3);
}
.form-screen h2 { font-size: 26px; margin: 20px 0 4px; }
.form-screen > p { color: var(--muted); margin: 0 0 8px; }
.form-screen .field { margin-top: 18px; }

.phone-input {
  display: flex; align-items: stretch; border: 1px solid var(--border-2); border-radius: 12px; background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.phone-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 108, 255, .15); }
.phone-input input { border: none; box-shadow: none !important; font-size: 17px; letter-spacing: .5px; }
.country-btn {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
  padding: 0 12px; border: none; border-right: 1px solid var(--border); background: #f8fafc; border-radius: 12px 0 0 12px;
}
.country-btn img { width: 24px; height: 17px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.country-btn i { font-size: 12px; color: var(--muted); }

.otp { display: flex; gap: 8px; justify-content: center; margin: 26px 0 10px; }
.otp input {
  width: 48px; height: 56px; padding: 0; text-align: center;
  font-size: 22px; font-weight: 700; border-radius: 12px;
}
.otp input:valid { border-color: var(--blue); background: var(--blue-50); }
.otp input:focus { border-color: var(--blue); }
.otp.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.otp-meta { display: flex; justify-content: space-between; align-items: center; }

/* Country sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 250;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15, 23, 42, 0); transition: background .25s;
}
.sheet-backdrop.open { background: rgba(15, 23, 42, .4); }
.sheet {
  width: 100%; max-width: 480px; max-height: 80vh; display: flex; flex-direction: column; gap: 12px;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  background: #fff; border-radius: 22px 22px 0 0;
  transform: translateY(100%); transition: transform .3s var(--ease);
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: #dde3ec; margin: 0 auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h3 { margin: 0; font-size: 18px; }
.country-list { overflow-y: auto; margin: 0 -8px; }
.country-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  font: inherit; color: var(--text); cursor: pointer; text-align: start;
  padding: 11px 10px; border: none; border-radius: 12px; background: none; transition: background .15s;
}
.country-row:hover { background: #f4f6f9; }
.country-row.active { background: var(--blue-50); }
.country-row img { width: 28px; height: 20px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.country-row .cname { flex: 1; font-weight: 500; }
.country-row .cdial { color: var(--muted); font-size: 14px; }
.country-row i { color: var(--blue); }
@media (min-width: 641px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 22px; transform: translateY(20px) scale(.98); opacity: 0; transition: transform .25s var(--ease), opacity .25s; }
  .sheet-backdrop.open .sheet { transform: none; opacity: 1; }
}

/* Top bar actions & user menu */
.top-actions { display: flex; align-items: center; gap: 8px; }
.lang-btn.compact { padding: 6px 10px; }
.user-menu { position: relative; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  display: grid; place-items: center; font: inherit; font-weight: 700; font-size: 15px;
  color: #fff; background: var(--blue);
}
.menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 50;
  min-width: 220px; padding: 6px; border-radius: 14px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: rise .2s var(--ease) both;
}
.menu-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-head b { display: block; }
.menu-head small { color: var(--muted); }
.menu button, .menu-link {
  width: 100%; display: flex; align-items: center; gap: 10px;
  font: inherit; font-size: 14px; color: var(--text); cursor: pointer; text-align: start;
  padding: 10px 12px; border: none; border-radius: 10px; background: none;
}
.menu button:hover, .menu-link:hover { background: #f4f6f9; }
.menu button i, .menu-link i { font-size: 18px; color: var(--muted); }

/* ---------- About ---------- */
#view-about { max-width: 600px; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 14px; padding: 6px 0; }
.back-link:hover { color: var(--blue); }
.about-hero { text-align: center; padding: 18px 0 26px; }
.about-logo { width: 104px; height: 104px; border-radius: 50%; box-shadow: 0 14px 34px rgba(10, 108, 255, .25); }
.about-hero h1 { margin: 14px 0 0; font-size: 30px; }
.about-hero p { margin: 0; color: var(--muted); font-size: 16px; }
.about-version { display: inline-block; margin-top: 10px; padding: 3px 12px; border-radius: 99px; background: var(--blue-50); color: var(--blue); font-size: 12px; font-weight: 600; }

.about-made {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
}
.about-flags { display: flex; flex-shrink: 0; }
.about-flags img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .12); }
.about-flags img + img { margin-inline-start: -12px; }
.about-made b { display: block; font-size: 15px; }
.about-made small { color: var(--muted); font-size: 13px; }

.team { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.member {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: 22px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
}
.member-avatar {
  width: 64px; height: 64px; margin-bottom: 10px; border-radius: 50%; display: grid; place-items: center;
  font-size: 26px; font-weight: 700; color: #fff; background: var(--blue); box-shadow: 0 8px 20px rgba(10, 108, 255, .25);
}
.member-avatar.pink { background: #e8548c; box-shadow: 0 8px 20px rgba(232, 84, 140, .25); }
.member b { font-size: 16px; }
.member small { color: var(--muted); font-size: 13px; }

.about-message {
  position: relative; margin-top: 16px; padding: 24px 22px 20px; border-radius: 20px;
  background: var(--blue-50); border: 1px solid var(--blue-100);
}
.about-message > i { position: absolute; top: 16px; inset-inline-end: 18px; font-size: 34px; color: var(--blue-100); }
.about-message h3 { margin: 0 0 8px; font-size: 17px; color: var(--blue); }
.about-message p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.9; }
.about-copy { text-align: center; color: var(--muted); font-size: 13px; margin: 26px 0 0; }
.menu .danger, .menu .danger i { color: var(--red); }
.muted-banner { background: #f4f6f9; }
.muted-banner > i { color: var(--text-2); }

/* ---------- Spending ---------- */
.stats { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat {
  padding: 18px; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 4px;
}
.stat span { color: var(--muted); font-size: 14px; font-weight: 500; }
.stat b { font-size: 24px; line-height: 1.25; align-self: flex-start; }
.stat b small { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat.main { background: var(--blue); border-color: var(--blue); color: #fff; }
.stat.main span, .stat.main b small { color: rgba(255, 255, 255, .8); }
.stat.main b { font-size: 30px; }

.panel + .panel, .stats + .panel { margin-top: 16px; }
.panel-title { margin: 0 0 14px; font-size: 16px; }
.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 170px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar-val { font-size: 11px; color: var(--muted); font-weight: 600; min-height: 16px; }
.bar-track { flex: 1; width: 100%; max-width: 34px; display: flex; align-items: flex-end; border-radius: 10px; background: #f1f4f8; overflow: hidden; }
.bar-track i { display: block; width: 100%; border-radius: 10px; background: var(--blue-100); transition: height .8s var(--ease); }
.bar.is-today .bar-track i { background: var(--blue); }
.bar.is-today .bar-day { color: var(--blue); font-weight: 700; }
.bar-day { font-size: 12px; color: var(--muted); white-space: nowrap; }

.report-panel { display: flex; align-items: center; gap: 14px; }
.report-ico { width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--blue-50); color: var(--blue); }
.report-text { flex: 1; min-width: 0; }
.report-text b { display: block; }
.report-text small { color: var(--muted); font-size: 13px; }
.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #d6deea; transition: background .25s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .2); transition: transform .25s var(--ease);
}
.switch input:checked + span { background: var(--blue); }
html[dir="rtl"] .switch input:checked + span::after { transform: translateX(-20px); }
html[dir="ltr"] .switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(10, 108, 255, .25); }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 10px; }
.list-head h3 { margin: 0; font-size: 18px; }
.list-head .btn { padding: 9px 16px; font-size: 14px; }
.expense-list { display: grid; gap: 8px; }
.day-head { font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 4px 0; }
.expense {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  animation: fadeIn .3s ease both;
}
.exp-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: #f1f4f8; color: var(--text-2); }
.exp-ico.place { background: var(--blue-50); color: var(--blue); }
.exp-main { flex: 1; min-width: 0; }
.exp-main b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-main small { color: var(--muted); font-size: 12px; }
.exp-amount {
  font: inherit; font-weight: 700; font-size: 16px; color: var(--text); cursor: pointer;
  border: none; background: none; padding: 6px 8px; border-radius: 10px; white-space: nowrap;
}
.exp-amount:hover { background: #f1f4f8; }
.exp-amount small { color: var(--muted); font-size: 12px; font-weight: 600; }
.icon-btn.small { width: 34px; height: 34px; font-size: 17px; background: none; color: var(--muted); }
.icon-btn.small:hover { background: var(--red-50); color: var(--red); }
.empty-state { text-align: center; padding: 36px 20px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--radius-lg); }
.empty-state i { font-size: 36px; color: #b6c2d3; }
.empty-state p { margin: 8px auto 0; max-width: 360px; font-size: 14px; }

.btn-done { background: var(--green-50); color: var(--green); cursor: default; }
.btn-done:disabled { opacity: 1; cursor: default; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #c92f32; }

/* ---------- Dialog ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 260;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, 0); transition: background .2s;
}
.modal-backdrop.open { background: rgba(15, 23, 42, .45); }
.modal {
  width: 100%; max-width: 400px; padding: 24px; border-radius: 22px; background: #fff; box-shadow: var(--shadow-lg);
  text-align: center; opacity: 0; transform: scale(.96) translateY(8px); transition: opacity .2s, transform .25s var(--ease);
}
.modal-backdrop.open .modal { opacity: 1; transform: none; }
.modal-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; font-size: 28px; background: var(--blue-50); color: var(--blue); }
.modal-icon.danger { background: var(--red-50); color: var(--red); }
.modal h3 { margin: 0; font-size: 19px; }
.modal p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
#modalBody { text-align: start; }
#modalBody:not(:empty) { margin-top: 16px; }
.modal-label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
.modal-label:first-child { margin-top: 0; }
.amount-field { display: flex; align-items: center; border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.amount-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 108, 255, .15); }
.amount-field input { border: none; box-shadow: none !important; font-size: 22px; font-weight: 700; }
.amount-field .cur-btn { align-self: stretch; border-radius: 0; padding: 0 14px; }
.amount-field > span { flex-shrink: 0; width: auto; border: none; border-radius: 0; padding: 0 14px; align-self: stretch; display: flex; align-items: center; background: #f1f4f8; font-weight: 600; color: var(--text-2); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.modal-actions .btn { padding: 13px; }

/* ---------- Home: guide & install cards ---------- */
.guide-card, .install-card {
  width: 100%; display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 16px;
  font: inherit; color: inherit; text-align: start; cursor: pointer;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s, transform .25s var(--ease), opacity .6s var(--ease);
}
.guide-card:hover { border-color: var(--blue-100); box-shadow: var(--shadow); }
.guide-card:hover .quick-go { color: var(--blue); }
.guide-card:active { transform: scale(.985); }
.guide-thumb {
  position: relative; width: 76px; height: 54px; flex-shrink: 0; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center; background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
}
.guide-thumb img { width: 34px; height: 34px; border-radius: 50%; opacity: .55; }
.guide-play {
  position: absolute; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue); color: #fff; font-size: 13px; box-shadow: 0 4px 12px rgba(10, 108, 255, .4);
  animation: playPulse 2.2s ease-in-out infinite;
}
@keyframes playPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(10, 108, 255, .35); } 50% { box-shadow: 0 0 0 8px rgba(10, 108, 255, 0); } }
.install-card { cursor: default; background: linear-gradient(135deg, #fff, var(--blue-50)); border-color: var(--blue-100); padding-inline-end: 10px; }
.install-card img { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; }
.install-card .btn { padding: 9px 16px; font-size: 14px; flex-shrink: 0; }
.install-card .icon-btn.small:hover { background: #f1f4f8; color: var(--text); }
.install-other { margin: 0; color: var(--text-2); font-size: 15px; text-align: center; }

/* ---------- Video guide ---------- */
.guide {
  position: fixed; inset: 0; z-index: 300; display: flex; justify-content: center;
  background: linear-gradient(180deg, #eef4ff 0%, #fff 60%);
  opacity: 0; transition: opacity .25s;
}
.guide.open { opacity: 1; }
.guide-inner {
  width: 100%; max-width: 480px; display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
}
.guide-top { display: flex; align-items: center; gap: 12px; }
.guide-bars { flex: 1; display: flex; gap: 4px; direction: ltr; }
html[dir="rtl"] .guide-bars { flex-direction: row-reverse; }
.guide-bars span { flex: 1; height: 4px; border-radius: 99px; background: rgba(10, 108, 255, .15); overflow: hidden; }
.guide-bars i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 99px; }
html[dir="rtl"] .guide-bars i { margin-left: auto; }
.guide-bars span.done i { width: 100%; }
.guide-bars span.active i { animation: guideBar 5.5s linear forwards; }
.guide.paused .guide-bars span.active i, .guide.paused .g-scene * { animation-play-state: paused !important; }
@keyframes guideBar { to { width: 100%; } }

.guide { background: #fff; }
.guide-top .icon-btn { width: 38px; height: 38px; background: #f1f4f8; }
.guide-stage {
  flex: 1; position: relative; min-height: 0; max-height: 480px; margin: 16px 0 20px; overflow: hidden;
  border-radius: 28px; background: linear-gradient(160deg, #eef4ff 0%, #f7faff 100%); border: 1px solid #e3ecfb;
  cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
.guide-stage::after {
  content: "\23F8"; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; display: grid; place-items: center; font-size: 26px; color: #fff; background: rgba(15, 23, 42, .45);
  opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s; pointer-events: none;
}
.guide.paused .guide-stage::after { opacity: 1; transform: none; }
.g-scene {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px;
  opacity: 0; transform: scale(.96); transition: opacity .35s, transform .45s var(--ease); pointer-events: none;
}
.g-scene.active { opacity: 1; transform: none; }

.guide-bottom { text-align: center; }
.guide-step { display: inline-block; padding: 3px 12px; border-radius: 99px; background: var(--blue-50); color: var(--blue); font-size: 12px; font-weight: 600; }
.guide-bottom h2 { margin: 10px 0 6px; font-size: 22px; line-height: 1.4; }
.guide-bottom p { margin: 0 auto; max-width: 380px; min-height: 78px; color: var(--muted); font-size: 15px; line-height: 1.75; }
.guide-foot { height: 52px; margin-top: 12px; display: flex; align-items: center; justify-content: center; }
.guide-hint { display: inline-flex; align-items: center; gap: 6px; color: #94a3b8; font-size: 13px; }
.guide-hint i { font-size: 17px; }
.guide-finish { width: 100%; height: 52px; font-size: 16px; animation: gSlideUp .4s var(--ease) both; }
.ios-link {
  width: 100%; margin-top: 14px; padding: 12px; border: none; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--blue); background: var(--blue-50);
}
.ios-link i { font-size: 18px; }

/* Safari install scenes */
.s-safari { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 99px; background: #fff; box-shadow: 0 4px 14px rgba(15, 23, 42, .08); font-size: 14px; }
.s-safari i { font-size: 22px; color: #1a8cff; }
.s-phone {
  position: relative; width: 210px; height: 300px; flex-shrink: 0; overflow: hidden;
  border-radius: 30px; border: 7px solid #1f2937; background: #f4f6f9; box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}
.s-phone.s-white { background: #f2f2f7; }
.s-page { padding: 16px 14px; display: grid; gap: 8px; }
.s-page i { display: block; height: 8px; border-radius: 99px; background: #dfe5ee; }
.s-page i.w60 { width: 60%; height: 12px; background: #c9d6ea; }
.s-page i.w80 { width: 80%; }
.s-page i.w40 { width: 40%; }
.s-page i.box { height: 70px; border-radius: 12px; background: #e6edf8; }
.s-address {
  position: absolute; left: 10px; right: 10px; bottom: 46px; height: 30px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .1); font-size: 11px; font-weight: 600; color: #334155;
}
.s-address i { font-size: 10px; color: #64748b; }
.s-toolbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42px; padding: 0 12px; direction: ltr;
  display: flex; align-items: center; justify-content: space-between; background: rgba(248, 250, 252, .96); border-top: 1px solid #e5e9f0;
}
.s-toolbar i { font-size: 19px; color: #1a8cff; }
.s-pick { position: relative; border-radius: 8px; }
.g-scene.active .s-pick { animation: sGlow 1.2s ease .6s 3; }
.s-tap {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  background: rgba(10, 108, 255, .3); border: 2px solid var(--blue); opacity: 0; pointer-events: none;
}
.s-tap.tap-share { left: 50%; top: calc(100% - 21px); }
.s-tap.tap-row { left: 50%; top: 214px; }
.s-tap.tap-add { right: 6px; left: auto; top: 22px; }
html[dir="rtl"] .s-tap.tap-add { right: auto; left: 22px; }
.g-scene.active .s-tap { animation: sTap 1.4s ease 1s 2; }

.s-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; height: 86%; padding: 12px 10px; border-radius: 18px 18px 0 0;
  background: #f2f2f7; box-shadow: 0 -6px 20px rgba(15, 23, 42, .15); transform: translateY(100%);
}
.g-scene.active .s-sheet { animation: sSheetUp .6s var(--ease) .3s forwards; }
.g-scene.active .s-sheet.picked { animation: none; transform: none; }
.s-sheet-head { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid #e2e5ea; }
.s-sheet-head img { width: 30px; height: 30px; border-radius: 8px; }
.s-sheet-head span { display: flex; flex-direction: column; line-height: 1.3; }
.s-sheet-head b { font-size: 12px; }
.s-sheet-head small { font-size: 10px; color: #64748b; }
.s-apps { display: flex; justify-content: space-between; padding: 10px 4px; }
.s-apps i { width: 30px; height: 30px; border-radius: 9px; background: #dfe3ea; }
.s-apps i:first-child { background: #25d366; }
.s-apps i:nth-child(2) { background: #34c759; }
.s-list { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: #fff; }
.g-scene.active .s-sheet:not(.picked) .s-list { animation: sScroll .8s var(--ease) 1.8s forwards; }
.s-list span {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px;
  font-size: 11px; color: #0f172a; border-bottom: 1px solid #eef0f3;
}
.s-list span:last-child { border-bottom: none; }
.s-list em { font-style: normal; }
.s-list i { font-size: 16px; color: #0f172a; }
.s-sheet.picked .s-list { transform: translateY(-36px); }
.g-scene.active .s-sheet.picked .s-target { animation: sRow .5s ease 1.3s forwards; }
.s-swipe { position: absolute; left: 50%; bottom: 30px; margin-left: -14px; font-size: 28px; color: var(--blue); opacity: 0; }
.g-scene.active .s-swipe { animation: sSwipe 1.4s ease 1.2s 2; }

.s-add-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 14px 12px 10px;
  font-size: 11px; border-bottom: 1px solid #e2e5ea; background: #f9f9fb;
}
.s-add-head b { font-size: 11px; text-align: center; }
.s-add-head span { color: #1a8cff; }
.s-add-btn { font-weight: 700; border-radius: 6px; padding: 2px 4px; }
.g-scene.active .s-add-btn { animation: sGlow 1.2s ease .6s 3; }
.s-add-row { display: flex; align-items: center; gap: 10px; margin: 14px 10px; padding: 10px; border-radius: 12px; background: #fff; }
.s-add-row img { width: 46px; height: 46px; border-radius: 11px; }
.s-add-row span { display: flex; flex-direction: column; min-width: 0; }
.s-add-row b { font-size: 13px; border-bottom: 1px solid #e2e5ea; padding-bottom: 4px; margin-bottom: 4px; }
.s-add-row small { font-size: 9px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@keyframes sGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(10, 108, 255, 0); background: transparent; } 50% { box-shadow: 0 0 0 6px rgba(10, 108, 255, .2); background: rgba(10, 108, 255, .12); } }
@keyframes sTap { 0% { opacity: 0; transform: scale(1.6); } 30% { opacity: 1; transform: scale(1); } 50% { transform: scale(.8); } 100% { opacity: 0; transform: scale(1.4); } }
@keyframes sSheetUp { to { transform: none; } }
@keyframes sScroll { to { transform: translateY(-36px); } }
@keyframes sRow { to { background: var(--blue-50); color: var(--blue); } }
@keyframes sSwipe { 0% { opacity: 0; transform: translateY(20px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-60px); } }

/* Scene pieces */
.g-logo { width: 130px; height: 130px; border-radius: 50%; box-shadow: 0 18px 40px rgba(10, 108, 255, .3); }
.g-scene.active .g-logo { animation: gPop .7s var(--ease) both, gFloat 3s ease-in-out .7s infinite; }
.g-spark { position: absolute; color: var(--blue); font-size: 22px; opacity: 0; }
.g-spark.s1 { top: 26%; inset-inline-start: 26%; }
.g-spark.s2 { bottom: 28%; inset-inline-end: 24%; font-size: 16px; }
.g-scene.active .g-spark { animation: gTwinkle 2s ease-in-out .5s infinite; }
.g-scene.active .g-spark.s2 { animation-delay: 1.2s; }

.g-drop { width: 200px; height: 120px; border: 2px dashed var(--blue-100); border-radius: 22px; display: grid; place-items: center; background: #fff; font-size: 38px; color: var(--blue); }
.g-scene.active .g-drop i { animation: gFlash 1.4s ease .2s 2; }
.g-tiles, .g-look { display: flex; gap: 12px; }
.g-tiles span, .g-look span {
  width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 30px;
  background: #fff; color: var(--blue); box-shadow: 0 6px 18px rgba(15, 23, 42, .08); opacity: 0;
}
.g-scene.active .g-tiles span { animation: gDrop .6s var(--ease) both; }
.g-scene.active .g-tiles span:nth-child(1) { animation-delay: .9s; }
.g-scene.active .g-tiles span:nth-child(2) { animation-delay: 1.4s; }
.g-scene.active .g-tiles span:nth-child(3) { animation-delay: 1.9s; }

.g-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 260px; }
.g-chips span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 16px; background: #fff; border: 1px solid var(--border); font-size: 13px; font-weight: 500; }
.g-chips i { font-size: 24px; color: var(--muted); }
.g-scene.active .g-chips .pick { animation: gPick .4s ease 1.6s forwards; }
.g-scene.active .g-chips .pick i { animation: gPickIcon .4s ease 1.6s forwards; }
.g-tap { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: rgba(10, 108, 255, .25); border: 2px solid var(--blue); opacity: 0; }
.g-scene.active .g-tap { animation: gTap 2.2s ease .4s forwards; }

.g-scene.active .g-look span { animation: gPop .5s var(--ease) both; }
.g-scene.active .g-look span:nth-child(2) { animation-delay: .25s; }
.g-scene.active .g-look span:nth-child(3) { animation-delay: .5s; }
.g-score {
  width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: baseline; justify-content: center; padding-top: 26px;
  background: conic-gradient(var(--blue) calc(var(--p, 0) * 1%), var(--blue-50) 0); position: relative; --p: 0;
}
.g-score::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; }
.g-score b, .g-score small { position: relative; }
.g-score b { font-size: 30px; line-height: 1; }
.g-score small { color: var(--muted); font-size: 13px; }
@property --p { syntax: '<number>'; inherits: false; initial-value: 0; }
.g-scene.active .g-score { animation: gRing 1.4s var(--ease) 1s forwards; }
.g-palette { display: flex; gap: 6px; }
.g-palette i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .12); opacity: 0; }
.g-palette i:nth-child(1) { background: #1e3a5f; }
.g-palette i:nth-child(2) { background: #e9e4d8; }
.g-palette i:nth-child(3) { background: #8a6a4f; }
.g-scene.active .g-palette i { animation: gPop .4s var(--ease) both; }
.g-scene.active .g-palette i:nth-child(1) { animation-delay: 2.2s; }
.g-scene.active .g-palette i:nth-child(2) { animation-delay: 2.4s; }
.g-scene.active .g-palette i:nth-child(3) { animation-delay: 2.6s; }

.g-budget { display: flex; align-items: center; gap: 14px; padding: 18px 26px; border-radius: 22px; background: #fff; border: 2px solid var(--blue); box-shadow: 0 0 0 5px rgba(10, 108, 255, .12); }
.g-budget > i { font-size: 32px; color: var(--blue); }
.g-budget b { font-size: 44px; line-height: 1; }
.g-budget small { font-size: 16px; color: var(--muted); }
.g-presets { display: flex; gap: 10px; }
.g-presets span { padding: 8px 18px; border-radius: 99px; background: #fff; border: 1px solid var(--border); font-weight: 600; }
.g-scene.active .g-presets .pick { animation: gPick .3s ease .3s forwards; }

.g-map {
  position: relative; width: 250px; height: 220px; border-radius: 26px; overflow: hidden;
  background-color: #eaf1fb;
  background-image: linear-gradient(#fff 3px, transparent 3px), linear-gradient(90deg, #fff 3px, transparent 3px);
  background-size: 50px 50px; box-shadow: inset 0 0 0 1px var(--border);
}
.g-pin { position: absolute; left: 50%; top: 50%; font-size: 52px; color: var(--blue); transform: translate(-50%, -100%); }
.g-scene.active .g-pin { animation: gPinDrop .7s var(--ease) .3s both; }
.g-pulse { position: absolute; left: 50%; top: 50%; width: 22px; height: 10px; margin: -5px 0 0 -11px; border-radius: 50%; background: rgba(10, 108, 255, .35); }
.g-scene.active .g-pulse { animation: gPulse 1.6s ease-out 1s infinite; }
.g-poi { position: absolute; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--green); font-size: 18px; box-shadow: 0 4px 12px rgba(15, 23, 42, .12); opacity: 0; }
.g-poi.p1 { left: 18%; top: 22%; }
.g-poi.p2 { right: 16%; top: 30%; }
.g-poi.p3 { left: 28%; bottom: 14%; }
.g-scene.active .g-poi { animation: gPop .5s var(--ease) both; }
.g-scene.active .g-poi.p1 { animation-delay: 1.4s; }
.g-scene.active .g-poi.p2 { animation-delay: 1.8s; }
.g-scene.active .g-poi.p3 { animation-delay: 2.2s; }

.g-place { width: 270px; padding: 18px; border-radius: 22px; background: #fff; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); border: 1px solid var(--border); }
.g-place-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.g-rank { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 700; font-size: 14px; }
.g-line { height: 9px; border-radius: 99px; background: #eef2f7; margin-bottom: 8px; }
.g-line.short { width: 60%; }
.g-go { position: relative; height: 46px; margin-top: 14px; border-radius: 14px; background: var(--blue); color: #fff; font-weight: 600; display: grid; place-items: center; overflow: hidden; }
.g-go-done { position: absolute; inset: 0; display: grid; place-items: center; background: var(--green); font-size: 24px; opacity: 0; }
.g-scene.active .g-go { animation: gPress .3s ease 1.6s; }
.g-scene.active .g-go-done { animation: gFadeIn .3s ease 1.9s forwards; }

.g-bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 16px 18px; border-radius: 22px; background: #fff; border: 1px solid var(--border); }
.g-bars i { width: 22px; height: 0; border-radius: 8px; background: var(--blue-100); }
.g-bars i:nth-child(6) { background: var(--blue); }
.g-scene.active .g-bars i { animation: gGrow .7s var(--ease) var(--d) forwards; }
.g-wa { display: flex; align-items: center; gap: 10px; max-width: 290px; padding: 12px 16px; border-radius: 18px 18px 18px 4px; background: #dcf8c6; color: #1f3b2b; font-size: 14px; font-weight: 500; box-shadow: 0 4px 14px rgba(15, 23, 42, .08); opacity: 0; }
html[dir="rtl"] .g-wa { border-radius: 18px 18px 4px 18px; }
.g-wa i { font-size: 22px; color: #128c4a; }
.g-scene.active .g-wa { animation: gSlideUp .5s var(--ease) 1.4s forwards; }

.g-home {
  display: grid; grid-template-columns: repeat(4, 46px); gap: 16px; padding: 26px 22px; border-radius: 30px;
  background: linear-gradient(160deg, #cfe0ff, #f1e6ff); box-shadow: inset 0 0 0 6px #fff, 0 12px 30px rgba(15, 23, 42, .1);
}
.g-home i { width: 46px; height: 46px; border-radius: 13px; background: rgba(255, 255, 255, .6); }
.g-home img { width: 46px; height: 46px; border-radius: 13px; box-shadow: 0 4px 12px rgba(10, 108, 255, .35); opacity: 0; }
.g-scene.active .g-home img { animation: gPop .6s var(--ease) 1s both, gWiggle .5s ease 1.8s 2; }

@keyframes gPop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
@keyframes gFloat { 50% { transform: translateY(-8px); } }
@keyframes gTwinkle { 0%, 100% { opacity: 0; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
@keyframes gFlash { 50% { transform: scale(1.2); } }
@keyframes gDrop { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: none; } }
@keyframes gPick { to { background: var(--blue-50); border-color: var(--blue); color: var(--blue); } }
@keyframes gPickIcon { to { color: var(--blue); } }
@keyframes gTap { 0% { opacity: 0; transform: translate(60px, 90px); } 30% { opacity: 1; } 55% { opacity: 1; transform: translate(-38px, -42px) scale(1); } 65% { transform: translate(-38px, -42px) scale(.75); } 80%, 100% { opacity: 0; transform: translate(-38px, -42px) scale(1); } }
@keyframes gRing { to { --p: 90; } }
@keyframes gPinDrop { from { opacity: 0; transform: translate(-50%, -260%); } 70% { transform: translate(-50%, -92%); } to { opacity: 1; transform: translate(-50%, -100%); } }
@keyframes gPulse { from { transform: scale(1); opacity: 1; } to { transform: scale(5); opacity: 0; } }
@keyframes gPress { 50% { transform: scale(.94); } }
@keyframes gFadeIn { to { opacity: 1; } }
@keyframes gGrow { to { height: var(--h); } }
@keyframes gSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes gWiggle { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

/* ---------- Responsive ---------- */
@media (display-mode: standalone) {
  .topbar { padding-top: calc(12px + env(safe-area-inset-top)); }
}
@media (max-width: 640px) {
  .guide-bottom h2 { font-size: 21px; }
  .install-card small { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat.main { grid-column: 1 / -1; }
  .stat b { font-size: 19px; }
  .stat.main b { font-size: 28px; }
  .chart { height: 150px; gap: 6px; }
  .bar-day { font-size: 11px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; padding: 24px 20px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  body.locked { padding-bottom: 0; }
  main { padding: 16px 16px 32px; }

  /* App-style header + bottom tab bar.
     backdrop-filter on .topbar would trap the fixed .nav inside the header. */
  .topbar { padding: 10px 16px; backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
  .top-actions .lang-btn.compact { display: none; }
  .otp input { width: 44px; height: 52px; }
  .brand { font-size: 19px; }
  .brand img { width: 30px; height: 30px; border-radius: 50%; }
  .nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    justify-content: space-around; gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--border);
  }
  .nav a {
    flex: 1; flex-direction: column; gap: 2px;
    padding: 6px 2px; border-radius: 12px;
    font-size: 10px; font-weight: 600;
  }
  .nav a i { font-size: 24px; }
  .nav a:hover { background: none; }
  .nav a.active { background: none; color: var(--blue); }

  /* Home */
  .home-head { padding: 14px 0 16px; }
  .home-head h1 { font-size: 26px; }
  .home-head p { font-size: 15px; }
  .today-card { padding: 20px; }
  .today-card b { font-size: 30px; }
  .today-card:hover, .quick-item:hover { transform: none; }
  .quick-item { padding: 14px; }
  .quick-ico { width: 44px; height: 44px; font-size: 22px; }
  .map-frame { height: 260px; }
  .how { margin-top: 40px; }
  .section-title { font-size: 20px; margin-bottom: 14px; }
  .steps { grid-template-columns: 1fr; gap: 8px; }
  .step { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; text-align: start; padding: 14px 16px; border-radius: 16px; }
  .step > i { grid-row: span 2; font-size: 26px; width: 44px; height: 44px; border-radius: 12px; background: var(--blue-50); display: grid; place-items: center; }
  .step h3 { margin: 0; font-size: 15px; align-self: end; }
  .step p { font-size: 13px; }
  .step-num { top: 50%; transform: translateY(-50%); inset-inline-start: auto; inset-inline-end: 14px; }

  /* Pages */
  .page-head { gap: 12px; margin-bottom: 16px; }
  .page-head h1 { font-size: 22px; }
  .page-head p { font-size: 13px; line-height: 1.5; }
  .page-icon { width: 46px; height: 46px; font-size: 24px; border-radius: 14px; }
  .panel { padding: 18px 16px; border-radius: 18px; }
  .panel-step { font-size: 15px; margin: 22px 0 10px; }

  .grid-2 > div > .panel-step:first-child { margin-top: 22px; }

  /* Options become a tidy tile grid */
  .chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .chips[data-group="style"], .chips[data-group="type"] { grid-template-columns: repeat(3, 1fr); }
  .chip {
    flex-direction: column; justify-content: center; gap: 4px;
    min-height: 72px; padding: 10px 4px; border-radius: 14px;
    font-size: 12px; line-height: 1.3; text-align: center;
  }
  .chip i { font-size: 24px; }

  input, select { font-size: 16px; }
  .dropzone { padding: 26px 16px; }
  .dropzone strong { font-size: 15px; }
  .dropzone span { font-size: 13px; }
  .dz-icon { width: 48px; height: 48px; font-size: 24px; }
  .thumbs { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .thumb { border-radius: 12px; }
  .wardrobe { padding: 12px; }
  .wardrobe-grid { grid-template-columns: repeat(4, 1fr); }
  .btn-lg { font-size: 16px; padding: 15px; }
  .btn-block { margin-top: 22px; }

  .budget-input input { font-size: 22px; }
  .presets { width: 100%; }
  .presets button { flex: 1; padding: 9px 0; }

  /* Results */
  .loader { padding: 28px 16px; }
  .loader-msg { font-size: 15px; }
  .loader-steps span { font-size: 12px; padding: 4px 10px; }
  .result-head { margin: 28px 0 12px; }
  .result-head h2 { font-size: 19px; }
  .toolbar { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .toolbar button { flex: 1; justify-content: center; white-space: nowrap; }
  .card { padding: 16px; border-radius: 18px; }
  .place-top { flex-wrap: wrap; gap: 12px; }
  .rank { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
  .place-main h3 { font-size: 16px; }
  .meta { font-size: 13px; gap: 2px 10px; }
  .price { width: 100%; display: flex; align-items: baseline; gap: 8px; text-align: start; }
  .price strong { font-size: 20px; }
  .tabs button { flex: 1; justify-content: center; font-size: 13px; }
  .menu-row { font-size: 14px; }
  .actions .btn { flex: 1 1 0; min-width: 0; padding: 11px 10px; font-size: 14px; white-space: nowrap; }
  .actions .btn-go, .actions .btn-done { flex-basis: 100%; padding: 13px; font-size: 15px; }
  .actions .btn-icon { flex: 0 0 46px; padding: 0; }
  .place-top .price { margin-inline-start: auto; }
  .look { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .look-item b { font-size: 12px; }
  .outfit-top h3 { font-size: 17px; }
  .score-ring { width: 50px; height: 50px; }
  .score-ring span { width: 40px; height: 40px; font-size: 14px; }

  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .to-top { bottom: calc(84px + env(safe-area-inset-bottom)); inset-inline-end: 16px; width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .guide-bars span.active i { animation-duration: 5.5s !important; }
}
