:root {
  --bg: #070912;
  --bg-soft: #0b0f1c;
  --panel: #101528;
  --panel-2: #151b31;
  --panel-3: #1b2240;
  --line: #242c4a;
  --line-soft: #1b2138;
  --text: #eef1ff;
  --text-2: #c6cbe8;
  --muted: #8f97bb;
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --accent-2: #2ee6c8;
  --pink: #ff5c8a;
  --warn: #ffb648;
  --danger: #ff647c;
  --success: #38e0a5;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --sidebar: 252px;
  --font: "Segoe UI", system-ui, -apple-system, "Inter", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(124, 92, 255, 0.16), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(46, 230, 200, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

svg {
  flex: none;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px 18px;
  background: linear-gradient(180deg, rgba(13, 17, 32, 0.96), rgba(8, 11, 21, 0.96));
  border-right: 1px solid var(--line-soft);
  overflow-y: auto;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 12px;
}

.logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(46, 230, 200, 0.18));
  border: 1px solid rgba(124, 92, 255, 0.45);
  color: var(--accent-2);
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.22);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 16px;
  letter-spacing: -0.2px;
}

.brand-text small {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-label {
  padding: 14px 10px 6px;
  color: #6f779b;
  font-size: 10.5px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  font-weight: 700;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #b9c0dd;
  font-size: 13.2px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.nav a svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav a.active {
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.2), rgba(124, 92, 255, 0.04));
  border-color: rgba(124, 92, 255, 0.28);
  color: #fff;
}

.nav a.active svg {
  color: var(--accent-2);
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: none;
  place-items: center;
}

.nav-badge.show {
  display: grid;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
}

.mode-card strong {
  display: block;
  font-size: 12px;
}

.mode-card small {
  color: var(--muted);
  font-size: 11px;
}

.mode-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(46, 230, 200, 0.12);
}

.mode-dot.live {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(56, 224, 165, 0.14);
}

.mode-dot.demo {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(255, 182, 72, 0.12);
}

.sidebar-note {
  margin: 0 6px;
  color: #6d7596;
  font-size: 10.5px;
  line-height: 1.45;
}
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 26px;
  min-height: 66px;
  background: rgba(8, 11, 21, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}

.menu-btn {
  display: none;
}

.channel-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 5px 10px 5px 5px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.channel-chip:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-soft);
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c5cff, #2ee6c8);
  color: #080b15;
  font-weight: 800;
  font-size: 13px;
  flex: none;
}

.channel-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.channel-meta strong {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.channel-meta small {
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.range-control {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 4px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.range-control span {
  color: var(--muted);
  font-size: 11px;
}

.range-control select {
  background: transparent;
  border: 0;
  padding: 4px 6px;
  font-size: 12.5px;
  outline: none;
}

.range-control option {
  background: var(--panel);
}

.alert-btn {
  position: relative;
}

.alert-btn .dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 2px var(--bg);
}

.view {
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: 22px 26px 70px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 12.8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #313a5e;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: linear-gradient(135deg, #7c5cff, #5a3df0);
  border-color: #7c5cff;
  color: #fff;
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.28);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #8b6dff, #6448ff);
}

.btn.ghost {
  background: transparent;
}

.btn.subtle {
  background: var(--panel-2);
  border-color: var(--line-soft);
}

.btn.danger {
  color: var(--danger);
  border-color: rgba(255, 100, 124, 0.32);
  background: rgba(255, 100, 124, 0.08);
}

.btn.small {
  height: 30px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: 8px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-2);
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.card {
  background: linear-gradient(180deg, rgba(21, 27, 49, 0.92), rgba(15, 20, 38, 0.92));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  min-width: 0;
}

.card.tight {
  padding: 14px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.card-head h2,
.card-head h3 {
  margin: 0;
  font-size: 14.5px;
  letter-spacing: -0.1px;
}

.card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.8px;
}

.card-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-main {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr);
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.spacer {
  flex: 1;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 11.5px;
}

.tiny {
  font-size: 10.5px;
}

.mono {
  font-variant-numeric: tabular-nums;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.5px;
  font-weight: 750;
}

.page-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  max-width: 760px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi {
  position: relative;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(25, 31, 55, 0.86), rgba(14, 19, 36, 0.9));
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  inset: auto -20% -60% auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.16), transparent 70%);
  pointer-events: none;
}

