/* ============================================================
   Daily 2 Door — UI styles (mobile-first, 3D buttons)
   ============================================================ */
:root {
  --green: #16a34a; --green-d: #0f7a36; --green-l: #dcfce7;
  --brand: #e3141b; --brand-d: #8e0a0e; --brand-l: #fee4e2; --brand-ink: #111111; --brand-tint: #fff5f4;
  --orange: #f97316; --orange-d: #c2560c; --orange-l: #ffedd5;
  --blue: #2563eb; --blue-d: #1a48b0; --blue-l: #dbeafe;
  --red: #e11d48; --red-d: #a8123a; --red-l: #ffe4e6;
  --purple: #7c3aed; --purple-d: #5b21b6; --purple-l: #ede9fe;
  --amber: #d97706; --amber-l: #fef3c7;
  --teal: #0d9488; --teal-l: #ccfbf1;
  --indigo: #4f46e5; --indigo-l: #e0e7ff;
  --gray: #64748b; --gray-l: #f1f5f9;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b;
  --bg: #f5f5f6; --card: #ffffff; --line: #e2e8f0;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px rgba(15,23,42,.07);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.14);
  --side-w: 260px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-d); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }
h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .tiny { font-size: .72rem; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: .5rem } .mt-2 { margin-top: 1rem } .mt-3 { margin-top: 1.5rem }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: .5rem } .mb-2 { margin-bottom: 1rem }
.flex { display: flex; gap: .6rem; align-items: center; } .flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.hide { display: none !important; }
.ic { flex-shrink: 0; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 60;
  background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%); color: #e5e5e5;
  display: flex; flex-direction: column; transform: translateX(-100%); transition: transform .25s ease;
  padding-top: env(safe-area-inset-top, 0px);
}
.sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
.brand { display: flex; gap: .75rem; align-items: center; padding: 1.1rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.brand strong { display: block; color: #fff; font-size: 1.05rem; }
.brand small { color: #fca5a5; font-size: .75rem; }
.side-nav { padding: .75rem; overflow-y: auto; flex: 1; }
.side-nav a {
  display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; margin-bottom: .25rem;
  color: #e5e5e5; border-radius: 12px; font-weight: 500; font-size: .93rem; position: relative;
}
.side-nav a:hover { background: rgba(255,255,255,.07); }
.side-nav a.active { background: linear-gradient(180deg, #ff3b30, #e3141b); color: #fff; box-shadow: 0 4px 0 var(--brand-d); }
.side-nav .count { margin-left: auto; background: var(--orange); color: #fff; border-radius: 99px; padding: 0 .5rem; font-size: .75rem; }
.scrim { position: fixed; inset: 0; background: rgba(2,6,23,.45); z-index: 55; opacity: 0; pointer-events: none; transition: .2s; }
.scrim.show { opacity: 1; pointer-events: auto; }

.main { min-height: 100vh; padding-bottom: calc(84px + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: .6rem;
  padding: calc(.6rem + env(safe-area-inset-top, 0px)) 1rem .6rem;
  background: rgba(255,255,255,.88); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.1rem; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: .45rem; align-items: center; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 13px; border: 0; display: grid; place-items: center; cursor: pointer;
  background: #fff; color: var(--ink); box-shadow: 0 3px 0 #d6dde6, 0 4px 10px rgba(15,23,42,.06); position: relative;
  transition: transform .08s, box-shadow .08s;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 0 0 #d6dde6; }
.icon-btn .dot, .bottom-nav .dot {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
  background: var(--orange); color: #fff; font-size: .7rem; display: grid; place-items: center; font-style: normal;
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #2a2a2a, #0a0a0a); color: #fff; font-weight: 700; box-shadow: 0 3px 0 var(--brand);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.content { padding: 1rem; max-width: 1180px; margin: 0 auto; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: space-around;
  background: #fff; border-top: 1px solid var(--line); padding: .35rem .25rem calc(.35rem + var(--safe-b));
  box-shadow: 0 -6px 20px rgba(15,23,42,.06);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .35rem 0; border-radius: 12px;
  color: var(--muted); font-size: .7rem; font-weight: 500; position: relative;
}
.bottom-nav a .dot { top: 0; right: calc(50% - 22px); }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav a.active .ic { transform: translateY(-2px); filter: drop-shadow(0 3px 0 rgba(227,20,27,.25)); }

@media (min-width: 992px) {
  .sidebar { transform: none; }
  .main { margin-left: var(--side-w); padding-bottom: 2rem; }
  .bottom-nav, .menu-btn, .scrim { display: none !important; }
  .content { padding: 1.5rem 2rem; }
  .topbar { padding-left: 2rem; padding-right: 2rem; }
}

/* ---------- 3D Buttons ---------- */
.btn {
  --c: var(--brand); --cd: var(--brand-d); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .72rem 1.15rem; border: 0; border-radius: 14px; cursor: pointer; font: inherit; font-weight: 600; font-size: .92rem;
  color: var(--fg); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 82%, #fff) 0%, var(--c) 55%);
  box-shadow: 0 5px 0 var(--cd), 0 9px 16px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.35);
  transform: translateY(0); transition: transform .07s ease, box-shadow .07s ease, filter .15s;
  text-shadow: 0 1px 0 rgba(0,0,0,.12); white-space: nowrap; user-select: none; margin-bottom: 5px; line-height: 1.2;
}
.btn:hover { filter: brightness(1.05); }
.btn:active, .btn.pressed { transform: translateY(5px); box-shadow: 0 0 0 var(--cd), 0 2px 5px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.2); }
.btn:disabled, .btn.disabled { filter: grayscale(.8) opacity(.6); pointer-events: none; }
.btn-primary { --c: var(--brand); --cd: var(--brand-d); }
.btn-green { --c: var(--green); --cd: var(--green-d); }
.btn-orange { --c: var(--orange); --cd: var(--orange-d); }
.btn-blue { --c: var(--blue); --cd: var(--blue-d); }
.btn-red { --c: var(--red); --cd: var(--red-d); }
.btn-purple { --c: var(--purple); --cd: var(--purple-d); }
.btn-light { --c: #ffffff; --cd: #cfd8e3; --fg: var(--ink); text-shadow: none; background: linear-gradient(180deg, #fff, #f5f7fa); }
.btn-dark { --c: #1e293b; --cd: #020617; }
.btn-sm { padding: .45rem .75rem; font-size: .8rem; border-radius: 11px; box-shadow: 0 4px 0 var(--cd), 0 6px 10px rgba(15,23,42,.14); margin-bottom: 4px; }
.btn-sm:active { transform: translateY(4px); }
.btn-lg { padding: 1rem 1.5rem; font-size: 1.05rem; border-radius: 16px; }
.btn-block { display: flex; width: 100%; }
.btn-round { width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-start; }
.btn-row > form { margin: 0; }

/* ---------- Cards & stats ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; margin-bottom: 1rem; border: 1px solid rgba(226,232,240,.7); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .8rem; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  border-radius: var(--radius); padding: 1rem; color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 6px 0 rgba(0,0,0,.14), var(--shadow);
}
.stat::after { content: ''; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255,255,255,.14); }
.stat .label { font-size: .78rem; opacity: .92; font-weight: 500; }
.stat .value { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.stat .sub { font-size: .72rem; opacity: .85; }
.stat.green { background: linear-gradient(135deg, #22c55e, #15803d); }
.stat.orange { background: linear-gradient(135deg, #fb923c, #ea580c); }
.stat.blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat.purple { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.stat.red { background: linear-gradient(135deg, #fb7185, #be123c); }
.stat.teal { background: linear-gradient(135deg, #2dd4bf, #0f766e); }
.stat.dark { background: linear-gradient(135deg, #334155, #0f172a); }

/* ---------- Badges / alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .18rem .6rem; border-radius: 99px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.badge-blue { background: var(--blue-l); color: var(--blue-d); }
.badge-amber { background: var(--amber-l); color: #92400e; }
.badge-purple { background: var(--purple-l); color: var(--purple-d); }
.badge-teal { background: var(--teal-l); color: #115e59; }
.badge-indigo { background: var(--indigo-l); color: #3730a3; }
.badge-orange { background: var(--orange-l); color: var(--orange-d); }
.badge-green { background: var(--green-l); color: var(--green-d); }
.badge-red { background: var(--red-l); color: var(--red-d); }
.badge-gray { background: var(--gray-l); color: var(--gray); }
.alert { padding: .8rem 1rem; border-radius: 14px; margin-bottom: 1rem; font-weight: 500; font-size: .9rem; border: 1px solid transparent; }
.alert-success { background: var(--green-l); color: var(--green-d); border-color: #bbf7d0; }
.alert-error { background: var(--red-l); color: var(--red-d); border-color: #fecdd3; }
.alert-info { background: var(--blue-l); color: var(--blue-d); border-color: #bfdbfe; }
.alert-warn { background: var(--amber-l); color: #92400e; border-color: #fde68a; }

/* ---------- Forms ---------- */
.field { margin-bottom: .9rem; }
.field label, .label { display: block; font-weight: 600; font-size: .83rem; margin-bottom: .35rem; color: var(--ink-2); }
.input, input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=month], input[type=search], select, textarea {
  width: 100%; padding: .75rem .9rem; border: 2px solid var(--line); border-radius: 13px; font: inherit; font-size: .95rem;
  background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; box-shadow: inset 0 2px 0 rgba(15,23,42,.03);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(227,20,27,.14); }
textarea { min-height: 90px; resize: vertical; }
input[type=file] { width: 100%; padding: .6rem; border: 2px dashed var(--line); border-radius: 13px; background: #fafcfb; font: inherit; font-size: .85rem; }
.form-row { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .form-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; flex: 1; min-width: 130px; }
.help { font-size: .76rem; color: var(--muted); margin-top: .25rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -1.1rem; padding: 0 1.1rem; }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: .6rem .5rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: .7rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--gray-l); display: grid; place-items: center; font-size: 1.3rem; }

/* ---------- Tabs / chips ---------- */
.tabs { display: flex; gap: .45rem; overflow-x: auto; padding: .2rem .1rem .6rem; margin-bottom: .6rem; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: .5rem .95rem; border-radius: 99px; background: #fff; color: var(--ink-2); font-weight: 600; font-size: .83rem; white-space: nowrap;
  box-shadow: 0 3px 0 #d6dde6; border: 1px solid var(--line); transition: transform .07s;
}
.tab:active { transform: translateY(3px); box-shadow: none; }
.tab.active { background: var(--brand-ink); color: #fff; box-shadow: 0 3px 0 var(--brand); border-color: var(--brand-ink); }
.tab .n { opacity: .75; margin-left: .25rem; }

/* ---------- Product grid (3 columns) ---------- */
.search-bar { position: relative; margin-bottom: .8rem; }
.search-bar input { padding-left: 2.6rem; border-radius: 99px; }
.search-bar .ic { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.hero {
  border-radius: 22px; padding: 1.2rem; color: #fff; margin-bottom: 1rem; position: relative; overflow: hidden;
  background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.25), transparent 40%), linear-gradient(135deg, #151515 0%, #2b2b2b 45%, #e3141b 130%);
  box-shadow: 0 8px 0 var(--brand-d), var(--shadow);
}
.hero h2 { font-size: 1.25rem; margin-bottom: .2rem; }
.hero p { margin: 0; opacity: .92; font-size: .88rem; }
.hero .hero-emoji { position: absolute; right: .8rem; bottom: .3rem; font-size: 3.4rem; filter: drop-shadow(0 6px 6px rgba(0,0,0,.2)); }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
@media (min-width: 600px) { .product-grid { gap: 1rem; } }
.p-card {
  background: #fff; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; position: relative;
  box-shadow: 0 4px 0 #e0e6ee, 0 8px 18px rgba(15,23,42,.07); border: 1px solid #eef2f6; transition: transform .15s;
  color: inherit;
}
.p-card:active { transform: translateY(3px); box-shadow: 0 1px 0 #e0e6ee; }
.p-img { aspect-ratio: 1 / 1; background: linear-gradient(135deg, #fafafa, #fff1f0); display: grid; place-items: center; overflow: hidden; }
.p-img img { width: 100%; height: 100%; object-fit: cover; }
.p-img .ph { font-size: 2.4rem; }
@media (min-width: 600px) { .p-img .ph { font-size: 3.6rem; } }
.p-body { padding: .45rem .5rem .55rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.p-name { font-weight: 600; font-size: .78rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.p-price { font-weight: 800; color: var(--brand); font-size: .82rem; }
.p-price.ask { color: var(--purple); font-size: .72rem; }
.p-unit { font-size: .66rem; color: var(--muted); }
.p-tag { position: absolute; top: .4rem; left: .4rem; background: var(--orange); color: #fff; font-size: .6rem; font-weight: 700; padding: .12rem .45rem; border-radius: 99px; box-shadow: 0 2px 0 var(--orange-d); }
a.p-add, .p-add {
  position: absolute; right: .4rem; top: .4rem; width: 32px; height: 32px; border-radius: 11px; border: 0;
  background: var(--brand); color: #fff; font-size: 1.3rem; line-height: 1; box-shadow: 0 3px 0 var(--brand-d); display: grid; place-items: center;
}
@media (min-width: 600px) {
  .p-name { font-size: .92rem; } .p-price { font-size: 1rem; } .p-body { padding: .7rem .8rem .8rem; }
  .p-add { width: 40px; height: 40px; top: .6rem; right: .6rem; }
}

/* product sheet */
.sheet-img { border-radius: 18px; overflow: hidden; aspect-ratio: 4/3; background: linear-gradient(135deg, #fafafa, #fff1f0); display: grid; place-items: center; margin-bottom: 1rem; }
.sheet-img img { width: 100%; height: 100%; object-fit: cover; }
.sheet-img .ph { font-size: 5rem; }
.variant-list { display: grid; gap: .5rem; margin-bottom: 1rem; }
.variant {
  display: flex; align-items: center; gap: .7rem; padding: .75rem .9rem; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; background: #fff;
}
.variant input { accent-color: var(--brand); width: 20px; height: 20px; }
.variant:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 3px 0 #fecaca; }
.variant .v-price { margin-left: auto; font-weight: 700; color: var(--brand); }

.qty { display: inline-flex; align-items: center; background: #fff; border-radius: 14px; border: 2px solid var(--line); overflow: hidden; }
.qty button { width: 40px; height: 40px; border: 0; background: var(--gray-l); font-size: 1.2rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.qty button:active { background: #e2e8f0; }
.qty input { width: 56px; border: 0; text-align: center; font-weight: 700; padding: .4rem 0; border-radius: 0; box-shadow: none; }
.qty input:focus { box-shadow: none; }

/* ---------- Lists (orders etc.) ---------- */
.list { display: grid; gap: .7rem; }
.list-item {
  background: #fff; border-radius: 16px; padding: .9rem 1rem; box-shadow: 0 3px 0 #e3e9f0, 0 6px 14px rgba(15,23,42,.05);
  border: 1px solid #edf1f5; display: block; color: inherit;
}
.list-item:active { transform: translateY(2px); }
.li-top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.li-title { font-weight: 700; }
.li-meta { font-size: .8rem; color: var(--muted); }
.li-amount { font-weight: 800; color: var(--brand-ink); white-space: nowrap; }

.bill-lines { width: 100%; font-size: .9rem; }
.bill-lines td { padding: .3rem 0; }
.bill-lines td:last-child { text-align: right; white-space: nowrap; }
.bill-lines tr.total td { border-top: 2px dashed var(--line); padding-top: .6rem; font-weight: 800; font-size: 1.1rem; color: var(--brand); }

/* ---------- Timeline ---------- */
.track { display: flex; justify-content: space-between; position: relative; margin: .5rem 0 1rem; }
.track::before { content: ''; position: absolute; left: 8%; right: 8%; top: 17px; height: 4px; background: var(--line); border-radius: 4px; }
.track .bar { position: absolute; left: 8%; top: 17px; height: 4px; background: var(--brand); border-radius: 4px; transition: width .4s; }
.track .step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; width: 20%; text-align: center; font-size: .66rem; color: var(--muted); font-weight: 600; }
.track .step i { width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 3px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: .95rem; }
.track .step.done i { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 3px 0 var(--brand-d); }
.track .step.done { color: var(--brand-d); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 3px solid var(--line); }
.timeline li { position: relative; padding: 0 0 .9rem .8rem; font-size: .85rem; }
.timeline li::before { content: ''; position: absolute; left: -1.55rem; top: .3rem; width: 13px; height: 13px; border-radius: 50%; background: var(--green); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--green); }

/* ---------- Contact card ---------- */
.contact-card { display: flex; align-items: center; gap: .8rem; padding: .9rem; border-radius: 16px; background: linear-gradient(135deg, #eff6ff, #f0fdf4); border: 1px solid #dbeafe; }
.contact-card .avatar { flex-shrink: 0; }

/* ---------- Stars ---------- */
.stars { color: #f59e0b; letter-spacing: 1px; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: .2rem; }
.star-input input { display: none; }
.star-input label { font-size: 2.2rem; color: #cbd5e1; cursor: pointer; transition: transform .1s; text-shadow: 0 3px 0 rgba(0,0,0,.08); }
.star-input label:active { transform: scale(.9); }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f59e0b; }

/* ---------- Attendance calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
.cal .dow { font-size: .68rem; text-align: center; color: var(--muted); font-weight: 600; }
.cal .day { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font-size: .8rem; font-weight: 600; background: var(--gray-l); color: var(--muted); }
.cal .day.present { background: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-d); }
.cal .day.absent { background: var(--red); color: #fff; box-shadow: 0 3px 0 var(--red-d); }
.cal .day.leave { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-d); }
.cal .day.half_day, .cal .day.late { background: var(--amber); color: #fff; box-shadow: 0 3px 0 #92400e; }
.cal .day.today { outline: 3px solid var(--orange); outline-offset: 1px; }
.legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .75rem; margin-top: .6rem; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; background: var(--c); }
.att-opts { display: flex; gap: .3rem; flex-wrap: wrap; }
.att-opts label { cursor: pointer; }
.att-opts input { display: none; }
.att-opts span { display: inline-block; padding: .35rem .6rem; border-radius: 10px; font-size: .75rem; font-weight: 600; background: var(--gray-l); box-shadow: 0 2px 0 #d6dde6; }
.att-opts input:checked + span.p { background: var(--green); color: #fff; box-shadow: 0 2px 0 var(--green-d); }
.att-opts input:checked + span.a { background: var(--red); color: #fff; box-shadow: 0 2px 0 var(--red-d); }
.att-opts input:checked + span.l { background: var(--blue); color: #fff; box-shadow: 0 2px 0 var(--blue-d); }
.att-opts input:checked + span.h { background: var(--amber); color: #fff; box-shadow: 0 2px 0 #92400e; }

/* ---------- Bars (mini charts) ---------- */
.bars { display: flex; align-items: flex-end; gap: .35rem; height: 140px; padding-top: .5rem; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .25rem; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 34px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #ff5a52, #e3141b); box-shadow: 0 3px 0 var(--brand-d); min-height: 3px; }
.bars .b span { font-size: .62rem; color: var(--muted); white-space: nowrap; }
.bars .b em { font-size: .6rem; font-style: normal; color: var(--ink-2); font-weight: 600; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(2,6,23,.5); display: flex; align-items: flex-end; justify-content: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 22px; padding: 1.3rem; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); animation: up .25s ease; max-height: 90vh; overflow: auto; }
@media (min-width: 600px) { .modal { align-items: center; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.steps-list { padding-left: 1.2rem; } .steps-list li { margin-bottom: .4rem; }
.share-ic { display: inline-block; background: var(--blue-l); color: var(--blue); border-radius: 6px; padding: 0 .35rem; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-emoji { font-size: 3rem; margin-bottom: .4rem; }

/* ---------- Auth pages ---------- */
body.public { background: radial-gradient(circle at 10% 0%, #fecaca 0, transparent 38%), radial-gradient(circle at 100% 100%, #e5e5e5 0, transparent 45%), #fbfbfb; }
.auth-wrap { max-width: 440px; margin: 0 auto; padding: calc(1.5rem + env(safe-area-inset-top, 0px)) 1rem 2rem; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.auth-logo { text-align: center; margin-bottom: 1.2rem; }
.auth-logo img { width: 92px; height: 92px; margin: 0 auto .6rem; border-radius: 26px; box-shadow: 0 8px 0 #0b5e2b, 0 16px 30px rgba(22,163,74,.3); }
.auth-logo h1 { font-size: 1.6rem; font-weight: 800; margin: 0; }
.auth-logo p { color: var(--muted); margin: 0; font-size: .9rem; }
.auth-card { background: #fff; border-radius: 24px; padding: 1.4rem; box-shadow: var(--shadow-lg); }
.role-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-bottom: 1rem; }
.role-pills span { text-align: center; font-size: .72rem; padding: .45rem; border-radius: 12px; background: var(--gray-l); font-weight: 600; color: var(--ink-2); }
.demo-box { font-size: .78rem; background: #fffbeb; border: 1px dashed #fcd34d; border-radius: 12px; padding: .6rem .8rem; margin-top: 1rem; color: #78350f; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 1.1rem 0 .6rem; }
.section-title h2 { margin: 0; font-size: 1.05rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; font-size: .9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }
.custom-thumb { width: 100%; max-width: 220px; border-radius: 12px; border: 1px solid var(--line); }
.divider { height: 1px; background: var(--line); margin: 1rem 0; }
.pill-note { display: inline-block; padding: .2rem .6rem; border-radius: 8px; background: var(--purple-l); color: var(--purple-d); font-size: .75rem; font-weight: 600; }
.sticky-bottom { position: sticky; bottom: calc(76px + var(--safe-b)); z-index: 20; }
@media (min-width: 992px) { .sticky-bottom { bottom: 1rem; } }
.fab-bar { background: #fff; border-radius: 18px; padding: .8rem 1rem; box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 1px solid var(--line); }

@media print {
  .sidebar, .topbar, .bottom-nav, .btn, .no-print { display: none !important; }
  .main { margin: 0; padding: 0; }
}

/* ============ v2: nested categories, grades, branding ============ */
.tab-sm { padding: .38rem .8rem; font-size: .76rem; }
.sub-tabs { margin-top: -.4rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; font-size: .8rem; color: var(--muted); margin-bottom: .6rem; }
.crumbs a { color: var(--brand); font-weight: 600; }
.crumbs span.sep { opacity: .5; }

/* Category tiles (3 columns, 3D) */
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 600px) { .cat-grid { gap: 1rem; } }
.cat-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; text-align: center;
  padding: .8rem .4rem; border-radius: 18px; color: var(--ink); font-weight: 700; font-size: .78rem; line-height: 1.2;
  background: linear-gradient(160deg, #ffffff 0%, #f0fdf4 100%); border: 1px solid #e3efe6;
  box-shadow: 0 5px 0 #d5e6da, 0 10px 18px rgba(15,23,42,.07); transition: transform .08s, box-shadow .08s; min-height: 104px;
}
.cat-tile:active { transform: translateY(4px); box-shadow: 0 1px 0 #d5e6da; }
.cat-tile .ct-ic { font-size: 2rem; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.05), 0 2px 6px rgba(15,23,42,.08); overflow: hidden; }
.cat-tile .ct-ic img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile small { font-weight: 500; color: var(--muted); font-size: .66rem; }
.cat-tile.main { background: linear-gradient(160deg, #fff7ed 0%, #ffedd5 100%); border-color: #fde2c4; box-shadow: 0 5px 0 #f5cfa4, 0 10px 18px rgba(15,23,42,.07); }
@media (min-width: 600px) { .cat-tile { font-size: .92rem; min-height: 130px; } .cat-tile .ct-ic { width: 68px; height: 68px; font-size: 2.5rem; } }

/* Grade chips & picker */
.grade-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 .4rem; border-radius: 7px; font-size: .68rem; font-weight: 800; color: #fff; background: var(--gray); box-shadow: 0 2px 0 rgba(0,0,0,.18); vertical-align: middle; }
.grade-chip.g-a { background: #16a34a; } .grade-chip.g-b { background: #2563eb; } .grade-chip.g-c { background: #d97706; } .grade-chip.g-d { background: #7c3aed; }
.grade-chips { display: flex; gap: .25rem; flex-wrap: wrap; }
.p-grades { position: absolute; left: .4rem; bottom: calc(100% - .4rem); }
.grade-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.grade-opt { position: relative; cursor: pointer; }
.grade-opt input { position: absolute; opacity: 0; pointer-events: none; }
.grade-opt .go-box {
  display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .7rem .3rem; border-radius: 16px; background: #fff;
  border: 2px solid var(--line); box-shadow: 0 4px 0 #dfe6ee; transition: transform .07s, box-shadow .07s;
}
.grade-opt .go-letter { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.grade-opt .go-label { font-size: .7rem; color: var(--muted); font-weight: 600; }
.grade-opt .go-price { font-size: .85rem; font-weight: 800; color: var(--brand-ink); }
.grade-opt input:checked + .go-box { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 4px 0 var(--brand-d); transform: translateY(-1px); }
.grade-opt.g-a .go-letter { color: #16a34a; } .grade-opt.g-b .go-letter { color: #2563eb; } .grade-opt.g-c .go-letter { color: #d97706; }
.price-live { font-size: 1.6rem; font-weight: 800; color: var(--brand); margin: .2rem 0 .8rem; }
.price-live small { font-size: .8rem; color: var(--muted); font-weight: 500; }

/* Admin grade inputs */
.grades-only { display: none; }
.with-grades .grades-only { display: block; }
.grade-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem; }
.grade-inputs .field { margin-bottom: .4rem; }
.v-row { padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.v-row:last-child { border-bottom: 0; }

/* Category tree (admin) */
.cat-tree { list-style: none; margin: 0; padding: 0; }
.cat-tree li { display: flex; align-items: center; gap: .6rem; padding: .55rem .5rem .55rem calc(.5rem + var(--d) * 1.4rem); border-bottom: 1px solid var(--line); position: relative; }
.cat-tree li.depth-0 { background: #f8fbf9; font-size: 1rem; }
.cat-tree li:not(.depth-0)::before { content: ''; position: absolute; left: calc(var(--d) * 1.4rem - .5rem); top: 0; bottom: 50%; width: .7rem; border-left: 2px solid #cbd5e1; border-bottom: 2px solid #cbd5e1; border-bottom-left-radius: 6px; }
.cat-tree li.inactive { opacity: .55; }
.cat-ic { width: 36px; height: 36px; border-radius: 10px; background: #fff; display: grid; place-items: center; font-size: 1.2rem; box-shadow: 0 2px 0 #e2e8f0; overflow: hidden; flex-shrink: 0; }
.cat-ic img { width: 100%; height: 100%; object-fit: cover; }

/* Branding */
.brand-preview { width: 84px; height: 84px; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 4px 0 #dfe6ee; display: grid; place-items: center; flex-shrink: 0; }
.brand-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.receipt-head-preview { text-align: center; font-family: 'Courier New', monospace; padding: .5rem 1rem; border: 1px dashed #94a3b8; border-radius: 10px; background: #fff; }
.rh-title { font-size: 1.6rem; font-weight: 900; letter-spacing: 2px; line-height: 1; }
.rh-sub { font-size: .8rem; letter-spacing: 1px; }
.bill-head { text-align: center; padding: .4rem 0 .8rem; border-bottom: 2px dashed var(--line); margin-bottom: .6rem; }
.bill-head img { width: 56px; height: 56px; object-fit: contain; margin: 0 auto .3rem; border-radius: 14px; }
.bill-head .bh-title { font-size: 1.5rem; font-weight: 900; letter-spacing: 2px; line-height: 1; color: var(--ink); }
.bill-head .bh-sub { font-size: .78rem; letter-spacing: 1.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.brand-logo { object-fit: contain; background: #fff; }

/* ============ v4: D2D logo branding (red / black) ============ */
.brand { flex-direction: column; align-items: stretch; gap: .35rem; padding: 1rem; }
.brand-card { background: #fff; border-radius: 16px; padding: .55rem .7rem; box-shadow: 0 4px 0 var(--brand), 0 8px 18px rgba(0,0,0,.35); }
.brand-card img { width: 100%; height: auto; display: block; }
.brand small { text-align: center; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; }
.topbar-logo { height: 30px; width: auto; display: block; }
@media (min-width: 992px) { .topbar-logo { display: none; } }
.auth-logo img { width: min(300px, 82vw); height: auto; border-radius: 0; box-shadow: none; margin: 0 auto .4rem; filter: drop-shadow(0 6px 10px rgba(0,0,0,.12)); }
.auth-logo p { letter-spacing: .3px; }
.hero { color: #fff; }
.hero .hero-mark { position: absolute; right: .8rem; top: .8rem; height: 34px; width: auto; opacity: .95; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); background: #fff; border-radius: 10px; padding: 4px 6px; }
.cat-tile { background: linear-gradient(160deg, #ffffff 0%, #f7f7f7 100%); border-color: #ececec; box-shadow: 0 5px 0 #e1e1e1, 0 10px 18px rgba(15,23,42,.07); }
.cat-tile.main { background: linear-gradient(160deg, #ffffff 0%, #fff1f0 100%); border-color: #fbd5d2; box-shadow: 0 5px 0 #f3b4af, 0 10px 18px rgba(15,23,42,.07); }
.bill-head img { width: min(220px, 70%); height: auto; border-radius: 0; margin: 0 auto .35rem; }
.brand-preview { width: 160px; height: 84px; }
.stat.brand { background: linear-gradient(135deg, #ff3b30, #b30d12); }
.stat.dark { background: linear-gradient(135deg, #2b2b2b, #0a0a0a); }
.hero:has(.hero-mark) h2 { padding-right: 115px; }

/* ============ v5: restaurants & food ============ */
.d-block { display: block; }
.r-card { display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden; color: inherit; border: 1px solid #eee;
  box-shadow: 0 5px 0 #e3e3e3, 0 10px 22px rgba(15,23,42,.08); transition: transform .08s, box-shadow .08s; }
a.r-card:active { transform: translateY(4px); box-shadow: 0 1px 0 #e3e3e3; }
.r-card.inactive { opacity: .55; }
.r-card.closed .r-cover { filter: grayscale(.85); }
.r-cover { position: relative; display: block; height: 128px; background: linear-gradient(135deg, #1a1a1a 0%, #3a1212 60%, #e3141b 140%); background-size: cover; background-position: center; }
.r-cover .badge { position: absolute; left: .6rem; top: .6rem; box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.r-logo { width: 56px; height: 56px; border-radius: 16px; background: #fff; display: inline-grid; place-items: center; font-size: 1.9rem; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 4px 0 rgba(0,0,0,.18), 0 6px 14px rgba(0,0,0,.15); }
.r-logo img { width: 100%; height: 100%; object-fit: cover; }
.r-cover .r-logo { position: absolute; left: .8rem; bottom: -24px; border: 3px solid #fff; }
.r-logo.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 1.1rem; box-shadow: 0 2px 0 rgba(0,0,0,.12); vertical-align: middle; }
.r-logo.lg { width: 72px; height: 72px; font-size: 2.4rem; border-radius: 20px; }
.r-body { display: block; padding: 1.9rem 1rem 1rem; }
.r-name { display: block; font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.r-meta { display: flex; flex-wrap: wrap; gap: .35rem .8rem; font-size: .76rem; color: var(--muted); margin-top: .45rem; align-items: center; }
.r-meta span { display: inline-flex; align-items: center; gap: .2rem; }
.r-meta.light { color: rgba(255,255,255,.9); }
.r-hero { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1.2rem; border-radius: 22px; margin-bottom: 1rem; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, #151515 0%, #2b2b2b 50%, #b30d12 140%); background-size: cover; background-position: center; box-shadow: 0 7px 0 var(--brand-d), var(--shadow); }
.r-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.75), rgba(0,0,0,.35)); }
.r-hero > * { position: relative; }
.r-hero h2 { color: #fff; }
.veg-dot { display: inline-block; width: 13px; height: 13px; border: 2px solid; border-radius: 3px; position: relative; vertical-align: -1px; }
.veg-dot::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: currentColor; }
.veg-dot.veg { color: #16a34a; } .veg-dot.nonveg { color: #b91c1c; }
.spicy { font-size: .7rem; }
.food-tag { display: inline-block; margin-top: .15rem; padding: .08rem .45rem; border-radius: 6px; background: #111; color: #fff; font-size: .68rem; font-weight: 600; }
.sticky-tabs { position: sticky; top: calc(62px + env(safe-area-inset-top, 0px)); z-index: 30; background: var(--bg); padding-top: .5rem; }
.food-hero { background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.18), transparent 40%), linear-gradient(135deg, #e3141b 0%, #9e0b10 55%, #111 140%); }
.food-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border-radius: 18px; margin-bottom: .7rem; color: #fff;
  background: linear-gradient(135deg, #111 0%, #2a2a2a 55%, #e3141b 150%); box-shadow: 0 5px 0 var(--brand-d), var(--shadow); }
.food-banner b { display: block; font-size: 1.05rem; } .food-banner small { opacity: .85; font-size: .78rem; }
.r-strip { display: flex; gap: .7rem; overflow-x: auto; padding: .3rem .1rem .8rem; margin-bottom: .4rem; scrollbar-width: none; }
.r-strip::-webkit-scrollbar { display: none; }
.r-chip { flex: 0 0 92px; display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; color: var(--ink); font-size: .72rem; font-weight: 700; line-height: 1.15; }
.r-chip small { font-weight: 600; color: var(--green-d); font-size: .64rem; }
.r-chip.closed { opacity: .6; } .r-chip.closed small { color: var(--red); }
.r-chip .r-logo { width: 64px; height: 64px; font-size: 2rem; }
.cart-group-head { display: flex; align-items: center; gap: .55rem; margin: .4rem 0 .5rem; flex-wrap: wrap; }
.pickup-card { border: 2px solid #111; }
.pickup-stop + .pickup-stop { margin-top: 1rem; padding-top: 1rem; border-top: 2px dashed var(--line); }
.pickup-items { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .88rem; }
.pickup-items li { margin-bottom: .3rem; }
.bill-lines tr.group-row td { font-weight: 800; padding-top: .7rem; color: var(--ink); border-bottom: 1px solid var(--line); }

/* ============ v6: restaurant panel, deals, 3D photo frames, lightbox ============ */
.role-pills.four { grid-template-columns: repeat(4, 1fr); }
.role-pills.four span { font-size: .66rem; padding: .45rem .2rem; }

/* 4×4 grid of large 3D frames */
.frame-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; perspective: 1400px; margin-bottom: 1rem; }
@media (min-width: 600px) { .frame-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem; } }
.frame3d { margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.frame3d.is-hidden { opacity: .45; }
.frame3d-inner {
  position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 14px; padding: 9px;
  background: linear-gradient(145deg, #2b2b2b 0%, #0d0d0d 55%, #3a0b0d 100%);
  box-shadow: 0 2px 0 #444 inset, 0 -3px 0 #000 inset, 0 10px 0 #7a0b0f, 0 18px 30px rgba(0,0,0,.35);
  transform: rotateX(4deg) rotateY(-5deg); transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.frame3d:nth-child(even) .frame3d-inner { transform: rotateX(4deg) rotateY(5deg); }
.frame3d-inner::before { content: ''; position: absolute; inset: 5px; border-radius: 10px; border: 2px solid rgba(255,255,255,.18); pointer-events: none; z-index: 2; }
.frame3d-inner img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(0,0,0,.5) inset; }
.frame3d-inner:hover, .frame3d-inner:focus-visible { transform: rotateX(0) rotateY(0) translateY(-6px) scale(1.03); box-shadow: 0 2px 0 #444 inset, 0 14px 0 #7a0b0f, 0 26px 40px rgba(0,0,0,.4); }
.frame3d-inner:active { transform: translateY(4px) scale(.99); box-shadow: 0 4px 0 #7a0b0f, 0 8px 14px rgba(0,0,0,.3); }
.frame3d-zoom { position: absolute; right: 14px; bottom: 14px; z-index: 3; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: #111; font-weight: 800; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.frame3d figcaption { font-size: .8rem; font-weight: 600; text-align: center; color: var(--ink-2); }
.frame-actions { display: flex; gap: .4rem; justify-content: center; }
.frame-edit summary { cursor: pointer; font-size: .78rem; font-weight: 700; color: var(--brand); text-align: center; list-style: none; }
.frame-edit input, .frame-edit select { padding: .45rem .6rem; font-size: .82rem; }
.frame-pager { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin: -.2rem 0 1.2rem; }
.frame-hero { position: relative; display: grid; box-shadow: 0 8px 0 #7a0b0f, 0 16px 30px rgba(0,0,0,.25); border: 8px solid #151515; }
.thumb-row { display: flex; gap: .5rem; overflow-x: auto; padding: .8rem 0 .2rem; }
.thumb-row a { flex: 0 0 76px; height: 76px; border-radius: 12px; overflow: hidden; border: 3px solid #111; box-shadow: 0 4px 0 #7a0b0f; }
.thumb-row img { width: 100%; height: 100%; object-fit: cover; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(5,5,5,.94); display: flex; align-items: center; justify-content: center; padding: 3.2rem .6rem 2.6rem; }
.lightbox[hidden] { display: none; }
.lb-stage { margin: 0; max-width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: .7rem; }
.lb-stage.pop { animation: lbpop .28s cubic-bezier(.2,.8,.2,1); }
@keyframes lbpop { from { transform: scale(.88) rotateX(8deg); opacity: 0; } }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 8rem); object-fit: contain; border-radius: 12px; border: 8px solid #fff; box-shadow: 0 14px 0 var(--brand-d), 0 30px 60px rgba(0,0,0,.6); cursor: zoom-in; transition: transform .25s; }
.lightbox.zoomed .lb-stage img { transform: scale(1.8); cursor: zoom-out; }
.lightbox.zoomed { overflow: auto; }
.lb-stage figcaption { color: #fff; font-weight: 600; text-align: center; }
.lb-close, .lb-prev, .lb-next { position: absolute; border: 0; cursor: pointer; color: #111; background: #fff; border-radius: 14px; font-size: 1.5rem; font-weight: 800;
  width: 48px; height: 48px; box-shadow: 0 4px 0 var(--brand); display: grid; place-items: center; z-index: 2; }
.lb-close { top: calc(.7rem + env(safe-area-inset-top, 0px)); right: .7rem; font-size: 1.1rem; }
.lb-prev { left: .6rem; top: 50%; transform: translateY(-50%); } .lb-next { right: .6rem; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; top: calc(1.1rem + env(safe-area-inset-top, 0px)); left: 1rem; color: #fff; font-weight: 700; font-size: .85rem; }

/* Deals */
.deal-strip { display: flex; gap: .9rem; overflow-x: auto; padding: .3rem .1rem 1rem; scroll-snap-type: x mandatory; }
.deal-strip .deal-card { flex: 0 0 min(280px, 80vw); scroll-snap-align: start; }
.deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.deal-card { background: #fff; border-radius: 18px; overflow: hidden; border: 2px solid #111; box-shadow: 0 6px 0 var(--brand), 0 12px 22px rgba(0,0,0,.1); display: flex; flex-direction: column; }
.deal-card.off { opacity: .55; }
.deal-img { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #111, #3a0b0d 60%, #e3141b); overflow: hidden; }
.deal-img img { width: 100%; height: 100%; object-fit: cover; }
.deal-img .ph { font-size: 3rem; }
.deal-save { position: absolute; top: .6rem; right: .6rem; background: #ffd400; color: #111; font-weight: 800; font-size: .72rem; padding: .2rem .55rem; border-radius: 8px; box-shadow: 0 3px 0 #b39500; transform: rotate(3deg); }
.deal-body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; flex: 1; }
.deal-price { font-size: 1.2rem; font-weight: 800; color: var(--brand); }
.deal-inc { margin: .35rem 0 0; padding-left: 1.05rem; font-size: .78rem; color: var(--ink-2); }

/* Restaurant panel */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.quick { display: flex; flex-direction: column; gap: .15rem; padding: .9rem; border-radius: 16px; background: #fafafa; border: 1px solid #eee; color: var(--ink); box-shadow: 0 4px 0 #e5e5e5; font-size: .85rem; }
.quick span { font-size: 1.6rem; } .quick b { font-size: 1.2rem; } .quick small { color: var(--red); font-weight: 600; }
.kitchen-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
@media (max-width: 520px) { .kitchen-steps { grid-template-columns: 1fr; } }
.kitchen-steps form { margin: 0; }
.ticket-line { padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.upload-card { border: 2px dashed var(--brand); background: var(--brand-tint); }
@media print { .kitchen-ticket { box-shadow: none; border: 0; } body.role-restaurant .card:not(.kitchen-ticket) { display: none; } }
.stat .label { color: #fff; opacity: .92; margin-bottom: 0; font-weight: 500; }

/* ============ v7: messaging ============ */
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.inbox { display: flex; flex-direction: column; gap: .55rem; }
.inbox-row { display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; background: #fff; border-radius: 18px; color: var(--ink);
  border: 1px solid #eee; box-shadow: 0 4px 0 #e6e6e6, 0 8px 16px rgba(0,0,0,.05); transition: transform .08s; }
.inbox-row:active { transform: translateY(3px); box-shadow: 0 1px 0 #e6e6e6; }
.inbox-row.unread { border-color: var(--brand); box-shadow: 0 4px 0 var(--brand-d), 0 8px 16px rgba(227,20,27,.12); }
.inbox-row.unread b.ellipsis { color: var(--brand-d); }
.unread-dot { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: .72rem; display: grid; place-items: center; flex-shrink: 0; }
.role-tag { color: var(--muted); }
.chat-avatar { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; flex-shrink: 0; overflow: hidden;
  background: #f3f3f3; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-avatar.role-admin { background: #111; } .chat-avatar.role-rider { background: #dbeafe; } .chat-avatar.role-restaurant { background: #fee4e2; } .chat-avatar.role-customer { background: #dcfce7; }
.who-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
@media (min-width: 720px) { .who-grid { grid-template-columns: repeat(4, 1fr); } }
.who-tile { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.3rem .8rem; border-radius: 20px; background: #fff; color: var(--ink);
  border: 2px solid #eee; box-shadow: 0 6px 0 #e3e3e3, 0 12px 20px rgba(0,0,0,.06); text-align: center; transition: transform .08s; }
.who-tile:active { transform: translateY(5px); box-shadow: 0 1px 0 #e3e3e3; }
.who-tile .who-ic { font-size: 2.4rem; width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: #f5f5f5; box-shadow: inset 0 -4px 0 rgba(0,0,0,.06); }
.who-tile.role-admin .who-ic { background: #111; } .who-tile.role-rider .who-ic { background: #dbeafe; } .who-tile.role-restaurant .who-ic { background: #fee4e2; } .who-tile.role-customer .who-ic { background: #dcfce7; }
.who-tile small { color: var(--muted); }

/* chat page layout */
body.chat-page .bottom-nav { display: none; }
body.chat-page .main { padding-bottom: 0; }
body.chat-page .content { padding: 0; max-width: 900px; }
.chat-wrap { display: flex; flex-direction: column; height: calc(100dvh - 63px - env(safe-area-inset-top, 0px)); background:
  radial-gradient(circle at 20% 10%, rgba(227,20,27,.05), transparent 40%), radial-gradient(circle at 90% 80%, rgba(0,0,0,.04), transparent 40%), #f4f2f0; }
.chat-wrap.flash::after { content: ''; position: fixed; inset: 0; background: #fff; opacity: .8; z-index: 300; pointer-events: none; }
.chat-head { display: flex; align-items: center; gap: .7rem; padding: .6rem .9rem; background: #fff; border-bottom: 1px solid var(--line); }
.chat-head .chat-avatar { width: 40px; height: 40px; font-size: 1.2rem; border-radius: 12px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: .8rem .8rem 1rem; -webkit-overflow-scrolling: touch; }
.load-older { display: block; margin: 0 auto .6rem; }
.chat-list { display: flex; flex-direction: column; gap: .35rem; }
.chat-empty { text-align: center; color: var(--muted); padding: 3rem 1rem; font-weight: 600; }
.day-chip { text-align: center; margin: .6rem 0; } .day-chip span { background: #fff; color: var(--muted); font-size: .7rem; font-weight: 700; padding: .25rem .7rem; border-radius: 99px; box-shadow: 0 2px 0 #e5e5e5; }
.chat-system { text-align: center; font-size: .75rem; color: var(--muted); }
.bubble-row { display: flex; } .bubble-row.mine { justify-content: flex-end; }
.bubble { position: relative; max-width: min(78%, 520px); padding: .5rem .7rem .35rem; border-radius: 18px; font-size: .92rem; line-height: 1.4; word-wrap: break-word; }
.bubble-row.theirs .bubble { background: #fff; color: var(--ink); border-bottom-left-radius: 6px; box-shadow: 0 3px 0 #e2e2e2, 0 4px 10px rgba(0,0,0,.05); }
.bubble-row.mine .bubble { background: linear-gradient(180deg, #ff3b30, #e3141b); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 3px 0 var(--brand-d), 0 4px 10px rgba(227,20,27,.2); }
.bubble-row.mine .bubble a { color: #fff; text-decoration: underline; }
.b-sender { font-size: .7rem; font-weight: 800; color: var(--brand); margin-bottom: .1rem; }
.b-meta { font-size: .64rem; opacity: .75; text-align: right; margin-top: .15rem; white-space: nowrap; }
.ticks.read { color: #bfe3ff; font-weight: 800; }
.bubble-row.theirs .ticks.read { color: var(--blue); }
.b-photo { display: block; margin: -.2rem -.4rem .2rem; border-radius: 14px; overflow: hidden; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.b-photo img { display: block; width: 100%; max-width: 300px; max-height: 340px; object-fit: cover; }
.b-voice { display: flex; align-items: center; gap: .4rem; min-width: 230px; }
.b-voice audio { height: 38px; flex: 1; min-width: 180px; }
.b-voice .v-ic { font-size: 1.1rem; }
.b-loc { display: flex; gap: .6rem; align-items: center; color: inherit !important; text-decoration: none !important; min-width: 220px; }
.loc-map { width: 64px; height: 64px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
  background: repeating-linear-gradient(0deg, #e8efe6 0 12px, #dfe8dc 12px 13px), repeating-linear-gradient(90deg, transparent 0 12px, #d6e0d2 12px 13px); background-blend-mode: multiply;
  box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.loc-pin { font-size: 1.6rem; filter: drop-shadow(0 3px 2px rgba(0,0,0,.3)); }
.loc-info { display: flex; flex-direction: column; } .loc-open { font-weight: 800; }
.b-del { position: absolute; top: -8px; left: -8px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #111; color: #fff; font-size: .65rem; cursor: pointer; opacity: 0; transition: opacity .15s; }
.bubble:hover .b-del, .bubble:focus-within .b-del { opacity: .9; }
@media (hover: none) { .b-del { opacity: .55; } }
.bubble.kind-deleted { background: #eee !important; color: #777 !important; box-shadow: none !important; }

/* composer */
.chat-compose { position: relative; background: #fff; border-top: 1px solid var(--line); padding: .55rem .6rem calc(.55rem + env(safe-area-inset-bottom, 0px)); }
.compose-row { display: flex; align-items: flex-end; gap: .45rem; }
.compose-row textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; border-radius: 22px; padding: .65rem 1rem; line-height: 1.35; }
.chat-compose .icon-btn { flex-shrink: 0; font-size: 1.2rem; }
.chat-compose .icon-btn.send { background: var(--brand); color: #fff; box-shadow: 0 3px 0 var(--brand-d); }
.chat-compose .icon-btn.mic { background: #111; color: #fff; box-shadow: 0 3px 0 var(--brand); }
.chat-wrap.is-sending .chat-compose { opacity: .6; pointer-events: none; }
.attach-menu { position: absolute; bottom: calc(100% + 6px); left: .6rem; display: grid; grid-template-columns: repeat(4, 76px); gap: .5rem; padding: .7rem;
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); border: 1px solid #eee; z-index: 5; animation: up .18s ease; }
.attach-menu button { display: flex; flex-direction: column; align-items: center; gap: .2rem; border: 0; background: #f6f6f6; border-radius: 16px; padding: .6rem .2rem; font-size: 1.6rem; cursor: pointer; box-shadow: 0 3px 0 #e1e1e1; }
.attach-menu button span { font-size: .68rem; font-weight: 700; font-family: inherit; }
.attach-menu button:active { transform: translateY(3px); box-shadow: none; }
.rec-bar { display: flex; align-items: center; gap: .6rem; padding: .2rem .3rem; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.8); } }

/* camera */
.cam-modal { background: #000; padding: 0; align-items: stretch; }
.cam-card { position: relative; width: 100%; height: 100%; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; }
.cam-stage { position: relative; flex: 1; display: grid; place-items: center; overflow: hidden; background: #000; }
.cam-stage video, .cam-stage img { width: 100%; height: 100%; object-fit: contain; }
.cam-stage video.mirror { transform: scaleX(-1); }
.cam-msg { position: absolute; inset: auto 1rem 45%; color: #fff; text-align: center; font-weight: 600; }
.cam-controls { display: flex; align-items: center; justify-content: space-around; gap: .6rem; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); background: #0b0b0b; }
.cam-controls input { flex: 1; min-width: 0; border-radius: 99px; }
.cam-btn { width: 54px; height: 54px; border-radius: 50%; border: 0; background: #262626; color: #fff; font-size: 1.4rem; cursor: pointer; box-shadow: 0 4px 0 #000; }
.cam-shutter { width: 76px; height: 76px; border-radius: 50%; border: 6px solid #fff; background: var(--brand); cursor: pointer; box-shadow: 0 0 0 4px rgba(255,255,255,.25), 0 6px 0 var(--brand-d); transition: transform .08s; }
.cam-shutter:active { transform: scale(.9); }
.cam-facing { position: absolute; top: calc(.8rem + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); color: #fff; background: rgba(0,0,0,.5); padding: .25rem .7rem; border-radius: 99px; }
.photo-preview { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 14px; background: #111; }
.loc-found { margin-top: .6rem; padding: .6rem .8rem; border-radius: 12px; background: var(--green-l); color: var(--green-d); font-size: .85rem; }
.chat-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #111; color: #fff; padding: .7rem 1rem; border-radius: 14px; z-index: 400;
  box-shadow: 0 4px 0 var(--brand); font-size: .85rem; max-width: 90vw; transition: opacity .4s; }
.chat-toast.out { opacity: 0; }
@media (min-width: 992px) { .chat-wrap { height: calc(100vh - 63px); } }

/* ============ v8: order tracking ============ */
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; letter-spacing: .5px; }
.track-box { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.track-qr { padding: 8px; background: #fff; border-radius: 16px; border: 3px solid #111; box-shadow: 0 5px 0 var(--brand), 0 10px 20px rgba(0,0,0,.1); line-height: 0; }
.track-qr svg { display: block; }
.track-info { flex: 1; min-width: 200px; }
.track-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.45rem; font-weight: 800; letter-spacing: 1.5px; color: var(--ink); margin: .1rem 0 .2rem; }
.bill-track { text-align: center; font-size: .8rem; color: var(--muted); margin: -.3rem 0 .6rem; }
.bill-track b { color: var(--ink); }
.track-logo img { width: min(220px, 60vw) !important; }
.track-logo h1 { font-size: 1.4rem; }
.track-input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem !important; letter-spacing: 1.5px; text-transform: uppercase; flex: 1; min-width: 0; }
.track-form .flex, .track-home .flex { gap: .5rem; align-items: stretch; }
.track-form .btn, .track-home .btn { margin-bottom: 0; }
.track-status { display: flex; gap: .9rem; align-items: center; padding: 1rem; border-radius: 18px; margin-bottom: .6rem; background: var(--gray-l); }
.track-status .ts-icon { font-size: 2.2rem; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.12); flex-shrink: 0; }
.ts-label { font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.ts-msg { font-size: .88rem; color: var(--ink-2); }
.ts-eta { font-size: .85rem; margin-top: .3rem; }
.track-status.st-amber { background: var(--amber-l); } .track-status.st-purple { background: var(--purple-l); } .track-status.st-teal { background: var(--teal-l); }
.track-status.st-indigo { background: var(--indigo-l); } .track-status.st-orange { background: var(--orange-l); } .track-status.st-green { background: var(--green-l); } .track-status.st-red { background: var(--red-l); }
.track-status.st-orange .ts-icon { animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateX(6px); } }
.track-kv { margin-top: .6rem; }
.track-group { padding: .5rem 0; }
.track-items { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .88rem; }
.track-foot { display: flex; gap: .8rem; align-items: center; }
.track-qr-small { line-height: 0; border: 2px solid #111; border-radius: 10px; padding: 3px; background: #fff; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: .2rem; animation: pulse 1.2s infinite; }
@media print { .track-qr { box-shadow: none; } }

/* ===== v8.1 — home: tracking hero + working role login buttons ===== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.auth-wrap.home-wrap { max-width: 1040px; justify-content: flex-start; gap: 1.2rem; }
@media (min-width: 900px) {
  .auth-wrap.home-wrap { display: grid; grid-template-columns: 1.25fr 1fr; align-items: start; align-content: center; column-gap: 1.6rem; }
  .home-wrap > .alert { grid-column: 1 / -1; }
  .home-wrap .login-card { margin-top: 4.2rem; }
}
.track-hero .th-brand { text-align: center; margin-bottom: .9rem; }
.track-hero .th-brand img { width: min(260px, 70vw); height: auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,.12)); }
.track-hero .th-brand p { color: var(--muted); margin: .2rem 0 0; font-size: .9rem; }
.th-card { position: relative; overflow: hidden; border-radius: 26px; padding: 1.4rem; color: #fff;
  background: radial-gradient(circle at 100% 0, rgba(255,255,255,.18) 0, transparent 40%), linear-gradient(145deg, var(--brand) 0%, #b40d13 55%, #111 130%);
  box-shadow: 0 10px 0 #7a070b, 0 22px 40px rgba(227,20,27,.35); transform: translateZ(0); }
.th-card::after { content: '📦'; position: absolute; right: -14px; bottom: -26px; font-size: 7.5rem; opacity: .1; transform: rotate(-12deg); pointer-events: none; }
.th-head { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.th-head h2 { margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: .2px; }
.th-head p { margin: .1rem 0 0; opacity: .9; font-size: .9rem; }
.th-icon { flex: 0 0 auto; width: 54px; height: 54px; display: grid; place-items: center; font-size: 1.7rem; border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f1f1f1); box-shadow: 0 5px 0 #c9c9c9, 0 10px 16px rgba(0,0,0,.25); animation: th-bob 3s ease-in-out infinite; }
@keyframes th-bob { 50% { transform: translateY(-4px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .th-icon { animation: none; } }
.th-form { display: flex; gap: .6rem; align-items: stretch; position: relative; z-index: 1; }
.th-form .track-input { background: #fff; color: var(--ink); border: 3px solid rgba(255,255,255,.6); border-radius: 16px; padding: .85rem 1rem; font-size: 1.2rem !important;
  box-shadow: inset 0 3px 6px rgba(0,0,0,.12); }
.th-form .track-input:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.35), inset 0 3px 6px rgba(0,0,0,.12); }
.th-form .th-go { --c: #111; --cd: #000; margin-bottom: 0; white-space: nowrap; }
.th-foot { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; position: relative; z-index: 1; }
.th-foot .btn { --c: #fff; --cd: #d4d4d4; --fg: #111; color: #111; text-shadow: none; margin-bottom: 4px; }
.th-foot .small { opacity: .92; }
.th-steps { display: flex; align-items: center; gap: .35rem; margin-top: 1.1rem; font-size: .72rem; font-weight: 700; flex-wrap: wrap; position: relative; z-index: 1; }
.th-steps span { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); padding: .3rem .55rem; border-radius: 999px; white-space: nowrap; }
.th-steps i { flex: 1 1 10px; min-width: 8px; height: 2px; background: rgba(255,255,255,.35); border-radius: 2px; }
@media (max-width: 480px) {
  .th-card { padding: 1.1rem; }
  .th-form { flex-direction: column; }
  .th-form .th-go { width: 100%; justify-content: center; }
  .th-steps i { display: none; }
}

.login-title { margin: 0 0 .8rem; font-size: 1.2rem; font-weight: 800; }
.role-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: .7rem; }
.role-tab { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .6rem .2rem .55rem; border-radius: 14px; cursor: pointer; user-select: none;
  text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: .74rem; background: linear-gradient(180deg, #fff, #f3f4f6);
  border: 1px solid #e5e7eb; box-shadow: 0 4px 0 #d1d5db, 0 6px 10px rgba(15,23,42,.08); transition: transform .08s, box-shadow .08s, background .15s, color .15s;
  -webkit-tap-highlight-color: transparent; }
.role-tab .rt-ico { font-size: 1.35rem; line-height: 1; transition: transform .15s; }
.role-tab:hover { background: #fff; color: var(--ink); box-shadow: 0 5px 0 #d1d5db, 0 10px 16px rgba(15,23,42,.12); transform: translateY(-1px); }
.role-tab:hover .rt-ico { transform: scale(1.15) rotate(-6deg); }
.role-tab:active { transform: translateY(4px); box-shadow: 0 0 0 #d1d5db, 0 2px 4px rgba(15,23,42,.12); }
.role-tab:focus-visible { outline: 3px solid rgba(227,20,27,.4); outline-offset: 2px; }
.role-tab.active { color: #fff; background: linear-gradient(180deg, #f0343a, var(--brand)); border-color: var(--brand-d); box-shadow: 0 4px 0 var(--brand-d), 0 8px 14px rgba(227,20,27,.3); }
.role-tab.active:active { box-shadow: 0 0 0 var(--brand-d); }
.role-desc { margin: 0 0 .9rem; min-height: 1.2em; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3rem; }
.pw-eye { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 1.1rem; padding: .4rem .5rem; cursor: pointer; opacity: .55; border-radius: 10px; }
.pw-eye:hover, .pw-eye.on { opacity: 1; background: var(--gray-l); }
.btn.loading { pointer-events: none; opacity: .85; }
.btn.loading::after { content: ''; width: 1em; height: 1em; margin-left: .5rem; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* QR scanner */
.qr-stage { position: relative; margin-top: .8rem; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 1 / 1; }
.qr-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.qr-frame::after { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: var(--brand); box-shadow: 0 0 10px var(--brand); animation: qr-scan 1.8s ease-in-out infinite; }
@keyframes qr-scan { 0%, 100% { top: 10%; } 50% { top: 90%; } }

/* tracking page: new-order call to action */
.track-cta { margin-top: 1rem; padding: 1.1rem; border-radius: 20px; background: linear-gradient(135deg, #fff5f5, #fff); border: 1px solid #fecaca; }
.track-cta h3 { margin: 0 0 .2rem; }
.track-cta .btn-row { margin-top: .7rem; }
.track-tools { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; }
@media (max-width: 480px) { .track-cta .btn-row .btn { flex: 1 1 100%; justify-content: center; } }

/* v8.2 — simple, flat voice & camera icons in chat */
.chat-compose .icon-btn.plain { background: transparent; box-shadow: none; color: #6b7280; width: 40px; height: 44px; border-radius: 50%; transition: background .15s, color .15s; }
.chat-compose .icon-btn.plain:hover { background: #f3f4f6; color: var(--ink); }
.chat-compose .icon-btn.plain:active { transform: scale(.92); background: #e5e7eb; box-shadow: none; }
.chat-compose .icon-btn.mic { background: transparent; color: #6b7280; box-shadow: none; }
.chat-compose .icon-btn.send { width: 44px; height: 44px; border-radius: 50%; box-shadow: none; }
.chat-compose .icon-btn.send:active { transform: scale(.92); }
.compose-row { align-items: center; }
.attach-menu button { font-size: inherit; color: var(--ink-2); background: #f7f7f8; box-shadow: none; padding: .7rem .2rem .55rem; gap: .35rem; }
.attach-menu button:hover { background: #efeff1; color: var(--ink); }
.attach-menu button:active { transform: scale(.95); }
.attach-menu button .ic { width: 22px; height: 22px; }
.b-voice .v-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.06); flex: 0 0 auto; }
.cam-btn { display: grid; place-items: center; width: 50px; height: 50px; background: rgba(255,255,255,.14); box-shadow: none; }
.cam-btn:hover { background: rgba(255,255,255,.24); }
.cam-btn:active { transform: scale(.92); }
.cam-shutter { width: 72px; height: 72px; border: 4px solid #fff; background: transparent; box-shadow: none; position: relative; }
.cam-shutter::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #fff; transition: transform .1s; }
.cam-shutter:active::after { transform: scale(.85); }
.rec-bar .icon-btn.plain { color: #6b7280; }
