/* ============ Fillmaster Compliance Portal ============ */
:root {
  --blue-900: #0b3a5e;
  --blue-800: #0e4a78;
  --blue-700: #1565a0;
  --blue-600: #1a7fc4;
  --blue-100: #e2f1fb;
  --blue-50:  #f0f8fd;
  --teal-500: #14b8a6;
  --ink-900: #16242f;
  --ink-700: #38505f;
  --ink-500: #5d7585;
  --ink-300: #9fb3bf;
  --line: #dde8ef;
  --bg: #f4f8fa;
  --card: #ffffff;
  --green-600: #16855b;
  --green-100: #e0f5ec;
  --amber-700: #92600a;
  --amber-100: #fdf0d7;
  --red-600: #c23a3a;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(11, 58, 94, .07), 0 8px 24px rgba(11, 58, 94, .06);
  --shadow-lg: 0 4px 12px rgba(11, 58, 94, .10), 0 16px 48px rgba(11, 58, 94, .12);
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  background: linear-gradient(105deg, var(--blue-900), var(--blue-700));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(11, 58, 94, .25);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: .7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; font-weight: 800; font-size: 1.08rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-size: 1.25rem;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  width: 2.2rem; height: 2.2rem;
  display: grid; place-items: center;
}
.brand-sub { font-weight: 500; opacity: .85; }
.topnav { display: flex; align-items: center; gap: .35rem; }
.topnav-link {
  color: #fff;
  padding: .45rem .8rem;
  border-radius: 9px;
  font-size: .9rem;
  font-weight: 600;
  background: rgba(255,255,255,.10);
  white-space: nowrap;
}
.topnav-link:hover { background: rgba(255,255,255,.22); text-decoration: none; }
.topnav-link.logout { background: transparent; opacity: .85; font-weight: 500; }
.topnav-user { font-size: .85rem; opacity: .9; padding: 0 .5rem; white-space: nowrap; }

/* ---------- Layout ---------- */
.main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.main-bare { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.footer {
  text-align: center;
  padding: 1.2rem;
  color: var(--ink-500);
  font-size: .8rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.page-head { margin: 0 0 1.25rem; }
.page-head h1 { margin: 0 0 .25rem; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--ink-500); font-size: .95rem; }
.breadcrumbs { font-size: .85rem; color: var(--ink-500); margin-bottom: .8rem; }
.breadcrumbs a { font-weight: 600; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: none; cursor: pointer;
  font: inherit; font-weight: 700; font-size: .95rem;
  padding: .7rem 1.4rem;
  border-radius: 10px;
  background: linear-gradient(105deg, var(--blue-700), var(--blue-600));
  color: #fff;
  transition: transform .06s ease, box-shadow .15s ease, filter .15s ease;
  box-shadow: 0 2px 8px rgba(21, 101, 160, .35);
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-ghost {
  background: #fff; color: var(--blue-700);
  border: 1.5px solid var(--line); box-shadow: none;
}
.btn-ghost:hover { background: var(--blue-50); }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .82rem; font-weight: 700; color: var(--ink-700); margin-bottom: .35rem; }
.field input, .field select {
  width: 100%;
  font: inherit;
  padding: .68rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-900);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(26, 127, 196, .18);
}
.hint { font-size: .8rem; color: var(--ink-500); margin-top: .35rem; }

/* ---------- Login ---------- */
.login-wrap { width: 100%; max-width: 420px; }
.login-hero { text-align: center; margin-bottom: 1.5rem; }
.login-hero .drop {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--blue-700), var(--teal-500));
  width: 4.2rem; height: 4.2rem;
  border-radius: 18px;
  display: grid; place-items: center;
  margin: 0 auto .9rem;
  box-shadow: var(--shadow-lg);
}
.login-hero h1 { margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; color: var(--blue-900); }
.login-hero p { margin: .35rem 0 0; color: var(--ink-500); font-size: .92rem; }
.login-card { padding: 1.8rem; }
.demo-note {
  margin-top: 1.1rem;
  background: var(--blue-50);
  border: 1px dashed var(--blue-600);
  border-radius: 10px;
  padding: .7rem .9rem;
  font-size: .82rem;
  color: var(--blue-800);
}
.login-explore {
  text-align: center; margin-top: 1.2rem; font-size: .82rem; color: var(--ink-500);
}
.login-explore span { display: block; margin-bottom: .35rem; }
.login-explore a { font-weight: 700; }
.login-page-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60rem 30rem at 110% -10%, var(--blue-100), transparent),
    radial-gradient(50rem 28rem at -20% 110%, #d8f3ef, transparent),
    var(--bg);
}

