:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef3ef;
  --ink: #1c241f;
  --muted: #6b746f;
  --line: #dfe5df;
  --green: #127a54;
  --blue: #2468a2;
  --amber: #a66d18;
  --red: #a3392f;
  --teal: #248075;
  --shadow: 0 18px 45px rgba(31, 45, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

body.is-locked {
  min-height: 100vh;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(18, 122, 84, 0.16), transparent 30%),
    linear-gradient(135deg, #101a17, #24342a 58%, #f6f7f4 58%);
}

.auth-screen[hidden] {
  display: none;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-eyebrow {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-card h1 {
  margin-top: 6px;
  font-size: 28px;
}

.auth-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  color: var(--ink);
}

.auth-card input:focus {
  outline: 2px solid rgba(18, 122, 84, 0.22);
  border-color: var(--green);
}

.auth-card button,
.logout-btn {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.auth-card button {
  min-height: 44px;
  background: var(--green);
  color: #ffffff;
  font-weight: 800;
}

.auth-message {
  min-height: 20px;
  color: var(--red);
  font-size: 14px;
}

body.is-locked .app-shell {
  display: none;
}

.logout-btn {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
}

.logout-btn:hover,
.logout-btn:focus-visible {
  color: var(--red);
  border-color: rgba(163, 57, 47, 0.45);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  background: linear-gradient(90deg, #18231e 0 280px, var(--bg) 280px);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 20px;
  background: #18231e;
  color: #f8fbf7;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #d9f2df;
  color: #183323;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.panel p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
}

.brand p,
.field span,
.side-summary span,
.side-summary small,
.nav a {
  color: #b9c6bf;
}

.field {
  display: grid;
  gap: 8px;
}

.field select,
.toolbar input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
}

.side-summary {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

.side-summary strong {
  font-size: 28px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.main {
  min-width: 0;
  padding: 28px;
  display: grid;
  gap: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.eyebrow {
  color: var(--green);
  font-weight: 700;
  margin-bottom: 6px;
}

.topbar h2 {
  font-size: 28px;
}

.data-status {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.2fr);
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid #bfd6c5;
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: #f3faf5;
}

.data-status span,
.data-status small {
  color: var(--muted);
}

.data-status strong {
  display: block;
  margin: 5px 0;
  font-size: 18px;
  line-height: 1.35;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.status-grid span {
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #d9e8dd;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.data-gaps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.gap-card {
  display: grid;
  gap: 7px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.gap-card:hover,
.gap-card:focus-visible {
  border-color: rgba(18, 122, 84, 0.45);
  box-shadow: 0 0 0 3px rgba(18, 122, 84, 0.1);
  outline: none;
}

.gap-card span,
.gap-card small {
  color: var(--muted);
  line-height: 1.45;
}

.gap-card strong {
  font-size: 23px;
}

.gap-card.ok {
  background: #f5fbf6;
}

.gap-card.warn {
  background: #fffaf1;
}

.gap-card.info {
  background: #f4f8fb;
}

.toolbar {
  display: flex;
  gap: 10px;
  min-width: 390px;
}

.time-switch {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border: 1px solid rgba(18, 122, 84, 0.18);
  border-radius: 8px;
  background: #eef5f0;
}

.time-switch button {
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.time-switch button.active {
  background: var(--green);
  color: #ffffff;
}

.toolbar button {
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--ink);
  color: #ffffff;
  cursor: pointer;
}

.toolbar .logout-btn {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
}

.toolbar .logout-btn:hover,
.toolbar .logout-btn:focus-visible {
  color: var(--red);
  border-color: rgba(163, 57, 47, 0.45);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  gap: 18px;
}

.panel[hidden] {
  display: none;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.panel h3 {
  font-size: 20px;
}

.panel-period {
  display: block;
  margin-top: 7px;
  color: var(--green);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.panel p,
.insight-card small,
.kpi small,
.note-card small,
.product-row small {
  color: var(--muted);
}

.status-pill,
.summary-pills span,
.summary-pills button,
.legend span,
.legend-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.legend-chip {
  border: 0;
  cursor: pointer;
}

.summary-pills button {
  border: 0;
  cursor: pointer;
}

.legend-chip.active,
.guide-card.active {
  background: #e4f4ea;
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(18, 122, 84, 0.28);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
  min-height: 142px;
}

.kpi strong {
  font-size: 25px;
  line-height: 1.1;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.single-compare {
  grid-template-columns: 1fr;
}

.compare span {
  background: #f5f6f3;
  border-radius: 6px;
  padding: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.metric-note {
  line-height: 1.4;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
}

.subhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 10px;
}

.subhead h4 {
  margin: 0;
  font-size: 16px;
}

.subhead span {
  color: var(--muted);
  font-size: 13px;
}

.insight-card {
  background: #f8faf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.insight-card span,
.note-card .label,
.product-row .label {
  color: var(--muted);
  font-size: 13px;
}

.insight-card strong {
  font-size: 18px;
  line-height: 1.45;
}

.ratio-bar {
  height: 12px;
  background: #e7ece7;
  border-radius: 999px;
  overflow: hidden;
}

.ratio-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.evidence-preview {
  display: grid;
  gap: 10px;
}

.screenshot-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.screenshot-card {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  overflow: hidden;
}

.shot-link {
  display: block;
  background: #eef4ef;
}

.shot-link:focus-visible {
  outline: 3px solid rgba(21, 128, 99, 0.45);
  outline-offset: -3px;
}

.screenshot-card img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  object-position: top center;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.source-check {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d9e8dd;
  border-radius: 8px;
  background: #f7fbf8;
}

.source-check-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.source-check-head strong {
  font-size: 16px;
}

.source-check-head span {
  color: var(--muted);
  font-size: 13px;
}

.source-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
}

.source-check-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.source-check-card small,
.source-check-card span,
.source-check-card p,
.source-check-card em {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  font-style: normal;
}

.source-check-card strong {
  font-size: 20px;
}

.source-check-card em {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef6f0;
  color: var(--green);
  font-weight: 700;
}

.screenshot-card figcaption,
.missing-shot {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.screenshot-card strong {
  font-size: 15px;
}

.screenshot-card span,
.screenshot-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.shot-placeholder {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 92px;
  border: 1px dashed #b7c8bd;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(18, 122, 84, 0.08), rgba(36, 104, 162, 0.06)),
    #f7faf7;
  text-align: center;
}

.quadrant-wrap {
  display: grid;
  grid-template-columns: minmax(560px, 1.2fr) minmax(360px, 0.8fr);
  gap: 16px;
  align-items: start;
  --quadrant-workspace-height: clamp(560px, calc(100vh - 230px), 720px);
}

.product-priority-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.68fr) minmax(480px, 1.32fr);
  gap: 16px;
  align-items: start;
}

.priority-board {
  display: grid;
  gap: 10px;
  position: sticky;
  top: 16px;
}

.priority-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.priority-card.main {
  border-color: rgba(18, 122, 84, 0.28);
  background: #eef9f2;
}

.priority-card span {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: #ffffff;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.priority-card strong {
  font-size: 18px;
  line-height: 1.35;
}

.priority-card small {
  color: var(--muted);
  line-height: 1.45;
}

.quadrant-wrap > .action-list {
  max-height: var(--quadrant-workspace-height);
  overflow-y: auto;
  align-content: start;
  padding-right: 8px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.threshold-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.threshold-card {
  display: grid;
  gap: 8px;
  border: 1px solid #cfded3;
  border-radius: 8px;
  padding: 12px;
  background: #f5faf6;
}

.threshold-card span {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.threshold-card strong {
  font-size: 16px;
  line-height: 1.35;
}

.threshold-card p,
.threshold-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.axis-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.axis-rule-card {
  display: grid;
  gap: 12px;
  border: 1px solid #d7e4dc;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.axis-rule-card strong {
  font-size: 17px;
}

.axis-rule-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.axis-rule-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.weight-list {
  display: grid;
  gap: 6px;
}

.weight-list span {
  display: grid;
  grid-template-columns: minmax(94px, 1fr) minmax(100px, 1.2fr) 48px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.weight-list i {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #edf1ee;
  overflow: hidden;
}

.weight-list i::before {
  content: "";
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #2b75a4);
}

.weight-list em {
  color: var(--ink);
  font-style: normal;
  text-align: right;
}

.axis-rule-card li {
  color: var(--muted);
  line-height: 1.45;
}

.axis-rule-card b {
  color: var(--ink);
}

.quadrant-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

.guide-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
}

.guide-card[role="button"] {
  cursor: pointer;
}

.guide-card strong {
  font-size: 15px;
}

.guide-card span {
  width: max-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
}

.guide-card p,
.guide-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.quadrant-plot {
  position: relative;
  height: var(--quadrant-workspace-height);
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  overflow: hidden;
}

.quadrant-zone {
  position: absolute;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 14px;
  color: rgba(28, 36, 31, 0.78);
  pointer-events: none;
}

.quadrant-zone strong {
  font-size: 18px;
}

.quadrant-zone span {
  width: max-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.quadrant-zone p,
.quadrant-zone small {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.quadrant-zone p {
  max-width: 210px;
  color: rgba(28, 36, 31, 0.78);
  font-size: 11px;
}

.threshold-line {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  background: rgba(91, 111, 99, 0.48);
}

.threshold-x {
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-1px);
}

.threshold-y {
  left: 0;
  right: 0;
  height: 2px;
  transform: translateY(1px);
}

.threshold-label {
  position: absolute;
  z-index: 6;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

.threshold-x-label {
  bottom: 10px;
  transform: translateX(8px);
}

.threshold-y-label {
  left: 10px;
  transform: translateY(-8px);
}

.axis-definition {
  position: absolute;
  z-index: 1;
  max-width: 300px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.24);
  color: rgba(91, 111, 99, 0.66);
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
}

.axis-definition-x {
  right: 12px;
  bottom: 38px;
}

.axis-definition-y {
  left: 12px;
  top: 82px;
}

.zone-tr {
  top: 0;
  right: 0;
  width: 50%;
  height: 50%;
  background: rgba(18, 122, 84, 0.08);
}

.zone-br {
  right: 0;
  bottom: 0;
  width: 50%;
  height: 50%;
  background: rgba(36, 104, 162, 0.08);
}

.zone-tl {
  top: 0;
  left: 0;
  width: 50%;
  height: 50%;
  background: rgba(166, 109, 24, 0.08);
}

.zone-bl {
  left: 0;
  bottom: 0;
  width: 50%;
  height: 50%;
  background: rgba(163, 57, 47, 0.07);
}

.quadrant-plot::before,
.quadrant-plot::after {
  display: none;
}

.quadrant-plot::before {
  content: attr(data-y);
  top: 12px;
  left: 14px;
}

.quadrant-plot::after {
  content: attr(data-x);
  right: 14px;
  bottom: 12px;
}

.axis-hint {
  position: absolute;
  z-index: 5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.axis-y-high {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
}

.axis-y-low {
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
}

.axis-x-high {
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.axis-x-low {
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.dot {
  position: absolute;
  z-index: 4;
  width: var(--bubble-size, 24px);
  height: var(--bubble-size, 24px);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, 50%);
  cursor: pointer;
  text-decoration: none;
}

.dot.has-label {
  width: max(var(--bubble-size, 34px), 38px);
  min-width: max(var(--bubble-size, 34px), 38px);
  height: max(calc(var(--bubble-size, 34px) * 0.74), 26px);
  border-radius: 999px;
  padding: 0 9px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.dot.has-label span {
  pointer-events: none;
}

.dot[data-q="优等生候选池"],
.dot[data-q="推广观察/复刻候选"] {
  background: var(--green);
}

.dot.is-core-priority {
  box-shadow:
    0 0 0 4px rgba(18, 122, 84, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.2);
}

.dot[data-q="成交强内容机会低"],
.dot[data-q="内容弱销售强"] {
  background: var(--blue);
}

.dot[data-q="内容机会高承接弱"],
.dot[data-q="内容强销售弱"] {
  background: var(--amber);
}

.dot[data-q="差生/低承接"],
.dot[data-q="暂不上推广"] {
  background: var(--red);
}

.note-plot {
  background: #f9fbfc;
}

.note-dot {
  z-index: 8;
}

.note-dot.has-label {
  min-width: max(var(--bubble-size, 32px), 32px);
  height: max(calc(var(--bubble-size, 32px) * 0.74), 26px);
  padding: 0 8px;
}

.note-dot.has-label[data-q="推广观察/复刻候选"] {
  background: var(--green);
}

.note-dot.has-label[data-q="内容弱销售强"] {
  background: var(--blue);
}

.note-dot.has-label[data-q="内容强销售弱"] {
  background: var(--amber);
}

.note-dot.has-label[data-q="暂不上推广"] {
  background: var(--red);
}

.note-dot.has-label.refund-low,
.dot.refund-low {
  background: var(--green);
}

.note-dot.has-label.refund-watch,
.dot.refund-watch {
  background: var(--amber);
}

.note-dot.has-label.refund-mid,
.dot.refund-mid {
  background: #c4542b;
}

.note-dot.has-label.refund-high,
.dot.refund-high {
  background: var(--red);
  box-shadow:
    0 0 0 4px rgba(163, 57, 47, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.2);
}

.note-dot.has-label.refund-unknown,
.dot.refund-unknown {
  background: var(--blue);
}

.note-dot.is-clickable:hover,
.note-dot.is-clickable:focus-visible,
.note-link:focus-visible {
  outline: 3px solid rgba(18, 122, 84, 0.35);
  outline-offset: 2px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-list,
.schedule-list,
.note-grid,
.compact-table {
  display: grid;
  gap: 10px;
}

.schedule-list {
  display: flex;
  flex-direction: column;
  max-height: 760px;
  overflow-y: auto;
  align-items: stretch;
  padding-right: 6px;
}

.list-note-count {
  padding: 10px 12px;
  border: 1px solid #cfe0d4;
  border-radius: 8px;
  background: #f4faf6;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.product-compare-card {
  display: grid;
  gap: 10px;
  border: 1px solid #cfe0d4;
  border-radius: 8px;
  background: #fbfdfb;
  overflow: hidden;
}

.product-compare-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 14px 0;
}

.product-compare-head div {
  display: grid;
  gap: 4px;
}

.product-compare-head strong {
  font-size: 16px;
}

.product-compare-head span,
.product-compare-head small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.product-compare-head small {
  max-width: 360px;
  text-align: right;
}

.product-compare-scroll {
  max-height: 460px;
  overflow: auto;
  scrollbar-gutter: stable;
  border-top: 1px solid #e4ece5;
}

.product-compare-table {
  width: 100%;
  min-width: 1680px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.product-compare-table th,
.product-compare-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e6ece6;
  border-right: 1px solid #edf2ed;
  vertical-align: top;
  text-align: left;
}

.product-compare-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef8f2;
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
}

.product-compare-table tr:hover td {
  background: #f7fbf8;
}

.rank-cell {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.sku-cell strong {
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}

.product-name {
  min-width: 290px;
  max-width: 380px;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 700;
}

.id-cell {
  max-width: 180px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.source-cell {
  max-width: 210px;
  color: var(--muted);
  line-height: 1.4;
}

.action-cell {
  min-width: 240px;
  max-width: 320px;
  color: var(--muted);
  line-height: 1.45;
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 160px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f0f4f1;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.product-thumb {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f5f2;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-row,
.schedule-item,
.note-card,
.table-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.product-row {
  display: grid;
  gap: 8px;
}

.score-details {
  border: 1px solid #dbe8df;
  border-radius: 8px;
  background: #f8fbf8;
  padding: 8px 10px;
}

.score-details summary {
  color: var(--green);
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
}

.score-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.score-section {
  display: grid;
  gap: 6px;
}

.score-section strong {
  font-size: 14px;
}

.score-parts {
  display: grid;
  gap: 5px;
}

.score-parts span {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
}

.score-parts em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.35;
}

.note-row.is-highlighted {
  border-color: rgba(18, 122, 84, 0.55);
  box-shadow: 0 0 0 3px rgba(18, 122, 84, 0.12);
}

.product-row strong,
.note-card strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.note-title-link {
  color: var(--ink);
  text-decoration: none;
}

.note-title-link:hover {
  color: var(--green);
  text-decoration: underline;
}

.note-link {
  width: max-content;
  border: 1px solid rgba(18, 122, 84, 0.28);
  border-radius: 999px;
  padding: 6px 10px;
  background: #eff8f2;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.note-link:hover {
  background: #e3f2e8;
}

.link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.promotion-entry {
  border-color: rgba(36, 104, 162, 0.26);
  background: #eef5fb;
  color: var(--blue);
}

.note-link.disabled {
  background: #f3f4f2;
  border-color: var(--line);
  color: var(--muted);
}

.row-meta,
.note-metrics,
.schedule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-meta span,
.note-metrics span,
.schedule-meta span {
  padding: 5px 8px;
  background: #f1f4f1;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}

.schedule-meta a {
  border-radius: 6px;
  padding: 5px 8px;
  background: #eff8f2;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.row-meta .risk-pill,
.note-metrics .risk-pill,
.risk-pill {
  border: 1px solid transparent;
  font-weight: 800;
}

.risk-pill.refund-low {
  background: #eaf7ef;
  border-color: #b8dec5;
  color: var(--green);
}

.risk-pill.refund-watch {
  background: #fff5df;
  border-color: #f0d39a;
  color: var(--amber);
}

.risk-pill.refund-mid {
  background: #fff0e9;
  border-color: #eab59a;
  color: #a84824;
}

.risk-pill.refund-high {
  background: #fff0ee;
  border-color: #e7aaa3;
  color: var(--red);
}

.risk-pill.refund-unknown {
  background: #edf4fb;
  border-color: #bed2e7;
  color: var(--blue);
}

.filter-row .risk-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.promotion-shortlist {
  display: grid;
  gap: 12px;
  border: 1px solid #cfe0d4;
  border-radius: 8px;
  padding: 14px;
  background: #f4faf6;
}

.promotion-shortlist-head {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.promotion-shortlist-head strong {
  display: block;
  font-size: 16px;
}

.promotion-shortlist-head span {
  color: var(--muted);
  font-size: 13px;
}

.promotion-shortlist-head button,
.difficulty-controls button {
  border: 1px solid rgba(18, 122, 84, 0.22);
  border-radius: 8px;
  padding: 8px 11px;
  background: #ffffff;
  color: var(--green);
  cursor: pointer;
  font-weight: 800;
}

.margin-control,
.planner-input {
  display: grid;
  gap: 6px;
}

.margin-control small {
  max-width: 160px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.margin-control input,
.planner-input input {
  width: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
}

.promotion-shortlist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 10px;
}

.promotion-shortlist-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.promotion-shortlist-card strong {
  overflow-wrap: anywhere;
}

.topic-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}

.topic-plan-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
  max-height: 720px;
  min-height: 0;
}

.topic-plan-card strong {
  font-size: 17px;
}

.topic-plan-card p,
.topic-plan-card small {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.topic-plan-items {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 560px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.topic-plan-item {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid #dbe7de;
  border-radius: 8px;
  background: #ffffff;
}

.topic-plan-item span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.topic-plan-item b {
  overflow-wrap: anywhere;
}

.planner-controls {
  display: grid;
  grid-template-columns: auto minmax(320px, 1fr);
  gap: 14px;
  align-items: end;
  border: 1px solid #d7e4dc;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.control-label,
.planner-input span,
.margin-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.planner-summary {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef6f0;
}

.planner-summary strong {
  font-size: 14px;
}

.planner-summary span {
  color: var(--muted);
  line-height: 1.4;
  font-size: 13px;
}

.capacity-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

.capacity-meter {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 18px;
  text-align: center;
}

.capacity-meter svg {
  width: 150px;
  height: 150px;
  transform: rotate(-90deg);
}

.meter-bg,
.meter-fg {
  fill: none;
  stroke-width: 12;
}

.meter-bg {
  stroke: #e6ece6;
}

.meter-fg {
  stroke: var(--green);
  stroke-linecap: round;
  stroke-dasharray: 301.59;
  stroke-dashoffset: 301.59;
}

.capacity-meter strong {
  display: block;
  font-size: 24px;
}

.capacity-meter span {
  color: var(--muted);
}

.schedule-product {
  display: grid;
  grid-template-rows: auto auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: visible;
}

.schedule-product-header,
.schedule-product summary {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.schedule-product summary::-webkit-details-marker {
  display: none;
}

.schedule-product-main {
  display: grid;
  gap: 7px;
}

.schedule-product-main strong {
  overflow-wrap: anywhere;
}

.schedule-product-expanded .schedule-product-header {
  cursor: default;
}

.schedule-count {
  font-size: 22px;
  font-weight: 800;
  color: var(--green);
  text-align: center;
  padding: 10px;
  background: #ecf6ef;
  border-radius: 8px;
}

.schedule-reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #fbfcfa;
}

.reference-list {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
}

.reference-list-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.reference-list-head strong {
  font-size: 14px;
}

.reference-list-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reference-cards {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 520px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.reference-card {
  display: grid;
  gap: 6px;
  border: 1px solid #dbe7de;
  border-radius: 8px;
  padding: 9px;
  background: #ffffff;
}

.reference-card span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.reference-card b {
  overflow-wrap: anywhere;
}

.summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-radar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}

.product-radar-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.radar-card-head {
  display: grid;
  gap: 8px;
}

.radar-card-head .status {
  width: max-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  color: #fff;
}

.radar-card-head strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.radar-score-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.radar-score-grid span {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: #f3f6f3;
}

.radar-score-grid b,
.radar-score-grid em {
  font-size: 11px;
  color: var(--muted);
}

.radar-score-grid i {
  height: 7px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--green) var(--w), #dfe8e0 var(--w));
}

.note-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.shelf-export-bar {
  margin-bottom: 12px;
}

.shelf-export-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(18, 122, 84, 0.22);
  border-radius: 8px;
  padding: 12px 14px;
  background: #f1faf4;
}

.shelf-export-card > div {
  display: grid;
  gap: 4px;
}

.shelf-export-card strong {
  font-size: 16px;
}

.shelf-export-card span,
.shelf-export-card small {
  color: var(--muted);
  line-height: 1.45;
}

.download-link {
  white-space: nowrap;
}

.operation-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;
}

.operation-lane {
  display: grid;
  gap: 12px;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.operation-lane:first-child {
  background: #f1faf4;
  border-color: rgba(18, 122, 84, 0.24);
}

.operation-lane-head {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
}

.operation-lane-head > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  font-weight: 900;
}

.operation-lane-head strong {
  display: block;
  font-size: 17px;
}

.operation-lane-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.4;
}

.operation-items {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.operation-download {
  display: grid;
  gap: 8px;
  border: 1px dashed rgba(18, 122, 84, 0.25);
  border-radius: 8px;
  padding: 10px;
  background: #f6fbf7;
}

.operation-download span {
  color: var(--muted);
  line-height: 1.45;
}

.operation-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.operation-item strong {
  font-size: 15px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.operation-item small {
  color: var(--muted);
  line-height: 1.45;
}

.note-card {
  display: grid;
  gap: 10px;
}

.note-card .status {
  width: max-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  color: #fff;
}

.status.ok {
  background: var(--green);
}

.status.watch {
  background: var(--amber);
}

.status.pending {
  background: var(--amber);
}

.status.no {
  background: var(--red);
}

.history-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.history-grid h4 {
  margin: 0 0 10px;
}

.table-row {
  display: grid;
  gap: 6px;
}

.bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 160px) 1fr 42px;
  align-items: center;
  gap: 10px;
}

.bar-row i {
  height: 10px;
  border-radius: 999px;
  background: var(--blue);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.rule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.rule-card strong {
  display: block;
  margin-bottom: 8px;
}

.rule-card p {
  line-height: 1.55;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
    background: var(--bg);
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .kpi-grid,
  .threshold-grid,
  .quadrant-guide,
  .screenshot-wall,
  .note-grid,
  .product-radar-grid,
  .rules-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .quadrant-wrap,
  .product-priority-layout,
  .operation-lanes,
  .planner-controls,
  .promotion-shortlist-head,
  .capacity-row,
  .data-status,
  .data-gaps,
  .history-grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .quadrant-wrap {
    --quadrant-workspace-height: 620px;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .panel-head {
    flex-direction: column;
  }

  .toolbar {
    min-width: 0;
    width: 100%;
    flex-wrap: wrap;
  }

  .kpi-grid,
  .threshold-grid,
  .quadrant-guide,
  .data-gaps,
  .note-grid,
  .product-radar-grid,
  .operation-lanes,
  .promotion-shortlist-grid,
  .rules-grid {
    grid-template-columns: 1fr;
  }

  .radar-score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screenshot-wall {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 86%);
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-gutter: stable;
  }

  .screenshot-card img {
    max-height: 170px;
  }

  .quadrant-wrap {
    --quadrant-workspace-height: 560px;
  }

  .score-detail-grid {
    grid-template-columns: 1fr;
  }

  .quadrant-zone {
    padding: 10px;
  }

  .quadrant-zone strong {
    font-size: 14px;
  }

  .quadrant-zone small {
    display: none;
  }

  .dot.has-label {
    min-width: 34px;
    height: 24px;
    padding: 0 7px;
    font-size: 11px;
  }
}

:root,
:root[data-theme="light"] {
  --mathage-accent: #b6ff3c;
  --mathage-accent-top: #dbff8a;
  --mathage-accent-bottom: #8fcc2e;
  --mathage-accent-ink: #4f7700;
  --bg: #f4f1ec;
  --page-bg:
    linear-gradient(135deg, rgba(244, 241, 236, 0.96) 0%, rgba(239, 245, 235, 0.94) 42%, rgba(235, 240, 249, 0.96) 100%);
  --surface: rgba(255, 255, 255, 0.48);
  --surface-2: rgba(255, 255, 255, 0.28);
  --glass-top: rgba(255, 255, 255, 0.78);
  --glass-bottom: rgba(255, 255, 255, 0.22);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-hairline: rgba(0, 0, 0, 0.08);
  --ink: #060706;
  --muted: rgba(6, 7, 6, 0.58);
  --line: rgba(6, 7, 6, 0.10);
  --green: var(--mathage-accent);
  --blue: #4f8fdf;
  --amber: #b67816;
  --red: #ba3d34;
  --teal: #1f9c86;
  --shadow: 0 18px 48px rgba(72, 58, 36, 0.13);
  --liquid-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 3px rgba(255, 255, 255, 0.42),
    0 18px 52px rgba(82, 66, 42, 0.14);
  --accent-gradient: radial-gradient(120% 120% at 30% 0%, var(--mathage-accent-top) 0%, var(--mathage-accent) 55%, var(--mathage-accent-bottom) 100%);
}

:root[data-theme="dark"] {
  --bg: #0b0b0b;
  --page-bg:
    linear-gradient(145deg, rgba(11, 11, 11, 1) 0%, rgba(14, 14, 14, 1) 46%, rgba(0, 0, 0, 1) 100%);
  --surface: rgba(255, 255, 255, 0.07);
  --surface-2: rgba(255, 255, 255, 0.08);
  --glass-top: rgba(255, 255, 255, 0.14);
  --glass-bottom: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-hairline: rgba(255, 255, 255, 0.08);
  --ink: #f8f8f5;
  --muted: rgba(248, 248, 245, 0.56);
  --line: rgba(255, 255, 255, 0.11);
  --mathage-accent-ink: #d9ff93;
  --blue: #75aef4;
  --amber: #f2c15c;
  --red: #ff746d;
  --teal: #55dec7;
  --shadow: 0 22px 58px rgba(0, 0, 0, 0.44);
  --liquid-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 2px rgba(0, 0, 0, 0.32),
    0 22px 62px rgba(0, 0, 0, 0.42);
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--ink);
  transition: background 240ms ease, color 180ms ease;
}

body.site-loading {
  background: var(--bg);
}

body.site-loading .home-screen,
body.site-loading .auth-screen,
body.site-loading .app-shell {
  display: none !important;
}

body.is-locked {
  min-height: 100vh;
}

.home-screen,
.auth-screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--page-bg);
  color: var(--ink);
}

.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(182, 255, 60, 0.22), transparent 32%),
    linear-gradient(238deg, rgba(79, 143, 223, 0.16), transparent 40%),
    linear-gradient(0deg, rgba(255, 201, 181, 0.10), transparent 62%);
  opacity: 0.9;
}

:root[data-theme="dark"] .ambient-glow {
  background:
    linear-gradient(120deg, rgba(182, 255, 60, 0.17), transparent 32%),
    linear-gradient(236deg, rgba(60, 255, 182, 0.10), transparent 45%),
    linear-gradient(0deg, rgba(107, 182, 255, 0.10), transparent 58%);
  opacity: 0.8;
}

.liquid-glass,
.panel,
.data-status,
.side-summary,
.kpi,
.insight-card,
.screenshot-card,
.source-check,
.source-check-card,
.priority-card,
.threshold-card,
.axis-rule-card,
.guide-card,
.quadrant-plot,
.product-compare-card,
.product-row,
.schedule-item,
.note-card,
.table-row,
.rule-card,
.promotion-shortlist,
.promotion-shortlist-card,
.topic-plan-card,
.topic-plan-item,
.planner-controls,
.planner-summary,
.capacity-meter,
.operation-card,
.operation-item,
.action-card,
.product-radar-card,
.score-details,
.score-parts span {
  position: relative;
  border: 1px solid var(--glass-border);
  background:
    linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  box-shadow: var(--liquid-shadow);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
}

.liquid-glass::before,
.panel::before,
.data-status::before,
.kpi::before,
.note-card::before,
.product-row::before,
.schedule-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 34%),
    linear-gradient(315deg, rgba(255, 255, 255, 0.16), transparent 46%);
  opacity: 0.58;
}

:root[data-theme="dark"] .liquid-glass::before,
:root[data-theme="dark"] .panel::before,
:root[data-theme="dark"] .data-status::before,
:root[data-theme="dark"] .kpi::before,
:root[data-theme="dark"] .note-card::before,
:root[data-theme="dark"] .product-row::before,
:root[data-theme="dark"] .schedule-item::before {
  opacity: 0.28;
}

.site-nav {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 40px));
  min-height: 68px;
  margin: 20px auto 0;
  padding: 12px 14px 12px 18px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo,
.auth-brand {
  display: flex;
  align-items: center;
}

.site-logo img {
  width: 154px;
  height: auto;
  display: block;
}

:root[data-theme="dark"] .site-logo img,
:root[data-theme="dark"] .auth-brand img,
:root[data-theme="dark"] .brand-logo,
:root[data-theme="dark"] .device-head img {
  filter: invert(1);
}

.site-actions,
.home-cta,
.device-head,
.quick-row,
.metric-strip,
.toolbar {
  display: flex;
  align-items: center;
}

.site-actions {
  gap: 10px;
}

.pill-link,
.accent-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}

.pill-link {
  padding: 0 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-2);
}

.accent-button,
.auth-card button[type="submit"],
.time-switch button.active,
.toolbar button:not(.theme-toggle):not(.logout-btn) {
  background: var(--accent-gradient);
  color: #111509;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 -2px 5px rgba(0, 0, 0, 0.18),
    0 10px 28px rgba(182, 255, 60, 0.28);
  font-weight: 800;
}

.accent-button {
  padding: 0 20px;
}

.home-main {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.home-hero {
  min-height: calc(100vh - 92px);
  min-height: calc(100dvh - 92px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  align-items: center;
  gap: 40px;
  padding: 40px 0 58px;
}

.home-copy {
  display: grid;
  gap: 20px;
}

.ai-badge,
.auth-eyebrow {
  width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--accent-gradient);
  color: #111509;
  font-size: 12px;
  font-weight: 800;
}

.home-copy h1 {
  margin: 0;
  font-size: 84px;
  line-height: 0.98;
  font-weight: 800;
}

.home-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.72;
}

.home-cta {
  gap: 14px;
  flex-wrap: wrap;
}

.home-cta span {
  color: var(--muted);
  font-size: 13px;
}

.home-device {
  width: 100%;
  min-height: 440px;
  border-radius: 32px;
  padding: 22px;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 18px;
}

.device-head {
  justify-content: space-between;
}

.device-head img {
  width: 132px;
  height: auto;
}

.device-head span,
.quick-row span,
.metric-strip small,
.preview-card small {
  color: var(--muted);
}

.quick-row {
  gap: 8px;
  flex-wrap: wrap;
}

.quick-row span {
  min-height: 34px;
  border-radius: 999px;
  padding: 9px 12px;
  background: var(--surface-2);
  font-size: 13px;
}

.metric-strip {
  gap: 12px;
}

.metric-strip article {
  flex: 1;
  min-height: 108px;
  border-radius: 22px;
  padding: 16px;
  display: grid;
  gap: 8px;
  align-content: center;
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid var(--glass-border);
}

:root[data-theme="dark"] .metric-strip article {
  background: rgba(255, 255, 255, 0.05);
}

.metric-strip strong {
  font-size: 28px;
}

.preview-card {
  min-height: 76px;
  border-radius: 22px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid var(--glass-border);
}

:root[data-theme="dark"] .preview-card {
  background: rgba(255, 255, 255, 0.05);
}

.preview-card > span {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: var(--accent-gradient);
  box-shadow: 0 10px 24px rgba(182, 255, 60, 0.24);
}

.preview-card div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.preview-card strong,
.preview-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted-preview > span {
  background: linear-gradient(135deg, #7fb4ff, #cbb7ff);
  box-shadow: 0 10px 24px rgba(127, 180, 255, 0.18);
}

@media (max-width: 720px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell,
  .sidebar,
  .main,
  .topbar,
  .panel,
  .data-status {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .app-shell {
    overflow-x: hidden;
  }

  .sidebar {
    overflow: hidden;
  }

  .field,
  .field select,
  .side-summary,
  .nav {
    max-width: 100%;
    min-width: 0;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
  }

  .topbar > div,
  .topbar h2,
  .eyebrow,
  .data-status strong {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .toolbar {
    min-width: 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .time-switch {
    flex: 1 1 100%;
    min-width: 0;
  }

  .time-switch button {
    flex: 1 1 0;
    min-width: 0;
  }

  .toolbar input {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .dashboard-theme-toggle,
  .toolbar .logout-btn,
  .toolbar button:not(.theme-toggle):not(.logout-btn) {
    flex: 0 0 auto;
  }

  .data-status {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-compare-scroll,
  .screenshot-wall,
  .nav {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
}

.theme-toggle {
  position: relative;
  width: 54px;
  min-width: 54px;
  height: 26px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  background:
    linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 6px 18px rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.theme-toggle span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #232323, #050505);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 2px 7px rgba(0, 0, 0, 0.25);
  transition: transform 180ms ease, background 180ms ease;
}

:root[data-theme="light"] .theme-toggle span {
  transform: translateX(28px);
  background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.68));
}

.auth-card .theme-toggle {
  min-height: 26px;
  width: 54px;
  height: 26px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0;
  background:
    linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  color: inherit;
  font-weight: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 6px 18px rgba(0, 0, 0, 0.10);
}

.auth-screen {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  z-index: 1;
  width: min(430px, 100%);
  gap: 18px;
  padding: 28px;
  border-radius: 30px;
  color: var(--ink);
}

.auth-brand {
  justify-content: space-between;
  gap: 16px;
}

.auth-brand img {
  width: 148px;
  height: auto;
}

.auth-card h1 {
  margin-top: 12px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.2;
}

.auth-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-card label {
  color: var(--muted);
}

.auth-card input,
.field select,
.toolbar input,
.margin-control input,
.planner-input input {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

:root[data-theme="dark"] .auth-card input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .toolbar input,
:root[data-theme="dark"] .margin-control input,
:root[data-theme="dark"] .planner-input input {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.auth-card input:focus,
.field select:focus,
.toolbar input:focus,
.margin-control input:focus,
.planner-input input:focus {
  outline: 3px solid rgba(182, 255, 60, 0.24);
  border-color: rgba(182, 255, 60, 0.62);
}

.auth-card button[type="submit"] {
  min-height: 48px;
  border-radius: 999px;
}

.auth-message {
  color: var(--red);
}

body.is-locked .app-shell {
  display: none;
}

.app-shell {
  position: relative;
  isolation: isolate;
  grid-template-columns: 292px minmax(0, 1fr);
  background: var(--page-bg);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(182, 255, 60, 0.13), transparent 30%),
    linear-gradient(238deg, rgba(79, 143, 223, 0.13), transparent 42%),
    linear-gradient(0deg, rgba(255, 201, 181, 0.08), transparent 64%);
}

.sidebar {
  z-index: 1;
  padding: 22px 18px;
  background:
    linear-gradient(180deg, rgba(8, 9, 8, 0.88), rgba(8, 9, 8, 0.58));
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.10),
    18px 0 44px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
}

:root[data-theme="light"] .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.30));
  border-right-color: var(--glass-border);
  color: var(--ink);
}

.brand {
  align-items: center;
}

.brand-logo {
  width: 136px;
  height: auto;
  display: block;
}

.brand h1 {
  font-size: 16px;
}

:root[data-theme="light"] .brand p,
:root[data-theme="light"] .field span,
:root[data-theme="light"] .side-summary span,
:root[data-theme="light"] .side-summary small,
:root[data-theme="light"] .nav a {
  color: var(--muted);
}

.brand-mark {
  display: none;
}

.nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav a:hover {
  border-color: var(--glass-border);
  background: var(--surface-2);
  color: var(--ink);
}

:root[data-theme="dark"] .nav a:hover {
  color: #ffffff;
}

.main {
  position: relative;
  z-index: 1;
  padding: 26px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: -8px -8px 0;
  padding: 12px;
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  background:
    linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  box-shadow: var(--liquid-shadow);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

.topbar h2 {
  color: var(--ink);
  font-size: 26px;
  line-height: 1.18;
}

.eyebrow,
.panel-period,
.note-link,
.schedule-meta a,
.topic-plan-item span,
.score-details summary,
.source-check-card em,
.control-label,
.planner-input span,
.margin-control span {
  color: var(--mathage-accent-ink);
}

:root[data-theme="dark"] .eyebrow,
:root[data-theme="dark"] .panel-period,
:root[data-theme="dark"] .note-link,
:root[data-theme="dark"] .schedule-meta a,
:root[data-theme="dark"] .topic-plan-item span,
:root[data-theme="dark"] .score-details summary,
:root[data-theme="dark"] .source-check-card em,
:root[data-theme="dark"] .control-label,
:root[data-theme="dark"] .planner-input span,
:root[data-theme="dark"] .margin-control span {
  color: var(--mathage-accent);
}

.toolbar {
  gap: 8px;
}

.toolbar button,
.logout-btn,
.promotion-shortlist-head button,
.difficulty-controls button {
  border-radius: 999px;
}

.dashboard-theme-toggle {
  padding: 0;
}

.logout-btn,
.toolbar .logout-btn {
  border: 1px solid var(--glass-border);
  background: var(--surface-2);
  color: var(--muted);
}

.time-switch,
.status-pill,
.summary-pills span,
.summary-pills button,
.legend span,
.legend-chip,
.mini-pill,
.row-meta span,
.note-metrics span,
.schedule-meta span,
.filter-row .risk-pill,
.guide-card span,
.priority-card span,
.quadrant-zone span,
.threshold-label,
.compare span {
  border: 1px solid var(--glass-border);
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.panel {
  border-radius: 28px;
  padding: 20px;
  overflow: hidden;
}

.data-status {
  border-left: 1px solid var(--glass-border);
  border-radius: 24px;
}

.status-grid span {
  border-color: var(--glass-border);
  background: var(--surface-2);
  color: var(--ink);
}

.kpi,
.insight-card,
.screenshot-card,
.source-check,
.source-check-card,
.priority-card,
.threshold-card,
.axis-rule-card,
.guide-card,
.quadrant-plot,
.product-compare-card,
.product-row,
.schedule-item,
.note-card,
.table-row,
.rule-card,
.promotion-shortlist,
.promotion-shortlist-card,
.topic-plan-card,
.topic-plan-item,
.planner-controls,
.capacity-meter,
.operation-card,
.operation-item,
.action-card,
.product-radar-card {
  border-radius: 18px;
}

.kpi,
.kpi *,
.compare,
.compare span,
.metric-note {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.compare span {
  overflow: hidden;
}

.priority-card.main,
.legend-chip.active,
.guide-card.active {
  border-color: rgba(182, 255, 60, 0.38);
  background:
    linear-gradient(180deg, rgba(182, 255, 60, 0.16), rgba(255, 255, 255, 0.18));
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    0 14px 34px rgba(182, 255, 60, 0.12);
}

:root[data-theme="dark"] .priority-card.main,
:root[data-theme="dark"] .legend-chip.active,
:root[data-theme="dark"] .guide-card.active {
  background:
    linear-gradient(180deg, rgba(182, 255, 60, 0.15), rgba(255, 255, 255, 0.04));
}

.panel h3,
.subhead h4,
.source-check-head strong,
.axis-rule-card strong,
.topic-plan-card strong,
.priority-card strong,
.product-row strong,
.note-card strong,
.source-check-card strong,
.rule-card strong,
.product-name,
.sku-cell strong,
.axis-rule-card b,
.metric-strip strong,
.preview-card strong {
  color: var(--ink);
}

.panel p,
.insight-card small,
.kpi small,
.note-card small,
.product-row small,
.subhead span,
.source-check-head span,
.axis-rule-card p,
.axis-rule-card li,
.guide-card p,
.guide-card small,
.topic-plan-card p,
.topic-plan-card small,
.topic-plan-item small,
.source-check-card small,
.source-check-card span,
.source-check-card p,
.source-check-card em,
.product-compare-head span,
.product-compare-head small,
.source-cell,
.action-cell,
.id-cell,
.rank-cell,
.score-parts em,
.row-meta span,
.note-metrics span,
.schedule-meta span,
.data-status span,
.data-status small,
.screenshot-card span,
.screenshot-card p,
.operation-item small {
  color: var(--muted);
}

.product-compare-scroll,
.product-compare-table th,
.product-compare-table td {
  border-color: var(--line);
}

.product-compare-table th {
  background: rgba(182, 255, 60, 0.18);
  color: var(--mathage-accent-ink);
}

:root[data-theme="dark"] .product-compare-table th {
  color: var(--mathage-accent);
}

.product-compare-table tr:hover td {
  background: rgba(182, 255, 60, 0.08);
}

.quadrant-zone {
  color: var(--ink);
}

.quadrant-zone p {
  color: var(--muted);
}

.zone-tr {
  background: rgba(182, 255, 60, 0.10);
}

.zone-br {
  background: rgba(79, 143, 223, 0.11);
}

.zone-tl {
  background: rgba(242, 193, 92, 0.12);
}

.zone-bl {
  background: rgba(255, 116, 109, 0.10);
}

.ratio-bar,
.weight-list i {
  background: rgba(255, 255, 255, 0.26);
}

.ratio-bar i,
.weight-list i::before {
  background: linear-gradient(90deg, var(--mathage-accent), var(--teal));
}

.dot[data-q="优等生候选池"],
.dot[data-q="推广观察/复刻候选"],
.note-dot.has-label[data-q="推广观察/复刻候选"],
.note-dot.has-label.refund-low,
.dot.refund-low,
.status.ok {
  background: var(--accent-gradient);
  color: #111509;
}

.dot.is-core-priority,
.note-row.is-highlighted {
  box-shadow:
    0 0 0 4px rgba(182, 255, 60, 0.22),
    0 12px 26px rgba(0, 0, 0, 0.22);
}

.note-link,
.schedule-meta a,
.promotion-shortlist-head button,
.difficulty-controls button {
  border-color: rgba(182, 255, 60, 0.34);
  background: rgba(182, 255, 60, 0.12);
}

.note-link:hover {
  background: rgba(182, 255, 60, 0.20);
}

.shot-link,
.shot-placeholder {
  background:
    linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
}

.screenshot-card img {
  background: rgba(255, 255, 255, 0.40);
  border-bottom-color: var(--line);
}

:root[data-theme="dark"] .screenshot-card img {
  background: rgba(255, 255, 255, 0.08);
}

.risk-pill.refund-low {
  background: rgba(182, 255, 60, 0.15);
  border-color: rgba(182, 255, 60, 0.38);
  color: var(--mathage-accent-ink);
}

:root[data-theme="dark"] .risk-pill.refund-low {
  color: var(--mathage-accent);
}

.risk-pill.refund-watch {
  background: rgba(242, 193, 92, 0.16);
}

.risk-pill.refund-mid {
  background: rgba(255, 150, 91, 0.14);
}

.risk-pill.refund-high {
  background: rgba(255, 116, 109, 0.13);
}

.risk-pill.refund-unknown,
.promotion-entry {
  background: rgba(79, 143, 223, 0.14);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--glass-border);
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .home-device {
    max-width: 560px;
  }
}

@media (max-width: 720px) {
  .site-nav {
    width: min(100% - 24px, 1120px);
    min-height: 60px;
    margin-top: 12px;
    padding: 10px;
  }

  .site-logo img {
    width: 128px;
  }

  .pill-link {
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }

  .home-main {
    width: min(100% - 24px, 1120px);
  }

  .home-hero {
    min-height: auto;
    padding: 52px 0 36px;
  }

  .home-copy h1 {
    font-size: 52px;
  }

  .home-copy p {
    font-size: 16px;
  }

  .home-device {
    min-height: 360px;
    border-radius: 26px;
    padding: 16px;
  }

  .metric-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-screen {
    padding: 14px;
  }

  .auth-card {
    border-radius: 26px;
    padding: 22px;
  }

  .auth-brand img {
    width: 128px;
  }

  .main {
    padding: 14px;
  }

  .topbar {
    position: relative;
    margin: 0;
    border-radius: 24px;
  }

  .topbar h2 {
    font-size: 22px;
  }

  .toolbar input {
    min-width: 100%;
  }

  .panel {
    border-radius: 24px;
    padding: 16px;
  }

  .brand {
    justify-content: space-between;
  }

  .sidebar {
    padding: 18px 18px 14px;
    gap: 14px;
  }

  .brand-logo {
    width: 132px;
  }

  .field {
    gap: 6px;
  }

  .field select {
    padding: 9px 12px;
  }

  .side-summary {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 4px 12px;
    padding: 12px 14px;
  }

  .side-summary strong {
    font-size: 24px;
  }

  .side-summary small {
    grid-column: 1 / -1;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -18px;
    padding: 0 18px 4px;
    scrollbar-gutter: stable;
  }

  .nav a {
    flex: 0 0 auto;
    border: 1px solid var(--glass-border);
    background: var(--surface-2);
    white-space: nowrap;
  }
}

/* Liquid Glass pass: clearer lenses, stronger refraction edges, less frosted haze. */
:root,
:root[data-theme="light"] {
  --liquid-fill-a: rgba(255, 255, 255, 0.34);
  --liquid-fill-b: rgba(255, 255, 255, 0.13);
  --liquid-edge: rgba(255, 255, 255, 0.88);
  --liquid-edge-soft: rgba(255, 255, 255, 0.38);
  --liquid-shadow-deep: rgba(70, 54, 34, 0.18);
  --liquid-tint: rgba(182, 255, 60, 0.08);
}

:root[data-theme="dark"] {
  --liquid-fill-a: rgba(255, 255, 255, 0.115);
  --liquid-fill-b: rgba(255, 255, 255, 0.028);
  --liquid-edge: rgba(255, 255, 255, 0.26);
  --liquid-edge-soft: rgba(255, 255, 255, 0.10);
  --liquid-shadow-deep: rgba(0, 0, 0, 0.46);
  --liquid-tint: rgba(182, 255, 60, 0.055);
}

.liquid-glass,
.topbar,
.panel,
.data-status,
.side-summary,
.kpi,
.insight-card,
.screenshot-card,
.source-check,
.source-check-card,
.priority-card,
.threshold-card,
.axis-rule-card,
.guide-card,
.quadrant-plot,
.product-compare-card,
.product-row,
.schedule-item,
.note-card,
.table-row,
.rule-card,
.promotion-shortlist,
.promotion-shortlist-card,
.topic-plan-card,
.topic-plan-item,
.planner-controls,
.planner-summary,
.capacity-meter,
.operation-card,
.operation-item,
.action-card,
.product-radar-card,
.score-details,
.score-parts span,
.metric-strip article,
.preview-card {
  overflow: hidden;
  background:
    radial-gradient(110% 130% at 8% 0%, rgba(255, 255, 255, 0.36), transparent 34%),
    radial-gradient(115% 110% at 100% 100%, var(--liquid-tint), transparent 46%),
    linear-gradient(135deg, var(--liquid-fill-a), var(--liquid-fill-b) 52%, rgba(255, 255, 255, 0.055));
  border-color: var(--liquid-edge);
  box-shadow:
    inset 1px 1px 0 var(--liquid-edge),
    inset -1px -1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -18px 36px rgba(0, 0, 0, 0.10),
    0 20px 58px var(--liquid-shadow-deep);
  backdrop-filter: blur(9px) saturate(220%) contrast(1.14) brightness(1.06);
  -webkit-backdrop-filter: blur(9px) saturate(220%) contrast(1.14) brightness(1.06);
}

:root[data-theme="light"] .liquid-glass,
:root[data-theme="light"] .topbar,
:root[data-theme="light"] .panel,
:root[data-theme="light"] .data-status,
:root[data-theme="light"] .side-summary,
:root[data-theme="light"] .kpi,
:root[data-theme="light"] .insight-card,
:root[data-theme="light"] .screenshot-card,
:root[data-theme="light"] .source-check,
:root[data-theme="light"] .source-check-card,
:root[data-theme="light"] .priority-card,
:root[data-theme="light"] .threshold-card,
:root[data-theme="light"] .axis-rule-card,
:root[data-theme="light"] .guide-card,
:root[data-theme="light"] .quadrant-plot,
:root[data-theme="light"] .product-compare-card,
:root[data-theme="light"] .product-row,
:root[data-theme="light"] .schedule-item,
:root[data-theme="light"] .note-card,
:root[data-theme="light"] .table-row,
:root[data-theme="light"] .rule-card,
:root[data-theme="light"] .promotion-shortlist,
:root[data-theme="light"] .promotion-shortlist-card,
:root[data-theme="light"] .topic-plan-card,
:root[data-theme="light"] .topic-plan-item,
:root[data-theme="light"] .planner-controls,
:root[data-theme="light"] .planner-summary,
:root[data-theme="light"] .capacity-meter,
:root[data-theme="light"] .operation-card,
:root[data-theme="light"] .operation-item,
:root[data-theme="light"] .action-card,
:root[data-theme="light"] .product-radar-card,
:root[data-theme="light"] .score-details,
:root[data-theme="light"] .score-parts span,
:root[data-theme="light"] .metric-strip article,
:root[data-theme="light"] .preview-card {
  box-shadow:
    inset 1px 1px 0 var(--liquid-edge),
    inset -1px -1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -20px 38px rgba(255, 255, 255, 0.22),
    0 20px 58px var(--liquid-shadow-deep);
}

.liquid-glass::before,
.topbar::before,
.panel::before,
.data-status::before,
.kpi::before,
.note-card::before,
.product-row::before,
.schedule-item::before,
.home-device::before,
.auth-card::before {
  background:
    linear-gradient(112deg, transparent 0 17%, rgba(255, 255, 255, 0.35) 18%, rgba(255, 255, 255, 0.06) 27%, transparent 39%),
    radial-gradient(90% 80% at 12% 0%, rgba(255, 255, 255, 0.42), transparent 58%),
    radial-gradient(70% 70% at 102% 100%, rgba(182, 255, 60, 0.12), transparent 58%);
  opacity: 0.72;
  mix-blend-mode: screen;
}

:root[data-theme="dark"] .liquid-glass::before,
:root[data-theme="dark"] .topbar::before,
:root[data-theme="dark"] .panel::before,
:root[data-theme="dark"] .data-status::before,
:root[data-theme="dark"] .kpi::before,
:root[data-theme="dark"] .note-card::before,
:root[data-theme="dark"] .product-row::before,
:root[data-theme="dark"] .schedule-item::before,
:root[data-theme="dark"] .home-device::before,
:root[data-theme="dark"] .auth-card::before {
  opacity: 0.48;
}

.liquid-glass::after,
.topbar::after,
.panel::after,
.data-status::after,
.home-device::after,
.auth-card::after,
.kpi::after,
.note-card::after,
.product-row::after,
.schedule-item::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 11%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent 7%, transparent 93%, rgba(255, 255, 255, 0.16)),
    radial-gradient(120% 70% at 50% 112%, rgba(255, 255, 255, 0.16), transparent 54%);
  opacity: 0.70;
}

:root[data-theme="dark"] .liquid-glass::after,
:root[data-theme="dark"] .topbar::after,
:root[data-theme="dark"] .panel::after,
:root[data-theme="dark"] .data-status::after,
:root[data-theme="dark"] .home-device::after,
:root[data-theme="dark"] .auth-card::after,
:root[data-theme="dark"] .kpi::after,
:root[data-theme="dark"] .note-card::after,
:root[data-theme="dark"] .product-row::after,
:root[data-theme="dark"] .schedule-item::after {
  opacity: 0.42;
}

.site-nav,
.auth-card,
.home-device,
.topbar,
.panel {
  transform: translateZ(0);
}

.accent-button,
.auth-card button[type="submit"],
.time-switch button.active,
.toolbar button:not(.theme-toggle):not(.logout-btn),
.preview-card > span,
.theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.42);
  background:
    radial-gradient(110% 130% at 24% 0%, #ecffbd 0%, var(--mathage-accent) 48%, #79b91f 100%);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.78),
    inset -2px -4px 9px rgba(48, 88, 0, 0.28),
    0 14px 32px rgba(182, 255, 60, 0.28),
    0 2px 5px rgba(0, 0, 0, 0.22);
}

.theme-toggle {
  background:
    linear-gradient(180deg, var(--liquid-fill-a), var(--liquid-fill-b));
  box-shadow:
    inset 1px 1px 0 var(--liquid-edge),
    inset -1px -1px 0 rgba(255, 255, 255, 0.08),
    0 8px 22px var(--liquid-shadow-deep);
}

.auth-card .theme-toggle {
  background:
    linear-gradient(180deg, var(--liquid-fill-a), var(--liquid-fill-b));
  box-shadow:
    inset 1px 1px 0 var(--liquid-edge),
    inset -1px -1px 0 rgba(255, 255, 255, 0.08),
    0 8px 22px var(--liquid-shadow-deep);
}

.site-nav::before,
.home-device::before,
.auth-card::before {
  background:
    linear-gradient(112deg, transparent 0 18%, rgba(255, 255, 255, 0.22) 19%, rgba(255, 255, 255, 0.045) 28%, transparent 39%),
    radial-gradient(90% 80% at 12% 0%, rgba(255, 255, 255, 0.34), transparent 58%),
    radial-gradient(70% 70% at 102% 100%, rgba(182, 255, 60, 0.11), transparent 58%);
  opacity: 0.50;
}

.topbar::before,
.panel::before,
.data-status::before {
  background:
    linear-gradient(112deg, transparent 0 19%, rgba(255, 255, 255, 0.13) 20%, rgba(255, 255, 255, 0.025) 29%, transparent 41%),
    radial-gradient(80% 70% at 9% 0%, rgba(255, 255, 255, 0.20), transparent 56%),
    radial-gradient(70% 70% at 102% 100%, rgba(182, 255, 60, 0.06), transparent 58%);
  opacity: 0.32;
}

.kpi::before,
.note-card::before,
.product-row::before,
.schedule-item::before {
  background:
    linear-gradient(112deg, transparent 0 18%, rgba(255, 255, 255, 0.15) 19%, rgba(255, 255, 255, 0.03) 30%, transparent 42%),
    radial-gradient(80% 70% at 10% 0%, rgba(255, 255, 255, 0.20), transparent 58%),
    radial-gradient(70% 70% at 102% 100%, rgba(182, 255, 60, 0.08), transparent 58%);
  opacity: 0.40;
}

:root[data-theme="dark"] .site-nav::before,
:root[data-theme="dark"] .home-device::before,
:root[data-theme="dark"] .auth-card::before {
  opacity: 0.42;
}

:root[data-theme="dark"] .topbar::before,
:root[data-theme="dark"] .panel::before,
:root[data-theme="dark"] .data-status::before {
  opacity: 0.24;
}

:root[data-theme="dark"] .kpi::before,
:root[data-theme="dark"] .note-card::before,
:root[data-theme="dark"] .product-row::before,
:root[data-theme="dark"] .schedule-item::before {
  opacity: 0.30;
}

/* Figma Make v142 Liquid Glass tokens. */
:root,
:root[data-theme="light"] {
  --liquid-bg:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.44) 42%, rgba(255, 255, 255, 0.24) 100%);
  --liquid-border: rgba(255, 255, 255, 0.80);
  --liquid-shadow-v142:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 1px 0 0 rgba(255, 255, 255, 0.72),
    inset 0 -18px 34px rgba(255, 255, 255, 0.36),
    0 16px 42px -22px rgba(86, 66, 42, 0.42);
  --liquid-before-v142:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.96), transparent 32%),
    linear-gradient(118deg, rgba(255, 255, 255, 0.76), transparent 20%, transparent 68%, rgba(255, 255, 255, 0.42));
  --liquid-before-opacity-v142: 0.90;
  --liquid-after-border-v142: rgba(255, 255, 255, 0.45);
  --liquid-filter-v142: blur(30px) saturate(180%);
  --chip-bg-v142: rgba(255, 255, 255, 0.55);
  --chip-border-v142: rgba(255, 255, 255, 0.75);
  --chip-shadow-v142:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 8px 20px -14px rgba(120, 90, 60, 0.28);
  --icon-well-bg-v142: rgba(255, 255, 255, 0.50);
  --icon-well-border-v142: rgba(255, 255, 255, 0.70);
  --icon-well-shadow-v142:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -8px 14px rgba(255, 255, 255, 0.24);
}

:root[data-theme="dark"] {
  --liquid-bg:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.075) 38%, rgba(255, 255, 255, 0.035) 100%);
  --liquid-border: rgba(255, 255, 255, 0.18);
  --liquid-shadow-v142:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    inset 1px 0 0 rgba(255, 255, 255, 0.14),
    inset 0 -18px 32px rgba(255, 255, 255, 0.035),
    0 18px 48px -22px rgba(0, 0, 0, 0.85);
  --liquid-before-v142:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.34), transparent 34%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.22), transparent 18%, transparent 72%, rgba(255, 255, 255, 0.10));
  --liquid-before-opacity-v142: 0.80;
  --liquid-after-border-v142: rgba(255, 255, 255, 0.08);
  --liquid-filter-v142: blur(28px) saturate(185%);
  --chip-bg-v142: rgba(255, 255, 255, 0.09);
  --chip-border-v142: rgba(255, 255, 255, 0.16);
  --chip-shadow-v142:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 8px 22px -14px rgba(0, 0, 0, 0.70);
  --icon-well-bg-v142: rgba(255, 255, 255, 0.075);
  --icon-well-border-v142: rgba(255, 255, 255, 0.10);
  --icon-well-shadow-v142: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.liquid-glass,
.topbar,
.panel,
.data-status,
.side-summary,
.kpi,
.insight-card,
.screenshot-card,
.source-check,
.source-check-card,
.priority-card,
.threshold-card,
.axis-rule-card,
.guide-card,
.quadrant-plot,
.product-compare-card,
.product-row,
.schedule-item,
.note-card,
.table-row,
.rule-card,
.promotion-shortlist,
.promotion-shortlist-card,
.topic-plan-card,
.topic-plan-item,
.planner-controls,
.planner-summary,
.capacity-meter,
.operation-card,
.operation-item,
.action-card,
.product-radar-card,
.score-details,
.score-parts span,
.metric-strip article,
.preview-card {
  isolation: isolate;
  overflow: hidden;
  border-color: var(--liquid-border);
  background: var(--liquid-bg);
  box-shadow: var(--liquid-shadow-v142);
  backdrop-filter: var(--liquid-filter-v142);
  -webkit-backdrop-filter: var(--liquid-filter-v142);
}

.liquid-glass::before,
.topbar::before,
.panel::before,
.data-status::before,
.side-summary::before,
.kpi::before,
.insight-card::before,
.screenshot-card::before,
.source-check::before,
.source-check-card::before,
.priority-card::before,
.threshold-card::before,
.axis-rule-card::before,
.guide-card::before,
.quadrant-plot::before,
.product-compare-card::before,
.product-row::before,
.schedule-item::before,
.note-card::before,
.table-row::before,
.rule-card::before,
.promotion-shortlist::before,
.promotion-shortlist-card::before,
.topic-plan-card::before,
.topic-plan-item::before,
.planner-controls::before,
.planner-summary::before,
.capacity-meter::before,
.operation-card::before,
.operation-item::before,
.action-card::before,
.product-radar-card::before,
.score-details::before,
.score-parts span::before,
.metric-strip article::before,
.preview-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: var(--liquid-before-v142);
  opacity: var(--liquid-before-opacity-v142);
  mix-blend-mode: normal;
}