.kpi-label {
  color: var(--muted);
  font-size: 10.6px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 700;
}

.kpi-value {
  margin-top: 5px;
  font-size: 25px;
  font-weight: 760;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  font-size: 11px;
}

.delta.up {
  color: var(--success);
}

.delta.down {
  color: var(--danger);
}

.delta.flat {
  color: var(--muted);
}

.metric {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.metric strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.metric span {
  color: var(--muted);
  font-size: 11.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.badge.accent {
  border-color: rgba(124, 92, 255, 0.4);
  background: rgba(124, 92, 255, 0.14);
  color: #cfc5ff;
}

.badge.success,
.badge.pass {
  border-color: rgba(56, 224, 165, 0.32);
  background: rgba(56, 224, 165, 0.1);
  color: #7cf0c6;
}

.badge.warn {
  border-color: rgba(255, 182, 72, 0.32);
  background: rgba(255, 182, 72, 0.1);
  color: #ffd08a;
}

.badge.danger,
.badge.fail {
  border-color: rgba(255, 100, 124, 0.32);
  background: rgba(255, 100, 124, 0.1);
  color: #ff9bad;
}

.badge.cyan {
  border-color: rgba(46, 230, 200, 0.32);
  background: rgba(46, 230, 200, 0.1);
  color: #8ff5e4;
}

.badge.ghost {
  background: transparent;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-2);
  font-size: 11.5px;
  cursor: default;
}

.chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.chip button:hover {
  color: var(--danger);
}

.chip.clickable {
  cursor: pointer;
}

.chip.clickable:hover {
  border-color: rgba(124, 92, 255, 0.4);
  color: #fff;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.3px;
  min-width: 560px;
}

th {
  text-align: left;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 10.3px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(27, 33, 56, 0.72);
  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.video-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 250px;
}

.thumb {
  width: 54px;
  height: 32px;
  border-radius: 7px;
  flex: none;
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.55), rgba(46, 230, 200, 0.35)),
    #1a2140;
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 9px;
  font-weight: 800;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.thumb.large {
  width: 88px;
  height: 50px;
  border-radius: 9px;
}

