/* Aisle Reviews: one stylesheet for the app and the public pages.
   Layout: a left sidebar shell for the app; wide editorial sections for the
   home page; a single reading column for the other public pages.
   Color: Ultraviolet for actions and the brand, gold only for stars, green
   only for "verified" and live states. Light theme only, by brand rule.
   Type: Archivo for our words, Source Serif 4 italic for shoppers' words,
   IBM Plex Mono for codes and IDs. */

:root {
  --bg: #F7F6FB;
  --surface: #FFFFFF;
  --surface-2: #FAF9FD;
  --tint: #EFEEF7;
  --ink: #16132B;
  --muted: #5E5B6E;
  --faint: #8B889B;
  --line: #E2E0EC;
  --line-2: #EEEDF5;
  --accent: #4B2FD6;
  --accent-hover: #3A25A7;
  --accent-ink: #FFFFFF;
  --accent-soft: #EDEAFB;
  --star: #F2A81D;
  --star-off: #E2E0EC;
  --good: #1E7558;
  --good-soft: #E3F2EC;
  --warn: #8A5300;
  --warn-soft: #FFF3D6;
  --bad: #B42318;
  --bad-soft: #FDECEA;
  --chip: #F0EFF6;
  --shadow: 0 1px 2px rgba(22, 19, 43, 0.05), 0 12px 32px rgba(22, 19, 43, 0.08);
  --shadow-lg: 0 2px 4px rgba(22, 19, 43, 0.04), 0 24px 60px rgba(22, 19, 43, 0.12);
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --quote: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; line-height: 1.15; text-wrap: balance; font-stretch: 106%; }
h1 { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; font-weight: 750; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: 0.85em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.85rem; }
.eyebrow { font-family: var(--display); font-size: 0.72rem; font-weight: 700; font-stretch: 75%; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.quote { font-family: var(--quote); font-style: italic; }
[hidden] { display: none !important; }

/* A label that hangs like an overhead aisle sign. */
.hang { position: relative; display: inline-block; justify-self: start; align-self: flex-start; margin-top: 12px; padding: 5px 10px 4px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); font: 700 0.72rem/1.3 var(--display); font-stretch: 75%; letter-spacing: 0.1em; text-transform: uppercase; }
.hang::before, .hang::after { content: ""; position: absolute; top: -12px; width: 2px; height: 12px; background: var(--ink); }
.hang::before { left: 9px; }
.hang::after { right: 9px; }

