:root {
  --bg: #eef2f5;
  --surface: #fff;
  --soft: #f7f9fb;
  --line: #d8e0e8;
  --line-strong: #c3d0dc;
  --text: #17212b;
  --muted: #627083;
  --faint: #8995a3;
  --accent: #11657f;
  --good: #16805a;
  --warn: #b46512;
  --bad: #b13b45;
  --shadow: 0 10px 24px rgba(32, 44, 57, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  background: #132934;
  color: #fff;
}

.eyebrow {
  margin: 0 0 4px;
  color: #9cc9d7;
  font-size: 12px;
  font-weight: 800;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: 24px; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 17px; letter-spacing: 0; }
.header-sub, .hint { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.topbar .header-sub { color: #bad0d8; }

.dashboard {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 16px 18px 32px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 610px;
}

button, .button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 11px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:disabled { opacity: 0.55; cursor: wait; }
.ghost { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.24); }

.daily-report {
  display: grid;
  gap: 12px;
}

.daily-toolbar {
  display: grid;
  gap: 8px;
}

.daily-summary,
.daily-change-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.daily-summary span,
.daily-change-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}

.daily-summary span {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.daily-summary b {
  color: var(--text);
  font-size: 14px;
}

.daily-change-grid header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.daily-change-grid article > div {
  display: grid;
  gap: 5px;
  min-height: 30px;
}

.daily-change-grid span,
.daily-change-grid em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.move-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 22px;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.move-badge.up,
.move-badge.in {
  background: rgba(22, 128, 90, 0.12);
  color: var(--good);
}

.move-badge.down,
.move-badge.out {
  background: rgba(177, 59, 69, 0.12);
  color: var(--bad);
}

.move-badge.same {
  background: rgba(98, 112, 131, 0.12);
  color: var(--muted);
}

.tier-report {
  gap: 10px;
}

.tier-board {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #0c141c;
}

.tier-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  min-height: 54px;
  gap: 12px;
  position: relative;
  border-radius: 8px;
  padding: 8px 10px 8px 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  box-shadow:
    inset 5px 0 0 var(--tier-accent, rgba(255,255,255,0.16)),
    inset 0 0 0 1px rgba(255,255,255,0.045);
}

.tier-label {
  display: grid;
  justify-items: center;
  line-height: 1;
  font-weight: 900;
}

.tier-label strong {
  font-size: 24px;
}

.tier-label span {
  font-size: 12px;
}

.tier-1 .tier-label { color: #ff5664; }
.tier-2 .tier-label { color: #ff8d4b; }
.tier-3 .tier-label { color: #e5c84c; }
.tier-4 .tier-label { color: #55bf5e; }
.tier-5 .tier-label { color: #47a7d8; }

.tier-row.tier-1 {
  --tier-accent: #ff5664;
  background: linear-gradient(90deg, rgba(255,86,100,0.18), rgba(255,86,100,0.065) 40%, rgba(255,86,100,0.018));
}

.tier-row.tier-2 {
  --tier-accent: #ff8d4b;
  background: linear-gradient(90deg, rgba(255,141,75,0.16), rgba(255,141,75,0.055) 40%, rgba(255,141,75,0.016));
}

.tier-row.tier-3 {
  --tier-accent: #e5c84c;
  background: linear-gradient(90deg, rgba(229,200,76,0.15), rgba(229,200,76,0.05) 40%, rgba(229,200,76,0.015));
}

.tier-row.tier-4 {
  --tier-accent: #55bf5e;
  background: linear-gradient(90deg, rgba(85,191,94,0.15), rgba(85,191,94,0.05) 40%, rgba(85,191,94,0.014));
}

.tier-row.tier-5 {
  --tier-accent: #47a7d8;
  background: linear-gradient(90deg, rgba(71,167,216,0.15), rgba(71,167,216,0.05) 40%, rgba(71,167,216,0.014));
}

.tier-icons {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 4px;
  row-gap: 8px;
  min-width: 0;
}

.tier-icons em {
  color: #8795a1;
  font-size: 12px;
  font-style: normal;
}

.tier-asset-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 50px;
  gap: 2px;
}

.tier-asset {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255,255,255,0.24);
  border-radius: 50%;
  background: #23313d;
  color: #dce7ed;
  box-shadow: 0 2px 10px rgba(0,0,0,0.28);
}

.tier-row.tier-1 .tier-asset {
  width: 53px;
  height: 53px;
}

.tier-row.tier-1 .tier-asset-wrap {
  width: 59px;
}

.tier-row.tier-sample .tier-label {
  color: #8d99a6;
}

.tier-row.tier-sample {
  --tier-accent: #8d99a6;
  background: linear-gradient(90deg, rgba(141,153,166,0.16), rgba(141,153,166,0.052) 40%, rgba(141,153,166,0.014));
}

.tier-sample-divider {
  margin: 8px 0 2px;
  border-top: 1px solid rgba(141, 153, 166, 0.45);
  padding-top: 12px;
  color: #7c8995;
  font-size: 12px;
  font-weight: 800;
}

.tier-sample-divider span {
  display: inline-block;
  background: #07111a;
  border: 1px solid rgba(141, 153, 166, 0.34);
  border-radius: 999px;
  padding: 4px 9px;
}

.tier-row.tier-sample .tier-asset {
  opacity: 0.72;
  border-style: dashed;
}

.tier-row.tier-sample .tier-asset-name {
  color: #8593a0;
}

.tier-asset img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.tier-asset > span {
  display: grid;
  place-items: center;
  width: 100%;
  font-size: 12px;
  font-weight: 900;
}

.tier-asset b {
  position: absolute;
  right: -5px;
  top: -14px;
  z-index: 2;
  min-width: 18px;
  border-radius: 999px;
  background: rgba(7, 17, 26, 0.92);
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
  padding: 2px 4px;
  text-align: center;
}

.tier-asset.up {
  border-color: var(--good);
  border-width: 4.5px;
}

.tier-asset.down {
  border-color: var(--bad);
  border-width: 4.5px;
}

.tier-asset.in {
  border-color: var(--good);
  border-width: 4.5px;
}

.tier-asset.up b { color: var(--good); }
.tier-asset.down b { color: var(--bad); }
.tier-asset.in b { color: var(--good); }

.tier-asset-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  width: 100%;
  max-height: 19px;
  color: #c4d0d9;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-capture-actions {
  margin-left: auto;
}

.daily-capture-actions button {
  white-space: nowrap;
}

.daily-capture-host {
  position: fixed;
  left: -20000px;
  top: 0;
  z-index: -1;
  background: #f4f8fb;
  pointer-events: none;
}

.daily-capture-section {
  gap: 10px;
  color: var(--text);
}

.daily-capture-merged {
  gap: 12px;
}

.daily-capture-kind-block {
  display: grid;
  gap: 10px;
}

.daily-capture-type-title {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.daily-capture-type-title strong {
  color: var(--text);
  font-size: 14px;
}

.daily-capture-type-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.daily-out-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--soft);
}

.daily-out-list strong {
  color: var(--bad);
  margin-right: 4px;
}

.daily-out-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.daily-period-line,
.daily-rule-line,
.daily-point-list,
.daily-trend-list,
.daily-search-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--soft);
}

