/* =========================================================
   模型报价中心 — Design System
   ========================================================= */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f1f3f7;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e7e9ef;
  --line-strong: #d7dbe4;
  --accent: #2456f0;
  --accent-hover: #1b45c9;
  --accent-soft: #eef3ff;
  --accent-line: #d7e2ff;
  --green: #087a5b;
  --green-soft: #e8f7f1;
  --green-line: #c7ebdd;
  --amber: #a15c07;
  --amber-soft: #fdf3e3;
  --red: #d02d24;
  --red-soft: #fdefee;
  --violet: #6d3bd1;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 14px 36px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 24px 70px rgba(16, 24, 40, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { display: block; }
h1, h2, h3, h4, p { margin: 0; }
svg { display: block; }
.ic { width: 16px; height: 16px; flex: none; }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------------- Layout ---------------- */

.shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: 240px;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.main {
  min-width: 0;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 30px 72px;
}

.sidebar-backdrop { display: none; }

body.public-mode .sidebar { display: none; }
body.public-mode .sidebar-backdrop { display: none !important; }
body.public-mode .main { margin-left: 0; }
body.public-mode .content { max-width: 1320px; }
body.public-mode .mobile-menu { display: none !important; }

.topbar-brand { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; color: var(--ink); }
.brand-mark.small { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 2px 8px rgba(36, 86, 240, 0.22); }
.brand-mark.small svg { width: 18px; height: 18px; }
.topbar-brand-name { letter-spacing: -0.01em; }

/* ---------------- Brand ---------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 22px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #2f63ff 0%, #1b41c8 100%);
  box-shadow: 0 4px 12px rgba(36, 86, 240, 0.28);
}
.brand-mark svg { width: 24px; height: 24px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.brand-sub { margin-top: 3px; font-size: 8.5px; font-weight: 650; letter-spacing: 0.16em; color: var(--faint); }

/* ---------------- Nav ---------------- */

.nav { flex: 1; overflow-y: auto; padding: 0 2px; }

.nav-section { margin-bottom: 20px; }
.nav-label {
  padding: 0 10px 7px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 10px;
  margin-bottom: 2px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.14s, color 0.14s;
}
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-icon { width: 17px; height: 17px; flex: none; opacity: 0.9; }
.nav-item .nav-lock { margin-left: auto; width: 13px; height: 13px; color: var(--faint); }
.nav-item.active .nav-lock { color: var(--accent); opacity: 0.7; }

.sidebar-foot { padding: 14px 8px 0; border-top: 1px solid var(--line); }
.storage-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--faint);
}
.storage-note svg { width: 13px; height: 13px; flex: none; margin-top: 1px; }
.sidebar-meta { margin-top: 8px; font-size: 10px; color: #b3bac7; letter-spacing: 0.04em; }

/* ---------------- Topbar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 30px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }

.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.crumb .crumb-sep { color: var(--line-strong); }
.crumb strong { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mobile-menu { display: none !important; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px #e7f8ef; }

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background 0.14s, border-color 0.14s, color 0.14s, box-shadow 0.14s, transform 0.06s;
}
.btn:hover { background: var(--surface-2); border-color: #c3c9d4; color: var(--ink); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .ic { width: 15px; height: 15px; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(36, 86, 240, 0.25);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-soft { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.btn-soft:hover { background: #e4ecff; border-color: #c3d5ff; color: var(--accent-hover); }

.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--ink); }

.btn-danger { color: var(--red); border-color: #f3c9c6; background: #fff; }
.btn-danger:hover { background: var(--red-soft); border-color: #eeb4b0; color: var(--red); }

.btn-danger-solid {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 2px 6px rgba(208, 45, 36, 0.24);
}
.btn-danger-solid:hover { background: #b8261e; border-color: #b8261e; color: #fff; }

.btn-sm { height: 31px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-sm .ic { width: 14px; height: 14px; }
.btn-lg { height: 40px; padding: 0 16px; font-size: 13px; }

.icon-btn {
  width: 31px;
  height: 31px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn .ic { width: 16px; height: 16px; }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.icon-btn:disabled:hover { background: transparent; color: var(--muted); }

/* ---------------- Page head ---------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.page-head-main { min-width: 0; }
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--faint);
  text-transform: uppercase;
  margin-bottom: 7px;
}
.page-head h1 { font-size: 27px; line-height: 1.2; font-weight: 680; letter-spacing: -0.025em; }
.page-desc { margin-top: 7px; font-size: 13px; color: var(--muted); max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.section-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.section-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }

/* ---------------- Quote hero ---------------- */

.quote-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(900px 260px at 100% -40%, rgba(36, 86, 240, 0.09), transparent 62%),
    linear-gradient(180deg, #fdfdfe 0%, #ffffff 70%);
  box-shadow: var(--shadow-sm);
}
.quote-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #2456f0, #6d9bff);
}
.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 24px 26px 22px;
}
.hero-version { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.hero-version .version-label { font-size: 12px; color: var(--muted); }
.hero-version .version-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero-note { font-size: 12px; color: var(--muted); }
.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }

