:root {
  --navy: #020c1c;
  --blue: #1b2529;
  --teal: #88b541;
  --ink: #172033;
  --muted: #667386;
  --line: #dfe5df;
  --surface: #ffffff;
  --canvas: #f4f6f3;
  --input: #f1f5ee;
  --formula: #edf6e5;
  --warning: #fff4d6;
  --danger: #fee8e7;
  --success: #eaf5e1;
  --shadow: 0 16px 42px rgba(2, 12, 28, 0.09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Segoe UI", "Microsoft YaHei UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(20,125,131,.2); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 22px;
  background: linear-gradient(180deg, #061424 0%, #020c1c 100%);
  color: #fff;
  z-index: 20;
}
.brand { display: block; padding: 0 10px 30px; }
.brand-logo { display: block; width: 164px; height: auto; }
.brand-subtitle { display: block; margin-top: 10px; color: #93a0ac; font-size: 9px; font-weight: 750; letter-spacing: .2em; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; background: #fff; color: var(--navy); font-weight: 900; font-size: 20px; box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 17px; letter-spacing: 0.08em; }
.brand span { margin-top: 2px; color: #a9bdd3; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.nav-list { display: grid; gap: 7px; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  color: #c4d2df; background: transparent; border: 0; border-radius: 12px; text-align: left;
}
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,0.105); }
.nav-item.active { box-shadow: inset 3px 0 0 var(--teal); }
.nav-icon { width: 22px; font-weight: 800; text-align: center; }
.sidebar-note { margin-top: auto; padding: 16px; border: 1px solid rgba(255,255,255,.13); border-radius: 16px; background: rgba(255,255,255,.065); }
.sidebar-note strong { display: block; margin: 5px 0; }
.sidebar-note p { color: #b9c9da; font-size: 12px; line-height: 1.55; }
.sidebar-note .eyebrow, .sidebar-note .text-button { color: #acd56b; }
.sidebar-scrim { display: none; }

.main-content { grid-column: 2; min-width: 0; padding: 0 34px 46px; }
.topbar {
  min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  position: sticky; top: 0; z-index: 10; background: rgba(243,246,248,.92); backdrop-filter: blur(14px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.breadcrumb { margin: 0 0 5px; color: #8290a0; font-size: 12px; }
.breadcrumb span { padding: 0 3px; color: #a5b0bc; }
.breadcrumb b { color: var(--blue); font-weight: 650; }
h1 { margin: 0; font-size: 25px; letter-spacing: -.025em; }
h2, h3, p { margin-top: 0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.team-tools { display: flex; align-items: center; gap: 7px; }
.team-sync-status { min-width: 128px; height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(18,53,84,.03); }
.team-sync-status i { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #8b97a5; box-shadow: 0 0 0 4px rgba(139,151,165,.12); }
.team-sync-status span, .team-sync-status strong, .team-sync-status small { display: block; min-width: 0; }
.team-sync-status strong { color: var(--ink); font-size: 10px; line-height: 1.2; }
.team-sync-status small { max-width: 118px; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 8px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.team-sync-status[data-tone="synced"] i { background: #6e9f2e; box-shadow: 0 0 0 4px rgba(110,159,46,.14); }
.team-sync-status[data-tone="syncing"] i, .team-sync-status[data-tone="pending"] i { background: #d69a25; box-shadow: 0 0 0 4px rgba(214,154,37,.14); animation: syncPulse 1s ease infinite; }
.team-sync-status[data-tone="error"] i, .team-sync-status[data-tone="conflict"] i { background: #d24a43; box-shadow: 0 0 0 4px rgba(210,74,67,.14); }
.team-sync-status[data-tone="auth"] i { background: #517caa; box-shadow: 0 0 0 4px rgba(81,124,170,.14); }
.team-user { max-width: 120px; overflow: hidden; color: #5d6978; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.team-logout { padding: 4px 6px; border: 0; color: #687585; background: transparent; font-size: 9px; font-weight: 700; }
@keyframes syncPulse { 50% { opacity: .45; transform: scale(.82); } }
.search-box { height: 42px; min-width: 248px; display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(18,53,84,.03); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); }
.button { min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; font-weight: 700; }
.button.primary { color: #102000; background: var(--teal); box-shadow: 0 6px 16px rgba(136,181,65,.22); }
.button.secondary { color: #3f6014; background: #edf5e4; }
.button.ghost { color: var(--blue); border-color: var(--line); background: #fff; }
.button.light { color: var(--navy); background: #fff; }
.button.outline-light { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; }
.button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(18,53,84,.12); }
.icon-button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: #eef3f7; color: var(--navy); font-size: 22px; }
.mobile-menu { display: none; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--blue); font-weight: 700; }

.team-auth-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(2,12,28,.76); backdrop-filter: blur(12px); }
.team-auth-gate[hidden] { display: none; }
.team-auth-card { width: min(460px, 100%); padding: 34px; border: 1px solid rgba(255,255,255,.28); border-radius: 24px; background: #fff; box-shadow: 0 28px 90px rgba(0,0,0,.28); }
.team-auth-brand { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 28px; padding-bottom: 17px; border-bottom: 1px solid #e5ebe1; }
.team-auth-brand strong { color: var(--navy); font-size: 25px; font-weight: 900; letter-spacing: .055em; }
.team-auth-brand span { color: #6e9637; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.team-auth-card h2 { margin: 7px 0 8px; color: var(--ink); font-size: 25px; }
.team-auth-card > p { margin-bottom: 22px; color: var(--muted); line-height: 1.65; }
.team-auth-card form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; }
.team-auth-card label { display: grid; gap: 7px; color: #536274; font-size: 11px; font-weight: 700; }
.team-auth-card input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid #ccd8e4; border-radius: 11px; background: #fff; }
.team-auth-message { min-height: 38px; margin-top: 14px; padding: 10px 12px; border-radius: 10px; color: #4c672a; background: #f0f7e8; font-size: 11px; }
.team-auth-card > small { display: block; margin-top: 14px; color: #8994a0; line-height: 1.5; }
.auth-locked .app-shell { filter: saturate(.72); }

.view { display: none; }
.view.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: .5; transform: translateY(3px); } }
.hero-panel {
  min-height: 232px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px;
  padding: 36px; border-radius: 24px; color: #fff;
  background: linear-gradient(125deg, #020c1c 0%, #17252b 58%, #34471c 100%);
  box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.hero-panel::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6,28,48,.16), transparent 52%); }
.hero-panel::after { content: ""; position: absolute; width: 330px; height: 330px; right: -70px; top: -170px; border: 48px solid rgba(255,255,255,.055); border-radius: 50%; }
.hero-panel > * { position: relative; z-index: 1; }
.hero-copy { max-width: 800px; }
.hero-kicker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-status { padding: 4px 9px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: #d8eef1; background: rgba(255,255,255,.08); font-size: 10px; }
.hero-panel h2 { max-width: 760px; margin: 10px 0 10px; font-size: clamp(28px, 3vw, 40px); line-height: 1.16; letter-spacing: -.045em; }
.hero-panel p { max-width: 760px; margin-bottom: 0; color: #dbe8f4; line-height: 1.7; }
.hero-proof { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 20px; color: #eef8fa; font-size: 12px; font-weight: 650; }
.hero-proof span::before { content: "\2713"; display: inline-grid; place-items: center; width: 17px; height: 17px; margin-right: 7px; border-radius: 50%; color: #1d3100; background: #acd56b; font-size: 10px; font-weight: 900; }
.hero-actions { display: flex; gap: 10px; white-space: nowrap; }
.eyebrow { color: #668f2c; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.light { color: #b7df7a; }

.channel-principles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.channel-principles article { min-width: 0; display: flex; gap: 12px; padding: 15px 16px; border: 1px solid #e4ebf0; border-radius: 15px; background: rgba(255,255,255,.88); box-shadow: 0 6px 18px rgba(18,53,84,.035); }
.channel-principles strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 13px; }
.channel-principles p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.channel-code { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--blue); font-weight: 850; }
.channel-code.amazon { background: #020c1c; }
.channel-code.cstore { background: #4d5c61; }
.channel-code.bstore { color: #1d3100; background: var(--teal); }
.channel-code.tiktok { background: #273542; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.kpi-card { padding: 20px; border: 1px solid #e5ebef; border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 22px rgba(18,53,84,.045); }
.kpi-card-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.kpi-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: #eaf2f9; font-weight: 800; }
.kpi-card strong { display: block; margin: 16px 0 4px; font-size: 30px; letter-spacing: -.04em; }
.kpi-card small { color: var(--muted); }
.kpi-card.risk .kpi-icon { color: #a4492f; background: var(--danger); }
.kpi-card.done .kpi-icon { color: #26713f; background: var(--success); }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel { border: 1px solid #e6ebf0; border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(26,54,93,.045); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px 14px; }
.panel-header h3 { margin: 4px 0 0; font-size: 17px; }
.channel-progress { padding: 4px 22px 22px; display: grid; gap: 15px; }
.progress-row { display: grid; grid-template-columns: 120px 1fr 48px; align-items: center; gap: 14px; }
.progress-row strong { font-size: 13px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #edf1f4; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #688f31, #a8d461); }
.progress-row span { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.threshold-control { padding: 6px 22px 24px; }
.threshold-value { display: flex; align-items: baseline; justify-content: space-between; }
.threshold-value span { font-size: 36px; font-weight: 800; color: var(--blue); }
.threshold-value small, .range-labels { color: var(--muted); }
.threshold-control input { width: 100%; accent-color: var(--teal); }
.range-labels { display: flex; justify-content: space-between; font-size: 11px; }
.threshold-help { margin: 14px 0 0; padding-top: 13px; border-top: 1px solid #edf1f4; color: var(--muted); font-size: 11px; line-height: 1.55; }

.view-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin: 6px 0 20px; padding: 22px 24px; border: 1px solid #e2e9ee; border-radius: var(--radius); background: linear-gradient(110deg, #fff 0%, #f6fafb 100%); }
.view-intro h2 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.025em; }
.view-intro > p { max-width: 460px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.formula-note { display: flex; gap: 14px; margin: 6px 0 18px; padding: 17px 19px; border: 1px solid #d8e5cc; border-radius: 15px; background: #f3f8ee; }
.formula-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--teal); font-weight: 800; }
.formula-note strong { display: block; margin-bottom: 3px; color: #45651c; }
.formula-note p { margin: 0; color: #607052; font-size: 12px; line-height: 1.65; }

.section-toolbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.filter-row, .channel-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
select, input { border: 1px solid #ccd7e3; border-radius: 8px; background: #fff; color: var(--ink); }
.filter-row select { min-width: 140px; height: 38px; padding: 0 12px; }
.toolbar-meta, .subtle { color: var(--muted); font-size: 12px; }
.channel-tab { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; }
.channel-tab.active { color: #fff; background: var(--blue); border-color: var(--blue); }
.table-panel { overflow: hidden; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1080px; }
th { position: sticky; top: 0; z-index: 2; padding: 13px 14px; color: #35516c; background: #edf3f6; border-bottom: 1px solid #dce5eb; font-size: 11px; letter-spacing: .02em; text-align: left; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #e9eef3; white-space: nowrap; vertical-align: middle; }
tbody tr:hover { background: #f8fafc; }
.compact-table table { min-width: 820px; }
.compact-table tbody tr:last-child td { border-bottom: 0; }
.product-name { display: grid; gap: 3px; }
.product-name strong { color: var(--ink); }
.product-name small { color: var(--muted); }
.money { font-variant-numeric: tabular-nums; font-weight: 650; }
.muted { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { color: #477020; background: var(--success); }
.badge.warning { color: #8a5a00; background: var(--warning); }
.badge.danger { color: #a13c33; background: var(--danger); }
.badge.neutral { color: #5f6d7c; background: #edf1f4; }
.row-action { padding: 5px 8px; border: 0; border-radius: 7px; color: var(--blue); background: transparent; font-weight: 700; }
.row-action:hover { background: #eaf2f7; }
.inline-select { min-width: 92px; padding: 6px 8px; background: var(--input); }
.price-cell.low { color: #a13c33; background: #fff7f6; }
.review-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.review-card { padding: 22px; border-radius: var(--radius); color: #fff; background: var(--navy); }
.review-card.warning { background: #9a641a; }
.review-card.missing { background: #53616a; }
.review-card.success { color: #182500; background: #9ac959; }
.review-card strong { display: block; margin-top: 8px; font-size: 28px; }
.review-header { padding-bottom: 18px; }
.empty-state { padding: 42px 20px; color: var(--muted); text-align: center; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(8,28,48,.65); backdrop-filter: blur(6px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(1120px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
#productForm { min-height: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.modal-header, .modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 4px 0 0; }
.modal-body { min-height: 0; flex: 1; padding: 22px 24px 28px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: #f8fafc; scrollbar-gutter: stable; }
.modal-body::-webkit-scrollbar { width: 10px; }
.modal-body::-webkit-scrollbar-track { background: #edf1ec; }
.modal-body::-webkit-scrollbar-thumb { border: 2px solid #edf1ec; border-radius: 999px; background: #9cac91; }
.form-section { margin-bottom: 16px; padding: 20px; border: 1px solid #e3eaf1; border-radius: 14px; background: #fff; }
.form-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.form-section-title > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--blue); font-weight: 800; }
.form-section-title h3 { margin: 0; }
.form-section-title p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.form-section-title output { margin-left: auto; padding: 7px 10px; border-radius: 8px; color: #26713f; background: var(--formula); font-weight: 700; }
.form-grid { display: grid; gap: 14px; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.form-grid label { display: grid; gap: 6px; color: #536274; font-size: 12px; font-weight: 650; }
.form-grid label[hidden], [hidden] { display: none !important; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; padding: 0 10px; }
.form-grid input, .form-grid select { height: 40px; }
.form-grid textarea { min-height: 82px; padding-top: 9px; padding-bottom: 9px; resize: vertical; line-height: 1.5; }
.variant-manager { grid-column: 1 / -1; padding: 14px; border: 1px solid #dce7d2; border-radius: 12px; background: #f8fbf5; }
.variant-manager-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.variant-manager-head strong { color: var(--ink); }
.variant-manager-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.button.compact { min-height: 34px; padding: 7px 12px; font-size: 11px; }
.variant-tabs { display: flex; gap: 8px; margin: 13px 0; padding-bottom: 2px; overflow-x: auto; }
.variant-tab { flex: 0 0 auto; min-width: 76px; padding: 8px 12px; border: 1px solid #cad7bd; border-radius: 9px; color: #536274; background: #fff; font-weight: 750; cursor: pointer; }
.variant-tab.active { border-color: var(--teal); color: #17270d; background: var(--teal); box-shadow: 0 5px 14px rgba(92,137,43,.18); }
.variant-editor { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 1.5fr auto; align-items: end; gap: 12px; padding-top: 12px; border-top: 1px dashed #d4dfca; }
.variant-editor-note { display: grid; align-self: stretch; align-content: center; gap: 2px; padding: 8px 11px; border-radius: 9px; color: #477020; background: #edf5e5; }
.variant-editor-note strong { font-size: 11px; }
.variant-editor-note span { color: #67776b; font-size: 10px; }
.channel-form { border-left: 4px solid var(--blue); }
.cstore-form { border-left-color: #5085ad; }
.bstore-form { border-left-color: var(--teal); }
.tiktok-form { border-left-color: #27313c; }
.modal-footer { border-top: 1px solid var(--line); border-bottom: 0; }
.modal-footer-right { display: flex; gap: 10px; margin-left: auto; }
.modal-save-note { margin: 0 0 0 auto; color: var(--muted); font-size: 11px; }
.danger-text { color: #a13c33 !important; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; transform: translateY(20px); opacity: 0; pointer-events: none; padding: 12px 16px; border-radius: 10px; color: #fff; background: #172033; box-shadow: var(--shadow); transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }

.bulk-import-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px 24px; margin-bottom: 16px; padding: 16px 18px; border: 1px solid #d8e5cc; border-radius: 14px; background: linear-gradient(110deg, #f4f9ef 0%, #fff 100%); }
.bulk-import-panel strong { display: block; margin-top: 3px; color: var(--ink); }
.bulk-import-panel p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.bulk-import-actions { display: flex; gap: 8px; }
.bulk-import-result { grid-column: 1 / -1; padding: 9px 11px; border-radius: 9px; color: #3f6014; background: #e8f4dc; font-size: 11px; }
.bulk-import-result[data-tone="loading"] { color: #57646c; background: #edf1f3; }
.bulk-import-result[data-tone="warning"] { color: #815b08; background: #fff3d7; }
.bulk-import-result[data-tone="danger"] { color: #993d35; background: #fee8e7; }
.fx-auto-field { display: grid; align-content: start; gap: 6px; color: #536274; font-size: 12px; font-weight: 650; }
.fx-auto-card { min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid #dce5d4; border-radius: 8px; background: #f4f8f1; }
.fx-auto-card i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: #557d20; background: #e5f0da; font-style: normal; }
.fx-auto-card strong, .fx-auto-card small { display: block; }
.fx-auto-card strong { color: #46651d; font-size: 10px; }
.fx-auto-card small { margin-top: 1px; color: var(--muted); font-size: 9px; font-weight: 500; }
.fx-auto-card[data-tone="loading"] i { animation: fxSpin .9s linear infinite; }
.fx-auto-card[data-tone="warning"] { border-color: #eadcb8; background: #fff8e9; }
.fx-auto-card[data-tone="warning"] i, .fx-auto-card[data-tone="warning"] strong { color: #865f0b; }
@keyframes fxSpin { to { transform: rotate(360deg); } }

.market-filter { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 4px 14px rgba(2,12,28,.03); }
.market-filter > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.market-filter select { min-width: 120px; height: 32px; padding: 0 26px 0 8px; border: 0; outline: 0; color: var(--ink); background: #f3f6f1; font-weight: 650; }
.input-with-suffix { position: relative; display: block; }
.input-with-suffix input { padding-right: 48px; }
.input-with-suffix input[name="exchangeRate"] { padding-right: 118px; }
.input-with-suffix small { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 10px; font-weight: 700; pointer-events: none; }
.form-grid label em { color: #8a7342; font-size: 9px; font-style: normal; font-weight: 500; line-height: 1.35; }
.field-label b { color: #557d20; font-weight: 800; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-grid.channel-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.form-grid.tiktok-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bstore-subsection { padding-top: 2px; }
.bstore-subsection + .bstore-subsection { margin-top: 18px; padding-top: 18px; border-top: 1px dashed #dbe5d4; }
.bstore-subsection-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 11px; }
.bstore-subsection-title strong { color: var(--ink); font-size: 13px; }
.bstore-subsection-title small { color: var(--muted); font-size: 10px; }
.form-grid.bstore-policy-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.bstore-quote-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bstore-results { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.bstore-result-card { min-width: 0; padding: 12px; border: 1px solid #dfe8d7; border-radius: 10px; background: #f8faf6; }
.bstore-result-card.primary { border-color: #b9d392; background: linear-gradient(135deg, #edf7e3, #f9fcf5); }
.bstore-result-card small, .bstore-result-card strong, .bstore-result-card span { display: block; }
.bstore-result-card small { color: #62704f; font-size: 9px; font-weight: 750; }
.bstore-result-card strong { overflow: hidden; margin-top: 5px; color: #315d18; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.bstore-result-card span { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.entry-architecture { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.entry-architecture article { display: flex; align-items: center; gap: 12px; padding: 15px 17px; border: 1px solid #dfe8d7; border-radius: 14px; background: #fff; }
.entry-architecture article > span { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #17270d; background: var(--teal); font-weight: 850; }
.entry-architecture strong { display: block; color: var(--ink); }
.entry-architecture p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.bstore-workbench { display: grid; grid-template-columns: minmax(248px, 292px) minmax(0, 1fr); align-items: start; gap: 20px; }
.bstore-picker-panel { position: sticky; top: 116px; overflow: hidden; padding: 24px 22px 22px; border-color: #dce7d5; border-radius: 18px; box-shadow: 0 14px 36px rgba(33, 57, 24, .07); }
.bstore-picker-panel::before { position: absolute; inset: 0 0 auto; height: 4px; content: ""; background: linear-gradient(90deg, var(--teal), #b8d988 72%, transparent); }
.bstore-picker-panel h3 { margin: 6px 0 20px; padding-bottom: 16px; border-bottom: 1px solid #e8eee4; }
.standalone-field { display: grid; gap: 7px; color: #536274; font-size: 12px; font-weight: 700; }
.standalone-field select { width: 100%; height: 42px; padding: 0 10px; }
.bstore-product-summary { display: grid; gap: 10px; margin-top: 16px; }
.bstore-product-summary article { padding: 13px 14px; border: 1px solid #e1e9dc; border-radius: 12px; background: linear-gradient(145deg, #fbfcfa, #f5f8f2); }
.bstore-product-summary small, .bstore-product-summary strong, .bstore-product-summary span { display: block; }
.bstore-product-summary small { color: var(--muted); font-size: 9px; }
.bstore-product-summary strong { margin-top: 4px; color: var(--ink); }
.bstore-product-summary span { margin-top: 3px; color: #617080; font-size: 10px; line-height: 1.45; }
.bstore-picker-help { margin: 18px 0 0; padding-top: 15px; border-top: 1px solid #e8eee4; color: var(--muted); font-size: 10px; line-height: 1.6; }
.bstore-quote-panel { min-width: 0; padding: 24px; border-color: #dce7d5; border-radius: 18px; box-shadow: 0 14px 36px rgba(33, 57, 24, .055); }
.quote-simulator { position: relative; margin-top: 24px; padding: 24px; border: 1px solid #d6e4cc; border-radius: 16px; background: linear-gradient(145deg, #fbfdf9 0%, #fff 48%, #f8fbf4 100%); box-shadow: inset 4px 0 0 rgba(139, 188, 64, .82), 0 8px 24px rgba(48, 76, 34, .045); }
.quote-simulator .bstore-workbench-head { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid #e4ecdf; }
.bstore-workbench-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.bstore-workbench-head h3 { margin: 4px 0 3px; }
.bstore-workbench-head p { margin: 0; color: var(--muted); font-size: 10px; }
.bstore-workbench-head output { flex: 0 0 auto; padding: 8px 11px; border-radius: 9px; color: #477020; background: var(--formula); font-size: 12px; font-weight: 750; }
.form-grid.bstore-brief-grid { grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.form-grid.bstore-brief-grid .span-4 { grid-column: 1 / -1; }
.quote-export-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; padding: 14px 15px; border: 1px solid #cadfba; border-radius: 12px; background: linear-gradient(110deg, #f0f7e9, #fff); }
.quote-export-toolbar strong { display: block; color: #365c1b; }
.quote-export-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.quote-export-actions { display: flex; flex: 0 0 auto; gap: 9px; }
.issue-cell { display: grid; justify-items: start; gap: 6px; max-width: 320px; white-space: normal; }
.issue-cell small { color: var(--muted); line-height: 1.45; }
.empty-state { display: grid; gap: 6px; }
.empty-state strong { color: var(--ink); }
.empty-state span { color: var(--muted); font-size: 12px; }
.form-section-title output { color: #477020; }
.threshold-control input { accent-color: var(--teal); }
.channel-tab.active { color: #172000; background: var(--teal); border-color: var(--teal); }
.text-button { color: #557d20; }
.row-action { color: #557d20; }
.row-action:hover { background: #eef5e8; }

.logic-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: stretch; gap: 10px; margin-bottom: 16px; }
.logic-flow article { min-width: 0; padding: 18px; border: 1px solid #e1e8dd; border-radius: 16px; background: #fff; box-shadow: 0 8px 22px rgba(18,53,84,.04); }
.logic-flow article.result { border-color: #b8d291; background: linear-gradient(135deg, #eef7e5, #fff); }
.logic-flow article span { display: inline-grid; place-items: center; width: 27px; height: 27px; margin-bottom: 11px; border-radius: 8px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 800; }
.logic-flow article.result span { color: #1d3100; background: var(--teal); }
.logic-flow article strong { display: block; margin-bottom: 5px; }
.logic-flow article p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.logic-flow > i { align-self: center; color: #88a15d; font-size: 18px; font-style: normal; }
.logic-equation { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; padding: 20px; border: 1px solid #d5e3ca; border-radius: 16px; background: #f5f9f1; }
.logic-equation strong, .logic-equation code { display: block; }
.logic-equation code { margin: 7px 0; color: #2f5218; font-family: "Cascadia Code", Consolas, monospace; font-size: 14px; font-weight: 700; white-space: normal; }
.logic-equation p { margin: 0; color: #607052; font-size: 11px; }
.logic-panel { margin-bottom: 16px; overflow: hidden; }
.logic-panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.button.compact { min-height: 34px; padding: 0 11px; font-size: 11px; }
.logic-compare-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid #e9eef1; }
.logic-channel-card { min-width: 0; padding: 20px; border-right: 1px solid #e9eef1; }
.logic-channel-card:last-child { border-right: 0; }
.logic-channel-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.logic-channel-heading strong { font-size: 14px; }
.logic-channel-heading em { margin-left: auto; color: #7f8b75; font-size: 8px; font-style: normal; font-weight: 650; }
.logic-rate-list { display: grid; gap: 9px; margin: 0; }
.logic-rate-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px dashed #e5eae3; color: var(--muted); font-size: 11px; }
.logic-rate-row:last-child { border-bottom: 0; }
.logic-rate-row b { color: var(--ink); }
.logic-rate-row.dynamic b { color: #5c8725; }
.logic-rate-editor { width: 72px; height: 30px; display: flex; align-items: center; overflow: hidden; border: 1px solid #cbd8c1; border-radius: 8px; background: #f7faf4; }
.logic-rate-editor:focus-within { border-color: #88b541; box-shadow: 0 0 0 3px rgba(136,181,65,.12); }
.logic-rate-editor input { width: 50px; height: 28px; padding: 0 3px 0 8px; border: 0; outline: 0; color: #263b17; background: transparent; font-size: 11px; font-weight: 800; text-align: right; }
.logic-rate-editor span { color: #657458; font-size: 10px; font-weight: 750; }
.logic-channel-card small { display: block; margin-top: 14px; color: var(--muted); line-height: 1.5; }
.logic-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.logic-detail-card { display: flex; align-items: flex-start; gap: 15px; padding: 22px; }
.logic-detail-card h3 { margin: 1px 0 10px; }
.logic-detail-card p { margin: 5px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.logic-detail-card code { display: block; margin-top: 12px; padding: 10px 12px; border-radius: 9px; color: #34531c; background: #f1f7ec; font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; white-space: normal; }
.logic-detail-card.b-detail { grid-column: 1 / -1; }
.logic-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.logic-notes article { padding: 17px 18px; border: 1px solid #e0e7ec; border-radius: 14px; background: #fff; }
.logic-notes strong { display: block; margin-bottom: 5px; }
.logic-notes p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

@media (max-width: 1280px) {
  .topbar { align-items: flex-start; padding: 18px 0; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .team-sync-status small, .team-user { display: none; }
  .team-sync-status { min-width: 0; }
  .form-grid.tiktok-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .review-summary { grid-template-columns: repeat(2, 1fr); }
  .channel-principles { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid.six { grid-template-columns: repeat(3, 1fr); }
  .form-grid.five { grid-template-columns: repeat(3, 1fr); }
  .form-grid.channel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid.bstore-policy-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-grid.bstore-quote-grid, .bstore-results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid.four { grid-template-columns: repeat(2, 1fr); }
  .variant-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .variant-editor-note { grid-column: 1 / -1; }
  .topbar { align-items: flex-start; padding: 20px 0; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .logic-flow { grid-template-columns: 1fr 1fr; }
  .logic-flow > i { display: none; }
  .logic-compare-grid { grid-template-columns: 1fr 1fr; }
  .logic-channel-card:nth-child(2) { border-right: 0; }
  .logic-channel-card:nth-child(-n+2) { border-bottom: 1px solid #e9eef1; }
  .logic-panel .panel-header, .logic-panel-actions { align-items: flex-start; flex-direction: column; }
  .bstore-workbench { grid-template-columns: 1fr; }
  .bstore-picker-panel { position: static; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 19; display: block; visibility: hidden; border: 0; background: rgba(7,25,41,.42); opacity: 0; transition: .2s ease; }
  .sidebar.open + .sidebar-scrim { visibility: visible; opacity: 1; }
  .main-content { padding: 0 16px 28px; }
  .mobile-menu { display: block; }
  .topbar { position: relative; min-height: auto; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .team-tools { order: -1; }
  .search-box { min-width: 100%; }
  .market-filter { width: 100%; }
  .market-filter select { flex: 1; }
  .hero-panel { align-items: flex-start; flex-direction: column; min-height: 0; padding: 28px 22px; }
  .hero-proof { gap: 10px 16px; }
  .channel-principles { grid-template-columns: 1fr; }
  .kpi-grid, .review-summary { grid-template-columns: 1fr; }
  .view-intro { align-items: flex-start; flex-direction: column; gap: 10px; }
  .form-grid.four, .form-grid.five, .form-grid.six, .form-grid.channel-grid, .form-grid.tiktok-grid, .form-grid.bstore-policy-grid, .form-grid.bstore-quote-grid, .bstore-results { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: span 2; }
  .variant-manager-head { align-items: flex-start; flex-direction: column; }
  .modal-backdrop { padding: 0; }
  .modal { max-height: 100vh; height: 100vh; border-radius: 0; }
  .bulk-import-panel { grid-template-columns: 1fr; }
  .bulk-import-actions { flex-wrap: wrap; }
  .bulk-import-actions .button { flex: 1; }
  .logic-detail-grid, .logic-notes { grid-template-columns: 1fr; }
  .logic-detail-card.b-detail { grid-column: auto; }
  .entry-architecture { grid-template-columns: 1fr; }
  .form-grid.bstore-brief-grid { grid-template-columns: 1fr 1fr; }
  .form-grid.bstore-brief-grid .span-3, .form-grid.bstore-brief-grid .span-4 { grid-column: span 2; }
  .quote-export-toolbar { align-items: flex-start; flex-direction: column; }
  .quote-export-actions { width: 100%; flex-wrap: wrap; }
  .quote-export-actions .button { flex: 1; }
  .bstore-picker-panel, .bstore-quote-panel, .quote-simulator { padding: 20px; }
}

@media (max-width: 480px) {
  .form-grid.four, .form-grid.five, .form-grid.six, .form-grid.channel-grid, .form-grid.tiktok-grid, .form-grid.bstore-policy-grid, .form-grid.bstore-quote-grid, .bstore-results { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .form-grid .span-3, .form-grid.bstore-brief-grid .span-3, .form-grid.bstore-brief-grid .span-4 { grid-column: auto; }
  .variant-editor { grid-template-columns: 1fr; }
  .variant-editor-note { grid-column: auto; }
  .hero-actions { width: 100%; flex-direction: column; }
  .topbar-actions .button { flex: 1; }
  .modal-save-note { display: none; }
  .logic-flow, .logic-compare-grid { grid-template-columns: 1fr; }
  .logic-channel-card { border-right: 0; border-bottom: 1px solid #e9eef1; }
  .quote-export-actions { display: grid; grid-template-columns: 1fr; }
  .bstore-picker-panel, .bstore-quote-panel, .quote-simulator { padding: 16px; border-radius: 14px; }
  .team-auth-card { padding: 24px 20px; border-radius: 18px; }
  .team-auth-card form { grid-template-columns: 1fr; }
}

.auth-locked .app-shell{visibility:hidden}.team-auth-card #teamCompanyLogin{display:flex;justify-content:center;margin-top:16px}