.liquid-glass::after,
.topbar::after,
.panel::after,
.data-status::after,
.side-summary::after,
.kpi::after,
.insight-card::after,
.screenshot-card::after,
.source-check::after,
.source-check-card::after,
.priority-card::after,
.threshold-card::after,
.axis-rule-card::after,
.guide-card::after,
.quadrant-plot::after,
.product-compare-card::after,
.product-row::after,
.schedule-item::after,
.note-card::after,
.table-row::after,
.rule-card::after,
.promotion-shortlist::after,
.promotion-shortlist-card::after,
.topic-plan-card::after,
.topic-plan-item::after,
.planner-controls::after,
.planner-summary::after,
.capacity-meter::after,
.operation-card::after,
.operation-item::after,
.action-card::after,
.product-radar-card::after,
.score-details::after,
.score-parts span::after,
.metric-strip article::after,
.preview-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid var(--liquid-after-border-v142);
  border-radius: inherit;
  pointer-events: none;
}

.time-switch,
.status-pill,
.summary-pills span,
.summary-pills button,
.legend span,
.legend-chip,
.mini-pill,
.row-meta span,
.note-metrics span,
.schedule-meta span,
.filter-row .risk-pill,
.guide-card span,
.priority-card span,
.quadrant-zone span,
.threshold-label,
.compare span,
.quick-row span {
  border-color: var(--chip-border-v142);
  background: var(--chip-bg-v142);
  box-shadow: var(--chip-shadow-v142);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.theme-toggle,
.auth-card .theme-toggle,
.preview-card > span,
.brand-mark,
.shot-placeholder {
  border-color: var(--icon-well-border-v142);
  background: var(--icon-well-bg-v142);
  box-shadow: var(--icon-well-shadow-v142);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
}

.accent-button,
.auth-card button[type="submit"],
.time-switch button.active,
.toolbar button:not(.theme-toggle):not(.logout-btn) {
  background: var(--accent-gradient);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.60),
    inset 0 -2px 4px rgba(0, 0, 0, 0.15),
    0 4px 12px -2px rgba(182, 255, 60, 0.50);
}

.preview-card > span {
  border-color: rgba(255, 255, 255, 0.42);
  background: var(--accent-gradient);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.60),
    inset 0 -2px 4px rgba(0, 0, 0, 0.15),
    0 10px 24px rgba(182, 255, 60, 0.24);
}

.muted-preview > span {
  background: linear-gradient(135deg, #7fb4ff, #cbb7ff);
  box-shadow: 0 10px 24px rgba(127, 180, 255, 0.18);
}