/* ---- Buttons and fields --------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 650 0.9rem/1 var(--body); padding: 10px 15px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { border-color: var(--faint); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(75, 47, 214, 0.25); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.danger { color: var(--bad); border-color: var(--bad-soft); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.small { padding: 7px 11px; font-size: 0.8rem; }
.btn.large { padding: 14px 22px; font-size: 1rem; border-radius: 10px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-weight: 700; font-size: 0.85rem; }
.field .hint { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=tel], input:not([type]), select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.check-row { display: flex; gap: 8px; align-items: flex-start; }
.check-row input { margin-top: 4px; }
.form { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > select, .row > input:not([type=checkbox]):not([type=radio]) { width: auto; min-width: 170px; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 16px; align-content: start; }
.stack.tight { gap: 8px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ---- Surfaces ------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.card.flush { padding: 0; }
.card > .btn, .stack > .btn, .form > .btn { justify-self: start; }
.card > .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.stat { display: grid; gap: 2px; }
.stat .value { font-family: var(--display); font-size: 1.9rem; font-weight: 800; font-stretch: 108%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: 0.85rem; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; background: var(--surface-2); }
.notice { border-radius: var(--radius); padding: 12px 14px; background: var(--accent-soft); display: grid; gap: 4px; }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--bad-soft); }
.notice.good { background: var(--good-soft); }

/* ---- Tables --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; vertical-align: top; padding: 11px 12px; border-bottom: 1px solid var(--line-2); }
tr:last-child td { border-bottom: 0; }
th { font-family: var(--display); font-stretch: 75%; font-size: 0.7rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: var(--surface-2); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; }

/* ---- Chips: state is always shown as a word, colored by meaning ----------- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 0.7rem; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--ink); white-space: nowrap; }
.chip.good, .chip.approved, .chip.live, .chip.delivered, .chip.connected, .chip.completed { background: var(--good-soft); color: var(--good); }
.chip.warn, .chip.needs_review, .chip.held, .chip.pending, .chip.paused, .chip.scheduled, .chip.past_due { background: var(--warn-soft); color: var(--warn); }
.chip.bad, .chip.rejected, .chip.error, .chip.failed, .chip.declined { background: var(--bad-soft); color: var(--bad); }
.chip.queued, .chip.sent, .chip.opened, .chip.info { background: var(--accent-soft); color: var(--accent); }
.chip.removed, .chip.withdrawn, .chip.skipped { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: var(--star-off); }

/* ---- Logo ----------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.brand img { display: block; height: 26px; width: auto; }
.brand-mark { display: block; width: 22px; height: 22px; flex: none; }

/* ---- App shell ------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--surface); border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { padding: 0 8px; }
.side .brand img { height: 24px; }
.org-name { margin: 0 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 0.82rem; color: var(--muted); }
.org-name b { display: block; color: var(--ink); font-weight: 700; }
.nav { display: grid; gap: 2px; }
.nav .group { font-family: var(--display); font-stretch: 75%; font-weight: 700; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); padding: 12px 10px 4px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 0.92rem; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav .badge { font-family: var(--mono); font-size: 0.7rem; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 1px 7px; }
.side .foot { margin-top: auto; display: grid; gap: 4px; padding: 12px 8px 0; border-top: 1px solid var(--line-2); font-size: 0.85rem; }
.main { padding: 32px max(24px, env(safe-area-inset-right, 0px)) 80px max(24px, env(safe-area-inset-left, 0px)); min-width: 0; }
.main > .inner { max-width: 1120px; margin: 0 auto; display: grid; gap: 22px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding-bottom: 4px; }
.page-head .lede { color: var(--muted); max-width: 70ch; margin-top: 6px; }
.topbar { display: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 0.9rem; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 30; transform: translateX(-100%); transition: transform 0.2s; height: 100%; padding-top: max(20px, env(safe-area-inset-top, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
  .topbar .brand img { height: 22px; }
  .main { padding-top: 22px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .side, .btn, input, select, textarea { transition: none; } }
@media (max-width: 600px) {
  .grid:has(> .card.stat) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid > .card.stat { padding: 14px; }
  .stat .value { font-size: 1.5rem; }
}

/* ---- Review card ---------------------------------------------------------- */
.review { display: grid; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); min-width: 0; }
.review:last-child { border-bottom: 0; }
.review .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 0.82rem; }
.review .body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--quote); font-style: italic; font-size: 1.02rem; line-height: 1.5; }
.review a.cover { color: inherit; text-decoration: none; display: grid; gap: 6px; }
.review a.cover:hover .body { color: var(--accent); }
.dist { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Checks list ---------------------------------------------------------- */
.checks { display: grid; gap: 0; }
.checks .item { display: grid; grid-template-columns: 22px minmax(110px, 160px) minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); align-items: start; }
.checks .item:last-child { border-bottom: 0; }
.checks .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: var(--good); }
.checks .flag .dot { background: var(--warn); }
.checks .fail .dot { background: var(--bad); }
.timeline { display: grid; gap: 8px; font-size: 0.85rem; }
.timeline .t { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; }
@media (max-width: 600px) { .checks .item { grid-template-columns: 22px minmax(0, 1fr); } .checks .item .detail { grid-column: 2; } .timeline .t { grid-template-columns: minmax(0, 1fr); } }

