/* 宠品对账 — mobile-first reconciliation app */
:root {
  --blue: #2563eb;
  --blue-600: #1d4ed8;
  --blue-700: #1e40af;
  --blue-50: #f2f6ff;
  --blue-100: #e6eeff;
  --blue-200: #c9d9ff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e7ecf3;
  --line-strong: #d8e0eb;
  --surface: #ffffff;
  --canvas: #f7f9fc;
  --green: #0b9b6d;
  --green-soft: #eaf8f2;
  --red: #dc3d43;
  --red-soft: #fff0f0;
  --amber: #b45309;
  --radius: 14px;
  --radius-sm: 10px;
  --tabbar-h: 66px;
  --statusbar-h: 31px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  display: grid;
  place-items: center;
  background: #edf1f7;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Device presentation */
.phone-stage {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100%;
  padding: 16px;
}
.phone-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 390px;
  height: min(844px, calc(100dvh - 32px));
  min-height: 620px;
  overflow: hidden;
  border-radius: 34px;
  background: var(--surface);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, .06),
    0 28px 70px rgba(30, 64, 175, .15),
    0 3px 10px rgba(15, 23, 42, .06);
}
.status-bar {
  display: flex;
  flex: 0 0 var(--statusbar-h);
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .01em;
  user-select: none;
}
.status-icons { display: flex; align-items: center; gap: 6px; }
.status-icons svg { width: 14px; height: 11px; stroke-width: 1.2; }
.signal { display: flex; align-items: flex-end; gap: 1.5px; height: 10px; }
.signal i { display: block; width: 2.5px; border-radius: 2px; background: currentColor; }
.signal i:nth-child(1) { height: 4px; }
.signal i:nth-child(2) { height: 6px; }
.signal i:nth-child(3) { height: 8px; }
.signal i:nth-child(4) { height: 10px; }
.battery {
  position: relative;
  width: 19px;
  height: 10px;
  padding: 1px;
  border: 1.2px solid currentColor;
  border-radius: 3px;
}
.battery::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 2.5px;
  width: 1.5px;
  height: 3.5px;
  border-radius: 0 1px 1px 0;
  background: currentColor;
  opacity: .45;
}
.battery i { display: block; width: 72%; height: 100%; border-radius: 1px; background: currentColor; }

