/* Jomi Business — app styles. Same palette and type as jomistudio.tj: ink, cream, mint green,
   Inter Tight, pill buttons, 16–24 px radii. Phone-first: 44 px targets, 16 px inputs (no iOS zoom),
   bottom tabs; a left rail from 900 px. */

@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-tight-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-tight-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-tight-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

:root {
  --ink: #1F1D24; --ink-2: #141318; --cream: #F6F1E9; --green: #4FC59A; --green-ink: #1F7049; --mint: #E3F5EC; --lavender: #ECE9F8; --grey: #EFEFF1;
  --bg: #F6F1E9; --card: #FFFFFF; --card-2: #FBF8F3; --text: #1F1D24; --muted: #66626C; --line: rgba(31, 29, 36, .12); --line-strong: rgba(31, 29, 36, .22);
  --primary: #1F1D24; --primary-text: #FFFFFF; --accent: #4FC59A; --accent-text: #0F2A1F;
  --sky: #2B5872; --sky-bg: #E1ECF2; --amber: #85590A; --amber-bg: #F8ECD2; --ok: #1F7049; --ok-bg: #E3F5EC; --danger: #B4382A; --danger-bg: #F8E6DF;
  --radius: 18px; --radius-sm: 12px; --gutter: 16px; --column: 720px; --nav-h: 0px; --top-h: 56px;
  --ease: cubic-bezier(.65, 0, .25, 1); --ease-out: cubic-bezier(.16, 1, .3, 1); --dur: 180ms;
  --font: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141318; --card: #1F1D24; --card-2: #26242C; --text: #F6F1E9; --muted: #AAA6B0; --line: rgba(246, 241, 233, .12); --line-strong: rgba(246, 241, 233, .24);
    --primary: #F6F1E9; --primary-text: #1F1D24; --mint: #1C3A2C; --lavender: #2A2838; --grey: #26242C;
    --sky: #9CC7E0; --sky-bg: #1E2F3B; --amber: #E8B860; --amber-bg: #3A2E14; --ok: #4FC59A; --ok-bg: #1C3A2C; --danger: #F08A7C; --danger-bg: #3E1F1A; --green-ink: #4FC59A;
  }
}
:root[data-theme="dark"] {
  --bg: #141318; --card: #1F1D24; --card-2: #26242C; --text: #F6F1E9; --muted: #AAA6B0; --line: rgba(246, 241, 233, .12); --line-strong: rgba(246, 241, 233, .24);
  --primary: #F6F1E9; --primary-text: #1F1D24; --mint: #1C3A2C; --lavender: #2A2838; --grey: #26242C;
  --sky: #9CC7E0; --sky-bg: #1E2F3B; --amber: #E8B860; --amber-bg: #3A2E14; --ok: #4FC59A; --ok-bg: #1C3A2C; --danger: #F08A7C; --danger-bg: #3E1F1A; --green-ink: #4FC59A;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body.has-sheet { overflow: hidden; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { width: 20px; height: 20px; flex: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num, .money, .stat__value, .timer { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.mt { margin-top: 12px; } .mt-l { margin-top: 20px; } .mb { margin-bottom: 12px; }
.flex { display: flex; gap: 8px; align-items: center; } .flex--between { justify-content: space-between; } .flex--wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 380px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar__inner { display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 var(--gutter); max-width: var(--column); margin: 0 auto; }
.topbar__brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-decoration: none; }
.topbar__mark { width: 28px; height: 28px; flex: none; }
.topbar__name { font-weight: 600; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__sub { display: block; font-size: 11px; color: var(--muted); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; }
.topbar__chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500; text-decoration: none; background: var(--mint); color: var(--green-ink); border: 1px solid transparent; }
.topbar__chip--warn { background: var(--amber-bg); color: var(--amber); }
.topbar__chip--danger { background: var(--danger-bg); color: var(--danger); }
.offline { background: var(--amber-bg); color: var(--amber); font-size: 13px; text-align: center; padding: 6px var(--gutter); }