.view-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
}
.view-badge.history { border-color: #eedcb8; background: var(--amber-soft); color: var(--amber); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: rgba(250, 251, 252, 0.7);
}
.hero-stat { padding: 14px 24px; border-right: 1px solid var(--line); }
.hero-stat:last-child { border-right: none; }
.hero-stat b { display: block; font-size: 19px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.3; }
.hero-stat span { font-size: 11px; color: var(--muted); }

.hero-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border-top: 1px solid #f0e2c6;
  background: #fffaf0;
  color: #8a5a12;
  font-size: 12px;
}
.hero-banner .ic { width: 15px; height: 15px; flex: none; }
.hero-banner .btn { margin-left: auto; }

.version-switch { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted); }
.version-switch .select { width: auto; max-width: 248px; height: 30px; font-size: 11px; background: #fff; }

.version-picker { width: auto; max-width: 250px; }

/* ---------------- Cards & tables ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card + .card { margin-top: 16px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 14px; font-weight: 650; }
.card-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.table-wrap { width: 100%; overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.scroll-hint { display: none; }
.table-wrap.flush { border-radius: var(--radius-lg); }

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
table.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
table.data td {
  padding: 13px 16px;
  border-bottom: 1px solid #f0f1f5;
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background 0.12s; }
table.data tbody tr:hover { background: #fbfcff; }
table.data tr.row-hidden { opacity: 0.48; background: #fafafa; }
table.data tr.row-hidden:hover { opacity: 0.72; }
table.data td.actions, table.data th.actions { text-align: right; padding-right: 14px; white-space: nowrap; }

table.table-quotes { min-width: 920px; }
table.table-suppliers { min-width: 720px; }
table.table-channels { min-width: 640px; }
table.table-history { min-width: 760px; }

table.table-prices { table-layout: fixed; min-width: 1100px; }
table.table-prices th, table.table-prices td { padding-left: 12px; padding-right: 12px; }
table.table-prices th:nth-child(1) { width: 46px; }
table.table-prices th:nth-child(2) { width: 145px; }
table.table-prices th:nth-child(3) { width: 132px; }
table.table-prices th:nth-child(4) { width: 198px; }
table.table-prices th:nth-child(5) { width: 135px; }
table.table-prices th:nth-child(6) { width: 112px; }
table.table-prices th:nth-child(7) { width: 98px; }
table.table-prices th:nth-child(8) { width: 130px; }
table.table-prices th:nth-child(9) { width: 106px; }

.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--ink-2); background: #f4f6fa; }
.sort-ic { display: inline-flex; align-items: center; margin-left: 4px; vertical-align: -1px; opacity: 0.3; }
.sort-ic .ic { width: 11px; height: 11px; }
.sort-ic.active { opacity: 1; color: var(--accent); }

table.table-models { table-layout: fixed; min-width: 950px; }
table.table-models th:nth-child(1) { width: 122px; }
table.table-models th:nth-child(2) { width: 212px; }
table.table-models th:nth-child(3) { width: 222px; }
table.table-models th:nth-child(4) { width: 72px; }
table.table-models th:nth-child(5) { width: 142px; }
table.table-models th:nth-child(6) { width: 62px; }
table.table-models th:nth-child(7) { width: 112px; }

.supplier-company {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.table-prices .provider-sub,
table.table-models td .mono {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.table-models td .mono { max-width: 198px; }
table.table-prices .model-name { overflow-wrap: anywhere; }

table.data .row-actions .icon-btn { width: 26px; height: 26px; }
table.data .row-actions .icon-btn .ic { width: 14px; height: 14px; }

.release-cell { display: flex; flex-direction: column; gap: 1px; white-space: nowrap; }
.release-cell span { font-size: 11.5px; color: var(--muted); }
.release-cell em {
  font-style: normal;
  font-size: 10px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.table-empty { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 13px; }

.cell-provider { display: flex; align-items: center; gap: 9px; min-width: 0; }
.logo {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.logo img { width: 20px; height: 20px; object-fit: contain; }
.logo.lg { width: 36px; height: 36px; border-radius: 10px; }
.logo.lg img { width: 25px; height: 25px; }
.logo-fallback { font-size: 12px; font-weight: 700; color: var(--provider-color, var(--ink)); background: var(--surface-2); }
.provider-name { font-weight: 600; font-size: 12.5px; line-height: 1.3; }
.provider-sub { margin-top: 1px; font-size: 10.5px; color: var(--faint); }

.model-name { font-weight: 550; line-height: 1.35; }
.model-api { margin-top: 2px; font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
  line-height: 1;
}
.badge-cn { background: #fff4ec; color: #b45419; border-color: #f7ddca; }
.badge-global { background: #edf4ff; color: #2557b8; border-color: #d8e6fd; }
.badge-soft { background: var(--surface-3); color: var(--ink-2); border-color: var(--line); }
.badge-green { background: var(--green-soft); color: var(--green); border-color: var(--green-line); }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: #f0dfbf; }
.badge-muted { background: #f5f6f8; color: var(--faint); border-color: var(--line); }

.channel-cell { display: flex; flex-direction: column; gap: 3px; }
.channel-name { font-weight: 500; }
.channel-type { font-size: 10.5px; color: var(--faint); }

.discount-main { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; }
.discount-main.is-empty { color: var(--faint); font-weight: 600; }
.fx-rate {
  margin-left: 3px;
  font-size: 0.7em;
  font-weight: 550;
  letter-spacing: 0;
  color: var(--muted);
  white-space: nowrap;
}
.chip-price .fx-rate, .chip-vip .fx-rate { font-size: 0.92em; margin-left: 2px; }
.discount-sub { font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.vip-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1px 5px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-2);
}
.vip-line .vip-basis { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.vip-line .vip-tail { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.vip-line .vip-arrow { color: var(--faint); font-size: 10px; }
.vip-line b { font-weight: 650; color: var(--green); }
.vip-none { color: var(--faint); font-size: 12px; }

.row-actions { display: inline-flex; align-items: center; gap: 1px; opacity: 0.55; transition: opacity 0.12s; }
tr:hover .row-actions { opacity: 1; }
.row-order { display: inline-flex; align-items: center; gap: 4px; color: var(--faint); }
.row-order .idx { width: 18px; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.order-btns { display: inline-flex; flex-direction: column; gap: 1px; }
.order-btn {
  width: 16px;
  height: 13px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.order-btn .ic { width: 10px; height: 10px; }
.order-btn:hover:not(:disabled) { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.order-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---------------- Filter bar ---------------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.filter-card {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.filter-card .filter-bar { border-bottom: 0; }
.filter-spacer { flex: 1; }
.filter-label { font-size: 11px; color: var(--faint); font-weight: 600; }

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-3);
}
.seg-btn {
  height: 27px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-xs); font-weight: 600; }

/* ---------------- Form controls ---------------- */

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 3px;
}
.field-label .req { color: var(--red); font-weight: 700; }
.field-hint { font-size: 10.5px; color: var(--faint); margin-top: 1px; line-height: 1.45; }