/* ---------- Lookup ---------- */
.lookup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: stretch; }
.lookup-card { display: flex; flex-direction: column; }
.lookup-card .icon {
  font-size: 1.4rem;
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--blue-100);
  margin-bottom: .9rem;
}
.lookup-card.rx .icon { background: var(--green-100); }
.lookup-card h2 { margin: 0 0 .3rem; font-size: 1.15rem; font-weight: 800; }
.lookup-card .sub { color: var(--ink-500); font-size: .9rem; margin: 0 0 1.1rem; }
.lookup-card form { margin-top: auto; }
.or-divider {
  display: none;
}

/* ---------- Store search results ---------- */
.store-list { display: grid; gap: .8rem; margin-top: 1.25rem; }
.store-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .1s;
  color: inherit;
}
.store-row:hover { border-color: var(--blue-600); text-decoration: none; transform: translateY(-1px); }
.store-row .store-no {
  font-weight: 800; color: var(--blue-800);
  background: var(--blue-100);
  border-radius: 9px; padding: .45rem .7rem;
  font-size: .9rem; white-space: nowrap;
}
.store-row .store-meta { flex: 1; min-width: 0; }
.store-row .store-name { font-weight: 700; }
.store-row .store-addr { color: var(--ink-500); font-size: .85rem; }
.store-row .chev { color: var(--ink-300); font-size: 1.2rem; }
.no-results { text-align: center; color: var(--ink-500); padding: 2rem 1rem; }