.daily-trend-list {
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.daily-trend-list article {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.daily-trend-list article > strong {
  color: var(--text);
  font-size: 13px;
}

.daily-trend-list article > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.daily-trend-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.daily-trend-entry {
  display: inline-grid;
  grid-template-columns: 26px minmax(48px, auto);
  column-gap: 7px;
  align-items: center;
  max-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 7px 4px 4px;
  background: #fff;
}

.daily-trend-entry img,
.daily-trend-entry > span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.daily-trend-entry > span {
  display: grid;
  place-items: center;
  background: #22313d;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.daily-trend-entry b,
.daily-trend-entry em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-trend-entry b {
  color: var(--text);
  font-size: 12px;
}

.daily-trend-entry em {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.daily-trend-entry.up { border-color: rgba(23,157,110,0.45); }
.daily-trend-entry.down { border-color: rgba(215,78,78,0.45); }

.daily-period-line strong,
.daily-point-list strong {
  color: var(--text);
}

.daily-period-line span,
.daily-rule-line,
.daily-point-list span,
.daily-search-result {
  color: var(--muted);
  font-size: 12px;
}

.daily-point-list span {
  border-left: 1px solid var(--line);
  padding-left: 8px;
}

.api-key-box {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
}

.api-key-box input {
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font: inherit;
  font-weight: 700;
}

.api-key-box input::placeholder { color: #c7d7dd; }

.api-key-status {
  grid-column: 1 / -1;
  color: #b8d8e2;
  font-size: 12px;
  text-align: right;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 76px;
  padding: 12px 13px;
  border-top: 3px solid #d7e6ec;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.panel {
  margin-bottom: 12px;
  padding: 15px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  background: #edf3f7;
}

.segmented button {
  padding: 6px 9px;
  border-radius: 5px;
  background: transparent;
  color: #344455;
}

.segmented button.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(31, 46, 61, 0.12);
}

.wide-tabs { max-width: 100%; }

.category-tabs {
  max-width: 100%;
  margin-bottom: 6px;
  background: #f7fbfd;
}

.status-pill {
  min-width: 120px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.pattern-tools {
  display: grid;
  grid-template-columns: 150px 150px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.pattern-tools select,
.pattern-tools input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.pattern-stats {
  margin-bottom: 10px;
}

.pattern-note {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #f7fbfd;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.signal-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef3f7;
  color: #4d5b69;
  font-size: 12px;
  font-weight: 900;
}

.signal-badge.win { background: #e7f5ef; color: var(--good); }
.signal-badge.loss { background: #fdebed; color: var(--bad); }
.signal-badge.low { background: #f3f0e7; color: var(--warn); }
.condition-title { display: block; line-height: 1.35; }
.good-text { color: var(--good); font-weight: 900; }
.bad-text { color: var(--bad); font-weight: 900; }

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

.insight-card,
.snapshot-card,
.factor-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: var(--soft);
}

.insight-card.good { border-left: 4px solid var(--good); }
.insight-card.warn { border-left: 4px solid var(--warn); }
.insight-card.info { border-left: 4px solid var(--accent); }
.insight-card.bad-rated { opacity: 0.72; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.card-title {
  font-weight: 900;
}

.card-body {
  margin: 0;
  line-height: 1.45;
}

.evidence {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.feedback {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.coach-queue {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
  color: var(--muted);
  font-size: 12px;
}

.coach-queue strong {
  color: var(--text);
}

.coach-action {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 8px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #f7fbfd;
  font-size: 12px;
  line-height: 1.45;
}

.coach-action strong {
  color: var(--accent);
}

.feedback button {
  padding: 4px 7px;
  border-color: var(--line);
  background: #fff;
  color: #425163;
  font-size: 12px;
}

.feedback button.active {
  border-color: var(--accent);
  color: var(--accent);
}

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

.snapshot-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

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

.mini-stats span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.mini-stats b {
  display: block;
  color: var(--text);
  font-size: 13px;
}

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

.factor-card strong {
  display: block;
  margin-bottom: 5px;
}

.factor-card .relation {
  color: var(--accent);
  font-weight: 900;
}

.recommend-profile {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 10px;
  margin-bottom: 10px;
}

.recommend-hero,
.recommend-evidence {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.recommend-hero {
  border-left: 4px solid var(--accent);
}

.recommend-hero h3,
.table-title {
  margin: 8px 0 6px;
  font-size: 16px;
}

.recommend-focus {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.recommend-score-row.explain span {
  display: grid;
  gap: 3px;
}

.recommend-score-row small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.recommend-score-row span,
.evidence-line {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  background: #fff;
}

.recommend-score-row span {
  color: var(--muted);
  font-size: 12px;
}

.recommend-score-row b,
.evidence-line b {
  color: var(--text);
  font-weight: 900;
}

.recommend-evidence {
  display: grid;
  gap: 6px;
}

.recommend-evidence strong + .evidence-line,
.recommend-evidence .evidence-line + strong {
  margin-top: 4px;
}

.evidence-line {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 3px 8px;
}

.evidence-line small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.table-title {
  margin-top: 14px;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.role-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.role-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.role-card header span,
.role-row small {
  color: var(--muted);
  font-size: 12px;
}

.role-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 7px 0;
}

.role-row div {
  min-width: 0;
}

.role-row b,
.role-row small {
  display: block;
  line-height: 1.35;
}

.rarity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.rarity-card,
.rarity-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.rarity-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

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

.build-compare > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.asset-list.compact .asset-chip {
  max-width: 118px;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

th {
  border-bottom-color: var(--line-strong);
  background: #eaf1f6;
  color: #334456;
  font-size: 12px;
  font-weight: 900;
}

th button {
  width: 100%;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: #fbfcfd; }
td strong { color: #061d34; font-weight: 900; }

.asset-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 30px;
}

.asset-chip img,
.mini-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.asset-chip img {
  padding: 3px;
  background: #132934;
}

.asset-chip.augment-chip img,
.asset-icon-chip.augment-chip {
  background: #0b1d2b;
}

.asset-chip.augment-chip {
  background: rgba(11, 29, 43, 0.08);
}

.asset-chip span,
.name-clip {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.asset-list .asset-chip {
  max-width: 145px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 6px 3px 3px;
  background: #fff;
}

.icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.asset-icon-chip {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.asset-icon-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.rarity-inline b {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.champion-augment-groups {
  grid-template-columns: repeat(3, minmax(42px, 1fr));
}

.champion-augment-groups .icon-row {
  display: grid;
  grid-template-columns: repeat(1, 30px);
  gap: 4px;
}

.champion-augment-groups .asset-icon-chip {
  width: 30px;
  height: 30px;
}

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

.core-lines {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.core-line {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 58px;
  gap: 5px;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px;
  background: #fff;
}

.core-line.empty {
  grid-template-columns: 34px minmax(0, 1fr);
  color: var(--muted);
}

.core-line b {
  font-size: 12px;
}

.core-line small {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.core-line .icon-row {
  flex-wrap: nowrap;
  overflow: hidden;
}

.core-line .asset-icon-chip {
  width: 28px;
  height: 28px;
}

.chip-grid10 {
  display: grid;
  grid-template-columns: repeat(5, 30px);
  gap: 4px;
  align-items: center;
}

.chip-grid10 .asset-icon-chip {
  width: 30px;
  height: 30px;
}

.core-build-compact {
  display: grid;
  gap: 5px;
}

.core-build-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 72px;
  gap: 5px;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px;
  background: #fff;
}

.core-build-row.empty {
  grid-template-columns: 34px minmax(0, 1fr);
}

.core-build-row b {
  font-size: 12px;
}

.core-build-row small {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.core-build-row .icon-row {
  flex-wrap: nowrap;
  overflow: hidden;
}

.core-build-row .asset-icon-chip {
  width: 28px;
  height: 28px;
}

.compact-build small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.rarity-grid.dense {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.synergy-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.synergy-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.synergy-card header span,
.synergy-card p,
.synergy-kpis,
.mini-stat-chip b {
  color: var(--muted);
  font-size: 12px;
}

.synergy-card p {
  min-height: 34px;
  margin: 6px 0;
  line-height: 1.4;
}

.synergy-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 6px;
}

.synergy-kpis span,
.mini-stat-chip {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px;
  background: #f8fbfd;
}

.synergy-kpis b {
  display: block;
  color: var(--text);
}

.synergy-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.synergy-pair-grid > div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
  background: #fff;
}

.synergy-pair-grid b {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.mini-chip-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.mini-stat-chip {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 4px 6px;
  align-items: center;
}

.mini-stat-chip img {
  width: 26px;
  height: 26px;
  grid-row: span 2;
  border-radius: 6px;
}

.mini-stat-chip span,
.mini-stat-chip b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
}

.win { background: #e7f7ef; color: var(--good); }
.loss { background: #fff0f1; color: var(--bad); }
.muted { color: var(--muted); }
.subtext { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.subtext,
.hint,
.header-sub {
  font-weight: 500;
}

.match-list {
  display: grid;
  gap: 10px;
}

.match-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(25, 39, 52, 0.05);
}

.match-summary {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) minmax(360px, 2fr) minmax(170px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.match-card[open] .match-summary {
  background: #f8fbfd;
  border-left: 4px solid var(--accent);
}

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

.match-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.match-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.match-kpis span,
.match-metric,
.team-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  background: var(--soft);
}

.match-kpis span {
  color: var(--muted);
  font-size: 12px;
}

.match-kpis b,
.team-numbers b {
  color: var(--text);
  font-weight: 900;
}

.match-detail {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #fbfcfd;
}

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

.match-metric span,
.match-metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.match-metric strong {
  display: block;
  margin: 3px 0;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.flow-panel {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-left: 4px solid #6f879b;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.flow-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.flow-head strong {
  color: var(--text);
  font-size: 14px;
}

.flow-summary,
.flow-frames {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.flow-summary span,
.flow-frame,
.flow-shifts div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
}

.flow-summary b,
.flow-frame b,
.flow-shifts strong {
  display: block;
  color: var(--text);
  font-weight: 900;
}

.flow-frame.good { border-color: #b9dfcf; background: #f1fbf6; }
.flow-frame.bad { border-color: #e7bdc3; background: #fff5f6; }

.flow-frame span,
.flow-frame small,
.flow-shifts span {
  display: block;
  margin-top: 3px;
}

.flow-shifts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.match-assets-grid,
.team-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.match-assets-grid > div {
  min-width: 0;
}

.match-assets-grid strong,
.team-panel strong {
  display: block;
  margin-bottom: 6px;
}

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

.team-numbers span {
  color: var(--muted);
  font-size: 12px;
}

.participant-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  background: #fff;
}

.participant-table {
  min-width: 920px;
  font-size: 12px;
}

.participant-table th,
.participant-table td {
  padding: 7px;
}

.participant-table .is-own td {
  background: #fff8ea;
  border-top: 1px solid #edcf93;
  border-bottom: 1px solid #edcf93;
}

.team-tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 7px;
  font-weight: 900;
  font-size: 11px;
}

.team-tag.ally { background: #e7f7ef; color: var(--good); }
.team-tag.enemy { background: #eef3f8; color: #41556b; }

.logs {
  display: grid;
  gap: 7px;
}

.log {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  background: var(--soft);
}

.asset-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 340px;
  border: 1px solid #b9c7d4;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 16px 34px rgba(20, 35, 52, 0.2);
  pointer-events: none;
  font-size: 12px;
  line-height: 1.45;
}

.asset-tooltip strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .insight-grid, .factor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .snapshot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recommend-profile { grid-template-columns: 1fr; }
  .role-grid, .rarity-grid, .synergy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .topbar, .section-head { flex-direction: column; align-items: stretch; }
  .metrics, .insight-grid, .factor-grid, .snapshot-grid { grid-template-columns: 1fr; }
  .pattern-tools { grid-template-columns: 1fr; }
  .match-summary, .match-assets-grid, .team-compare { grid-template-columns: 1fr; }
  .match-kpis, .match-stat-grid, .team-numbers, .flow-summary, .flow-frames, .flow-shifts, .recommend-score-row, .build-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-grid, .rarity-grid, .synergy-grid, .rarity-inline, .mini-chip-row { grid-template-columns: 1fr; }
  .dashboard { padding: 12px; }
}

/* 2026-04-29 UI polish: presentation only, no data or analysis changes. */
:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --soft: #f8fafc;
  --line: #d8e1ea;
  --line-strong: #b9c8d7;
  --text: #101923;
  --muted: #5f6f80;
  --faint: #8d9baa;
  --accent: #0f6f86;
  --accent-2: #c49338;
  --ink: #111b25;
  --good: #0f8b61;
  --warn: #b36b12;
  --bad: #c23a4a;
  --shadow: 0 12px 28px rgba(18, 31, 45, 0.08);
  --shadow-soft: 0 6px 16px rgba(18, 31, 45, 0.06);
}

body {
  background:
    linear-gradient(180deg, rgba(17, 27, 37, 0.08) 0, rgba(17, 27, 37, 0) 260px),
    var(--bg);
  color: var(--text);
  font-size: 13px;
}

.topbar {
  position: relative;
  isolation: isolate;
  align-items: stretch;
  padding: 18px calc((100% - 1080px) / 2 + 18px);
  min-height: 128px;
  background:
    linear-gradient(135deg, #101923 0%, #142937 50%, #26323a 100%);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 16px 36px rgba(16, 25, 35, 0.22);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(196,147,56,0.22), rgba(196,147,56,0) 24%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.055) 0 1px, transparent 1px 18px);
  opacity: 0.8;
}

.topbar > div:first-child {
  max-width: 470px;
  padding: 4px 0;
}

.eyebrow {
  color: #d7b46b;
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.26);
}

h2 {
  color: #0d1f2d;
  font-size: 18px;
  line-height: 1.25;
}

.topbar .header-sub {
  max-width: 520px;
  color: #c9d7df;
  font-size: 13px;
}

.actions {
  align-content: flex-start;
  align-self: flex-start;
  max-width: 560px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(255,255,255,0.075);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

button,
.button {
  border-radius: 6px;
  background: linear-gradient(180deg, #137d96, #0f6478);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 14px rgba(6, 27, 36, 0.18);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
}

.ghost {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.dashboard {
  width: min(1080px, 100%);
  padding: 16px 18px 36px;
}

.metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: -28px;
  margin-bottom: 14px;
}

.metric {
  position: relative;
  min-height: 78px;
  padding: 11px 12px;
  border: 1px solid rgba(209, 220, 231, 0.92);
  border-top: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8fbfd);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.metric:nth-child(2)::before,
.metric:nth-child(5)::before { background: var(--accent-2); }
.metric:nth-child(3)::before { background: var(--good); }
.metric:nth-child(6)::before { background: var(--bad); }

.metric span {
  color: #667789;
  font-size: 11px;
}

.metric strong {
  margin-top: 7px;
  color: #0b2232;
  font-size: 18px;
}

.panel {
  position: relative;
  margin-bottom: 14px;
  padding: 15px;
  border-color: rgba(196, 209, 222, 0.9);
  background: rgba(255,255,255,0.96);
  box-shadow: var(--shadow);
}

.section-head {
  align-items: stretch;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e1e9f0;
}

.section-head > div:first-child {
  min-width: 230px;
}

.hint,
.subtext,
.header-sub {
  color: #647588;
}

.status-pill {
  align-self: center;
  min-width: 144px;
  color: #5f7588;
}

.segmented {
  align-self: flex-start;
  gap: 3px;
  border-color: #cfdae4;
  background: #eef4f8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.segmented button {
  min-height: 30px;
  color: #2a4054;
  font-weight: 900;
}

.segmented button.active {
  color: #0c5e72;
  border-color: #d8e5ed;
  background: #fff;
  box-shadow: 0 3px 10px rgba(20, 42, 60, 0.12);
}

.category-tabs {
  background: #e8f0f5;
}

.wide-tabs {
  row-gap: 5px;
}

.snapshot-grid,
.factor-grid,
.insight-grid,
.synergy-grid {
  gap: 9px;
}

.snapshot-card,
.factor-card,
.insight-card,
.role-card,
.rarity-card,
.rarity-block,
.synergy-card,
.recommend-hero,
.recommend-evidence,
.build-compare > div,
.team-panel,
.match-metric {
  border-color: #d4e0ea;
  background: linear-gradient(180deg, #fff, #f8fbfd);
  box-shadow: 0 2px 8px rgba(19, 36, 52, 0.04);
}

.mini-stats span,
.recommend-score-row span,
.evidence-line,
.synergy-kpis span,
.mini-stat-chip,
.team-numbers span {
  border-color: #d8e3ec;
  background: #fbfdfe;
}

.recommend-profile {
  gap: 12px;
}

.recommend-hero {
  border-left-color: var(--accent-2);
}

.recommend-evidence {
  border-top: 3px solid #d7b46b;
}

.table-title {
  color: #0d1f2d;
  font-weight: 900;
}

.table-hint {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid #d8e3ec;
  border-radius: 8px;
  background: #f7fafc;
}

.table-search-bar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto minmax(180px, 0.9fr);
  align-items: center;
  gap: 8px;
  margin: 12px 0 12px;
  padding: 10px 12px;
  border: 1px solid #cbd9e5;
  border-radius: 10px;
  background: #f7fafc;
  box-shadow: var(--shadow-soft);
}

.table-search-bar label {
  color: #173049;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.table-search-bar input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #c7d8e5;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.table-search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(19,125,150,0.14);
}

.table-search-bar .ghost {
  height: 34px;
  padding: 0 12px;
}

.table-search-bar span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.table-search-result {
  margin: 0 0 8px;
  color: #426073;
  font-size: 12px;
  font-weight: 700;
}

.mechanics-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.mechanics-summary span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
}

.mechanics-summary b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 16px;
}

.mechanic-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

.mechanic-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.mechanic-card strong {
  display: block;
  margin-bottom: 6px;
}

.mechanic-note {
  color: var(--text);
  line-height: 1.45;
  word-break: keep-all;
}

.evidence-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.empty-cell {
  padding: 22px 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .daily-trend-list {
    grid-template-columns: 1fr;
  }

  .table-search-bar {
    grid-template-columns: 1fr auto;
  }

  .table-search-bar label,
  .table-search-bar span {
    grid-column: 1 / -1;
  }

  .mechanics-summary,
  .mechanic-card-grid {
    grid-template-columns: 1fr;
  }
}

.table-wrap {
  border-color: #cbd9e5;
  box-shadow: var(--shadow-soft);
}

table {
  background: #fff;
}

th,
td {
  padding: 8px 9px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #edf4f8, #e2edf4);
  color: #173049;
  border-bottom-color: #b8c8d8;
  font-size: 11px;
}

td {
  background: #fff;
}

tbody tr:nth-child(even) td {
  background: #f8fbfd;
}

tbody tr:hover td {
  background: #f2f7fa;
}

td strong {
  color: #071d2b;
}

.good-text {
  color: #068158;
}

.bad-text {
  color: #bf3045;
}

.pill,
.signal-badge,
.team-tag {
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.68);
}

.asset-chip,
.asset-icon-chip,
.core-line,
.core-build-row {
  border-color: #cfdae4;
  background: #fff;
  box-shadow: 0 1px 3px rgba(18, 31, 45, 0.04);
}

.asset-chip img,
.mini-icon,
.asset-icon-chip {
  border-radius: 7px;
}

.asset-icon-chip {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
}

.asset-icon-chip .icon-fallback {
  display: none;
  color: #d9e6ee;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  padding: 0 2px;
}

.asset-chip img {
  background: #102337;
}

.asset-chip.augment-chip img,
.asset-icon-chip.augment-chip {
  background: #102337;
}

.asset-chip.augment-chip {
  background: rgba(16, 35, 55, 0.06);
  color: var(--text);
  border-color: #cfdae4;
}

.asset-chip.augment-chip > span {
  color: var(--text);
}

.asset-chip.augment-chip.rarity-prismatic,
.asset-chip.augment-chip.rarity-gold,
.asset-chip.augment-chip.rarity-silver {
  background: rgba(16, 35, 55, 0.04);
  color: var(--text);
  border-color: #cfdae4;
  box-shadow: none;
}

.asset-chip.augment-chip.rarity-prismatic img,
.asset-icon-chip.augment-chip.rarity-prismatic {
  background: #0b1d2b;
  border-color: rgba(161, 118, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(161, 118, 255, 0.28), 0 1px 3px rgba(18, 31, 45, 0.04);
}

.asset-chip.augment-chip.rarity-gold img,
.asset-icon-chip.augment-chip.rarity-gold {
  background: #0b1d2b;
  border-color: rgba(214, 164, 48, 0.72);
  box-shadow: inset 0 0 0 1px rgba(214, 164, 48, 0.28), 0 1px 3px rgba(18, 31, 45, 0.04);
}

.asset-chip.augment-chip.rarity-silver img,
.asset-icon-chip.augment-chip.rarity-silver {
  background: #0b1d2b;
  border-color: rgba(139, 154, 166, 0.72);
  box-shadow: inset 0 0 0 1px rgba(139, 154, 166, 0.28), 0 1px 3px rgba(18, 31, 45, 0.04);
}

.asset-list .asset-chip:hover,
.asset-icon-chip:hover,
.core-line:hover,
.core-build-row:hover {
  border-color: #b8c8d8;
  box-shadow: 0 3px 10px rgba(18, 31, 45, 0.08);
}

.champion-augment-groups .asset-icon-chip,
.chip-grid10 .asset-icon-chip,
.core-line .asset-icon-chip,
.core-build-row .asset-icon-chip {
  background: #102337;
}

.asset-icon-chip.missing-icon .icon-fallback {
  display: inline-flex;
}

.asset-chip.missing-icon::before {
  content: attr(data-fallback);
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #102337;
  border: 1px solid rgba(207, 218, 228, 0.9);
  color: #d9e6ee;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.asset-icon-chip.missing-icon::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 5px;
  pointer-events: none;
}

body.is-refreshing #rangeTabs button.active,
body.is-refreshing #refreshBtn {
  box-shadow: 0 0 0 3px rgba(19,125,150,0.18), 0 8px 18px rgba(18,31,45,0.12);
}

body.public-viewer #syncLcuBtn,
body.public-viewer #backfillLcuBtn,
body.public-viewer #syncExternalBtn,
body.public-viewer #saveApiKeyBtn,
body.public-viewer #testApiKeyBtn,
body.public-viewer #riotApiKeyInput,
body.public-viewer #riotApiKeyStatus,
body.public-viewer .api-key-box,
body.public-viewer a[href="/api/export"] {
  display: none !important;
}

body.public-viewer #metrics,
body.public-viewer .side-nav-summary {
  display: none !important;
}

body.public-viewer .dashboard > section.panel:nth-of-type(2) {
  grid-row: 1 / span 2;
}

.core-lines,
.core-build-compact {
  gap: 6px;
}

.core-line,
.core-build-row {
  min-height: 38px;
  border-radius: 8px;
}

.synergy-card {
  overflow: hidden;
}

.synergy-card header strong {
  color: #0d1f2d;
}

.match-list {
  gap: 10px;
}

.match-card {
  border-color: #c9d8e5;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.match-summary {
  min-height: 72px;
  background: linear-gradient(180deg, #ffffff, #f7fbfd);
}

.match-card[open] .match-summary {
  background: linear-gradient(180deg, #f7fbfd, #eef6fa);
}

.match-title strong {
  color: #0a2232;
}

.match-kpis span {
  border-color: #d5e1eb;
  background: #fff;
}

.match-detail {
  background: #fbfdfe;
}

.match-stat-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.match-metric strong {
  color: #071d2b;
}

.participant-table-wrap {
  border-color: #cbd9e5;
}

.participant-table th {
  position: static;
}

.participant-table .is-own td {
  background: #fff7e6;
  border-top-color: #dfbd70;
  border-bottom-color: #dfbd70;
}

.log {
  border-color: #d4e0ea;
  background: #f8fbfd;
}

.asset-tooltip {
  border-color: #aebfcd;
  background: #fff;
  box-shadow: 0 18px 42px rgba(14, 29, 43, 0.26);
}

@media (max-width: 1050px) {
  .topbar {
    padding: 16px 18px;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
  }

  .match-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .actions {
    max-width: 100%;
  }

  .api-key-box {
    grid-template-columns: 1fr;
  }

  .metrics {
    margin-top: 8px;
  }

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

.tier-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 12px;
  color: var(--muted);
}

.tier-headline strong {
  color: var(--text);
  font-size: 17px;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  border-radius: 7px;
  font-weight: 800;
  color: #fff;
  background: #64748b;
}

.tier-s { background: #0f766e; }
.tier-a { background: #15803d; }
.tier-b { background: #2563eb; }
.tier-c { background: #7c3aed; }
.tier-d { background: #b91c1c; }
.tier-watch { background: #64748b; }
.tier-관찰 { background: #64748b; }

.more-rows {
  margin-top: 10px;
}

.more-rows > summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-weight: 800;
  color: var(--accent);
}

.result-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.result-summary-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.result-summary-grid span,
.result-summary-grid small {
  display: block;
  color: var(--muted);
}

.result-summary-grid strong {
  display: block;
  margin: 4px 0;
  font-size: 18px;
  color: var(--text);
}

@media (max-width: 900px) {
  .result-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.anvil-reference {
  display: grid;
  gap: 14px;
}

.anvil-hero,
.anvil-table-card,
.anvil-note-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.anvil-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
}

.anvil-hero h2,
.anvil-table-card h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.anvil-hero p,
.anvil-table-card p,
.anvil-note-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.anvil-hero span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

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

.anvil-note-grid article {
  padding: 12px;
}

.anvil-note-grid strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.anvil-table-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.anvil-table-scroll {
  overflow-x: auto;
}

.anvil-reference table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 12px;
}

.anvil-reference th,
.anvil-reference td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.anvil-reference thead th {
  background: #eef5f8;
  color: var(--text);
  font-weight: 900;
  text-align: center;
}

.anvil-reference tbody th {
  width: 86px;
  background: var(--soft);
  color: var(--accent);
  font-weight: 900;
  white-space: nowrap;
}

.anvil-reference td:nth-child(n+2):nth-child(-n+10) {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.anvil-check-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
}

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

.anvil-formula-grid span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
}

.anvil-formula-grid b {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
}

@media (max-width: 820px) {
  .anvil-hero { align-items: flex-start; flex-direction: column; }
  .anvil-note-grid { grid-template-columns: 1fr; }
  .anvil-formula-grid { grid-template-columns: 1fr; }
}

.time-pattern-report {
  display: grid;
  gap: 12px;
}

.time-pattern-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.time-pattern-summary article,
.time-pattern-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.time-pattern-summary article {
  padding: 12px;
}

.time-pattern-summary span,
.time-pattern-summary small {
  display: block;
  color: var(--muted);
}

.time-pattern-summary strong {
  display: block;
  margin: 4px 0;
  color: var(--text);
  font-size: 17px;
}

.time-pattern-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.time-pattern-card {
  padding: 14px;
}

.time-pattern-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}

.time-pattern-card h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.time-pattern-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.time-pattern-legend {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.time-pattern-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.time-pattern-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.time-pattern-dot.win { background: #0f9f7a; }
.time-pattern-dot.loss { background: #ef4b5f; }

.time-pattern-bars {
  display: grid;
  gap: 7px;
}

.time-pattern-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: center;
  min-height: 22px;
}

.time-pattern-label {
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.time-pattern-bar {
  height: 12px;
  border-radius: 999px;
  background: #e7eef3;
  overflow: hidden;
}

.time-pattern-fill {
  height: 100%;
  min-width: 0;
  display: flex;
  border-radius: inherit;
  overflow: hidden;
}

.time-pattern-win,
.time-pattern-loss {
  display: block;
  height: 100%;
}

.time-pattern-win { background: #0f9f7a; }
.time-pattern-loss { background: #ef4b5f; }

.time-pattern-meta {
  display: grid;
  justify-items: end;
  line-height: 1.1;
}

.time-pattern-meta strong {
  color: var(--text);
  font-size: 12px;
}

.time-pattern-meta small {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1120px) {
  .time-pattern-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-pattern-grid {
    grid-template-columns: 1fr;
  }
}

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

.time-pattern-scale {
  margin-left: auto;
}

.time-pattern-chart-scroll {
  overflow-x: auto;
  padding: 4px 0 2px;
}

.time-pattern-bars {
  display: flex;
  align-items: end;
  gap: 8px;
  min-width: max-content;
  min-height: 230px;
  padding: 18px 8px 4px;
  border-left: 1px solid #d7e2ea;
  border-bottom: 1px solid #d7e2ea;
  background:
    linear-gradient(to top, rgba(148, 163, 184, 0.16) 1px, transparent 1px) 0 18px / 100% 44px,
    linear-gradient(#f8fbfd, #f8fbfd);
}

.time-pattern-column {
  flex: 0 0 42px;
  display: grid;
  grid-template-rows: 158px auto auto;
  gap: 5px;
  align-items: end;
  justify-items: center;
}

.time-pattern-column-bars {
  width: 100%;
  height: 158px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
}

.time-pattern-vbar {
  position: relative;
  display: block;
  width: 14px;
  min-height: 0;
  border-radius: 5px 5px 2px 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.time-pattern-vbar.win {
  background: #0f9f7a;
}

.time-pattern-vbar.loss {
  background: #ef4b5f;
}

.time-pattern-vbar em {
  position: absolute;
  left: 50%;
  top: -16px;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
}

.time-pattern-column:hover .time-pattern-vbar em {
  opacity: 1;
}

.time-pattern-column-label {
  min-height: 14px;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.time-pattern-column-rate {
  display: grid;
  justify-items: center;
  line-height: 1.05;
}

.time-pattern-column-rate strong {
  font-size: 11px;
  color: var(--text);
}

.time-pattern-column-rate small {
  font-size: 10px;
  color: var(--muted);
}

.time-pattern-column.win-dominant .time-pattern-column-rate strong {
  color: #047857;
}

.time-pattern-column.loss-dominant .time-pattern-column-rate strong {
  color: #be123c;
}

@media (max-width: 1120px) {
  .time-pattern-grid {
    grid-template-columns: 1fr;
  }
}

/* Public dark dashboard skin */
:root {
  --bg: #141820;
  --surface: #1b2029;
  --soft: #242b38;
  --line: #303746;
  --line-strong: #3b4658;
  --text: #e6ebf4;
  --muted: #9aa4b5;
  --faint: #697488;
  --accent: #5d7df2;
  --accent-2: #e29a2c;
  --good: #43c59e;
  --warn: #e2a449;
  --bad: #e15a67;
  --shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 8px 18px rgba(0, 0, 0, 0.16);
}

body {
  background:
    linear-gradient(180deg, #171c24 0, #141820 180px, #11151c 100%);
  color: var(--text);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, auto);
  align-items: center;
  gap: 24px;
  padding: 22px 38px 18px;
  border-bottom: 1px solid #252c39;
  background: rgba(24, 29, 38, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.topbar h1 {
  color: #f5f7fb;
  font-size: 25px;
  font-weight: 950;
}

.eyebrow {
  color: #82a0ff;
  font-size: 13px;
}

.topbar .header-sub {
  color: #8f98aa;
  font-size: 13px;
}

.actions {
  justify-content: flex-end;
  gap: 8px;
  max-width: none;
}

button,
.button {
  min-height: 34px;
  border-radius: 9px;
  background: #425fe0;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 16px rgba(0, 0, 0, 0.18);
}

button:hover,
.button:hover {
  filter: brightness(1.08);
}

.ghost {
  border-color: #3b4658;
  background: #242b36;
  color: #d4dbea;
}

#syncLcuBtn,
#syncExternalBtn {
  background: #d98e25;
}

.api-key-box {
  grid-template-columns: minmax(240px, 1fr) auto auto;
}

.api-key-box input {
  border-color: #3a4353;
  background: #151a22;
  color: #e7ecf5;
}

.api-key-status {
  color: #8792a4;
}

.dashboard {
  width: min(1680px, 100%);
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 24px 28px;
  padding: 32px 38px 48px;
}

.metrics {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.dashboard > section.panel:nth-of-type(2) {
  grid-column: 1;
  grid-row: 2;
}

.dashboard > section.panel:nth-of-type(3) {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
}

.metric,
.panel,
.snapshot-card,
.factor-card,
.insight-card,
.role-card,
.rarity-card,
.rarity-block,
.synergy-card,
.recommend-hero,
.recommend-evidence,
.build-compare > div,
.team-panel,
.match-metric,
.anvil-hero,
.anvil-table-card,
.anvil-note-grid article,
.time-pattern-summary article,
.time-pattern-card {
  border-color: var(--line);
  background: linear-gradient(180deg, #202633, #1a202a);
  box-shadow: var(--shadow-soft);
}

.metric {
  min-height: 96px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}

.metric:first-child {
  grid-column: 1 / -1;
  min-height: 154px;
  background:
    linear-gradient(135deg, rgba(91, 125, 242, 0.18), rgba(27, 32, 41, 0.92) 56%),
    #1b2029;
}

.metric::before {
  width: 5px;
  background: var(--accent);
}

.metric span {
  color: #9aa6ba;
  font-size: 12px;
}

.metric strong {
  color: #f6f8fc;
  font-size: 20px;
}

.metric:first-child strong {
  margin-top: 16px;
  font-size: 34px;
  letter-spacing: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: #1a2029;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: start;
  gap: 12px;
  border-bottom: 1px solid #2a3240;
  padding-bottom: 14px;
}

.dashboard > section.panel:nth-of-type(3) .section-head {
  grid-template-columns: minmax(180px, 1fr);
}

.section-head h2,
.table-title,
.anvil-hero h2,
.anvil-table-card h2 {
  color: #f3f6fb;
}

.hint,
.subtext,
.table-hint,
.daily-rule-line,
.daily-period-line span,
.daily-point-list span,
.daily-search-result {
  color: var(--muted);
}

.segmented {
  border-color: #303846;
  border-radius: 12px;
  background: #151a22;
  box-shadow: none;
}

.segmented button {
  min-height: 33px;
  border-radius: 9px;
  color: #8f98aa;
}

.segmented button.active {
  border-color: rgba(255, 255, 255, 0.08);
  background: #edf1f7;
  color: #171d26;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
}

.category-tabs {
  background: #151a22;
}

.category-tabs button.active {
  background: #4868e8;
  color: #fff;
}

.wide-tabs {
  display: flex;
  gap: 7px;
  width: 100%;
  padding: 7px;
  overflow-x: auto;
  border-radius: 14px;
}

.wide-tabs button {
  flex: 0 0 auto;
}

.status-pill {
  color: #8792a4;
}

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

.snapshot-card {
  border-radius: 14px;
}

.snapshot-card strong {
  color: #f3f6fb;
}

.table-search-bar,
.table-hint,
.daily-period-line,
.daily-rule-line,
.daily-point-list,
.daily-search-result,
.daily-change-grid article,
.daily-summary span,
.daily-out-list,
.daily-trend-entry,
.daily-capture-type-title {
  border-color: #303846;
  background: #161c25;
}

.table-search-bar input,
.pattern-tools select,
.pattern-tools input {
  border-color: #374151;
  background: #11161d;
  color: #eef3fb;
}

.table-search-bar label {
  color: #dbeafe;
}

.table-search-bar span,
.table-search-result {
  color: #aebcd0;
}

.table-wrap {
  border: 1px solid #2b3341;
  border-radius: 14px;
  background: #171d26;
}

table {
  background: #171d26;
  color: #dfe6f1;
}

thead th {
  background: #202736;
  color: #9faabd;
  border-bottom-color: #303846;
}

tbody td {
  border-bottom-color: #252d3a;
}

tbody tr:hover td {
  background: #202737;
}

.asset-cell,
.daily-trend-entry b,
.daily-period-line strong,
.daily-point-list strong,
.time-pattern-card h3,
.time-pattern-summary strong {
  color: #f0f4fb;
}

.mini-icon,
.asset img,
.daily-trend-entry img {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.match-list {
  gap: 12px;
}

.match-card {
  overflow: hidden;
  border: 1px solid #2a3242;
  border-left: 6px solid #536178;
  border-radius: 13px;
  background: #202532;
  box-shadow: var(--shadow-soft);
}

.match-card:has(.pill.win) {
  border-left-color: #5074ff;
  background: linear-gradient(90deg, rgba(63, 95, 194, 0.28), rgba(31, 38, 54, 0.96) 34%, #1b202b);
}

.match-card:has(.pill.loss) {
  border-left-color: #e15a67;
  background: linear-gradient(90deg, rgba(171, 61, 73, 0.28), rgba(45, 30, 38, 0.96) 34%, #211d27);
}

.match-summary {
  grid-template-columns: 280px minmax(320px, 1fr) minmax(150px, auto);
  align-items: center;
  padding: 16px 18px;
  background: transparent;
}

.match-card[open] .match-summary {
  border-bottom-color: #2b3443;
  background: rgba(255, 255, 255, 0.02);
}

.match-title strong {
  color: #f4f7fd;
  font-size: 17px;
}

.match-kpis {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.match-kpis span {
  min-width: 94px;
  border: 1px solid #303947;
  border-radius: 10px;
  background: rgba(18, 23, 32, 0.68);
  color: #a1adbf;
}

.match-kpis b {
  color: #f2f6fc;
}

.pill.win {
  background: rgba(80, 116, 255, 0.18);
  color: #88a3ff;
}

.pill.loss {
  background: rgba(225, 90, 103, 0.18);
  color: #ff8d98;
}

.match-detail {
  background: rgba(13, 17, 24, 0.32);
}

.match-stat-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.match-metric {
  border-radius: 11px;
}

.match-metric span,
.match-metric small {
  color: #9aa6ba;
}

.match-metric strong {
  color: #f2f6fc;
}

.team-panel,
.match-assets-grid > div,
.participant-table-wrap {
  border-color: #2d3544;
  background: #171d26;
}

.team-numbers span,
.mini-stats span,
.recommend-score-row span,
.evidence-line,
.synergy-kpis span,
.mini-stat-chip {
  border-color: #2f3847;
  background: #11161d;
}

.participant-table th {
  background: #202736;
  color: #9faabd;
}

.participant-table td {
  border-bottom-color: #27303d;
}

.participant-table .is-own td {
  background: rgba(91, 125, 242, 0.1);
}

.tier-board {
  border-color: #2b3443;
  border-radius: 16px;
  background: #090f17;
}

.tier-row {
  border-radius: 12px;
}

.tier-sample-divider span {
  background: #090f17;
}

.time-pattern-bars {
  border-color: #303846;
  background:
    linear-gradient(to top, rgba(148, 163, 184, 0.11) 1px, transparent 1px) 0 18px / 100% 44px,
    linear-gradient(#141a23, #141a23);
}

.time-pattern-column-label,
.time-pattern-column-rate strong,
.time-pattern-vbar em {
  color: #eef3fb;
}

.time-pattern-column-rate small {
  color: #8f99aa;
}

.good-text {
  color: var(--good);
}

.bad-text {
  color: var(--bad);
}

.muted {
  color: var(--muted);
}

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

  .actions {
    justify-content: flex-start;
  }

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

  .metrics,
  .dashboard > section.panel:nth-of-type(2),
  .dashboard > section.panel:nth-of-type(3) {
    grid-column: 1;
    grid-row: auto;
  }

  .match-summary {
    grid-template-columns: 1fr;
  }

  .match-kpis {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

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

  .dashboard {
    padding: 18px 12px 32px;
  }

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

  .section-head {
    grid-template-columns: 1fr;
  }
}

/* Compact public layout pass: keep dashboard horizontal, not a tall stack. */
.dashboard {
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 18px 22px;
  padding-top: 24px;
}

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

.metric {
  min-height: 78px;
  padding: 11px 12px;
}

.metric:first-child {
  min-height: 112px;
}

.metric:first-child strong {
  margin-top: 8px;
  font-size: 30px;
}

.panel {
  padding: 14px;
}

.dashboard > section.panel:nth-of-type(2) {
  position: sticky;
  top: 106px;
  max-height: calc(100vh - 128px);
  overflow: auto;
}

.dashboard > section.panel:nth-of-type(2) .section-head {
  grid-template-columns: 1fr;
  gap: 8px;
}

.dashboard > section.panel:nth-of-type(2) .section-head .hint {
  display: none;
}

.dashboard > section.panel:nth-of-type(3) {
  align-self: start;
}

.dashboard > section.panel:nth-of-type(3) .section-head {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(0, 1fr);
  grid-template-areas:
    "title range"
    "category tabs";
  align-items: center;
  gap: 8px 10px;
  padding-bottom: 10px;
}

.dashboard > section.panel:nth-of-type(3) .section-head > div:first-child {
  grid-area: title;
  min-width: 0;
}

.dashboard > section.panel:nth-of-type(3) .section-head > div:first-child .hint {
  display: none;
}

#rangeTabs {
  grid-area: range;
  justify-self: end;
  max-width: 100%;
}

#tableCategoryTabs {
  grid-area: category;
  align-self: stretch;
  justify-self: start;
  max-width: 100%;
}

#tableTabs {
  grid-area: tabs;
  align-self: stretch;
}

.dashboard > section.panel:nth-of-type(3) .segmented {
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.dashboard > section.panel:nth-of-type(3) .segmented button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 9px;
  white-space: nowrap;
}

.wide-tabs {
  row-gap: 0;
}

.snapshot-grid {
  display: grid;
  gap: 8px;
}

.snapshot-card {
  padding: 12px;
}

.daily-toolbar,
.daily-report {
  gap: 8px;
}

.daily-summary,
.daily-change-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.daily-change-grid {
  gap: 8px;
}

.daily-trend-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tier-board {
  padding: 12px;
}

.tier-row {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  min-height: 46px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.tier-label strong {
  font-size: 21px;
}

.tier-label span {
  font-size: 10px;
}

.match-summary {
  grid-template-columns: minmax(210px, 260px) minmax(260px, 1fr) minmax(120px, auto);
  padding: 12px 14px;
}

.match-kpis {
  gap: 7px;
}

.match-kpis span {
  min-width: 78px;
  padding: 7px 8px;
}

@media (max-width: 1320px) {
  .dashboard {
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 16px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .dashboard > section.panel:nth-of-type(3) .section-head {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "range"
      "category"
      "tabs";
  }

  #rangeTabs {
    justify-self: start;
  }
}

@media (max-width: 980px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .dashboard > section.panel:nth-of-type(2) {
    position: static;
    max-height: none;
  }
}

/* Hard compact pass: the page itself must not become a long vertical document. */
html,
body {
  height: 100%;
  overflow: hidden;
}

.topbar {
  position: relative;
  height: 122px;
  min-height: 0;
  grid-template-columns: 400px minmax(0, 1fr);
  padding: 16px 32px;
}

.topbar h1 {
  font-size: 24px;
}

.topbar .header-sub {
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions {
  display: grid;
  grid-template-columns: repeat(5, auto);
  justify-content: end;
  align-content: center;
  align-items: center;
  gap: 8px;
}

.actions > button,
.actions > .button {
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}

.api-key-box {
  grid-column: 1 / -1;
  grid-template-columns: minmax(300px, 1fr) auto auto;
  align-items: center;
  margin-top: 0;
}

.api-key-box input {
  height: 34px;
}

.api-key-status {
  grid-column: 1 / -1;
  max-height: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dashboard {
  height: calc(100vh - 122px);
  min-height: 0;
  overflow: hidden;
  grid-template-columns: 330px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px 18px;
  padding: 18px 24px 22px;
}

.metrics {
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.metric {
  min-height: 68px;
  padding: 9px 10px;
}

.metric:first-child {
  min-height: 86px;
}

.metric:first-child strong {
  margin-top: 5px;
  font-size: 26px;
}

.metric strong {
  font-size: 18px;
}

.dashboard > section.panel:nth-of-type(2) {
  position: static;
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.dashboard > section.panel:nth-of-type(3) {
  height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.dashboard > section.panel:nth-of-type(3) .section-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -14px -14px 10px;
  padding: 12px 14px 10px;
  background: rgba(26, 32, 41, 0.96);
  backdrop-filter: blur(8px);
}

.panel {
  margin-bottom: 0;
}

.section-head h2 {
  font-size: 16px;
}

.dashboard > section.panel:nth-of-type(3) .segmented {
  min-height: 38px;
  padding: 3px;
}

.dashboard > section.panel:nth-of-type(3) .segmented button {
  min-height: 28px;
  padding: 4px 8px;
}

.snapshot-card {
  padding: 10px;
}

.snapshot-card .mini-stats {
  gap: 6px;
}

.tier-board {
  max-height: none;
}

@media (max-width: 980px) {
  html,
  body {
    overflow: auto;
  }

  .topbar {
    height: auto;
    grid-template-columns: 1fr;
  }

  .dashboard {
    height: auto;
    overflow: visible;
    grid-template-columns: 1fr;
  }

  .dashboard > section.panel:nth-of-type(2),
  .dashboard > section.panel:nth-of-type(3) {
    height: auto;
    overflow: visible;
  }
}

/* Balanced public layout pass: spread summary and report controls across the viewport. */
.topbar {
  height: 132px;
  grid-template-columns: minmax(340px, 0.38fr) minmax(0, 1fr);
  padding: 14px 28px;
}

.dashboard {
  height: calc(100vh - 132px);
  grid-template-columns: minmax(390px, 0.34fr) minmax(0, 0.66fr);
  grid-template-rows: 86px minmax(0, 1fr);
  gap: 14px 18px;
  padding: 16px 24px 20px;
}

.metrics {
  grid-column: 1 / -1;
  grid-row: 1;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-self: stretch;
}

.metric,
.metric:first-child {
  grid-column: auto;
  min-height: 0;
  height: 86px;
  padding: 10px 12px;
}

.metric strong,
.metric:first-child strong {
  margin-top: 6px;
  font-size: 20px;
}

.dashboard > section.panel:nth-of-type(2) {
  grid-column: 1;
  grid-row: 2;
  height: 100%;
  max-height: none;
  overflow: auto;
}

.dashboard > section.panel:nth-of-type(3) {
  grid-column: 2;
  grid-row: 2;
  height: 100%;
  overflow: auto;
}

.dashboard > section.panel:nth-of-type(3) .section-head {
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  grid-template-areas:
    "title range"
    "category tabs";
  align-items: center;
}

.daily-report.tier-report {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.daily-toolbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.daily-toolbar .segmented {
  min-width: 0;
}

.daily-toolbar .wide-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
}

.daily-capture-actions {
  margin-left: 0;
  justify-self: end;
  display: flex;
  gap: 8px;
}

.daily-capture-actions button {
  min-height: 32px;
  padding: 5px 10px;
  white-space: nowrap;
}

.daily-period-line,
.daily-rule-line {
  min-width: 0;
}

.daily-search-result,
.daily-trend-list,
.tier-board {
  grid-column: 1 / -1;
}

@media (max-width: 1180px) {
  html,
  body {
    overflow: auto;
  }

  .topbar {
    height: auto;
    grid-template-columns: 1fr;
  }

  .dashboard {
    height: auto;
    overflow: visible;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .metrics {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard > section.panel:nth-of-type(2),
  .dashboard > section.panel:nth-of-type(3) {
    grid-column: 1;
    grid-row: auto;
    height: auto;
    overflow: visible;
  }

  .daily-report.tier-report {
    grid-template-columns: 1fr;
  }

  .daily-toolbar {
    grid-template-columns: 1fr;
  }
}

/* 1080-width fit pass: keep the page distributed instead of falling into one long column. */
@media (min-width: 900px) and (max-width: 1180px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .topbar {
    height: 132px;
    grid-template-columns: minmax(270px, 0.32fr) minmax(0, 1fr);
    padding: 12px 16px;
  }

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

  .topbar .header-sub {
    max-width: 320px;
  }

  .actions {
    grid-template-columns: repeat(5, auto);
    gap: 6px;
  }

  .actions > button,
  .actions > .button {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 12px;
  }

  .api-key-box {
    grid-template-columns: minmax(240px, 1fr) auto auto;
  }

  .dashboard {
    height: calc(100vh - 132px);
    overflow: hidden;
    grid-template-columns: minmax(320px, 0.35fr) minmax(0, 0.65fr);
    grid-template-rows: 152px minmax(0, 1fr);
    gap: 12px 14px;
    padding: 14px 16px 18px;
  }

  .metrics {
    grid-column: 1 / -1;
    grid-row: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, 72px);
    gap: 8px;
  }

  .metric,
  .metric:first-child {
    height: 72px;
    padding: 8px 10px;
  }

  .metric strong,
  .metric:first-child strong {
    font-size: 19px;
  }

  .dashboard > section.panel:nth-of-type(2) {
    grid-column: 1;
    grid-row: 2;
    height: 100%;
    overflow: auto;
  }

  .dashboard > section.panel:nth-of-type(3) {
    grid-column: 2;
    grid-row: 2;
    height: 100%;
    overflow: auto;
  }

  .dashboard > section.panel:nth-of-type(3) .section-head {
    grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
    grid-template-areas:
      "title range"
      "category tabs";
  }

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

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

  .daily-capture-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

/* 1080 analysis layout repair: narrow utility sidebar, readable full-width tables. */
.dashboard {
  grid-template-columns: minmax(260px, 0.22fr) minmax(0, 1fr);
}

.dashboard > section.panel:nth-of-type(2) {
  min-width: 0;
}

.dashboard > section.panel:nth-of-type(3) {
  min-width: 0;
}

#tableArea {
  min-width: 0;
}

.side-nav-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-nav-panel #snapshotTabs,
.side-nav-panel .status-pill {
  display: none !important;
}

.side-nav-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.side-nav-summary article,
.side-nav-group {
  border: 1px solid #303948;
  border-radius: 12px;
  background: #1c2431;
}

.side-nav-summary article {
  padding: 10px;
}

.side-nav-summary span,
.side-nav-group small {
  display: block;
  color: #98a8bc;
  font-size: 11px;
}

.side-nav-summary strong {
  display: block;
  margin-top: 5px;
  color: #f5f8fd;
  font-size: 18px;
}

.side-nav-group {
  overflow: hidden;
}

.side-nav-group header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid #2b3443;
  background: #202938;
}

.side-nav-group h3 {
  margin: 0;
  color: #f4f7fc;
  font-size: 13px;
}

.side-nav-list {
  display: grid;
  gap: 4px;
  padding: 7px;
}

.side-nav-list button {
  width: 100%;
  min-height: 31px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  background: transparent;
  color: #cbd6e5;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.side-nav-list button:hover {
  border-color: #3e4a5d;
  background: #242e3d;
  color: #fff;
}

.side-nav-list button.active {
  border-color: #5b7cff;
  background: linear-gradient(135deg, rgba(80,116,255,0.38), rgba(32,41,58,0.96));
  color: #fff;
}

.side-nav-note {
  margin: 0;
  color: #96a6ba;
  font-size: 12px;
  line-height: 1.45;
}

.table-wrap,
.participant-table-wrap,
.anvil-table-scroll,
.time-pattern-chart-scroll {
  max-width: 100%;
  overflow-x: visible;
}

table,
.participant-table,
.anvil-reference table {
  width: 100%;
  table-layout: fixed;
  background: #141b25;
  color: #e6edf7;
}

th,
td,
.participant-table th,
.participant-table td,
.anvil-reference th,
.anvil-reference td {
  color: #e6edf7;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-height: 1.38;
}

thead th,
.participant-table th,
.anvil-reference th {
  background: #222b39;
  color: #d7e2ef;
}

th button {
  color: inherit;
  white-space: normal;
}

tbody td,
.participant-table td,
.anvil-reference td {
  background: #151c26;
}

tbody tr:nth-child(even) td {
  background: #192230;
}

tbody tr:hover td {
  background: #222c3b;
}

td strong,
.asset-cell strong,
.asset-cell,
.subtext strong,
.role-row b {
  color: #f6f9ff;
}

.subtext,
.table-hint,
.role-row small,
.asset-cell + .subtext {
  color: #aebbd0;
}

.good-text {
  color: #37d194;
}

.bad-text {
  color: #ff6d7d;
}

@media (min-width: 900px) and (max-width: 1180px) {
  .dashboard {
    grid-template-columns: minmax(230px, 0.24fr) minmax(0, 1fr);
  }

  .side-nav-summary {
    grid-template-columns: 1fr;
  }

  .side-nav-summary article {
    padding: 8px 9px;
  }

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

  .dashboard > section.panel:nth-of-type(3) .section-head {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "range"
      "category"
      "tabs";
  }

  .table-wrap {
    border-radius: 10px;
  }

  th,
  td {
    padding: 7px 6px;
    font-size: 12px;
  }
}

/* Final public UI guard: no light islands, no duplicate tab bars. */
* {
  scrollbar-width: thin;
  scrollbar-color: #3b4a60 #101722;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #101722;
}

*::-webkit-scrollbar-thumb {
  background: #3b4a60;
  border: 2px solid #101722;
  border-radius: 999px;
}

html,
body,
.dashboard,
.panel,
#tableArea,
.table-wrap,
.participant-table-wrap,
.anvil-table-scroll,
.time-pattern-chart-scroll {
  overflow-x: hidden !important;
}

html {
  overflow-y: scroll !important;
  scrollbar-gutter: stable;
}

.dashboard > section.panel:nth-of-type(3) .section-head {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
  margin: 0 0 10px !important;
  background: transparent !important;
  backdrop-filter: none !important;
}

body:not(.filters-open) #tableCategoryTabs,
body:not(.filters-open) #tableTabs {
  display: none !important;
}

body.filters-open #tableCategoryTabs,
body.filters-open #tableTabs,
body.filters-open .wide-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  overflow: visible !important;
}

.filter-toggle,
.sidebar-toggle {
  min-height: 32px;
  border: 1px solid #3a4658;
  border-radius: 9px;
  padding: 6px 10px;
  background: #202a3a;
  color: #eaf1fb;
  font-size: 12px;
  font-weight: 900;
}

.filter-toggle:hover,
.sidebar-toggle:hover {
  border-color: #5b7cff;
  background: #263248;
}

.filter-toggle {
  justify-self: end;
}

.sidebar-toggle {
  position: absolute;
  left: 10px;
  top: 146px;
  z-index: 80;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.side-nav-panel .sidebar-toggle {
  position: static;
  justify-self: start;
  align-self: start;
  width: max-content;
  margin: 0 0 8px;
  box-shadow: none;
}

body.sidebar-collapsed .dashboard {
  grid-template-columns: 0 minmax(0, 1fr) !important;
}

body.sidebar-collapsed .dashboard > section.panel:nth-of-type(2) {
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

body.sidebar-collapsed .sidebar-toggle {
  position: static;
  left: auto;
  top: auto;
  z-index: auto;
  width: max-content;
  margin: 0 0 10px;
  box-shadow: none;
}

#tableArea .insight-card,
#tableArea .factor-card,
#tableArea .recommend-hero,
#tableArea .recommend-evidence,
#tableArea .recommend-score-row span,
#tableArea .mini-stats span,
#tableArea .role-card,
#tableArea .role-row,
#tableArea .flow-frame,
#tableArea .build-compare > div,
#tableArea .synergy-pair-grid > div,
#tableArea .asset-chip,
#tableArea .asset-icon-chip,
#tableArea .core-line,
#tableArea .core-build-row,
#tableArea .mechanic-pair-chip,
#tableArea .anvil-table-card,
#tableArea .time-pattern-card,
#tableArea .time-pattern-summary article,
#tableArea .daily-summary > *,
#tableArea .daily-change-card,
#tableArea .match-stat-grid > *,
#tableArea .team-numbers > *,
#tableArea .flow-summary > *,
#tableArea .flow-shifts > * {
  border-color: #344052 !important;
  background: #1a2330 !important;
  color: #dfe9f7 !important;
  box-shadow: none !important;
}

#tableArea .asset-chip > span,
#tableArea .asset-chip span,
#tableArea .mechanic-pair-chip span,
#tableArea .mechanic-pair-chip small,
#tableArea .core-line b,
#tableArea .core-line small,
#tableArea .core-build-row b,
#tableArea .core-build-row small,
#tableArea .recommend-score-row b,
#tableArea .mini-stats b,
#tableArea .flow-frame b,
#tableArea .flow-frame span,
#tableArea .flow-frame small,
#tableArea .role-row b,
#tableArea .role-row small,
#tableArea .insight-card *,
#tableArea .factor-card *,
#tableArea .recommend-hero *,
#tableArea .recommend-evidence *,
#tableArea .anvil-table-card *,
#tableArea .time-pattern-card * {
  background: transparent !important;
  color: inherit !important;
}

#tableArea .asset-chip img,
#tableArea .asset-icon-chip img,
#tableArea .mini-icon {
  background: #0f1722 !important;
}

#tableArea .good-text,
#tableArea .win {
  color: #37d194 !important;
}

#tableArea .bad-text,
#tableArea .loss {
  color: #ff6d7d !important;
}

#tableArea .muted,
#tableArea .subtext,
#tableArea small,
#tableArea .table-hint {
  color: #aebbd0 !important;
}

.table-wrap table,
.participant-table,
.anvil-reference table {
  min-width: 0 !important;
}

.table-wrap th,
.table-wrap td {
  min-width: 0;
}

thead th,
th {
  position: static !important;
  top: auto !important;
}

.asset-tooltip,
#assetTooltip {
  z-index: 10000 !important;
  max-width: min(420px, calc(100vw - 28px)) !important;
  border: 1px solid #5b6a82 !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  background: #0b111a !important;
  color: #eef5ff !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55) !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: keep-all !important;
  line-height: 1.5 !important;
}

.asset-tooltip *,
#assetTooltip * {
  background: transparent !important;
  color: #eef5ff !important;
}

.asset-tooltip strong,
#assetTooltip strong {
  color: #ffffff !important;
  font-weight: 900 !important;
}

[data-tip]:hover,
[title]:hover {
  color: inherit;
}

/* Public UI final contrast guard: every table/card/hover surface must stay readable. */
#tableArea {
  color: #dfe9f7 !important;
}

#tableArea :is(h1,h2,h3,h4,p,span,small,b,strong,em,label,div,section,article,li,td,th,button,summary) {
  color: inherit;
}

#tableArea :is(
  [class*="card"],
  [class*="panel"],
  [class*="box"],
  [class*="tile"],
  [class*="summary"],
  [class*="metric"],
  [class*="evidence"],
  [class*="recommend"],
  [class*="mechanic"],
  [class*="synergy"],
  [class*="factor"],
  [class*="insight"],
  [class*="match"],
  [class*="team"],
  [class*="time-pattern"],
  [class*="anvil"],
  [class*="flow"],
  .log,
  .table-search-bar,
  .table-wrap,
  table,
  tbody,
  thead,
  tr,
  td,
  th
) {
  border-color: #344052 !important;
  background-color: #151e2a !important;
  background-image: none !important;
  color: #dfe9f7 !important;
}

#tableArea article,
#tableArea :is(.snapshot-grid,.factor-grid,.insight-grid,.synergy-grid,.result-summary-grid,.recommend-grid,.summary-grid) > * {
  border-color: #344052 !important;
  background: #1a2330 !important;
  color: #dfe9f7 !important;
  box-shadow: none !important;
}

#tableArea article * {
  background: transparent !important;
  color: inherit !important;
}

#tableArea :is(.asset-chip,.asset-icon-chip,.mechanic-pair-chip,.core-line,.core-build-row,.pill,.more-rows > summary) {
  border-color: #3a4658 !important;
  background: #1d2837 !important;
  color: #eaf1fb !important;
}

#tableArea :is(input,select,textarea) {
  border-color: #3a4658 !important;
  background: #0f1722 !important;
  color: #eef5ff !important;
}

#tableArea :is(input,select,textarea)::placeholder {
  color: #8391a7 !important;
}

#tableArea tbody tr:nth-child(even) td,
#tableArea tbody tr:hover td,
#tableArea .participant-table .is-own td {
  background: #182333 !important;
  color: #eaf1fb !important;
}

#tableArea :is(.muted,.subtext,.hint,.header-sub,.table-hint,small) {
  color: #aebbd0 !important;
}

#tableArea :is(.win,.good,.good-text) {
  color: #37d194 !important;
}

#tableArea :is(.loss,.bad,.bad-text) {
  color: #ff6d7d !important;
}

#tableArea .tier-1 .tier-label { color: #ff5664 !important; }
#tableArea .tier-2 .tier-label { color: #ff8d4b !important; }
#tableArea .tier-3 .tier-label { color: #e5c84c !important; }
#tableArea .tier-4 .tier-label { color: #55d975 !important; }
#tableArea .tier-5 .tier-label { color: #4fc3f7 !important; }

#tableArea [data-tip],
#tableArea [title] {
  cursor: inherit;
}

.asset-tooltip,
#assetTooltip {
  position: fixed !important;
  pointer-events: none !important;
  background: #0b111a !important;
  color: #eef5ff !important;
}

.asset-tooltip :is(strong,div,span,p,small),
#assetTooltip :is(strong,div,span,p,small) {
  color: #eef5ff !important;
  text-shadow: none !important;
}

/* Active segmented controls must never inherit pale text from dark panels. */
.segmented button,
#tableArea .segmented button,
.daily-toolbar .segmented button,
#rangeTabs button,
#tableCategoryTabs button,
#tableTabs button,
#tableArea [data-daily-window],
#tableArea [data-daily-type],
#tableArea [data-daily-group] {
  border-color: #344052 !important;
  background: #111a26 !important;
  color: #cbd8ea !important;
  text-shadow: none !important;
}

.segmented button:hover,
#tableArea .segmented button:hover,
.daily-toolbar .segmented button:hover,
#rangeTabs button:hover,
#tableCategoryTabs button:hover,
#tableTabs button:hover,
#tableArea [data-daily-window]:hover,
#tableArea [data-daily-type]:hover,
#tableArea [data-daily-group]:hover {
  border-color: #5b6f8e !important;
  background: #1b2838 !important;
  color: #ffffff !important;
}

.segmented button.active,
#tableArea .segmented button.active,
.daily-toolbar .segmented button.active,
#rangeTabs button.active,
#tableCategoryTabs button.active,
#tableTabs button.active,
#tableArea [data-daily-window].active,
#tableArea [data-daily-type].active,
#tableArea [data-daily-group].active {
  border-color: #b8c9dc !important;
  background: #f4f8ff !important;
  color: #0b1724 !important;
  box-shadow: 0 4px 14px rgba(8, 15, 24, 0.28) !important;
}

.segmented button.active *,
#tableArea .segmented button.active *,
.daily-toolbar .segmented button.active *,
#rangeTabs button.active *,
#tableCategoryTabs button.active *,
#tableTabs button.active *,
#tableArea [data-daily-window].active *,
#tableArea [data-daily-type].active *,
#tableArea [data-daily-group].active * {
  color: #0b1724 !important;
  background: transparent !important;
}

.segmented button:disabled,
#tableArea .segmented button:disabled,
#rangeTabs button:disabled,
#tableCategoryTabs button:disabled,
#tableTabs button:disabled {
  opacity: 0.45 !important;
  color: #8391a7 !important;
}

/* 2026-05-20 public layout repair: the header and summary cards belong to the page flow. */
html,
body {
  height: auto !important;
  min-height: 100% !important;
  overflow-y: auto !important;
}

.topbar {
  position: relative !important;
  top: auto !important;
  height: auto !important;
  min-height: 132px !important;
}

.topbar .header-sub,
.api-key-status {
  max-width: none !important;
  max-height: none !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.45 !important;
}

.dashboard {
  height: auto !important;
  min-height: calc(100vh - 132px) !important;
  overflow: visible !important;
}

.dashboard > section.panel:nth-of-type(2),
.dashboard > section.panel:nth-of-type(3) {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.side-nav-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.side-nav-switch button,
.side-filter-row button,
.side-snapshot-tabs button {
  min-height: 30px;
  border: 1px solid #344052;
  border-radius: 8px;
  padding: 5px 8px;
  background: #111a26;
  color: #cbd8ea;
  font-size: 12px;
  font-weight: 900;
  box-shadow: none;
}

.side-nav-switch button.active,
.side-filter-row button.active,
.side-snapshot-tabs button.active {
  border-color: #b8c9dc;
  background: #f4f8ff;
  color: #0b1724;
}

#tableArea .side-filter-row button,
#tableArea .side-filter-row button:not(.active) {
  border-color: #344052 !important;
  background: #111a26 !important;
  color: #eaf1fb !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#tableArea .side-filter-row button.active {
  border-color: #b8c9dc !important;
  background: #f4f8ff !important;
  color: #0b1724 !important;
  opacity: 1 !important;
}

#tableArea .side-filter-row button.active,
#tableArea .side-filter-row button.active * {
  color: #0b1724 !important;
}

.side-filter-panel,
.side-snapshot-panel {
  display: grid;
  gap: 10px;
}

.side-filter-group,
.side-snapshot-card {
  border: 1px solid #303948;
  border-radius: 12px;
  background: #1c2431;
  padding: 9px;
}

.side-filter-group h3,
.side-snapshot-card strong {
  display: block;
  margin: 0 0 7px;
  color: #f4f7fc;
  font-size: 13px;
}

.side-filter-row,
.side-snapshot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.side-snapshot-grid {
  display: grid;
  gap: 7px;
}

.side-snapshot-card .mini-stats {
  gap: 5px;
}

/* Keep time charts visible inside a 1080p OBS/browser capture. */
#tableArea .time-pattern-chart-scroll {
  overflow: hidden !important;
}

#tableArea .time-pattern-bars {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 210px !important;
  gap: 4px !important;
  padding: 16px 6px 4px !important;
  border-color: #344052 !important;
  background: #111a26 !important;
}

#tableArea .time-pattern-column {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  grid-template-rows: 132px auto auto !important;
}

#tableArea .time-pattern-column-bars {
  height: 132px !important;
  gap: 2px !important;
}

#tableArea .time-pattern-vbar {
  width: 10px !important;
  border: 0 !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

#tableArea .time-pattern-vbar.win,
#tableArea .time-pattern-dot.win {
  background: #10b981 !important;
}

#tableArea .time-pattern-vbar.loss,
#tableArea .time-pattern-dot.loss {
  background: #f43f5e !important;
}

#tableArea .time-pattern-column-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  font-size: 10px !important;
}

#tableArea .time-pattern-column-rate strong,
#tableArea .time-pattern-column-rate small {
  font-size: 9px !important;
}

.entity-time-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.entity-time-chip {
  border: 1px solid #344052;
  border-radius: 8px;
  padding: 5px 6px;
  background: #101923;
  color: #dfe9f7;
  line-height: 1.15;
}

.entity-time-chip strong,
.entity-time-chip span,
.entity-time-chip i {
  display: block;
}

.entity-time-chip strong {
  color: #f6f9ff;
  font-size: 12px;
}

.entity-time-chip span {
  color: #aebbd0;
  font-size: 10px;
}

.entity-time-chip.good {
  border-color: rgba(16, 185, 129, 0.7);
}

.entity-time-chip.bad {
  border-color: rgba(244, 63, 94, 0.7);
}

.entity-time-bar {
  height: 5px;
  margin-top: 5px;
  border-radius: 999px;
  background: #253144;
  overflow: hidden;
}

.entity-time-bar b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #8aa0ba;
}

.entity-time-chip.good .entity-time-bar b {
  background: #10b981;
}

.entity-time-chip.bad .entity-time-bar b {
  background: #f43f5e;
}

.entity-time-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: #eaf1fb;
  line-height: 1.1;
}

.entity-time-cell strong {
  color: #f6f9ff;
  font-size: 12px;
}

.entity-time-cell span {
  color: #aebbd0;
  font-size: 10px;
}

.entity-time-cell i {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: #253144;
  overflow: hidden;
}

.entity-time-cell i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #8aa0ba;
}

.entity-time-cell.good i b {
  background: #10b981;
}

.entity-time-cell.bad i b {
  background: #f43f5e;
}

.entity-time-cell.empty {
  opacity: 0.62;
}

.entity-time-trend-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.entity-time-spark {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 4px;
  height: 52px;
  padding: 4px 2px 0;
  border: 1px solid #253144;
  border-radius: 8px;
  background: #0e1722;
}

.entity-time-spark-col {
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 2px;
}

.entity-time-spark-col i {
  width: 12px;
  min-height: 2px;
  border-radius: 999px 999px 2px 2px;
  background: #8aa0ba;
}

.entity-time-spark-col.good i {
  background: #10b981;
}

.entity-time-spark-col.bad i {
  background: #f43f5e;
}

.entity-time-spark-col.empty i {
  background: #344052;
}

.entity-time-spark-col em {
  width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
  color: #aebbd0;
  font-size: 8px;
  font-style: normal;
  line-height: 1;
}

@media (max-width: 1180px) {
  #tableArea .time-pattern-bars {
    gap: 2px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  #tableArea .time-pattern-vbar {
    width: 8px !important;
  }

  .entity-time-bars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.public-viewer .topbar {
  min-height: 88px !important;
  padding: 14px 24px !important;
  grid-template-columns: minmax(360px, 1fr) auto !important;
  gap: 16px !important;
  align-items: center !important;
}

body.public-viewer .header-sub {
  max-width: 760px !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

body.public-viewer .actions {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  justify-content: flex-end !important;
  align-items: center !important;
}

body.public-viewer .actions > :not(#refreshBtn) {
  display: none !important;
}

body.public-viewer #refreshBtn {
  min-width: 74px !important;
  padding: 10px 16px !important;
}

body.public-viewer .dashboard {
  min-height: 0 !important;
  padding-top: 14px !important;
  grid-template-rows: auto !important;
  align-items: start !important;
}

body.public-viewer .dashboard > section.panel:nth-of-type(2),
body.public-viewer .dashboard > section.panel:nth-of-type(3) {
  grid-row: 1 !important;
  align-self: start !important;
  margin-top: 0 !important;
}

/* 2026-05-20: range controls are hidden until the detail filter is opened. */
body:not(.filters-open) .dashboard > section.panel:nth-of-type(3) #rangeTabs {
  display: none !important;
}

body.filters-open .dashboard > section.panel:nth-of-type(3) #rangeTabs {
  display: flex !important;
}

