/* QR Platform admin design system.
   Tokens → base → layout → components → screens → responsive. 14px base, 8px grid.
   Light + dark come from light-dark(); html[data-theme="light|dark"] overrides prefers-color-scheme.
   Fonts are self-hosted (Inter latin 400/600, Noto Sans Thai 400/600/700). No external requests. */

/* ───────────── fonts ───────────── */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Noto Sans Thai"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/noto-sans-thai-thai-400-normal.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Thai"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/noto-sans-thai-thai-600-normal.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Thai"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/noto-sans-thai-thai-700-normal.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }

/* ───────────── tokens ───────────── */
:root {
  color-scheme: light dark;

  --font-sans: "Inter", "Noto Sans Thai", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Leelawadee UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* neutral scale (green-tinted greys taken from the Automate Studio site) */
  --bg:            light-dark(#f5f7f5, #0a1311);
  --bg-sidebar:    light-dark(#fbfcfb, #0d1816);
  --surface:       light-dark(#ffffff, #101c19);
  --surface-2:     light-dark(#f8faf8, #14231f);
  --surface-3:     light-dark(#eff3f0, #1a2c27);
  --surface-inset: light-dark(#f2f5f3, #0c1715);
  --border:        light-dark(#e1e7e3, #22342e);
  --border-strong: light-dark(#c8d1cb, #35493f);
  --input-border:  light-dark(#7f8f88, #67796f);   /* >= 3:1 on surfaces (WCAG 1.4.11) */
  --text:          light-dark(#172522, #e8efeb);
  --text-2:        light-dark(#44534d, #b5c3bc);
  --text-3:        light-dark(#5d6b65, #8ea199);

  /* the one brand accent (Automate Studio green; lime on dark, like the site header) */
  --accent:        light-dark(#2f6f5a, #d7f36a);
  --accent-hover:  light-dark(#265c4b, #e5fb8e);
  --accent-press:  light-dark(#1f4c3e, #c4e054);
  --on-accent:     light-dark(#ffffff, #10211c);
  --accent-text:   light-dark(#28634f, #a9ddc4);
  --accent-soft:   light-dark(#e6f1ec, #162b24);
  --accent-soft-2: light-dark(#d6e8df, #1d382f);
  --accent-border: light-dark(#bfd9cc, #2c4a3e);
  --ring:          light-dark(#2f6f5a, #d7f36a);

  /* calm status colours (fg on soft bg, all >= 4.5:1) */
  --success-fg: light-dark(#17653f, #84dba6);  --success-bg: light-dark(#e5f5eb, #11301f);  --success-bd: light-dark(#b8e0c8, #1f4d33);  --success-solid: light-dark(#1f8a56, #3fbf7a);
  --warning-fg: light-dark(#7a4d00, #f3c873);  --warning-bg: light-dark(#fdf3d9, #33260b);  --warning-bd: light-dark(#efd697, #5b4414);  --warning-solid: light-dark(#d19215, #e0a93c);
  --danger-fg:  light-dark(#a3241a, #ffa198);  --danger-bg:  light-dark(#fdebe9, #3a1613);  --danger-bd:  light-dark(#f4c0ba, #67241e);  --danger-solid:  light-dark(#c8372b, #ef6f63);
  --info-fg:    light-dark(#19578f, #94c9f6);  --info-bg:    light-dark(#e7f0fa, #11263a);  --info-bd:    light-dark(#bcd5ef, #1e4363);  --info-solid:    light-dark(#2f7bc4, #5aa6e8);
  --neutral-fg: light-dark(#44534d, #b5c3bc);  --neutral-bg: light-dark(#edf1ee, #1a2824);  --neutral-bd: light-dark(#d5ddd8, #2c3f38);  --neutral-solid: light-dark(#8a9892, #6f827a);

  /* outcome palette (charts: always paired with text labels) */
  --c-valid: var(--success-solid); --c-expiring: var(--warning-solid); --c-expired: light-dark(#e0713f, #f08a5a);
  --c-recalled: var(--danger-solid); --c-notFound: var(--neutral-solid); --c-noLot: light-dark(#7c8cb8, #96a5cf);
  --c-redirect: var(--info-solid); --c-file: light-dark(#14907f, #4fc7b5);

  --shadow-c: light-dark(rgba(16, 38, 30, .07), rgba(0, 0, 0, .5));
  --shadow-xs: 0 1px 2px var(--shadow-c);
  --shadow-sm: 0 1px 3px var(--shadow-c), 0 1px 2px var(--shadow-c);
  --shadow-md: 0 8px 24px -4px light-dark(rgba(16, 38, 30, .12), rgba(0, 0, 0, .55)), 0 2px 6px var(--shadow-c);
  --shadow-lg: 0 24px 56px -8px light-dark(rgba(16, 38, 30, .2), rgba(0, 0, 0, .65));

  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --sidebar-w: 248px; --topbar-h: 56px; --content-max: 1160px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ───────────── base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh;
}
:lang(th) { line-height: 1.65; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, kbd, .mono { font-family: var(--font-mono); font-size: .93em; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s5) 0; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { flex: none; }
.js-only, [data-needs-js] { display: none !important; }
html.js .js-only { display: flex !important; }
html.js [data-needs-js] { display: inline-flex !important; }
html.js span.js-only, html.js .js-inline { display: inline-flex !important; }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--r-sm); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }
.skip-link { position: fixed; left: 16px; top: -64px; z-index: 100; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: var(--r-md); box-shadow: var(--shadow-md); border: 1px solid var(--border-strong); }
.skip-link:focus { top: 12px; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ───────────── brand mark ───────────── */
.app-mark { flex: none; }
.app-mark-bg { fill: var(--accent); }
.app-mark-fg { color: var(--on-accent); fill: var(--on-accent); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: -.01em; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────────── app shell ───────────── */
.nav-toggle { position: fixed; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s3);
  padding: var(--s3); background: var(--bg-sidebar); border-right: 1px solid var(--border); z-index: 40;
}
.sidebar-head { display: flex; align-items: center; height: 40px; padding: 0 var(--s2); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label { padding: var(--s3) var(--s2) var(--s1); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.nav-label-gap { margin-top: var(--s3); }
.nav-spacer { flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 var(--s2); border-radius: var(--r-md);
  color: var(--text-2); transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item .icon { color: var(--text-3); }
.nav-item.is-active { background: var(--accent-soft); color: var(--text); }
.nav-item.is-active .icon { color: var(--accent-text); }
.sidebar-foot { margin-top: auto; }
.plan-card { padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); display: grid; gap: var(--s2); }
.plan-card-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.plan-card-name { font-weight: 600; font-size: 13px; }
.plan-card-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.plan-card-link:hover { color: var(--accent-text); }

.ws-switch { position: relative; }
.ws-switch-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-xs); cursor: pointer; list-style: none;
}
.ws-switch-btn:hover { border-color: var(--border-strong); }
.ws-switch-btn::-webkit-details-marker, summary::-webkit-details-marker { display: none; }
summary { list-style: none; }
.ws-tile { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 7px; background: var(--accent-soft-2); color: var(--accent-text); font-weight: 600; font-size: 13px; }
.ws-tile-sm { width: 22px; height: 22px; border-radius: 6px; font-size: 11.5px; }
.ws-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.ws-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-plan { font-size: 12px; color: var(--text-3); }
.ws-chev { color: var(--text-3); }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s6);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
}
.topbar-spacer { flex: 1; }
.menu-btn, .brand-compact { display: none; }
.menu-btn { width: 40px; height: 40px; border-radius: var(--r-md); align-items: center; justify-content: center; color: var(--text-2); cursor: pointer; margin-left: -8px; }
.menu-btn:hover { background: var(--surface-3); }
.nav-toggle:focus-visible ~ .app .menu-btn { outline: 2px solid var(--ring); outline-offset: 1px; }
.scrim { display: none; }
.crumbs ol { display: flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; min-width: 0; }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.crumbs a { color: var(--text-2); }
.crumbs li:last-child span { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb-sep { color: var(--text-3); }
.main { width: 100%; max-width: calc(var(--content-max) + 2 * var(--s6)); margin: 0 auto; padding: var(--s6) var(--s6) var(--s8); }
.main-wide { max-width: calc(1480px + 2 * var(--s6)); }
.page-body { display: grid; gap: var(--s5); margin-top: var(--s5); }

/* menus (details-based, work without JS) */
.menu { position: relative; }
.menu > summary { cursor: pointer; }
.menu-panel {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 200px; padding: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); display: grid; gap: 1px;
}
.menu-right .menu-panel { left: auto; right: 0; }
.menu-wide { min-width: 260px; }
.ws-switch .menu-panel { left: 0; right: 0; min-width: 0; }
.menu-label { padding: 6px 8px 4px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: var(--r-sm); background: none;
  color: var(--text); text-align: left; font-size: 13px; cursor: pointer;
}
.menu-item:hover { background: var(--surface-3); text-decoration: none; }
.menu-item .icon { color: var(--text-3); }
.menu-item-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item.is-current .icon:last-child { color: var(--accent-text); }
.menu-item-danger, .menu-item-danger .icon { color: var(--danger-fg); }
.menu-sep { height: 1px; margin: 4px 2px; background: var(--border); }
.menu-identity { display: flex; align-items: center; gap: 10px; padding: 8px; }
.menu-identity-text { min-width: 0; }
.menu-identity-name { font-weight: 600; font-size: 13px; }
.menu-identity-email { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.menu-row { align-items: center; justify-content: space-between; gap: var(--s3); padding: 6px 8px; }
.menu-row-label { font-size: 13px; color: var(--text-2); }
.avatar { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft-2); color: var(--accent-text); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.avatar-sm { width: 22px; height: 22px; font-size: 10px; }
.avatar-lg { width: 36px; height: 36px; font-size: 13px; }
.avatar-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
.avatar-btn:hover { background: var(--surface-3); }
.theme-switch { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-inset); }
.theme-opt { display: grid; place-items: center; width: 28px; height: 24px; border: 0; border-radius: 6px; background: none; color: var(--text-3); }
.theme-opt:hover { color: var(--text); }
.theme-opt[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* banners */
.banner { display: flex; align-items: flex-start; gap: var(--s3); padding: 10px var(--s6); border-bottom: 1px solid; font-size: 13px; }
.banner .icon { margin-top: 2px; }
.banner p { flex: 1; }
.banner-action { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-weight: 600; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.banner-warning { background: var(--warning-bg); color: var(--warning-fg); border-color: var(--warning-bd); }
.banner-danger { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-bd); }
.banner-neutral { background: var(--neutral-bg); color: var(--text); border-color: var(--neutral-bd); }
.banner-info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bd); }

/* blocked (suspended) */
.blocked { max-width: 520px; margin: var(--s7) auto; text-align: center; display: grid; justify-items: center; gap: var(--s3); }
.blocked-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--danger-bg); color: var(--danger-fg); border: 1px solid var(--danger-bd); }
.blocked-title { font-size: 22px; letter-spacing: -.015em; }
.blocked-body { color: var(--text-2); }
.blocked-ws { font-weight: 600; padding: 4px 10px; border-radius: var(--r-pill); background: var(--neutral-bg); border: 1px solid var(--neutral-bd); }
.blocked-actions { margin-top: var(--s3); }

/* bare layout (onboarding, errors, invite) */
.bare { min-height: 100vh; display: flex; flex-direction: column; }
.bare-top { display: flex; align-items: center; gap: var(--s3); height: var(--topbar-h); padding: 0 var(--s5); border-bottom: 1px solid var(--border); background: var(--bg-sidebar); }
.bare-user { display: flex; align-items: center; gap: var(--s2); }
.bare-user-email { font-size: 13px; color: var(--text-3); }
.bare-main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: var(--s7) var(--s4) var(--s6); }
.bare-main-wide { max-width: 760px; }
.bare-foot { display: flex; justify-content: center; align-items: center; gap: 8px; padding: var(--s5); color: var(--text-3); font-size: 12px; }
.vendor-logo { height: 22px; width: auto; opacity: .85; }
:root[data-theme="dark"] .vendor-logo { filter: brightness(0) invert(1); opacity: .7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .vendor-logo { filter: brightness(0) invert(1); opacity: .7; } }

/* ───────────── page header ───────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-header-main { min-width: 0; display: grid; gap: 6px; }
.page-title-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.page-title { font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
.page-subtitle { color: var(--text-2); max-width: 70ch; }
.page-actions { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); width: fit-content; }
.back-link:hover { color: var(--text); text-decoration: none; }

.page-head { display: grid; gap: var(--s3); }
.page-head-row { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.page-head-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-border); }
.page-head-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.page-meta { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.page-meta-sep { width: 1px; height: 14px; background: var(--border-strong); }
.type-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.section-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.section-desc { color: var(--text-2); margin-top: 2px; max-width: 70ch; }
.section-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-top: var(--s1); }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); white-space: nowrap; font-size: 13.5px; }
.tab .icon { color: var(--text-3); }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.tab.is-active .icon { color: var(--accent-text); }

/* ───────────── buttons ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid transparent;
  border-radius: var(--r-md); font-size: 13.5px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s;
}
.btn:hover { text-decoration: none; }
.btn-label { display: inline-block; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--border-strong) 70%, var(--text-3)); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--surface); color: var(--danger-fg); border-color: var(--danger-bd); box-shadow: var(--shadow-xs); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-danger-solid { background: light-dark(#b42318, #ef6f63); color: light-dark(#fff, #2a0c09); }
.btn-danger-solid:hover { background: light-dark(#9a1d14, #f58a80); }
.btn-link { height: auto; padding: 0; background: none; color: var(--accent-text); }
.btn-link:hover { text-decoration: underline; }
.btn.is-disabled, .btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; box-shadow: none; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--r-md); background: none; color: var(--text-3); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.icon-btn-sm { width: 26px; height: 26px; }

/* ───────────── badges ───────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border: 1px solid; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-neutral { color: var(--neutral-fg); background: var(--neutral-bg); border-color: var(--neutral-bd); }
.badge-success { color: var(--success-fg); background: var(--success-bg); border-color: var(--success-bd); }
.badge-warning { color: var(--warning-fg); background: var(--warning-bg); border-color: var(--warning-bd); }
.badge-danger { color: var(--danger-fg); background: var(--danger-bg); border-color: var(--danger-bd); }
.badge-info { color: var(--info-fg); background: var(--info-bg); border-color: var(--info-bd); }
.badge-accent { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-border); }
.code-chip { font-family: var(--font-mono); font-size: 12.5px; padding: 2px 8px; border-radius: var(--r-sm); background: var(--surface-inset); border: 1px solid var(--border); color: var(--text); }
.copy-inline { display: inline-flex; align-items: center; gap: 2px; }

/* ───────────── cards ───────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); padding: var(--s4) var(--s5) 0; flex-wrap: wrap; }
.card-head-main { min-width: 0; display: grid; gap: 2px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.card-title .icon { color: var(--text-3); }
.card-desc { color: var(--text-2); font-size: 13.5px; max-width: 70ch; }
.card-head-actions { display: flex; gap: var(--s2); align-items: center; }
.card-body { padding: var(--s4) var(--s5) var(--s5); }
.card-flush .card-body { padding: 0; }
.card-flush .card-head { padding-bottom: var(--s4); }
.card-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s5); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card-danger { border-color: var(--danger-bd); }
.card-danger .card-title { color: var(--danger-fg); }
.card-foot-note { color: var(--text-3); font-size: 13px; margin-right: auto; }

/* alerts + flash */
.alert { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid; border-radius: var(--r-md); font-size: 13.5px; }
.alert-icon { margin-top: 1px; }
.alert-body { display: grid; gap: 2px; min-width: 0; }
.alert-title { font-weight: 600; }
.alert-info { color: var(--info-fg); background: var(--info-bg); border-color: var(--info-bd); }
.alert-success { color: var(--success-fg); background: var(--success-bg); border-color: var(--success-bd); }
.alert-warning { color: var(--warning-fg); background: var(--warning-bg); border-color: var(--warning-bd); }
.alert-danger { color: var(--danger-fg); background: var(--danger-bg); border-color: var(--danger-bd); }
.alert-text { color: inherit; }
.alert-text a { color: inherit; text-decoration: underline; }
.flash { display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s3) 10px var(--s4); margin-bottom: var(--s5); border: 1px solid; border-radius: var(--r-md); box-shadow: var(--shadow-xs); transition: opacity .3s, transform .3s; }
.flash-text { flex: 1; }
.flash-success { color: var(--success-fg); background: var(--success-bg); border-color: var(--success-bd); }
.flash-danger { color: var(--danger-fg); background: var(--danger-bg); border-color: var(--danger-bd); }
.flash-info { color: var(--info-fg); background: var(--info-bg); border-color: var(--info-bd); }
.flash.is-leaving { opacity: 0; transform: translateY(-4px); }
.flash .icon-btn { color: inherit; opacity: .75; }

/* empty state */
.empty { display: grid; justify-items: center; text-align: center; gap: var(--s2); padding: var(--s7) var(--s5); }
.empty-compact { padding: var(--s6) var(--s4); }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: var(--s2); border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-border); }
.empty-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.empty-body { color: var(--text-2); max-width: 46ch; }
.empty-actions { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: center; margin-top: var(--s3); }

/* ───────────── tables ───────────── */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { padding: 10px var(--s4); text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: var(--s5); }
.table th:last-child, .table td:last-child { padding-right: var(--s5); }
.table td { padding: 12px var(--s4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num-col { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions-col { text-align: right; width: 1%; white-space: nowrap; }
.cell-primary { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.cell-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--r-md); background: var(--surface-3); color: var(--text-2); }
.cell-title { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
a.cell-title:hover { color: var(--accent-text); text-decoration: none; }
.cell-sub { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cell-text { min-width: 0; display: grid; gap: 1px; }
.cell-actions { display: inline-flex; align-items: center; gap: 2px; justify-content: flex-end; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.toolbar-group { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.search { position: relative; display: flex; align-items: center; min-width: 240px; }
.search .icon { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 32px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s5); border-top: 1px solid var(--border); }
.pager-info, .pager-pos { font-size: 13px; color: var(--text-3); }
.pager-ctrl { display: flex; align-items: center; gap: var(--s3); }

/* ───────────── forms ───────────── */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.label { font-weight: 600; font-size: 13px; color: var(--text); display: flex; align-items: baseline; gap: 6px; }
.req { color: var(--danger-fg); }
.opt { font-weight: 400; font-size: 12px; color: var(--text-3); }
.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.error-text { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--danger-fg); }
.error-text .icon { margin-top: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 36px; padding: 7px 10px; background: var(--surface); color: var(--text); border: 1px solid var(--input-border); border-radius: var(--r-md);
  box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s; line-height: 1.4;
}
:lang(th).input, .input:lang(th) { line-height: 1.55; }
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: 1; }
.input:hover:not(:disabled):not([readonly]), .select:hover:not(:disabled), .textarea:hover:not(:disabled) { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 24%, transparent); outline: none; }
.input[readonly], .input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-inset); color: var(--text-2); box-shadow: none; }
.input:disabled, .select:disabled { cursor: not-allowed; }
.has-error .input, .has-error .select, .has-error .textarea, [aria-invalid="true"] { border-color: var(--danger-solid); }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a9892' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input-sm, .select-sm { min-height: 30px; padding: 4px 8px; font-size: 13px; }
.select-sm { padding-right: 28px; }
input[type="date"].input { min-height: 36px; }
input[type="color"].input { padding: 3px; width: 44px; min-height: 36px; cursor: pointer; }
input[type="file"].input { padding: 5px 8px; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check-text { display: grid; gap: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s4); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-stack { display: grid; gap: var(--s4); }
.form-actions { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.form-actions-end { justify-content: flex-end; }
.form-section { display: grid; gap: var(--s4); }
.form-section + .form-section { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--border); }
.form-section-title { font-size: 13px; font-weight: 600; color: var(--text); }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--r-md) 0 0 var(--r-md); }
.input-group .btn { border-radius: 0 var(--r-md) var(--r-md) 0; margin-left: -1px; }
.prefix-input { display: flex; align-items: center; border: 1px solid var(--input-border); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
.prefix-input:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 24%, transparent); }
.prefix-input .prefix { padding: 0 0 0 10px; color: var(--text-3); font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }
.prefix-input .input { border: 0; box-shadow: none; padding-left: 2px; background: transparent; }
.copyfield { display: flex; gap: var(--s2); align-items: stretch; }
.copyfield .input { flex: 1; min-width: 0; }
.fieldset-reset { border: 0; padding: 0; margin: 0; min-width: 0; }
.lang-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.lang-tag { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 16px; padding: 0 4px; border-radius: 4px; background: var(--surface-3); color: var(--text-3); font-size: 10.5px; font-weight: 600; letter-spacing: .04em; }

/* radio cards (type picker) */
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.choice { position: relative; display: block; cursor: pointer; }
.choice-input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice-body { display: grid; gap: var(--s2); align-content: start; height: 100%; padding: var(--s4); border: 1px solid var(--input-border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s, background .12s; }
.choice:hover .choice-body { border-color: var(--text-3); }
.choice-input:checked + .choice-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent), var(--shadow-xs); }
.choice-input:focus-visible + .choice-body { outline: 2px solid var(--ring); outline-offset: 2px; }
.choice-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); }
.choice-input:checked + .choice-body .choice-icon { background: var(--accent); color: var(--on-accent); }
.choice-title { font-weight: 600; font-size: 14.5px; }
.choice-desc { font-size: 13px; color: var(--text-2); }
.choice-grid + .hint { margin-top: var(--s2); }
.choice-locked { cursor: not-allowed; }
.choice-locked .choice-input { cursor: not-allowed; }
.choice-locked .choice-body { background: var(--surface-2); box-shadow: none; }
.choice-locked .choice-title, .choice-locked .choice-desc, .choice-locked .choice-icon { opacity: .62; }
.choice-locked:hover .choice-body { border-color: var(--input-border); }
.choice-lock { margin-top: 2px; }
.choice-check { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--input-border); display: grid; place-items: center; color: transparent; background: var(--surface); }
.choice-input:checked + .choice-body .choice-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.type-form:has(input[name="type"][value="page"]:checked) .only-redirect,
.type-form:has(input[name="type"][value="page"]:checked) .only-file,
.type-form:has(input[name="type"][value="redirect"]:checked) .only-file,
.type-form:has(input[name="type"][value="redirect"]:checked) .only-page,
.type-form:has(input[name="type"][value="file"]:checked) .only-redirect,
.type-form:has(input[name="type"][value="file"]:checked) .only-page { display: none; }

/* ───────────── meters, charts ───────────── */
.meter { display: grid; gap: 8px; }
.meter-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.meter-label { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.meter-label .icon { color: var(--text-3); }
.meter-value { font-size: 13px; }
.meter-value b { font-size: 15px; font-weight: 600; }
.meter-of { color: var(--text-3); }
.meter-track { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width .3s; }
.meter.is-high .meter-fill { background: var(--warning-solid); }
.meter.is-full .meter-fill { background: var(--danger-solid); }
.meter-hint { font-size: 12.5px; color: var(--text-3); }
.usage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); }
.spark { overflow: visible; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.spark-area { fill: var(--accent); opacity: .12; }
.spark-dot { fill: var(--accent); }
.spark-empty .spark-line { stroke: var(--border-strong); stroke-dasharray: 2 3; }
.spark-empty .spark-area { opacity: 0; }
.spark-empty .spark-dot { fill: var(--border-strong); }
.spark-cell { display: flex; align-items: center; gap: var(--s3); justify-content: flex-end; }
.spark-total { min-width: 28px; text-align: right; font-weight: 600; }
.chart { display: grid; gap: 6px; }
.chart-plot { position: relative; }
.chart-plot svg { width: 100%; height: 132px; display: block; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-grid-dash { stroke-dasharray: 3 4; }
.chart-bar { fill: var(--accent); opacity: .55; }
.chart-bar.is-last { opacity: 1; }
.chart-bar.is-zero { fill: var(--border-strong); opacity: 1; }
.chart-max { position: absolute; top: -2px; right: 0; padding: 0 4px; font-size: 11.5px; color: var(--text-3); background: var(--surface); transform: translateY(-100%); }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.stat { display: grid; gap: 2px; }
.stat-value { font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
.stat-label { font-size: 13px; color: var(--text-3); }
.outcome-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.outcome-seg { min-width: 4px; background: var(--seg, var(--neutral-solid)); }
.legend { display: grid; gap: 2px; margin-top: var(--s3); }
.legend li { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; border-bottom: 1px dashed var(--border); }
.legend li:last-child { border-bottom: 0; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--seg); flex: none; }
.legend .legend-name { flex: 1; color: var(--text-2); }
.legend .legend-n { font-weight: 600; min-width: 36px; text-align: right; }
.legend .legend-pct { color: var(--text-3); min-width: 40px; text-align: right; font-size: 12.5px; }
.seg-valid { --seg: var(--c-valid); } .seg-expiring { --seg: var(--c-expiring); } .seg-expired { --seg: var(--c-expired); }
.seg-recalled { --seg: var(--c-recalled); } .seg-notFound { --seg: var(--c-notFound); } .seg-noLot { --seg: var(--c-noLot); }
.seg-redirect { --seg: var(--c-redirect); } .seg-file { --seg: var(--c-file); }

/* ───────────── dialog ───────────── */
.dialog { padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.dialog-sm { width: min(420px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(8, 18, 15, .5); backdrop-filter: blur(2px); }
.dialog[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
.dialog-inner { display: grid; gap: var(--s3); padding: var(--s5); }
.dialog-head { display: flex; align-items: center; gap: var(--s3); }
.dialog-title { flex: 1; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.dialog-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.dialog-icon-danger { background: var(--danger-bg); color: var(--danger-fg); }
.dialog-body { color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s2); }

/* ───────────── screens ───────────── */
/* dashboard */
.dash-intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
.name-cell { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.qr-glyph { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-border); }
.empty-hero { display: grid; justify-items: center; text-align: center; gap: var(--s3); padding: var(--s7) var(--s5); }
.empty-hero h2 { font-size: 20px; letter-spacing: -.015em; }
.empty-hero p { color: var(--text-2); max-width: 52ch; }
.empty-art { width: 120px; height: 120px; margin-bottom: var(--s2); color: var(--accent); }
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s5); text-align: left; width: 100%; max-width: 860px; }
.how-item { display: grid; gap: 6px; padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); }
.how-item h3 { font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.how-item h3 .icon { color: var(--accent-text); }
.how-item p { font-size: 13px; color: var(--text-2); }

/* overview */
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.overview-col { display: grid; gap: var(--s5); min-width: 0; }
.qr-card-body { display: grid; gap: var(--s4); justify-items: center; }
.qr-tile { display: grid; place-items: center; width: 100%; max-width: 264px; aspect-ratio: 1; padding: 14px; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.qr-tile img { width: 100%; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; }
.qr-actions { display: flex; gap: var(--s2); width: 100%; justify-content: center; flex-wrap: wrap; }
.qr-options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); width: 100%; align-items: end; }
.qr-options .btn { grid-column: 1 / -1; }
.url-row { display: grid; gap: 6px; }
.url-row + .url-row { margin-top: var(--s4); }
.url-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.url-token { display: inline-block; padding: 0 5px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); font-family: var(--font-mono); }
.checklist { display: grid; gap: 2px; }
.check-step { display: flex; align-items: center; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--border); }
.check-step:last-child { border-bottom: 0; padding-bottom: 0; }
.check-step:first-child { padding-top: 0; }
.step-mark { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--input-border); color: transparent; }
.check-step.is-done .step-mark { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.step-text { flex: 1; min-width: 0; }
.step-title { font-weight: 600; }
.check-step.is-done .step-title { color: var(--text-3); font-weight: 400; }
.step-desc { font-size: 12.5px; color: var(--text-3); }
.status-line { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px var(--s5); font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }

/* design */
.design-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: var(--s5); align-items: start; }
.design-form { display: grid; gap: var(--s5); min-width: 0; }
.preview-pane { position: sticky; top: calc(var(--topbar-h) + var(--s4)); display: grid; gap: var(--s3); }
.preview-controls { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--s2); align-items: end; }
.preview-frame-wrap { border: 1px solid var(--border-strong); border-radius: 20px; padding: 8px; background: var(--surface-3); box-shadow: var(--shadow-md); }
.preview-frame { display: block; width: 100%; height: calc(100vh - 230px); min-height: 520px; border: 0; border-radius: 13px; background: #fff; }
.seg-tabs { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--r-md); border: 1px solid var(--border); width: fit-content; max-width: 100%; overflow-x: auto; }
.seg-tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font-weight: 600; font-size: 13px; white-space: nowrap; cursor: pointer; }
.seg-tab:hover { color: var(--text); text-decoration: none; }
.seg-tab.is-active, .seg-tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.tab-panel[hidden] { display: none; }
.rows { display: grid; gap: var(--s3); }
.row-card { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s2) var(--s3); padding: 38px var(--s3) var(--s3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.row-card:focus-within { border-color: var(--border-strong); background: var(--surface); }
.row-num { position: absolute; left: 12px; top: 9px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-3); }
.row-card .rc { display: grid; gap: 3px; min-width: 0; align-content: start; }
.row-card .rc > span { font-size: 11.5px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.rc-6 { grid-column: span 6; } .rc-4 { grid-column: span 4; } .rc-3 { grid-column: span 3; } .rc-5 { grid-column: span 5; } .rc-2 { grid-column: span 2; } .rc-12 { grid-column: 1 / -1; }
.row-tools { position: absolute; top: 5px; right: 8px; display: flex; justify-content: flex-end; gap: 2px; }
.row-card.is-field .rc-en { visibility: hidden; }
.row-card.is-blank { background: transparent; border-style: dashed; }
.row-card.is-blank:focus-within { border-style: solid; }
.add-row { justify-self: start; }
.accent-field { display: flex; gap: var(--s2); align-items: center; }
.state-grid { display: grid; gap: var(--s3); }
.state-card { padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); display: grid; gap: var(--s3); }
.state-head { display: flex; align-items: center; gap: var(--s2); }
.state-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--seg); }
.state-name { font-weight: 600; }
.state-hint { font-size: 12.5px; color: var(--text-3); margin-left: auto; }
.savebar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s4); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
.savebar-note { flex: 1; min-width: 160px; }
.savebar-note .input { min-height: 34px; }
.json-area { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; min-height: 420px; tab-size: 2; white-space: pre; overflow: auto; }
.disclosure { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.disclosure > summary { display: flex; align-items: center; gap: 8px; padding: 10px var(--s4); font-weight: 600; cursor: pointer; }
.disclosure > summary .icon { color: var(--text-3); transition: transform .15s; }
.disclosure[open] > summary .icon-chev { transform: rotate(90deg); }
.disclosure-body { padding: 0 var(--s4) var(--s4); display: grid; gap: var(--s3); }

/* data */
.key-cell { font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.import-result { display: grid; gap: var(--s3); }
.import-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.import-stat { padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.import-stat b { display: block; font-size: 22px; letter-spacing: -.02em; font-weight: 600; }
.error-list { display: grid; gap: 4px; padding: var(--s3); border: 1px solid var(--danger-bd); border-radius: var(--r-md); background: var(--danger-bg); color: var(--danger-fg); font-size: 13px; font-family: var(--font-mono); }
.template-cols { display: flex; flex-wrap: wrap; gap: 6px; }
.dropzone { position: relative; display: grid; justify-items: center; gap: 6px; padding: var(--s5) var(--s4); text-align: center; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface-2); transition: border-color .12s, background .12s; }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); color: var(--text-2); }
.dropzone-title { font-weight: 600; }
.dropzone-file { font-size: 13px; color: var(--accent-text); font-weight: 600; min-height: 1.4em; overflow-wrap: anywhere; }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone .btn { position: relative; z-index: 1; }
.dropzone-actions { display: flex; gap: var(--s2); align-items: center; position: relative; z-index: 2; flex-wrap: wrap; justify-content: center; }
.record-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s5); align-items: start; }

/* versions */
.timeline { display: grid; }
.tl-item { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: 0; }
.tl-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-strong); }
.tl-item.is-live .tl-dot { background: var(--success-bg); color: var(--success-fg); border-color: var(--success-bd); }
.tl-item.is-draft .tl-dot { background: var(--warning-bg); color: var(--warning-fg); border-color: var(--warning-bd); }
.tl-title { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-weight: 600; }
.tl-note { color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.tl-meta { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.tl-actions { display: flex; align-items: center; gap: var(--s2); }
.audit-time { white-space: nowrap; color: var(--text-2); }
.action-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.action-tag { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); flex: none; }
.action-tag.is-danger { background: var(--danger-bg); color: var(--danger-fg); }
.action-tag.is-create { background: var(--success-bg); color: var(--success-fg); }
.action-tag.is-publish { background: var(--accent-soft); color: var(--accent-text); }

/* files */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.file-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s; }
.file-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.file-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--surface-inset); border-bottom: 1px solid var(--border); color: var(--text-3); overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb.is-contain img { object-fit: contain; padding: 10px; }
.file-ext { position: absolute; left: 10px; bottom: 10px; }
.file-body { display: flex; flex-direction: column; flex: 1; gap: 6px; padding: var(--s3) var(--s4) var(--s4); }
.file-name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; }
.file-meta { font-size: 12.5px; color: var(--text-3); }
.file-used { font-size: 12.5px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.file-actions { display: flex; align-items: center; gap: 2px; margin: auto -6px -6px; padding-top: 6px; }

/* members */
.perm-table th, .perm-table td { text-align: center; }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.perm-yes { color: var(--accent-text); }
.perm-no { color: var(--border-strong); }
.role-form { display: flex; align-items: center; gap: var(--s2); }
.role-form .select { width: auto; min-width: 118px; flex: 1 1 auto; }
.invite-link { min-width: 260px; }

/* settings */
.status-table td:first-child { width: 190px; }
.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.plan-stat { padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); display: grid; gap: 2px; }
.plan-stat b { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.plan-stat span { font-size: 12.5px; color: var(--text-3); }
.export-list { display: grid; gap: var(--s2); }
.export-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text); }
.export-item:hover { border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; }
.export-item .cell-icon { flex: none; }
.export-item-text { flex: 1; min-width: 0; }
.export-item-text b { display: block; }
.export-item-text span { font-size: 12.5px; color: var(--text-3); }
.logo-preview { display: grid; place-items: center; width: 72px; height: 72px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-inset); overflow: hidden; color: var(--text-3); }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }

/* operator */
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.stat-card { padding: var(--s4) var(--s5); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.stack { display: grid; gap: var(--s5); min-width: 0; }
.stack > .page-header { margin-bottom: 0; }
.two-col--members { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
.two-col--files { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.two-col--reports { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.only-narrow { display: none; }
.table td .num { white-space: nowrap; }

/* invite + onboarding cards */
.center-card { display: grid; gap: var(--s5); }
.center-card-head { display: grid; gap: var(--s2); justify-items: center; text-align: center; }
.center-card-head h1 { font-size: 24px; letter-spacing: -.02em; }
.center-card-head p { color: var(--text-2); max-width: 46ch; }
.hero-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-border); margin-bottom: var(--s2); }
.hero-icon.is-danger { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-bd); }
.err-code { font-size: 64px; line-height: 1; font-weight: 600; letter-spacing: -.04em; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ───────────── auth (split screen) ───────────── */
.auth { display: grid; grid-template-columns: minmax(380px, 5fr) 6fr; min-height: 100vh; }
.auth-form-side { display: flex; flex-direction: column; padding: var(--s5) var(--s6); background: var(--bg); }
.auth-top { display: flex; align-items: center; }
.auth-center { flex: 1; display: grid; align-content: center; width: 100%; max-width: 400px; margin: 0 auto; padding: var(--s6) 0; gap: var(--s5); }
.auth-title { font-size: 26px; line-height: 1.2; letter-spacing: -.025em; font-weight: 600; }
.auth-sub { color: var(--text-2); margin-top: 6px; }
.auth-foot { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; }
.social-stack { display: grid; gap: var(--s2); }
.btn-social { height: 42px; background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-xs); }
.btn-social:hover { background: var(--surface-2); }
.divider { display: flex; align-items: center; gap: var(--s3); color: var(--text-3); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.dev-box { display: grid; gap: var(--s3); padding: var(--s4); border: 1px dashed var(--warning-bd); border-radius: var(--r-md); background: var(--warning-bg); color: var(--warning-fg); }
.dev-box .input { background: var(--surface); color: var(--text); }
.dev-box-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.dev-box p { font-size: 12.5px; }
.code-input { text-align: center; font-family: var(--font-mono); font-size: 30px; letter-spacing: .45em; padding-left: .45em; min-height: 60px; font-variant-numeric: tabular-nums; }
.dev-code { display: flex; align-items: center; justify-content: center; gap: var(--s3); padding: var(--s3); border: 1px dashed var(--warning-bd); border-radius: var(--r-md); background: var(--warning-bg); color: var(--warning-fg); }
.dev-code b { font-family: var(--font-mono); font-size: 24px; letter-spacing: .3em; padding-left: .3em; }
.auth-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); justify-content: center; font-size: 13px; }
.auth-brand-side {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: var(--s6); padding: var(--s7) var(--s7) var(--s6);
  background: #11211f; color: #eef4f0; isolation: isolate;
}
.auth-brand-side::before, .auth-brand-side::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.auth-brand-side::before { width: 640px; height: 640px; right: -180px; top: -240px; background: radial-gradient(circle, rgba(80, 151, 122, .34), rgba(17, 33, 31, 0) 70%); }
.auth-brand-side::after { width: 560px; height: 560px; left: -120px; bottom: -300px; background: radial-gradient(circle, rgba(215, 243, 106, .12), rgba(17, 33, 31, 0) 70%); }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 10px; color: #c1d5ca; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.auth-eyebrow::before { content: ""; width: 24px; height: 1px; background: #d7f36a; }
.auth-headline { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; letter-spacing: -.035em; font-weight: 600; max-width: 14em; margin-top: var(--s4); }
.auth-headline em { font-style: normal; color: #d7f36a; }
.auth-lede { color: #b6c7bf; max-width: 46ch; margin-top: var(--s4); font-size: 15px; line-height: 1.65; }
.auth-points { display: grid; gap: var(--s3); margin-top: var(--s5); }
.auth-points li { display: flex; gap: var(--s3); align-items: flex-start; color: #d3e0d9; }
.auth-points .icon { color: #d7f36a; margin-top: 3px; }
.auth-mock { position: relative; width: min(340px, 100%); margin-top: var(--s5); padding: var(--s4); border: 1px solid rgba(255, 255, 255, .14); border-radius: 20px; background: linear-gradient(150deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04)); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.auth-mock-top { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: #b6c7bf; }
.auth-mock-title { margin-top: var(--s3); font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.auth-mock-status { display: flex; align-items: center; gap: 8px; margin-top: var(--s3); padding: 10px 12px; border-radius: 12px; background: rgba(63, 191, 122, .16); border: 1px solid rgba(63, 191, 122, .35); color: #9ce8bd; font-weight: 600; font-size: 13px; }
.auth-mock-rows { display: grid; gap: 8px; margin-top: var(--s3); font-size: 12.5px; color: #b6c7bf; }
.auth-mock-rows div { display: flex; justify-content: space-between; gap: var(--s3); padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.auth-mock-rows b { color: #eef4f0; font-weight: 600; }
.auth-vendor { display: flex; align-items: center; gap: 10px; color: #9fb3aa; font-size: 12px; }
.auth-vendor img { height: 26px; width: auto; }

/* ───────────── responsive ───────────── */
@media (min-width: 901px) { .page-head > .back-link { display: none; } }
@media (max-width: 1240px) {
  .only-narrow { display: inline-flex; }
  .design-layout { grid-template-columns: minmax(0, 1fr); }
  .preview-pane { position: static; }
  .preview-frame { height: 640px; }
}
@media (max-width: 1100px) {
  .overview-grid, .record-layout, .two-col, .two-col--members, .two-col--files, .two-col--reports { grid-template-columns: minmax(0, 1fr); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100dvh; transform: translateX(-102%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg); z-index: 90;
  }
  .nav-toggle:checked ~ .app .sidebar { transform: none; }
  .nav-toggle:checked ~ .app .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 18, 15, .5); z-index: 80; }
  .menu-btn { display: inline-flex; }
  .brand-compact { display: inline-flex; }
  .crumbs { display: none; }
  .topbar { padding: 0 var(--s4); gap: var(--s2); }
  .main { padding: var(--s5) var(--s4) var(--s7); }
  .banner { padding: 10px var(--s4); flex-wrap: wrap; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand-side { display: none; }
  .auth-form-side { padding: var(--s4); }
  .usage-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .how-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .form-grid, .lang-pair { grid-template-columns: minmax(0, 1fr); }
  .stat-row, .import-stats, .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .page-title { font-size: 21px; }
  .page-header, .page-head-row { align-items: flex-start; }
  .page-actions { width: 100%; }
  .card-head, .card-body, .card-foot, .pager { padding-left: var(--s4); padding-right: var(--s4); }
  .tl-item { padding-left: var(--s4); padding-right: var(--s4); grid-template-columns: 28px minmax(0, 1fr); }
  .tl-actions { grid-column: 2; }
  .search { min-width: 0; width: 100%; }
  .toolbar-group { width: 100%; }
  .toolbar-group > * { flex: 1; }
  .preview-controls { grid-template-columns: 1fr 1fr; }
  .preview-controls .btn { grid-column: 1 / -1; }
  .row-card { grid-template-columns: minmax(0, 1fr); }
  .row-card > .rc { grid-column: 1 / -1 !important; }
  .copyfield { flex-direction: column; }
  .qr-options { grid-template-columns: 1fr; }
  .savebar { border-radius: var(--r-md); }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .btn { width: 100%; }
  .code-input { font-size: 26px; }
  .bare-user-email { display: none; }

  /* tables become stacked cards */
  .table-wrap { overflow: visible; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td, .table td:first-child, .table td:last-child { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: 5px 0; border: 0; text-align: right; }
  .table tbody tr:hover td { background: none; }
  .table td::before { content: attr(data-label); flex: none; max-width: 42%; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); }
  .table td[data-label=""]::before { content: none; }
  .table td.cell-lead { display: block; text-align: left; padding-top: 0; }
  .table td.cell-lead::before { content: none; }
  .table td.actions-col { justify-content: flex-end; width: 100%; padding-top: var(--s2); }
  .table .num-col { text-align: right; }
  .spark-cell { justify-content: flex-end; }
  .role-form { flex-wrap: wrap; justify-content: flex-end; }
  .invite-link { min-width: 0; width: 100%; }
}
@media (max-width: 480px) {
  .btn-lg { width: 100%; }
}
@media (forced-colors: active) {
  .badge, .btn, .card, .input, .select, .textarea { border: 1px solid CanvasText; }
  .meter-fill, .chart-bar, .outcome-seg { background: Highlight; forced-color-adjust: none; }
}
@media print { .sidebar, .topbar, .banner { display: none; } .app { display: block; } }

/* ───────────── additions ───────────── */
.mb { margin-bottom: var(--s5); }
.sub-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.jump-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.jump-nav a { padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); font-size: 12.5px; }
.jump-nav a:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.tabs-box { display: grid; gap: var(--s4); }
.tabs-box:not(.is-js) .tab-panel + .tab-panel { margin-top: var(--s5); }
.field-narrow { max-width: 240px; }
.error-bullets { margin: 0; padding-left: 18px; list-style: disc; display: grid; gap: 2px; }
.json-status { min-height: 1.4em; }
.json-status[data-state="error"] { color: var(--danger-fg); }
.json-status[data-state="ok"] { color: var(--success-fg); }
html.js .theme-switch.js-only { display: inline-flex !important; }
.placeholder-help { display: grid; gap: 6px; padding: var(--s3) var(--s4); border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); }
.placeholder-help .template-cols { margin: 0; }
.auth-links form { display: inline; }
.auth-links .btn-link { height: auto; font-size: inherit; }
.design-fieldset { min-width: 0; }
.file-id .code-chip { font-size: 11.5px; }
.card-foot > span:empty { display: none; }
@media (max-width: 1100px) {
  .overview-grid > .overview-col:last-child { order: -1; }
}

/* Print-ready QR codes panel on the data tab */
.qr-zip-form { max-width: 520px; margin-bottom: var(--s3); }

/* Narrow side column on the lot screen: stack the QR option selects so labels are not cut off */
.record-layout .qr-options { grid-template-columns: 1fr; }
