:root {
  --ink: #12362b;
  --muted: #708079;
  --green: #137653;
  --lime: #ccef64;
  --paper: #f5f8f2;
  --card: #ffffff;
  --line: #dce7df;
  --red: #d75c55;
  --blue: #4d8fe8;
  --shadow-sm: 0 4px 16px rgba(30, 73, 56, .06);
  --shadow-md: 0 12px 34px rgba(30, 73, 56, .09);
}

body {
  grid-template-columns: 218px 1fr;
  background:
    radial-gradient(circle at 82% 5%, rgba(204, 239, 100, .16), transparent 24%),
    radial-gradient(circle at 35% 95%, rgba(77, 143, 232, .08), transparent 27%),
    var(--paper);
  letter-spacing: .01em;
}

aside {
  position: relative;
  overflow: hidden;
  padding: 24px 16px 20px;
  color: #29483e;
  background:
    radial-gradient(circle at 10% 2%, rgba(137, 213, 176, .18), transparent 22%),
    linear-gradient(180deg, #fbfdf9 0%, #f4f8f4 58%, #f8faf6 100%);
  border-right: 1px solid #dce8e0;
  box-shadow: 8px 0 30px rgba(37, 73, 57, .05);
}
aside::before {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: -125px;
  left: auto;
  bottom: -85px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(89, 149, 217, .10), transparent 67%);
  pointer-events: none;
}