.synergy-clean-card {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto;
  gap: 7px;
  height: 100%;
}

.synergy-clean-card header strong {
  font-size: 15px;
  letter-spacing: 0;
}

.synergy-clean-card header span {
  white-space: nowrap;
  color: #cbd8ea !important;
  font-weight: 900;
}

.synergy-clean-card p {
  margin: 0;
  color: #dbe7f6 !important;
  line-height: 1.45;
}

.synergy-clean-card .synergy-kpis,
.synergy-clean-card .synergy-kpis-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 50px;
  margin-bottom: 0;
}

.synergy-clean-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch !important;
}

@media (max-width: 900px) {
  .synergy-clean-grid {
    grid-template-columns: 1fr !important;
  }
}

.synergy-stage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-height: 99px;
}

.synergy-stage-chip {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 29px;
  padding: 5px 9px;
  border: 1px solid rgba(94, 234, 212, 0.32);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.16);
  color: #e9f4ff;
  min-width: 0;
}

.synergy-stage-chip b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #f6fbff !important;
}

.synergy-stage-chip em,
.synergy-stage-chip strong {
  white-space: nowrap;
  font-style: normal;
  font-size: 11px;
}

.synergy-stage-chip em {
  color: #9fd8ff;
}

.synergy-stage-chip strong {
  color: #66f0bd !important;
}

