/* Melon Craft dashboard: warm, calm, readable on a phone, an iPad and a desk.
   analytics.css builds on the tokens below. Every class keeps its old name; bare elements are styled too. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --bg: #FAF9F5;            /* ivory page */
  --surface: #FFFFFF;       /* cards, tables, inputs */
  --surface-2: #F2F0E8;     /* chips, hovers, quiet fills */
  --sidebar: #F3F1EA;
  --text: #1F1E1D;
  --muted: #6B6A63;
  --border: #E8E6DC;
  --border-strong: #D6D3C7;
  --accent: #D97757;        /* terracotta: active nav, bars, focus rings */
  --accent-ink: #A84E2D;    /* the accent as text (links), AA on every light surface */
  --accent-strong: #B85A38; /* primary button fill, AA with white text */
  --accent-soft: #F6E5DB;
  --good: #276C44;  --good-soft: #E5F1E8;
  --warn: #9A5B0A;  --warn-soft: #F8EEDB;
  --bad: #B3392F;   --bad-soft: #F9E6E3;
  --shadow: 0 1px 2px rgba(31, 30, 29, .04), 0 2px 8px rgba(31, 30, 29, .04);
  --scrim: rgba(31, 30, 29, .38);
  --radius: 12px;
  --radius-sm: 8px;
  --control: 44px;          /* tap target; a desk with a mouse gets 36px below */
  --sidebar-w: 256px;
  --topbar-h: 56px;
  --serif: "Source Serif 4", "Iowan Old Style", Charter, Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* old names, kept for templates that still use them */
  --panel: var(--surface); --line: var(--border); --chip: var(--surface-2); --ok: var(--good);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #262624; --surface: #30302E; --surface-2: #3A3A37; --sidebar: #1F1E1D;
    --text: #F2F0E8; --muted: #A9A69C; --border: #42413D; --border-strong: #55534E;
    --accent: #D97757; --accent-ink: #E89270; --accent-strong: #B85A38; --accent-soft: #45322A;
    --good: #7FC195; --good-soft: #263A2D; --warn: #E2A857; --warn-soft: #3E3221; --bad: #F08A7E; --bad-soft: #452B28;
    --shadow: 0 1px 2px rgba(0, 0, 0, .2); --scrim: rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --bg: #262624; --surface: #30302E; --surface-2: #3A3A37; --sidebar: #1F1E1D;
  --text: #F2F0E8; --muted: #A9A69C; --border: #42413D; --border-strong: #55534E;
  --accent: #D97757; --accent-ink: #E89270; --accent-strong: #B85A38; --accent-soft: #45322A;
  --good: #7FC195; --good-soft: #263A2D; --warn: #E2A857; --warn-soft: #3E3221; --bad: #F08A7E; --bad-soft: #452B28;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2); --scrim: rgba(0, 0, 0, .5);
}
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  :root { --control: 36px; }
  .sidebar-nav a { min-height: 34px; }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent-ink); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { color: var(--text); }
h1 { font: 500 30px/1.2 var(--serif); letter-spacing: -.01em; margin: 0 0 18px; }
h1 .muted { font: 400 .55em/1.4 var(--sans); letter-spacing: 0; }
h2 { font: 500 21px/1.3 var(--serif); margin: 36px 0 12px; }
h2 .muted { font-family: var(--sans); font-size: .7em; }
h3 { font: 600 16px/1.35 var(--sans); margin: 24px 0 8px; }
p { margin: 0 0 12px; }
main > p, main > .muted { max-width: 80ch; }
ul, ol { padding-left: 1.3em; margin: 0 0 12px; }
li { margin: 3px 0; }
b, strong { font-weight: 600; }
small { font-size: .85em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
code, kbd, pre { font-family: var(--mono); font-size: .86em; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: .05em .4em; overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; }
pre code { background: none; border: 0; padding: 0; }
img, svg { max-width: 100%; }
.muted { color: var(--muted); }

/* ---------- Shell: a sidebar from 1200 px (desks, laptops, the 13" iPad in landscape); below it (phones, iPads)
   a top bar whose menu button opens the same sidebar as a drawer ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--sidebar); border-right: 1px solid var(--border);
  padding-left: env(safe-area-inset-left);
}
.sidebar-head { display: flex; align-items: center; padding: 20px 16px 10px 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 19px/1.2 var(--serif); color: var(--text); letter-spacing: -.01em; }
a.brand:hover { text-decoration: none; }
.brand-mark {
  width: 24px; height: 24px; flex: none; border-radius: 7px; display: block; object-fit: cover;
  /* the game's own store app icon (Assets/Sprites/UI/icon-full.png on the store branches), 128 px */
}
.sidebar-nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 12px 16px; }
.sidebar-nav a {
  display: flex; align-items: center; min-height: var(--control); padding: 0 12px; margin: 1px 0;
  border-radius: 10px; color: var(--text); font-size: 14.5px;
}
.sidebar-nav a:hover { background: var(--surface-2); text-decoration: none; }
.sidebar-nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-group { margin-top: 10px; }
.nav-title { margin: 0; padding: 6px 12px 4px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.sidebar-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom)) 22px;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 13px;
}
.sidebar-foot .who-email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot a { flex: none; display: inline-flex; align-items: center; min-height: var(--control); padding: 0 6px; font-weight: 500; }

