:root {
  --bg: #eef3f2; --surface: #fff; --surface2: #f6f9f8; --ink: #13201e; --ink2: #51625f; --ink3: #8a9a97;
  --line: #e1e9e7; --brand: #0f766e; --brand2: #14b8a6; --brandSoft: #e3f4f1; --danger: #c2410c; --dangerSoft: #fdeee6;
  --morning: #f59e0b; --afternoon: #ea580c; --evening: #7c3aed; --night: #1d4ed8; --random: #64748b;
  --radius: 18px; --shadow: 0 1px 2px rgba(16,40,36,.06), 0 4px 16px rgba(16,40,36,.06);
  --paper: #fffdf7; --paperInk: #1c2b4a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1211; --surface: #141d1c; --surface2: #1a2524; --ink: #e6efed; --ink2: #a2b3b0; --ink3: #6c7d7a;
    --line: #253331; --brand: #2dd4bf; --brand2: #14b8a6; --brandSoft: #133632; --danger: #fb923c; --dangerSoft: #3a2215;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --paper: #f8f5ea; --paperInk: #1c2b4a;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, system-ui, sans-serif; background: #cfdcd9; color: var(--ink); font-size: 15px; }
@media (prefers-color-scheme: dark) { body { background: #050908; } }
button, input, select, textarea { font: inherit; color: inherit; }

/* Phone frame: full screen on mobile, centered device on desktop */
#phone { position: relative; height: 100dvh; max-width: 480px; margin: 0 auto; background: var(--bg); overflow: hidden; display: flex; flex-direction: column; }
@media (min-width: 600px) {
  #phone { height: min(900px, calc(100dvh - 40px)); margin-top: 20px; border-radius: 36px; box-shadow: 0 30px 80px rgba(0,0,0,.25), 0 0 0 10px #1b2423; max-width: 420px; }
}
#app { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* App bar */
.bar { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 12px) 16px 12px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 60px; }
.bar h1 { font-size: 19px; font-weight: 700; margin: 0; flex: 1; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar.brand { background: var(--brand); color: #fff; border: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bar.brand { color: #04201d; } }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; flex: none; }
.iconbtn:active { background: rgba(127,127,127,.15); }
.iconbtn svg { width: 22px; height: 22px; }

.content { flex: 1; overflow-y: auto; padding: 16px 16px 96px; -webkit-overflow-scrolling: touch; }
.content.nopad { padding: 0 0 96px; }

/* Bottom nav */
.tabs { display: flex; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; text-decoration: none; color: var(--ink3); font-size: 11px; font-weight: 600; border-radius: 14px; }
.tabs a svg { width: 24px; height: 24px; }
.tabs a.on { color: var(--brand); }
.tabs a.on .pill { background: var(--brandSoft); }
.tabs .pill { padding: 3px 16px; border-radius: 16px; display: grid; place-items: center; }

.fab { position: absolute; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 84px); height: 56px; padding: 0 20px; border-radius: 18px; background: var(--brand); color: #fff; border: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; box-shadow: 0 6px 20px rgba(15,118,110,.35); cursor: pointer; z-index: 5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fab { color: #04201d; } }
.fab svg { width: 22px; height: 22px; }

/* Cards & lists */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.card.tap { cursor: pointer; } .card.tap:active { transform: scale(.99); }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.title { font-weight: 600; font-size: 16px; }
.sub { color: var(--ink2); font-size: 13px; margin-top: 2px; }
.muted { color: var(--ink3); font-size: 13px; }
.section { font-size: 13px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; margin: 20px 4px 10px; }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; font-size: 17px; flex: none; color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; background: var(--brandSoft); color: var(--brand); }
.chip.gray { background: var(--surface2); color: var(--ink2); }
.chip.warn { background: var(--dangerSoft); color: var(--danger); }
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.list > .li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list > .li:last-child { border-bottom: 0; }
.empty { text-align: center; padding: 40px 24px; color: var(--ink2); }
.empty svg { width: 64px; height: 64px; color: var(--ink3); margin-bottom: 8px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: 14px; border: 0; background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; width: 100%; font-size: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { color: #04201d; } }
.btn.ghost { background: var(--brandSoft); color: var(--brand); }
.btn.line { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.danger { background: var(--dangerSoft); color: var(--danger); }
.btn.sm { height: 38px; width: auto; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn:disabled { opacity: .55; }
.btn svg { width: 20px; height: 20px; }
.btns { display: flex; gap: 10px; margin-top: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink2); margin: 0 0 6px 2px; }
.input { width: 100%; height: 50px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); outline: none; font-size: 16px; }
textarea.input { height: auto; min-height: 80px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--brand); }
.prefix { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }
.prefix span { padding: 0 4px 0 14px; color: var(--ink2); font-weight: 600; }
.prefix .input { border: 0; padding-left: 6px; }
.prefix:focus-within { border-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12px; color: var(--ink3); margin: 6px 2px 0; }
.hint.ok { color: var(--brand); } .hint.err { color: var(--danger); }
.otp { letter-spacing: .5em; text-align: center; font-size: 22px; font-weight: 700; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1.5px solid var(--line); background: var(--surface); padding: 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink2); }
.seg button.on { border-color: var(--brand); background: var(--brandSoft); color: var(--brand); }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }

/* Sheets */
.scrim { position: absolute; inset: 0; background: rgba(5,15,13,.45); z-index: 20; animation: fade .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%; background: var(--bg); border-radius: 24px 24px 0 0; z-index: 21; display: flex; flex-direction: column; animation: up .25s cubic-bezier(.2,.9,.3,1); }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 10px auto 2px; flex: none; }
.sheet .shead { display: flex; align-items: center; padding: 6px 12px 6px 20px; }
.sheet .shead h2 { flex: 1; font-size: 18px; margin: 0; }
.sheet .sbody { overflow-y: auto; padding: 8px 20px calc(env(safe-area-inset-bottom) + 20px); }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
#toast { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(20px); background: #13201e; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 40; max-width: 90%; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* Landing */
.hero { background: linear-gradient(160deg, #0f766e, #115e59 60%, #134e4a); color: #fff; padding: calc(env(safe-area-inset-top) + 36px) 24px 40px; border-radius: 0 0 32px 32px; }
.hero .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.hero .logo img { width: 40px; height: 40px; border-radius: 12px; }
.hero h2 { font-size: 30px; line-height: 1.15; margin: 32px 0 12px; letter-spacing: -.02em; }
.hero p { opacity: .85; line-height: 1.5; margin: 0; }
.feat { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; }
.feat .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--brandSoft); color: var(--brand); display: grid; place-items: center; flex: none; }
.feat .ic svg { width: 22px; height: 22px; }
.feat b { display: block; margin-bottom: 2px; }
.feat span { color: var(--ink2); font-size: 14px; line-height: 1.45; }

/* Today */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px 4px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day { flex: none; width: 50px; padding: 8px 0; border-radius: 16px; background: var(--surface); text-align: center; cursor: pointer; border: 1.5px solid transparent; }
.day small { display: block; font-size: 11px; color: var(--ink3); font-weight: 600; }
.day b { font-size: 18px; }
.day.on { background: var(--brand); color: #fff; } .day.on small { color: rgba(255,255,255,.8); }
.day.today:not(.on) { border-color: var(--brand); }
.progress { display: flex; align-items: center; gap: 16px; }
.ring { width: 64px; height: 64px; flex: none; }
.slot { margin-bottom: 14px; }
.slot-h { display: flex; align-items: center; gap: 10px; margin: 18px 4px 10px; }
.slot-h .dot { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.slot-h .dot svg { width: 18px; height: 18px; }
.slot-h b { font-size: 16px; } .slot-h span { color: var(--ink3); font-size: 13px; margin-left: auto; }
.dose { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.dose:first-of-type { border-top: 0; }
.tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; cursor: pointer; background: transparent; }
.tick svg { width: 16px; height: 16px; opacity: 0; color: #fff; }
.tick.on { background: var(--brand); border-color: var(--brand); } .tick.on svg { opacity: 1; }
.dose.done .title { text-decoration: line-through; color: var(--ink3); }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink2); margin-bottom: 4px; }
.who .avatar { width: 24px; height: 24px; border-radius: 8px; font-size: 11px; }

/* Medicine editor */
.med { background: var(--surface); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.med .head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.slotpick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0; }
.slotpick button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 0 6px; font-size: 10.5px; font-weight: 700; color: var(--ink3); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.slotpick button svg { width: 18px; height: 18px; }
.slotpick button.on { color: #fff; border-color: transparent; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; text-align: center; background: var(--surface); cursor: pointer; }
.drop svg { width: 48px; height: 48px; color: var(--brand); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--brandSoft); border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.preview-img { width: 100%; max-height: 220px; object-fit: contain; border-radius: 14px; background: #000; }

/* Re-rendered prescription pad */
.rx { background: var(--paper); color: var(--paperInk); border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,.18); font-family: Inter, sans-serif; position: relative; overflow: hidden; }
.rx-head { padding: 18px 18px 12px; border-bottom: 3px double #1c2b4a55; display: flex; gap: 12px; }
.rx-head .dn { font-size: 19px; font-weight: 700; }
.rx-head .dq { font-size: 12px; opacity: .8; margin-top: 2px; }
.rx-head .right { text-align: right; font-size: 11px; opacity: .8; margin-left: auto; max-width: 45%; }
.rx-pt { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 10px 18px; font-size: 13px; border-bottom: 1px solid #1c2b4a22; }
.rx-pt b { font-weight: 600; }
.rx-body { padding: 14px 18px 18px; font-size: 14px; }
.rx-sym { font-family: Georgia, serif; font-size: 34px; font-style: italic; font-weight: 700; line-height: 1; margin-bottom: 6px; }
.rx-line { font-size: 13px; margin: 6px 0; } .rx-line b { font-weight: 600; }
.rx-med { padding: 9px 0; border-bottom: 1px dashed #1c2b4a33; }
.rx-med .mn { font-family: Caveat, cursive; font-size: 23px; font-weight: 700; line-height: 1.1; }
.rx-med .md { font-size: 12.5px; margin-top: 2px; }
.rx-med .freq { font-family: Caveat, cursive; font-size: 20px; font-weight: 700; color: #2343a5; }
.rx-sign { text-align: right; padding: 10px 18px 18px; font-size: 12px; }
.rx-sign .s { font-family: Caveat, cursive; font-size: 24px; border-bottom: 1px solid #1c2b4a66; display: inline-block; min-width: 140px; text-align: center; }
.rx-foot { background: #1c2b4a0d; padding: 8px 18px; font-size: 10.5px; opacity: .75; }

@media print {
  body { background: #fff; } #phone { height: auto; box-shadow: none; margin: 0; max-width: none; border-radius: 0; }
  .bar, .tabs, .fab, #toast, .content > p { display: none !important; }
  .content { overflow: visible; padding: 0 !important; background: #fff !important; } .rx { box-shadow: none; }
}

/* Phase 2: stock, reminders, re-order */
.stock { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: var(--surface2); color: var(--ink2); }
.stock.low { background: var(--dangerSoft); color: var(--danger); }
.lowtxt { color: var(--danger); font-weight: 600; }
.reorder-banner { text-decoration: none; color: var(--danger); background: var(--dangerSoft); box-shadow: none; }
.reorder-banner svg { width: 26px; height: 26px; flex: none; }
.reorder-banner .title { color: var(--danger); } .reorder-banner .sub { color: var(--danger); opacity: .85; }
.dot-sm { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.dot-sm svg { width: 16px; height: 16px; }
.avatar.xs { width: 22px; height: 22px; border-radius: 7px; font-size: 10px; }
.wa-wrap { background: #e5ddd5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='20' cy='20' r='1.2' fill='%23d4cbc1'/%3E%3C/svg%3E"); border-radius: var(--radius); padding: 14px; }
.wa-bubble { white-space: pre-wrap; background: #dcf8c6; color: #111b21; border-radius: 10px 0 10px 10px; padding: 10px 12px; font-size: 14px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0,0,0,.12); margin-left: 18px; word-break: break-word; font-family: -apple-system, 'Segoe UI', Roboto, Inter, sans-serif; }
.btn.wa { background: #25d366; color: #fff; }

/* ================= Glass theme (overrides the base layer above) ================= */
:root {
  --ink: #0f1f2e; --ink2: #4b5d6b; --ink3: #8696a3;
  --brand: #0d9488; --brand2: #06b6d4; --brandSoft: rgba(13,148,136,.12);
  --danger: #e2533a; --dangerSoft: rgba(226,83,58,.12);
  --glass: rgba(255,255,255,.58); --glass2: rgba(255,255,255,.40); --glassEdge: rgba(255,255,255,.75);
  --line: rgba(15,31,46,.08); --surface: var(--glass); --surface2: rgba(255,255,255,.45);
  --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 8px 28px rgba(15,60,70,.10);
  --blur: blur(22px) saturate(170%);
  --grad: linear-gradient(135deg, #14b8a6 0%, #0891b2 100%);
  --radius: 22px;
  --barH: calc(env(safe-area-inset-top) + 62px);
  --sheetBg: rgba(246,250,251,.88);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8f1f4; --ink2: #9fb2bd; --ink3: #6b7f8b;
    --brand: #2dd4bf; --brandSoft: rgba(45,212,191,.14); --danger: #ff8a70; --dangerSoft: rgba(255,138,112,.14);
    --glass: rgba(22,34,44,.55); --glass2: rgba(12,22,30,.45); --glassEdge: rgba(255,255,255,.09);
    --line: rgba(255,255,255,.07); --surface2: rgba(255,255,255,.05);
    --shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 10px 30px rgba(0,0,0,.35);
    --sheetBg: rgba(14,24,32,.88);
  }
}
body { background: #dfe9ec; }
@media (prefers-color-scheme: dark) { body { background: #04080b; } }

/* Ambient gradient behind everything; the glass picks up its colour */
#phone { background:
  radial-gradient(60% 40% at 0% 0%, rgba(45,212,191,.45), transparent 70%),
  radial-gradient(50% 35% at 100% 15%, rgba(129,140,248,.35), transparent 70%),
  radial-gradient(60% 40% at 80% 100%, rgba(56,189,248,.35), transparent 70%),
  linear-gradient(180deg, #f3f8f9, #e9f2f4); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #phone { background:
  radial-gradient(60% 40% at 0% 0%, rgba(20,184,166,.28), transparent 70%),
  radial-gradient(50% 35% at 100% 15%, rgba(99,102,241,.22), transparent 70%),
  radial-gradient(60% 40% at 80% 100%, rgba(14,165,233,.18), transparent 70%),
  linear-gradient(180deg, #0a1218, #071015); } }
@media (min-width: 600px) { #phone { box-shadow: 0 40px 100px rgba(0,30,40,.28), 0 0 0 9px #11191e, 0 0 0 10px #2a363d; } }
#app { position: relative; }

/* Frosted app bar floating over the scrolling content */
.bar, .bar.brand { position: absolute; top: 0; left: 0; right: 0; z-index: 10; height: var(--barH); min-height: 0;
  background: var(--glass2); color: var(--ink); border-bottom: 1px solid var(--glassEdge);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.bar h1 { font-size: 20px; letter-spacing: -.02em; }
.iconbtn { background: var(--glass); border: 1px solid var(--glassEdge); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: var(--ink); position: relative; }
.iconbtn .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.content { padding: calc(var(--barH) + 14px) 16px 120px; }
.content.nopad { padding: 0 0 40px; }
.content.nobar { padding-top: calc(env(safe-area-inset-top) + 18px); }

/* Floating glass tab bar with one center action */
.tabs { position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 12px); z-index: 10;
  border-radius: 26px; padding: 6px; border: 1px solid var(--glassEdge); background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 12px 34px rgba(10,40,50,.18); align-items: center; }
.tabs a { font-size: 10.5px; padding: 4px 0; }
.tabs a .pill { padding: 4px 14px; border-radius: 14px; transition: background .2s; }
.tabs .plus { flex: none; width: 56px; height: 56px; margin: -24px 6px 0; border-radius: 20px; border: 0; cursor: pointer; color: #fff;
  background: var(--grad); box-shadow: 0 10px 24px rgba(8,145,178,.45), inset 0 1px 0 rgba(255,255,255,.45); display: grid; place-items: center; transition: transform .2s; }
.tabs .plus svg { width: 28px; height: 28px; }
.tabs .plus:active { transform: scale(.94); }
.fab { display: none !important; }

/* Glass surfaces */
.card, .list, .med, .day, .drop, .input, .prefix, .seg button, .slotpick button, .empty {
  background: var(--glass); border: 1px solid var(--glassEdge); box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.input, .prefix { box-shadow: none; }
.prefix .input { background: transparent; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.input:focus, .prefix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brandSoft); }
select.input option { background: #fff; color: #0f1f2e; }
.list > .li { border-bottom: 1px solid var(--line); transition: background .15s; }
.list > .li:active, .card.tap:active { background: var(--surface2); }
.section { font-size: 12px; letter-spacing: .08em; color: var(--ink3); }
.avatar { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 12px rgba(0,0,0,.12); }
.chip.gray { background: var(--surface2); border: 1px solid var(--line); }
.empty { border-radius: var(--radius); margin-bottom: 12px; }
.empty .btn { margin-top: 16px; }

/* Glossy buttons */
.btn { background: var(--grad); color: #fff !important; box-shadow: 0 8px 20px rgba(8,145,178,.30), inset 0 1px 0 rgba(255,255,255,.35); border-radius: 16px; transition: transform .15s, filter .15s; text-decoration: none; }
.btn:active { transform: scale(.98); filter: brightness(.95); }
.btn.ghost { background: var(--brandSoft); color: var(--brand) !important; box-shadow: none; border: 1px solid rgba(13,148,136,.18); }
.btn.line { background: var(--glass); color: var(--ink) !important; box-shadow: none; border: 1px solid var(--glassEdge); }
.btn.danger { background: var(--dangerSoft); color: var(--danger) !important; box-shadow: none; }
.btn.wa { background: linear-gradient(135deg, #25d366, #128c7e); box-shadow: 0 8px 20px rgba(18,140,126,.35), inset 0 1px 0 rgba(255,255,255,.35); }
.linkbtn { border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 6px; display: inline-flex; align-items: center; gap: 4px; }
.linkbtn svg { width: 16px; height: 16px; }

/* Today header */
.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hello .avatar { width: 46px; height: 46px; border-radius: 16px; cursor: pointer; }
.hello h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.hello p { margin: 2px 0 0; color: var(--ink2); font-size: 13px; }
.days { padding: 2px 16px 14px; margin: 0 -16px; }
.day { border-radius: 18px; width: 52px; }
.day.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(8,145,178,.35); }
.day.today:not(.on) { border-color: var(--brand); }
.progress { background: linear-gradient(135deg, rgba(20,184,166,.92), rgba(8,145,178,.92)); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.progress .sub { color: rgba(255,255,255,.85); }
.progress .ring circle:first-child { stroke: rgba(255,255,255,.25); }
.progress .ring circle:last-child { stroke: #fff; }
.slot-h .dot { box-shadow: 0 6px 14px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.4); }
.tick { border-color: var(--ink3); background: var(--surface2); transition: transform .15s; }
.tick:active { transform: scale(.88); }
.tick.on { background: var(--grad); border-color: transparent; box-shadow: 0 4px 10px rgba(8,145,178,.35); }
.reorder-banner { background: linear-gradient(135deg, rgba(255,138,112,.20), rgba(251,191,36,.14)); border: 1px solid rgba(226,83,58,.25); }

/* Sheets: frosted, with an action grid for the + menu */
.scrim { background: rgba(5,15,20,.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet { background: var(--sheetBg); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); border-top: 1px solid var(--glassEdge); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 20px; border: 1px solid var(--glassEdge);
  background: var(--glass); cursor: pointer; text-align: left; box-shadow: var(--shadow); color: var(--ink); }
.action:active { transform: scale(.98); }
.action .ai { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 14px rgba(0,0,0,.12); }
.action .ai svg { width: 22px; height: 22px; }
.action b { font-size: 14.5px; }
.action span { font-size: 12px; color: var(--ink2); margin-top: -6px; }
.action.wide { grid-column: span 2; flex-direction: row; align-items: center; }
.action.wide span { margin-top: 2px; }

/* Landing */
.hero { background: var(--grad); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 300px; height: 300px; right: -90px; top: -80px; border-radius: 50%; background: rgba(255,255,255,.14); }
.feat .ic { background: var(--glass); border: 1px solid var(--glassEdge); }
#toast { background: rgba(15,31,46,.88); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-radius: 16px; bottom: 110px; }

[hidden] { display: none !important; }

/* Collapsible time-of-day sections on Today */
.slot { margin-bottom: 10px; }
.slot-h { width: 100%; border: 1px solid var(--glassEdge); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-radius: 20px; padding: 10px 12px; margin: 0; cursor: pointer; color: var(--ink); box-shadow: var(--shadow); transition: border-radius .2s; }
.slot-h b { font-size: 16px; }
.slot-sum { font-size: 12.5px; color: var(--ink3); margin-top: 1px; }
.slot-sum .ok { color: var(--brand); font-weight: 600; }
.slot-h span { margin-left: 0; }
.nowpill { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: var(--grad);
  padding: 2px 8px; border-radius: 10px; margin-left: 8px; vertical-align: 2px; box-shadow: 0 3px 8px rgba(8,145,178,.35); }
.faces { display: flex; }
.faces .avatar { margin-left: -6px; border: 2px solid var(--glassEdge); }
.chev { width: 20px; height: 20px; color: var(--ink3); transition: transform .25s; flex: none; }
.slot.open .chev { transform: rotate(180deg); }
.slot.open .faces { display: none; }
.slot-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease, opacity .25s; opacity: 0; }
.slot-body > * { overflow: hidden; }
.slot-body { padding: 0; }
.slot.open .slot-body { grid-template-rows: 1fr; opacity: 1; margin-top: 10px; }
.slot-body { display: grid; }
.slot-body > .card:first-child { margin-top: 0; }
.slot.now .slot-h { border-color: rgba(13,148,136,.45); box-shadow: 0 0 0 3px var(--brandSoft), var(--shadow); }

/* Re-order: delivery vs pickup */
.fulfil { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fopt { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: 20px; text-align: left; cursor: pointer; color: var(--ink);
  background: var(--glass); border: 1.5px solid var(--glassEdge); box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: border-color .2s, box-shadow .2s; position: relative; }
.fopt .ai { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; margin-bottom: 4px; }
.fopt .ai svg { width: 20px; height: 20px; }
.fopt b { font-size: 14.5px; }
.fopt span { font-size: 12px; color: var(--ink2); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fopt.on { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brandSoft), var(--shadow); }
.fopt.on::after { content: "✓"; position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }

/* Re-order quantity: stepper + tablets/sheets */
.qtyrow { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.stepper { display: flex; align-items: center; border: 1px solid var(--glassEdge); background: var(--glass); border-radius: 14px; overflow: hidden; height: 40px; }
.stepper button { width: 36px; height: 100%; border: 0; background: transparent; font-size: 20px; font-weight: 600; color: var(--brand); cursor: pointer; }
.stepper button:active { background: var(--brandSoft); }
.stepper input { width: 48px; height: 100%; border: 0; background: transparent; text-align: center; font-weight: 700; font-size: 16px; outline: none; }
.qunit { flex-wrap: nowrap; }
.qunit button { padding: 9px 12px; }
.sheetsz { font-size: 12.5px; color: var(--ink2); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.sheetsz input { width: 44px; height: 30px; border-radius: 10px; border: 1px solid var(--glassEdge); background: var(--glass); text-align: center; font-weight: 600; }

/* My orders */
.order .title { font-size: 15.5px; }
.order-amt { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 2px; color: var(--brand); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.order-amt span { font-size: 13px; font-weight: 500; color: var(--ink2); letter-spacing: 0; }
.order-items { font-size: 13px; color: var(--ink2); margin-top: 10px; display: grid; gap: 4px; }
.order-items b { color: var(--ink); font-weight: 600; }
.order.ready { border-color: rgba(13,148,136,.45); box-shadow: 0 0 0 3px var(--brandSoft), var(--shadow); }
.order.cancelled, .order.received { opacity: .75; }
.order .btns { margin-top: 12px; }
.order .btns .btn { flex: 1; }

.ready-banner { text-decoration: none; color: var(--ink); background: linear-gradient(135deg, rgba(20,184,166,.20), rgba(8,145,178,.14)); border: 1px solid rgba(13,148,136,.35); }
.ready-banner svg { width: 26px; height: 26px; color: var(--brand); flex: none; }

.days-eq { font-size: 12.5px; color: var(--brand); font-weight: 600; margin-top: 8px; }
.qunit button { padding: 9px 10px; }

/* Account shortcut + hub */
.mebtn { position: relative; border: 0; background: none; padding: 0; cursor: pointer; flex: none; }
.mebtn .dot { position: absolute; top: -2px; right: -2px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.avatar.sm { width: 38px; height: 38px; border-radius: 13px; font-size: 14px; }
.avatar.lg { width: 60px; height: 60px; border-radius: 20px; font-size: 22px; }
.me-hero .me-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.me-addr { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink2); margin-top: 12px; line-height: 1.4; }
.me-addr svg { flex: none; margin-top: 1px; color: var(--ink3); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.stat { text-decoration: none; color: var(--ink); text-align: center; padding: 10px 4px; border-radius: 16px; background: var(--surface2); border: 1px solid var(--line); }
.stat b { display: block; font-size: 20px; letter-spacing: -.02em; }
.stat span { font-size: 11px; color: var(--ink3); font-weight: 600; }
.order-mini { text-decoration: none; color: var(--ink); }
.order-mini svg { color: var(--brand); flex: none; }
.order-mini.ready { border-color: rgba(13,148,136,.45); box-shadow: 0 0 0 3px var(--brandSoft), var(--shadow); }
a.li { text-decoration: none; color: var(--ink); }

/* Ringing reminder */
#ring { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(80% 60% at 50% 30%, rgba(20,184,166,.55), rgba(5,20,28,.86)); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: fade .25s; }
.ring-card { width: 100%; max-width: 380px; text-align: center; color: #fff; }
.ring-bell { width: 112px; height: 112px; margin: 0 auto 14px; border-radius: 36px; display: grid; place-items: center; background: var(--grad);
  box-shadow: 0 0 0 0 rgba(45,212,191,.6), 0 18px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.45); animation: pulse 1.3s infinite; }
.ring-bell svg { width: 58px; height: 58px; transform-origin: 50% 8%; animation: swing 1.3s ease-in-out infinite; }
#ring.quiet .ring-bell, #ring.quiet .ring-bell svg { animation: none; }
@keyframes swing { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(22deg); } 25% { transform: rotate(-18deg); } 40% { transform: rotate(12deg); } 55% { transform: rotate(-7deg); } 70% { transform: rotate(3deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(45,212,191,.6), 0 18px 40px rgba(0,0,0,.35); } 70% { box-shadow: 0 0 0 26px rgba(45,212,191,0), 0 18px 40px rgba(0,0,0,.35); } 100% { box-shadow: 0 0 0 0 rgba(45,212,191,0), 0 18px 40px rgba(0,0,0,.35); } }
.ring-time { font-size: 42px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.ring-card h2 { margin: 6px 0 16px; font-size: 20px; font-weight: 600; opacity: .92; }
.ring-list { text-align: left; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 22px; padding: 12px 14px; margin-bottom: 16px; max-height: 38vh; overflow-y: auto; }
.ring-who { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; font-size: 14px; }
.ring-med { padding: 6px 0 6px 30px; font-weight: 600; font-size: 15.5px; border-top: 1px solid rgba(255,255,255,.12); }
.ring-med span { display: block; font-weight: 400; font-size: 12.5px; opacity: .8; }
#ring .btn.line { background: rgba(255,255,255,.14); color: #fff !important; border-color: rgba(255,255,255,.3); }
.ring-tap { font-size: 12px; opacity: .65; margin-top: 12px; }
#ring.quiet .ring-tap { visibility: hidden; }

.order-amt .saved { font-style: normal; font-size: 12.5px; font-weight: 600; color: #16a34a; letter-spacing: 0; }
.order-amt .saved s { color: var(--ink3); font-weight: 500; }

.slot-sum .miss { color: var(--danger); font-weight: 600; }

/* Order tabs */
.otabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glassEdge); margin-bottom: 14px; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.otabs button { border: 0; background: transparent; padding: 10px 0; border-radius: 14px; font-weight: 700; font-size: 13.5px; color: var(--ink2); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.otabs button span { min-width: 20px; height: 20px; border-radius: 10px; background: var(--surface2); font-size: 11.5px; display: grid; place-items: center; padding: 0 6px; }
.otabs button.on { background: var(--grad); color: #fff; box-shadow: 0 6px 14px rgba(8,145,178,.3); }
.otabs button.on span { background: rgba(255,255,255,.25); color: #fff; }
.paybar { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--brandSoft); color: var(--brand); font-size: 13px; font-weight: 600; }
.paybar svg { width: 18px; height: 18px; flex: none; }

.order .btns .btn { white-space: nowrap; font-size: 13.5px; }

/* Orders grouped by family member */
.ogroup { margin-bottom: 8px; }
.ogroup-h { display: flex; align-items: center; gap: 10px; margin: 14px 4px 10px; }
.ogroup-h .avatar + .avatar { margin-left: -16px; border: 2px solid var(--glassEdge); }
.ogroup-h b { display: block; font-size: 15.5px; }
.ogroup-h span { font-size: 12px; color: var(--ink3); }
.ogroup-h em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink2); background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 2px 9px; }
.oi-who { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink3); margin-top: 6px; }
.oi-who:first-child { margin-top: 0; }

/* Orders calendar */
.cal { padding: 12px; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-h b { font-size: 16.5px; }
.cal-h .iconbtn { width: 36px; height: 36px; }
.cal-w, .cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-w span { text-align: center; font-size: 11px; font-weight: 700; color: var(--ink3); padding: 4px 0; }
.cday { aspect-ratio: 1 / 1.05; border: 1.5px solid transparent; background: transparent; border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; padding: 0; }
.cday.blank { cursor: default; }
.cday.has { background: var(--surface2); }
.cday.today { border-color: var(--brand); }
.cday.sel { background: var(--grad); color: #fff; box-shadow: 0 6px 14px rgba(8,145,178,.35); }
.cday i { display: flex; gap: 2px; height: 6px; }
.cday i b { width: 6px; height: 6px; border-radius: 50%; }
.cday.sel i b { box-shadow: 0 0 0 1.5px #fff; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 10px; font-size: 11.5px; color: var(--ink2); }
.cal-legend span { display: flex; align-items: center; gap: 5px; }
.cal-legend b { width: 8px; height: 8px; border-radius: 50%; }
.cal-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.cal-sum > div { text-align: center; padding: 10px 4px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glassEdge); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.cal-sum b { display: block; font-size: 17px; letter-spacing: -.02em; }
.cal-sum span { font-size: 11px; color: var(--ink3); font-weight: 600; }

.datelink { border: 0; background: none; padding: 0; font: inherit; color: var(--brand); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.datelink svg { width: 13px; height: 13px; }

/* Landing: compact hero, side-by-side actions */
.hero { padding: calc(env(safe-area-inset-top) + 18px) 22px 22px; border-radius: 0 0 28px 28px; }
.hero h2 { font-size: 24px; margin: 16px 0 6px; }
.hero p { font-size: 14px; }
.hero .logo img { width: 34px; height: 34px; }
.feat { padding: 9px 0; }
.land-btns { margin-top: 16px; gap: 10px; }
.land-btns .btn { flex: 1; padding: 0 10px; font-size: 14.5px; white-space: nowrap; }

/* Landing feature tiles */
.ftiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ftile { background: var(--glass); border: 1px solid var(--glassEdge); border-radius: 18px; padding: 11px 12px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); display: flex; flex-direction: column; gap: 2px; }
.ftile .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; margin-bottom: 6px; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 10px rgba(0,0,0,.12); }
.ftile .ic svg { width: 17px; height: 17px; }
.ftile b { font-size: 13.5px; line-height: 1.25; }
.ftile span { font-size: 11.5px; color: var(--ink2); line-height: 1.35; }

/* Gold logo tiles */
.hero .logo img, .brand img { box-shadow: 0 6px 16px rgba(0,0,0,.25), 0 0 0 1px rgba(243,207,107,.35); }
.hero .logo { font-size: 19px; }
.hero .logo img { width: 46px; height: 46px; border-radius: 14px; }

/* Order parts + payment */
.partline { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #b45309; background: rgba(245,158,11,.12); border-radius: 10px; padding: 5px 10px; margin: -2px 0 10px; width: fit-content; }
.partline svg { width: 14px; height: 14px; }
.payrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--ink2); font-weight: 600; }
.paysw { display: flex; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.paysw button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink3); cursor: pointer; display: flex; align-items: center; gap: 4px; }
.paysw button svg { width: 14px; height: 14px; }
.paysw button.on[data-paid="1"] { background: #16a34a; color: #fff; box-shadow: 0 3px 8px rgba(22,163,74,.3); }
.paysw button.on[data-paid="0"] { background: var(--dangerSoft); color: var(--danger); }
.paydue { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--danger); background: var(--dangerSoft); padding: 3px 10px; border-radius: 10px; }

.siblings { display: grid; gap: 6px; margin-bottom: 10px; }
.sib { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; font-size: 12.5px; padding: 7px 10px; border-radius: 12px; background: var(--surface2); border: 1px dashed var(--line); }
.sib b { color: var(--ink); }
.sib span { color: var(--ink2); font-weight: 600; }
.sib em { grid-column: 1 / -1; font-style: normal; color: var(--ink3); }
.sib.ready span { color: var(--brand); }

/* Order card with stacked parts */
.opart.multi { margin-top: 10px; padding: 12px; border-radius: 16px; background: var(--surface2); border: 1px solid var(--line); }
.opart.multi.ready { border-color: rgba(13,148,136,.4); background: var(--brandSoft); }
.opart.multi.sent { border-style: dashed; border-color: rgba(245,158,11,.5); }
.opart-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.opart-h .chip { margin-left: auto; }
.opart-h .muted { font-size: 12px; }
.opart .order-amt { margin-top: 6px; }
.order > .partline { margin: 10px 0 0; }

/* Medicines dashboard */
.medstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.medstats button { border: 1px solid var(--glassEdge); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: 16px; padding: 9px 2px; cursor: pointer; color: var(--ink); box-shadow: var(--shadow); }
.medstats b { display: block; font-size: 20px; letter-spacing: -.02em; }
.medstats span { font-size: 10.5px; font-weight: 700; color: var(--ink3); }
.medstats button.on { background: var(--grad); color: #fff; border-color: transparent; }
.medstats button.on span { color: rgba(255,255,255,.85); }
.medstats button.warn:not(.on) b { color: var(--danger); }
.medsearch { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glassEdge); margin-bottom: 10px; }
.medsearch svg { width: 18px; height: 18px; color: var(--ink3); flex: none; }
.medsearch input { flex: 1; border: 0; background: transparent; outline: none; font-size: 15px; }
.memchips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 6px; padding: 0 16px 6px; scrollbar-width: none; }
.memchips::-webkit-scrollbar { display: none; }
.memchips button { flex: none; display: flex; align-items: center; gap: 6px; border: 1px solid var(--glassEdge); background: var(--glass); border-radius: 20px; padding: 5px 12px 5px 6px; font-size: 13px; font-weight: 700; color: var(--ink2); cursor: pointer; }
.memchips button:first-child { padding-left: 12px; }
.memchips button em { font-style: normal; font-size: 11px; background: var(--surface2); border-radius: 9px; padding: 1px 6px; }
.memchips button.on { background: var(--brandSoft); border-color: var(--brand); color: var(--brand); }
.medrow { cursor: pointer; padding: 14px; }
.medrow .medic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brandSoft); color: var(--brand); flex: none; }
.medrow .medic svg { width: 20px; height: 20px; }
.medrow.low { border-color: rgba(226,83,58,.35); }
.medrow.low .medic { background: var(--dangerSoft); color: var(--danger); }
.medrow.ended { opacity: .6; }
.medrow.flash { animation: flash 2.4s ease; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px rgba(34,197,94,.55), var(--shadow); } 100% { box-shadow: var(--shadow); } }
.slotchips { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 8px; }
.slotchips span { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); padding: 3px 9px 3px 6px; border-radius: 10px; }
.slotchips svg { width: 13px; height: 13px; }
.medfoot { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink2); }
.stockline { flex: 1; min-width: 0; }
.stockline .sbar { height: 6px; border-radius: 4px; background: var(--surface2); border: 1px solid var(--line); overflow: hidden; margin-bottom: 4px; }
.stockline .sbar i { display: block; height: 100%; background: var(--grad); border-radius: 4px; }
.medrow.low .stockline .sbar i { background: linear-gradient(90deg, #f97316, #e2533a); }
.stockline.none span { color: var(--ink3); font-style: italic; }
.till { font-size: 12px; color: var(--ink3); white-space: nowrap; }
.medfoot .linkbtn { padding: 4px 0; }
.pillbtn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--glassEdge); background: var(--glass); font-weight: 700; font-size: 13px; color: var(--ink); cursor: pointer; }
.pillbtn svg { width: 17px; height: 17px; }
/* success toast */
#toast.ok { background: linear-gradient(135deg, #16a34a, #0d9488); display: flex; align-items: center; gap: 10px; text-align: left; box-shadow: 0 10px 26px rgba(13,148,136,.4); }
#toast .tk { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; font-weight: 800; flex: none; }
#toast.ok { width: max-content; max-width: min(90%, 340px); }

/* Tablets per sheet */
.persheet { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; color: var(--ink2); background: var(--surface2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 10px; }
.persheet.unset { color: #b45309; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.3); }
.stockmode { margin-top: 4px; }
.stockmode button { flex: 1; }
.stepper.big { height: 50px; width: 100%; justify-content: space-between; border-radius: 14px; }
.stepper.big button { width: 46px; font-size: 22px; }
.stepper.big input { flex: 1; font-size: 18px; }
.stocktotal { font-size: 13.5px; color: var(--ink2); background: var(--brandSoft); border-radius: 12px; padding: 10px 12px; margin: 4px 0 12px; min-height: 18px; }
.stocktotal:empty { display: none; }
.stocktotal b { color: var(--brand); }

/* Receive check */
.rcard { border: 1px solid var(--glassEdge); background: var(--glass); border-radius: 18px; padding: 12px; margin-bottom: 10px; }
.rtop { display: flex; gap: 10px; align-items: flex-start; }
.rtop b { font-size: 15px; }
.rtop span { display: block; font-size: 12.5px; color: var(--ink2); margin-top: 2px; }
.rtop span b { font-size: 12.5px; color: var(--brand); }
.rtop .none { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink3); white-space: nowrap; margin: 0; }
.rtop .none input { width: 16px; height: 16px; accent-color: var(--danger); }
.rbody.off { opacity: .35; pointer-events: none; }
.rseg { margin: 10px 0 8px; }
.rseg button { flex: 1; }
.rrow { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--ink2); font-weight: 600; }
.rrow > span:first-child { min-width: 56px; }
.rrow .input { height: 40px; width: 90px; font-size: 15px; padding: 0 10px; }
.rrow .stepper { height: 40px; }
.req { font-size: 12.5px; color: var(--ink2); margin-top: 8px; }
.req b { color: var(--brand); }
.req .short, .rcv.short { color: var(--danger); font-weight: 700; }
.req .okk { color: #16a34a; font-weight: 700; }
.rcv { display: block; font-size: 11.5px; color: #16a34a; font-weight: 600; margin: 1px 0 3px; }

.reorder-cta { width: 100%; text-align: left; cursor: pointer; color: var(--ink); margin-bottom: 12px; }
.reorder-cta > svg:first-child { width: 26px; height: 26px; color: var(--brand); flex: none; }
.reorder-cta.warn { background: linear-gradient(135deg, rgba(255,138,112,.20), rgba(251,191,36,.14)); border-color: rgba(226,83,58,.3); }
.reorder-cta.warn > svg:first-child, .reorder-cta.warn .title { color: var(--danger); }

.section .linkbtn { text-transform: none; letter-spacing: 0; font-size: 13px; text-decoration: none; }

/* Re-order: create, then share */
.order-locked .ro, .order-locked .fulfil, .order-locked #when { pointer-events: none; opacity: .6; }
.sharebox { border-color: rgba(22,163,74,.35); }
.share-ok { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.share-ok > svg { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: linear-gradient(135deg, #16a34a, #0d9488); color: #fff; flex: none; }
.share-ok b { display: block; font-size: 16px; margin-bottom: 2px; }
.share-ok span { font-size: 13px; color: var(--ink2); line-height: 1.4; }
.sharebox .btns .btn { flex: 1; }

/* Phone access card */
.access .title { font-size: 15px; }
.linkbox { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface2); border: 1px dashed var(--line); font-size: 12.5px; color: var(--ink2); word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; }
.access .btns .btn { flex: 1; }
.danger-txt { color: var(--danger) !important; }

/* Add to home screen */
.installcard { display: flex; gap: 12px; align-items: flex-start; border-color: rgba(212,160,23,.45); background: linear-gradient(135deg, rgba(253,230,138,.28), rgba(255,255,255,.55)); }
.installcard img { width: 48px; height: 48px; border-radius: 13px; box-shadow: 0 6px 14px rgba(0,0,0,.18); flex: none; }
.installcard .iconbtn.sm { width: 30px; height: 30px; flex: none; }
.installcard .iconbtn.sm svg { width: 16px; height: 16px; }
.ios-share { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: #007aff; color: #fff; font-size: 12px; vertical-align: -3px; }
.steps { padding-left: 20px; margin: 4px 0 14px; line-height: 1.9; font-size: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .installcard { background: linear-gradient(135deg, rgba(212,160,23,.18), rgba(22,34,44,.6)); } }