.synergy-stage-chip.empty {
  display: flex;
  color: #aebbd0;
}

.synergy-bonus-list {
  display: grid;
  gap: 4px;
}

.synergy-bonus-list span {
  display: block;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(11, 18, 28, 0.52);
  color: #cbd8ea !important;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.synergy-member-row {
  min-height: 36px;
  flex-wrap: wrap;
  align-content: center;
}

.synergy-detail-block {
  min-width: 0;
  min-height: 74px;
  display: grid;
  align-content: start;
  gap: 5px;
}

.synergy-detail-block b {
  color: #f1f7ff !important;
  font-size: 12px;
  font-weight: 950;
}

.synergy-pair-line {
  margin-top: 6px;
  min-height: 31px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.synergy-pair-line small {
  white-space: nowrap;
  color: #a9c8ff !important;
  font-weight: 800;
}

.synergy-bonus-line,
.synergy-member-row {
  margin-top: 6px;
}

.synergy-clean-card .synergy-pair-grid {
  align-self: stretch;
  grid-auto-rows: auto;
}

.synergy-clean-card .synergy-pair-grid > div {
  min-height: 0;
}

.synergy-clean-card .synergy-pair-grid > div:nth-child(2n + 1),
.synergy-clean-card .synergy-pair-grid > div:nth-child(2n) {
  align-self: stretch;
}

#tableArea .asset-chip,
#tableArea .asset-icon-chip,
#tableArea [data-tip],
#tableArea [title] {
  cursor: default !important;
}