.topbar, .nav-scrim { display: none; }
body.with-nav { padding-left: var(--sidebar-w); }

main {
  max-width: 1280px; margin: 0 auto;
  padding: 36px max(44px, env(safe-area-inset-right)) calc(64px + env(safe-area-inset-bottom)) 44px;
}

@media (max-width: 1199.98px) {
  body.with-nav { padding-left: 0; }
  .topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px;
    min-height: calc(var(--topbar-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav-toggle {
    width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px;
    background: transparent; color: var(--text);
  }
  .nav-toggle:hover { background: var(--surface-2); }
  .nav-toggle svg { width: 22px; height: 22px; }
  .topbar .brand { font-size: 18px; }
  .topbar .brand-mark { width: 22px; height: 22px; }
  .sidebar {
    width: min(300px, 86vw); padding-top: env(safe-area-inset-top);
    transform: translateX(-100%); visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
  }
  .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 35; background: var(--scrim);
    opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; box-shadow: 0 10px 40px rgba(0, 0, 0, .18); }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  main { padding: 24px max(24px, env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
}
@media (max-width: 767.98px) {
  main { padding: 18px max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  h1 { font-size: 25px; margin-bottom: 14px; }
  h2 { font-size: 19px; margin-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .nav-scrim, body.nav-open .sidebar { transition: none; }
}

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.num { font-variant-numeric: tabular-nums; }
.card .num { font: 500 28px/1.15 var(--serif); letter-spacing: -.01em; overflow-wrap: anywhere; }
.card .num a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.card .num .chip { font-family: var(--sans); font-size: 14px; vertical-align: middle; }
.card .label { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.4; }
@media (max-width: 767.98px) {
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .card { padding: 14px; }
  .card .num { font-size: 24px; }
}

/* ---------- Tables ---------- */
table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 0 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; box-shadow: var(--shadow);
}
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
td { overflow-wrap: break-word; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; line-height: 1.35; background: var(--surface); }
tr:last-child > td, tr:last-child > th { border-bottom: 0; }
tr:first-child > :first-child { border-top-left-radius: var(--radius); }
tr:first-child > :last-child { border-top-right-radius: var(--radius); }
tr:last-child > :first-child { border-bottom-left-radius: var(--radius); }
tr:last-child > :last-child { border-bottom-right-radius: var(--radius); }
td.num, th.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
td.prompt { min-width: 14rem; }
table + p, table + .muted, .table-wrap + p, details + p { margin-top: 14px; }
td > .prompt { min-width: 11rem; }
td > div + div { margin-top: 4px; }
td .muted, td.muted { font-size: 13px; }
@media (hover: hover) { tr:hover > td { background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); } }
tr.clickable { cursor: pointer; }
tr.clickable:hover > td { background: var(--surface-2); }

/* an explicit scroller for wide tables, with soft edge shadows while there is more to see */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 8px;
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left center / 32px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right center / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .14), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .14), transparent) right center / 12px 100% no-repeat scroll,
    var(--surface);
}
.table-wrap > table { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.table-wrap th { background: transparent; white-space: nowrap; }

/* a table too wide for the screen scrolls inside itself, never the page (every width). The rows sit in an inner
   table box so they still fill the width; a table with <thead> keeps its columns but may not fill it: use
   .table-wrap for those. */
main table:not(.table-wrap > table) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
main table:not(.table-wrap > table) > tbody:only-child { display: table; width: 100%; }
td .chip { white-space: normal; }
/* phones and iPads in portrait: headers on one line, tighter cells */
@media (max-width: 1023.98px) {
  main th, main td .chip { white-space: nowrap; }
  main th, main td { padding: 10px 10px; }
  main th:first-child, main td:first-child { padding-left: 14px; }
  main td.muted, main td > .prompt { min-width: 12rem; }
}
/* phones and iPads in portrait: tables marked .stack turn each row into a card; cells with data-label show their
   column name. A phone shows one field a line (.half: two), an iPad three. */
@media (max-width: 1023.98px) {
  main table.stack:not(.table-wrap > table) { display: block; overflow: visible; background: none; border: 0; border-radius: 0; box-shadow: none; }
  main table.stack:not(.table-wrap > table) > tbody:only-child { display: block; }
  .stack tr {
    display: flex; flex-wrap: wrap; align-items: flex-start; margin: 0 0 12px; padding: 8px 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .stack tr:has(> th) { display: none; }
  .stack tr:hover > td { background: none; }
  .stack td, .stack td:first-child { display: block; flex: 1 1 100%; min-width: 0; padding: 6px 16px; border: 0; border-radius: 0; }
  .stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
  .stack td.half { flex: 1 1 40%; }
  .stack td.num { text-align: left; }
  .stack td.rank { flex: 0 0 auto; padding-top: 12px; padding-right: 0; color: var(--muted); font: 500 18px/1 var(--serif); }
  .stack td.media { flex: 0 0 auto; padding-right: 0; }
  .stack td.media:not(:has(img)), .stack td.empty { display: none; }
  .stack td.media img.preview { width: 88px; height: 88px; }
  .stack td.media + td { flex: 1 1 150px; }
  .stack td.title { font-weight: 600; }
  .stack td.title .muted { font-weight: 400; }
  .stack td.prompt, .stack .prompt { max-width: none; min-width: 0; }
  .stack td .chip { white-space: normal; }
  .stack td[colspan] { text-align: center; padding: 14px 16px; }
}
@media (min-width: 768px) and (max-width: 1023.98px) {
  .stack tr { padding: 10px 6px; }
  .stack td, .stack td.half { flex: 1 1 28%; }
  .stack td.media + td { flex: 1 1 50%; }
}

/* ---------- Chips and badges ---------- */
.chip, .badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font: 500 12.5px/1.5 var(--sans); white-space: nowrap; vertical-align: baseline;
}
.chip.ok, .chip.good, .badge.ok, .badge.good { background: var(--good-soft); color: var(--good); }
.chip.warn, .badge.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad, .badge.bad { background: var(--bad-soft); color: var(--bad); }
.chip a { color: inherit; text-decoration: underline; }

/* ---------- Notices ---------- */
.notice { padding: 12px 16px; margin: 0 0 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); max-width: 80ch; }
.notice.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); box-shadow: inset 3px 0 0 var(--bad); }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); box-shadow: inset 3px 0 0 var(--warn); }
.notice.good, .notice.ok { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 30%, transparent); box-shadow: inset 3px 0 0 var(--good); }