/* ---------- Store page ---------- */
.store-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.4rem;
  margin-bottom: 1.2rem;
}
.store-header .badge-no {
  font-size: 1.05rem; font-weight: 800;
  background: var(--blue-900); color: #fff;
  border-radius: 11px; padding: .55rem .85rem;
}
.store-header h1 { margin: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.store-header .meta { color: var(--ink-500); font-size: .88rem; width: 100%; }
.store-header .meta span { margin-right: 1.2rem; white-space: nowrap; }

/* Calendar */
.cal-card { padding: 1rem 1.2rem 1.2rem; margin-bottom: 1.25rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cal-title { font-weight: 800; font-size: 1rem; }
.cal-nav { display: flex; gap: .4rem; }
.cal-nav button {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-700);
  border-radius: 8px; width: 2.1rem; height: 2.1rem;
  font-size: 1rem; cursor: pointer;
}
.cal-nav button:hover { background: var(--blue-50); border-color: var(--blue-600); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem; }
.cal-dow { text-align: center; font-size: .68rem; font-weight: 700; color: var(--ink-300); text-transform: uppercase; padding: .3rem 0; }
.cal-day {
  position: relative;
  aspect-ratio: 1.15;
  border: none; background: transparent;
  border-radius: 9px;
  font: inherit; font-size: .85rem; color: var(--ink-700);
  cursor: default;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.cal-day.has-data { cursor: pointer; background: var(--blue-50); font-weight: 700; color: var(--blue-800); }
.cal-day.has-data:hover { background: var(--blue-100); }
.cal-day.has-data .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--blue-600); }
.cal-day.selected { background: var(--blue-700) !important; color: #fff; }
.cal-day.selected .dot { background: #fff; }
.cal-day.empty { visibility: hidden; }
.cal-day.today { outline: 2px solid var(--teal-500); outline-offset: -2px; }
.cal-clear {
  font-size: .8rem; font-weight: 700; color: var(--blue-700);
  background: none; border: none; cursor: pointer; padding: .3rem .5rem;
}
.cal-hint { font-size: .78rem; color: var(--ink-500); margin-top: .5rem; }

/* Tabs */
.tabs { display: flex; gap: .4rem; border-bottom: 2px solid var(--line); margin-bottom: 1rem; }
.tab-btn {
  font: inherit; font-weight: 700; font-size: .92rem;
  color: var(--ink-500);
  background: none; border: none; cursor: pointer;
  padding: .65rem 1rem .55rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--blue-700); }
.tab-btn.active { color: var(--blue-800); border-bottom-color: var(--blue-600); }
.tab-btn .count {
  font-size: .72rem; font-weight: 800;
  background: var(--blue-100); color: var(--blue-800);
  border-radius: 99px; padding: .1rem .5rem; margin-left: .3rem;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Table toolbar */
.table-toolbar { display: flex; gap: .7rem; align-items: center; margin-bottom: .8rem; flex-wrap: wrap; }
.table-toolbar input {
  flex: 1; min-width: 200px;
  font: inherit; font-size: .9rem;
  padding: .55rem .85rem;
  border: 1.5px solid var(--line); border-radius: 9px;
}
.table-toolbar input:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(26,127,196,.15); }
.filter-pill {
  display: none;
  align-items: center; gap: .45rem;
  background: var(--blue-100); color: var(--blue-800);
  font-size: .82rem; font-weight: 700;
  border-radius: 99px; padding: .35rem .8rem;
}
.filter-pill.show { display: inline-flex; }
.filter-pill button { background: none; border: none; cursor: pointer; font-weight: 800; color: var(--blue-800); padding: 0; font-size: .95rem; }
.result-count { font-size: .82rem; color: var(--ink-500); white-space: nowrap; }

/* Data tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
table.data th {
  text-align: left;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-500);
  background: var(--blue-50);
  padding: .7rem .9rem;
  border-bottom: 1.5px solid var(--line);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: sticky; top: 0;
}
table.data th:hover { color: var(--blue-800); }
table.data th .arrow { opacity: .45; font-size: .8em; margin-left: .25em; }
table.data th.sorted .arrow { opacity: 1; color: var(--blue-700); }
table.data td { padding: .65rem .9rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--blue-50); }
tr.row-link { cursor: pointer; }
.rx-link { font-weight: 700; color: var(--blue-700); }
.med-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }

.pill { display: inline-block; font-size: .75rem; font-weight: 700; border-radius: 99px; padding: .2rem .65rem; }
.pill.pass { background: var(--green-100); color: var(--green-600); }
.pill.attention { background: var(--amber-100); color: var(--amber-700); }
.pill.type { background: var(--blue-100); color: var(--blue-800); }

.empty-state { text-align: center; color: var(--ink-500); padding: 2.5rem 1rem; font-size: .92rem; }

/* ---------- Rx detail ---------- */
.rx-head-card {
  background: linear-gradient(105deg, var(--blue-900), var(--blue-700));
  color: #fff;
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: flex-end;
}
.rx-head-card .rx-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; font-weight: 700; }
.rx-head-card .rx-number { font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; }
.rx-head-card .rx-med { font-size: 1.05rem; font-weight: 600; max-width: 100%; }
.rx-head-card .rx-when { font-size: .9rem; opacity: .85; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.detail-card h3 {
  margin: 0 0 .9rem; font-size: .8rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em; color: var(--ink-500);
  display: flex; align-items: center; gap: .5rem;
}
.kv { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; row-gap: .55rem; column-gap: 1rem; font-size: .9rem; }
.kv dt { color: var(--ink-500); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; color: var(--ink-900); word-break: break-word; }
.kv dd.mono { font-variant-numeric: tabular-nums; }

.ing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ing-card { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; background: var(--blue-50); }
.ing-card h4 { margin: 0 0 .6rem; font-size: .92rem; font-weight: 800; color: var(--blue-900); display: flex; align-items: center; gap: .5rem; }
.ing-num {
  background: var(--blue-700); color: #fff;
  width: 1.45rem; height: 1.45rem; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: .75rem; font-weight: 800; flex: none;
}
.ing-card .kv { font-size: .85rem; row-gap: .4rem; }

.actions-bar { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .lookup-grid { grid-template-columns: 1fr; }
  .or-divider {
    display: flex; align-items: center; gap: .8rem;
    color: var(--ink-300); font-weight: 800; font-size: .8rem;
  }
  .or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
  .detail-grid { grid-template-columns: 1fr; }
  .ing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  html { font-size: 15px; }
  .brand-sub { display: none; }
  .topnav-label { display: none; }
  .topnav-user { display: none; }
  .main { padding: 1rem .8rem 2.5rem; }
  .card { padding: 1.1rem; }
  .rx-head-card { padding: 1.1rem 1.2rem; gap: .6rem 1.5rem; }
  .rx-head-card .rx-number { font-size: 1.4rem; }
  .kv { grid-template-columns: 1fr; row-gap: .15rem; }
  .kv dt { margin-top: .55rem; font-size: .78rem; }
  .cal-day { font-size: .78rem; }
  .store-row { padding: .85rem .9rem; }
  .page-head h1 { font-size: 1.25rem; }
}

/* =====================================================================
   EDUCATIONAL PAGES (Workflow / FAQ / Legal)
   ===================================================================== */

/* ---- Device screen palette (matches physical Fillmaster touchscreen) ---- */
:root {
  --fm-teal-deep: #0c4f63;
  --fm-teal-deep2: #0a6075;
  --fm-go: #25a39b;       /* dispense / OK */
  --fm-amber: #efa829;    /* back */
  --fm-red: #e23a31;      /* cancel */
  --fm-sky: #1aa4d8;      /* NDC / progress */
  --fm-mark: #ff7a1a;     /* FLAVORx "Rx" orange */
}

/* ---- Secondary "learn" nav row ---- */
.subnav {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.subnav-inner {
  max-width: 1180px; margin: 0 auto;
  padding: .35rem 1rem;
  display: flex; align-items: center; gap: .3rem; flex-wrap: wrap;
}
.subnav-link {
  color: var(--ink-700); font-weight: 600; font-size: .86rem;
  padding: .4rem .7rem; border-radius: 8px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .4rem;
}
.subnav-link:hover { background: var(--blue-50); color: var(--blue-800); text-decoration: none; }
.subnav-link.active { background: var(--blue-100); color: var(--blue-900); }
.subnav-spacer { flex: 1; }
.subnav-tag { font-size: .72rem; font-weight: 800; color: var(--teal-500); letter-spacing: .04em; }

/* ---- Marketing hero ---- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(115deg, var(--blue-900), var(--blue-700) 60%, var(--fm-teal-deep2));
  color: #fff; border-radius: 18px;
  padding: 2.6rem 2.2rem; margin-bottom: 1.6rem;
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(28rem 16rem at 108% -20%, rgba(37,163,155,.55), transparent),
    radial-gradient(24rem 14rem at -10% 130%, rgba(26,164,216,.4), transparent);
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  padding: .35rem .8rem; border-radius: 99px; margin-bottom: 1rem;
}
.hero h1 { margin: 0 0 .6rem; font-size: 2.15rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }
.hero p { margin: 0; max-width: 60ch; font-size: 1.05rem; opacity: .92; line-height: 1.55; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }
.hero-cta .btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.hero-cta .btn-ghost:hover { background: rgba(255,255,255,.22); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2.2rem; margin-top: 1.8rem; }
.hero-stat .n { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.hero-stat .l { font-size: .82rem; opacity: .85; }

/* ---- Section headings ---- */
.sec-head { margin: 2.4rem 0 1.1rem; }
.sec-head h2 { margin: 0 0 .25rem; font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; color: var(--blue-900); }
.sec-head p { margin: 0; color: var(--ink-500); font-size: .95rem; }
.sec-kicker { font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-500); }

.badge-new {
  display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .06em;
  background: var(--teal-500); color: #fff; border-radius: 99px;
  padding: .12rem .5rem; vertical-align: middle; text-transform: uppercase;
}

/* ---- "Why it matters" / feature cards ---- */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.feat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.feat-card .fi {
  font-size: 1.3rem; width: 2.8rem; height: 2.8rem; border-radius: 12px;
  display: grid; place-items: center; background: var(--blue-100); margin-bottom: .8rem;
}
.feat-card.tealtint .fi { background: var(--green-100); }
.feat-card h3 { margin: 0 0 .35rem; font-size: 1.02rem; font-weight: 800; }
.feat-card p { margin: 0; color: var(--ink-700); font-size: .9rem; line-height: 1.55; }

/* =================== DEVICE SIMULATOR =================== */
.sim-layout { display: grid; grid-template-columns: 290px 1fr; gap: 1.5rem; align-items: start; }

/* Vertical stepper */
.sim-steps { display: flex; flex-direction: column; gap: .2rem; }
.sim-step {
  display: flex; gap: .8rem; align-items: flex-start; text-align: left;
  background: none; border: none; cursor: pointer; font: inherit;
  padding: .7rem .8rem; border-radius: 12px; position: relative; width: 100%;
}
.sim-step:hover { background: var(--blue-50); }
.sim-step.active { background: var(--blue-100); }
.sim-step .num {
  flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: #fff; border: 2px solid var(--line); color: var(--ink-500);
  display: grid; place-items: center; font-size: .85rem; font-weight: 800;
}
.sim-step.active .num { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.sim-step.done .num { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.sim-step .st-title { display: block; font-weight: 700; font-size: .92rem; color: var(--ink-900); line-height: 1.2; }
.sim-step .st-sub { display: block; font-size: .78rem; color: var(--ink-500); margin-top: .15rem; }
.sim-step.active .st-title { color: var(--blue-900); }

/* Device shell */
.sim-stage { display: flex; flex-direction: column; align-items: center; }
.fm-screens .fm-screen { display: none; }
.fm-screens .fm-screen.active-step { display: flex; }
.sim-caption { display: none; }
.sim-caption.active-step { display: block; }
.fm-device {
  width: 100%; max-width: 620px;
  background: linear-gradient(160deg, #ffffff, #eef3f6);
  border: 1px solid #dbe6ec; border-radius: 26px;
  padding: 20px; box-shadow: var(--shadow-lg);
}
.fm-screen {
  position: relative; aspect-ratio: 5 / 3; width: 100%;
  border-radius: 10px; overflow: hidden;
  background: #fff; display: flex;
  box-shadow: inset 0 0 0 3px #11333f, 0 2px 6px rgba(0,0,0,.2);
  font-family: 'Inter', sans-serif;
}
.fm-main { flex: 1; position: relative; padding: 6% 6% 6% 7%; display: flex; flex-direction: column; min-width: 0; }
.fm-rail {
  width: 21%; background: var(--fm-teal-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9%; padding: 6% 0;
}
.fm-key {
  width: 60%; aspect-ratio: 1; border-radius: 50%; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; gap: 2px; line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .07s, filter .12s;
  font-size: clamp(.4rem, 1.4vw, .6rem); letter-spacing: .03em;
}
.fm-key:hover { filter: brightness(1.08); }
.fm-key:active { transform: translateY(1px); }
.fm-key .ico { font-size: 1.6em; line-height: 1; }
.fm-key.back { background: var(--fm-amber); }
.fm-key.go { background: var(--fm-go); }
.fm-key.cancel { background: var(--fm-red); }

/* Screen flavor variants */
.fm-screen.bg-light .fm-main { background: linear-gradient(180deg, #ffffff 40%, #d7f0ef); }
.fm-screen.bg-deep .fm-main { background: var(--fm-teal-deep); color: #fff; }
.fm-screen.bg-deep .fm-title { color: #fff; }
.fm-title {
  font-size: clamp(.95rem, 3.2vw, 1.7rem); font-weight: 800; color: var(--fm-teal-deep);
  letter-spacing: -.01em; line-height: 1.08; margin: 0 0 .5em; text-transform: uppercase;
}
.fm-sub { font-size: clamp(.6rem, 1.7vw, .9rem); color: var(--ink-700); line-height: 1.5; }
.fm-center { align-items: center; justify-content: center; text-align: center; }

/* Home screen */
.fm-logo { text-align: center; margin-bottom: 7%; }
.fm-logo .fl { font-size: clamp(1.4rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -.01em; }
.fm-logo .fl .rx { color: var(--fm-mark); }
.fm-logo .fl .flavo { color: var(--fm-sky); }
.fm-logo .au { font-size: clamp(1.6rem, 6vw, 3rem); font-weight: 800; color: var(--blue-800); letter-spacing: .02em; line-height: .9; }
.fm-home-btns { display: flex; gap: 6%; justify-content: center; }
.fm-circle {
  width: clamp(54px, 16%, 110px); aspect-ratio: 1; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; gap: .2em; cursor: pointer; border: none;
  font-size: clamp(.55rem, 1.6vw, .82rem); box-shadow: 0 3px 8px rgba(0,0,0,.18);
}
.fm-circle .ico { font-size: 1.9em; }
.fm-circle.scan { background: var(--fm-teal-deep); }
.fm-circle.ndc { background: var(--fm-sky); }
.fm-circle.menu { background: var(--fm-go); }

/* Badge / scan graphics */
.fm-bigicon { font-size: clamp(2.4rem, 11vw, 5rem); line-height: 1; margin: .2em 0; }
.fm-scanbox {
  border: 3px dashed var(--fm-sky); border-radius: 12px;
  padding: .7em 1.2em; font-weight: 800; color: var(--fm-teal-deep);
  font-size: clamp(.7rem, 2.2vw, 1.1rem); letter-spacing: .04em;
  display: inline-flex; align-items: center; gap: .5em; background: rgba(255,255,255,.6);
}
.fm-entry {
  margin-top: 5%; font-variant-numeric: tabular-nums; font-weight: 800;
  font-size: clamp(.9rem, 3vw, 1.6rem); color: var(--blue-900);
  background: #fff; border: 2px solid var(--fm-sky); border-radius: 8px;
  padding: .3em .7em; letter-spacing: .12em; display: inline-block;
}
.fm-entry .caret { animation: fmblink 1s step-end infinite; color: var(--fm-sky); }
@keyframes fmblink { 50% { opacity: 0; } }
.fm-barcode {
  display: inline-block; height: 1.6em; width: 70%; max-width: 220px; margin-top: .5em;
  background: repeating-linear-gradient(90deg, #16242f 0 2px, #fff 2px 4px, #16242f 4px 7px, #fff 7px 9px);
  border-radius: 2px;
}
.fm-badgecard {
  width: 58%; max-width: 220px; aspect-ratio: 1.6; border-radius: 12px; margin-top: 3%;
  background: linear-gradient(135deg, var(--blue-700), var(--fm-go));
  color: #fff; padding: .8em; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0,0,0,.2); text-align: left;
}
.fm-badgecard .bc-top { font-size: .62em; font-weight: 700; opacity: .85; letter-spacing: .08em; }
.fm-badgecard .bc-name { font-size: clamp(.7rem, 2vw, 1rem); font-weight: 800; }
.fm-badgecard .bc-strip { height: .5em; width: 60%; background: rgba(255,255,255,.7); border-radius: 2px; }

/* Bottle graphic (scan medication) */
.fm-bottle {
  width: clamp(38px, 12%, 90px); aspect-ratio: .55; align-self: center;
  background: linear-gradient(180deg, #3a2a1a, #6b4a2a);
  border-radius: 8px 8px 14px 14px; position: relative; margin: .3em auto;
  box-shadow: 0 3px 8px rgba(0,0,0,.2);
}
.fm-bottle::before { content: ""; position: absolute; top: -16%; left: 30%; width: 40%; height: 16%; background: #cfd8dd; border-radius: 4px 4px 0 0; }
.fm-bottle .lbl { position: absolute; inset: 28% 10% 14%; background: #fff; border-radius: 4px; display: grid; place-items: center; gap: 8%; padding: 8%; }
.fm-bottle .lbl .qr { width: 60%; aspect-ratio: 1; background:
  repeating-linear-gradient(0deg,#16242f 0 3px,#fff 3px 6px),
  repeating-linear-gradient(90deg,#16242f 0 3px,transparent 3px 6px); background-blend-mode: multiply; }

/* Flavor grid */
.fm-flavors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4%; width: 100%; }
.fm-flav {
  aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(255,255,255,.6);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; cursor: pointer; gap: .1em;
  font-size: clamp(.34rem, 1.05vw, .56rem); text-transform: uppercase; letter-spacing: .02em;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.fm-flav .fe { font-size: 1.7em; line-height: 1; }
.fm-flav.sel { outline: 3px solid var(--fm-go); outline-offset: 2px; }

/* Progress / dispensing */
.fm-progress { width: 80%; height: clamp(10px, 3vw, 22px); background: rgba(255,255,255,.15); border: 2px solid #fff; border-radius: 99px; overflow: hidden; margin-top: 6%; }
.fm-progress .bar { height: 100%; width: 0; background: var(--fm-sky); border-radius: 99px; transition: width 1.1s linear; }
.fm-screen.active-step .fm-progress.run1 .bar { width: 50%; }
.fm-screen.active-step .fm-progress.run2 .bar { width: 100%; }

.fm-repeat {
  background: var(--fm-sky); color: #fff; font-weight: 800; border: none; border-radius: 10px;
  padding: .6em 1.2em; font-size: clamp(.6rem, 1.8vw, .95rem); cursor: pointer;
  align-self: center; margin-bottom: 8%; box-shadow: 0 3px 8px rgba(0,0,0,.18);
}
.fm-check { font-size: clamp(2rem, 9vw, 4rem); color: var(--fm-go); line-height: 1; }

/* Caption under device + controls */
.sim-caption {
  margin-top: 1.1rem; width: 100%; max-width: 620px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--blue-600);
  border-radius: 12px; padding: 1rem 1.2rem; box-shadow: var(--shadow);
}
.sim-caption.is-new { border-left-color: var(--teal-500); }
.sim-caption h4 { margin: 0 0 .35rem; font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: .5rem; }
.sim-caption p { margin: 0; color: var(--ink-700); font-size: .9rem; line-height: 1.55; }
.sim-caption .logs { margin: .7rem 0 0; padding: .7rem .9rem; background: var(--blue-50); border-radius: 9px; font-size: .82rem; }
.sim-caption .logs strong { color: var(--blue-800); }
.sim-caption .logs code { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: .05rem .4rem; font-size: .92em; color: var(--ink-900); }

.sim-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; width: 100%; max-width: 620px; }
.sim-dots { display: flex; gap: .4rem; }
.sim-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); cursor: pointer; }
.sim-dots span.on { background: var(--blue-600); transform: scale(1.25); }

/* =================== COMPARISON (before / after) =================== */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.compare .col { border-radius: var(--radius); padding: 1.3rem; border: 1px solid var(--line); }
.compare .col.before { background: #fff; }
.compare .col.after { background: linear-gradient(160deg, var(--blue-50), #e3f6f1); border-color: var(--blue-100); }
.compare h3 { margin: 0 0 .8rem; font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: .5rem; }
.compare ul { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.compare li { font-size: .9rem; color: var(--ink-700); display: flex; gap: .55rem; align-items: flex-start; line-height: 1.45; }
.compare li .mk { flex: none; font-weight: 800; }
.compare .before li .mk { color: var(--ink-300); }
.compare .after li .mk { color: var(--green-600); }

/* =================== FAQ =================== */
.faq-toc { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.faq-toc a {
  font-size: .84rem; font-weight: 700; color: var(--blue-800);
  background: var(--blue-50); border: 1px solid var(--blue-100);
  padding: .4rem .8rem; border-radius: 99px;
}
.faq-toc a:hover { background: var(--blue-100); text-decoration: none; }

.faq-group { margin-bottom: 2rem; scroll-margin-top: 90px; }
.faq-group > h2 {
  font-size: 1.15rem; font-weight: 800; color: var(--blue-900);
  display: flex; align-items: center; gap: .6rem; margin: 0 0 .9rem;
  padding-bottom: .5rem; border-bottom: 2px solid var(--line);
}
.faq-group > h2 .gi {
  width: 2rem; height: 2rem; border-radius: 9px; background: var(--blue-100);
  display: grid; place-items: center; font-size: 1.05rem;
}
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: .65rem; overflow: hidden; box-shadow: var(--shadow); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer; font: inherit;
  padding: 1rem 1.2rem; display: flex; align-items: center; gap: .8rem; font-weight: 700; color: var(--ink-900);
}
.faq-q:hover { background: var(--blue-50); }
.faq-q .chev { margin-left: auto; color: var(--ink-300); transition: transform .2s; font-size: 1.1rem; flex: none; }
.faq-item.open .faq-q .chev { transform: rotate(90deg); color: var(--blue-700); }
.faq-q .qtag { flex: none; font-size: 1.05rem; }
.faq-a { display: none; padding: 0 1.2rem 1.1rem 3rem; color: var(--ink-700); font-size: .92rem; line-height: 1.6; }
.faq-item.open .faq-a { display: block; }
.faq-a p { margin: 0 0 .6rem; }
.faq-a ul { margin: .4rem 0 .6rem; padding-left: 1.1rem; }
.faq-a li { margin-bottom: .3rem; }
.faq-a .ref { font-size: .82rem; color: var(--ink-500); border-top: 1px dashed var(--line); padding-top: .55rem; margin-top: .6rem; }

/* =================== LEGAL =================== */
.legal-layout { display: grid; grid-template-columns: 230px 1fr; gap: 2rem; align-items: start; }
.legal-toc { position: sticky; top: 90px; font-size: .86rem; }
.legal-toc .lt-title { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); margin-bottom: .6rem; }
.legal-toc a { display: block; padding: .35rem .6rem; border-radius: 7px; color: var(--ink-700); font-weight: 600; border-left: 2px solid var(--line); }
.legal-toc a:hover { background: var(--blue-50); color: var(--blue-800); text-decoration: none; border-left-color: var(--blue-600); }

.legal-doc { max-width: 760px; }
.legal-doc section { scroll-margin-top: 90px; margin-bottom: 2.2rem; }
.legal-doc h2 { font-size: 1.3rem; font-weight: 800; color: var(--blue-900); letter-spacing: -.015em; margin: 0 0 .3rem; }
.legal-doc h2 .cfr { display: block; font-size: .76rem; font-weight: 700; color: var(--teal-500); letter-spacing: .04em; margin-top: .15rem; }
.legal-doc h3 { font-size: 1rem; font-weight: 800; color: var(--ink-900); margin: 1.3rem 0 .4rem; }
.legal-doc p { color: var(--ink-700); font-size: .94rem; line-height: 1.7; margin: 0 0 .9rem; }
.legal-doc ul { color: var(--ink-700); font-size: .94rem; line-height: 1.65; padding-left: 1.2rem; margin: 0 0 .9rem; }
.legal-doc li { margin-bottom: .4rem; }

.callout {
  border-radius: 12px; padding: 1rem 1.2rem; margin: 0 0 1.1rem;
  font-size: .9rem; line-height: 1.6; border: 1px solid var(--line);
}
.callout .ct { font-weight: 800; display: block; margin-bottom: .25rem; }
.callout.info { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-900); }
.callout.good { background: var(--green-100); border-color: #bfe7d4; color: #0f5c3f; }
.callout.warn { background: var(--amber-100); border-color: #f1dcae; color: var(--amber-700); }

.id-table { width: 100%; border-collapse: collapse; font-size: .86rem; margin: .6rem 0 1rem; }
.id-table th { text-align: left; background: var(--blue-50); color: var(--ink-700); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; padding: .6rem .7rem; border-bottom: 1.5px solid var(--line); }
.id-table td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-700); }
.id-table tr:last-child td { border-bottom: none; }
.id-table .ok { color: var(--green-600); font-weight: 800; white-space: nowrap; }
.id-table .idname { font-weight: 700; color: var(--ink-900); }

.legal-disclaimer { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--ink-500); line-height: 1.6; }

/* =================== Responsive =================== */
@media (max-width: 980px) {
  .sim-layout { grid-template-columns: 1fr; }
  .sim-steps { flex-direction: row; overflow-x: auto; gap: .5rem; padding-bottom: .4rem; }
  .sim-step { min-width: 150px; flex-direction: column; }
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { position: static; display: none; }
}
@media (max-width: 760px) {
  .feat-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .hero { padding: 1.8rem 1.4rem; }
  .hero h1 { font-size: 1.65rem; }
  .id-table { font-size: .8rem; }
}