/* Mobile browsers should render the same 1080px desktop composition instead of switching to a narrow layout. */
html,
body {
  min-width: 1080px;
}

body {
  overflow-x: auto !important;
}

.topbar,
.dashboard {
  min-width: 1080px;
}

.dashboard {
  width: 1080px !important;
  max-width: none !important;
}

@media (max-width: 900px) {
  .synergy-clean-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.streamer-banner {
  position: relative;
  width: 1080px;
  max-width: none;
  min-width: 1080px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(95, 118, 143, 0.34);
  background:
    linear-gradient(135deg, rgba(17, 101, 127, 0.16), rgba(0, 255, 163, 0.10) 48%, rgba(233, 160, 40, 0.13)),
    #17202b;
  color: #eef7ff;
  overflow: hidden;
  isolation: isolate;
}

.streamer-banner::before,
.streamer-banner::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.streamer-banner::before {
  right: 246px;
  top: 50%;
  width: 86px;
  height: 86px;
  transform: translateY(-50%) rotate(-6deg);
  background: url("assets/chzzk-symbol.svg") center / contain no-repeat;
  opacity: 0.13;
  filter: blur(0.15px);
}

.streamer-banner::after {
  right: 98px;
  top: 12px;
  width: 310px;
  height: 54px;
  background: url("assets/chzzk-logo.svg") center / contain no-repeat;
  opacity: 0.07;
  filter: blur(1px);
}

.streamer-banner-top {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.streamer-banner-bottom {
  margin-bottom: 28px;
  border-radius: 10px;
}

.streamer-banner__copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.streamer-banner__eyebrow {
  color: #9cc9d7;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
}

.streamer-banner__copy strong {
  color: #fff;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.2;
}

.streamer-banner__copy span:last-child {
  color: #c9d7e5;
  font-size: 12px;
  font-weight: 750;
}

.streamer-banner__link {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #e99f28;
  color: #121923;
  font-size: 13px;
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.streamer-banner__link:hover {
  filter: brightness(1.06);
}

.streamer-banner__brand {
  position: relative;
  z-index: 1;
  flex: 0 0 214px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.streamer-banner__brand img {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.36));
}

.streamer-banner__symbol {
  width: 44px;
  height: 44px;
  opacity: 0.72;
}

.streamer-banner__wordmark {
  width: 146px;
  max-height: 42px;
  opacity: 0.82;
}