.input, .select {
  width: 100%;
  height: 37px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}
.input::placeholder { color: #aeb6c4; }
.input:hover, .select:hover { border-color: #c2c8d4; }
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 86, 240, 0.12);
}
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--faint); cursor: not-allowed; }

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.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;
  cursor: pointer;
}
.select-sm { height: 32px; font-size: 11.5px; padding-left: 9px; border-radius: 8px; }

.input-suffix { position: relative; display: flex; align-items: center; }
.input-suffix .input { padding-right: 34px; }
.input-suffix > span {
  position: absolute;
  right: 11px;
  font-size: 11.5px;
  color: var(--faint);
  pointer-events: none;
  font-weight: 500;
}

.input-affix { position: relative; display: flex; align-items: center; width: 100%; }
.input-affix .input { padding-right: 34px; }
.input-affix.has-prefix .input { padding-left: 28px; }
.input-affix .affix-prefix,
.input-affix .affix-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--faint);
  pointer-events: none;
}
.input-affix .affix-prefix { left: 11px; }
.input-affix .affix-suffix { right: 11px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section-label {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}
.form-section-label::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.form-subgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
  min-width: 0;
}
.form-subgrid .form-section-label { grid-column: 1 / -1; margin-top: 0; }

.form-error {
  margin-top: 14px;
  padding: 9px 11px;
  border: 1px solid #f3c9c6;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11.5px;
}

