/* Custom creator dashboard demo. Dark console look shared with the Studio board; --brand is set from JS. */
:root {
  --cd-bg: #0F0C16; --cd-panel: #17131F; --cd-panel-2: #1F1A2A; --cd-line: #2E2840; --cd-line-2: #3A3350;
  --cd-ink: #F4F0FA; --cd-ink2: #C9C2D8; --cd-ink3: #A49DB5;
  --brand: #A77BFF; --brand-soft: rgba(167,123,255,.16); --on-brand: #0B0910;
  --cd-r: 14px; --cd-head: Poppins, Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body.cd { margin: 0; background: var(--cd-bg); color: var(--cd-ink2); font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--cd-ink); font-family: var(--cd-head); font-weight: 600; letter-spacing: -.02em; margin: 0 0 .35em; }
h2 { font-size: 1.25rem; line-height: 1.2; } h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
a { color: var(--cd-ink); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.cd-skip { position: absolute; left: -999px; top: 0; z-index: 100; background: #fff; color: #000; padding: 8px 12px; }
.cd-skip:focus { left: 8px; top: 8px; }

/* sales strip */
.cd-strip { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; padding: 10px 20px; background: #FFF6D6; color: #2A2310; font-size: .93rem; }
.cd-strip p { margin: 0; max-width: 820px; } .cd-strip strong { color: #000; }

/* buttons */
.cd-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; background: var(--brand); color: var(--on-brand); font: 600 .95rem/1.2 var(--cd-head); text-decoration: none; cursor: pointer; }
.cd-btn:hover { filter: brightness(1.08); color: var(--on-brand); }
.cd-btn-light { background: #15121F; color: #fff; } .cd-btn-light:hover { color: #fff; }
.cd-btn-ghost { background: transparent; color: var(--cd-ink); border-color: var(--cd-line-2); } .cd-btn-ghost:hover { color: var(--cd-ink); border-color: var(--cd-ink3); }

/* header */
.cd-top { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; padding: 12px 20px; background: rgba(15,12,22,.94); border-bottom: 1px solid var(--cd-line); backdrop-filter: blur(8px); }
.cd-id { display: flex; gap: 12px; align-items: center; min-width: 0; }
.cd-logo { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: var(--brand); color: var(--on-brand); font: 700 1rem var(--cd-head); }
.cd-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.cd-name { margin: 0; color: var(--cd-ink); font: 600 1.15rem/1.15 var(--cd-head); }
.cd-handle { margin: 0; color: var(--cd-ink3); font-size: .85rem; }
.cd-tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.cd-tabs a { padding: 6px 12px; border-radius: 8px; color: var(--cd-ink2); text-decoration: none; font-size: .92rem; min-height: 32px; display: inline-flex; align-items: center; }
.cd-tabs a:hover { background: var(--brand-soft); color: var(--cd-ink); }

/* sample badge (FTC: on every number) */
.cd-sample { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; border: 1px dashed #E8C766; color: #F2D98A; font: 600 .68rem/1.5 Inter, system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; vertical-align: middle; }
.cd-sample-lg { font-size: .76rem; padding: 3px 10px; }

/* layout */
.cd-main { max-width: 1240px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.cd-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.cd-panel { background: var(--cd-panel); border: 1px solid var(--cd-line); border-radius: var(--cd-r); padding: 18px; min-width: 0; }
.cd-panel-h { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.cd-panel-h h2, .cd-panel-h h3 { margin: 0; }
.cd-mt { margin-top: 20px; margin-bottom: 6px; }
.cd-sub { color: var(--cd-ink3); font-size: .92rem; margin: 6px 0 14px; }
.cd-fine { color: var(--cd-ink3); font-size: .82rem; margin: 0; }

/* brand chooser */
.cd-brand { background: linear-gradient(135deg, var(--brand-soft), transparent 60%), var(--cd-panel); }
.cd-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cd-swatches button { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--cd-line-2); background: var(--cd-panel-2); color: var(--cd-ink); font: 600 .9rem var(--cd-head); cursor: pointer; }
.cd-swatches button[aria-checked="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.cd-own { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.cd-own label { display: grid; gap: 4px; font-size: .85rem; color: var(--cd-ink2); }
.cd-own input[type="text"] { min-height: 40px; width: 200px; max-width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--cd-line-2); background: var(--cd-bg); color: var(--cd-ink); font: inherit; }
.cd-own input[type="color"] { width: 64px; height: 40px; padding: 2px; border-radius: 8px; border: 1px solid var(--cd-line-2); background: var(--cd-bg); cursor: pointer; }
.cd-own input[type="file"] { max-width: 220px; color: var(--cd-ink3); font-size: .82rem; }
.cd-own .cd-fine { flex-basis: 100%; }

/* KPIs */
.cd-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.cd-kpi { background: var(--cd-panel); border: 1px solid var(--cd-line); border-radius: var(--cd-r); padding: 14px; min-width: 0; }
.cd-kpi:nth-child(-n+2) { border-top: 3px solid var(--brand); }
.cd-kpi-l { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; margin: 0 0 6px; font-size: .8rem; color: var(--cd-ink3); }
.cd-kpi-v { margin: 0; color: var(--cd-ink); font: 600 1.6rem/1.1 var(--cd-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cd-kpi-n { margin: 4px 0 0; font-size: .8rem; color: var(--cd-ink3); }

/* weekly revenue bars */
.cd-bars { position: relative; height: 220px; padding: 0 0 26px 42px; }
.cd-grid { position: absolute; inset: 0 0 26px 42px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.cd-gl { position: relative; border-top: 1px solid var(--cd-line); height: 0; }
.cd-gl-t { position: absolute; right: calc(100% + 8px); top: -9px; font-size: .72rem; color: var(--cd-ink3); font-variant-numeric: tabular-nums; }
.cd-bar-row { position: relative; height: 100%; display: flex; align-items: flex-end; gap: 2px; }
.cd-bar { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; padding: 0 3px; background: none; border: 0; cursor: pointer; border-radius: 4px; }
.cd-bar:hover { background: rgba(255,255,255,.04); }
.cd-bar-fill { display: block; width: 100%; max-width: 28px; margin: 0 auto; background: var(--brand); border-radius: 4px 4px 0 0; }
.cd-bar:last-child .cd-bar-fill { box-shadow: 0 0 0 2px var(--cd-panel), 0 0 0 3px var(--brand); }
.cd-axis { position: absolute; left: 42px; right: 0; bottom: 0; display: flex; justify-content: space-between; font-size: .72rem; color: var(--cd-ink3); }
.cd-table { margin-top: 10px; font-size: .85rem; }
.cd-table summary { cursor: pointer; color: var(--cd-ink2); min-height: 24px; }
.cd-table table { border-collapse: collapse; margin-top: 8px; width: 100%; max-width: 320px; }
.cd-table caption { text-align: left; color: var(--cd-ink3); padding-bottom: 4px; }
.cd-table th, .cd-table td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--cd-line); }
.cd-table td:last-child { font-variant-numeric: tabular-nums; }

/* horizontal bars + lists */
.cd-hbars, .cd-lines, .cd-reels, .cd-tools { list-style: none; margin: 0; padding: 0; }
.cd-hbars { display: grid; gap: 12px; margin-top: 12px; }
.cd-hb-l { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; margin-bottom: 4px; }
.cd-hb-l b { color: var(--cd-ink); font-variant-numeric: tabular-nums; }
.cd-hb-t { display: block; height: 8px; border-radius: 4px; background: var(--cd-panel-2); overflow: hidden; }
.cd-hb-f { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.cd-lines li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--cd-line); font-size: .92rem; }
.cd-lines li:last-child { border-bottom: 0; }
.cd-lines b { color: var(--cd-ink); font-variant-numeric: tabular-nums; }
.cd-lines span { display: grid; min-width: 0; }
.cd-lines small { color: var(--cd-ink3); font-size: .8rem; }
.cd-lines .cd-total { border-top: 1px solid var(--cd-line-2); border-bottom: 0; }
.cd-lines .cd-total b { color: var(--brand); font-size: 1.05rem; }
.cd-when { color: var(--cd-ink2); font-size: .85rem; white-space: nowrap; }

/* reels */
.cd-reels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cd-reel { background: var(--cd-panel-2); border: 1px solid var(--cd-line); border-radius: 12px; overflow: hidden; }
.cd-thumb { position: relative; aspect-ratio: 16 / 9; background: #000; }
.cd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cd-thumb .cd-plat { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.72); color: #fff; font-size: .75rem; }
.cd-thumb .cd-sample { position: absolute; right: 8px; top: 8px; background: rgba(0,0,0,.72); }
.cd-reel-b { padding: 10px 12px 12px; }
.cd-reel-t { margin: 0 0 8px; color: var(--cd-ink); font-weight: 600; font-size: .95rem; }
.cd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; }
.cd-stats dt { font-size: .72rem; color: var(--cd-ink3); }
.cd-stats dd { margin: 0; color: var(--cd-ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* tools */
.cd-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cd-tools a, .cd-tools button { display: grid; gap: 4px; height: 100%; width: 100%; text-align: left; padding: 16px; border-radius: 12px; border: 1px solid var(--cd-line-2); background: var(--cd-panel-2); color: var(--cd-ink2); text-decoration: none; font: inherit; cursor: pointer; }
.cd-tools a:hover, .cd-tools button:hover { border-color: var(--brand); background: var(--brand-soft); }
.cd-tools b { color: var(--cd-ink); font: 600 1rem var(--cd-head); }
.cd-tools span { font-size: .88rem; }

/* CTA */
.cd-cta { text-align: center; padding: 32px 20px; border-radius: var(--cd-r); border: 1px solid var(--brand); background: radial-gradient(ellipse at top, var(--brand-soft), transparent 70%), var(--cd-panel); }
.cd-cta h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
.cd-cta p { max-width: 560px; margin: 0 auto 16px; }
.cd-cta-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cd-foot { text-align: center; padding: 8px 0 24px; }

/* tooltip */
.cd-tip { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px); padding: 8px 12px; border-radius: 8px; background: #FFFFFF; color: #15121F; font-size: .85rem; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.4); pointer-events: none; }
.cd-tip.cd-tip-float { bottom: auto; transform: none; width: 180px; text-align: center; }

@media (max-width: 1100px) { .cd-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cd-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .cd-row { grid-template-columns: 1fr; } .cd-reels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .cd-main { padding: 12px 16px; gap: 12px; }
  .cd-top { position: static; padding: 10px 16px; } .cd-tabs { margin-left: 0; width: 100%; } .cd-tabs a { padding: 6px 8px; }
  .cd-strip { padding: 10px 16px; }
  .cd-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .cd-kpi-v { font-size: 1.3rem; }
  .cd-reels, .cd-tools { grid-template-columns: 1fr; }
  .cd-own input[type="text"] { width: 100%; } .cd-own label { flex: 1 1 100%; }
  .cd-bars { padding-left: 36px; } .cd-grid, .cd-axis { left: 36px; } .cd-grid { inset: 0 0 26px 36px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (forced-colors: active) { .cd-bar-fill, .cd-hb-f { background: CanvasText; } .cd-sample { border-style: solid; } }
