:root {
  color-scheme: light;
  --bg: #f5f6f8; --panel: #fff; --ink: #17181b; --muted: #6d727c; --line: #e7e8eb;
  --soft: #f7f8fa; --red: #ff0033; --green: #16804b; --blue: #315cf6; --sidebar: #121316;
  --shadow: 0 1px 2px rgba(18,19,22,.04), 0 10px 32px rgba(18,19,22,.035);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
button:not(:disabled):active { transform: translateY(1px); }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(49,92,246,.2); outline-offset: 2px; }
.login-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, rgba(254,220,3,.16), transparent 27%), radial-gradient(circle at 86% 90%, rgba(49,92,246,.1), transparent 30%), var(--bg); }
.login-card { width: min(100%, 440px); display: grid; gap: 18px; padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: 0 24px 80px rgba(20,23,31,.09); }
.login-card label { display: grid; gap: 8px; font-size: 13px; font-weight: 750; color: #4d5159; }
.login-card input { width: 100%; min-height: 48px; border: 1px solid #dfe1e5; border-radius: 11px; padding: 0 14px; color: var(--ink); background: #fff; }
.login-card input:focus { border-color: #969da8; }
.login-brand { display: flex; align-items: center; gap: 13px; }
.oauth-app-icon { width: 48px; height: 48px; display: block; border-radius: 12px; object-fit: cover; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border-radius: 12px; background: #f0f1f3; }
.auth-tab { min-height: 39px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; cursor: pointer; }
.auth-tab.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.09); }
.login-card .primary-action { justify-self: stretch; }
.login-screen.hidden { display: none; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 22px; display: flex; flex-direction: column; gap: 30px; background: var(--sidebar); color: #fff; }
.brand-lockup { display: grid; gap: 14px; }
.brand-lockup .brand-logo { filter: brightness(0) invert(1); }
.brand-logo { width: 112px; height: auto; display: block; }
.login-logo { width: 148px; margin-bottom: 2px; }
.brand-lockup .eyebrow { color: #989ba4; }
.brand-lockup h1 { color: #fff; font-size: 14px; }
.eyebrow { margin: 0 0 6px; font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; color: #858b95; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.02em; }
h2 { margin-bottom: 0; font-size: clamp(25px,3vw,34px); letter-spacing: -.035em; }
h3 { margin-bottom: 8px; font-size: 19px; letter-spacing: -.02em; }
.integration-nav { display: grid; gap: 8px; }
.nav-item { width: 100%; min-height: 48px; border: 1px solid #292b30; background: #1b1c20; border-radius: 11px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 0 13px; color: #fff; cursor: pointer; text-align: left; }
.nav-item.active { border-color: #3a3c42; background: #25262b; box-shadow: inset 3px 0 var(--red); }
.nav-item strong { font-size: 10px; color: #b5b7bd; text-transform: uppercase; letter-spacing: .06em; }
.platform-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,0,51,.12); }
.youtube-dot { background: var(--red); }
.product-note { margin-top: auto; padding: 15px; border: 1px solid #2b2d32; border-radius: 12px; background: #1a1b1f; }
.product-note h2 { margin-bottom: 7px; font-size: 13px; }
.product-note p { margin-bottom: 0; color: #989ba4; line-height: 1.5; font-size: 12px; }
.sidebar > .secondary-action { border-color: #303238; background: transparent; color: #c7c9cf; }
.content { width: min(100%,1500px); margin: 0 auto; padding: 36px clamp(24px,4vw,56px) 64px; display: grid; gap: 24px; align-content: start; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 6px; }
.topbar-copy { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.status-pill { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 9px 13px; color: var(--muted); font-weight: 750; font-size: 12px; white-space: nowrap; }
.status-pill::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #a1a5ad; }
.status-pill.connected { color: var(--green); border-color: rgba(22,128,75,.18); background: #f1faf5; }
.status-pill.connected::before { background: #20a761; box-shadow: 0 0 0 3px rgba(32,167,97,.12); }
.connect-panel, .channel-card, .section-band { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.connect-panel { padding: clamp(22px,4vw,38px); display: grid; grid-template-columns: auto minmax(0,1fr); gap: 22px; }
.youtube-icon { width: 66px; height: 47px; border-radius: 14px; background: var(--red); display: grid; place-items: center; margin-top: 4px; box-shadow: 0 12px 28px rgba(255,0,51,.16); }
.youtube-icon span { width: 0; height: 0; border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-left: 16px solid #fff; margin-left: 4px; }
.connect-copy p { max-width: 680px; margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.permission-list { grid-column: 1/-1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.permission-list div { border: 1px solid var(--line); border-radius: 13px; padding: 16px; background: var(--soft); display: grid; gap: 7px; }
.permission-list span, .muted { color: var(--muted); }
code { color: #455064; background: #eceef2; border-radius: 7px; padding: 6px 8px; font-size: 11px; overflow-wrap: anywhere; }
.primary-action { grid-column: 1/-1; min-height: 48px; justify-self: start; border: 0; border-radius: 11px; padding: 0 19px; background: #17181b; color: #fff; font-weight: 820; cursor: pointer; box-shadow: 0 7px 18px rgba(17,19,21,.14); }
.primary-action:hover { background: #2b2d31; }
.secondary-action, .danger-action { min-height: 39px; border-radius: 10px; padding: 0 13px; font-weight: 780; cursor: pointer; }
.secondary-action { border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.secondary-action:hover { border-color: #c8cbd1; background: #fafafa; }
.danger-action { border: 1px solid rgba(255,0,51,.2); background: var(--red); color: #fff; }
.privacy-copy { grid-column: 1/-1; margin-bottom: 0; color: var(--muted); font-size: 12px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; }
.legal-links a, .oauth-disclosure a { color: #4b5565; font-weight: 700; text-decoration: underline; text-decoration-color: #c9ccd2; text-underline-offset: 3px; }
.legal-links a:hover, .oauth-disclosure a:hover { color: var(--ink); text-decoration-color: currentColor; }
.sidebar-legal { justify-content: center; gap: 8px 14px; }
.sidebar-legal a { color: #989ba4; text-decoration-color: #45474d; }
.sidebar-legal a:hover { color: #fff; }
.oauth-disclosure { grid-column: 1/-1; max-width: 820px; margin: -8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.hidden { display: none !important; }
.dashboard { display: grid; gap: 20px; }
.channel-card { padding: 22px 24px; display: grid; grid-template-columns: minmax(240px,1fr) minmax(420px,1.6fr); gap: 28px; align-items: center; }
.channel-identity { display: flex; align-items: center; gap: 15px; min-width: 0; }
.channel-identity h3 { margin-bottom: 3px; font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-identity .eyebrow { display: none; }
.verified-label { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; color: var(--green); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.verified-label span { width: 14px; height: 14px; display: inline-grid; place-items: center; border-radius: 50%; background: #e4f6eb; font-size: 9px; }
.avatar { width: 64px; height: 64px; flex: 0 0 auto; border-radius: 16px; background: #191a1e; color: #fff; display: grid; place-items: center; font-weight: 900; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.metric-grid, .analytics-grid { margin: 0; display: grid; }
.metric-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.metric-grid > div { padding: 3px 14px; border-left: 1px solid var(--line); }
.metric-grid dt { min-height: 30px; }
.analytics-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.analytics-card { min-height: 156px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); display: flex; flex-direction: column; }
.analytics-card-primary { background: #17181b; border-color: #17181b; color: #fff; }
.analytics-card-primary dt, .analytics-card-primary .metric-context { color: #aeb1b8; }
.analytics-card dd { margin-top: auto; font-size: clamp(27px,3vw,37px); letter-spacing: -.045em; }
.metric-context { margin-top: 3px; color: var(--muted); font-size: 11px; }
.subscriber-detail { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 11px; }
.subscriber-detail b { color: #4c535e; }
.analytics-note { margin: 14px 2px 0; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.analytics-note > span { width: 17px; height: 17px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #cfd2d7; border-radius: 50%; font-size: 10px; font-weight: 800; }
dt { color: var(--muted); font-size: 11px; font-weight: 760; letter-spacing: .015em; }
dd { margin: 4px 0 0; font-size: 21px; font-weight: 860; letter-spacing: -.025em; }
.section-band { padding: 22px; }
.performance-band { padding: 24px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.section-heading h3 { margin-bottom: 0; }
.section-heading > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.source-label { display: flex; align-items: center; gap: 7px; }
.source-label i, .video-private strong i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.video-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.video-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; transition: transform 180ms ease, box-shadow 180ms ease; }
.video-card:hover { transform: translateY(-2px); box-shadow: 0 13px 35px rgba(21,23,26,.08); }
.video-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg,#17191d,#4d5665); display: grid; place-items: center; color: #fff; font-weight: 900; overflow: hidden; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.video-card:hover .video-thumb img { transform: scale(1.025); }
.video-body { padding: 15px; }
.video-date { margin-bottom: 7px; color: #8b9099; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.video-body h4 { min-height: 38px; margin: 0 0 12px; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-stats { display: flex; flex-wrap: wrap; gap: 7px 12px; color: var(--muted); font-size: 11px; }
.video-stats b { color: #3d424a; font-weight: 800; }
.video-private { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 9px; color: var(--muted); font-size: 11px; }
.video-private strong { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 11px; }
.private-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.private-metrics span { min-width: 0; }
.private-metrics b { display: block; margin-bottom: 1px; color: #373c44; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breakdown-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.breakdown-row { min-height: 104px; border: 1px solid var(--line); border-radius: 13px; padding: 15px; background: var(--soft); display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 9px 14px; }
.breakdown-row strong { font-size: 13px; }
.breakdown-stats { color: var(--muted); font-size: 11px; }
.breakdown-stats b { color: #353a42; }
.breakdown-stats i { display: inline-block; width: 3px; height: 3px; margin: 0 6px 2px; border-radius: 50%; background: #b0b4bb; }
.breakdown-track { grid-column: 1/-1; height: 6px; border-radius: 999px; background: #e4e6e9; overflow: hidden; }
.breakdown-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#ff0033,#ff4165); }
.breakdown-empty { grid-column: 1/-1; margin-bottom: 0; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(10,12,15,.58); backdrop-filter: blur(4px); }
.confirm-modal { width: min(100%,440px); display: grid; grid-template-columns: auto minmax(0,1fr); gap: 16px; padding: 23px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 24px 80px rgba(0,0,0,.24); }
.modal-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,0,51,.1); color: var(--red); font-weight: 900; }
.confirm-modal h2 { margin-bottom: 8px; font-size: 22px; }
.confirm-modal p { margin-bottom: 0; line-height: 1.5; }
.modal-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 1160px) {
  .analytics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .video-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .channel-card { grid-template-columns: 1fr; }
  .metric-grid > div:first-child { border-left: 0; }
}
@media (max-width: 780px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 17px 20px; display: grid; grid-template-columns: 1fr auto; gap: 16px; }
  .brand-lockup { display: flex; align-items: center; }
  .brand-lockup > div, .integration-nav, .product-note { display: none; }
  .sidebar > .secondary-action { grid-column: 2; grid-row: 1; }
  .sidebar-legal { grid-column: 1/-1; }
  .content { padding: 24px 16px 44px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; overflow-x: auto; }
  .connect-panel { grid-template-columns: 1fr; }
  .permission-list { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 0; }
  .metric-grid > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .analytics-grid, .video-list, .breakdown-list { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
  .section-heading > span { text-align: right; }
  .private-metrics { grid-template-columns: repeat(3,1fr); }
  .confirm-modal { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
}
@media (max-width: 430px) {
  .login-card { padding: 23px; border-radius: 16px; }
  .channel-card, .section-band { border-radius: 15px; }
  .channel-card { padding: 18px; }
  .channel-identity { align-items: flex-start; }
  .avatar { width: 54px; height: 54px; border-radius: 14px; }
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-card { min-height: 136px; }
  .section-heading { display: grid; }
  .section-heading > span { text-align: left; }
}