.inline-fields { display: flex; gap: 8px; }
.inline-fields .select { width: auto; flex: none; }
.inline-fields .input-suffix { flex: 1; min-width: 0; }

/* ---------------- Provider picker ---------------- */

.picker { position: relative; }
.picker-btn {
  width: 100%;
  height: 37px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.picker-btn:hover { border-color: #c2c8d4; }
.picker.open .picker-btn { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36, 86, 240, 0.12); }
.picker-btn .logo { width: 23px; height: 23px; border-radius: 6px; }
.picker-btn .logo img { width: 16px; height: 16px; }
.picker-current { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.picker-current.placeholder { color: #aeb6c4; }
.picker-caret { width: 13px; height: 13px; color: var(--faint); flex: none; }

.picker-pop {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 80;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-md);
}
.picker-search { position: relative; margin: 2px 2px 6px; }
.picker-search svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--faint);
}
.picker-search input {
  width: 100%;
  height: 31px;
  padding: 0 9px 0 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  font-size: 12px;
  outline: none;
}
.picker-search input:focus { border-color: var(--accent-line); background: #fff; }
.picker-list { max-height: 236px; overflow-y: auto; }
.picker-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
}
.picker-option:hover { background: var(--accent-soft); }
.picker-option.selected { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.picker-option .logo { width: 24px; height: 24px; border-radius: 6px; }
.picker-option .logo img { width: 16px; height: 16px; }
.picker-option .opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-option em { font-style: normal; font-size: 9.5px; color: var(--faint); letter-spacing: 0.04em; }
.picker-empty { padding: 18px 10px; text-align: center; font-size: 11.5px; color: var(--faint); }

/* ---------------- Customer quote cards ---------------- */

.quote-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.quote-toolbar .hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--faint);
}
.quote-toolbar .hint .ic { width: 13px; height: 13px; }
.quote-toolbar .spacer { flex: 1; }

.group-card {
  padding: 0;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.group-card:hover { border-color: var(--line-strong); }
.group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px 14px;
}
.group-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.group-title .logo { width: 34px; height: 34px; border-radius: 9px; }
.group-name-wrap { min-width: 0; }
.group-name-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.group-name { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.group-api { margin-top: 2px; font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.group-meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }

.group-margin { flex: none; padding-left: 12px; text-align: right; }
.margin-pair { display: flex; justify-content: flex-end; gap: 26px; }
.margin-box { text-align: right; min-width: 76px; }
.margin-label { font-size: 10px; font-weight: 650; letter-spacing: 0.06em; color: var(--faint); text-transform: uppercase; }
.margin-value {
  display: block;
  margin-top: 2px;
  font-size: 25px;
  font-weight: 680;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--green);
}
.margin-value.is-mid { color: var(--amber); }
.margin-value.is-bad { color: var(--red); }
.margin-value.is-none { color: var(--faint); }
.margin-sub { display: block; margin-top: 2px; font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.margin-note { margin-top: 3px; font-size: 10.5px; color: var(--faint); }

.supplier-strip {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 20px 15px;
}
.supplier-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s, background 0.14s;
}
.supplier-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.supplier-chip.cheapest { border-color: var(--green-line); background: var(--green-soft); }
.chip-name { font-size: 11.5px; font-weight: 550; color: var(--ink-2); }
.chip-price { font-size: 13px; font-weight: 680; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.chip-vip { font-size: 9.5px; color: var(--faint); }
.chip-tag {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--green);
  background: #fff;
  border: 1px solid var(--green-line);
  padding: 1px 4px;
  border-radius: 4px;
}
.supplier-empty { font-size: 11.5px; color: var(--faint); padding: 7px 0; }
.supplier-note { align-self: center; font-size: 10.5px; color: var(--faint); padding-left: 2px; }