.video-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.video-title strong {
  font-size: 12.3px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.video-title small {
  color: var(--muted);
  font-size: 10.5px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field > label,
.field-label {
  color: var(--text-2);
  font-size: 11.2px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field small {
  color: var(--muted);
  font-size: 10.5px;
}

.input,
.select,
.textarea {
  width: 100%;
  background: rgba(8, 12, 24, 0.72);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(124, 92, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.14);
}

.input::placeholder,
.textarea::placeholder {
  color: #666e90;
}

.select option {
  background: var(--panel);
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.55;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.counter {
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.counter.good {
  color: var(--success);
}

.counter.bad {
  color: var(--warn);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 12px;
}

.switch input {
  appearance: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #2a3152;
  position: relative;
  cursor: pointer;
  transition: background 0.18s ease;
  border: 1px solid #353d63;
  margin: 0;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.switch input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked::after {
  transform: translateX(16px);
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 240px;
}

.chart-wrap.small {
  height: 74px;
}

canvas.chart {
  width: 100%;
  height: 100%;
  display: block;
}

.legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  flex-wrap: wrap;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
}

.score-ring {
  --score: 50;
  --ring: var(--accent);
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: conic-gradient(var(--ring) calc(var(--score) * 1%), rgba(255, 255, 255, 0.07) 0);
  display: grid;
  place-items: center;
  position: relative;
  flex: none;
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--panel);
}

.score-ring .ring-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.score-ring strong {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.score-ring small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.gauge-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gauge-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.gauge-meta strong {
  font-size: 15px;
}

.progress {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.meter-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
}

.meter-row .progress {
  flex: 1;
  height: 5px;
}

.meter-row b {
  min-width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.heatmap-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.heatmap {
  display: grid;
  grid-template-columns: 46px repeat(24, minmax(13px, 1fr));
  gap: 3px;
  min-width: 700px;
}

.heat-label {
  color: var(--muted);
  font-size: 9.5px;
  display: grid;
  place-items: center;
  min-height: 20px;
}

.heat-label.day {
  justify-items: start;
  padding-left: 2px;
  font-size: 10px;
}

.heat-cell {
  aspect-ratio: 1 / 1;
  min-height: 16px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: transform 0.1s ease;
}

.heat-cell:hover {
  transform: scale(1.18);
  outline: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 2;
}

.slot-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.022);
}

.slot-rank {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: rgba(124, 92, 255, 0.16);
  color: #cfc5ff;
  flex: none;
}

.slot-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.slot-info strong {
  font-size: 12px;
}

.slot-info small {
  color: var(--muted);
  font-size: 10.5px;
}

.check-row {
  display: flex;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(27, 33, 56, 0.72);
}

.check-row:last-child {
  border-bottom: 0;
}

.check-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex: none;
  margin-top: 1px;
}

.check-icon.pass {
  background: rgba(56, 224, 165, 0.13);
  color: var(--success);
}

.check-icon.warn {
  background: rgba(255, 182, 72, 0.13);
  color: var(--warn);
}

.check-icon.fail {
  background: rgba(255, 100, 124, 0.13);
  color: var(--danger);
}

.check-body {
  min-width: 0;
}

.check-body strong {
  font-size: 12.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.check-body p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11.3px;
}

.check-body .fix {
  margin-top: 3px;
  color: #cfd4ee;
  font-size: 11.3px;
}

.advice {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(27, 33, 56, 0.72);
}

.advice:last-child {
  border-bottom: 0;
}

.advice-priority {
  width: 4px;
  border-radius: 999px;
  background: var(--muted);
  flex: none;
}

.advice-priority.alta {
  background: var(--danger);
}

.advice-priority.media {
  background: var(--warn);
}

.advice-priority.baja {
  background: var(--accent-2);
}

.advice-body {
  flex: 1;
  min-width: 0;
}

.advice-body strong {
  font-size: 12.3px;
}

.advice-body p {
  margin: 3px 0 6px;
  color: var(--muted);
  font-size: 11.4px;
}

.idea-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(24, 30, 53, 0.9), rgba(14, 19, 36, 0.92));
  min-width: 0;
}

.idea-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.idea-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.15px;
}

.idea-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.idea-why {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.idea-hook {
  margin: 0;
  padding: 8px 10px;
  border-left: 2px solid rgba(46, 230, 200, 0.55);
  background: rgba(46, 230, 200, 0.05);
  border-radius: 0 8px 8px 0;
  color: #c8d6e8;
  font-size: 11.4px;
  font-style: italic;
}

.idea-outline {
  margin: 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 11.3px;
}

.idea-outline li {
  margin: 2px 0;
}

.idea-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

.score-pill {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(124, 92, 255, 0.3);
  background: rgba(124, 92, 255, 0.12);
  font-size: 15px;
  font-weight: 800;
  flex: none;
}

.score-pill.small {
  width: 34px;
  height: 34px;
  font-size: 12px;
  border-radius: 9px;
}

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(124, 92, 255, 0.07);
  color: var(--text-2);
  font-size: 11.8px;
  line-height: 1.5;
}

.notice.warn {
  border-color: rgba(255, 182, 72, 0.28);
  background: rgba(255, 182, 72, 0.07);
}

.notice.danger {
  border-color: rgba(255, 100, 124, 0.28);
  background: rgba(255, 100, 124, 0.07);
}

.notice strong {
  color: var(--text);
}

.notice svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex: none;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 12px;
}

.empty strong {
  color: var(--text-2);
  font-size: 13px;
}

.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  min-height: 14px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.skeleton-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skeleton-page .skeleton.kpi {
  height: 86px;
}

.skeleton-page .skeleton.block {
  height: 260px;
}
.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
  max-height: 56vh;
  overflow-y: auto;
  padding-right: 4px;
}

