/* GoodsChat owner portal: same ocean-blue palette as the app, the website and the admin panel (docs/DESIGN_SYSTEM.md).
   Semantic tokens only; light and dark are designed as a pair. Mobile first, one column below 900px. */
:root {
  --brand-1: #0369a1; --brand-2: #075985; --brand-3: #0c4a6e;
  --grad: linear-gradient(160deg, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
  --bg: #f1f4f8; --surface: #ffffff; --surface-2: #f8fafc; --text: #12161c; --muted: #5a6577; --line: #e1e6ed;
  --accent: #0369a1; --accent-soft: #e0f2fe; --on-accent-soft: #082f49;
  --primary-bg: linear-gradient(135deg, #0369a1, #075985); --on-primary: #ffffff;
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7; --bad: #b91c1c; --bad-soft: #fee2e2;
  --shadow: 0 1px 2px rgb(15 23 42 / .06), 0 4px 14px rgb(15 23 42 / .05);
  --radius: 14px; --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1217; --surface: #171b22; --surface-2: #1b2029; --text: #eef1f5; --muted: #9aa5b4; --line: #262c36;
    --accent: #7dd3fc; --accent-soft: #0b2f47; --on-accent-soft: #bae6fd;
    --primary-bg: #7dd3fc; --on-primary: #082f49;
    --ok: #4ade80; --ok-soft: #0f2e1b; --warn: #fbbf24; --warn-soft: #33270a; --bad: #f87171; --bad-soft: #3a1414;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); }
h1, h2, h3, p, ul, ol, dl { margin: 0; }
h1 { font-size: 24px; line-height: 1.2; letter-spacing: -.01em; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 75%, #fff); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { top: 8px; }
a { color: var(--accent); }

/* ---- top bar */
.top { background: var(--grad); color: #fff; }
.top .inner { max-width: 1040px; margin: 0 auto; padding: 0 16px; min-height: 60px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; color: #fff; text-decoration: none; }
.brand .mark { width: 32px; height: 32px; border-radius: 10px; background: rgb(255 255 255 / .16); display: grid; place-items: center; }
.brand small { display: block; font-weight: 500; opacity: .8; font-size: 12px; line-height: 1; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.who span { font-size: 13px; opacity: .92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36vw; }
.top .btn { background: rgb(255 255 255 / .14); border-color: rgb(255 255 255 / .28); color: #fff; min-height: 40px; }
.top .btn:hover { background: rgb(255 255 255 / .24); border-color: rgb(255 255 255 / .5); }

main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
main:focus, main:focus-visible { outline: none; } /* focused by script on navigation (for screen readers), not an interactive control */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.pagehead p { margin-top: 4px; }
.stack > * + * { margin-top: 16px; }

/* ---- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card > h2 { margin-bottom: 10px; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid.two { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; } .editor .sticky { position: sticky; top: 16px; } }

/* ---- buttons, chips */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); font: 600 14px/1 var(--font); cursor: pointer;
  text-decoration: none; touch-action: manipulation; transition: border-color .15s var(--ease), background .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary-bg); color: var(--on-primary); border-color: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn.armed { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.btn.danger.armed { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--accent-soft); color: var(--on-accent-soft); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }

/* ---- login */
.login { display: grid; gap: 20px; max-width: 760px; margin: 0 auto; }
@media (min-width: 700px) { .login { grid-template-columns: 1fr 280px; align-items: center; } }
.qrbox { display: grid; justify-items: center; gap: 10px; text-align: center; }
.qr { width: 232px; height: 232px; border-radius: 14px; background: #fff; padding: 4px; border: 1px solid var(--line); image-rendering: pixelated; }
.qr.dim { opacity: .25; }
.steps { padding-left: 20px; margin: 12px 0; }
.steps li { margin-top: 8px; }
.hero h1 { margin-bottom: 8px; }

/* ---- widget cards */
.wcard { display: grid; gap: 12px; }
.wcard header { display: flex; align-items: center; gap: 12px; }
.dot { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.wcard h2 { overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 36px 16px; display: grid; gap: 12px; justify-items: center; }

/* ---- forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .field > .lbl { font-weight: 600; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }
.err { color: var(--bad); font-size: 13px; }
input[type=text], textarea, select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--text); font: 15px/1.4 var(--font);
}
textarea { min-height: 88px; resize: vertical; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0; box-shadow: 0 0 0 1px var(--line); }
.sw[aria-pressed="true"] { border-color: var(--surface); box-shadow: 0 0 0 3px var(--text); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { min-height: 44px; padding: 0 18px; border: 0; background: var(--surface); color: var(--text); font: 600 14px var(--font); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--on-accent-soft); }

/* ---- preview mock (approximate: the real widget is drawn by the loader on the site) */
.pv { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); height: 380px; position: relative; overflow: hidden; }
.pv .bar { height: 26px; background: var(--line); display: flex; align-items: center; gap: 5px; padding: 0 10px; }
.pv .bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .5; }
.pv .ln { height: 9px; border-radius: 5px; background: var(--line); margin: 14px 18px 0; }
.pv .ln.s { width: 55%; }
.pv .panel { position: absolute; bottom: 74px; width: 250px; max-width: calc(100% - 28px); background: #fff; color: #12161c; border-radius: 14px; box-shadow: 0 8px 28px rgb(0 0 0 / .22); overflow: hidden; }
.pv .panel .hd { color: #fff; padding: 12px 14px; font-weight: 650; font-size: 14px; }
.pv .panel .bd { padding: 12px 14px; min-height: 88px; font-size: 13.5px; }
.pv .panel .msg { background: #eef2f6; border-radius: 12px 12px 12px 4px; padding: 8px 11px; display: inline-block; max-width: 92%; overflow-wrap: anywhere; }
.pv .panel .ft { border-top: 1px solid #e5e9ee; padding: 9px 14px; color: #8a94a3; font-size: 13px; }
.pv .fab { position: absolute; bottom: 14px; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 4px 14px rgb(0 0 0 / .28); }
.pv .left { left: 14px; }
.pv .right { right: 14px; }

/* ---- install */
.code { display: flex; gap: 8px; align-items: stretch; }
.code pre { flex: 1; margin: 0; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
details.tip { border-top: 1px solid var(--line); }
details.tip summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
details.tip p { padding-bottom: 12px; }

/* ---- modal + toast */
.scrim { position: fixed; inset: 0; background: rgb(8 12 20 / .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 16px; max-width: 460px; width: 100%; padding: 20px; box-shadow: 0 20px 60px rgb(0 0 0 / .4); max-height: 92vh; overflow: auto; }
.modal h2 { margin-bottom: 10px; }
.modal ul { padding-left: 20px; margin: 10px 0; }
.modal li { margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 8px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 14px; z-index: 60; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.skel { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--line), var(--surface-2), var(--line)); background-size: 200% 100%; animation: sh 1.4s infinite linear; }
@keyframes sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } .btn { transition: none; } }