.tag-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 6px 0 8px;
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
}
.tag-chip button {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  opacity: 0.6;
}
.tag-chip button:hover { background: var(--accent-soft); opacity: 1; }
.tag-chip .ic { width: 10px; height: 10px; }
.tag-options { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-option {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.tag-option:hover { border-color: var(--accent-line); color: var(--ink-2); }
.tag-option.active { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.tag-custom { display: flex; gap: 8px; }
.tag-custom .input { height: 32px; font-size: 12px; background: #fff; }

.model-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.preset-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.preset-label { font-size: 10.5px; color: var(--faint); }
.preset-chip {
  height: 25px;
  padding: 0 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  cursor: pointer;
}
.preset-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

.quote-form {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 1.2fr 0.85fr auto;
  gap: 12px 14px;
  align-items: end;
  padding: 14px 20px 17px;
  border-top: 1px solid var(--line);
  background: #fcfcfd;
}
.quote-form .field > label { font-size: 10.5px; color: var(--muted); }
.quote-form .input, .quote-form .select { height: 34px; font-size: 12px; background: #fff; }
.quote-form .form-actions { display: flex; align-items: center; gap: 4px; padding-bottom: 1px; }

.quote-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fcfcfd;
}
.quote-empty-text { font-size: 12px; color: var(--muted); }
.quote-empty-text b { display: block; color: var(--ink-2); font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }

/* ---------------- Stats / banners ---------------- */

.stat-inline { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.stat-inline .item { display: flex; align-items: baseline; gap: 6px; }
.stat-inline b { font-size: 18px; font-weight: 680; letter-spacing: -0.02em; }
.stat-inline span { font-size: 11.5px; color: var(--muted); }

.banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
}
.banner .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.banner-info { background: var(--accent-soft); border-color: var(--accent-line); color: #2b4fa8; }
.banner-warn { background: #fffaf0; border-color: #f0e2c6; color: #8a5a12; }
.banner-danger { background: var(--red-soft); border-color: #f3c9c6; color: var(--red); }

/* ---------------- Empty state ---------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 62px 24px;
  text-align: center;
}
.empty-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--faint);
}
.empty-icon .ic { width: 21px; height: 21px; }
.empty-title { font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.empty-desc { font-size: 12px; color: var(--muted); max-width: 360px; line-height: 1.65; }
.empty .btn { margin-top: 16px; }

/* ---------------- Modal ---------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 7vh 20px 40px;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in 0.16s ease both;
  overflow-y: auto;
}
.modal {
  width: 100%;
  max-width: 560px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.modal.wide { max-width: 720px; }
.modal.narrow { max-width: 430px; }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
}
.modal-head h3 { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; }
.modal-head p { margin-top: 4px; font-size: 12px; color: var(--muted); }
.modal-close { margin: -4px -6px 0 0; }

.modal-body { padding: 4px 22px 20px; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 15px 15px;
}
.modal-foot .left { margin-right: auto; }

.login-hint {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.65;
}
.login-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #eef1f6;
  font-family: var(--font-mono);
  color: var(--ink-2);
}

.publish-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0 16px;
}
.publish-stat {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.publish-stat b { display: block; font-size: 22px; font-weight: 680; letter-spacing: -0.02em; }
.publish-stat span { font-size: 10.5px; color: var(--muted); }

.publish-version {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
}
.publish-version .mono { font-weight: 600; }

.confirm-text { font-size: 13px; line-height: 1.75; color: var(--ink-2); }
.confirm-text b { color: var(--ink); font-weight: 600; }

.warning-list {
  margin: 10px 0 0;
  padding: 0 0 0 18px;
  font-size: 11.5px;
  color: var(--amber);
  line-height: 1.7;
}

/* ---------------- Toast ---------------- */

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 240px;
  max-width: 380px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow-md);
  font-size: 12px;
  color: var(--ink-2);
  animation: toast-in 0.2s ease both;
  pointer-events: auto;
}
.toast.error { border-left-color: var(--red); }
.toast .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--green); }
.toast.error .ic { color: var(--red); }
.toast.leaving { animation: toast-out 0.18s ease both; }

/* ---------------- Loading ---------------- */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 120px 20px;
  color: var(--muted);
  font-size: 12px;
}
.spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---------------- User menu ---------------- */

.user-menu-wrap { position: relative; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 8px 0 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 550;
}
.user-chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.avatar {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #2f63ff, #1b41c8);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}
.user-chip .ic { width: 13px; height: 13px; color: var(--faint); }
.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 90;
  width: 190px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-md);
}
.user-menu-head { padding: 8px 10px 9px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu-head b { display: block; font-size: 12.5px; font-weight: 600; }
.user-menu-head span { font-size: 10.5px; color: var(--faint); }
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
}
.menu-item:hover { background: var(--surface-3); color: var(--ink); }
.menu-item .ic { width: 14px; height: 14px; color: var(--faint); }
.menu-item.danger { color: var(--red); }
.menu-item.danger .ic { color: var(--red); }

/* ---------------- Print ---------------- */

.print-only { display: none; }

@media print {
  @page { size: A4 landscape; margin: 11mm 10mm; }
  body { background: #fff; font-size: 10.5px; }
  .sidebar, .topbar, .sidebar-backdrop, .no-print, .page-actions, .page-head, .filter-bar,
  .toast-root, #modal-root, .view-badge, .hero-banner, .hero-side, .hero-top, .quote-toolbar,
  .scroll-hint { display: none !important; }
  .main { margin: 0; }
  .content { max-width: none; padding: 0; }
  .eyebrow { font-size: 8px; }
  .quote-hero { border: 0; box-shadow: none; border-radius: 0; margin-bottom: 8px; background: #fff; }
  .quote-hero::before { display: none; }
  .hero-stats { border-top: 1px solid #ddd; background: #fff; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .hero-stat { padding: 7px 12px; border-right: 1px solid #ddd !important; border-bottom: none !important; }
  .hero-stat:last-child { border-right: none !important; }
  .hero-stat b { font-size: 13px; }
  .hero-stat span { font-size: 8.5px; }
  .print-only { display: block; }
  .sort-ic { display: none !important; }
  .print-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 2px solid #111;
  }
  .print-head h1 { font-size: 17px; letter-spacing: 0; }
  .print-head .print-meta { font-size: 8.5px; color: #555; text-align: right; line-height: 1.7; }
  .print-foot { margin-top: 10px; font-size: 8px; color: #777; display: flex; justify-content: space-between; }
  .card { border: 1px solid #ddd; box-shadow: none; border-radius: 0; }
  table.data { font-size: 9px; }
  table.data th { padding: 5px 8px; font-size: 7.5px; background: #f4f4f4 !important; color: #333; position: static; }
  table.data td { padding: 5px 8px; border-bottom: 1px solid #e8e8e8; }
  .discount-main { font-size: 10.5px; }
  .model-api { font-size: 7.5px; }
  .badge { height: 15px; font-size: 7.5px; padding: 0 4px; border: 0; background: transparent !important; color: #333 !important; }
  .logo { width: 17px; height: 17px; border: 0; }
  .logo img { width: 13px; height: 13px; }
  .cell-provider { gap: 5px; }
  .provider-name { font-size: 8.5px; }
  tr, .hero { break-inside: avoid; }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1180px) {
  .quote-form { grid-template-columns: 1fr 1fr; }
  .quote-form .form-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }
  .main { margin-left: 0; }
  .mobile-menu { display: inline-grid !important; }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(15, 23, 42, 0.35);
  }
  .content { padding: 22px 20px 60px; }
  .topbar { padding: 0 20px; }
  .hero-top { padding: 20px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stat:nth-child(2) { border-right: none; }
  .hero-stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .page-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .page-actions { justify-content: flex-start; }
}

@media (max-width: 680px) {
  .content { padding: 18px 14px 52px; }
  .topbar { height: 58px; padding: 0 14px; }
  .status-pill { display: none; }
  .page-head h1 { font-size: 22px; }
  .hero-version .version-value { font-size: 20px; }
  .hero-top { flex-direction: column; gap: 14px; }
  .hero-side { align-items: flex-start; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stat { padding: 11px 16px; }
  .hero-stat b { font-size: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-subgrid { grid-template-columns: 1fr; }
  .quote-form { grid-template-columns: 1fr; padding: 14px 16px 16px; }
  .quote-form .form-actions { justify-content: flex-start; }
  .group-head { flex-direction: column; gap: 12px; padding: 15px 16px 12px; }
  .group-margin { text-align: left; padding-left: 0; width: 100%; }
  .margin-pair { justify-content: flex-start; gap: 30px; }
  .margin-box { text-align: left; }
  .version-switch { width: 100%; align-items: flex-start; flex-direction: column; gap: 4px; }
  .version-switch .select { width: 100%; max-width: none; }
  .supplier-strip { padding: 0 16px 13px; }
  .quote-empty { flex-direction: column; align-items: flex-start; padding: 13px 16px; }
  .card-head { padding: 14px 16px; }
  table.data th, table.data td { padding: 10px 12px; }
  .modal-overlay { padding: 4vh 10px 24px; }
  .modal-head { padding: 17px 17px 12px; }
  .modal-body { padding: 4px 17px 17px; }
  .modal-foot { padding: 12px 17px; }
  .publish-summary { grid-template-columns: 1fr 1fr; }
  .scroll-hint {
    display: block;
    padding: 7px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--faint);
    font-size: 10.5px;
    text-align: center;
  }
  .toast-root { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .page-actions .version-picker { width: 100%; max-width: none; }
}

/* ---------------- Animations ---------------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(5px); } }

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