.app-viewport {
  position: relative;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  scrollbar-width: none;
}
.app-viewport::-webkit-scrollbar { display: none; }
.screen-root { min-height: 100%; background: var(--surface); }
.boot-screen {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 24px 64px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.boot-brand { display: flex; flex-direction: column; align-items: center; }
.boot-logo {
  width: 76px;
  height: 76px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--blue);
  box-shadow: 0 14px 30px rgba(37, 99, 235, .2), 0 2px 6px rgba(15, 23, 42, .06);
}
.boot-logo img { display: block; width: 100%; height: 100%; }
.boot-name { margin: 17px 0 0; color: var(--ink); font-size: 23px; font-weight: 750; letter-spacing: -.03em; }
.boot-tagline { margin: 6px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.5; letter-spacing: .01em; }
.boot-status { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 11px; }
.boot-screen .spinner { width: 18px; height: 18px; border-width: 2px; }
.boot-note { position: absolute; bottom: max(22px, env(safe-area-inset-bottom)); margin: 0; color: #a4afbf; font-size: 10px; letter-spacing: .02em; }
.phone-frame.is-booting .tabbar { visibility: hidden; }
.screen-enter { animation: screen-in .22s ease both; }
@keyframes screen-in {
  from { opacity: .6; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tab bar */
.tabbar {
  position: relative;
  z-index: 30;
  display: flex;
  flex: 0 0 var(--tabbar-h);
  align-items: stretch;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
  padding: 5px 8px max(6px, env(safe-area-inset-bottom));
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 50px;
  border-radius: 10px;
  color: #8a96a8;
  font-size: 10.5px;
  font-weight: 500;
  transition: color .15s ease, background .15s ease;
}
.tab-icon { display: grid; place-items: center; width: 28px; height: 24px; }
.tab-icon svg { width: 21px; height: 21px; stroke-width: 1.8; }
.tab-item.is-active { color: var(--blue); font-weight: 650; }
.tab-item.is-active .tab-icon { color: var(--blue); }
.tab-item:active { background: var(--blue-50); }

/* Shared app header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(231, 236, 243, .9);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}
.header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  overflow: hidden;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, .14);
}
.brand-mark svg { width: 17px; height: 17px; stroke-width: 1.9; }
.brand-logo { display: block; width: 100%; height: 100%; }
.header-share { color: var(--blue); }
.header-copy { min-width: 0; }
.app-name {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.app-context {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-actions { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.header-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: var(--ink-2);
  transition: background .15s ease, color .15s ease;
}
.header-icon svg { width: 19px; height: 19px; }
.header-icon:hover { background: var(--blue-50); color: var(--blue); }
.header-icon:active { background: var(--blue-100); }
.header-icon.is-blue { color: var(--blue); }
.header-add { background: var(--blue); color: #fff; box-shadow: 0 3px 8px rgba(37, 99, 235, .16); }
.header-add:hover { background: var(--blue-600); color: #fff; }
.header-add:active { background: var(--blue-700); }

/* Page layout */
.page { padding: 16px 18px 24px; }
.page--flush { padding: 0 0 24px; }
.section { margin-top: 18px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-title { margin: 0; color: var(--ink); font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.section-sub { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 600;
}
.section-link svg { width: 13px; height: 13px; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.amount { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-primary:active { background: var(--blue-700); }
.btn-secondary { border-color: var(--line-strong); background: #fff; color: var(--ink-2); }
.btn-secondary:hover { border-color: var(--blue-200); color: var(--blue); background: var(--blue-50); }
.btn-ghost { background: var(--blue-50); color: var(--blue); }
.btn-ghost:hover { background: var(--blue-100); }
.btn-danger { border-color: #f3caca; background: #fff; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 12px; border-radius: 8px; font-size: 12px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 2px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}
.text-btn svg { width: 15px; height: 15px; }
.danger-text { color: var(--red); }

/* Month selector */
.month-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.month-picker svg { width: 14px; height: 14px; color: var(--muted); }
.month-picker:active { background: var(--blue-50); border-color: var(--blue-200); }
.month-picker--inline { height: 30px; }

/* Summary card */
.summary-card {
  padding: 16px;
  border: 1px solid #e1e9fa;
  border-radius: 16px;
  background: #f5f8ff;
}
.summary-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.summary-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #506079;
  font-size: 12px;
  font-weight: 600;
}
.summary-label .dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}
.summary-amount {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 7px;
  color: var(--ink);
}
.summary-amount .currency { color: var(--ink-2); font-size: 17px; font-weight: 650; }
.summary-amount .value { font-size: 34px; font-weight: 760; line-height: 1.05; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.summary-amount .decimals { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.summary-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 9px; color: var(--muted); font-size: 11.5px; }
.meta-sep { width: 1px; height: 10px; background: #ced8e8; }
.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.trend svg { width: 11px; height: 11px; stroke-width: 2; }
.trend.is-up { background: #fff0ee; color: #c2413b; }
.trend.is-down { background: var(--green-soft); color: var(--green); }
.summary-actions { display: flex; gap: 8px; margin-top: 14px; }
.summary-actions .btn { height: 38px; font-size: 13px; border-radius: 9px; }
.summary-actions .btn-primary { flex: 1.1; }
.summary-actions .btn-secondary { flex: 1; background: #fff; border-color: #d5e0f4; color: #31517e; }
.summary-actions .btn-secondary:hover { background: #fff; border-color: var(--blue); color: var(--blue); }

/* Search */
.search-wrap { position: relative; margin: 12px 0 0; }
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.search-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.search-field svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--muted); }
.search-field input {
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}
.search-field input::placeholder { color: var(--muted-2); }
.search-field input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.search-clear {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eef2f8;
  color: var(--muted);
}
.search-clear svg { width: 13px; height: 13px; }

/* Flow list */
.date-group { margin-top: 15px; }
.date-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 1px 7px;
  color: var(--muted);
  font-size: 11px;
}
.date-head strong { color: var(--ink-2); font-size: 11.5px; font-weight: 650; }
.date-total { color: var(--muted); font-variant-numeric: tabular-nums; }
.flow-list { border-top: 1px solid var(--line); }
.section-actions { display: flex; align-items: center; gap: 12px; }
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 0 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.bulk-check { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 11.5px; }
.bulk-check input,
.flow-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}
.bulk-count { flex: 1; }
.bulk-bar .btn { min-height: 32px; padding: 0 12px; font-size: 11px; }
.bulk-bar .btn:disabled { opacity: .45; cursor: not-allowed; }
.flow-check {
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  align-self: stretch;
  cursor: pointer;
}
.flow-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding-right: 2px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: background .12s ease;
}
.flow-row:hover { background: #fbfcff; }
.flow-open {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 64px;
  padding: 10px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.flow-open:active { background: var(--blue-50); }
.flow-delete {
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.flow-delete:hover { background: #fff1f2; color: #be123c; }
.flow-delete:active { background: #ffe4e6; }
.product-avatar {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}
.product-avatar--green { background: #eef9f5; color: #0b8f67; }
.product-avatar--amber { background: #fff8ea; color: #a45d08; }
.product-avatar--slate { background: #f1f4f8; color: #52647c; }
.flow-main { flex: 1; min-width: 0; }
.flow-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-sub {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-sub .sub-sep { margin: 0 4px; color: #cbd5e1; }
.flow-side { flex: 0 0 auto; text-align: right; }
.flow-amount { display: block; color: var(--ink); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.flow-qty { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 20px;
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--blue-50);
  color: var(--blue);
}
.empty-icon svg { width: 23px; height: 23px; }
.empty-title { margin: 0; font-size: 13.5px; font-weight: 650; }
.empty-desc { margin: 5px 0 14px; color: var(--muted); font-size: 11.5px; line-height: 1.55; }

/* Stats */
.stats-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stats-hero {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.stats-hero-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.stats-hero-value { margin-top: 5px; color: var(--ink); font-size: 31px; font-weight: 760; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stats-hero-value .currency { font-size: 16px; font-weight: 650; }
.stats-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 15px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.stat-kpi { padding: 0 12px; border-left: 1px solid var(--line); }
.stat-kpi:first-child { padding-left: 0; border-left: 0; }
.stat-kpi:last-child { padding-right: 0; }
.stat-kpi-label { color: var(--muted); font-size: 10.5px; }
.stat-kpi-value { margin-top: 4px; color: var(--ink-2); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-kpi-value small { margin-left: 1px; color: var(--muted); font-size: 9.5px; font-weight: 500; }

.card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.card + .card { margin-top: 12px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { margin: 0; color: var(--ink); font-size: 13.5px; font-weight: 700; }
.card-sub { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}
.legend i { width: 6px; height: 6px; border-radius: 2px; background: var(--blue); }
.legend i.is-empty { background: #dce6f8; }

.chart-wrap { position: relative; margin-top: 14px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-axis { fill: var(--muted-2); font-size: 8.5px; font-family: var(--font); }
.chart-grid { stroke: #e9eef6; stroke-width: 1; stroke-dasharray: none; }
.chart-bar { fill: var(--blue); stroke: none; }
.chart-bar-empty { fill: #e8effb; stroke: none; }
.chart-bar:hover { fill: var(--blue-700); }
.chart-caption { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 10px; }

.category-list { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.category-row { display: grid; grid-template-columns: 70px 1fr 64px; align-items: center; gap: 9px; }
.category-name { color: var(--ink-2); font-size: 11.5px; font-weight: 550; white-space: nowrap; }
.category-track { display: block; height: 6px; overflow: hidden; border-radius: 4px; background: #eef3fb; }
.category-fill { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
.category-value { text-align: right; color: var(--ink-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.category-value small { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; font-weight: 500; }
.rank-list { margin: 5px 0 0; padding: 0; list-style: none; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f4f9; }
.rank-row:last-child { border-bottom: 0; padding-bottom: 0; }
.rank-no { display: grid; place-items: center; width: 18px; height: 18px; flex: 0 0 18px; border-radius: 5px; background: #f1f5fb; color: var(--muted); font-size: 9.5px; font-weight: 700; }
.rank-row:nth-child(1) .rank-no { background: var(--blue); color: #fff; }
.rank-row:nth-child(2) .rank-no { background: #dbe7ff; color: var(--blue-600); }
.rank-row:nth-child(3) .rank-no { background: #eaf0fb; color: #426188; }
.rank-main { flex: 1; min-width: 0; }
.rank-name { display: block; overflow: hidden; color: var(--ink-2); font-size: 11.5px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.rank-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.rank-value { color: var(--ink); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* Import page */
.import-card {
  padding: 16px;
  border: 1px dashed #b9cdf5;
  border-radius: 14px;
  background: #f8faff;
}
.import-card.is-ready { border-style: solid; border-color: #d7e2f5; background: #fff; }
.import-head { display: flex; gap: 11px; align-items: flex-start; }
.import-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  background: #e9f0ff;
  color: var(--blue);
}
.import-icon svg { width: 20px; height: 20px; }
.import-copy { flex: 1; min-width: 0; }
.import-title { margin: 1px 0 0; font-size: 13.5px; font-weight: 700; }
.import-desc { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.import-file {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--green-soft);
  color: #087a56;
  font-size: 10px;
  line-height: 1.4;
}
.import-file svg { width: 14px; height: 14px; flex: 0 0 14px; }
.import-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-actions { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.import-actions .btn { height: 38px; border-radius: 9px; font-size: 12px; }
.import-actions .btn-primary { flex: 1; }
.import-actions .btn-secondary { flex: 0 0 auto; padding: 0 11px; }
.import-hint { margin-top: 8px; color: var(--muted-2); font-size: 9.5px; line-height: 1.5; }

.formula-card {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid #e5ecf7;
  border-radius: 10px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 10px;
}
.formula-card svg { width: 14px; height: 14px; flex: 0 0 14px; color: var(--blue); }
.formula-chip { padding: 3px 6px; border-radius: 5px; background: #eef4ff; color: var(--blue-700); font-weight: 650; white-space: nowrap; }
.formula-eq { color: var(--muted-2); font-weight: 600; }
.formula-result { color: var(--ink-2); font-weight: 600; }

.price-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.price-count { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.product-price-list { margin-top: 8px; border-top: 1px solid var(--line); }
.price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.price-main { flex: 1; min-width: 0; }
.price-name { display: block; overflow: hidden; color: var(--ink); font-size: 12.5px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.price-spec { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.price-value { text-align: right; color: var(--ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-value small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 500; }
.show-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 40px;
  margin-top: 5px;
  border-radius: 9px;
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 600;
}
.show-more:hover { background: var(--blue-50); }
.show-more svg { width: 14px; height: 14px; }

/* Export page */
.export-summary { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.export-summary-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.export-period { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.export-period svg { width: 15px; height: 15px; color: var(--muted); }
.export-total { margin-top: 10px; color: var(--ink); font-size: 30px; font-weight: 760; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.export-total .currency { margin-right: 2px; font-size: 15px; font-weight: 650; }
.export-counts { display: flex; gap: 12px; margin-top: 7px; color: var(--muted); font-size: 10.5px; }
.export-counts span { display: inline-flex; align-items: center; gap: 4px; }
.export-counts i { width: 3px; height: 3px; border-radius: 50%; background: #b7c4d6; }

.form-card { margin-top: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.form-card-title { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.form-card-desc { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.option-list { margin-top: 9px; }
.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  border-top: 1px solid #f0f4f9;
  cursor: pointer;
}
.option-row:first-child { border-top: 0; }
.option-row input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1.5px solid #c9d4e2;
  border-radius: 5px;
  background: #fff;
  color: #fff;
  transition: background .12s ease, border-color .12s ease;
}
.checkbox svg { width: 12px; height: 12px; stroke-width: 2.4; opacity: 0; }
.option-row input:checked + .checkbox { border-color: var(--blue); background: var(--blue); }
.option-row input:checked + .checkbox svg { opacity: 1; }
.option-copy { flex: 1; min-width: 0; }
.option-name { display: block; color: var(--ink-2); font-size: 12px; font-weight: 550; }
.option-desc { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.option-count { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.field-label { display: block; margin: 14px 0 6px; color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.share-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e5ecf7;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
}
.share-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 14px;
  box-shadow: 0 5px 14px rgba(37, 99, 235, .16);
}
.share-card strong { display: block; color: var(--ink); font-size: 14px; }
.share-card p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.share-link-row { display: flex; align-items: center; gap: 8px; }
.share-link-row .input { flex: 1; min-width: 0; font-size: 10.5px; }
.share-link-row .btn { flex: 0 0 auto; min-height: 40px; }

/* APP install entry */
.install-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid #e1e9fa;
  border-radius: 12px;
  background: #f7f9fe;
}
.install-entry-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  background: #e9f0ff;
  color: var(--blue);
}
.install-entry-icon svg { width: 18px; height: 18px; }
.install-entry-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.install-entry-copy strong { color: var(--ink-2); font-size: 12px; font-weight: 650; }
.install-entry-copy span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.install-entry-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.install-entry-btn:active { background: var(--blue-600); }
.install-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e5ecf7;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
}
.install-hero strong { display: block; color: var(--ink); font-size: 14px; }
.install-hero p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.install-steps { display: flex; flex-direction: column; gap: 15px; margin: 17px 0 0; padding: 0; list-style: none; }
.install-steps li { display: flex; align-items: flex-start; gap: 10px; }
.install-step-num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  background: var(--blue-50);
  color: var(--blue);
  font-size: 10.5px;
  font-weight: 700;
}
.install-steps strong { color: var(--ink-2); font-size: 11.5px; font-weight: 650; }
.install-steps p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.55; }
.filename-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
}
.filename-field svg { width: 16px; height: 16px; color: var(--muted); }
.filename-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink-2); font-size: 11.5px; }
.filename-field span { color: var(--muted-2); font-size: 10.5px; }
.format-fixed { display: flex; align-items: center; justify-content: space-between; height: 42px; margin-top: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.format-fixed strong { color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.format-fixed span { color: var(--muted); font-size: 10px; }
.export-btn-wrap { margin-top: 14px; }
.export-note { margin: 9px 0 0; color: var(--muted-2); font-size: 9.5px; line-height: 1.55; text-align: center; }
.success-card {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #cbe9dd;
  border-radius: 12px;
  background: #f4fbf8;
}
.success-card > svg { width: 19px; height: 19px; flex: 0 0 19px; color: var(--green); margin-top: 1px; }
.success-copy { flex: 1; min-width: 0; }
.success-title { margin: 0; color: #086c4e; font-size: 11.5px; font-weight: 650; }
.success-file { margin: 3px 0 0; overflow: hidden; color: #39755f; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.export-history { margin-top: 8px; border-top: 1px solid var(--line); }
.export-history-row { display: flex; align-items: center; gap: 9px; min-height: 50px; padding: 8px 0; border-bottom: 1px solid #f0f4f9; }
.export-history-row:last-child { border-bottom: 0; }
.export-history-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; background: #f2f6fd; color: var(--blue); }
.export-history-icon svg { width: 15px; height: 15px; }
.export-history-main { flex: 1; min-width: 0; }
.export-history-name { display: block; overflow: hidden; color: var(--ink-2); font-size: 10.5px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.export-history-date { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.export-history-action { padding: 5px; color: var(--blue); font-size: 10px; font-weight: 600; }

/* Bottom sheet */
.sheet-root {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  background: rgba(15, 23, 42, .35);
  animation: fade-in .18s ease both;
}
.sheet-root.is-closing { animation: fade-out .16s ease both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
.sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100% - 38px);
  overflow: hidden;
  border-radius: 18px 18px 0 0;
  background: #fff;
  box-shadow: 0 -8px 28px rgba(15, 23, 42, .12);
  animation: sheet-up .23s cubic-bezier(.2, .8, .25, 1) both;
  scrollbar-width: none;
}
.sheet::-webkit-scrollbar { display: none; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .7; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle { width: 34px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: #dce4ee; }
.sheet-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.sheet-heading { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.sheet-sub { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.sheet-close { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; margin-top: -2px; border-radius: 50%; background: #f1f4f9; color: var(--muted); }
.sheet-close svg { width: 15px; height: 15px; }
.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 15px 18px calc(18px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
.sheet-body::-webkit-scrollbar { display: none; }
.sheet-footer { display: flex; flex: 0 0 auto; gap: 9px; padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.sheet-footer .btn { flex: 1; }
.month-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 10px 12px; }
.month-option { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 48px; padding: 0 12px; border-radius: 9px; color: var(--ink-2); font-size: 13px; text-align: left; }
.month-option:hover { background: #f7f9fd; }
.month-option.is-active { background: var(--blue-50); color: var(--blue); font-weight: 650; }
.month-option svg { width: 17px; height: 17px; }
.month-option small { margin-left: 6px; color: var(--muted); font-size: 10px; font-weight: 400; }

/* Flow import shortcut */
.flow-import-panel {
  margin: -2px 0 16px;
  padding: 10px;
  border: 1px solid #e1e9fa;
  border-radius: 10px;
  background: #f7f9fe;
}
.flow-import-head { display: flex; align-items: center; gap: 9px; }
.flow-import-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: #e9f0ff;
  color: var(--blue);
}
.flow-import-icon svg { width: 16px; height: 16px; }
.flow-import-copy { flex: 1; min-width: 0; }
.flow-import-copy strong { display: block; color: var(--ink-2); font-size: 11.5px; font-weight: 650; line-height: 1.3; }
.flow-import-copy p { margin: 2px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.flow-import-actions { display: flex; align-items: center; gap: 6px; margin-top: 9px; }
.flow-template-link { margin-left: auto; padding: 6px 3px; color: var(--blue); font-size: 10px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.flow-template-link:hover { text-decoration: underline; }
.flow-import-actions .btn { flex: 1; height: 32px; padding: 0 7px; border-radius: 7px; font-size: 10.5px; }
.flow-import-actions .btn svg { width: 13px; height: 13px; }
.flow-import-errors { margin-top: 14px; border-top: 1px solid var(--line); }
.flow-import-errors-head { padding: 11px 0 4px; color: var(--ink-2); font-size: 11px; font-weight: 650; }
.flow-import-error-row { display: flex; gap: 8px; padding: 6px 0; border-top: 1px solid #f2f5fa; color: var(--muted); font-size: 10px; line-height: 1.45; }
.flow-import-error-row span:first-child { flex: 0 0 50px; color: var(--ink-2); }
.flow-import-error-row span:last-child { flex: 1; }

/* Image recognition */
.ocr-preview {
  display: block;
  width: 100%;
  max-height: 158px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fc;
}
.ocr-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px 22px;
  text-align: center;
}
.spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--blue-100);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ocr-status-title { margin: 0; color: var(--ink-2); font-size: 12px; font-weight: 650; }
.ocr-status-desc { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.ocr-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 4px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.ocr-map-panel {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #e1e9fa;
  border-radius: 10px;
  background: #f7f9fe;
}
.ocr-map-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ocr-map-head strong { color: var(--ink-2); font-size: 11px; font-weight: 650; }
.ocr-map-head span { color: var(--muted); font-size: 9px; }
.ocr-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 142px;
  margin-top: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.ocr-chip {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid #d9e4f5;
  border-radius: 5px;
  background: #fff;
  color: var(--ink-2);
  font-size: 9.5px;
  line-height: 1.4;
  text-align: left;
  cursor: grab;
  white-space: normal;
  overflow-wrap: anywhere;
}
.ocr-chip:active { cursor: grabbing; background: var(--blue-50); }
.ocr-chip.is-dragging { opacity: .45; }
.ocr-manual-note {
  margin: 10px 0 0;
  padding: 9px 10px;
  border: 1px solid #e5ecf7;
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.ocr-dragover { border-color: var(--blue) !important; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.ocr-summary-title { margin: 0; color: var(--ink-2); font-size: 12px; font-weight: 650; }
.ocr-summary-sub { margin: 3px 0 0; color: var(--muted); font-size: 9.5px; }
.ocr-row-card {
  margin-top: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfdff;
}
.ocr-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ocr-candidate { color: var(--muted); font-size: 9.5px; font-weight: 600; }
.ocr-confidence { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; padding: 2px 5px; border-radius: 4px; background: var(--green-soft); color: #087a56; font-size: 9px; font-weight: 600; }
.ocr-confidence.is-medium { background: #fff7e8; color: #a45d08; }
.ocr-confidence.is-low { background: var(--red-soft); color: #b4232a; }
.ocr-remove { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: var(--muted); }
.ocr-remove:hover { background: var(--red-soft); color: var(--red); }
.ocr-remove svg { width: 14px; height: 14px; }
.ocr-fields { display: grid; grid-template-columns: 1fr 88px; gap: 7px; margin-top: 8px; }
.ocr-field--full { grid-column: 1 / -1; }
.ocr-field-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.ocr-field-hint { margin-left: 4px; color: var(--muted-2); font-size: 8px; font-weight: 400; }
.ocr-price-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9.5px;
}
.ocr-price-label { color: var(--muted); }
.ocr-price-status { color: var(--green); font-size: 10.5px; font-weight: 650; }
.ocr-price-status.is-pending { color: #b45309; }
.ocr-price-status.is-missing { color: #b4232a; }
.ocr-input {
  width: 100%;
  height: 35px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-2);
  font-size: 11px;
  outline: 0;
}
.ocr-input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37, 99, 235, .08); }
.ocr-price-wrap {
  display: flex;
  align-items: center;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}
.ocr-price-wrap > span { padding-left: 9px; color: var(--muted); font-size: 11px; }
.ocr-price-wrap .ocr-input { height: 33px; border: 0; padding-left: 4px; }
.ocr-price-wrap .ocr-input:focus { box-shadow: none; }
.ocr-expense-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 8px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed #e8edf5;
  color: var(--muted);
  font-size: 9.5px;
}
.ocr-expense-label strong { color: var(--ink-2); font-size: 10.5px; font-weight: 650; }
.ocr-expense-computed { text-align: right; }
.ocr-expense-diff {
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--red-soft);
  color: #b4232a;
  font-size: 8.5px;
  white-space: nowrap;
}
.ocr-expense-ok {
  margin-left: 4px;
  color: var(--green);
  font-size: 8.5px;
  white-space: nowrap;
}
.ocr-raw {
  margin: 7px 0 0;
  padding-top: 6px;
  border-top: 1px dashed #e8edf5;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ocr-text-details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.ocr-text-details summary { color: var(--blue); font-size: 10.5px; font-weight: 600; cursor: pointer; }
.ocr-text-details pre {
  max-height: 150px;
  margin: 8px 0 0;
  padding: 9px;
  overflow: auto;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-family: var(--font);
  font-size: 9.5px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.ocr-error {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #f2cccc;
  border-radius: 9px;
  background: var(--red-soft);
  color: #a52b31;
  font-size: 10.5px;
  line-height: 1.55;
}
.ocr-service-note { margin: 9px 0 0; color: var(--muted-2); font-size: 9px; line-height: 1.5; }

/* Forms */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.field .field-extra { color: var(--muted); font-size: 9.5px; font-weight: 400; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input, .select { height: 42px; padding: 0 11px; }
.textarea { min-height: 66px; padding: 10px 11px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.select-wrap { position: relative; }
.select-wrap .select { appearance: none; padding-right: 32px; }
.select-wrap > svg { position: absolute; right: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.qty-stepper { display: flex; align-items: center; height: 42px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.qty-btn { display: grid; place-items: center; width: 42px; height: 100%; color: var(--ink-2); font-size: 20px; font-weight: 400; }
.qty-btn:hover { background: var(--blue-50); color: var(--blue); }
.qty-input { width: 100%; min-width: 0; height: 100%; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); outline: 0; color: var(--ink); font-size: 14px; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-box { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border-radius: 9px; background: var(--blue-50); }
.calc-label { color: #4c6180; font-size: 10.5px; }
.calc-value { color: var(--blue-700); font-size: 19px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.calc-breakdown { margin-top: 5px; color: var(--muted); font-size: 9.5px; line-height: 1.45; }

/* Detail sheet */
.detail-top { display: flex; align-items: center; gap: 11px; padding: 3px 0 14px; border-bottom: 1px solid var(--line); }
.detail-top .product-avatar { width: 42px; height: 42px; flex-basis: 42px; border-radius: 11px; font-size: 14px; }
.detail-name { margin: 0; font-size: 15px; font-weight: 700; }
.detail-spec { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; }
.detail-amount { display: flex; align-items: baseline; justify-content: space-between; margin: 15px 0; }
.detail-amount span { color: var(--muted); font-size: 11px; }
.detail-amount strong { color: var(--ink); font-size: 24px; font-weight: 760; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.detail-list { margin: 0; }
.detail-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px solid #f0f4f9; }
.detail-item dt { color: var(--muted); font-size: 11px; }
.detail-item dd { margin: 0; color: var(--ink-2); font-size: 11.5px; font-weight: 550; text-align: right; font-variant-numeric: tabular-nums; }
.detail-note { margin: 12px 0 0; padding: 10px; border-radius: 8px; background: #f8fafc; color: var(--ink-2); font-size: 10.5px; line-height: 1.55; }
.danger-zone { margin-top: 3px; }

/* Toast */
.toast-root { position: absolute; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 12px); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 7px; pointer-events: none; padding: 0 18px; transition: top .15s ease; }
.sheet-root:not([hidden]) ~ .toast-root { top: calc(var(--statusbar-h) + 58px + 8px); bottom: auto; }
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(15, 23, 42, .92);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.4;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
  animation: toast-in .22s ease both;
  pointer-events: auto;
}
.toast svg { width: 15px; height: 15px; flex: 0 0 15px; }
.toast.is-success svg { color: #6ee7b7; }
.toast.is-error svg { color: #fca5a5; }
.toast.is-out { animation: toast-out .18s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* Small phones and desktop scaling */
@media (max-width: 480px) {
  body { background: #fff; display: block; }
  .phone-stage { display: block; padding: 0; min-height: 100dvh; }
  .phone-frame {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}
@media (max-height: 700px) and (min-width: 481px) {
  .phone-frame { height: calc(100dvh - 16px); min-height: 560px; border-radius: 26px; }
  .phone-stage { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Phone / WeChat: use the full viewport instead of the desktop phone mockup. */
@media (max-width: 600px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body { background: var(--surface); }

  .phone-stage {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
  }

  .phone-frame {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .status-bar { display: none; }

  .app-viewport { padding-top: env(safe-area-inset-top); }

  .tabbar {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}

/* Accessibility helpers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