.msg {
  display: flex;
  gap: 9px;
  max-width: 88%;
}

.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  flex: none;
  background: rgba(124, 92, 255, 0.2);
  color: #d3caff;
}

.msg.user .msg-avatar {
  background: rgba(46, 230, 200, 0.16);
  color: #9df3e3;
}

.msg-bubble {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--panel-2);
  font-size: 12.4px;
  line-height: 1.55;
}

.msg.user .msg-bubble {
  background: rgba(124, 92, 255, 0.14);
  border-color: rgba(124, 92, 255, 0.28);
}

.msg-bubble p {
  margin: 0 0 6px;
}

.msg-bubble p:last-child {
  margin-bottom: 0;
}

.msg-bubble ul {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--text-2);
}

.msg-bubble li {
  margin: 3px 0;
}

.msg-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.chat-input {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.chat-input .input {
  flex: 1;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(3, 5, 12, 0.72);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade 0.16s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal {
  width: min(720px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #171d34, #0e1324);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  animation: pop 0.16s ease;
}

@keyframes pop {
  from {
    transform: translateY(8px) scale(0.985);
    opacity: 0;
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
}

.modal-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  max-width: 380px;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(21, 27, 49, 0.97);
  box-shadow: var(--shadow);
  color: var(--text-2);
  font-size: 12px;
  animation: toastIn 0.2s ease;
  pointer-events: auto;
}

.toast.success {
  border-color: rgba(56, 224, 165, 0.4);
}

.toast.error {
  border-color: rgba(255, 100, 124, 0.45);
}

.toast.warn {
  border-color: rgba(255, 182, 72, 0.4);
}

@keyframes toastIn {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

.tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 24, 0.6);
  gap: 2px;
}

.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 11.8px;
  font-weight: 600;
  cursor: pointer;
}

.tabs button.active {
  background: var(--panel-3);
  color: #fff;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(27, 33, 56, 0.6);
  font-size: 12px;
}

.kv:last-child {
  border-bottom: 0;
}

.kv span {
  color: var(--muted);
}

.kv strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.source-note {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #7780a3;
  font-size: 10.8px;
  margin-top: 10px;
}

.source-note svg {
  width: 13px;
  height: 13px;
}
.competitor-card,
.trend-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(23, 29, 52, 0.9), rgba(13, 18, 34, 0.92));
}

.competitor-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.competitor-head .avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.competitor-head div {
  min-width: 0;
}

.competitor-head strong {
  display: block;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.competitor-head small {
  color: var(--muted);
  font-size: 11px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat-grid > div {
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line-soft);
  min-width: 0;
}

.stat-grid small {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-grid strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.rank {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 800;
  flex: none;
}

.rank.top {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(46, 230, 200, 0.2));
  color: #fff;
}

.trend-card .trend-title {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trend-card .trend-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10.8px;
  flex-wrap: wrap;
}

.thumbnail-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(124, 92, 255, 0.5), rgba(46, 230, 200, 0.25)),
    #171d31;
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  font-size: 10.5px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 14px;
}

.section-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11.5px;
}

.hr {
  height: 1px;
  background: var(--line-soft);
  margin: 14px 0;
}

.quota-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-top: 7px;
}

.quota-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--warn));
}

code,
kbd {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-soft);
  padding: 1px 5px;
  border-radius: 5px;
  color: #d9defa;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #262e4d;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #333d63;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-main {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-grid,
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .menu-btn {
    display: inline-grid;
  }
  .view {
    padding: 16px 14px 60px;
  }
  .topbar {
    padding: 10px 14px;
    gap: 8px;
  }
  .topbar .range-control {
    display: none;
  }
  .topbar .btn.ghost {
    display: none;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-row,
  .form-row.three {
    grid-template-columns: minmax(0, 1fr);
  }
  .channel-meta strong {
    max-width: 130px;
  }
  .topbar-actions .btn.primary {
    display: none;
  }
  .page-head h1 {
    font-size: 20px;
  }
}

@media (max-width: 520px) {
  .kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .msg {
    max-width: 100%;
  }
}






