:root {
  --ink: #1d2b27; --muted: #6d7a74; --line: #e6dfd2; --paper: #faf6ef; --card: #fffdf9;
  --green: #1f3a34; --green-2: #2f564c; --gold: #b08a4f; --gold-soft: #f0e4cd; --blush: #f4e1dc;
  --ok: #2e7d5b; --warn: #b4612a; --bad: #a8433c;
  --serif: 'Cormorant Garamond', Georgia, serif; --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ar: 'Noto Naskh Arabic', 'Geeza Pro', serif;
  --shadow: 0 1px 2px rgba(31,58,52,.05), 0 8px 24px rgba(31,58,52,.06);
}
/* min-width:0 lets grid and flex children shrink instead of pushing the page wider than the screen */
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
:root { color-scheme: only light; }
html { overflow-x: hidden; }
html, body { max-width: 100%; overflow-x: clip; }
body { overflow-wrap: break-word; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; line-height: 1.15; text-wrap: balance; }
h2 { font-size: 30px; } h3 { font-size: 22px; }
p { margin: 0; }
.ar { font-family: var(--ar); direction: rtl; unicode-bidi: isolate; color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 80% -10%, #2f564c 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #3a5f4f 0%, transparent 55%), var(--green); }
.login-card { width: min(420px, 100%); background: var(--card); border-radius: 22px; padding: 40px 32px 32px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.rings { width: 64px; margin: 0 auto 14px; display: block; }
.login-card h1 { font-size: 40px; letter-spacing: .01em; }
.login-card h1 i { color: var(--gold); font-weight: 500; }
.login-card .sub { color: var(--muted); margin: 6px 0 26px; }
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.who button { padding: 14px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-family: var(--serif); font-size: 22px; font-weight: 600; transition: .15s; }
.who button[aria-pressed=true] { border-color: var(--green); background: var(--green); color: #fff; }
.login-card input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 16px; }
.login-card .err { color: var(--bad); min-height: 22px; margin: 8px 0 4px; font-size: 14px; }

/* ---------- shell ---------- */
.top { background: var(--green); color: #f5efe2; padding: 18px 20px 0; position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1120px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 26px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand h1 i { color: #d9b77c; font-weight: 500; }
.brand .cd { font-size: 13px; color: #cfd8d3; }
.userchip { background: rgba(255,255,255,.12); border: 0; color: inherit; border-radius: 999px; padding: 6px 12px 6px 6px; display: flex; align-items: center; gap: 8px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: #d9b77c; color: var(--green); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.tabs { display: flex; gap: 2px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; color: #c5d0cb; padding: 10px 14px 12px; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs button[aria-selected=true] { color: #fff; border-color: #d9b77c; }
main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 90px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.section-head { display: flex; align-items: end; gap: 12px; margin: 28px 0 14px; flex-wrap: wrap; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { flex: 1; }
.btn { border: 1.5px solid var(--green); background: var(--green); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 500; transition: .15s; }
.btn:hover { background: var(--green-2); }
.btn.ghost { background: transparent; color: var(--green); }
.btn.ghost:hover { background: rgba(31,58,52,.06); }
.btn.gold { background: var(--gold); border-color: var(--gold); }
.btn.sm { padding: 6px 11px; border-radius: 9px; font-size: 13px; }
.btn.block { width: 100%; padding: 13px; font-size: 16px; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { border: 0; background: none; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; flex: none; }
.icon-btn:hover { background: rgba(0,0,0,.06); color: var(--bad); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .02em; text-transform: uppercase; }
.in { width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; min-width: 0; }
.in:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px var(--gold-soft); }
.money { position: relative; }
.money .in { padding-right: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.money::after { content: 'JOD'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); pointer-events: none; }
.money.pct::after { content: '%'; }
.money.plain::after { content: ''; } .money.plain .in { padding-right: 11px; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; }
textarea.in { resize: vertical; min-height: 60px; }
/* iPhones draw date boxes wider than their container and centre the text unless told otherwise */
input[type=date].in { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; text-align: left; line-height: 1.4; background: #fff; }
input[type=date].in::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
input[type=date].in::-webkit-calendar-picker-indicator { margin: 0; opacity: .6; }
.field { min-width: 0; }

/* ---------- overview ---------- */
.stat .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }
.stat .v { font-family: var(--serif); font-size: 36px; font-weight: 600; line-height: 1.1; margin-top: 4px; }
.stat .v small { font-size: 15px; font-family: var(--sans); color: var(--muted); font-weight: 400; margin-left: 4px; }
.stat .s { font-size: 13px; color: var(--muted); margin-top: 4px; }
.bar { height: 8px; background: #ece5d6; border-radius: 99px; overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .4s; }
.bar > i.over { background: var(--bad); }
.donut-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.donut { width: 190px; height: 190px; flex: none; }
.legend { flex: 1; min-width: 220px; display: grid; gap: 7px; }
.legend div { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; }
.feed { display: grid; gap: 10px; }
.feed div { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.feed time { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--gold-soft); color: #6f5425; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.pill.green { background: #dcefe6; color: #1e5a41; } .pill.blush { background: var(--blush); color: #8a4a3f; }

/* ---------- expenses ---------- */
.cat { padding: 0; overflow: hidden; }
.cat > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; }
.cat > summary::-webkit-details-marker { display: none; }
.cat .emo { width: 40px; height: 40px; border-radius: 12px; background: var(--gold-soft); display: grid; place-items: center; font-size: 19px; flex: none; }
.cat .ttl { flex: 1; min-width: 0; }
.cat .ttl h3 { font-size: 21px; }
.cat .sum { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.cat .sum small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.cat .chev { color: var(--muted); transition: transform .2s; }
.cat[open] .chev { transform: rotate(90deg); }
.cat-body { border-top: 1px solid var(--line); padding: 6px 20px 18px; }
.cat-note { color: var(--muted); font-size: 13px; padding: 10px 0 4px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 132px 132px 32px 32px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0eadf; }
.row-head { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; padding-bottom: 4px; }
.row-head span:nth-child(2), .row-head span:nth-child(3) { text-align: right; padding-right: 6px; }
.row .nm { min-width: 0; }
.row .nm b { font-weight: 500; }
.row .nm .hint { font-size: 12px; color: var(--muted); }
.row .nm input { font-weight: 500; }
.more { grid-column: 1 / -1; background: #f7f1e6; border-radius: 12px; padding: 14px; display: grid; gap: 12px; }
.quotes { display: grid; gap: 8px; }
.quote { display: grid; grid-template-columns: minmax(0, 1.3fr) 120px minmax(0, 1fr) auto 32px; gap: 8px; align-items: center; }
.quote.best .in { border-color: var(--ok); }
.tag { font-size: 11px; color: var(--ok); font-weight: 600; }
.addrow { margin-top: 12px; }
.hotel-line { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.hotel-line .emo { width: 46px; height: 46px; border-radius: 14px; background: var(--green); display: grid; place-items: center; font-size: 21px; flex: none; }

/* ---------- hotels ---------- */
.hotel { padding: 0; }
.hotel-top { padding: 18px 20px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 32px; gap: 10px; align-items: end; border-bottom: 1px solid var(--line); }
.hotel-top .in.name { font-family: var(--serif); font-size: 22px; font-weight: 600; padding: 6px 10px; }
.hotel-terms { padding: 14px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; background: #fbf7ee; border-bottom: 1px solid var(--line); }
.menus { padding: 16px 20px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.menu { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; background: #fff; position: relative; align-content: start; }
details.terms { border-bottom: 1px solid var(--line); background: #fbf7ee; }
details.terms > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 20px; cursor: pointer; font-weight: 500; }
details.terms > summary::-webkit-details-marker { display: none; }
details.terms > summary small { flex: 1; text-align: right; color: var(--muted); font-weight: 400; font-size: 13px; }
details.terms .chev { color: var(--muted); transition: transform .2s; } details.terms[open] .chev { transform: rotate(90deg); }
details.terms .hotel-terms { border-bottom: 0; border-top: 1px solid var(--line); }
details.menu { display: block; padding: 0; }
details.menu > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .m-ttl { flex: 1; min-width: 0; }
details.menu .m-ttl b { display: block; font-weight: 600; font-size: 16px; }
details.menu .m-ttl span { font-size: 13px; color: var(--muted); }
details.menu .m-tot { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
details.menu .m-tot small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
details.menu .chev { color: var(--muted); transition: transform .2s; }
details.menu[open] .chev { transform: rotate(90deg); }
.menu-body { display: grid; gap: 10px; padding: 0 14px 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.menus { align-items: start; }
.menu.chosen { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.menu-head { display: flex; gap: 6px; align-items: center; }
.drop { border: 1.5px dashed #cfc5b0; border-radius: 12px; padding: 18px 12px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; transition: .15s; display: block; }
.drop:hover, .drop.over { border-color: var(--gold); background: var(--gold-soft); color: #6f5425; }
.drop b { display: block; color: var(--ink); font-weight: 500; font-size: 14px; }
.drop input { display: none; }
.filechip { display: flex; align-items: center; gap: 10px; background: #f5efe2; border-radius: 12px; padding: 9px 10px; font-size: 13px; }
.filechip a { color: var(--green); font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.filechip a:hover { text-decoration: underline; }
.thumb { width: 36px; height: 44px; border-radius: 6px; object-fit: cover; background: #e8dfcc; display: grid; place-items: center; font-size: 10px; font-weight: 600; color: #7b6a45; flex: none; }
.menu .tot { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.menu .tot b { color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.menu.add { border-style: dashed; place-items: center; min-height: 150px; color: var(--muted); cursor: pointer; background: transparent; }
.empty { text-align: center; padding: 46px 20px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto 18px; }

/* ---------- study ---------- */
.hero { background: linear-gradient(135deg, #1f3a34, #2f564c); color: #f5efe2; border: 0; padding: 26px; }
.hero .eyebrow { color: #d9b77c; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.hero h2 { font-size: 34px; margin: 6px 0 10px; }
.hero p { color: #dfe7e3; max-width: 75ch; }
.hero .facts { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 18px; }
.hero .facts div b { display: block; font-family: var(--serif); font-size: 28px; font-weight: 600; color: #fff; }
.hero .facts div span { font-size: 12px; color: #c5d0cb; text-transform: uppercase; letter-spacing: .05em; }
.award { display: grid; gap: 6px; }
.award .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--gold); }
.award h3 { font-size: 22px; }
.rank { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; }
.rank .n { width: 44px; height: 44px; border-radius: 50%; background: var(--gold-soft); color: #6f5425; display: grid; place-items: center; font-family: var(--serif); font-size: 24px; font-weight: 600; }
.rank.first .n { background: var(--gold); color: #fff; }
.rank-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.rank-head h3 { flex: 1; min-width: 180px; }
.rank-head .price { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 18px; margin: 12px 0; }
.score { font-size: 12px; color: var(--muted); }
.score div { display: flex; justify-content: space-between; }
.score b { color: var(--ink); font-variant-numeric: tabular-nums; }
.score .bar { margin-top: 4px; height: 6px; }
.score .bar > i { background: var(--green-2); }
.pc { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; font-size: 14px; }
.pc ul { margin: 4px 0 0; padding-left: 18px; } .pc li { margin: 3px 0; }
.pc h4 { margin: 0; font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .05em; }
.pc .pro h4 { color: var(--ok); } .pc .con h4 { color: var(--warn); }
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 10px; text-align: right; border-bottom: 1px solid #f0eadf; white-space: nowrap; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; white-space: normal; min-width: 160px; position: sticky; left: 0; background: var(--card); }
thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; }
td.top { color: var(--ok); font-weight: 600; }
.hbar { display: grid; grid-template-columns: minmax(110px, 220px) 1fr auto; gap: 12px; align-items: center; font-size: 14px; padding: 6px 0; }
.hbar .trk { height: 22px; background: #f0eadf; border-radius: 7px; overflow: hidden; }
.hbar .trk i { display: block; height: 100%; background: var(--green-2); border-radius: 7px; }
.hbar.low .trk i { background: var(--gold); }
.hbar b { font-variant-numeric: tabular-nums; font-weight: 600; }
.list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 7px; }
.diff { display: grid; gap: 12px; }
.diff div b { display: block; }
details.dishes summary { cursor: pointer; font-weight: 500; padding: 6px 0; }
.course { margin: 8px 0; font-size: 14px; }
.course b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--gold-soft); border-top-color: var(--gold); border-radius: 50%; animation: spin .9s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { background: var(--blush); color: #7a3d33; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.notice.gold { background: var(--gold-soft); color: #6f5425; }

.glance { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid #f0eadf; }
.glance:last-of-type { border-bottom: 0; }
.glance .n { width: 38px; height: 38px; border-radius: 50%; background: var(--gold-soft); color: #6f5425; display: grid; place-items: center; font: 600 21px var(--serif); }
.glance.win .n { background: var(--gold); color: #fff; }
.g-name { font-size: 16px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.g-bar { height: 6px; background: #f0eadf; border-radius: 9px; margin: 7px 0 6px; overflow: hidden; }
.g-bar i { display: block; height: 100%; background: var(--green-2); border-radius: 9px; }
.glance.win .g-bar i { background: var(--gold); }
.g-price { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-price b { display: block; font-size: 17px; } .g-price span { display: block; font-size: 12px; color: var(--muted); }
details.full > summary { list-style: none; display: inline-block; cursor: pointer; }
details.full > summary::-webkit-details-marker { display: none; }
details.full[open] > summary { display: none; }
@media (max-width: 640px) { .glance { grid-template-columns: 34px minmax(0, 1fr); } .glance .g-price { grid-column: 2; text-align: left; } .glance .g-price b, .glance .g-price span { display: inline; margin-right: 8px; } .glance > div:last-child { grid-column: 2; } }

/* ---------- guests ---------- */
.gadd { display: grid; grid-template-columns: minmax(0, 2fr) 90px 130px minmax(0, 1.2fr) auto; gap: 10px; align-items: end; }
.gtools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 10px; }
.gtools .in { max-width: 260px; }
.guest { display: grid; grid-template-columns: minmax(0, 1.6fr) 110px 70px minmax(0, 1fr) 132px 70px auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0eadf; }
.guest.head { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; padding-bottom: 4px; }
.guest .in { padding: 7px 9px; }
.gc { display: block; min-width: 0; } .gc > span { display: none; }
.bnav { display: none; }
.guest .acts { display: flex; gap: 4px; }
.guest .msg { overflow-wrap: anywhere; grid-column: 1 / -1; font-size: 13px; color: var(--muted); background: #f7f1e6; border-radius: 9px; padding: 7px 10px; }
.guest select.s-yes { border-color: var(--ok); color: var(--ok); font-weight: 600; }
.guest select.s-no { border-color: var(--bad); color: var(--bad); font-weight: 600; }
.mini { border: 1.5px solid var(--line); background: #fff; border-radius: 9px; height: 34px; min-width: 34px; padding: 0 9px; font-size: 13px; white-space: nowrap; }
.mini:hover { border-color: var(--gold); background: var(--gold-soft); }
.mini.wa { color: #128c4b; border-color: #bfe3cf; }
@media (max-width: 860px) {
  .gadd { grid-template-columns: 1fr 90px; } .gadd .btn { grid-column: 1 / -1; }
  .guest.head { display: none; }
  .guest { grid-template-columns: minmax(0, 1fr) 70px 70px; gap: 8px; padding: 14px 0; }
  .guest .g-name { grid-column: 1 / -1; } .guest .g-phone { grid-column: 1 / -1; } .guest .acts { grid-column: 1 / -1; }
}

/* ---------- invitation ---------- */
.inv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 440px); gap: 20px; align-items: start; }
.inv-preview { position: sticky; top: 130px; display: grid; gap: 12px; }
.inv-preview canvas { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 18px 50px rgba(31,58,52,.25); display: block; background: #fff; }
.inv-form { display: grid; gap: 16px; }
.inv-form .card { display: grid; gap: 12px; }
.designs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.design { border: 0; background: none; padding: 0; display: grid; gap: 6px; font-size: 12px; color: var(--muted); justify-items: center; }
.design canvas { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 2px 8px rgba(31,58,52,.18); display: block; }
.design[aria-pressed=true] canvas { outline: 3px solid var(--gold); outline-offset: 3px; }
.design[aria-pressed=true] span { color: var(--ink); font-weight: 600; }
.pals { display: flex; gap: 10px; flex-wrap: wrap; }
.pal { border: 0; background: none; padding: 0; display: grid; gap: 5px; justify-items: center; font-size: 11px; color: var(--muted); width: 68px; }
.pal i { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--line); display: block; }
.pal[aria-pressed=true] i { box-shadow: 0 0 0 3px var(--gold); }
.pal[aria-pressed=true] span { color: var(--ink); font-weight: 600; }
.range { width: 100%; accent-color: var(--green); height: 32px; }
.inv-actions { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 8px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 9px 14px; font-weight: 500; }
.seg button[aria-pressed=true] { background: var(--green); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 11px; font-size: 13px; font-family: var(--ar); }
.chip:hover { border-color: var(--gold); background: var(--gold-soft); }
.in[dir=rtl] { font-family: var(--ar); font-size: 16px; }
@media (max-width: 860px) { .inv { grid-template-columns: 1fr; } .inv-preview { position: static; order: -1; max-width: 380px; margin: 0 auto; width: 100%; } }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,30,27,.5); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal .card { width: min(420px, 100%); display: grid; gap: 12px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.saved { font-size: 12px; color: #c5d0cb; margin-left: 4px; white-space: nowrap; }

@media (max-width: 640px) {
  main { padding: 18px 14px 80px; }
  .top { padding: 14px 14px 0; }
  .brand h1 { font-size: 22px; } .brand .cd { display: none; }
  h2 { font-size: 26px; }
  .row { grid-template-columns: minmax(0, 1fr) 96px 32px; }
  .row .paid, .row-head span:nth-child(3) { display: none; }
  .row .del { display: none; }
  .row .money .in { padding-right: 36px; }
  .quote { grid-template-columns: 1fr 100px 32px; } .quote .qnote, .quote .use { grid-column: 1 / -1; }
  .hotel-top { grid-template-columns: 1fr 32px; } .hotel-top .hall { grid-column: 1 / -1; grid-row: 2; }
  .cat > summary, .cat-body { padding-left: 14px; padding-right: 14px; }
  .hero h2 { font-size: 27px; }
  .tbl-wrap { margin: 0 -14px; padding: 0 14px; }
  .hbar { grid-template-columns: 1fr auto; } .hbar .trk { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 0s !important; } }

/* ---------- phone layout ---------- */
@media (max-width: 760px) {
  .rank-head .price, .g-price, .cat .sum, .menu .tot b { white-space: normal; }
  .rank-head h3 { min-width: 0; flex-basis: 100%; }
  .pill { white-space: normal; text-align: left; }
  .cat .sum { max-width: 42%; font-size: 14px; }
  .stat .v { overflow-wrap: anywhere; }
  .filechip a { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .brand h1 { flex: 1 1 auto; } .userchip { flex: none; }
  /* 16px inputs stop iPhones zooming in on every tap */
  .in, select.in, textarea.in, .login-card input, .guest .in { font-size: 16px; }
  .in { padding: 11px 12px; min-height: 46px; } textarea.in { min-height: 80px; }
  .money .in { padding-right: 42px; }
  .top { position: static; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
  .tabs { display: none; }
  .brand h1 { font-size: 23px; } .brand .cd { display: none; }
  .saved { font-size: 11px; }
  main { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  .bnav { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,253,249,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(31,58,52,.08); }
  .bnav button { border: 0; background: none; color: var(--muted); display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 500; border-radius: 12px; min-height: 52px; }
  .bnav svg { width: 23px; height: 23px; }
  .bnav button[aria-current=true] { color: var(--green); background: var(--gold-soft); font-weight: 600; }
  #toast { bottom: calc(86px + env(safe-area-inset-bottom)); }

  h2 { font-size: 27px; } h3 { font-size: 21px; }
  .section-head { margin: 22px 0 12px; gap: 10px; }
  .section-head p { font-size: 14px; }
  .card { padding: 16px; border-radius: 16px; }
  .grid { gap: 12px; }
  .g3 { grid-template-columns: 1fr 1fr; }
  .g2 { grid-template-columns: 1fr; }
  .stat .v { font-size: 30px; } .stat .v small { font-size: 13px; }
  .stat .s { font-size: 12px; }
  .card.g3 > .field:first-child { grid-column: 1 / -1; }
  .g3 > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .btn { min-height: 46px; padding: 11px 16px; } .btn.sm { min-height: 40px; padding: 8px 12px; font-size: 14px; }
  .icon-btn { width: 40px; height: 40px; font-size: 16px; }
  .donut-wrap { justify-content: center; } .donut { width: 170px; height: 170px; }

  /* expenses */
  .cat > summary { padding: 14px; gap: 10px; } .cat-body { padding: 4px 14px 16px; }
  .cat .ttl h3 { font-size: 19px; } .cat .emo { width: 36px; height: 36px; font-size: 17px; }
  .row { grid-template-columns: 1fr 1fr 40px; grid-template-areas: "nm nm nm" "cost paid more"; gap: 8px; padding: 12px 0; }
  .row-head { display: none; }
  .row .nm { grid-area: nm; } .row > .money { grid-area: cost; } .row .paid { display: block; grid-area: paid; } .row > [data-act=more] { grid-area: more; }
  .row .more { grid-column: 1 / -1; }
  .section-head > div[style*="flex:1"] { flex: 1 1 100% !important; }
  .section-head > .btn, .section-head > label.btn { flex: 1 1 0; justify-content: center; text-align: center; }
  h1, h2, h3, .btn, .bnav span, .field > span { overflow-wrap: normal; word-break: normal; }
  .row .nm b { font-size: 15px; }
  .more { padding: 12px; } .more .g3 { grid-template-columns: 1fr; }
  .quote { grid-template-columns: minmax(0, 1fr) 112px 40px; }
  .hotel-line { gap: 10px; } .hotel-line > div[style*="width:132px"] { width: 100% !important; }

  /* hotels */
  details.terms > summary { padding: 12px 14px; }
  .hotel-top { padding: 14px; } .hotel-terms { padding: 14px; grid-template-columns: 1fr 1fr; }
  .hotel-terms > .field:first-child { grid-column: 1 / -1; }
  .menus { padding: 14px; grid-template-columns: 1fr; }
  .menu.add { min-height: 64px; }
  .section-head .btn.gold { width: 100%; }

  /* study */
  .hero { padding: 20px 16px; } .hero h2 { font-size: 26px; }
  .hero .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; } .hero .facts div b { font-size: 23px; }
  .hero .btn { width: 100%; }
  .rank { grid-template-columns: 1fr; } .rank .n { width: 36px; height: 36px; font-size: 20px; }
  .glance .btn { width: 100%; }

  /* guests */
  .gadd { grid-template-columns: 1fr 1fr; } .gadd > label:first-child { grid-column: 1 / -1; } .gadd .btn { grid-column: 1 / -1; }
  .gadd > label:nth-child(4) { grid-column: 1 / -1; }
  .gtools { gap: 8px; margin: 14px 0 10px; } .gtools .in { max-width: none; width: 100%; }
  .gtools .seg { width: 100%; display: grid; grid-template-columns: repeat(4, auto); } .gtools .seg button { padding: 10px 6px; font-size: 14px; }
  .gtools > span { display: none; } .gtools .btn { flex: 1; }
  .guest { grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 14px 0; }
  .gc > span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; margin-bottom: 3px; }
  .gc.g-name, .gc.g-phone { grid-column: 1 / -1; }
  .gc.g-name .in { font-weight: 600; }
  .gc.g-side { display: none; }
  .gc.g-status { grid-column: span 1; }
  .guest .acts { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 44px; gap: 8px; }
  .mini { height: 44px; font-size: 14px; font-weight: 500; }
  .guest { grid-template-areas: "name name name" "status seats coming" "phone phone phone" "acts acts acts"; }
  .gc.g-name { grid-area: name; } .gc.g-status { grid-area: status; } .gc.g-seats { grid-area: seats; } .gc.g-coming { grid-area: coming; } .gc.g-phone { grid-area: phone; } .guest .acts { grid-area: acts; }
  .guest .msg { grid-column: 1 / -1; }

  /* invitation */
  .inv-preview { max-width: 340px; } .inv-preview > div { position: static; }
  .seg { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; } .seg button { padding: 10px 4px; font-size: 14px; }
  .inv-form .g3 { grid-template-columns: 1fr 1fr; }
  .designs { grid-template-columns: repeat(3, 1fr); } .pals { gap: 6px; justify-content: space-between; } .pal { width: 23%; }
  .inv-actions { grid-template-columns: 1fr 1fr; } .inv-actions .btn:first-child { grid-column: 1 / -1; }
  .section-head label.btn { flex: 1; justify-content: center; } .section-head .btn.ghost { flex: 1; }
  .modal { align-items: end; padding: 0; } .modal .card { width: 100%; border-radius: 20px 20px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
}

@media (max-width: 380px) {
  main { padding-left: 12px; padding-right: 12px; }
  .cat .emo { display: none; }
  .cat .ttl h3 { font-size: 18px; }
  .stat .v { font-size: 26px; }
  .card { padding: 14px; }
  .bnav button { font-size: 10px; } .bnav svg { width: 21px; height: 21px; }
  .gtools .seg button { font-size: 13px; padding: 10px 2px; }
  .designs { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hero .facts div b { font-size: 21px; }
}