/* ---- Problems and checklist ----------------------------------------------- */
.list { display: grid; }
.list .li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); align-items: center; }
.list .li:last-child { border-bottom: 0; }
.checklist .li .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: 12px; }
.checklist .li.done .tick { background: var(--good); border-color: var(--good); color: var(--surface); }
.checklist .li.done .text { color: var(--muted); text-decoration: line-through; }
.bar { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.spread { display: grid; gap: 6px; }
.spread .r { display: grid; grid-template-columns: 50px minmax(0, 1fr) 40px; gap: 10px; align-items: center; font-size: 0.85rem; }

/* ---- Toast and modal ------------------------------------------------------ */
.toast { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--surface); padding: 11px 16px; border-radius: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.toast.bad { background: var(--bad); color: #FFFFFF; }
.modal-back { position: fixed; inset: 0; background: rgba(22, 19, 43, 0.42); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px; display: grid; gap: 14px; box-shadow: var(--shadow-lg); }
.copybox { font-family: var(--mono); font-size: 0.8rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; white-space: pre; }

/* ---- Sign in -------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px max(40px, env(safe-area-inset-left, 0px)) 40px 48px; background: var(--tint); border-right: 1px solid var(--line); overflow: hidden; }
.auth-side h2 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 800; font-stretch: 112%; letter-spacing: -0.03em; line-height: 1; max-width: 12ch; }
.auth-side h2 em { font-style: normal; color: var(--accent); }
.auth-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.auth-side li { display: flex; gap: 10px; align-items: baseline; color: var(--muted); }
.auth-side li::before { content: "★"; color: var(--star); }
.auth-sign { position: absolute; right: 40px; top: 0; width: 120px; }
.auth-main { display: grid; place-items: center; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); }
.auth .box { width: min(420px, 100%); display: grid; gap: 18px; }
.auth .box > .brand { display: none; }
.auth .card { padding: 24px; box-shadow: var(--shadow); }
.demo-logins { display: grid; gap: 6px; }
.demo-logins .btn { justify-content: space-between; }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .auth .box > .brand { display: inline-flex; justify-self: center; margin-bottom: 4px; }
}

/* ---- Public pages --------------------------------------------------------- */
.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.site-head { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, 0.9); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.site-head .in { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 66px; flex-wrap: wrap; padding-block: 10px; }
.site-head nav { display: flex; gap: 6px 20px; align-items: center; flex-wrap: wrap; font-size: 0.92rem; }
.site-head nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 550; }
.site-head nav a:not(.btn):hover { color: var(--accent); }
@media (max-width: 760px) { .site-head nav .hide-sm { display: none; } .site-head .brand img { height: 22px; } }
@media (max-width: 420px) { .site-head nav .hide-xs { display: none; } }
.page { max-width: 1100px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 80px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 56px; }
.doc { max-width: 760px; margin: 0 auto; padding: 48px max(20px, env(safe-area-inset-right, 0px)) 96px max(20px, env(safe-area-inset-left, 0px)); }
.prose { max-width: 70ch; display: grid; gap: 14px; }
.prose h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); font-stretch: 110%; letter-spacing: -0.025em; }
.prose h2 { margin-top: 22px; font-size: 1.35rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.prose li::marker { color: var(--accent); }
.narrow { max-width: 640px; margin: 0 auto; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 80px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 20px; }
.star-pick { display: flex; gap: 4px; }
.star-pick button { font-size: 2.2rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--star-off); padding: 2px; transition: transform 0.1s, color 0.1s; }
.star-pick button:hover { transform: scale(1.08); }
.star-pick button.on { color: var(--star); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img, .thumbs video { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
footer.site-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0 calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 0.88rem; }
footer.site-foot .in { display: flex; gap: 16px 28px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
footer.site-foot nav { display: flex; gap: 8px 20px; flex-wrap: wrap; }
footer.site-foot a { color: var(--muted); text-decoration: none; }
footer.site-foot a:hover { color: var(--accent); }
footer.site-foot .brand img { height: 22px; }

/* Plan cards, shared by the home page and the app's billing page */
.plan { position: relative; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan .flag { position: absolute; top: -11px; left: 18px; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 0.68rem/1.3 var(--display); font-stretch: 80%; letter-spacing: 0.08em; text-transform: uppercase; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 0.9rem; }
.plan li { display: flex; gap: 8px; align-items: baseline; }
.plan li::before { content: "✓"; color: var(--good); font-weight: 700; }

/* Shopper pages lead with the seller; we sign the footer. */
.mini-foot { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 0 16px calc(32px + env(safe-area-inset-bottom, 0px)); font-size: 0.8rem; color: var(--faint); }
.mini-foot img { display: block; height: 16px; width: auto; }

/* 404 */
.lost { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 40px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
.lost-sign { width: 132px; height: auto; transform-origin: 50% 0; animation: lost-swing 2.6s cubic-bezier(.32, .62, .38, 1) both; }
@keyframes lost-swing { 0% { transform: rotate(9deg); } 30% { transform: rotate(-5deg); } 55% { transform: rotate(2.4deg); } 80% { transform: rotate(-1deg); } 100% { transform: rotate(0); } }
.lost h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); font-stretch: 112%; letter-spacing: -0.03em; margin-top: 12px; }
.lost .row { justify-content: center; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .lost-sign { animation: none; } }