.main { flex: 1; width: 100%; max-width: var(--column); margin: 0 auto; padding: 16px var(--gutter) calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
.main--wide { max-width: 1080px; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; padding: 4px 4px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tab { flex: 1 1 0; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; padding: 6px 2px; border-radius: 14px; color: var(--muted); font-size: 11.5px; font-weight: 500; text-decoration: none; letter-spacing: 0; }
.tab .icon { width: 24px; height: 24px; stroke-width: 1.6; }
.tab.is-on { color: var(--text); }
.tab.is-on .icon { color: var(--green-ink); stroke-width: 2; }
.tab__badge { position: absolute; top: 4px; right: 50%; transform: translateX(16px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.tab { position: relative; }
body { --nav-h: calc(64px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  body { --nav-h: 0px; }
  .shell { flex-direction: row; }
  .tabs { position: sticky; top: 0; bottom: auto; left: auto; flex-direction: column; width: 220px; height: 100dvh; padding: 16px 12px; border-top: 0; border-right: 1px solid var(--line); gap: 2px; }
  .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 0 14px; font-size: 15px; }
  .tab.is-on { background: var(--mint); }
  .tab__badge { position: static; transform: none; margin-left: auto; }
  .tabs__brand { display: flex; align-items: center; gap: 10px; padding: 4px 14px 18px; font-weight: 600; }
  .tabs__brand img { width: 30px; height: 30px; }
  .shell__content { flex: 1; min-width: 0; }
}
.tabs__brand { display: none; }
@media (min-width: 900px) { .tabs__brand { display: flex; } }

/* ---------- Page ---------- */
.page__head { display: flex; align-items: center; gap: 10px; margin: 2px 0 16px; }
.page__titles { flex: 1; min-width: 0; }
.page__title { font-size: 24px; line-height: 1.15; font-weight: 600; letter-spacing: -.025em; }
.page__sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.page__actions { display: flex; gap: 8px; flex: none; }
.page__back { margin-left: -8px; }
.section-title { font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 500; font-size: 15px; line-height: 1.2; white-space: nowrap; transition: transform var(--dur) var(--ease-out), background-color var(--dur), opacity var(--dur); text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--primary); color: var(--primary-text); }
.btn--accent { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn--secondary { background: var(--card); border-color: var(--line-strong); color: var(--text); }
.btn--ghost { background: transparent; color: var(--text); }
.btn--ghost:hover { background: var(--grey); }
.btn--danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn--danger-solid { background: var(--danger); color: #fff; }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn--xl { min-height: 56px; font-size: 17px; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; animation: spin .8s linear infinite; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 999px; color: var(--text); }
.icon-btn:hover { background: var(--grey); }
.icon-btn:disabled { opacity: .35; }
.icon-btn--danger { color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards, rows, stats ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card--tight { padding: 8px 0; }
.card--mint { background: var(--mint); border-color: transparent; }
.card--lavender { background: var(--lavender); border-color: transparent; }
.card--ink { background: var(--ink); color: var(--cream); border-color: transparent; }
.card--ink .muted, .card--ink .bar span, .card--ink .stat__label { color: #AAA6B0; }
.card--ink .bar.is-today span { color: var(--cream); }
.card__title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.row:last-child { border-bottom: 0; }
button.row:hover { background: var(--card-2); }
.row__lead { flex: none; }
.row__main { flex: 1; min-width: 0; }
.row__title { font-weight: 500; overflow-wrap: anywhere; }
.row__sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.row__right { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.row .icon { color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; background: var(--lavender); color: var(--ink); font-weight: 600; font-size: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: var(--cream); } }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); width: 100%; min-width: 0; }
.stat--mint { background: var(--mint); border-color: transparent; }
.stat--lavender { background: var(--lavender); border-color: transparent; }
.stat--ink { background: var(--ink); color: var(--cream); border-color: transparent; }
.stat--ink .stat__label, .stat--ink .stat__sub { color: #AAA6B0; }
.stat--amber { background: var(--amber-bg); border-color: transparent; }
.stat--danger { background: var(--danger-bg); border-color: transparent; }
.stat__label { font-size: 13px; color: var(--muted); }
.stat__value { font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.stat__value--xl { font-size: 36px; }
.stat__sub { font-size: 12.5px; color: var(--muted); }
button.stat:hover { border-color: var(--line-strong); }
.money small { font-weight: 400; color: var(--muted); font-size: .72em; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 15px; }
.kv__k { color: var(--muted); }
.kv__v { font-variant-numeric: tabular-nums; text-align: right; }
.kv--strong { font-weight: 600; font-size: 17px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--grey); color: var(--muted); }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--sky { background: var(--sky-bg); color: var(--sky); }
.badge--amber { background: var(--amber-bg); color: var(--amber); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--ink { background: var(--ink); color: var(--cream); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.field__hint { font-size: 12.5px; color: var(--muted); }
input[type="text"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--card); color: var(--text); font-size: 16px; appearance: none; -webkit-appearance: none;
}
textarea { min-height: 72px; resize: vertical; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2377737D' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input.is-invalid { border-color: var(--danger); }
.form__error { background: var(--danger-bg); color: var(--danger); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; cursor: pointer; }
.toggle__text { display: flex; flex-direction: column; gap: 2px; }
.toggle__switch { position: relative; flex: none; width: 48px; height: 28px; }
.toggle__switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.toggle__switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background var(--dur); }
.toggle__switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease-out); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle__switch input:checked + i { background: var(--green); }
.toggle__switch input:checked + i::after { transform: translateX(20px); }
.toggle__switch input:focus-visible + i { outline: 3px solid var(--accent); outline-offset: 2px; }
.search { position: relative; margin-bottom: 12px; }
.search input { padding-left: 42px; border-radius: 999px; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ---------- Segmented, chips ---------- */
.segment { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--grey); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.segment::-webkit-scrollbar { display: none; }
.segment__btn { flex: 1 0 auto; min-height: 38px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.segment__btn.is-on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.segment__count { font-size: 12px; background: var(--grey); padding: 0 6px; border-radius: 999px; }
.segment__btn.is-on .segment__count { background: var(--mint); color: var(--green-ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; margin-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); font-size: 14px; font-weight: 500; }
.chip.is-on { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* ---------- States ---------- */
.state { padding: 40px 16px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.state__title { color: var(--text); font-weight: 500; font-size: 16px; }
.state__hint { font-size: 14px; max-width: 320px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--green); animation: spin .8s linear infinite; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); z-index: 60; max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 14.5px; font-weight: 500; opacity: 0; transition: opacity var(--dur), transform var(--dur) var(--ease-out); pointer-events: none; text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast--error { background: var(--danger); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: var(--cream); color: var(--ink); } }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- Sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(20, 19, 24, .45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity var(--dur); }
.sheet.is-on { opacity: 1; }
.sheet__panel { width: 100%; max-width: 560px; max-height: 92dvh; display: flex; flex-direction: column; background: var(--card); color: var(--text); border-radius: 24px 24px 0 0; transform: translateY(24px); transition: transform var(--dur) var(--ease-out); padding-bottom: env(safe-area-inset-bottom); }
.sheet.is-on .sheet__panel { transform: none; }
.sheet__grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 8px auto 0; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 4px 20px; }
.sheet__title { font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.sheet__body { padding: 8px 20px 12px; overflow: auto; -webkit-overflow-scrolling: touch; }
.sheet__text { color: var(--muted); font-size: 15px; }
.sheet__actions { display: flex; gap: 8px; padding: 8px 20px 16px; }
.sheet__actions .btn { flex: 1; }
@media (min-width: 900px) { .sheet { align-items: center; } .sheet__panel { border-radius: 24px; } }

/* ---------- Tables board ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.tcard { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 22px; border: 2px solid var(--line); background: var(--card); text-align: left; width: 100%; min-height: 150px; transition: transform var(--dur) var(--ease-out); }
.tcard:active { transform: scale(.985); }
.tcard--free { border-color: color-mix(in srgb, var(--green) 55%, transparent); }
.tcard--busy { border-color: color-mix(in srgb, var(--sky) 60%, transparent); background: color-mix(in srgb, var(--sky-bg) 55%, var(--card)); }
.tcard--awaiting { border-color: color-mix(in srgb, var(--amber) 60%, transparent); background: color-mix(in srgb, var(--amber-bg) 60%, var(--card)); }
.tcard__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tcard__name { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.tcard__rate { font-size: 13px; color: var(--muted); }
.timer { font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1; margin: 4px 0; }
.tcard__sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); }
.tcard__sum b { font-size: 20px; color: var(--text); font-weight: 600; }
.tcard .btn { margin-top: auto; }

/* ---------- POS ---------- */
.pos { display: grid; gap: 12px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.ptile { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 76px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-align: left; transition: transform var(--dur) var(--ease-out); }
.ptile:active { transform: scale(.97); }
.ptile__name { font-size: 14.5px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.ptile__price { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ptile__qty { position: absolute; top: 6px; right: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.ptile { position: relative; }
.ptile.is-in { border-color: var(--green); background: color-mix(in srgb, var(--mint) 60%, var(--card)); }
.cartbar { position: fixed; left: var(--gutter); right: var(--gutter); bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 20px; border-radius: 999px; background: var(--ink); color: var(--cream); box-shadow: 0 14px 34px -14px rgba(20, 19, 24, .5); max-width: calc(var(--column) - 2 * var(--gutter)); margin: 0 auto; }
.cartbar b { font-size: 19px; font-weight: 600; }
.cartbar .btn { min-height: 44px; }
@media (min-width: 900px) { .cartbar { bottom: 20px; left: 240px; } }
.line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line__name { flex: 1; min-width: 0; }
.line__price { font-size: 13px; color: var(--muted); }
.qty { display: inline-flex; align-items: center; gap: 2px; }
.qty button { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line-strong); display: grid; place-items: center; background: var(--card); }
.qty b { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.line__total { min-width: 70px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Pay sheet ---------- */
.paygrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.paybtn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font-weight: 500; font-size: 14.5px; }
.paybtn.is-on { border-color: var(--green); background: color-mix(in srgb, var(--mint) 70%, var(--card)); }
.paybtn .icon { width: 24px; height: 24px; }
.paytotal { text-align: center; margin: 4px 0 16px; }
.paytotal b { display: block; font-size: 40px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.paytotal span { color: var(--muted); font-size: 14px; }

/* ---------- Bars (mini charts) ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 72px; padding-top: 6px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar i { display: block; width: 100%; min-height: 3px; border-radius: 6px 6px 3px 3px; background: var(--green); opacity: .85; }
.bar i.is-zero { background: var(--line-strong); }
.bar span { font-size: 11px; color: var(--muted); }
.bar.is-today span { color: var(--text); font-weight: 600; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 6px 0; }
.hbar__name { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar__val { font-size: 14.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.hbar__track { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--grey); overflow: hidden; }
.hbar__track i { display: block; height: 100%; border-radius: 6px; background: var(--green); }

/* ---------- Realty grid ---------- */
.flats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.flat { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-align: left; min-height: 72px; }
.flat__name { font-weight: 600; font-size: 14px; }
.flat__sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flat--reserved { background: var(--amber-bg); border-color: transparent; }
.flat--sold { background: var(--danger-bg); border-color: transparent; }
.flat--closed { opacity: .5; }
.flat--late { outline: 2px solid var(--danger); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 5px; border: 1px solid var(--line); background: var(--card); }
.legend i.l-reserved { background: var(--amber-bg); } .legend i.l-sold { background: var(--danger-bg); }

/* ---------- Plans ---------- */
.plan { border: 2px solid var(--line); border-radius: 22px; padding: 18px; margin-bottom: 12px; background: var(--card); }
.plan.is-current { border-color: var(--green); }
.plan.is-hot { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.plan.is-hot .muted, .plan.is-hot .plan__price small, .plan.is-hot .small { color: #AAA6B0; }
.plan__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.plan__name { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.plan__price { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.plan__price small { font-size: 13px; font-weight: 400; color: var(--muted); }
.plan ul { margin: 12px 0; display: grid; gap: 6px; font-size: 14.5px; }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li .icon { width: 18px; height: 18px; color: var(--green); margin-top: 2px; }

/* ---------- Receipt ---------- */
.receipt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: #fff; color: #000; padding: 16px; border-radius: 12px; max-width: 320px; margin: 0 auto; }
.receipt h3 { font-size: 15px; text-align: center; margin-bottom: 4px; }
.receipt .r { display: flex; justify-content: space-between; gap: 8px; }
.receipt .r.total { border-top: 1px dashed #000; margin-top: 6px; padding-top: 6px; font-weight: 700; }
.receipt .c { text-align: center; color: #555; }
@media print {
  body * { visibility: hidden; }
  .receipt, .receipt * { visibility: visible; }
  .receipt { position: absolute; left: 0; top: 0; width: 80mm; max-width: none; border-radius: 0; padding: 4mm; }
  .qrcards, .qrcards * { visibility: visible; }
  .qrcards { position: absolute; left: 0; top: 0; width: 100%; }
}

/* ---------- QR cards ---------- */
.qrcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.qrcard { border: 1px solid #ccc; border-radius: 12px; padding: 12px; text-align: center; background: #fff; color: #000; break-inside: avoid; }
.qrcard svg { width: 100%; height: auto; }
.qrcard b { display: block; font-size: 18px; margin-bottom: 4px; }
.qrcard small { display: block; font-size: 11px; color: #555; margin-top: 4px; }

/* ---------- Login ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter) max(24px, env(safe-area-inset-bottom)); }
.auth__card { width: 100%; max-width: 420px; }
.auth__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth__brand img { width: 44px; height: 44px; }
.auth__brand b { font-size: 20px; letter-spacing: -.01em; }
.auth__brand span { display: block; font-size: 13px; color: var(--muted); }
.auth h1 { font-size: 28px; letter-spacing: -.03em; font-weight: 600; line-height: 1.1; margin-bottom: 6px; }
.auth__sub { color: var(--muted); margin-bottom: 18px; }
.auth__links { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; text-align: center; font-size: 14.5px; }
.auth__links a { text-decoration: underline; text-underline-offset: 3px; }
.auth__credit { margin-top: 28px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ---------- Misc ---------- */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 12px; font-size: 14.5px; }
.banner--mint { background: var(--mint); color: var(--green-ink); }
.banner--amber { background: var(--amber-bg); color: var(--amber); }
.banner--danger { background: var(--danger-bg); color: var(--danger); }
.banner .btn { flex: none; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.todo { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }
.todo__check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.todo__check.is-done { background: var(--green); border-color: var(--green); color: var(--accent-text); }
.todo__text { flex: 1; min-width: 0; }
.todo__text.is-done { text-decoration: line-through; color: var(--muted); }
.todo__sub { font-size: 12.5px; color: var(--muted); }
.todo__sub.is-late { color: var(--danger); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; letter-spacing: .08em; background: var(--grey); padding: 8px 12px; border-radius: 10px; display: inline-block; }
.bigcode { font-size: 28px; font-weight: 600; letter-spacing: .06em; }
.period { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.period input[type="date"] { min-height: 40px; padding: 6px 10px; font-size: 14px; }
.schedule { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.schedule th, .schedule td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.schedule th:first-child, .schedule td:first-child { text-align: left; }
.schedule tr.is-paid td { color: var(--muted); }
.schedule tr.is-late td { color: var(--danger); }
.tablewrap { overflow-x: auto; }
.progress { height: 8px; border-radius: 8px; background: var(--grey); overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Photos, queue chip ---------- */
.thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--grey); }
.photo-prev { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; background: var(--grey); flex: none; }
.topbar__queue:empty { display: none; }
.topbar__queue .topbar__chip { margin-right: 6px; }
