:root {
  --o1: #FDB52A;
  --o2: #F4511E;
  --orange: #F7741A;
  --grad: linear-gradient(135deg, var(--o1), var(--o2));
  --leaf: #1f8a3b;
  --ink: #141414;
  --mute: #757575;
  --line: #ededed;
  --soft: #f8f7f5;
  --red: #c62828;
  --r: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: #fff; color: var(--ink); }
body {
  font-family: 'Questrial', system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.mute { color: var(--mute); }
.small { font-size: 14px; }
.center { text-align: center; }

/* ---------- landing: fixed, never scrolls ---------- */
html:has(body.landing), body.landing { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.landing { position: fixed; inset: 0; min-height: 0; }
.hero {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; padding: 24px;
}
.hero { --L: min(48vh, 72vw, 360px); }
.hero .logo { width: var(--L); height: auto; }

/* ---------- animated logo ---------- */
.hero .brand { display: flex; flex-direction: column; align-items: center; margin: 0; font-weight: 400; }
.brand-mark { position: relative; display: block; width: calc(var(--L) * .69); aspect-ratio: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.b-orange { position: absolute; left: 14.34%; top: 29.91%; width: 70.46%; height: 70.09%; transform-origin: 50% 100%; }
.b-orange img { width: 100%; height: 100%; display: block; }
.b-leaf { position: absolute; left: 50.93%; top: 0; width: 34.61%; height: 27.81%; transform-origin: 2% 98%; }
.brand-word { display: flex; margin-top: calc(var(--L) * .055); font-size: calc(var(--L) * .158); line-height: 1.15; letter-spacing: -.01em; color: var(--ink); overflow: hidden; padding-bottom: .08em; }
.brand-word span { display: inline-block; }
.brand-word .sp { width: .28em; }

/* start state (only when JS runs, so the logo is never lost) */
.anim .b-orange { opacity: 0; transform: translateY(-160%); }
.anim .b-leaf { opacity: 0; transform: scale(0) rotate(-50deg); }
.anim .brand-word span { opacity: 0; transform: translateY(105%); }
.anim .hero .tag, .anim .hero .actions, .anim .land-foot { opacity: 0; transform: translateY(14px); }

.intro .b-orange { animation: drop 1.05s cubic-bezier(.33, 0, .25, 1) .05s both; }
.intro .b-leaf { animation: sprout .75s cubic-bezier(.2, 1.4, .4, 1) .82s both, sway 5s ease-in-out 2.4s infinite; }
.intro .brand-word span { animation: rise .6s cubic-bezier(.2, .9, .25, 1.15) calc(.95s + var(--i) * 45ms) both; }
.intro .hero .tag { animation: fadeUp .6s ease 1.45s both; }
.intro .hero .actions { animation: fadeUp .6s ease 1.6s both; }
.intro .land-foot { animation: fadeUp .6s ease 1.8s both; }

@keyframes drop {
  0%   { opacity: 0; transform: translateY(-160%) scale(.94, 1.08); }
  12%  { opacity: 1; }
  44%  { transform: translateY(0) scale(.96, 1.05); }
  52%  { transform: translateY(0) scale(1.14, .84); }
  66%  { transform: translateY(-14%) scale(.96, 1.05); }
  78%  { transform: translateY(0) scale(1.06, .94); }
  88%  { transform: translateY(-3%) scale(.99, 1.01); }
  100% { opacity: 1; transform: none; }
}
@keyframes sprout {
  from { opacity: 0; transform: scale(0) rotate(-50deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes sway {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-7deg); }
  45% { transform: rotate(4deg); }
  65% { transform: rotate(-2deg); }
  80% { transform: rotate(0); }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* after the intro: everything settled, leaf keeps swaying */
.ready .b-orange, .ready .b-leaf, .ready .brand-word span, .ready .hero .tag, .ready .hero .actions, .ready .land-foot { opacity: 1; transform: none; animation: none; }
.ready .b-leaf { animation: sway 5s ease-in-out infinite; }

/* tap the orange */
.brand.boing .b-orange { animation: boing .7s cubic-bezier(.3, 0, .3, 1) both; }
.brand.boing .b-leaf { animation: flutter .8s ease-in-out both; }
@keyframes boing {
  0%   { transform: none; }
  18%  { transform: scale(1.12, .86); }
  40%  { transform: translateY(-16%) scale(.93, 1.08); }
  62%  { transform: translateY(0) scale(1.07, .93); }
  80%  { transform: translateY(-3%) scale(.98, 1.02); }
  100% { transform: none; }
}
@keyframes flutter {
  0%, 100% { transform: none; }
  25% { transform: rotate(-16deg) translateY(-4%); }
  50% { transform: rotate(10deg); }
  75% { transform: rotate(-5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .anim .b-orange, .anim .b-leaf, .anim .brand-word span, .anim .hero .tag, .anim .hero .actions, .anim .land-foot { opacity: 1; transform: none; animation: none !important; }
}
.hero .tag { color: var(--mute); font-size: 18px; text-align: center; }
.hero .actions { display: flex; gap: 12px; margin-top: 18px; }
.land-foot {
  position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 16px;
}
.land-badge { max-width: 100%; font-size: 13px; line-height: 1.4; color: var(--mute); text-align: center; text-wrap: balance; }
.land-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 100%; }
.land-foot nav a { padding: 6px 10px; border-radius: 999px; font-size: 13px; color: var(--mute); text-decoration: none; transition: color .15s, background .15s; }
.land-foot nav a:hover { color: var(--ink); background: var(--soft); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 26px; border-radius: 999px; border: 0;
  background: var(--grad); color: #fff; font-size: 16px; text-decoration: none;
  cursor: pointer; transition: transform .08s, opacity .15s, box-shadow .15s;
  box-shadow: 0 6px 18px -8px rgba(244, 81, 30, .7);
  white-space: nowrap;
}
.btn:hover { box-shadow: 0 8px 22px -8px rgba(244, 81, 30, .9); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: #d6d6d6; }
.btn.dark { background: var(--ink); box-shadow: none; }
.btn.sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--mute); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.link.danger { color: var(--red); }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--mute); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 12px 14px; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(247, 116, 26, .15); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.check {
  display: flex; gap: 14px; align-items: center;
  margin: 10px 0 20px; padding: 16px 18px;
  background: var(--soft); border: 1px solid transparent; border-radius: var(--r);
  font-size: 15px; line-height: 1.45; color: #4a4a4a; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.check:has(input:checked) { background: #fff8f1; border-color: rgba(247, 116, 26, .35); }
.check input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--orange); cursor: pointer; }
.check span { flex: 1; min-width: 0; }
.check a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: rgba(0, 0, 0, .25); }
.check a:hover { color: var(--orange); text-decoration-color: currentColor; }
.hint { display: block; font-size: 13px; color: var(--mute); margin-top: 6px; }
.hint.ok { color: var(--leaf); }
.hint.bad { color: var(--red); }
.invite-ok { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 18px; border-radius: var(--r); background: #fff8f1; border: 1px solid rgba(247, 116, 26, .35); }
.invite-ok .grow { flex: 1; min-width: 0; }
.invite-ok code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.invite-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; flex: none; }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* ---------- auth pages ---------- */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth form { width: 100%; max-width: 380px; }
.auth .mark { display: block; width: 56px; height: 56px; margin: 0 auto 18px; }
.auth h1 { font-size: 28px; font-weight: 400; text-align: center; margin-bottom: 6px; }
.auth .sub { text-align: center; color: var(--mute); margin-bottom: 28px; }
.auth .foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--mute); }

/* ---------- signup wizard: one question per screen ---------- */
.wiz { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 0 16px 32px; }
.wiz-top {
  position: sticky; top: 0; z-index: 2; width: 100%; max-width: 380px; background: #fff;
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 0 12px;
}
.wiz-back { width: 36px; height: 36px; margin-left: -6px; border: 0; background: none; border-radius: 999px; display: grid; place-items: center; color: var(--ink); cursor: pointer; }
.wiz-back:active { background: var(--soft); }
.wiz-progress { display: flex; gap: 4px; }
.wiz-progress i { flex: 1; height: 4px; border-radius: 999px; background: var(--line); transition: background .3s; }
.wiz-progress i.done { background: var(--orange); }
.wiz-count { font-size: 13px; color: var(--mute); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wiz form { width: 100%; max-width: 380px; margin-top: 7vh; }
.wiz-step { display: none; }
.wiz-step.on { display: block; }
.wiz-step.in-right { animation: wizIn .26s cubic-bezier(.2, .8, .2, 1); }
.wiz-step.in-left { animation: wizBack .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes wizIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes wizBack { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.wiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.wiz-head .wiz-mark { width: 40px; height: 40px; flex: none; margin-top: -4px; }
.wiz-head h1 { margin: 0; }
.wiz h1 { font-size: 28px; font-weight: 400; line-height: 1.2; margin-bottom: 8px; }
.wiz-sub { color: var(--mute); margin-bottom: 24px; line-height: 1.45; }
.wiz input:not([type=checkbox]) { height: 54px; font-size: 18px; border-radius: 14px; }
.wiz input[name=inviteCode] { letter-spacing: .06em; }
.wiz-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; margin-bottom: 18px; border-radius: 999px; background: #fff3e8; color: #b4520c; font-size: 13px; }
.wiz-chip code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.wiz-summary { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 4px; overflow: hidden; }
.wiz-row { width: 100%; display: flex; justify-content: space-between; gap: 16px; padding: 13px 16px; border: 0; background: #fff; font-size: 15px; text-align: right; cursor: pointer; color: var(--ink); }
.wiz-row + .wiz-row { border-top: 1px solid var(--line); }
.wiz-row span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz-row:active { background: var(--soft); }
.wiz .err { margin-top: 12px; }
.wiz .foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--mute); }
@media (prefers-reduced-motion: reduce) { .wiz-step.in-right, .wiz-step.in-left { animation: none; } }

/* ---------- app shell ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: 1080px; margin: 0 auto;
}
.top .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 19px; }
.top .brand img { width: 30px; height: 30px; }
.top .brand .badge { font-size: 12px; color: var(--mute); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 20px 80px; }
.wrap.wide { max-width: 1080px; }
h1.title { font-size: 30px; font-weight: 400; margin: 18px 0 6px; }
h2 { font-size: 20px; font-weight: 400; margin: 34px 0 14px; }
.card { border: 1px solid var(--line); border-radius: var(--r); padding: 22px; background: #fff; }
.card + .card { margin-top: 12px; }
.soft { background: var(--soft); border-color: transparent; }

/* waitlist */
.big-num { font-size: 72px; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* plans */
.plans { display: grid; gap: 10px; }
.plan { display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.plan input { width: 18px; height: 18px; flex: none; accent-color: var(--orange); }
.plan:has(input:checked) { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(247, 116, 26, .12); }
.plan .name { font-size: 17px; }
.plan .desc { font-size: 14px; color: var(--mute); }
.plan .price { margin-left: auto; text-align: right; white-space: nowrap; }
.plan .price small { display: block; color: var(--mute); font-size: 12px; }
#card-container { min-height: 90px; }
.demo-note { font-size: 14px; color: var(--mute); background: var(--soft); border-radius: 12px; padding: 14px 16px; }

/* journey */
.journey { display: flex; justify-content: space-between; position: relative; margin: 26px 4px 6px; }
.journey::before, .journey .bar {
  content: ''; position: absolute; top: 13px; left: 14px; right: 14px; height: 3px; border-radius: 3px; background: var(--line);
}
.journey .bar { background: var(--grad); right: auto; transition: width .6s ease; }
.step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 25%; text-align: center; }
.journey .bar + .step { align-items: flex-start; text-align: left; }
.step:last-of-type { align-items: flex-end; text-align: right; }
.dot { width: 29px; height: 29px; border-radius: 50%; background: #fff; border: 3px solid var(--line); display: grid; place-items: center; color: #fff; font-size: 14px; }
.step.done .dot { background: var(--grad); border-color: transparent; }
.step.now .dot { box-shadow: 0 0 0 6px rgba(247, 116, 26, .16); }
.step .lbl { margin-top: 10px; font-size: 14px; }
.step .when { font-size: 12px; color: var(--mute); min-height: 18px; }
.step:not(.done) .lbl { color: var(--mute); }
.track { margin-top: 18px; font-size: 14px; color: var(--mute); }
.track a { color: var(--orange); }

.list { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list .item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); }
.list .item:first-child { border-top: 0; }
.list .item .grow { flex: 1; min-width: 0; }
.list .empty { padding: 28px; text-align: center; color: var(--mute); }

.pill { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--mute); white-space: nowrap; }
.pill.placed { background: #fff4e5; color: #b45309; }
.pill.packaged { background: #fff0e6; color: #c2410c; }
.pill.shipped { background: #eaf2ff; color: #1d4ed8; }
.pill.delivered, .pill.active { background: #e9f7ee; color: var(--leaf); }
.pill.canceled, .pill.disabled { background: #fdecec; color: var(--red); }

/* ---------- ops / admin ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 8px 0 18px; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 12px 14px; cursor: pointer; color: var(--mute); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--orange); }
.tabs .n { font-size: 12px; background: var(--soft); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.subtabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; height: 36px; padding: 0 14px; cursor: pointer; font-size: 14px; color: var(--mute); }
.subtabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input { max-width: 320px; height: 40px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 8px; }
.stat { background: var(--soft); border-radius: var(--r); padding: 16px 18px; }
.stat .v { font-size: 26px; }
.stat .k { font-size: 13px; color: var(--mute); }
.list .item.box-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.box-row .addr { font-size: 14px; color: var(--mute); }
.ship-form { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ship-form select, .ship-form input { height: 36px; font-size: 14px; width: auto; }
.ship-form input { width: 170px; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; margin-bottom: 16px; }
.inline-form label.field { margin: 0; }
.inline-form input, .inline-form select { height: 42px; }
.inline-form .btn { height: 42px; }
code.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: var(--soft); padding: 3px 8px; border-radius: 6px; }

/* ---------- modal + toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; max-width: 360px; width: 100%; text-align: center; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .25); }
.modal h2 { margin: 0 0 8px; font-size: 22px; }
.modal p { color: var(--mute); margin-bottom: 22px; }
.modal .row { gap: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; opacity: 0; transition: .25s; z-index: 60; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--red); }

@media (max-width: 640px) {
  .top { padding: 14px 16px; }
  .wrap { padding: 8px 16px 64px; }
  .row.stack { flex-direction: column; gap: 0; }
  .list .item.box-row { grid-template-columns: 1fr; }
  .ship-form { justify-content: flex-start; }
  .ship-form input { width: 100%; }
  .hero .actions { flex-direction: column; width: 100%; max-width: 280px; }
  .step .lbl { font-size: 12px; }
}

/* ---------- legal pages ---------- */
.legal { max-width: 680px; margin: 0 auto; padding: 8px 20px 96px; }
.legal h1 { font-size: 32px; font-weight: 400; margin: 20px 0 4px; }
.legal .eff { color: var(--mute); font-size: 14px; margin-bottom: 28px; }
.tldr { background: #fff8f1; border: 1px solid rgba(247, 116, 26, .2); border-radius: 20px; padding: 22px 22px 20px; margin-bottom: 36px; }
.tldr-label { font-size: 12px; color: #b45309; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.legal .tldr ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.legal .tldr li { display: flex; gap: 12px; align-items: flex-start; margin: 0; color: var(--ink); line-height: 1.45; }
.tldr-check { width: 22px; height: 22px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; flex: none; margin-top: 1px; }
.tldr-note { font-size: 13px; color: var(--mute); margin: 18px 0 0; padding-top: 14px; border-top: 1px solid rgba(247, 116, 26, .18); }
.legal h2 { font-size: 19px; margin: 34px 0 10px; }
.legal p, .legal li { color: #333; margin-bottom: 10px; }
.legal ul { padding-left: 20px; margin-bottom: 10px; }
.legal a { color: var(--orange); }
.legal .fill { background: #fff4e5; color: #b45309; border-radius: 4px; padding: 0 4px; }
.legal-foot { display: flex; gap: 16px; justify-content: center; font-size: 13px; color: var(--mute); }
.legal-foot a { color: var(--mute); }

/* ---------- address autocomplete ---------- */
.ac {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .25); overflow: hidden;
}
.ac.open { display: block; }
.ac-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; border-top: 1px solid var(--line); }
.ac-item:first-child { border-top: 0; }
.ac-item:hover, .ac-item.on { background: #fff8f1; }
.ac-pin { color: var(--orange); display: grid; place-items: center; flex: none; }
.ac-text { display: flex; flex-direction: column; min-width: 0; }
.ac-main { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-sub { font-size: 13px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes filled { from { background: #fff1e3; } to { background: #fff; } }
input.filled, select.filled { animation: filled 1.2s ease; }

/* =========================================================
   Member app: tab screens + floating pill tab bar + sheets
   ========================================================= */
body.app { background: #f6f5f3; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.apphead {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 245, 243, .86); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  padding-top: env(safe-area-inset-top);
}
.apphead-in { max-width: 560px; margin: 0 auto; padding: 18px 20px 12px; display: flex; align-items: center; justify-content: space-between; }
.apphead h1 { font-size: 32px; font-weight: 400; letter-spacing: -.01em; }
.apphead img { width: 34px; height: 34px; }
.screen { max-width: 560px; margin: 0 auto; padding: 4px 20px 20px; animation: screenIn .28s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lede { color: var(--mute); margin: -2px 0 20px; }
.section-title { font-size: 13px; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; margin: 28px 4px 10px; }

/* pill tab bar */
.tabbar {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  display: flex; gap: 4px; padding: 6px;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(0, 0, 0, .06); border-radius: 999px;
  box-shadow: 0 16px 36px -14px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .04);
}
.tabbar a {
  display: flex; align-items: center; justify-content: center; gap: 0; height: 50px; min-width: 56px; padding: 0 16px;
  border-radius: 999px; color: #8a8a8a; text-decoration: none; font-size: 15px;
  transition: background .25s, color .25s, padding .25s, gap .25s; -webkit-tap-highlight-color: transparent;
}
.tabbar a svg { flex: none; }
.tabbar a span { max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; transition: max-width .3s ease, opacity .2s; }
.tabbar a.on { background: var(--grad); color: #fff; gap: 8px; padding: 0 20px; box-shadow: 0 8px 18px -8px rgba(244, 81, 30, .8); }
.tabbar a.on span { max-width: 90px; opacity: 1; }
.tabbar a:not(.on):hover { color: var(--ink); }

/* product cards */
.product { background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.product + .product { margin-top: 16px; }
.product-art {
  height: 190px; display: grid; place-items: center; position: relative;
  background: radial-gradient(120% 90% at 30% 20%, #fff3df 0%, #ffe2c4 45%, #ffcfa6 100%);
}
.product-art img { width: 108px; height: 108px; filter: drop-shadow(0 18px 22px rgba(244, 81, 30, .35)); }
.product-art .badge-on { position: absolute; top: 14px; left: 14px; background: #fff; color: var(--leaf); font-size: 12px; padding: 5px 10px; border-radius: 999px; }
.product-body { padding: 18px 20px 20px; }
.product-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.product-top h3 { font-size: 22px; font-weight: 400; }
.product-top .price { font-size: 22px; white-space: nowrap; }
.product-top .price small { font-size: 13px; color: var(--mute); margin-left: 2px; }
.product-body p { color: var(--mute); margin: 6px 0 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.chips span { font-size: 12px; color: #6b5a4a; background: #faf3ec; padding: 5px 10px; border-radius: 999px; }

/* white grouped cards */
.panel { background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.panel + .panel { margin-top: 12px; }
.group { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.group .gi { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-top: 1px solid #f1f0ee; text-decoration: none; color: inherit; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; font: inherit; }
.group .gi:first-child { border-top: 0; }
.group button.gi, .group a.gi { cursor: pointer; }
.group button.gi:hover, .group a.gi:hover { background: #fcfbfa; }
.gi .k { flex: 1; min-width: 0; }
.gi .v { color: var(--mute); text-align: right; }
.gi .chev { color: #c4c4c4; flex: none; }
.gi.danger { color: var(--red); }

/* orders */
.status-head { font-size: 26px; margin: 2px 0 2px; }
.order-meta { display: flex; justify-content: space-between; align-items: center; color: var(--mute); font-size: 14px; }
.track-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 14px 16px; border-radius: 14px; background: #f7f6f4; text-decoration: none; color: inherit; }
.track-btn .small { display: block; }
.hist { display: flex; align-items: center; gap: 14px; }
.hist-ico { width: 40px; height: 40px; border-radius: 12px; background: #fff3e6; display: grid; place-items: center; flex: none; }
.hist-ico img { width: 22px; height: 22px; }
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state img { width: 72px; height: 72px; opacity: .9; margin-bottom: 14px; }
.empty-state h3 { font-weight: 400; font-size: 20px; margin-bottom: 6px; }
.empty-state p { color: var(--mute); margin-bottom: 20px; }

/* profile */
.me-card { display: flex; align-items: center; gap: 16px; }
.avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 24px; flex: none; }

/* waiting list screen */
.wait { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; max-width: 440px; margin: 0 auto; padding: 24px 20px; }
.wait .big-num { font-size: 96px; }

/* bottom sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 20, 20, .35); opacity: 0; transition: opacity .25s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; display: flex; flex-direction: column;
  background: #fff; border-radius: 26px 26px 0 0; transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .3);
}
.sheet-wrap.open { pointer-events: auto; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-handle { width: 40px; height: 5px; border-radius: 5px; background: #e2e2e2; margin: 10px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 6px; flex: none; }
.sheet-head h2 { margin: 0; font-size: 22px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #f3f2f0; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.sheet-body { overflow-y: auto; padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.sheet-foot { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 22px); padding: 26px 0 calc(4px + env(safe-area-inset-bottom)); margin-top: 6px; }
.sheet-foot .fine { font-size: 12px; color: var(--mute); text-align: center; margin-top: 10px; line-height: 1.5; }
.sheet-foot .fine a { color: var(--mute); }
.label-sm { font-size: 13px; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 12px; }
.summary { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: #fff8f1; }
.summary .mini-art { width: 52px; height: 52px; border-radius: 14px; background: radial-gradient(120% 90% at 30% 20%, #fff3df, #ffcfa6); display: grid; place-items: center; flex: none; }
.summary .mini-art img { width: 32px; height: 32px; }
.summary .grow { flex: 1; min-width: 0; }
.summary .amt { white-space: nowrap; }
.summary .amt small { color: var(--mute); font-size: 12px; }

@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; bottom: 50%; width: 480px; border-radius: 26px; transform: translate(-50%, calc(50% + 40px)); opacity: 0; transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .2s; }
  .sheet-wrap.open .sheet { transform: translate(-50%, 50%); opacity: 1; }
  .sheet-handle { display: none; }
  .sheet-head { padding-top: 20px; }
}

body.app .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- support threads ---------- */
.thread { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.bubble { max-width: 86%; padding: 12px 14px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; }
.bubble .who { font-size: 12px; color: var(--mute); margin-bottom: 4px; }
.bubble .when { font-size: 11px; color: var(--mute); margin-top: 6px; }
.bubble.me { align-self: flex-end; background: #fff1e3; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: #f3f2f0; border-bottom-left-radius: 6px; }
.reply-box textarea { min-height: 96px; resize: vertical; }
.back-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--mute); cursor: pointer; padding: 0; font-size: 14px; margin-bottom: 10px; }
.pill.open { background: #fff4e5; color: #b45309; }
.pill.answered { background: #eaf2ff; color: #1d4ed8; }
.pill.closed { background: #f1f1f1; color: #777; }
.ticket-row { display: flex; align-items: center; gap: 12px; }
.ticket-row .k .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-box { font-size: 13px; color: var(--mute); background: #f7f6f4; border-radius: 12px; padding: 10px 12px; }

/* team inbox */
.inbox-thread { max-width: 760px; }
.cust-card { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--mute); background: var(--soft); border-radius: var(--r); padding: 14px 16px; }
.cust-card strong { color: var(--ink); font-weight: 400; }
.reply-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }

.top .brand { white-space: nowrap; }

/* ---------- team / admin header ---------- */
.teamhead { position: sticky; top: 0; z-index: 25; background: rgba(255, 255, 255, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.teamhead-in { max-width: 1080px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.th-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.th-brand img { width: 36px; height: 36px; flex: none; }
.th-brand > span { display: flex; flex-direction: column; line-height: 1.2; }
.th-name { font-size: 18px; white-space: nowrap; }
.th-role { font-size: 12px; color: var(--mute); letter-spacing: .02em; }
.th-user { position: relative; }
.th-avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; font-size: 16px; cursor: pointer; display: grid; place-items: center; box-shadow: 0 4px 12px -6px rgba(244, 81, 30, .8); transition: transform .1s; }
.th-avatar:active { transform: scale(.96); }
.th-avatar[aria-expanded="true"] { box-shadow: 0 0 0 4px rgba(247, 116, 26, .18); }
.th-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .25); padding: 6px; opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s, transform .15s; }
.th-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.th-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.th-menu-head .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.th-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; color: var(--red); }
.th-menu button:hover { background: #fdf1f1; }
.teamhead + main { padding-top: 22px; }
@media (max-width: 640px) { .teamhead-in { padding: 12px 16px; } }

/* =========================== Chat =========================== */
.tabbar a { position: relative; }
.tab-badge { position: absolute; top: 6px; left: 50%; margin-left: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5391b; color: #fff; font-size: 11px; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.tabbar a.on .tab-badge { display: none; }
.head-action { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.invite-card { position: relative; overflow: hidden; border-radius: 22px; padding: 20px; color: #fff; background: var(--grad); box-shadow: 0 14px 30px -18px rgba(244, 81, 30, .9); }
.invite-card::after { content: ''; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.14); }
.invite-card h3 { font-weight: 400; font-size: 20px; margin-bottom: 4px; }
.invite-card p { opacity: .92; font-size: 14px; margin-bottom: 16px; }
.invite-card .row { gap: 8px; position: relative; z-index: 1; }
.invite-card .btn { background: #fff; color: var(--o2); box-shadow: none; height: 44px; }
.invite-card .btn.clear { background: rgba(255,255,255,.18); color: #fff; }
.invite-meta { font-size: 12px; opacity: .85; margin-top: 12px; position: relative; z-index: 1; }

.ava { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 19px; flex: none; }
.ava.sm { width: 38px; height: 38px; font-size: 16px; }
.ava-0 { background: linear-gradient(135deg, #FDB52A, #F4511E); }
.ava-1 { background: linear-gradient(135deg, #6CC13A, #1f8a3b); }
.ava-2 { background: linear-gradient(135deg, #5ec2ff, #2563eb); }
.ava-3 { background: linear-gradient(135deg, #c084fc, #7c3aed); }
.ava-4 { background: linear-gradient(135deg, #fb7185, #e11d48); }
.ava-5 { background: linear-gradient(135deg, #2dd4bf, #0f766e); }

.chat-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; width: 100%; background: none; border: 0; border-top: 1px solid #f1f0ee; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.chat-row:first-child { border-top: 0; }
.chat-row:hover { background: #fcfbfa; }
.chat-row .mid { flex: 1; min-width: 0; }
.chat-row .name { display: flex; justify-content: space-between; gap: 8px; }
.chat-row .name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .time { font-size: 12px; color: var(--mute); flex: none; }
.chat-row .prev { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 2px; }
.chat-row .prev span:first-child { font-size: 14px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 12px; line-height: 22px; text-align: center; flex: none; }

/* conversation (full screen) */
.convo { position: fixed; inset: 0; z-index: 40; background: #f6f5f3; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.convo.open { transform: none; }
.convo-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: rgba(255,255,255,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); flex: none; }
.convo-head .who { flex: 1; min-width: 0; }
.convo-head .who div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo-head .who .small { color: var(--mute); }
.icon-plain { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; }
.icon-plain:hover { background: #f3f2f0; }
.convo-body { flex: 1; overflow-y: auto; padding: 14px 14px 8px; -webkit-overflow-scrolling: touch; }
.convo-inner { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 3px; }
.day-sep { align-self: center; font-size: 12px; color: var(--mute); background: rgba(255,255,255,.8); padding: 4px 10px; border-radius: 999px; margin: 12px 0 8px; }
.msg { max-width: 78%; padding: 8px 12px 6px; border-radius: 18px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; position: relative; font-size: 15.5px; }
.msg .meta { display: inline-flex; gap: 3px; align-items: center; font-size: 11px; margin-left: 8px; float: right; margin-top: 6px; opacity: .75; }
.msg.mine { align-self: flex-end; background: linear-gradient(135deg, #f8a046, #F4511E); color: #fff; border-bottom-right-radius: 6px; }
.msg.theirs { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 1px 1px rgba(0,0,0,.04); cursor: pointer; }
.msg.mine + .msg.theirs, .msg.theirs + .msg.mine { margin-top: 8px; }
.msg.removed { font-style: italic; opacity: .6; background: #ecebe8; color: var(--mute); }
.msg .ticks.read { color: #fff; opacity: 1; }
.convo-banner { background: #fff; border-radius: 18px; padding: 16px; margin: 6px auto 14px; max-width: 640px; width: 100%; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.convo-banner p { color: var(--mute); font-size: 14px; margin-bottom: 12px; }
.convo-banner .row { gap: 8px; }
.composer { flex: none; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.composer form { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; height: 44px; resize: none; border-radius: 22px; padding: 11px 16px; line-height: 1.35; background: #f6f5f3; border-color: transparent; }
.composer textarea:focus { background: #fff; }
.send-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; transition: opacity .15s, transform .1s; }
.send-btn:disabled { opacity: .4; }
.send-btn:active { transform: scale(.94); }
.composer-note { text-align: center; font-size: 13px; color: var(--mute); padding: 8px 0 calc(4px + env(safe-area-inset-bottom)); }

.option-list { display: grid; gap: 8px; }
.option-list label { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.option-list label:has(input:checked) { border-color: var(--orange); background: #fff8f1; }
.option-list input { width: 18px; height: 18px; accent-color: var(--orange); flex: none; }
.at-input { position: relative; }
.at-input span { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--mute); }
.at-input input { padding-left: 32px; }
.found-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #f7f6f4; margin: 4px 0 14px; }

/* group chat */
.ava-group { background: #fff1e3; color: #c2410c; }
.ava-group svg { width: 55%; height: 55%; }
.unread.muted { background: #c9c7c3; }
.day-sep.sys { font-size: 12px; margin: 8px 0; }
.gline { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.gline .msg { max-width: calc(100% - 46px); }
.gline + .gline.first, .msg.mine + .gline, .gline + .msg.mine { margin-top: 8px; }
.gline .ava.sm { width: 30px; height: 30px; font-size: 13px; }
.ava-spacer { width: 30px; flex: none; }
.gname { font-size: 12.5px; margin-bottom: 2px; }
.convo-head .who { cursor: pointer; }
.option-list label .ava.sm { width: 34px; height: 34px; font-size: 14px; }

/* member app without title bars */
body.app .screen { padding-top: calc(22px + env(safe-area-inset-top)); }
.section-row { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.section-row .section-title { margin: 0 4px; }
.section-row .head-action { width: 36px; height: 36px; }

/* chat photos & videos */
.composer form { align-items: flex-end; }
.attach-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; color: var(--mute); display: grid; place-items: center; cursor: pointer; flex: none; }
.attach-btn:hover { color: var(--orange); background: #fff4ea; }
.attach-preview { max-width: 640px; margin: 0 auto 8px; display: flex; align-items: center; gap: 12px; padding: 8px; background: #f6f5f3; border-radius: 16px; }
.ap-thumb { position: relative; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: #e8e6e2; flex: none; }
.ap-thumb img, .ap-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 16px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.ap-progress { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.6); overflow: hidden; }
.ap-progress span { display: block; height: 100%; background: var(--o2); transition: width .2s; }
.ap-text { flex: 1; font-size: 14px; color: var(--mute); }
.msg.has-media { padding: 4px; max-width: min(78%, 280px); }
.msg.has-media .gname { padding: 4px 8px 2px; }
.msg.has-media .cap { display: block; padding: 6px 8px 0; }
.msg.has-media .meta { padding: 0 8px 4px; }
.msg.has-media:not(:has(.cap)) .meta { float: none; display: flex; justify-content: flex-end; margin-top: 4px; }
.m-img { display: block; border: 0; padding: 0; background: #ece9e5; border-radius: 14px; overflow: hidden; cursor: zoom-in; width: 100%; }
.m-img img { display: block; width: 100%; max-height: 340px; object-fit: cover; min-height: 80px; }
.m-video { display: block; width: 100%; max-height: 360px; border-radius: 14px; background: #000; }
.viewer { position: fixed; inset: 0; z-index: 80; background: rgba(10,10,10,.92); display: grid; place-items: center; opacity: 0; transition: opacity .2s; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.viewer.open { opacity: 1; }
.viewer img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.viewer-x { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center; cursor: pointer; }
.msg.has-media { width: 260px; max-width: 78%; overflow: hidden; }
.gline .msg.has-media { width: 240px; max-width: calc(100% - 46px); }
.m-video, .m-img img { max-width: 100%; }

/* ---------- iMessage-style message bar ---------- */
.composer {
  background: rgba(249, 249, 249, .82);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: .5px solid rgba(0, 0, 0, .14);
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
}
.composer form { gap: 8px; align-items: flex-end; }
.plus-btn {
  width: 34px; height: 34px; margin-bottom: 2px; border-radius: 50%; border: 0; flex: none; cursor: pointer;
  background: #e5e5ea; color: #6e6e73; display: grid; place-items: center; transition: background .15s, transform .1s;
}
.plus-btn:hover { background: #dcdce1; }
.plus-btn:active { transform: scale(.92); }
.msg-field {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 4px;
  background: #fff; border: 1px solid #d1d1d6; border-radius: 19px; padding: 3px 3px 3px 14px;
  transition: border-color .15s;
}
.msg-field:focus-within { border-color: #c7c7cc; }
.composer .msg-field textarea {
  flex: 1; min-width: 0; height: auto; min-height: 30px; max-height: 132px; margin: 0; padding: 5px 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none;
  font-size: 17px; line-height: 20px; resize: none; overflow-y: hidden;
}
.composer .msg-field textarea:focus { background: transparent; box-shadow: none; }
.composer .msg-field textarea::placeholder { color: #a1a1a6; }
.composer .send-btn {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--o2); color: #fff; border: 0; cursor: pointer;
  transition: transform .18s cubic-bezier(.3, 1.4, .5, 1), opacity .15s, width .18s, margin .18s;
}
.composer .send-btn:disabled { opacity: 0; transform: scale(.4); width: 0; margin-left: -4px; pointer-events: none; }
.composer .send-btn:active { transform: scale(.9); }
.attach-preview { background: #fff; border: 1px solid #e5e5ea; }

/* ---------- floating message capsule ---------- */
.convo { position: fixed; }
#cv-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
}
#cv-foot > * { pointer-events: auto; }
#cv-foot .composer { background: none; border: 0; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.glass {
  background: rgba(255, 255, 255, .74);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: .5px solid rgba(255, 255, 255, .7);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .06), inset 0 .5px 0 rgba(255, 255, 255, .9);
}
#cv-foot .composer form {
  max-width: 640px; margin: 0 auto; padding: 6px; gap: 6px; border-radius: 26px;
  background: rgba(255, 255, 255, .74);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: .5px solid rgba(0, 0, 0, .06);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .06);
}
#cv-foot .plus-btn { margin-bottom: 0; width: 36px; height: 36px; background: rgba(120, 120, 128, .14); }
#cv-foot .msg-field { background: none; border: 0; padding: 3px 0 3px 4px; border-radius: 0; }
#cv-foot .msg-field textarea { padding: 5px 0; }
#cv-foot .send-btn { width: 32px; height: 32px; }
#cv-foot .attach-preview {
  margin: 0 auto 8px; border-radius: 20px; border: .5px solid rgba(0, 0, 0, .06);
  background: rgba(255, 255, 255, .8); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 12px 32px -14px rgba(0, 0, 0, .25);
}
#cv-foot .composer-note {
  max-width: 640px; margin: 0 auto 8px; padding: 11px 16px; border-radius: 18px; font-size: 13.5px;
  background: rgba(255, 255, 255, .8); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 12px 32px -14px rgba(0, 0, 0, .25);
}
#cv-foot .composer-note:last-child { margin-bottom: 0; }
.convo-body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

/* ---------- iOS-style grouped form (Change password) ---------- */
.ios-group { background: #f4f3f1; border-radius: 16px; overflow: hidden; }
.ios-row { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 8px 0 16px; position: relative; cursor: text; }
.ios-row + .ios-row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: rgba(60, 60, 67, .2); }
.ios-label { width: 74px; flex: none; font-size: 16px; color: var(--ink); }
.ios-row input { flex: 1; min-width: 0; height: 52px; border: 0; padding: 0; background: transparent; box-shadow: none; font-size: 17px; border-radius: 0; }
.ios-row input:focus { box-shadow: none; border: 0; }
.ios-row input::placeholder { color: #a1a1a6; }
.ios-eye { width: 38px; height: 38px; border: 0; background: none; color: #8e8e93; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; }
.ios-eye:hover { background: rgba(0, 0, 0, .05); color: var(--ink); }
.ios-foot { font-size: 13px; color: var(--mute); line-height: 1.45; margin: 10px 16px 6px; }
.pw-meter { display: flex; align-items: center; gap: 10px; margin: 12px 16px 0; height: 0; opacity: 0; overflow: hidden; transition: height .2s, opacity .2s; }
.pw-meter.show { height: 18px; opacity: 1; }
.pw-bar { flex: 1; height: 4px; border-radius: 4px; background: #e5e5ea; overflow: hidden; }
.pw-bar span { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .25s, background .25s; }
.pw-meter.weak .pw-bar span { width: 30%; background: #e5391b; }
.pw-meter.okay .pw-bar span { width: 65%; background: #f5a524; }
.pw-meter.strong .pw-bar span { width: 100%; background: #34a853; }
.pw-label { font-size: 12px; color: var(--mute); min-width: 92px; text-align: right; }
.pw-meter.strong .pw-label { color: #1f8a3b; }

/* =========================== Channels =========================== */
.ava-channel { color: #fff; }
.ava-channel svg { width: 55%; height: 55%; }
.ava-ch-0 { background: linear-gradient(135deg, #FDB52A, #F4511E); }
.ava-ch-1 { background: linear-gradient(135deg, #ff8a65, #e64a19); }
.ava-ch-2 { background: linear-gradient(135deg, #81c784, #2e7d32); }
.ava-ch-3 { background: linear-gradient(135deg, #64b5f6, #1565c0); }
.ava-ch-4 { background: linear-gradient(135deg, #ba68c8, #6a1b9a); }
.ava-ch-5 { background: linear-gradient(135deg, #f06292, #ad1457); }
.role-tag { font-size: 11px; color: #b45309; background: #fff4e5; padding: 1px 7px; border-radius: 999px; margin-left: 4px; vertical-align: 2px; }

.discover { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -20px; padding-left: 20px; padding-right: 20px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.discover::-webkit-scrollbar { display: none; }
.disc-card { flex: none; width: 136px; scroll-snap-align: start; background: #fff; border-radius: 20px; padding: 16px 12px 14px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.04); cursor: pointer; }
.disc-card .ava { width: 56px; height: 56px; font-size: 22px; margin-bottom: 6px; }
.disc-name { font-size: 15px; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.disc-meta { font-size: 12px; color: var(--mute); margin-bottom: 8px; }
.disc-card .btn.sm { height: 32px; padding: 0 18px; font-size: 13px; }

.channel-about { display: flex; gap: 14px; align-items: flex-start; background: #fff; border-radius: 20px; padding: 16px; margin: 4px 0 6px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.channel-about p { color: #4a4a4a; font-size: 14px; margin-top: 8px; }
.post { background: #fff; border-radius: 20px; padding: 12px 14px 10px; margin: 6px 0; box-shadow: 0 1px 2px rgba(0,0,0,.05); cursor: pointer; width: 100%; max-width: 520px; align-self: center; }
.post.removed { color: var(--mute); font-style: italic; font-size: 14px; text-align: center; cursor: default; }
.post-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.post-head .ava.sm { width: 26px; height: 26px; font-size: 12px; }
.post-media { margin: 0 -6px 8px; }
.post-media .m-img { border-radius: 14px; }
.post-media .m-img img { max-height: 460px; }
.post-body { font-size: 16px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.post-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.post-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--mute); margin-left: auto; }
.rx-row { display: flex; gap: 6px; flex-wrap: wrap; }
.rx { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid transparent; background: #f4f3f1; font-size: 15px; cursor: pointer; color: var(--ink); transition: transform .12s, background .15s; }
.rx span { font-size: 13px; color: var(--mute); }
.rx.on { background: #fff1e3; border-color: rgba(244, 81, 30, .35); }
.rx.on span { color: #c2410c; }
.rx:active { transform: scale(.94); }
.rx.add { color: #8e8e93; padding: 0 8px; }
.rx-picker { position: fixed; z-index: 90; display: flex; gap: 2px; padding: 6px; border-radius: 999px; background: rgba(255,255,255,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 14px 34px -12px rgba(0,0,0,.3); opacity: 0; transform: translateY(6px) scale(.96); transition: opacity .15s, transform .15s; }
.rx-picker.open { opacity: 1; transform: none; }
.rx-picker button { width: 42px; height: 42px; border: 0; background: none; font-size: 24px; border-radius: 50%; cursor: pointer; transition: transform .12s, background .12s; }
.rx-picker button:hover { background: #f4f3f1; transform: scale(1.15); }

.channel-bar { max-width: 640px; margin: 0 auto; }
.cbar-btn { width: 100%; height: 50px; border-radius: 26px; border: .5px solid rgba(0,0,0,.06); font-size: 16px; cursor: pointer; color: var(--o2);
  background: rgba(255,255,255,.8); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); box-shadow: 0 12px 32px -12px rgba(0,0,0,.28); }
.cbar-btn.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 12px 26px -12px rgba(244, 81, 30, .9); }

/* ---------- calmer Chat tab ---------- */
.chat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: rgba(118, 118, 128, .12); color: #8e8e93; cursor: text; }
.search input { flex: 1; min-width: 0; height: 38px; border: 0; padding: 0; background: transparent; box-shadow: none; font-size: 16px; color: var(--ink); border-radius: 0; }
.search input:focus { box-shadow: none; }
.search input::-webkit-search-cancel-button { opacity: .5; }
.chat-top .head-action { width: 40px; height: 40px; }
.seg { display: flex; padding: 2px; border-radius: 10px; background: rgba(118, 118, 128, .12); margin-bottom: 16px; }
.seg button { flex: 1; height: 32px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, box-shadow .15s; }
.seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 1px rgba(0, 0, 0, .04); }
.seg-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--o2); color: #fff; font-size: 11px; line-height: 18px; }
.chat-list .group { box-shadow: none; }
.list-label { margin: 18px 4px 8px; }
.chat-list .chat-row .ava { width: 50px; height: 50px; }
.chat-row + .chat-row { border-top: 0; position: relative; }
.chat-row + .chat-row::before { content: ''; position: absolute; top: 0; left: 80px; right: 0; height: .5px; background: rgba(60, 60, 67, .16); }
.follow-pill { flex: none; height: 30px; padding: 0 14px; border-radius: 999px; border: 0; background: #fff1e3; color: #c2410c; font: inherit; font-size: 14px; cursor: pointer; }
.follow-pill:hover { background: #ffe4cc; }
.invite-row { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 16px; padding: 12px 16px; border: 0; border-radius: 20px; background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.invite-row .k { flex: 1; min-width: 0; }
.inv-ico { width: 40px; height: 40px; border-radius: 50%; background: #fff1e3; color: var(--o2); display: grid; place-items: center; flex: none; }
.inv-cta { flex: none; height: 30px; padding: 0 14px; border-radius: 999px; background: var(--grad); color: #fff; font-size: 14px; display: inline-flex; align-items: center; }
.chat-empty { text-align: center; padding: 36px 20px 20px; }
.chat-empty h3 { font-weight: 400; font-size: 18px; margin-bottom: 4px; }
.chat-empty p { color: var(--mute); font-size: 14px; margin-bottom: 14px; }

/* ---------- pill segmented control with gliding thumb ---------- */
.seg { position: relative; height: 44px; padding: 4px; border-radius: 999px; background: rgba(118, 118, 128, .12); }
.seg-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px;
  background: var(--grad); box-shadow: 0 8px 18px -8px rgba(244, 81, 30, .85);
  transition: transform .42s cubic-bezier(.3, 1.35, .45, 1);
}
.seg[data-pos="1"] .seg-pill { transform: translateX(100%); }
.seg button { position: relative; z-index: 1; height: 36px; border-radius: 999px; font-size: 15px; color: #3c3c43; transition: color .25s; }
.seg button.on { background: none; box-shadow: none; color: #fff; }
.seg button:active { transform: scale(.97); }
.seg button.on .seg-badge { background: #fff; color: var(--o2); }

/* ===== Flat look: no shadows or glows anywhere on the platform ===== */
*, *::before, *::after { box-shadow: none !important; text-shadow: none !important; }
.product-art img { filter: none !important; }
/* Floating pieces keep a hairline edge instead of a shadow */
.tabbar { border: 1px solid rgba(0, 0, 0, .1) !important; }
#cv-foot .composer form, .cbar-btn, #cv-foot .attach-preview, #cv-foot .composer-note { border: 1px solid rgba(0, 0, 0, .1) !important; }
.cbar-btn.primary { border: 0 !important; }
.rx-picker, .th-menu, .ac, .modal { border: 1px solid rgba(0, 0, 0, .1) !important; }
.sheet { border-top: 1px solid rgba(0, 0, 0, .06); }
.head-action, .disc-card, .invite-row, .post, .channel-about, .panel, .group, .product { border: 1px solid rgba(0, 0, 0, .06); }
.chat-list .group { border: 1px solid rgba(0, 0, 0, .06); }
.btn.ghost { border: 1px solid var(--line); }
/* Focus: orange border / outline instead of a glow */
input:focus, select:focus, textarea:focus { border-color: var(--orange); }
.composer .msg-field textarea:focus, .search input:focus, .ios-row input:focus { border-color: transparent; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible { outline: 2px solid rgba(247, 116, 26, .6); outline-offset: 2px; }
.plan:has(input:checked) { border-color: var(--orange); }

/* ---------- products: photos, drops, coming soon ---------- */
.product-art { position: relative; }
.product-art.has-photo { padding: 0; height: 220px; background: #f1ede8; }
.product-photo { width: 100% !important; height: 100% !important; object-fit: cover; display: block; }
.p-badge { position: absolute; top: 14px; left: 14px; z-index: 1; font-size: 12px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #b45309; }
.p-badge.drop { background: #141414; color: #fff; }
.p-badge.dark { background: rgba(20, 20, 20, .8); color: #fff; }
.p-badge.mine { color: var(--leaf); }
.p-meta { font-size: 13px; color: #c2410c; margin-top: 4px; }
.product-top .price small { margin-left: 4px; }
.product.is-out .product-art { filter: grayscale(.6); opacity: .85; }
.notice { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid rgba(244, 81, 30, .25); border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; }
.notice .grow { flex: 1; min-width: 0; }
.n-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--o2); flex: none; }

/* ---------- admin product editor ---------- */
.prod-row { gap: 14px; }
.prod-thumb { width: 54px; height: 54px; border-radius: 12px; overflow: hidden; background: #fff4ea; display: grid; place-items: center; flex: none; }
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.editor-grid { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.photo-drop { aspect-ratio: 4 / 3; border-radius: 18px; border: 1.5px dashed #d9d5cf; background: #faf8f5; display: grid; place-items: center; overflow: hidden; cursor: pointer; color: var(--mute); font-size: 14px; }
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; gap: 14px; justify-content: center; margin-top: 8px; }
.editor .row { gap: 12px; }
@media (max-width: 720px) { .editor-grid { grid-template-columns: 1fr; } }
.editor-grid > * { min-width: 0; }
@media (max-width: 720px) { .photo-drop { max-width: 300px; margin: 0 auto; } .photo-actions { margin-bottom: 8px; } }

/* ---------- compact product cards ---------- */
.plist { display: grid; gap: 10px; }
.pcard { display: flex; gap: 14px; padding: 12px; background: #fff; border-radius: 20px; border: 1px solid rgba(0, 0, 0, .06); align-items: stretch; }
.pthumb { position: relative; width: 104px; flex: none; border-radius: 14px; overflow: hidden; background: #f1ede8; aspect-ratio: 1; align-self: flex-start; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb.art { background: radial-gradient(120% 90% at 30% 20%, #fff3df, #ffcfa6); display: grid; place-items: center; }
.pthumb.art img { width: 58%; height: 58%; object-fit: contain; }
.ptag { position: absolute; left: 6px; top: 6px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: #b45309; }
.ptag.drop, .ptag.dark { background: #141414; color: #fff; }
.pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pinfo h3 { font-size: 17px; font-weight: 400; line-height: 1.25; }
.pdesc { font-size: 13.5px; color: var(--mute); line-height: 1.35; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pmeta { font-size: 12.5px; color: #c2410c; margin-top: 4px; }
.pmeta .ok { color: var(--leaf); }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.pprice { font-size: 17px; white-space: nowrap; }
.pprice small { font-size: 12px; color: var(--mute); margin-left: 1px; }
.pbtn { height: 32px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--grad); color: #fff; font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.pbtn.soft { background: #fff1e3; color: #c2410c; }
.pbtn.muted { background: #f1f0ee; color: var(--mute); cursor: default; }
.pcard.is-out .pthumb { filter: grayscale(.7); opacity: .8; }
.pcard.is-out h3, .pcard.is-out .pprice { color: var(--mute); }

/* ---------- end-to-end encryption ---------- */
.e2ee-note { align-self: center; max-width: 320px; text-align: center; font-size: 12px; line-height: 1.45; color: #8a6d3b; background: #fff8e6; border-radius: 12px; padding: 8px 12px; margin: 6px auto 10px; }
.m-e2ee { width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; background: #ece9e5; display: grid; place-items: center; font-size: 13px; color: var(--mute); }
.msg.mine .m-e2ee { background: rgba(255, 255, 255, .25); color: #fff; }

/* ---------- admin settings ---------- */
.settings-card { max-width: 680px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; }
.set-row { display: flex; align-items: center; gap: 16px; }
.set-notes { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; font-size: 14px; color: #4a4a4a; display: grid; gap: 10px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #e5e5ea; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid rgba(0,0,0,.08); transition: transform .25s cubic-bezier(.3, 1.3, .5, 1); }
.switch input:checked + span { background: #34c759; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid rgba(247, 116, 26, .6); outline-offset: 2px; }

/* ---------- team dashboards (admin + moderators) ---------- */
.dash { max-width: 760px; margin: 0 auto; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.dash-head { display: flex; align-items: center; gap: 10px; margin: 14px 0 18px; min-height: 44px; }
.dash-back { display: none; width: 36px; height: 36px; margin-left: -8px; border-radius: 999px; place-items: center; color: var(--ink); flex: none; }
.dash.sub .dash-back { display: grid; }
.dash-back:active { background: var(--soft); }
.dash-title { flex: 1; min-width: 0; }
.dash-title h1 { font-size: 32px; font-weight: 400; line-height: 1.1; letter-spacing: -.01em; }
.dash-title p { font-size: 14px; color: var(--mute); margin-top: 3px; line-height: 1.4; }
.dash-title p:empty { display: none; }
#daction .btn { white-space: nowrap; }

.dash { padding-top: env(safe-area-inset-top); }
.me-av { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 14px; }
.me-av.lg { width: 52px; height: 52px; font-size: 20px; flex: none; }
.me-card { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
/* home: summary + menu */
.dsum { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 8px; }
.dsum > div { background: #fff; padding: 14px 16px; }
.dsum .v { font-size: 24px; line-height: 1.2; }
.dsum .k { font-size: 13px; color: var(--mute); }
.dm-title { font-size: 13px; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; margin: 24px 4px 8px; }
.dm-list { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
.dm-row { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 14px; color: var(--ink); text-decoration: none; position: relative; -webkit-tap-highlight-color: transparent; }
.dm-row + .dm-row::before { content: ''; position: absolute; top: 0; left: 58px; right: 0; border-top: 1px solid var(--line); }
.dm-row:active { background: var(--soft); }
.dm-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--t, var(--orange)); color: #fff; display: grid; place-items: center; flex: none; }
.dm-label { flex: 1; font-size: 16px; }
.dm-count { font-size: 15px; color: var(--mute); }
.dm-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #e5391b; color: #fff; font-size: 12px; line-height: 22px; text-align: center; }
.dm-chev { color: #c4c4c4; flex: none; }

/* lists inside dashboards: roomier, easy to scan */
.dash .list { border-radius: 16px; }
.dash .list .item { padding: 14px 16px; gap: 12px; }
.dash .list .item .grow > div:first-child { font-size: 16px; }
.dash .list .item .small { font-size: 14px; line-height: 1.45; }
.dash .list .item.tap { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dash .list .item.tap:active { background: var(--soft); }
.dash .list .item .dm-chev { margin-right: -4px; }
/* segmented control (iOS style, flat) */
.dash .subtabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  margin: 0 0 12px; padding: 3px; border-radius: 999px; background: #f1efec;
}
.dash .subtabs button {
  height: 36px; padding: 0 6px; border: 1px solid transparent; border-radius: 999px; background: none;
  color: #6b6b6b; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .2s, color .2s, border-color .2s;
}
.dash .subtabs button.on { background: #fff; color: var(--ink); border-color: rgba(0, 0, 0, .06); }
.seg-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* search with an icon */
.dash .toolbar { margin-bottom: 14px; }
.dash .toolbar input[type=search] {
  max-width: none; height: 44px; border-radius: 999px; padding: 0 16px 0 42px; border-color: transparent; background-color: #f1efec;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 15px 50%;
}
.dash .toolbar input[type=search]:focus { background-color: #fff; border-color: var(--orange); }

/* friendly empty state (no box around it) */
.dash .list:has(> .empty:only-child) { border: 0; background: none; }
.dash .list .empty { padding: 44px 24px 36px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.dash .list .empty b { font-weight: 400; font-size: 18px; color: var(--ink); }
.dash .list .empty span { font-size: 15px; color: var(--mute); max-width: 280px; line-height: 1.45; }
.dash .list .empty:has(b)::before {
  content: ''; width: 64px; height: 64px; border-radius: 50%; margin-bottom: 10px; background: #fff3e8 no-repeat center / 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23f7741a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.dash h2 { font-size: 13px; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; margin: 26px 4px 8px; }
.dash .inbox-thread h2, .dash .editor h2 { font-size: 22px; color: var(--ink); text-transform: none; letter-spacing: 0; margin: 0; }
.dash-banner { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin: -4px 0 14px; border-radius: 14px; background: #fff6ec; font-size: 14px; color: #8a5a2b; line-height: 1.4; }
.dash-banner b { font-weight: 400; color: #b4520c; }
.dash-note { font-size: 14px; color: var(--mute); line-height: 1.45; margin: -6px 2px 14px; }

.np-opt { width: 100%; display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; color: var(--ink); }
.np-opt + .np-opt { margin-top: 10px; }
.np-opt b { display: block; font-weight: 400; font-size: 17px; margin-bottom: 2px; }
.np-opt .small { display: block; line-height: 1.4; }
.np-opt:active { background: var(--soft); }
.inbox-row { align-items: flex-start !important; }
.ib-av { width: 40px; height: 40px; border-radius: 50%; background: #f1efec; color: #555; display: grid; place-items: center; font-size: 16px; flex: none; position: relative; }
.ib-av.flag { background: #fdecea; color: #d6391d; }
.inbox-row.is-new .ib-av:not(.flag)::after { content: ''; position: absolute; left: -10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--orange); }
.inbox-row.is-new .ib-av:not(.flag) { background: #fff3e8; color: #c2410c; }
.ib-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ib-name { font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-when { font-size: 13px; color: var(--mute); flex: none; }
.ib-subj { font-size: 15px; margin-top: 1px; }
.ib-prev { font-size: 14px; color: var(--mute); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.ib-tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #f1efec; color: #666; vertical-align: 2px; margin-left: 4px; }
.ib-tag.red { background: #fdecea; color: var(--red); }
.ib-done { display: inline-block; margin-top: 6px; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #e9f7ee; color: var(--leaf); }
.inbox-row .dm-chev, .inbox-row .chev { display: none; }
.bw-form { display: flex; gap: 8px; margin-bottom: 14px; }
.bw-form input { flex: 1; min-width: 0; }
.bw-form .btn { height: 48px; padding: 0 20px; }
.bw-list { display: flex; flex-wrap: wrap; gap: 8px; }
.bw-chip { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 6px 0 14px; border-radius: 999px; background: #f1efec; font-size: 14px; }
.bw-chip button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: #888; cursor: pointer; font-size: 16px; line-height: 1; }
.bw-chip button:hover { background: #e6e3df; color: var(--ink); }
/* bottom sheet (phones) / centered card (wide screens) */
.dsheet-bg { position: fixed; inset: 0; z-index: 70; background: rgba(20, 20, 20, .32); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.dsheet-bg.in { opacity: 1; }
.dsheet { width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; background: #fff; border-radius: 22px 22px 0 0; padding: 18px 20px calc(22px + env(safe-area-inset-bottom)); transform: translateY(24px); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.dsheet-bg.in .dsheet { transform: none; }
.dsheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dsheet-head h2 { margin: 0; font-size: 20px; }
.dsheet-x { width: 34px; height: 34px; border-radius: 999px; border: 0; background: var(--soft); display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; }
.dsheet .btn.block + .btn.block { margin-top: 10px; }
.dfacts { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.dfacts > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; font-size: 15px; }
.dfacts > div + div { border-top: 1px solid var(--line); }
.dfacts > div > span:first-child { color: var(--mute); flex: none; }
.dfacts > div > span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }
body.sheet-open { overflow: hidden; }
@media (min-width: 640px) {
  .dsheet-bg { align-items: center; padding: 24px; }
  .dsheet { border-radius: 22px; padding-bottom: 22px; }
}

/* ---------- show/hide password ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 52px; }
.pw-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 40px; border: 0; border-radius: 999px; background: none;
  display: grid; place-items: center; color: var(--mute); cursor: pointer; transition: color .15s, background .15s;
}
.pw-eye:hover { color: var(--ink); background: var(--soft); }
.pw-eye:focus-visible { outline: 2px solid rgba(247, 116, 26, .6); outline-offset: -2px; }
input::-ms-reveal, input::-ms-clear { display: none; }

/* ---------- no zoom while typing ----------
   iPhone/iPad Safari zooms the page when a text box under 16px gets focus. On touch devices every
   input is at least 16px (pinch-to-zoom stays available for accessibility). */
@media (hover: none), (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea, [contenteditable] { font-size: 16px !important; }
  .wiz input:not([type=checkbox]) { font-size: 18px !important; }
}

/* team dashboards: keep the 5-item bottom bar inside small phones */
@media (max-width: 400px) {
  #dtabs a { min-width: 46px; padding: 0 11px; }
  #dtabs a.on { padding: 0 15px; }
}
@media (max-width: 360px) {
  #dtabs a.on { gap: 0; padding: 0 14px; }
  #dtabs a.on span:not(.me-av) { max-width: 0; opacity: 0; }
}
