/* ======================================================================
   Staro Profile — mobile-first, app-like design system
   Logical properties everywhere → correct in RTL (ku/ar/fa) and LTR (en)
   ====================================================================== */
@font-face { font-family: "Ubuntu Arabic"; src: url("../fonts/UbuntuArabic-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Ubuntu Arabic"; src: url("../fonts/UbuntuArabic-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --brand: #5b3df5;
  --brand-2: #ff6b4a;
  --brand-grad: linear-gradient(135deg, #6a4cff 0%, #8b5cf6 45%, #ff6b4a 100%);
  --brand-soft: #efeaff;
  --bg: #f5f4fa;
  --surface: #ffffff;
  --surface-2: #f2f0f8;
  --surface-3: #e8e5f2;
  --border: #e4e0ef;
  --border-strong: #cfc9e0;
  --text: #17142b;
  --text-2: #3e3a57;
  --muted: #6d6886;
  --green: #0f9d58; --green-soft: #ddf6e8;
  --amber: #b26a00; --amber-soft: #fff1d6;
  --red: #e11d48;   --red-soft: #ffe4ea;
  --gray-soft: #eceaf2;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgb(23 20 43 / .06);
  --shadow: 0 2px 6px rgb(23 20 43 / .05), 0 12px 28px -14px rgb(23 20 43 / .22);
  --shadow-lg: 0 30px 60px -20px rgb(23 20 43 / .45);
  --ring: 0 0 0 3px rgb(91 61 245 / .25);
  --appbar-h: 60px;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Ubuntu Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand-soft: #2a2350;
  --bg: #0d0b18; --surface: #17142a; --surface-2: #201c36; --surface-3: #2a2544;
  --border: #2c2746; --border-strong: #3d3760;
  --text: #f3f1ff; --text-2: #d6d2ee; --muted: #a39dc4;
  --green: #4ade80; --green-soft: #0e2e1d; --amber: #fbbf24; --amber-soft: #3a2b07; --red: #fb7185; --red-soft: #3b1220; --gray-soft: #26223d;
  --shadow: 0 2px 6px rgb(0 0 0 / .4), 0 12px 28px -14px rgb(0 0 0 / .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; min-height: 100dvh; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.08rem; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
:focus-visible { outline: none; box-shadow: var(--ring); }
.icon { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
:root[data-theme="dark"] .only-light, :root:not([data-theme="dark"]) .only-dark { display: none; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .center { text-align: center; } .grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: .9rem; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40; height: calc(var(--appbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) .75rem 0; display: flex; align-items: center; gap: .6rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.appbar-logo .brand-mark { width: 36px; height: 36px; display: block; }
.appbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.appbar-title strong { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-title small { color: var(--muted); font-size: .78rem; }
.appbar-actions { display: flex; align-items: center; gap: .25rem; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 0; background: transparent; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 60; width: 250px; padding: .5rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop .16s var(--ease); }
.menu-label { font-size: .78rem; color: var(--muted); font-weight: 700; padding: .3rem .6rem; }
.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; margin-bottom: .3rem; }
.lang-grid a { padding: .55rem; border-radius: 12px; text-align: center; font-weight: 700; background: var(--surface-2); }
.lang-grid a.is-active { background: var(--brand); color: #fff; }
.menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .7rem .7rem; border-radius: 12px; border: 0; background: none; font-weight: 700; text-align: start; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--red); }
.menu form { margin: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }

/* ---------- Page ---------- */
.page { max-width: 980px; margin: 0 auto; padding: 1rem 1rem calc(6rem + var(--safe-b)); display: flex; flex-direction: column; gap: 1rem; animation: in .3s var(--ease); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.card-head h2 { display: flex; align-items: center; gap: .5rem; }
.card-head h2 .icon { color: var(--brand); }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .6rem 1.1rem;
  border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 700; font-size: .98rem;
  transition: transform .1s var(--ease), background .15s, box-shadow .15s; white-space: nowrap; user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 10px 22px -12px rgb(91 61 245 / .9); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
:root[data-theme="dark"] .btn-soft { color: #c4b5fd; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger, .btn-ghost.danger { color: var(--red); }
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #073b1c; }
.btn-lg { min-height: 56px; font-size: 1.05rem; border-radius: 16px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.btn-row form { margin: 0; }
.btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-color: #fff #fff #fff transparent; animation: spin .7s linear infinite; }
.btn:not(.btn-primary):not(.btn-danger).is-loading::after { border-color: var(--brand) var(--brand) var(--brand) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > span { font-size: .88rem; font-weight: 700; color: var(--text-2); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 52px; padding: .7rem .9rem; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface);
  font-size: 16px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-inline-end: 2.2rem; }
[dir="rtl"] select { background-position: 20px 50%, 14px 50%; }
textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; inset-inline-start: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-inline-start: 2.8rem !important; }
.input-with-btn { display: flex; gap: .5rem; }
.input-suffix { display: flex; }
.input-suffix input { border-start-end-radius: 0; border-end-end-radius: 0; font-weight: 700; font-size: 1.15rem; }
.input-suffix span { display: grid; place-items: center; padding: 0 1rem; border: 1.5px solid var(--border); border-inline-start: 0; border-start-end-radius: 14px; border-end-end-radius: 14px; background: var(--surface-2); color: var(--muted); font-weight: 700; }
.form-error { color: var(--red); font-weight: 700; font-size: .92rem; }
.reveal-btn { position: absolute; inset-inline-end: .35rem; top: 50%; transform: translateY(-50%); }

/* ---------- Badges / status ---------- */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-gray { background: var(--gray-soft); color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-submitted { background: var(--green-soft); color: var(--green); }
.status-in_progress { background: var(--amber-soft); color: var(--amber); }
.status-new { background: var(--gray-soft); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.progress { display: block; height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; width: var(--p); background: var(--brand-grad); border-radius: inherit; transition: width .5s var(--ease); }
.progress.lg { height: 10px; }
.pct { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand); }
.pct.big { font-size: 1.4rem; }
:root[data-theme="dark"] .pct { color: #c4b5fd; }

/* ---------- Auth pages ---------- */
.center-page main { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.25rem; gap: 1rem; }
.auth-page { background: radial-gradient(1200px 600px at 0% 0%, rgb(124 92 255 / .18), transparent 60%), radial-gradient(900px 500px at 100% 100%, rgb(255 107 74 / .16), transparent 60%), var(--bg); }
.auth-top { position: fixed; top: calc(.5rem + env(safe-area-inset-top, 0px)); inset-inline-end: .5rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 28px; padding: 1.6rem 1.3rem; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 1.3rem; animation: in .4s var(--ease); }
.auth-brand { display: flex; align-items: center; gap: .9rem; }
.auth-brand .brand-mark, .auth-logo { width: 56px; height: 56px; border-radius: 16px; object-fit: contain; flex: none; }
.auth-logo { background: #fff; border: 1px solid var(--border); padding: 4px; }
.auth-brand strong { display: block; font-size: 1.25rem; }
.auth-brand small { color: var(--muted); }
.powered { color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .08em; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .8rem; font-size: .85rem; font-weight: 700; }
.checks .ok { color: var(--green); } .checks .bad { color: var(--red); }
.checks li { display: flex; align-items: center; gap: .35rem; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- Empty states ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .7rem; padding: 2.5rem 1rem; color: var(--muted); }
.empty h1, .empty h2 { color: var(--text); }
.empty-icon { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty-icon .icon { width: 36px; height: 36px; }
.empty-icon.danger { background: var(--red-soft); color: var(--red); }
.card-lite { max-width: 420px; }
.empty-inline { text-align: center; color: var(--muted); padding: 1.5rem; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 200; inset-inline: 0; top: calc(var(--appbar-h) + .5rem + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; align-items: center; gap: .5rem; pointer-events: none; padding: 0 1rem; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: .6rem; max-width: 460px; padding: .8rem 1.1rem; border-radius: 16px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-weight: 700; animation: toast .3s var(--ease); }
.toast-success .icon { color: #4ade80; }
.toast-error { background: var(--red); color: #fff; }
.toast.out { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- Sheets (dialogs): bottom sheet on phones, centered card on larger screens ---------- */
dialog.sheet { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100dvh; width: 100%; margin: auto auto 0; color: var(--text); }
dialog.sheet::backdrop { background: rgb(10 8 20 / .5); backdrop-filter: blur(3px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet-box { width: 100%; max-height: 92dvh; display: flex; flex-direction: column; background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg); animation: sheet-up .32s var(--ease); }
@keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } }
.sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1.1rem 1rem .6rem; }
.sheet-head h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.12rem; }
.sheet-head h2 .icon { color: var(--brand); }
.sheet-grip { position: absolute; top: .45rem; inset-inline-start: 50%; width: 42px; height: 5px; border-radius: 9px; background: var(--border-strong); transform: translateX(-50%); }
[dir="rtl"] .sheet-grip { transform: translateX(50%); }
.sheet-body { padding: .4rem 1rem 1rem; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: .5rem; padding: .8rem 1rem calc(.9rem + var(--safe-b)); border-top: 1px solid var(--border); }
.sheet-full .sheet-box { height: 100dvh; max-height: 100dvh; border-radius: 0; }
.hint { display: flex; gap: .5rem; align-items: flex-start; padding: .7rem .85rem; border-radius: 14px; background: var(--brand-soft); color: var(--text-2); font-size: .9rem; }
.hint .icon { color: var(--brand); margin-top: .15rem; }

/* ---------- Admin: dashboard ---------- */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.summary-tile { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .8rem .9rem; border-radius: 18px; border: 1.5px solid var(--border); background: var(--surface); text-align: start; transition: border-color .15s, transform .1s; }
.summary-tile strong { font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.summary-tile span { font-size: .8rem; color: var(--muted); font-weight: 700; }
.summary-tile.is-active { border-color: var(--brand); box-shadow: var(--ring); }
.summary-tile:active { transform: scale(.97); }
.tone-green strong { color: var(--green); } .tone-amber strong { color: var(--amber); } .tone-gray strong { color: var(--muted); }
.searchbar { position: relative; }
.searchbar > .icon { position: absolute; inset-inline-start: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.searchbar input { padding-inline-start: 2.9rem !important; border-radius: 999px !important; background: var(--surface); }
.rest-list { display: flex; flex-direction: column; gap: .6rem; }
.rest-card { display: flex; align-items: center; gap: .85rem; padding: .9rem; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .12s var(--ease), box-shadow .15s; }
.rest-card:active { transform: scale(.985); }
.rest-card:hover { box-shadow: var(--shadow); }
.rest-logo { width: 54px; height: 54px; flex: none; border-radius: 16px; display: grid; place-items: center; background: var(--brand-grad); color: #fff; font-weight: 700; font-size: 1.3rem; overflow: hidden; }
.rest-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.rest-logo.lg { width: 68px; height: 68px; border-radius: 20px; font-size: 1.6rem; }
.rest-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.rest-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rest-sub { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rest-meta { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: .8rem; font-weight: 700; color: var(--text-2); }
.rest-meta span { display: inline-flex; align-items: center; gap: .25rem; }
.rest-meta .icon { width: 1em; height: 1em; }
.rest-card .progress { margin-top: .3rem; }
.rest-side { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; flex: none; }
.fab { position: fixed; z-index: 30; inset-inline-end: 1rem; bottom: calc(1rem + var(--safe-b)); display: inline-flex; align-items: center; gap: .5rem; height: 60px; padding: 0 1.4rem; border-radius: 20px; border: 0; background: var(--brand-grad); color: #fff; font-weight: 700; font-size: 1.02rem; box-shadow: 0 18px 36px -14px rgb(91 61 245 / .95); transition: transform .12s var(--ease); }
.fab:active { transform: scale(.95); }
.fab .icon { width: 1.5em; height: 1.5em; }

/* ---------- Admin: restaurant ---------- */
.share-card { display: flex; flex-direction: column; gap: 1rem; }
.share-head { display: flex; gap: .9rem; align-items: center; }
.cred-grid { display: flex; flex-direction: column; gap: .5rem; }
.cred { display: flex; align-items: center; gap: .6rem; padding: .55rem .4rem .55rem .9rem; border-radius: 14px; background: var(--surface-2); }
[dir="rtl"] .cred { padding: .55rem .9rem .55rem .4rem; }
.cred span { font-size: .78rem; font-weight: 700; color: var(--muted); min-width: 68px; }
.cred code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 700; font-size: .92rem; }
.cred-secret { background: var(--amber-soft); }
.alert { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 16px; }
.alert-success { background: var(--green-soft); color: var(--text); }
.alert-success > .icon { color: var(--green); width: 1.5em; height: 1.5em; }
.checklist { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.checklist li { display: flex; align-items: center; gap: .55rem; font-weight: 700; flex-wrap: wrap; }
.checklist li .icon { color: var(--muted); }
.checklist li.done .icon { color: var(--green); }
.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: .55rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 700; font-size: .86rem; }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.link { display: inline-flex; align-items: center; gap: .3rem; color: var(--brand); font-weight: 700; }
.cat-block { border-top: 1px solid var(--border); padding: .6rem 0; }
.cat-block > summary { display: flex; align-items: center; gap: .6rem; cursor: pointer; list-style: none; padding: .4rem 0; font-weight: 700; }
.cat-block > summary::-webkit-details-marker { display: none; }
.cat-name { flex: 1; }
.lang-dots { display: inline-flex; gap: .2rem; }
.lang-dots i { font-style: normal; font-size: .62rem; font-weight: 700; padding: .05rem .3rem; border-radius: 6px; background: var(--surface-2); color: var(--muted); opacity: .55; }
.lang-dots i.on { background: var(--brand-soft); color: var(--brand); opacity: 1; }
.item-view { display: grid; grid-template-columns: 1fr; gap: .7rem; padding: .8rem; margin: .5rem 0; border-radius: 16px; background: var(--surface-2); }
.item-view.is-incomplete { box-shadow: inset 0 0 0 1.5px var(--amber); }
.gallery { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
.gallery img { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; }
.no-photo { width: 92px; height: 92px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.item-texts { display: flex; flex-direction: column; gap: .5rem; }
.lang-block { position: relative; padding-inline-start: 2.4rem; }
.lang-tag { position: absolute; inset-inline-start: 0; top: .1rem; font-size: .66rem; font-weight: 700; padding: .05rem .35rem; border-radius: 6px; background: var(--brand-soft); color: var(--brand); }
.lang-block p { color: var(--text-2); font-size: .92rem; white-space: pre-line; }
.item-foot { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.price { font-weight: 700; font-size: 1.05rem; color: var(--brand); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .price { color: #c4b5fd; }
.danger-zone { margin-top: 1rem; border: 1px dashed color-mix(in srgb, var(--red) 50%, transparent); border-radius: 16px; padding: .8rem 1rem; }
.danger-zone summary { display: flex; align-items: center; gap: .5rem; color: var(--red); font-weight: 700; cursor: pointer; list-style: none; }
.danger-zone form { margin-top: .8rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.timeline li { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; font-size: .9rem; }
.who { font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 6px; background: var(--surface-2); }
.who-admin { background: var(--brand-soft); color: var(--brand); } .who-rest { background: var(--green-soft); color: var(--green); }

/* ---------- Portal ---------- */
.portal-main { max-width: 860px; margin: 0 auto; padding: 1rem 1rem calc(var(--tabbar-h) + 2rem + var(--safe-b)); }
.portal-view { display: flex; flex-direction: column; gap: 1rem; animation: in .25s var(--ease); }
.skeleton { height: 220px; border-radius: 22px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.tabbar {
  position: fixed; z-index: 35; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.6) blur(18px); border-top: 1px solid var(--border);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: .78rem; position: relative; }
.tabbar button .icon { width: 1.5em; height: 1.5em; transition: transform .2s var(--ease); }
.tabbar button.is-active { color: var(--brand); }
:root[data-theme="dark"] .tabbar button.is-active { color: #c4b5fd; }
.tabbar button.is-active .icon { transform: translateY(-2px); }
.tabbar button.is-active::before { content: ""; position: absolute; top: 0; width: 36px; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand); }
.tabbar .dot { position: absolute; top: 10px; inset-inline-end: calc(50% - 20px); width: 9px; height: 9px; border-radius: 50%; background: var(--brand-2); border: 2px solid var(--surface); }

.hero { position: relative; overflow: hidden; padding: 1.3rem; border-radius: 26px; background: var(--brand-grad); color: #fff; box-shadow: 0 22px 40px -22px rgb(91 61 245 / .9); }
.hero h1 { font-size: 1.35rem; }
.hero p { opacity: .92; margin-top: .3rem; }
.hero .ring { position: absolute; inset-inline-end: -30px; top: -30px; width: 150px; height: 150px; border-radius: 50%; background: rgb(255 255 255 / .12); }
.hero-progress { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; }
.hero-progress .progress { flex: 1; background: rgb(255 255 255 / .25); height: 10px; }
.hero-progress .progress i { background: #fff; }
.hero-progress strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.steps { display: flex; flex-direction: column; gap: .6rem; }
.step { display: flex; align-items: center; gap: .9rem; padding: 1rem; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); text-align: start; width: 100%; transition: transform .12s var(--ease); }
.step:active { transform: scale(.985); }
.step-num { width: 42px; height: 42px; flex: none; border-radius: 14px; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.step.done .step-num { background: var(--green-soft); color: var(--green); }
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.step-body small { color: var(--muted); }
.step > .icon:last-child { color: var(--muted); }
.submit-card { text-align: center; display: flex; flex-direction: column; gap: .7rem; align-items: center; }
.submit-card.is-submitted { background: var(--green-soft); border-color: transparent; }
.submit-card .big-icon { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; background: var(--surface); color: var(--green); }
.submit-card .big-icon .icon { width: 32px; height: 32px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.stat { padding: .8rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); text-align: center; }
.stat strong { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); font-weight: 700; }

.logo-pick { display: flex; align-items: center; gap: 1rem; }
.logo-box { width: 96px; height: 96px; flex: none; border-radius: 24px; border: 2px dashed var(--border-strong); display: grid; place-items: center; overflow: hidden; background: var(--surface-2); color: var(--muted); position: relative; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo-box.is-busy::after { content: ""; position: absolute; inset: 0; background: rgb(255 255 255 / .6) url() center/24px no-repeat; }
.ml-group { display: flex; flex-direction: column; gap: .55rem; }
.ml-group > .label { font-size: .88rem; font-weight: 700; color: var(--text-2); }
.ml-row { position: relative; }
.ml-row .lang-chip { position: absolute; inset-inline-start: .55rem; top: .55rem; z-index: 1; font-size: .7rem; font-weight: 700; padding: .12rem .45rem; border-radius: 8px; background: var(--surface-2); color: var(--muted); pointer-events: none; }
.ml-row.filled .lang-chip { background: var(--brand-soft); color: var(--brand); }
.ml-row input, .ml-row textarea { padding-inline-start: 3.4rem !important; }
.lang-tabs { display: flex; gap: .3rem; padding: .3rem; background: var(--surface-2); border-radius: 16px; overflow-x: auto; scrollbar-width: none; }
.lang-tabs button { flex: 1; min-width: 70px; position: relative; padding: .6rem .5rem; border-radius: 12px; border: 0; background: none; font-weight: 700; color: var(--muted); white-space: nowrap; }
.lang-tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.lang-tabs button.filled::after { content: ""; position: absolute; top: 6px; inset-inline-end: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.lang-pane { display: flex; flex-direction: column; gap: .8rem; }

.cat-section { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; }
.cat-header { display: flex; align-items: center; gap: .5rem; padding: .85rem .9rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cat-header h2 { flex: 1; min-width: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.cat-header .count { font-size: .8rem; color: var(--muted); font-weight: 700; }
.item-row { display: flex; align-items: center; gap: .8rem; padding: .75rem .9rem; border-bottom: 1px solid var(--border); width: 100%; background: none; border-inline: 0; border-top: 0; text-align: start; transition: background .15s; }
.item-row:last-of-type { border-bottom: 0; }
.item-row:active { background: var(--surface-2); }
.item-thumb { width: 64px; height: 64px; flex: none; border-radius: 16px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.item-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-info .desc { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-info .meta { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.add-item { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; padding: .9rem; border: 0; background: none; color: var(--brand); font-weight: 700; }
:root[data-theme="dark"] .add-item { color: #c4b5fd; }
.reorder { display: flex; gap: .1rem; }
.reorder .icon-btn { width: 36px; height: 36px; }
.photo-strip { display: flex; gap: .55rem; overflow-x: auto; padding: .2rem .1rem .4rem; scrollbar-width: none; }
.photo-tile { position: relative; width: 104px; height: 104px; flex: none; border-radius: 18px; overflow: hidden; background: var(--surface-2); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile .del { position: absolute; top: 5px; inset-inline-end: 5px; width: 30px; height: 30px; border-radius: 10px; border: 0; background: rgb(0 0 0 / .55); color: #fff; display: grid; place-items: center; }
.photo-tile .cover { position: absolute; bottom: 5px; inset-inline-start: 5px; font-size: .66rem; font-weight: 700; padding: .1rem .4rem; border-radius: 6px; background: var(--brand); color: #fff; }
.photo-tile .mv { position: absolute; bottom: 5px; inset-inline-end: 5px; width: 28px; height: 28px; border-radius: 9px; border: 0; background: rgb(0 0 0 / .45); color: #fff; display: grid; place-items: center; }
.photo-tile.uploading::after { content: attr(data-pct); position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .45); color: #fff; font-weight: 700; }
.photo-add { width: 104px; height: 104px; flex: none; border-radius: 18px; border: 2px dashed var(--border-strong); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; color: var(--brand); font-weight: 700; font-size: .8rem; }
.photos-block .block-title { display: flex; align-items: center; gap: .45rem; font-weight: 700; margin-bottom: .45rem; }
.photos-block .block-title .icon { color: var(--brand); }
.pill-missing { font-size: .7rem; }

/* ---------- Larger screens: centered sheets, bigger layout ---------- */
@media (min-width: 720px) {
  .page { padding: 1.5rem 1.5rem 7rem; gap: 1.25rem; }
  .card { padding: 1.4rem; }
  dialog.sheet { margin: auto; width: min(600px, calc(100vw - 2rem)); }
  .sheet-box { border-radius: 26px; max-height: 88dvh; animation: pop .22s var(--ease); }
  .sheet-grip { display: none; }
  .sheet-full .sheet-box { height: auto; max-height: 92dvh; border-radius: 26px; }
  .sheet-foot { border-radius: 0 0 26px 26px; }
  .item-view { grid-template-columns: 220px 1fr; }
  .gallery { flex-wrap: wrap; }
  .cred-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .cred:first-child { grid-column: 1 / -1; }
  .portal-main { padding-top: 1.5rem; }
  .stat-row { gap: .8rem; }
  .steps { display: grid; grid-template-columns: 1fr 1fr 1fr; }
  .step { flex-direction: column; align-items: flex-start; }
  .step > .icon:last-child { display: none; }
}
@media (min-width: 1024px) {
  .tabbar { top: calc(var(--appbar-h) + env(safe-area-inset-top, 0px)); bottom: auto; inset-inline: 0; height: 56px; padding: 0; grid-template-columns: repeat(3, 160px); justify-content: center; border-top: 0; border-bottom: 1px solid var(--border); }
  .tabbar button { flex-direction: row; gap: .5rem; font-size: .95rem; }
  .tabbar button.is-active::before { top: auto; bottom: 0; width: 60%; border-radius: 4px 4px 0 0; }
  .portal-main { padding-top: calc(56px + 1.5rem); padding-bottom: 3rem; }
  .fab { inset-inline-end: 2rem; bottom: 2rem; }
}
@media (max-width: 420px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rest-side .pct { display: none; }
  .fab span { display: none; }
  .fab { width: 60px; padding: 0; justify-content: center; border-radius: 20px; }
  .kv { grid-template-columns: 1fr; gap: .1rem .5rem; }
  .kv dd { margin-bottom: .5rem; }
}
@media (hover: none) { .rest-card:hover { box-shadow: var(--shadow-sm); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Location picker ---------- */
.location-card { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .85rem .9rem; border-radius: 16px; border: 1.5px dashed var(--border-strong); background: var(--surface); text-align: start; transition: border-color .15s, background .15s; }
.location-card:active { transform: scale(.99); }
.location-card .loc-icon { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.location-card.is-set { border-style: solid; border-color: color-mix(in srgb, var(--green) 45%, transparent); background: var(--green-soft); }
.location-card.is-set .loc-icon { background: var(--surface); color: var(--green); }
.location-card strong { display: block; }
.location-card > .icon { color: var(--muted); }
#dlg-map .sheet-box { height: 100dvh; max-height: 100dvh; }
#dlg-map .sheet-head { padding-bottom: .4rem; }
.map-search { position: relative; padding: 0 1rem .6rem; z-index: 3; }
.map-results { position: absolute; inset-inline: 1rem; top: calc(100% - .3rem); max-height: 45dvh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 1000; }
.map-results button { display: flex; gap: .55rem; align-items: flex-start; width: 100%; padding: .75rem .9rem; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: start; font-size: .9rem; }
.map-results button:last-child { border-bottom: 0; }
.map-results button .icon { color: var(--brand); margin-top: .15rem; }
.map-wrap { position: relative; flex: 1; min-height: 300px; }
.map { position: absolute; inset: 0; background: var(--surface-2); }
.map-pin { position: absolute; z-index: 500; left: 50%; top: 50%; transform: translate(-50%, -100%); pointer-events: none; color: var(--brand-2); filter: drop-shadow(0 6px 6px rgb(0 0 0 / .35)); transition: transform .18s var(--ease); }
.map-pin .icon { width: 46px; height: 46px; fill: #fff; stroke-width: 2.2; }
.map-pin::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 10px; height: 4px; margin-left: -5px; border-radius: 50%; background: rgb(0 0 0 / .35); }
#dlg-map.is-moving .map-pin { transform: translate(-50%, -118%); }
.map-tools { position: absolute; z-index: 500; inset-inline-end: .8rem; bottom: .8rem; display: flex; flex-direction: column; gap: .5rem; }
.map-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-width: 50px; height: 50px; padding: 0 .9rem; border-radius: 16px; border: 0; background: var(--surface); color: var(--text); font-weight: 700; box-shadow: var(--shadow); }
.map-btn .icon { color: var(--brand); }
.map-foot { align-items: center; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10px; }
[dir="rtl"] .leaflet-control-zoom { margin-left: 10px; }

/* ---------- misc ---------- */
.pre { white-space: pre-line; }
.sticky-save { position: sticky; bottom: calc(var(--tabbar-h) + .6rem + var(--safe-b)); z-index: 5; }
@media (min-width: 1024px) { .sticky-save { bottom: 1rem; } }
html.is-navigating::before { content: ""; position: fixed; z-index: 300; top: 0; inset-inline: 0; height: 3px; background: var(--brand-grad); animation: navbar 1s var(--ease) infinite; transform-origin: left; }
@keyframes navbar { 0% { transform: scaleX(0); } 60% { transform: scaleX(.7); } 100% { transform: scaleX(1); opacity: 0; } }
html.is-navigating main { opacity: .6; transition: opacity .15s; }

/* items in a vertical stack never get squeezed (fixes scrollable rows collapsing inside sheets) */
.stack > *, .portal-view > * { flex-shrink: 0; }