.brand {
  position: relative;
  gap: 11px;
  margin: 0 2px 34px;
  padding: 4px 0;
  align-items: center;
}
.brand-mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(145deg, #dff57d 0%, #8fd8ac 54%, #79b9df 100%);
  box-shadow: 0 8px 20px rgba(66, 133, 103, .16), inset 0 1px rgba(255,255,255,.72);
  color: #164d3c;
}
.brand-mark svg { width: 31px; height: 31px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark .brand-signal { stroke: #fff; stroke-width: 2.6; }
.brand-copy { min-width: 0; }
.brand b { color: #183d32; font-size: 14px; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; }
.brand small { color: #71877f; margin-top: 5px; font-size: 10.5px; white-space: nowrap; }

nav { position: relative; gap: 9px; }
.nav {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 44px;
  padding: 11px 14px;
  color: #577067;
  border: 1px solid transparent;
  overflow: hidden;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}
.nav.hidden { display: none; }

.viewer-login {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f4f7f3;
}
.viewer-login.hidden { display: none; }
.viewer-login-panel {
  width: min(420px, 100%);
  padding: 34px 36px 30px;
  border: 1px solid #d7e0da;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(27, 48, 39, .12);
}
.viewer-login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: #153f32;
  font-size: 15px;
}
.viewer-login-brand .brand-mark { width: 34px; height: 34px; }
.viewer-login-panel h1 { margin: 0; font-size: 24px; line-height: 1.3; }
.viewer-login-panel > p { margin: 8px 0 24px; color: #64716b; font-size: 14px; }
.viewer-login-panel label { display: grid; gap: 7px; margin-top: 14px; color: #405249; font-size: 13px; font-weight: 700; }
.viewer-login-panel input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #cdd8d2;
  border-radius: 6px;
  background: #fff;
  color: #15231d;
  font: inherit;
  outline: none;
}
.viewer-login-panel input:focus { border-color: #1b8c68; box-shadow: 0 0 0 3px rgba(27, 140, 104, .12); }
.viewer-login-panel .primary { width: 100%; height: 44px; margin-top: 18px; }
.viewer-login-panel > small { display: block; margin-top: 14px; color: #78847e; text-align: center; }
.viewer-login-error { margin-top: 14px; padding: 10px 12px; border-left: 3px solid #c94040; background: #fff5f4; color: #9f2e2e; font-size: 13px; }
.viewer-logout {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #53675d;
  font-size: 12px;
  cursor: pointer;
}
.viewer-logout:hover { color: #146d52; text-decoration: underline; }
.sharing-auth-panel { padding: 16px 0; border-top: 1px solid #e3e9e5; border-bottom: 1px solid #e3e9e5; }
.sharing-auth-panel h3 { margin: 0 0 4px; font-size: 15px; }
.sharing-auth-panel > p { margin: 0 0 12px; color: #68766f; font-size: 12px; }
.sharing-auth-fields { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; align-items: end; }
.sharing-auth-fields label { display: grid; gap: 5px; color: #53655c; font-size: 12px; font-weight: 700; }
.sharing-auth-fields input { height: 40px; min-width: 0; padding: 0 10px; border: 1px solid #d4ddd8; border-radius: 6px; font: inherit; }
@media (max-width: 720px) {
  .viewer-login-panel { padding: 28px 22px 24px; }
  .sharing-auth-fields { grid-template-columns: 1fr; }
}
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#insightrackrNav .nav-label { font-size: 12.5px; letter-spacing: -.02em; }
.nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #eaf1ed;
  color: #58756a;
  font-size: 15px;
}
.nav:hover { background: #edf5f0; color: #1f5a45; transform: translateX(2px); }
.nav.active {
  background: linear-gradient(100deg, #e3f4e9, #edf7f2);
  color: #14553f;
  border-color: #cfe5d8;
  box-shadow: inset 3px 0 #79c99b, 0 6px 16px rgba(42, 103, 77, .07);
}
.nav.active .nav-icon { background: #cfee78; color: #24533f; box-shadow: 0 3px 8px rgba(91, 146, 84, .14); }
.nav-child.active { background: transparent; border-color: transparent; box-shadow: none; color: #14553f; font-weight: 750; }
.nav-child.active .nav-icon { box-shadow: none; }
.nav-child.active::before { color: #77bb96; }
.sidebar-foot { position: relative; color: #82958e; padding: 10px 6px; border-top: 1px solid #e0e9e3; }
.sidebar-foot span { color: #9aa9a3; }

main { padding-top: 24px; }
header {
  position: relative;
  z-index: 20;
  min-height: 58px;
  padding: 10px 16px 10px 20px;
  gap: 14px;
  flex-wrap: nowrap;
  border: 1px solid rgba(193, 218, 203, .78);
  border-radius: 15px;
  background:
    linear-gradient(110deg, rgba(255,255,255,.98), rgba(248, 252, 245, .96)),
    var(--card);
  box-shadow: var(--shadow-sm);
  overflow: visible;
}
header::after {
  display: none;
}
.header-copy {
  position: relative;
  z-index: 1;
  flex: 1 1 260px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: end;
  min-width: 0;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  grid-column: 1 / -1;
  margin-bottom: 1px;
  color: #4c8d70;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
}
.eyebrow::before { content: ""; width: 16px; height: 2px; border-radius: 2px; background: var(--lime); }
h1 { color: #102f25; letter-spacing: -.025em; }
header h1 { font-size: 24px; line-height: 1.05; margin: 0; white-space: nowrap; }
header p { color: #658076; font-size: 13px; margin: 0 0 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.actions {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.actions.hidden { display: none; }
.actions .primary,
.actions .secondary {
  width: 112px;
  height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  font-size: 14px;
  line-height: 1;
  font-weight: 750;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.actions .primary.hidden,
.actions .secondary.hidden { display: none; }
.actions .secondary {
  background: rgba(255,255,255,.92);
  border-color: #d4e2da;
  box-shadow: 0 4px 13px rgba(27, 70, 54, .06);
}
.actions .primary {
  background: linear-gradient(145deg, #17845c, #116947);
  box-shadow: 0 7px 18px rgba(20, 118, 82, .22);
}
.actions .primary:hover,
.actions .secondary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(21, 91, 65, .16); }
.actions .primary:active,
.actions .secondary:active { transform: translateY(0); }
.collection-menu { position: relative; }
.collection-menu.hidden { display: none; }
.actions .collection-status-btn {
  width: auto;
  min-width: 132px;
  padding-inline: 13px;
  color: #30363d;
}
.collection-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa3aa;
  box-shadow: 0 0 0 4px rgba(154,163,170,.12);
}
.collection-menu.schedule-enabled .collection-status-dot {
  background: #2fa56e;
  box-shadow: 0 0 0 4px rgba(47,165,110,.13);
}
.collection-menu.collection-error .collection-status-dot {
  background: #d35445;
  box-shadow: 0 0 0 4px rgba(211,84,69,.14);
}
.collection-menu.collection-error .collection-status-btn { color: #a53e34; border-color: #efc1ba; background: #fff7f5; }
.collection-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  padding: 16px;
  border: 1px solid #dce3df;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(26,45,37,.18);
  color: #202428;
  z-index: 80;
}
.collection-popover.hidden { display: none; }
.collection-popover-head {
  display: grid;
  gap: 3px;
  padding: 0 2px 13px;
  border-bottom: 1px solid #edf0ee;
}
.collection-popover-head b { font-size: 15px; }
.collection-popover-head small,
.schedule-toggle-row small {
  color: #768079;
  font-size: 11px;
  font-weight: 500;
}
.schedule-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 2px;
  cursor: pointer;
}
.schedule-toggle-row > span:first-child {
  display: grid;
  gap: 4px;
  text-align: left;
}
.schedule-toggle-row b { font-size: 13px; }
.switch { position: relative; flex: 0 0 auto; width: 38px; height: 22px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #c9d0cc;
  transition: background .16s ease;
}
.switch i::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: transform .16s ease;
}
.switch input:checked + i { background: #17845c; }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 3px solid rgba(23,132,92,.18); }
.switch input:disabled + i { opacity: .5; }
.collection-action-stack {
  display: grid;
  gap: 8px;
}
.actions .collection-popover .refresh-latest-menu-btn,
.actions .collection-popover .collect-once-btn {
  width: 100%;
  height: 38px;
  color: #3d4742;
  background: #f7f9f8;
  border-color: #dfe5e1;
  box-shadow: none;
}
.actions .collection-popover .refresh-latest-menu-btn:hover,
.actions .collection-popover .collect-once-btn:hover {
  color: #176448;
  background: #f0f6f2;
  box-shadow: none;
}
.actions .collection-popover .refresh-latest-menu-btn.fresh {
  color: #5c6d65;
  background: #fbfcfb;
}
.report-dialog { width: min(560px, 90vw); overflow: visible; }
.report-form h2 { margin: 0 0 6px; font-size: 23px; }
.report-form > p { margin: 0 0 22px; color: var(--muted); }
.date-range { display: grid; grid-template-columns: 1fr 24px 1fr; gap: 10px; align-items: end; }
.date-field { position: relative; display: grid; gap: 7px; color: #4d665d; font-size: 12px; font-weight: 650; }
.report-date-control { position: relative; display: block; }
.report-date-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid #d8e0e6;
  border-radius: 10px;
  background: #fff;
  color: #202428;
  font-size: 13px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}
.report-date-trigger:hover {
  border-color: #bfc8d1;
  box-shadow: 0 4px 14px rgba(31,41,55,.08);
}
.report-date-trigger i {
  width: 7px;
  height: 7px;
  border-right: 2px solid #58616b;
  border-bottom: 2px solid #58616b;
  transform: rotate(45deg) translateY(-2px);
}
.report-date-panel {
  left: 0;
  right: auto;
  top: calc(100% + 8px);
  z-index: 1000;
}
.date-separator { padding-bottom: 11px; text-align: center; color: #8ba097; }
.report-form .report-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.report-chooser h2,.demo-export-progress h2 { margin: 0 0 6px; font-size: 23px; }
.report-chooser>p,.demo-export-progress>p { margin: 0 0 20px; color: var(--muted); }
.report-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.report-choice-grid button { min-height: 108px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: left; color: var(--ink); }
.report-choice-grid button:hover { border-color: #93c9ae; box-shadow: 0 8px 22px rgba(31,91,67,.09); transform: translateY(-1px); }
.report-choice-grid b { display: block; margin-bottom: 8px; font-size: 17px; }
.report-choice-grid small,.demo-mode-options small { display: block; color: var(--muted); line-height: 1.5; }
.report-back { margin: 0 0 12px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.demo-end-date { display: block; margin: 18px 0 12px; color: var(--muted); font-size: 12px; }
.demo-end-date .report-date-control { margin-top: 6px; }
.demo-mode-options { display: grid; gap: 8px; }
.demo-mode-options label { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.demo-mode-options label:has(input:checked) { border-color: #87c8a7; background: #f3fbf6; }
.demo-mode-options input { margin-top: 3px; accent-color: var(--primary); }
.demo-progress-kicker { color: var(--primary); font-size: 12px; font-weight: 700; }
.demo-progress-track { height: 9px; overflow: hidden; border-radius: 99px; background: #edf1ee; }
.demo-progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#48b982,var(--primary)); transition: width .25s ease; }
.demo-progress-stats { display: flex; justify-content: space-between; margin-top: 9px; color: var(--muted); font-size: 12px; }
.demo-export-progress .report-actions { display: flex; justify-content: flex-end; margin-top: 24px; }
img.demo-image-error { min-width: 36px; min-height: 36px; opacity: .45; background: linear-gradient(135deg,#eef2ef,#dfe7e2); }
.export-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.export-option { display: flex; align-items: flex-start; gap: 13px; min-height: 104px; padding: 17px; text-align: left; border: 1px solid #d8e5dd; border-radius: 14px; background: #fbfdfb; color: var(--ink); cursor: pointer; transition: transform .16s ease,border-color .16s ease,box-shadow .16s ease; }
.export-option:hover { transform: translateY(-2px); border-color: #a9cfb8; box-shadow: 0 9px 22px rgba(29,91,65,.09); }
.export-option-icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px; background: #e5f3e9; color: #176448; font-size: 17px; }
.export-option b,.export-option small { display: block; }
.export-option b { margin: 1px 0 5px; font-size: 15px; }
.export-option small { color: var(--muted); line-height: 1.45; }

.cards { gap: 15px; margin-top: 18px; }
.metric {
  position: relative;
  overflow: hidden;
  border: 0;
  box-shadow: var(--shadow-sm);
  min-height: 108px;
  padding: 20px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.metric::after { content: ""; position: absolute; width: 74px; height: 74px; right: -25px; top: -28px; border-radius: 50%; opacity: .16; }
.metric:nth-child(1) { background: linear-gradient(140deg, #fff, #f1f7ff); }.metric:nth-child(1)::after { background: #5797e8; }
.metric:nth-child(2) { background: linear-gradient(140deg, #fff, #fff7ea); }.metric:nth-child(2)::after { background: #f3aa45; }
.metric:nth-child(3) { background: linear-gradient(140deg, #fff, #f7f2ff); }.metric:nth-child(3)::after { background: #9870d3; }
.metric:nth-child(4) { background: linear-gradient(140deg, #fff, #effaf2); }.metric:nth-child(4)::after { background: #35a66d; }
.metric small { font-weight: 650; }
.metric strong { color: #12362b; letter-spacing: -.03em; }

.panel {
  border-color: rgba(207, 222, 213, .85);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  background: rgba(255,255,255,.94);
}
.panel h2 { color: #153c2f; }
.health-grid { gap: 13px; }
.health {
  background: linear-gradient(145deg, #fff, #f7fbf7);
  border-color: #d9e6de;
  border-radius: 13px;
  padding: 15px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.health:hover { transform: translateY(-1px); border-color: #bcd8c7; box-shadow: 0 8px 18px rgba(25, 93, 65, .08); }
.health .dot { width: 9px; height: 9px; box-shadow: 0 0 0 4px rgba(66,166,111,.10); }

table { border-spacing: 0; }
th { color: #648076; font-size: 12px; background: #f8faf7; }
thead th:first-child { border-radius: 9px 0 0 9px; }
thead th:last-child { border-radius: 0 9px 9px 0; }
td { border-bottom-color: #e8eee9; }
tbody tr { transition: background .14s ease, box-shadow .14s ease; }
tbody tr:hover { background: #f3f9f4; }
.overview-main-row:hover { box-shadow: inset 3px 0 var(--lime); }
.product-cell img { box-shadow: 0 4px 10px rgba(31, 68, 53, .12); }
.product-cell b { color: #15372c; }
.tag,.event { padding: 4px 9px; }
.event.new { background: #e7f0ff; color: #2868ae; }
.tag.pending { background: #fff8e7; color: #9a6719; }
.sparkline { border-radius: 8px; background: linear-gradient(180deg, rgba(239,247,241,.75), rgba(255,255,255,0)); }

select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
  padding: 9px 38px 9px 13px;
  border: 1px solid #cfe1d7;
  border-radius: 10px;
  background:
    linear-gradient(45deg, transparent 50%, #1f5e48 50%) calc(100% - 18px) 17px / 6px 6px no-repeat,
    linear-gradient(135deg, #1f5e48 50%, transparent 50%) calc(100% - 13px) 17px / 6px 6px no-repeat,
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,252,249,.98));
  color: #14382d;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 3px 10px rgba(25,91,65,.04);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
select:hover {
  border-color: #a9d2b9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 6px 16px rgba(25,91,65,.08);
}
select:focus {
  outline: none;
  border-color: #78c79b;
  box-shadow: 0 0 0 3px rgba(121,201,155,.18), 0 6px 16px rgba(25,91,65,.08);
}
select option {
  background: #fbfdfb;
  color: #153a2f;
  font-weight: 500;
  padding: 9px 12px;
}
select option:checked {
  background: linear-gradient(135deg, #dff3e7, #edf8ef);
  color: #0f684a;
  font-weight: 750;
  box-shadow: 0 0 0 999px #dff3e7 inset;
}
select option:hover,
select option:focus {
  background: #eef8f1;
  color: #0f684a;
  box-shadow: 0 0 0 999px #eef8f1 inset;
}
select:focus option:checked,
select option:checked:hover {
  background: linear-gradient(135deg, #caedda, #e5f7eb);
  color: #0b5f43;
  box-shadow: 0 0 0 999px #caedda inset;
}

dialog { border: 1px solid #d7e4db; box-shadow: 0 26px 90px rgba(10, 47, 35, .28); }
.close { width: 36px; height: 36px; border-radius: 50%; color: #45665a; }
.close:hover { background: #edf5ef; }

.product-detail-dialog { width: min(980px, 92vw); max-height: 90vh; padding: 28px 30px 30px; overflow-x: hidden; }
.product-detail-dialog > .close { position: sticky; z-index: 12; top: 0; float: right; margin: -8px -8px 0 0; background: rgba(255,255,255,.9); }
.product-detail-top { display: grid; grid-template-columns: 70px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 0 42px 12px 0; }
.product-detail-icon { width: 70px; height: 70px; border-radius: 17px; object-fit: cover; box-shadow: 0 8px 20px rgba(34,70,55,.14); }
.product-detail-title h2 { margin: 0 0 5px; font-size: 25px; line-height: 1.18; }
.product-detail-title p { margin: 0 0 6px; color: var(--muted); }
.product-detail-title span { display: inline-block; padding: 3px 8px; border-radius: 99px; background: #edf4ef; color: #24664e; font-size: 11px; font-weight: 700; }
.store-link { min-width: 112px; height: 42px; align-self: center; }
.refresh-store-link { min-width: 0; height: 34px; align-self: center; padding: 0 12px; border-color: #dde8e1; background: #fff; color: #5f6b66; font-size: 13px; font-weight: 650; box-shadow: none; white-space: nowrap; }
.refresh-store-link:hover { background: #f7faf8; color: #1c5f47; }
.store-cache-meta { display: inline-flex; align-items: center; gap: 5px; margin-top: 1px; padding: 2px 7px; border-radius: 99px; background: #f5f7f6; color: #7d8883; font-size: 10px; line-height: 1.35; vertical-align: middle; }
.store-cache-meta::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #9aa6a0; }
.store-cache-meta b { margin-left: 2px; color: #9a6a12; font-weight: 750; }
.store-cache-meta.stale { background: #fff8e8; color: #806b42; }
.store-cache-meta.stale::before { background: #d99b2b; }
.store-cache-meta i { width: 1px; height: 10px; margin: 0 1px; background: #dfe5e2; }
.cache-refresh-link { padding: 0; border: 0; background: transparent; color: #326b55; font-size: 10px; font-weight: 750; cursor: pointer; }
.cache-refresh-link:hover { text-decoration: underline; }
.cache-refresh-link:disabled { color: #9aa6a0; cursor: default; text-decoration: none; }
.product-detail-actions { display: flex; align-items: center; gap: 10px; }
.store-tabs { display: flex; align-items: center; gap: 6px; height: 42px; margin: 0; padding: 3px; border-radius: 12px; background: #f3f7f4; }
.store-tab { height: 34px; border: 1px solid #d8e5dd; border-radius: 9px; padding: 0 12px; background: #fff; color: #61776e; cursor: pointer; }
.store-tab.active { background: #e8f5ed; border-color: #abd3ba; color: #176448; font-weight: 750; }
.store-lead { margin: 2px 0 14px; padding: 12px 15px; border-radius: 12px; background: linear-gradient(115deg,#f1f8f3,#f8fbf8); border: 1px solid #dce9e1; }
.store-lead b { color: #507067; font-size: 11px; }
.store-lead p { margin: 5px 0 0; color: #25483c; font-size: 14px; line-height: 1.55; }
.detail-section { margin-top: 18px; }
.detail-section h3 { margin: 0 0 12px; font-size: 16px; }
.section-heading { display: flex; align-items: baseline; gap: 9px; }
.section-heading small { color: var(--muted); }
.screenshot-strip { display: flex; justify-content: safe center; gap: 12px; padding: 3px 2px 12px; overflow-x: auto; scroll-snap-type: x proximity; }
.screenshot-card { flex: 0 0 auto; height: 250px; padding: 0; overflow: hidden; border: 1px solid #dbe5df; border-radius: 14px; background: #eef3ef; cursor: zoom-in; scroll-snap-align: start; box-shadow: 0 5px 14px rgba(26,69,51,.08); }
.screenshot-card img { display: block; width: auto; max-width: 430px; height: 100%; object-fit: cover; }
.product-info-grid { display: grid; grid-template-columns: minmax(430px,1.65fr) minmax(250px,.85fr); gap: 14px; margin-top: 16px; align-items: stretch; }
.detail-summary-card { min-width: 0; padding: 15px 16px; border: 1px solid #dfe9e3; border-radius: 14px; background: linear-gradient(145deg,#fbfdfb,#f5f9f6); }
.detail-summary-card h3 { margin: 0 0 12px; font-size: 15px; }
.detail-summary-card h3 small { margin-left: 4px; color: var(--muted); font-size: 10px; font-weight: 500; }
.tag-cloud { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px; }
.tags-summary-card { display: grid; grid-template-rows: auto auto; padding-top: 0; padding-bottom: 0; }
.tag-summary-group { padding: 13px 0; }
.tag-summary-group + .tag-summary-group { border-top: 1px solid #dfe8e2; }
.tag-summary-group h3 { margin-bottom: 10px; }
.compact-change-group { padding-bottom: 12px; }
.store-change-list { display: grid; gap: 7px; }
.store-change-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border: 1px solid #e5e9e7; border-radius: 9px; background: #fff; color: #5f6b66; font-size: 11px; }
.store-change-item b { color: #6b7570; font-size: 10px; font-weight: 650; white-space: nowrap; }
.store-change-item span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.board-rank-list { display: grid; gap: 8px; }
.board-rank-item { display: grid; grid-template-columns: minmax(0,1fr) auto 62px; gap: 9px; align-items: center; min-height: 44px; padding: 8px 10px; border-radius: 10px; background: #f7faf7; border: 1px solid #e2ebe5; }
.board-rank-item > span:first-child { overflow: hidden; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.board-rank-item > b { color: #176448; white-space: nowrap; }
.board-rank-item > .event,.board-rank-item > .muted { justify-self: center; white-space: nowrap; }
.board-rank-main { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; }
.board-rank-main span { font-weight: 700; }
.board-rank-main b { color: #176448; }
.board-rank-main small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.board-stats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.board-stat { padding: 3px 7px; border-radius: 99px; background: #edf1ee; color: #63766f; font-size: 10px; }
.board-stat.highlight { background: #e8f3ff; color: #326893; }
.tag-block { padding: 12px 0; border-bottom: 1px solid #e7eee9; }
.tag-block > b { display: block; margin-bottom: 8px; color: #587067; font-size: 12px; }
.store-tag { display: inline-block; margin: 2px 5px 2px 0; padding: 4px 9px; border-radius: 99px; background: #edf3ff; color: #3b6592; font-size: 11px; }
.detail-empty { padding: 25px; border: 1px dashed #d8e3dc; border-radius: 12px; color: var(--muted); text-align: center; }
.store-detail-note { margin-top: 18px; color: #98702b; font-size: 11px; }
.product-detail-loading { display: grid; place-items: center; gap: 8px; min-height: 320px; color: var(--muted); }
.product-detail-loading span { width: 32px; height: 32px; border: 3px solid #dce8e0; border-top-color: #16815b; border-radius: 50%; animation: detail-spin .8s linear infinite; }
.product-detail-loading b { color: #36594c; }
.product-detail-loading small { color: #879990; }
@keyframes detail-spin { to { transform: rotate(360deg); } }
.screenshot-lightbox { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 42px; background: rgba(9,31,24,.86); }
.screenshot-lightbox.hidden { display: none; }
.screenshot-lightbox img { max-width: 90vw; max-height: 84vh; border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.screenshot-lightbox button { position: absolute; top: 20px; right: 25px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; font-size: 25px; cursor: pointer; }

@media (max-width: 900px) {
  header { align-items: flex-start; gap: 12px; }
  header::after { display: none; }
  .actions { grid-template-columns: repeat(2, 106px); }
  .actions .primary,.actions .secondary { width: 106px; }
  .product-info-grid { grid-template-columns: 1fr; gap: 10px; }
  .product-detail-top { grid-template-columns: 64px 1fr; }
  .product-detail-icon { width: 64px; height: 64px; }
  .product-detail-actions { grid-column: 1 / -1; justify-content: space-between; flex-wrap: wrap; }
  .store-link { width: auto; }
}

@media (max-width: 760px) {
  .header-copy { grid-template-columns: 1fr; align-items: start; }
  header h1 { font-size: 22px; }
  header p { white-space: normal; }
}

/* 内容区阅读层：绿色只做品牌与状态强调，正文回到黑白灰 */
:root {
  --ink: #202428;
  --muted: #69717a;
  --line: #e3e7eb;
  --paper: #f6f8f4;
  --card: #ffffff;
  --shadow-sm: 0 4px 16px rgba(31, 41, 55, .055);
  --shadow-md: 0 12px 34px rgba(31, 41, 55, .085);
}

main {
  color: #202428;
}

main header {
  border-color: #e0e5e9;
  background:
    linear-gradient(110deg, rgba(255,255,255,.98), rgba(249,250,251,.96)),
    var(--card);
  box-shadow: 0 4px 16px rgba(31, 41, 55, .055);
}

main .eyebrow {
  color: #66707a;
}

main h1,
main header h1,
main .panel h2,
main .tag-tool-card h2,
main .tag-rules-head h2,
main .product-detail-title h2,
main .detail-section h3,
main .detail-summary-card h3,
main .report-form h2 {
  color: #171a1f;
}

main header p,
main .metric small,
main .health small,
main .ranking-panel-head p,
main .ranking-hint,
main .section-heading small,
main .detail-summary-card h3 small,
main .board-rank-main small,
main .product-detail-title p,
main .store-detail-note,
main .loading,
main .empty,
main .muted {
  color: #69717a;
}

main .metric {
  background: linear-gradient(140deg, #fff, #fbfcfd);
  box-shadow: 0 4px 16px rgba(31, 41, 55, .055);
}

main .metric::after {
  opacity: .08;
}

main .metric strong,
main .rank,
main .rank-day-cell,
main .rank-day-cell.latest {
  color: #171a1f;
}

main .panel,
main .health,
main .detail-summary-card,
main .store-lead,
main .ranking-table-wrap,
main .screenshot-card,
main .export-option,
main dialog {
  border-color: #e2e6ea;
  background: rgba(255,255,255,.96);
  box-shadow: 0 4px 16px rgba(31, 41, 55, .05);
}

main .health,
main .detail-summary-card,
main .board-rank-item,
main .store-lead {
  background: linear-gradient(145deg, #fff, #fafbfc);
}

main .health:hover,
main .export-option:hover {
  border-color: #cdd3da;
  box-shadow: 0 8px 20px rgba(31, 41, 55, .075);
}

main th {
  color: #5f6873;
  background: #f8f9fa;
}

main td {
  color: #202428;
  border-bottom-color: #eceff2;
}

main tbody tr:hover,
main .product-open:hover,
main .trend-open:hover,
main .event-product-open:hover,
main .event-trend-open:hover,
main .ranking-product-open:hover,
main .ranking-trend-open:hover {
  background: #f7f8fa;
}

main .product-cell b,
main .board-toggle,
main .single-board,
main .detail-board,
main .board-rank-item > span:first-child,
main .board-rank-main span {
  color: #171a1f;
}

main .product-cell small,
main .tag-block > b,
main .store-lead b,
main .date-field,
main .events-filterbar label,
main .ranking-toolbar .filters label,
main .checkbox-line,
main .tag-rules-table-head {
  color: #69717a;
}

main input,
main textarea,
main select {
  border-color: #dce1e6;
  color: #202428;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

main select {
  background:
    linear-gradient(45deg, transparent 50%, #3f4a54 50%) calc(100% - 18px) 17px / 6px 6px no-repeat,
    linear-gradient(135deg, #3f4a54 50%, transparent 50%) calc(100% - 13px) 17px / 6px 6px no-repeat,
    #fff;
}

main input:hover,
main textarea:hover,
main select:hover {
  border-color: #c8ced5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 4px 12px rgba(31,41,55,.055);
}

main input:focus,
main textarea:focus,
main select:focus {
  border-color: #8dbfa4;
  box-shadow: 0 0 0 3px rgba(19,118,83,.14);
}

main .secondary,
main .actions .secondary {
  color: #202428;
  border-color: #dce1e6;
  background: rgba(255,255,255,.94);
}

main .overview-scope-button {
  color: #4b5560;
}

main .overview-scope-button.active,
main .store-tab.active {
  color: #103f2f;
}

main .tag,
main .event,
main .board-stat {
  color: #4b5560;
  background: #f0f2f4;
}

main .event.new {
  color: #2563a8;
  background: #eaf2ff;
}

main .event.surge,
main .event.hit,
main .event.trend-up {
  color: #176448;
  background: #e9f5ee;
}

main .event.leader {
  color: #7a4f00;
  background: #fff0bd;
}

main .event.drop,
main .event.out,
main .event.trend-down {
  color: #a33a35;
  background: #fdebea;
}

main .tag.pending {
  color: #8a651a;
  background: #fff8e6;
  border-color: #e4c56d;
}

/* 玩法标签按名称稳定分配柔和色系，同一玩法在各页面保持同色。 */
main .tag.tag-tone-0 { color: #315f91; background: #eaf2ff; border-color: #c8daf2; }
main .tag.tag-tone-1 { color: #684da0; background: #f1edff; border-color: #d9cff4; }
main .tag.tag-tone-2 { color: #176f65; background: #e7f7f3; border-color: #c4e5dd; }
main .tag.tag-tone-3 { color: #95506a; background: #fff0f4; border-color: #edced9; }
main .tag.tag-tone-4 { color: #85631f; background: #fff6dd; border-color: #ead79d; }
main .tag.tag-tone-5 { color: #286c83; background: #e9f7fb; border-color: #c7e3eb; }
main .tag.tag-tone-6 { color: #48723e; background: #edf7ea; border-color: #cfe4c9; }
main .tag.tag-tone-7 { color: #9a5837; background: #fff0e8; border-color: #eccfbe; }

main .store-tag,
main .board-stat.highlight {
  color: #46637f;
  background: #eef4fb;
}

main .product-detail-title span,
main .store-tabs,
main .store-tab,
main .board-stat {
  border-color: #e1e6eb;
  background: #f4f6f8;
}

main .store-tab {
  color: #5b6570;
}

main .store-tab.active {
  color: #103f2f;
  border-color: #9acbb1;
  background: #e9f5ee;
}

main .board-rank-item > b,
main .board-rank-main b {
  color: #202428;
}

main .close {
  color: #5e6771;
}

main .close:hover {
  background: #f1f3f5;
}

@media (max-width: 1250px) {
  body { grid-template-columns: 210px 1fr; }
  aside { padding-left: 14px; padding-right: 14px; }
}

@media (max-width: 1320px) {
  header { gap: 10px; }
  .header-copy { flex-basis: 210px; column-gap: 10px; }
  header p { max-width: 210px; }
}

@media (max-width: 1180px) {
  .header-copy { flex: 0 1 150px; grid-template-columns: auto; align-items: start; }
  header p { display: none; }
  .eyebrow { margin-bottom: 0; }
  .actions .collection-status-btn { min-width: 112px; width: auto; }
}