/* ---------- Forms ---------- */
input, select, textarea, button { font: inherit; color: var(--text); }
input:where(:not([type="checkbox"], [type="radio"], [type="hidden"])), select, textarea {
  min-height: var(--control); padding: 6px 12px; font-size: 16px; line-height: 1.4;   /* 16px: iOS never zooms */
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px;
  max-width: 100%; transition: border-color .12s, box-shadow .12s;
}
select {
  -webkit-appearance: none; appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238A877E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 11px 8px;
}
textarea { min-height: 96px; width: 100%; max-width: 640px; resize: vertical; padding: 10px 12px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent-strong); margin: 0; flex: none; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  input:where(:not([type="checkbox"], [type="radio"], [type="hidden"])), select, textarea { font-size: 14px; padding: 4px 10px; }
  select { padding-right: 30px; background-position: right 10px center; }
  textarea { padding: 8px 10px; }
}
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--control); padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 14px; font-weight: 500; line-height: 1.2; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button:hover { background: var(--surface-2); }
button:disabled { opacity: .55; cursor: progress; }
button.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
button.primary:hover { background: color-mix(in srgb, var(--accent-strong) 88%, #000); }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--border-strong)); }
button.danger:hover { background: var(--bad-soft); }
form.inline { display: inline-flex; gap: 8px; align-items: center; margin: 3px 0; flex-wrap: wrap; max-width: 100%; }
td form.inline { display: flex; margin: 8px 0 0; }
td form.inline:first-child { margin-top: 0; }
input.narrow { width: 6.5rem; }

/* ---------- Filters, pager, details ---------- */
.filters { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; align-items: center; }
.filters > a {
  display: inline-flex; align-items: center; min-height: var(--control); padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
}
.filters > a:hover { background: var(--surface-2); text-decoration: none; }
.filters > a.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.filters a.on { font-weight: 600; }
.filters > form.inline { margin: 0; }
.filters > .chip { padding: 6px 12px; }
.pager { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pager a { display: inline-flex; align-items: center; min-height: var(--control); padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 500; }
.pager a:hover { background: var(--surface-2); text-decoration: none; }
details { margin: 12px 0; padding: 2px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
details > summary { cursor: pointer; padding: 10px 0; min-height: var(--control); font-weight: 500; }
details[open] > summary { margin-bottom: 4px; }
details > table, details > .table-wrap { margin-bottom: 14px; box-shadow: none; }

/* ---------- Page pieces (shared names, unchanged) ---------- */
.prompt { max-width: 420px; white-space: pre-wrap; word-break: break-word; }
img.preview { width: 120px; height: 120px; object-fit: contain; image-rendering: pixelated; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--border); }
img.preview.reference { image-rendering: auto; }
img.icon { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; vertical-align: middle; }
.count { font: 500 22px/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.report-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; }
.report-head > div { display: grid; gap: 8px; min-width: 0; flex: 1 1 280px; }
.report-head h1 { margin: 0; }
.report-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.report-head .actions form.inline { margin: 0; }
.sdk-lines { list-style: none; padding: 0; display: grid; gap: 8px; }
.sdk-lines li { margin: 0; }

/* sign-in */
.login { max-width: 420px; margin: max(48px, 14vh) auto 0; text-align: center; }
.login .card { padding: 36px 32px; }
.login .brand-mark { width: 40px; height: 40px; border-radius: 11px; margin: 0 auto 18px; }
.login h1 { font-size: 28px; margin-bottom: 10px; }
.login a:has(> button) { display: inline-block; margin-top: 8px; }
.login a:has(> button):hover { text-decoration: none; }
.login button.primary { min-height: 48px; padding: 0 24px; font-size: 15px; }
@media (max-width: 767.98px) { .login { margin-top: 32px; } .login .card { padding: 28px 20px; } }

/* settings */
.settings { max-width: 760px; padding: 6px 24px 22px; }
.settings > label { display: block; margin: 22px 0 6px; font-weight: 600; }
.settings > label:has(> input[type="checkbox"]) { display: flex; gap: 10px; align-items: center; min-height: var(--control); margin: 8px 0 0; font-weight: 500; }
.settings > input:not([type="checkbox"]), .settings > select { width: 100%; max-width: 420px; }
.settings > input[type="number"] { max-width: 180px; }
.settings > .muted { font-size: 13.5px; margin-top: 8px; }
.settings .row { display: flex; gap: 10px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.settings .row-key { flex: 0 0 200px; overflow-wrap: anywhere; font-size: 14px; }
.settings .row-key.short { flex-basis: 80px; }
.settings .row .wide { width: 200px; }
.settings .row input[type="number"] { width: 110px; }
.settings .row input, .settings .row select { min-width: 0; }
.settings > p:last-child { margin: 24px 0 0; }
@media (max-width: 767.98px) {
  .settings { padding: 4px 16px 18px; }
  .settings .row-key { flex: 1 1 120px; font-size: 14px; }
  .settings .row-key.short { flex: 0 0 64px; }
  .settings .row .wide, .settings .row select { flex: 1 1 160px; width: auto; }
  .settings > input:not([type="checkbox"]), .settings > select { max-width: none; }
  .settings > input[type="number"] { max-width: 180px; }
}

/* the shop's save bar */
.savebar {
  position: sticky; bottom: 0; z-index: 2; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); border-top: 1px solid var(--border);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
@media (max-width: 767.98px) { .savebar { gap: 6px 12px; padding: 10px 4px calc(10px + env(safe-area-inset-bottom)); } .savebar .muted { font-size: 13px; } }
