:root {
  color-scheme: light;
  --page: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8faff;
  --line: #e6ebf3;
  --line-strong: #d8e0ec;
  --ink: #182235;
  --muted: #778399;
  --faint: #9aa6b8;
  --primary: #1467f5;
  --primary-dark: #0e52d0;
  --primary-soft: #eaf2ff;
  --nav: #07182c;
  --nav-soft: #0c2340;
  --success: #13a66b;
  --success-soft: #e7f8f0;
  --warning: #e48a19;
  --warning-soft: #fff5e6;
  --danger: #e2484f;
  --danger-soft: #fff0f1;
  --violet: #7657e8;
  --violet-soft: #f0edff;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(30, 49, 78, .06);
  --sidebar: 168px;
  --topbar: 50px;
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--page); color: var(--ink); }
body { font-size: 13px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 24% 18%, rgba(20, 103, 245, .13), transparent 28%),
    linear-gradient(135deg, #eef4ff 0%, #f7f9fd 48%, #edf2f9 100%);
}
.login-card {
  width: min(380px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 70px rgba(29, 56, 97, .14);
}
.login-brand { margin-bottom: 20px; }
.login-card h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.login-card > p { margin: 3px 0 24px; color: var(--muted); }
.form-error { min-height: 20px; margin: 12px 0 0 !important; color: var(--danger) !important; font-size: 12px; }

.brand-mark { position: relative; display: inline-grid; grid-template-columns: repeat(2, 12px); grid-template-rows: repeat(2, 12px); gap: 2px; width: 30px; height: 30px; transform: rotate(12deg); }
.brand-mark i { display: block; border-radius: 8px 3px 8px 3px; background: linear-gradient(145deg, #4b94ff, #145ee6); }
.brand-mark i:nth-child(2) { background: linear-gradient(145deg, #8caeff, #4773ed); }
.brand-mark i:nth-child(3) { grid-column: 1 / 3; width: 20px; justify-self: center; background: linear-gradient(145deg, #2175ef, #1748be); }

.app-shell { display: none; min-height: 100dvh; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 14px 10px 10px;
  color: #b7c6da;
  background: linear-gradient(180deg, var(--nav) 0%, #091b31 64%, #061426 100%);
}
.sidebar-brand { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 2px 8px 14px; color: #fff; }
.sidebar-brand .brand-mark { transform: rotate(12deg) scale(.82); transform-origin: left center; margin-right: -3px; }
.sidebar-brand b { display: block; font-size: 13px; letter-spacing: .01em; }
.sidebar-brand small { display: block; margin-top: 1px; color: #7f91aa; font-size: 9px; }
.menu { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #29415e transparent; }
.menu-group { margin-bottom: 5px; }
.menu-parent, .menu-item {
  width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left;
  transition: background .16s ease, color .16s ease;
}
.menu-parent { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 8px; border-radius: 6px; color: #d9e4f2; font-weight: 650; font-size: 12px; }
.menu-parent:hover, .menu-parent.open { background: rgba(255, 255, 255, .05); color: #fff; }
.menu-parent.active { background: var(--primary); color: #fff; box-shadow: 0 5px 14px rgba(20, 103, 245, .28); }
.menu-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-caret { margin-left: auto; color: #66809f; font-size: 10px; transition: transform .18s ease; }
.menu-children { position: relative; margin: 2px 0 5px 17px; padding-left: 12px; }
.menu-group:not(.open) .menu-children { display: none; }
.menu-group.open .menu-children { display: block; }
.menu-group.open .menu-caret { transform: rotate(180deg); }
.menu-children::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 5px; width: 1px; background: #263d58; }
.menu-item { position: relative; display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 5px 7px; border-radius: 5px; color: #91a5bd; font-size: 11px; }
.menu-item .menu-icon { width: 15px; height: 15px; opacity: .82; }
.menu-item::before { content: ""; position: absolute; left: -12px; width: 8px; height: 1px; background: #263d58; }
.menu-item:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.menu-item.active { color: #fff; background: rgba(20, 103, 245, .18); }
.menu-badge { margin-left: auto; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 5px; border-radius: 9px; color: #fff; background: var(--danger); font-size: 9px; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; padding: 9px 6px 2px; border-top: 1px solid #1a304b; color: #6f85a0; font-size: 10px; }
.sidebar-logout { border: 0; background: transparent; color: #8ca0b8; cursor: pointer; font-size: 10px; }
.sidebar-logout:hover { color: #fff; }

.workspace { grid-column: 2; min-width: 0; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 15; height: var(--topbar); display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
}
.global-search { width: min(420px, 44vw); height: 30px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfe; }
.global-search:focus-within { border-color: #8eb4fb; box-shadow: 0 0 0 3px rgba(20, 103, 245, .08); }
.search-icon { width: 11px; height: 11px; border: 1.5px solid #8c9ab0; border-radius: 50%; position: relative; flex: none; }
.search-icon::after { content: ""; position: absolute; right: -4px; bottom: -3px; width: 5px; height: 1.5px; transform: rotate(45deg); background: #8c9ab0; }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.global-search input::placeholder { color: #aab3c1; }
.global-search kbd { color: #a6afbd; font-size: 9px; font-family: inherit; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; color: #647289; }
.icon-btn:hover { border-color: var(--line); background: #f7f9fc; color: var(--ink); }
.wind-chime-icon { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn em { position: absolute; right: -2px; top: -3px; min-width: 15px; height: 15px; display: none; place-items: center; padding: 0 4px; border: 2px solid #fff; border-radius: 9px; background: var(--danger); color: #fff; font-size: 8px; font-style: normal; }
.icon-btn em.show { display: grid; }
.profile-button { display: flex; align-items: center; gap: 7px; padding: 3px 4px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.profile-button b { display: block; max-width: 95px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.profile-button small { display: block; color: var(--muted); font-size: 9px; }
.avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #d7e5ff, #b8d0fb); color: #174b9e; font-weight: 700; }

.content { padding: 14px 16px 28px; outline: 0; }
.page-head { min-height: 36px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.page-head h1 { margin: 0; font-size: 15px; line-height: 1.35; letter-spacing: -.01em; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.page-actions { display: flex; align-items: center; gap: 7px; }

.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 1px 2px rgba(31, 46, 71, .02); }
.panel-head { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px 7px; border-bottom: 1px solid #eef1f6; }
.panel-head h2 { margin: 0; font-size: 11px; font-weight: 700; }
.panel-head p { margin: 1px 0 0; color: var(--muted); font-size: 9px; }
.panel-link { border: 0; background: transparent; color: var(--primary); cursor: pointer; font-size: 9px; }
.panel-body { padding: 11px 12px; }
.panel + .panel { margin-top: 10px; }

.dashboard-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .92fr); gap: 10px; }
.dashboard-left { display: grid; gap: 10px; min-width: 0; }
.dashboard-mid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dashboard-right { display: grid; grid-template-rows: auto auto; gap: 10px; min-width: 0; }
.dashboard-bottom { display: grid; grid-template-columns: 1.1fr 1.1fr .9fr; gap: 10px; margin-top: 10px; }

.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; gap: 0; padding: 8px 0 2px; }
.pipeline-stage { position: relative; min-width: 0; text-align: center; }
.pipeline-stage:not(:last-child)::after { content: ""; position: absolute; left: calc(50% + 19px); right: calc(-50% + 19px); top: 17px; height: 2px; background: linear-gradient(90deg, var(--stage-color), #cfdbef); }
.stage-icon { position: relative; z-index: 1; width: 34px; height: 34px; display: grid; place-items: center; margin: 0 auto 5px; border-radius: 50%; color: var(--stage-color); background: var(--stage-soft); font-size: 12px; font-weight: 750; }
.stage-name { min-height: 27px; display: block; padding: 0 3px; font-size: 9px; font-weight: 650; line-height: 1.35; }
.stage-count { display: block; font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stage-meta { color: var(--muted); font-size: 8px; }
.stage-meta strong { color: var(--success); font-weight: 650; }

.metric-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.metric-cell { min-width: 0; padding: 9px 10px; border: 1px solid #edf0f5; border-radius: 6px; background: #fbfcfe; }
.metric-cell span { display: block; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-cell b { display: block; margin-top: 5px; font-size: 16px; font-variant-numeric: tabular-nums; }
.metric-cell small { color: var(--success); font-size: 8px; }
.metric-cell small.danger { color: var(--danger); }

.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 8px; }
.result-stat { padding: 9px; border-radius: 6px; background: linear-gradient(145deg, #f8faff, #f1f5fc); }
.result-stat span { display: block; color: #5c6b82; font-size: 8px; }
.result-stat b { display: block; margin-top: 4px; font-size: 17px; }
.result-stat small { color: var(--success); font-size: 8px; }
.trend-chart { width: 100%; height: 120px; display: block; overflow: visible; }
.chart-grid { stroke: #edf1f7; stroke-width: 1; }
.chart-label { fill: #95a1b3; font-size: 8px; }
.chart-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { opacity: .07; }
.chart-legend { display: flex; gap: 12px; margin-top: 3px; color: var(--muted); font-size: 8px; }
.chart-legend i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; }

.run-list, .todo-list, .notice-list { display: grid; gap: 0; }
.run-row, .todo-row, .notice-row { display: grid; align-items: center; gap: 8px; min-height: 36px; padding: 6px 0; border-bottom: 1px solid #f0f2f6; }
.run-row:last-child, .todo-row:last-child, .notice-row:last-child { border-bottom: 0; }
.run-row { grid-template-columns: minmax(0, 1fr) 76px 54px; }
.run-main { min-width: 0; }
.run-main b, .todo-copy b, .notice-copy b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.run-main small, .todo-copy small, .notice-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.mini-progress { height: 4px; overflow: hidden; border-radius: 3px; background: #edf1f7; }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.run-progress { color: var(--muted); font-size: 8px; text-align: right; }
.todo-row, .notice-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
.signal-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font-size: 9px; font-weight: 700; }
.signal-icon.red { color: var(--danger); background: var(--danger-soft); }
.signal-icon.orange { color: var(--warning); background: var(--warning-soft); }
.signal-icon.blue { color: var(--primary); background: var(--primary-soft); }
.signal-icon.green { color: var(--success); background: var(--success-soft); }

.btn { min-height: 29px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; cursor: pointer; font-weight: 600; font-size: 10px; white-space: nowrap; }
.btn:hover { border-color: #a9b9cf; background: #f8faff; }
.btn.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.btn.primary:hover { border-color: var(--primary-dark); background: var(--primary-dark); }
.btn.danger { border-color: #f4c6ca; background: #fff6f6; color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn.block { width: 100%; }
.btn.small { min-height: 24px; padding: 4px 8px; font-size: 9px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 9px; }
.input, .select, .textarea { width: 100%; min-height: 32px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 6px; outline: 0; background: #fff; color: var(--ink); font-size: 10px; }
.input:focus, .select:focus, .textarea:focus { border-color: #7ca8fa; box-shadow: 0 0 0 3px rgba(20, 103, 245, .08); }
.textarea { min-height: 76px; resize: vertical; }
.field { display: grid; gap: 4px; margin-bottom: 11px; }
.field > span, .field > label { color: #59677b; font-size: 9px; font-weight: 650; }
.field .required::after { content: " *"; color: var(--danger); }
.filter-input { width: 180px; }
.filter-select { width: 118px; }

.tabs { display: flex; gap: 16px; min-height: 34px; padding: 0 2px; border-bottom: 1px solid var(--line); }
.tab { position: relative; padding: 8px 2px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); font-weight: 650; }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); }

.table-wrap { width: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 9px; }
.data-table th { height: 31px; padding: 7px 8px; border-bottom: 1px solid var(--line); background: #fafbfd; color: #718098; text-align: left; font-weight: 650; }
.data-table td { height: 38px; padding: 7px 8px; border-bottom: 1px solid #f0f2f6; color: #314057; vertical-align: middle; }
.data-table tr:hover td { background: #fafcff; }
.data-table tr:last-child td { border-bottom: 0; }
.product-cell { display: flex; align-items: center; gap: 7px; min-width: 190px; max-width: 290px; }
.product-thumb { width: 29px; height: 29px; flex: none; border: 1px solid var(--line); border-radius: 5px; object-fit: cover; background: #f1f4f8; }
.candidate-image-missing { display: inline-flex; align-items: center; justify-content: center; padding: 2px; color: var(--muted); font-size: 7px; line-height: 1.1; text-align: center; }
.product-cell b { display: block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.product-cell small { display: block; color: var(--muted); font-size: 8px; }
.candidate-product-link { color: inherit; text-decoration: none; }
.candidate-product-link:hover b { color: var(--primary); text-decoration: underline; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .95em; }
.num { font-variant-numeric: tabular-nums; }

.tag { display: inline-flex; align-items: center; min-height: 18px; padding: 2px 6px; border-radius: 4px; background: #f0f3f7; color: #617088; font-size: 8px; line-height: 1; }
.tag.blue { background: var(--primary-soft); color: var(--primary); }
.tag.green { background: var(--success-soft); color: #08794c; }
.tag.orange { background: var(--warning-soft); color: #b36808; }
.tag.red { background: var(--danger-soft); color: #c7373f; }
.tag.violet { background: var(--violet-soft); color: #6648cf; }
.tag.gray { background: #f0f3f7; color: #68768a; }

.empty-state { display: grid; place-items: center; min-height: 150px; padding: 24px; color: var(--muted); text-align: center; font-size: 10px; }
.empty-state b { display: block; margin-bottom: 3px; color: #4f5e74; font-size: 11px; }
.loading { min-height: 220px; display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.loading::before { content: ""; width: 18px; height: 18px; margin-right: 8px; border: 2px solid #dbe4f2; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.error-state { min-height: 150px; display: grid; place-items: center; padding: 20px; color: var(--danger); text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }

.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 10px; }
.summary-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.summary-card > span { color: var(--muted); font-size: 9px; }
.summary-card b { display: block; margin-top: 6px; font-size: 20px; }
.summary-card small { color: var(--muted); font-size: 8px; }
.summary-status-card { min-width: 0; }
.summary-status-card h3 { margin: 0; color: var(--ink); font-size: 11px; }
.summary-status-list { display: grid; gap: 6px; margin-top: 9px; }
.summary-status-row,
.summary-status-empty { min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.summary-status-row b,
.summary-status-empty b { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.summary-status-empty span { color: var(--muted); font-size: 9px; }
.supplemental-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.supplemental-status-group { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfcfe; }
.supplemental-status-group h3 { margin: 0; color: var(--ink); font-size: 11px; }
.funnel { display: grid; grid-template-columns: repeat(7, minmax(80px, 1fr)); gap: 5px; overflow-x: auto; }
.funnel-step { position: relative; padding: 12px 9px; border: 1px solid var(--line); background: #fff; text-align: center; }
.funnel-step:first-child { border-radius: 6px 0 0 6px; }
.funnel-step:last-child { border-radius: 0 6px 6px 0; }
.funnel-step span { display: block; color: var(--muted); font-size: 8px; }
.funnel-step b { display: block; margin-top: 3px; font-size: 17px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(7, 20, 38, .24); }
.drawer { position: absolute; inset: 0 0 0 auto; width: min(430px, 100%); display: flex; flex-direction: column; background: #fff; box-shadow: -18px 0 48px rgba(20, 39, 68, .16); animation: drawer-in .2s ease-out; }
.drawer.drawer-wide { width: min(1280px, 92vw); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .55; } to { transform: translateX(0); opacity: 1; } }
.drawer-head { min-height: 64px; display: flex; align-items: flex-start; justify-content: space-between; padding: 14px 16px 11px; border-bottom: 1px solid var(--line); }
.drawer-head p { margin: 0 0 2px; color: var(--primary); font-size: 9px; }
.drawer-head h2 { margin: 0; font-size: 14px; }
.drawer-head .close { font-size: 20px; }
.drawer-body { flex: 1; overflow: auto; padding: 16px; }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 18px; }
.step { position: relative; padding-top: 25px; color: #a0aabc; text-align: center; font-size: 8px; }
.step::before { content: attr(data-index); position: absolute; z-index: 1; top: 0; left: calc(50% - 9px); width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: #e9edf3; color: #8995a8; font-weight: 700; }
.step:not(:last-child)::after { content: ""; position: absolute; left: calc(50% + 9px); right: calc(-50% + 9px); top: 8px; height: 1px; background: #e1e6ee; }
.step.active { color: var(--primary); font-weight: 650; }
.step.active::before, .step.done::before { background: var(--primary); color: #fff; }
.step.done::after { background: #8bb1f8; }
.drawer-section h3 { margin: 0 0 12px; font-size: 11px; }
.drawer-section + .drawer-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.listing-stepper { grid-template-columns: repeat(9, minmax(58px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
.blocking-list { display: grid; gap: 5px; margin-bottom: 12px; padding: 11px 12px; border: 1px solid #efc485; border-radius: 8px; background: var(--warning-soft); color: #83520d; font-size: 9px; }
.blocking-list b { font-size: 10px; }
.blocking-list span::before { content: "• "; }
.compact-form { margin-top: 12px; }
.required-attributes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.asset-card { display: grid; gap: 3px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; }
.asset-card img, .asset-placeholder { width: 100%; aspect-ratio: 1; border-radius: 5px; object-fit: cover; background: #eef2f7; }
.asset-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 8px; }
.asset-card b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.asset-card small { color: var(--muted); font-size: 8px; }
.asset-upload-form { margin-top: 10px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 8px; background: #fafcff; }
.gate-grid { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.issue { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; margin-top: 5px; padding: 7px 9px; border-radius: 6px; background: #f5f7fa; font-size: 9px; }
.issue.failed { background: var(--danger-soft); color: #8e2d34; }
.issue.warning { background: var(--warning-soft); color: #83520d; }
.drawer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.notice.danger { border-color: #efb0b5; background: var(--danger-soft); color: #a32630; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.textarea.compact { min-height: 54px; }
.category-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.translate-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.translation-hint, .category-picked { min-height: 13px; color: var(--primary); font-size: 8px; font-weight: 500; line-height: 1.45; }
.filter-options { display: grid; gap: 7px; margin: 2px 0 12px; }
.filter-options > label { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fafcff; cursor: pointer; }
.filter-options input { margin-top: 2px; accent-color: var(--primary); }
.filter-options span { display: grid; gap: 2px; }
.filter-options b { font-size: 9px; }
.filter-options small, .form-note { color: var(--muted); font-size: 8px; line-height: 1.5; }

.integration-flow-option { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; padding: 12px; border: 1px solid #b8cdf6; border-radius: 8px; background: #f3f7ff; cursor: pointer; }
.integration-flow-option input { margin-top: 2px; }
.integration-flow-option span { display: grid; gap: 4px; }
.integration-flow-option b { color: #164eaa; font-size: 10px; }
.integration-flow-option small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.fixed-products { display: grid; gap: 7px; margin: -6px 0 14px; }
.fixed-products > span { display: grid; grid-template-columns: 20px 86px minmax(0, 1fr); gap: 8px; align-items: center; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.fixed-products i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #e8f0ff; color: #1459bf; font-style: normal; font-size: 9px; }
.fixed-products b { font-family: var(--mono); font-size: 9px; }
.fixed-products small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.integration-settings { margin-bottom: 14px; padding: 12px; border: 1px solid #c9d8f2; border-radius: 8px; background: #f8faff; }
.integration-mode-head { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 12px; align-items: center; margin-bottom: 12px; }
.integration-mode-head span { display: grid; gap: 3px; }
.integration-mode-head b { font-size: 10px; }
.integration-mode-head small { color: var(--muted); font-size: 9px; }
.form-note { margin: -2px 0 10px; }
.drawer-footer { position: sticky; bottom: -16px; display: flex; justify-content: flex-end; gap: 8px; margin: 18px -16px -16px; padding: 11px 16px; border-top: 1px solid var(--line); background: #fff; }
.detail-list { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.detail-list dt, .detail-list dd { margin: 0; padding: 8px 10px; border-bottom: 1px solid #eef1f5; font-size: 9px; }
.detail-list dt { color: var(--muted); background: #fafbfd; }
.detail-list dd { overflow-wrap: anywhere; }
.detail-list dt:last-of-type, .detail-list dd:last-of-type { border-bottom: 0; }
.competitor-groups { margin-top: 18px; }
.competitor-group-card { overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fbfcfe; }
.competitor-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 11px; border-bottom: 1px solid var(--line); background: #f5f8fc; }
.competitor-group-head h4 { margin: 0 0 3px; font-size: 10px; }
.competitor-group-head p { margin: 0; color: var(--muted); font-size: 8px; }
.competitor-group-head > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.competitor-group-reason { margin: 0; padding: 8px 11px; border-bottom: 1px solid var(--line); color: #59677b; font-size: 8px; line-height: 1.5; }
.authenticity-evidence { margin: 10px 12px 0; padding: 12px; border: 1px solid #d8e4f5; border-radius: 10px; background: #f7faff; }
.authenticity-evidence.pass { border-color: #bce6d1; background: #f2fbf6; }
.authenticity-evidence.review { border-color: #f2d49a; background: #fff9ed; }
.authenticity-evidence.reject { border-color: #f2bdbd; background: #fff5f5; }
.authenticity-evidence > header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.authenticity-evidence > header span:last-child { color: var(--muted); font-size: 11px; }
.authenticity-evidence > p { margin: 8px 0 0; color: #334155; line-height: 1.6; }
.authenticity-review-alert { margin-left: auto; border-color: #f0a53b; background: linear-gradient(135deg, #f59e0b, #e97913); color: #fff; text-decoration: none; box-shadow: 0 0 0 0 rgba(234, 131, 24, .38); animation: authenticity-review-pulse 1.6s ease-out infinite; }
.authenticity-review-alert:hover { border-color: #d96d0c; background: linear-gradient(135deg, #ee9007, #d96d0c); color: #fff; }
.authenticity-review-alert em { min-width: 58px; padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.2); font-size: 9px; font-style: normal; }
@keyframes authenticity-review-pulse {
  0% { box-shadow: 0 0 0 0 rgba(234, 131, 24, .38); transform: translateY(0); }
  55% { box-shadow: 0 0 0 9px rgba(234, 131, 24, 0); transform: translateY(-1px); }
  100% { box-shadow: 0 0 0 0 rgba(234, 131, 24, 0); transform: translateY(0); }
}
.authenticity-category-evidence { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(110px, 1fr)); gap: 8px; margin: 10px 0 0; }
.authenticity-category-evidence div { min-width: 0; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.78); border: 1px solid rgba(148,163,184,.24); }
.authenticity-category-evidence dt { color: var(--muted); font-size: 10px; }
.authenticity-category-evidence dd { margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.authenticity-member-evidence { margin: 8px 0; padding: 9px 10px; border-left: 3px solid #7c65e8; border-radius: 0 8px 8px 0; background: #f7f5ff; }
.authenticity-member-evidence p { margin: 5px 0 0; color: #475569; line-height: 1.5; }
.authenticity-drawer-group { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.authenticity-drawer-group > header, .authenticity-drawer-member header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.authenticity-drawer-group > header small { display: block; margin-top: 3px; color: var(--muted); }
.authenticity-drawer-reason { margin: 10px 0; line-height: 1.6; }
.authenticity-drawer-members { display: grid; gap: 8px; margin-top: 12px; }
.authenticity-drawer-member { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.authenticity-drawer-member img, .authenticity-drawer-member .competitor-product-image { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; }
.authenticity-drawer-member p { margin: 6px 0 0; color: #475569; line-height: 1.5; }
.authenticity-review-summary { display: inline-flex; align-items: baseline; gap: 7px; margin-bottom: 12px; padding: 8px 12px; border: 1px solid #f0cf9c; border-radius: 9px; background: #fff9ed; color: #8b5510; }
.authenticity-review-summary b { font-size: 22px; }
.authenticity-review-toolbar { align-items: flex-end; }
.authenticity-review-toolbar .field { width: 180px; margin: 0; }
.authenticity-review-table .table-wrap { overflow-x: auto; }
.authenticity-review-table .data-table { min-width: 980px; }
.authenticity-review-table-reason { max-width: 360px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.authenticity-review-table [data-review-focused="true"] { box-shadow: 0 0 0 3px rgba(239, 164, 60, .18); }
.authenticity-review-list { display: grid; gap: 14px; }
.authenticity-review-card { scroll-margin-top: 70px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.authenticity-review-card[data-review-focused="true"] { border-color: #efa43c; box-shadow: 0 0 0 3px rgba(239, 164, 60, .14), var(--shadow); }
.authenticity-review-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.authenticity-review-card > header span, .authenticity-review-card > header h2, .authenticity-review-card > header small { display: block; }
.authenticity-review-card > header span { color: var(--warning); font-size: 9px; font-weight: 700; }
.authenticity-review-card > header h2 { margin: 3px 0 0; font-size: 15px; }
.authenticity-review-card > header > div:last-child { display: flex; align-items: center; gap: 7px; }
.authenticity-review-card > header small { color: var(--muted); }
.authenticity-review-reason { margin: 12px 0; padding: 12px; border-left: 3px solid var(--warning); border-radius: 0 8px 8px 0; background: var(--warning-soft); }
.authenticity-review-reason p { margin: 6px 0 0; line-height: 1.65; }
.authenticity-review-products { display: grid; gap: 8px; margin-top: 12px; }
.authenticity-review-product { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.authenticity-review-product img, .authenticity-review-product .competitor-product-image { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; }
.authenticity-review-product header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.authenticity-review-product p { margin: 7px 0 0; color: #475569; line-height: 1.6; }
.authenticity-review-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.authenticity-review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.authenticity-review-followup { display: grid; gap: 3px; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--success-soft); color: #176b49; }
.authenticity-review-followup span, .form-note { color: var(--muted); font-size: 9px; }
.competitor-product-list { display: grid; gap: 8px; }
.competitor-group-card .competitor-product-list { padding: 9px; }
.competitor-product-card { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.competitor-product-media a { display: block; }
.competitor-product-image { width: 82px; height: 82px; display: grid; place-items: center; border-radius: 6px; object-fit: cover; background: #eef2f7; color: var(--muted); font-size: 8px; }
.competitor-product-content { min-width: 0; }
.competitor-product-content > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: start; }
.competitor-product-content > header b { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 9px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.competitor-product-content > header > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.competitor-product-ids { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 5px 0 6px; color: var(--muted); font-size: 8px; }
.competitor-product-ids code { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.competitor-product-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 9px; margin: 0; }
.competitor-product-metrics div { min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px; font-size: 8px; }
.competitor-product-metrics dt { color: var(--muted); }
.competitor-product-metrics dd { overflow: hidden; margin: 0; color: #314057; text-overflow: ellipsis; white-space: nowrap; }
.competitor-source-link { display: inline-block; margin-top: 7px; color: var(--primary); font-size: 8px; text-decoration: none; }
.competitor-source-link:hover { text-decoration: underline; }
.competitor-decision-layout { grid-template-columns: 82px minmax(0, 1fr); align-items: start; }
.competitor-card-summary { margin: 6px 0 8px; color: #42526a; font-size: 9px; line-height: 1.5; }
.grouping-signal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 8px 0; }
.grouping-signal { min-width: 0; padding: 7px 8px; border: 1px solid #dbe5f2; border-radius: 7px; background: #f8fbff; }
.grouping-signal span, .grouping-signal b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grouping-signal span { color: var(--muted); font-size: 8px; }
.grouping-signal b { margin-top: 3px; color: var(--ink); font-size: 10px; }
.business-position-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 8px; margin: 8px 0; }
.business-position-grid div { min-width: 0; padding: 6px 7px; border-radius: 6px; background: #fbfcfe; }
.business-position-grid dt { color: var(--muted); font-size: 8px; }
.business-position-grid dd { overflow: hidden; margin: 2px 0 0; color: #26364d; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.business-flag-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0; }
.business-flag { display: inline-flex; align-items: center; padding: 3px 7px; border: 1px solid #f0c36c; border-radius: 999px; background: #fff8e8; color: #855d13; font-size: 8px; font-weight: 700; }
.competitor-analysis { margin-top: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fafbfd; }
.competitor-analysis > summary { padding: 8px 9px; color: var(--primary); font-size: 9px; font-weight: 700; cursor: pointer; }
.competitor-analysis > summary:focus-visible, .grouping-dashboard-group > summary:focus-visible, .grouping-distribution-row:focus-visible, .competitor-card-actions .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.competitor-comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 9px 9px; }
.competitor-comparison-grid section { min-width: 0; padding: 8px; border-radius: 6px; background: #fff; }
.competitor-comparison-grid h5 { margin: 0 0 5px; font-size: 9px; }
.competitor-comparison-grid ul { margin: 0; padding-left: 16px; color: #40516a; font-size: 8px; line-height: 1.55; }
.competitor-comparison-grid p { margin: 0; color: #40516a; font-size: 8px; line-height: 1.55; }
.competitor-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.manual-revision-badge { display: inline-flex; align-items: center; padding: 4px 8px; border: 1px solid #d9cff7; border-radius: 999px; background: #f5f1ff; color: #5d3db7; font-size: 8px; font-weight: 700; }
.grouping-decision-summary { color: #40516a !important; }
.competitor-group-technical { margin: 0 11px 8px; border: 1px dashed var(--line); border-radius: 6px; background: #fff; }
.competitor-group-technical summary { padding: 6px 8px; color: var(--muted); font-size: 8px; cursor: pointer; }
.competitor-group-technical p { margin: 0; padding: 0 8px 8px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.json-view { max-height: 340px; overflow: auto; padding: 10px; border-radius: 6px; background: #0d1d32; color: #d7e4f3; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; white-space: pre-wrap; }
.sourcing-candidates { margin-top: 16px; }
.sourcing-candidates .table-wrap { margin: 0 -16px; width: calc(100% + 32px); }
.sourcing-margin-cell { min-width: 210px; display: grid; gap: 4px; white-space: normal; }
.sourcing-margin-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sourcing-margin-cell > small { color: var(--muted); }
.sourcing-margin-cell.unavailable { min-width: 170px; }
.sourcing-margin-details { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 4px; }
.sourcing-margin-details > summary { color: var(--primary); cursor: pointer; font-weight: 650; }
.sourcing-margin-details > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }
.sourcing-margin-formulas { width: min(520px, 72vw); margin: 7px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.sourcing-margin-formula-row { padding: 6px 7px; border-radius: 6px; background: #f7f9fc; display: grid; gap: 3px; }
.sourcing-margin-formula-row > div { display: flex; justify-content: space-between; gap: 10px; }
.sourcing-margin-formula-row span, .sourcing-margin-formula-row code { color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
.sourcing-margin-formula-row.income { background: #f1faf5; }
.sourcing-margin-formula-row.result { background: #fff8eb; }
.sourcing-margin-notes, .sourcing-margin-reasons { margin: 0; padding-left: 15px; color: var(--muted); }
.failure-card { margin-bottom: 12px; padding: 12px; border: 1px solid #efb0b5; border-radius: 8px; background: var(--danger-soft); }
.failure-card h3 { margin: 0 0 8px; color: #a32630; font-size: 11px; }
.failure-card h4 { margin: 9px 0 3px; color: #8e2d34; font-size: 9px; }
.failure-card p { margin: 0; color: #54373a; font-size: 9px; line-height: 1.55; }
.failure-card .failure-impact { margin-top: 4px; color: #7a5155; }
.failure-card .btn { margin-top: 9px; }
.failure-card dl { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 5px 8px; margin: 0 0 8px; font-size: 9px; line-height: 1.5; }
.failure-card dt { color: #a32630; font-weight: 650; }
.failure-card dd { margin: 0; color: #54373a; }
.failure-card small { color: #8f5960; font-size: 8px; }
.publish-progress { display: grid; gap: 7px; margin-bottom: 10px; }
.publish-stage { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #fafbfd; }
.publish-stage i { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: #e6ebf2; font-style: normal; font-size: 9px; font-weight: 700; }
.publish-stage span { display: grid; gap: 2px; }
.publish-stage b { color: var(--ink); font-size: 9px; }
.publish-stage small { font-size: 8px; }
.publish-stage.active { border-color: #91b5f7; background: var(--primary-soft); }
.publish-stage.active i { background: var(--primary); color: #fff; }
.publish-stage.done { border-color: #a7ddc3; background: var(--success-soft); }
.publish-stage.done i { background: var(--success); color: #fff; }
.publish-stage.failed { border-color: #efb0b5; background: var(--danger-soft); }
.publish-stage.failed i { background: var(--danger); color: #fff; }
.publish-stage code { color: inherit; font-family: var(--mono); font-size: 8px; }
.main-workflow-run + .main-workflow-run { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.main-workflow-run > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.main-workflow-run > header > div { display: grid; gap: 3px; }
.main-workflow-run > header > div:last-child { justify-items: end; }
.main-workflow-run > header b { font-family: var(--mono); font-size: 9px; }
.main-workflow-run > header small { color: var(--muted); font-size: 8px; }
.main-workflow-progress { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 6px 2px 14px; scrollbar-width: thin; }
.main-workflow-progress .publish-stage { position: relative; min-width: 150px; flex: 1 0 150px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0 12px; border: 0; border-radius: 0; background: transparent; text-align: center; }
.main-workflow-progress .publish-stage:not(:last-child)::after { content: ""; position: absolute; z-index: 0; top: 20px; left: calc(50% + 21px); width: calc(100% - 42px); height: 2px; background: #dce3ec; }
.main-workflow-progress .publish-stage i { position: relative; z-index: 1; width: 40px; height: 40px; border: 2px solid #d4dce6; border-radius: 50%; background: #fff; color: #8291a2; font-size: 11px; box-shadow: 0 0 0 5px #fff; }
.main-workflow-progress .publish-stage span { justify-items: center; }
.main-workflow-progress .publish-stage b { max-width: 142px; font-size: 9px; line-height: 1.35; }
.main-workflow-progress .publish-stage small { max-width: 142px; color: var(--muted); line-height: 1.45; }
.main-workflow-progress .publish-stage.done i { border-color: var(--success); background: var(--success); color: #fff; }
.main-workflow-progress .publish-stage.done:not(:last-child)::after { background: #8ed0b0; }
.main-workflow-progress .publish-stage.active i { border-color: var(--primary); background: var(--primary); color: #fff; }
.main-workflow-progress .publish-stage.failed i { border-color: var(--danger); background: var(--danger); color: #fff; }
.selection-task-list { display: grid; gap: 12px; }
.selection-task-card { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.selection-task-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px 14px 10px; }
.selection-task-card > header > div:first-child { min-width: 0; display: grid; gap: 3px; }
.selection-task-card > header b { font-size: 12px; }
.selection-task-card > header small { color: var(--muted); font-size: 9px; }
.selection-task-actions { display: flex; align-items: center; gap: 8px; }
.task-agent-flow { display: flex; align-items: center; gap: 7px; overflow-x: auto; padding: 4px 14px 13px; scrollbar-width: thin; }
.task-agent-node { min-width: 130px; display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid; border-radius: 8px; }
.task-agent-node i { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 10px; font-style: normal; }
.task-agent-node span { min-width: 0; display: grid; gap: 2px; }
.task-agent-node b, .task-agent-node small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-agent-node b { font-size: 9px; }
.task-agent-node small { font-size: 8px; }
.task-agent-node.done { border-color: #bce8d2; background: #f0fbf5; color: #187c50; }
.task-agent-node.done i, .task-subtask-icon.done { background: var(--success); }
.task-agent-node.incomplete { border-color: #f1c4c7; background: #fff4f4; color: #a72f36; }
.task-agent-node.incomplete i, .task-subtask-icon.incomplete { background: var(--danger); }
.task-agent-arrow { flex: none; color: #9eacbb; font-size: 13px; }
.task-subtasks { border-top: 1px solid var(--line); }
.task-subtasks summary { padding: 10px 14px; color: var(--ink); background: #fafbfd; cursor: pointer; font-size: 10px; font-weight: 650; }
.task-subtasks summary span { margin-left: 7px; color: var(--muted); font-size: 8px; font-weight: 400; }
.task-subtask-list { display: grid; padding: 4px 14px 10px; }
.task-subtask-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #eef1f5; }
.task-subtask-row:last-child { border-bottom: 0; }
.task-subtask-row > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.task-subtask-row b { font-size: 9px; }
.task-subtask-row small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.task-subtask-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 9px; }
.technical-details { margin-top: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fafbfd; }
.technical-details summary { padding: 8px 10px; color: var(--muted); cursor: pointer; font-size: 9px; }
.technical-details .json-view { margin: 0 8px 8px; }
.final-confirm-card { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.final-confirm-card > img { width: 130px; height: 130px; border: 1px solid var(--line); border-radius: 9px; object-fit: cover; }
.final-confirm-card h3 { margin: 0 0 9px; font-size: 12px; line-height: 1.45; }
.notice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 10px; }
.notice.success { border-color: #9eddbf; background: #effbf5; color: #176b49; }
.notice span { color: var(--muted); }
.agent-config-panel .panel-body { padding-top: 10px; }
.agent-config-meta, .prompt-editor-foot, .prompt-editor > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.agent-config-meta { margin-bottom: 10px; color: var(--muted); font-size: 9px; }
.prompt-editor-list { display: grid; gap: 10px; }
.prompt-editor { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcff; }
.prompt-editor h3, .prompt-editor p { margin: 0; }
.prompt-editor h3 { font-size: 11px; }
.prompt-editor p { margin-top: 4px; color: var(--muted); font-size: 9px; }
.prompt-textarea { width: 100%; min-height: 190px; margin-top: 6px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; line-height: 1.55; }
.prompt-editor-foot { margin-top: 9px; }
.prompt-editor-foot small { color: var(--muted); }
.similarity-grid { margin-top: 8px; }
.similarity-input { display: flex; align-items: center; gap: 6px; }
.similarity-input input { flex: 1; }
.similarity-formula { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.prompt-editor-foot code { display: inline-block; margin: 2px 3px 2px 0; padding: 2px 5px; border-radius: 5px; background: #eef2f8; color: var(--ink); }
.credential-card-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.credential-summary-card b { font-size: 16px; line-height: 1.3; }
.managed-account-form h3 { margin-top: 8px; }
.managed-account-form .field small { color: var(--muted); font-size: 10px; line-height: 1.45; }

.grouping-dashboard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.grouping-dashboard-head h1 { margin: 0; font-size: 21px; }
.grouping-dashboard-head p { margin: 4px 0 0; color: var(--muted); }
.grouping-dashboard-controls { display: flex; align-items: center; gap: 8px; }
.grouping-dashboard-controls .select { min-width: 260px; }
.grouping-conclusion { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; padding: 14px 16px; border: 1px solid #cbd8ef; border-radius: 10px; background: linear-gradient(135deg, #f7faff, #eef4ff); }
.grouping-conclusion span, .grouping-conclusion b { display: block; }
.grouping-conclusion > div:first-child > span { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.grouping-conclusion > div:last-child { display: flex; gap: 5px; }
.grouping-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.grouping-metric { min-height: 92px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.grouping-metric > span, .grouping-metric > small { display: block; color: var(--muted); }
.grouping-metric > b { display: block; margin: 7px 0 4px; font-size: 24px; line-height: 1; color: var(--ink); }
.grouping-metric.warning { border-color: #f4c77a; background: #fffaf0; }
.grouping-metric.danger { border-color: #efb1b1; background: #fff6f6; }
.grouping-metric.success { border-color: #a9ddc8; background: #f4fbf8; }
.grouping-distribution { display: grid; gap: 8px; }
.grouping-distribution-row { display: grid; grid-template-columns: 42px minmax(180px, 1.2fr) minmax(180px, 2fr) auto; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.grouping-distribution-row img, .distribution-image-placeholder { width: 42px; height: 42px; border-radius: 7px; object-fit: cover; background: #eef2f7; }
.distribution-label b, .distribution-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.distribution-label small { margin-top: 3px; color: var(--muted); }
.distribution-track { height: 10px; overflow: hidden; border-radius: 999px; background: #e8edf4; }
.distribution-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3867d6, #6e8ff2); }
.grouping-action-list { display: grid; gap: 8px; }
.grouping-action-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-left: 3px solid #e3a63b; background: #fffaf0; }
.grouping-action-item p { margin: 3px 0 0; color: var(--muted); }
.grouping-dashboard-group { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.grouping-dashboard-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; cursor: pointer; list-style: none; }
.grouping-dashboard-group > summary b, .grouping-dashboard-group > summary small { display: block; }
.grouping-dashboard-group > summary small { margin-top: 3px; color: var(--muted); }
.grouping-dashboard-group .competitor-product-list { padding: 0 12px 12px; }
.grouping-technical-records { margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.grouping-technical-records > summary { padding: 12px; font-weight: 700; cursor: pointer; }
.grouping-technical-records .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }

@media (max-width: 900px) {
  .credential-card-grid { grid-template-columns: 1fr; }
  .grouping-dashboard-head { align-items: stretch; flex-direction: column; }
  .grouping-dashboard-controls { align-items: stretch; flex-direction: column; }
  .grouping-dashboard-controls .select { min-width: 0; width: 100%; }
  .grouping-conclusion { align-items: flex-start; flex-direction: column; }
  .grouping-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grouping-distribution-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .distribution-track { grid-column: 1 / -1; }
  .grouping-signal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .business-position-grid, .competitor-comparison-grid { grid-template-columns: 1fr; }
  .authenticity-category-evidence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .grouping-metric-grid { grid-template-columns: 1fr; }
  .grouping-action-item { align-items: flex-start; flex-direction: column; }
  .competitor-product-card, .competitor-decision-layout { grid-template-columns: 1fr; }
  .competitor-product-image { width: 100%; max-width: 160px; }
  .grouping-signal-grid, .business-position-grid { grid-template-columns: 1fr; }
  .authenticity-category-evidence { grid-template-columns: 1fr; }
}

.toast { position: fixed; z-index: 80; right: 18px; bottom: 18px; max-width: 340px; padding: 10px 13px; border-radius: 7px; background: #10243f; color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; font-size: 10px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #9f2931; }

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

@media (max-width: 1180px) {
  .dashboard-top { grid-template-columns: 1fr; }
  .dashboard-right { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .dashboard-bottom { grid-template-columns: 1fr 1fr; }
  .dashboard-bottom > :last-child { grid-column: 1 / -1; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  :root { --sidebar: 0px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; max-height: none; padding: 9px; }
  .sidebar-brand { min-height: 34px; padding-bottom: 7px; }
  .menu { display: flex; gap: 5px; overflow-x: auto; }
  .menu-group { flex: none; margin: 0; }
  .menu-parent { min-width: 105px; }
  .menu-children { display: none; }
  .sidebar-foot { display: none; }
  .workspace { grid-column: 1; }
  .topbar { top: 0; padding: 0 10px; }
  .global-search { width: min(62vw, 420px); }
  .profile-button > span:last-child { display: none; }
  .content { padding: 10px; }
  .dashboard-mid, .dashboard-right, .dashboard-bottom { grid-template-columns: 1fr; }
  .dashboard-bottom > :last-child { grid-column: auto; }
  .pipeline { min-width: 650px; }
  .panel-body.pipeline-wrap { overflow-x: auto; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .drawer.drawer-wide { width: 100%; }
}

@media (max-width: 520px) {
  .global-search { width: 52vw; }
  .global-search kbd, #help-button { display: none; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-actions { justify-content: flex-end; }
  .metric-grid, .result-stats, .card-grid { grid-template-columns: 1fr 1fr; }
  .drawer { width: 100%; }
}

.grouping-revision-dialog { width: min(760px, calc(100vw - 48px)); max-height: min(760px, calc(100vh - 48px)); padding: 0; border: 0; border-radius: 16px; color: var(--ink); box-shadow: var(--shadow); }
.grouping-revision-dialog::backdrop { background: rgba(7, 24, 44, .48); backdrop-filter: blur(3px); }
.grouping-revision-form { display: grid; gap: 14px; padding: 18px; background: #fff; }
.grouping-revision-head, .grouping-revision-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grouping-revision-head p, .grouping-revision-head h2 { margin: 0; }
.grouping-revision-head p { color: var(--muted); font-size: 10px; }
.grouping-revision-head h2 { margin-top: 3px; font-size: 18px; }
.grouping-revision-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grouping-revision-product { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.grouping-revision-product span, .grouping-revision-product small { display: block; color: var(--muted); font-size: 9px; }
.grouping-revision-product b { display: block; margin: 3px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grouping-reason-field { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.grouping-reason-field legend { padding: 0 4px; font-weight: 700; }
.grouping-reason-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.grouping-radio { display: flex; align-items: center; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcff; cursor: pointer; }
.grouping-radio:focus-within { outline: 2px solid #9ab9ff; outline-offset: 1px; }
.grouping-revision-actions .btn:disabled, .competitor-card-actions .btn:disabled { opacity: .55; cursor: not-allowed; }
.grouping-undo { position: fixed; z-index: 90; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 36px)); padding: 12px 14px; border: 1px solid #b8d6ff; border-radius: 12px; background: #eef6ff; color: #10243f; box-shadow: var(--shadow); }
.grouping-undo[hidden] { display: none; }
.grouping-undo span { font-weight: 700; font-size: 10px; }
.grouping-dashboard-group > .btn.small { margin: 0 12px 10px; }

@media (max-width: 640px) {
  .grouping-revision-dialog { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
  .grouping-revision-form { padding: 14px; }
  .grouping-revision-preview, .grouping-reason-grid { grid-template-columns: 1fr; }
  .grouping-revision-head, .grouping-revision-actions { align-items: stretch; flex-direction: column; }
  .grouping-undo { right: 12px; bottom: 12px; align-items: stretch; flex-direction: column; }
}
@media (max-width: 640px) {
  .authenticity-review-card > header, .authenticity-review-card > header > div:last-child { align-items: flex-start; flex-direction: column; }
  .authenticity-review-product { grid-template-columns: 1fr; }
  .authenticity-review-product img, .authenticity-review-product .competitor-product-image { width: 100%; max-width: 180px; height: auto; aspect-ratio: 1; }
  .authenticity-review-actions .btn { width: 100%; }
}
@media (max-width: 640px) {
  .sourcing-margin-formulas { width: 78vw; }
  .sourcing-margin-formula-row > div { display: grid; gap: 2px; }
}

/* 竞品组明细分页控件（组明细已改服务端分页，汇总与分布图仍覆盖全量） */
.grouping-group-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.grouping-group-pager span { color: var(--muted); font-size: 13px; }
.grouping-group-pager .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* 数据中心通用分页控件（原始数据池、图搜与货源数据） */
.data-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; padding: 9px; border-top: 1px solid var(--line); }
.data-pager span { color: var(--muted); font-size: 12px; }
.data-pager .btn[disabled] { opacity: .45; cursor: not-allowed; }
.page-size-control { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.page-size-control .select { width: 78px; min-height: 30px; padding: 4px 7px; }
.raw-filter-grid { display: grid; grid-template-columns: minmax(210px, 1.6fr) repeat(6, minmax(110px, 1fr)) auto auto; gap: 7px; margin-bottom: 10px; }
.sourcing-split-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 12px; }
.sourcing-split-column { min-width: 0; }
.sourcing-split-column .panel { margin: 0; }
.sourcing-split-column .table-wrap { overflow-x: auto; scrollbar-width: thin; }
.sourcing-split-column .data-table { min-width: 980px; }

/* Ozon-inspired visual refresh: presentation only, existing structure and behavior stay unchanged. */
:root {
  --page: #f2f5f9;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --line: #e3e8ef;
  --line-strong: #cdd6e1;
  --ink: #001a34;
  --muted: #667585;
  --faint: #8d9baa;
  --primary: #005bff;
  --primary-dark: #0047cc;
  --primary-soft: #e8f0ff;
  --nav: #ffffff;
  --nav-soft: #f2f5f9;
  --success: #16a36a;
  --success-soft: #e7f7ef;
  --warning: #e78417;
  --warning-soft: #fff3df;
  --danger: #f04438;
  --danger-soft: #ffeded;
  --violet: #6d55e8;
  --violet-soft: #f0edff;
  --radius: 18px;
  --shadow: 0 8px 28px rgba(0, 26, 52, .07);
  --sidebar: 236px;
  --topbar: 68px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

html { scroll-behavior: smooth; }
body { font-size: 14px; background: var(--page); }

:where(button, input, select, textarea, summary, a):focus-visible {
  outline: 3px solid rgba(0, 91, 255, .28);
  outline-offset: 2px;
}

.login-screen {
  position: relative;
  overflow: hidden;
  padding: 36px;
  background:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,.22) 0 7%, transparent 7.2%),
    radial-gradient(circle at 82% 78%, rgba(255,255,255,.14) 0 13%, transparent 13.2%),
    #005bff;
}
.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  pointer-events: none;
}
.login-screen::before { width: 420px; height: 420px; top: -190px; right: -110px; }
.login-screen::after { width: 260px; height: 260px; bottom: -120px; left: -70px; }
.login-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 46px 48px 42px;
  border: 0;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 32px 90px rgba(0, 35, 105, .28);
}
.login-brand { margin-bottom: 28px; }
.login-card h1 { font-size: 31px; font-weight: 750; letter-spacing: -.04em; }
.login-card > p { margin: 6px 0 30px; font-size: 14px; }
.login-card .field { gap: 8px; margin-bottom: 18px; }
.login-card .field > span { color: var(--ink); font-size: 13px; }
.login-card .input { min-height: 50px; padding-inline: 15px; font-size: 14px; }
.login-card .btn.block { min-height: 50px; margin-top: 8px; font-size: 15px; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 40px;
  height: 40px;
  transform: none;
  border-radius: 13px;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(0, 91, 255, .22);
}
.brand-mark i { width: 6px; height: 20px; border-radius: 5px; background: #fff; }
.brand-mark i:nth-child(2) { width: 6px; height: 14px; background: rgba(255,255,255,.82); }
.brand-mark i:nth-child(3) { width: 6px; height: 9px; background: rgba(255,255,255,.64); }

.sidebar {
  padding: 18px 14px 14px;
  color: #526477;
  border-right: 1px solid #e3e8ef;
  background: #fff;
  box-shadow: 8px 0 28px rgba(0, 26, 52, .035);
}
.sidebar-brand { min-height: 58px; gap: 12px; padding: 2px 8px 18px; color: var(--ink); }
.sidebar-brand .brand-mark { margin-right: 0; transform: scale(.88); transform-origin: center; }
.sidebar-brand b { font-size: 15px; letter-spacing: -.01em; }
.sidebar-brand small { margin-top: 2px; color: #7f8e9d; font-size: 10px; }
.menu { padding-right: 2px; scrollbar-color: #c9d7ea transparent; }
.menu-group { margin-bottom: 8px; }
.menu-parent,
.menu-item { transition: color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease; }
.menu-parent {
  min-height: 44px;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  color: #33485e;
  font-size: 13px;
  font-weight: 650;
}
.menu-parent:hover,
.menu-parent.open { color: var(--primary); background: #eef4ff; }
.menu-parent.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(0, 91, 255, .22);
}
.menu-parent:active,
.menu-item:active,
.btn:active,
.icon-btn:active { transform: translateY(1px) scale(.985); }
.menu-icon {
  width: 22px;
  height: 22px;
  opacity: .8;
}
.menu-caret { color: #94a2b1; }
.menu-children { margin: 4px 0 6px 21px; padding-left: 14px; }
.menu-children::before,
.menu-item::before { background: #dbe3ed; }
.menu-item {
  min-height: 35px;
  padding: 7px 10px;
  border-radius: 10px;
  color: #6b7b8c;
  font-size: 12px;
}
.menu-item:hover { color: var(--primary); background: #f2f6ff; }
.menu-item.active { color: var(--primary); background: #e8f0ff; font-weight: 650; }
.sidebar-foot { padding: 14px 8px 2px; border-top-color: #e8edf3; color: #8795a5; font-size: 11px; }
.sidebar-logout { color: #5f7183; font-size: 11px; }
.sidebar-logout:hover { color: var(--primary); }

.topbar {
  padding: 0 24px;
  border-bottom: 0;
  background: rgba(255,255,255,.96);
  box-shadow: 0 3px 18px rgba(0, 26, 52, .055);
  backdrop-filter: blur(18px);
}
.global-search {
  width: min(560px, 48vw);
  height: 42px;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: #f1f4f8;
}
.global-search:focus-within { border-color: #75a5ff; background: #fff; box-shadow: 0 0 0 4px rgba(0, 91, 255, .1); }
.search-icon { width: 14px; height: 14px; border-color: #718399; }
.search-icon::after { background: #718399; }
.global-search input { font-size: 13px; }
.global-search kbd { padding: 2px 6px; border: 1px solid #dbe1e8; border-radius: 6px; background: #fff; font-size: 10px; }
.topbar-actions { gap: 10px; }
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #526477;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.icon-btn:hover { border-color: transparent; background: #edf3ff; color: var(--primary); }
.profile-button { gap: 9px; padding: 5px 8px 5px 5px; border-radius: 13px; }
.profile-button:hover { background: #f2f5f9; }
.profile-button b { font-size: 12px; }
.profile-button small { font-size: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 12px; background: var(--primary); color: #fff; }

.content { width: 100%; max-width: 1800px; margin: 0 auto; padding: 25px 28px 42px; }
.page-head { min-height: 54px; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; font-weight: 750; letter-spacing: -.035em; }
.page-head p { margin-top: 5px; font-size: 13px; }
.page-actions { gap: 10px; }

.help-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  border: 1px solid #b9c8da;
  border-radius: 50%;
  color: var(--primary);
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: 0;
  vertical-align: 3px;
  cursor: help;
  transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.help-tip:hover,
.help-tip:focus-visible {
  border-color: #7ba8ff;
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(0, 91, 255, .1);
  outline: none;
}
.help-tip::before,
.help-tip::after {
  position: absolute;
  z-index: 120;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.help-tip::before {
  content: "";
  top: calc(100% + 4px);
  left: 5px;
  border: 5px solid transparent;
  border-bottom-color: #001a34;
  transform: translateY(-3px);
}
.help-tip::after {
  content: attr(data-tooltip);
  top: calc(100% + 14px);
  left: -8px;
  width: max-content;
  max-width: min(420px, calc(100vw - 48px));
  padding: 10px 12px;
  border-radius: 10px;
  background: #001a34;
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 26, 52, .2);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
  white-space: normal;
  text-align: left;
  text-wrap: pretty;
  transform: translateY(-4px);
}
.help-tip:hover::before,
.help-tip:focus-visible::before,
.help-tip:hover::after,
.help-tip:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.panel {
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-head { min-height: 58px; padding: 16px 18px 13px; border-bottom-color: #eef1f5; }
.panel-head h2 { font-size: 15px; letter-spacing: -.01em; }
.panel-head p { margin-top: 3px; font-size: 11px; }
.panel-link { font-size: 12px; font-weight: 650; }
.panel-body { padding: 17px 18px; }
.panel + .panel { margin-top: 16px; }
.dashboard-top,
.dashboard-left,
.dashboard-right { gap: 16px; }
.dashboard-mid { gap: 16px; }
.dashboard-bottom { gap: 16px; margin-top: 16px; }

.metric-grid { gap: 11px; }
.metric-cell {
  padding: 14px;
  border: 0;
  border-radius: 14px;
  background: #f5f8fc;
}
.metric-cell span { font-size: 11px; }
.metric-cell b { margin-top: 7px; font-size: 23px; letter-spacing: -.025em; }
.metric-cell small { font-size: 10px; }
.result-stats { gap: 10px; margin-bottom: 13px; }
.result-stat { padding: 14px; border-radius: 14px; background: #f2f6ff; }
.result-stat span,
.result-stat small { font-size: 10px; }
.result-stat b { font-size: 23px; }
.pipeline { padding: 13px 0 4px; }
.pipeline-stage:not(:last-child)::after { top: 21px; height: 3px; }
.stage-icon { width: 42px; height: 42px; margin-bottom: 8px; font-size: 14px; }
.stage-name { min-height: 34px; font-size: 11px; }
.stage-count { font-size: 21px; }
.stage-meta { font-size: 10px; }

.btn {
  min-height: 38px;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 12px;
  font-size: 12px;
  transition: border-color .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.btn:hover { border-color: #aebdce; background: #f3f6fa; }
.btn.primary { box-shadow: 0 7px 16px rgba(0, 91, 255, .18); }
.btn.primary:hover { box-shadow: 0 9px 20px rgba(0, 71, 204, .24); }
.btn.small { min-height: 31px; padding: 6px 11px; font-size: 11px; }
.input,
.select,
.textarea {
  min-height: 42px;
  padding: 9px 13px;
  border-color: #cfd8e3;
  border-radius: 12px;
  font-size: 12px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.input:hover,
.select:hover,
.textarea:hover { border-color: #aebdce; }
.input:focus,
.select:focus,
.textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0, 91, 255, .1); }
.field { gap: 7px; margin-bottom: 15px; }
.field > span,
.field > label { color: #42566b; font-size: 11px; }
.filter-input { width: 220px; }
.filter-select { width: 145px; }
.toolbar { gap: 10px; margin-bottom: 14px; }

.tabs { min-height: 46px; gap: 22px; }
.tab { padding: 12px 3px; font-size: 12px; }
.tab.active::after { height: 3px; border-radius: 3px 3px 0 0; }
.table-wrap { border-radius: 14px; }
.data-table { font-size: 11px; }
.data-table th { height: 44px; padding: 10px 12px; background: #f4f7fa; color: #607286; font-size: 11px; }
.data-table td { height: 52px; padding: 10px 12px; border-bottom-color: #edf1f5; color: #253d55; }
.data-table tr:hover td { background: #f3f7ff; }
.product-cell { gap: 10px; min-width: 220px; }
.product-thumb { width: 40px; height: 40px; border-radius: 10px; }
.product-cell b { font-size: 11px; }
.product-cell small { margin-top: 2px; font-size: 10px; }

.tag {
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
}
.card-grid { gap: 14px; margin-bottom: 16px; }
.summary-card,
.grouping-metric {
  padding: 18px;
  border: 0;
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow);
}
.summary-card > span,
.summary-card small,
.grouping-metric > span,
.grouping-metric > small { font-size: 11px; }
.summary-card b { margin-top: 8px; font-size: 28px; }
.summary-status-card h3 { font-size: 13px; }
.summary-status-list { gap: 8px; margin-top: 12px; }
.summary-status-row,
.summary-status-empty { min-height: 38px; padding-top: 8px; }
.summary-status-row b,
.summary-status-empty b { margin-top: 0; font-size: 18px; }
.summary-status-empty span { font-size: 11px; }
.supplemental-status-grid { gap: 12px; }
.supplemental-status-group { padding: 15px; border-radius: 14px; background: #f8faff; }
.supplemental-status-group h3 { font-size: 13px; }
.grouping-metric > b { font-size: 28px; }

.drawer-backdrop { background: rgba(0, 26, 52, .38); backdrop-filter: blur(5px); }
.drawer {
  width: min(520px, 100%);
  border-radius: 24px 0 0 24px;
  box-shadow: -28px 0 70px rgba(0, 26, 52, .18);
  animation-duration: .26s;
}
.drawer-head { min-height: 82px; padding: 21px 24px 16px; }
.drawer-head p { font-size: 11px; font-weight: 650; }
.drawer-head h2 { margin-top: 3px; font-size: 20px; letter-spacing: -.02em; }
.drawer-body { padding: 24px; }
.drawer-footer { bottom: -24px; margin: 24px -24px -24px; padding: 16px 24px; }
.drawer-section h3 { font-size: 14px; }
.detail-list { border-radius: 13px; }
.detail-list dt,
.detail-list dd { padding: 11px 13px; font-size: 11px; }

.competitor-group-card,
.competitor-product-card,
.authenticity-review-card,
.prompt-editor,
.grouping-dashboard-group,
.grouping-conclusion,
.notice,
.failure-card {
  border-radius: 16px;
}
.competitor-group-card { margin-bottom: 16px; background: #fff; box-shadow: 0 5px 18px rgba(0,26,52,.05); }
.competitor-group-head { padding: 14px 16px; background: #f5f8fc; }
.competitor-group-head h4 { font-size: 13px; }
.competitor-group-head p,
.competitor-group-reason { font-size: 10px; }
.competitor-product-card { gap: 14px; padding: 13px; }
.competitor-product-image { border-radius: 12px; }
.competitor-product-content > header b { font-size: 12px; }
.competitor-product-ids,
.competitor-product-metrics div,
.competitor-source-link,
.competitor-card-summary { font-size: 10px; }
.grouping-signal { padding: 9px 10px; border-radius: 10px; background: #f3f7ff; }
.grouping-signal span { font-size: 9px; }
.grouping-signal b { font-size: 11px; }
.authenticity-review-card { padding: 20px; box-shadow: var(--shadow); }
.authenticity-review-card > header h2 { font-size: 18px; }
.authenticity-review-reason { padding: 15px; border-radius: 0 12px 12px 0; }
.grouping-conclusion { padding: 18px 20px; border: 0; background: #eaf1ff; }

.grouping-revision-dialog { border-radius: 24px; box-shadow: 0 28px 90px rgba(0,26,52,.22); }
.grouping-revision-dialog::backdrop { background: rgba(0,26,52,.46); backdrop-filter: blur(6px); }
.grouping-revision-form { gap: 18px; padding: 24px; border-radius: inherit; }
.grouping-revision-head h2 { font-size: 22px; }
.grouping-revision-product,
.grouping-reason-field,
.grouping-radio { border-radius: 13px; }
.grouping-undo { padding: 14px 16px; border: 0; border-radius: 15px; background: #eaf1ff; box-shadow: 0 12px 32px rgba(0,91,255,.14); }
.toast { border-radius: 14px; box-shadow: 0 14px 38px rgba(0,26,52,.2); }

@media (max-width: 1180px) {
  :root { --sidebar: 220px; }
  .content { padding-inline: 20px; }
  .raw-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #raw-query { grid-column: span 2; }
}

@media (max-width: 820px) {
  :root { --sidebar: 0px; --topbar: 60px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; max-height: none; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); box-shadow: none; }
  .sidebar-brand { min-height: 42px; padding: 2px 7px 8px; }
  .sidebar-brand .brand-mark { transform: scale(.76); }
  .menu { display: flex; gap: 7px; overflow-x: auto; }
  .menu-group { flex: none; margin: 0; }
  .menu-parent { min-width: 120px; min-height: 40px; }
  .menu-children { display: none; }
  .sidebar-foot { display: none; }
  .workspace { grid-column: 1; }
  .topbar { padding: 0 12px; }
  .global-search { width: min(62vw, 420px); height: 40px; }
  .content { padding: 18px 14px 32px; }
  .drawer { border-radius: 0; }
  .drawer.drawer-wide { width: 100%; }
  .supplemental-status-grid { grid-template-columns: 1fr; }
  .raw-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sourcing-split-layout { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .login-screen { padding: 16px; }
  .login-card { padding: 34px 24px 30px; border-radius: 22px; }
  .login-card h1 { font-size: 27px; }
  .global-search { width: 50vw; }
  .page-head h1 { font-size: 23px; }
  .metric-grid,
  .result-stats,
  .card-grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .drawer-head,
  .drawer-body { padding-inline: 18px; }
}
