/* Rekit Demo Store (server/public/demo-store.html and demo-store-account.html): a sample shop, Ember Coffee
   Co., that runs Rekit. One fixed light look, like a merchant's theme. Rekit's own bits (the demo bar and
   the "Show Rekit parts" labels) are indigo, the site's brand colour. */
:root {
  --s-bg: #ffffff; --s-ink: #1b1714; --s-muted: #6b625b; --s-line: #e7e2dc; --s-line-strong: #c9c0b7; --s-soft: #f5f1ec;
  --s-btn: #2b1a12; --s-btn-text: #f7efe8; --s-accent: #8a4b2a; --s-gold: #d9a441; --s-night: #161311;
  --s-good: #1f7a4d; --s-good-bg: #e6f4ec; --s-warn: #8a5a00; --s-warn-bg: #fff4d6; --s-bad: #b42318; --s-bad-bg: #fdecea;
  --k-brand: #4f46e5; --k-on: #ffffff; --k-soft: #eef0ff; --k-ink: #3730a3; --k-dark: #0d0d1f;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--s-bg); color: var(--s-ink); font: 16px/1.5 Assistant, 'Helvetica Neue', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.2; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--s-ink); outline-offset: 2px; }
.ds-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ds-wrap { max-width: 1180px; margin: 0 auto; padding-left: var(--gutter); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Rekit's demo bar */
.ds-demo { position: sticky; top: 0; z-index: 30; background: var(--k-dark); color: #e9e9f6; font: 500 .82rem/1.3 Inter, system-ui, sans-serif; }
.ds-demo .ds-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-block: 8px; }
.ds-demo-name { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.ds-demo-name img { width: 22px; height: 22px; border-radius: 6px; }
.ds-demo-name span { color: #a9a9c4; }
.ds-demo label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ds-demo select { max-width: 230px; padding: 5px 8px; border: 1px solid #3a3a5c; border-radius: 6px; background: #1b1b33; color: #fff; }
.ds-demo input[type="checkbox"] { appearance: none; width: 34px; height: 20px; margin: 0; border-radius: 99px; background: #3a3a5c; position: relative; cursor: pointer; }
.ds-demo input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.ds-demo input[type="checkbox"]:checked { background: var(--k-brand); }
.ds-demo input[type="checkbox"]:checked::after { transform: translateX(14px); }
.ds-demo a { color: #c7c4ff; font-weight: 600; text-decoration: none; }
.ds-demo a:hover { text-decoration: underline; }
.ds-demo :focus-visible { outline-color: #c7c4ff; }
@media (max-width: 640px) { .ds-demo { position: static; } .ds-demo-name span { display: none; } .ds-demo select { max-width: 160px; } }

/* store header and footer */
.ds-bar { background: var(--s-btn); color: var(--s-btn-text); text-align: center; font-size: .82rem; letter-spacing: .04em; padding: 8px 16px; }
.ds-head { border-bottom: 1px solid var(--s-line); }
.ds-head .ds-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; padding-block: 14px; }
.ds-brand { font-size: 1.35rem; font-weight: 700; letter-spacing: .02em; text-decoration: none; }
.ds-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-right: auto; }
.ds-nav a { padding: 4px 0; border-bottom: 2px solid transparent; color: var(--s-muted); font-size: .95rem; text-decoration: none; }
.ds-nav a:hover, .ds-nav a[aria-current="page"] { color: var(--s-ink); border-color: var(--s-ink); }
.ds-icons { display: flex; gap: 2px; }
.ds-icon { position: relative; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--s-ink); cursor: pointer; text-decoration: none; }
.ds-icon svg { width: 22px; height: 22px; }
.ds-icon span { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--s-btn); color: var(--s-btn-text); font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
@media (max-width: 720px) { .ds-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; } .ds-nav a { white-space: nowrap; } .ds-brand { margin-right: auto; } }
.ds-foot { margin-top: 56px; border-top: 1px solid var(--s-line); background: var(--s-soft); color: var(--s-muted); font-size: .85rem; }
.ds-foot .ds-wrap { display: grid; gap: 6px; padding-block: 28px; }
.ds-foot b { color: var(--s-ink); font-size: 1rem; }

/* shared pieces */
.ds-thumb { width: 64px; height: 64px; flex: none; overflow: hidden; border-radius: 6px; background: var(--s-soft); }
.ds-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ds-atc { width: 100%; padding: 15px; border: 0; border-radius: 3px; background: var(--s-btn); color: var(--s-btn-text); font-size: 1rem; font-weight: 700; letter-spacing: .03em; cursor: pointer; font-variant-numeric: tabular-nums; }
.ds-atc:disabled { opacity: .45; cursor: not-allowed; }
.ds-btn { padding: 9px 14px; border: 1px solid var(--s-line-strong); border-radius: 6px; background: var(--s-bg); color: var(--s-ink); font-size: .92rem; font-weight: 600; cursor: pointer; }
.ds-btn:disabled { opacity: .45; cursor: not-allowed; }
.ds-btn.primary { border-color: var(--s-btn); background: var(--s-btn); color: var(--s-btn-text); }
.ds-btn.critical { border-color: var(--s-bad); color: var(--s-bad); }
.ds-btn.critical.primary { background: var(--s-bad); color: #fff; }
.ds-add { padding: 7px 14px; border: 1px solid var(--s-accent); border-radius: 99px; background: none; color: var(--s-accent); font-size: .85rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ds-add:disabled { opacity: .55; cursor: default; }
.ds-link { justify-self: start; padding: 0; border: 0; background: none; color: var(--s-accent); font-size: .92rem; text-decoration: underline; cursor: pointer; }
.ds-desc { color: var(--s-muted); }
.ds-fine { font-size: .8rem; color: var(--s-muted); }
.ds-h { display: flex; align-items: center; gap: .75em; margin-bottom: 14px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ds-h::before, .ds-h::after { content: ""; flex: 1; height: 1px; background: var(--s-line); }
.ds-qty { display: flex; width: max-content; align-items: center; border: 1px solid var(--s-line); border-radius: 4px; }
.ds-qty button { width: 32px; height: 32px; border: 0; background: none; font-size: 1rem; cursor: pointer; }
.ds-qty button:disabled { opacity: .3; cursor: default; }
.ds-qty output { min-width: 24px; text-align: center; font-size: .9rem; }
.ds-x { width: 40px; height: 40px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.ds-badge-s { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; background: var(--s-soft); color: var(--s-muted); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.ds-badge-s.good { background: var(--s-good-bg); color: var(--s-good); }
.ds-badge-s.warn { background: var(--s-warn-bg); color: var(--s-warn); }
.ds-badge-s.bad { background: var(--s-bad-bg); color: var(--s-bad); }
.ds-badge-s svg { width: 12px; height: 12px; }

/* popups and toast */
.ds-scrim { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .45); }
.ds-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; }
.ds-panel { position: relative; width: min(100%, 760px); max-height: calc(100dvh - 36px); overflow: auto; border-radius: 12px; background: var(--s-bg); box-shadow: 0 24px 60px rgb(0 0 0 / .3); }
.ds-panel.narrow { width: min(100%, 520px); }
.ds-mclose { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgb(255 255 255 / .85); }
.ds-pad { display: grid; gap: 14px; padding: 24px; }
.ds-pad h3 { font-size: 1.35rem; padding-right: 36px; }
.ds-field { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; }
.ds-field input, .ds-field select, .ds-select { padding: 9px 11px; border: 1px solid var(--s-line-strong); border-radius: 6px; background: var(--s-bg); font-weight: 400; }
.ds-mfoot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.ds-toast { position: fixed; left: 50%; bottom: 22px; z-index: 60; max-width: calc(100% - 32px); transform: translateX(-50%); padding: 11px 18px; border-radius: 8px; background: #1b1714; color: #fff; font: 500 .9rem Inter, system-ui, sans-serif; box-shadow: 0 8px 24px rgb(0 0 0 / .25); }

/* "Show Rekit parts": a dashed outline and a label with the feature and the plan it needs */
.ds-rkchip { display: none; }
.ds-labels .ds-rkchip { display: inline-block; padding: 3px 8px; border-radius: 99px; background: var(--k-brand); color: var(--k-on); font: 700 11px/1.2 Inter, system-ui, sans-serif; white-space: nowrap; }
.ds-labels [data-rekit] { position: relative; outline: 2px dashed var(--k-brand); outline-offset: 5px; }
.ds-labels [data-rekit]::after { content: "Rekit · " attr(data-rekit); position: absolute; top: -1.2em; right: 4px; z-index: 2; padding: 3px 8px; border-radius: 99px; background: var(--k-brand); color: var(--k-on); font: 700 11px/1.2 Inter, system-ui, sans-serif; letter-spacing: .02em; white-space: nowrap; pointer-events: none; }
.ds-labels .ds-modal [data-rekit] { outline-offset: -3px; }
.ds-labels .ds-modal [data-rekit]::after { top: 6px; right: auto; left: 8px; }
.ds-flash { animation: ds-flash 2s ease-out; }
@keyframes ds-flash { 0%, 55% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--k-brand) 40%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .ds-flash { animation: none; } .ds-demo input[type="checkbox"]::after { transition: none; } }
