:root {
  color-scheme: dark;
  --bg: #050a14;
  --panel: #0b1626;
  --panel-2: #0f1f35;
  --line: #1f3654;
  --line-bright: #375a88;
  --text: #f3f7fc;
  --muted: #8ca3be;
  --primary: #7458f5;
  --cyan: #19d8c2;
  --pink: #ff4d8d;
  --drive: #25b869;
  --amber: #ffb536;
  --danger: #ff4d6d;
}

* {
  box-sizing: border-box;
}

/* Component display rules must never override the native hidden state. */
:where([hidden]) {
  display: none !important;
}

.kd-load-more {
  display: flex;
  margin: 18px auto 32px;
}

.kd-uploader-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.kd-uploader-line .material-symbols-rounded {
  color: var(--cyan);
  font-size: 15px;
}

.kd-item-warning {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 181, 54, .45);
  border-radius: 9px;
  background: rgba(255, 181, 54, .09);
  color: #ffd28a;
  font-size: 10px;
  line-height: 1.45;
}

.kd-item-warning.is-duplicate {
  border-color: rgba(255, 77, 109, .75);
  background: rgba(255, 77, 109, .12);
  color: #ff9aae;
}

.kd-pending-player {
  display: grid;
  min-height: 240px;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(116, 88, 245, .12), rgba(25, 216, 194, .06));
  color: var(--muted);
  text-align: center;
}

.kd-pending-player .material-symbols-rounded {
  display: block;
  margin-bottom: 8px;
  color: var(--amber);
  font-size: 38px;
}

.kd-report-modal {
  width: min(1180px, 96vw);
}

.kd-report-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kd-report-kpi {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 31, 53, .72);
}

.kd-report-kpi strong,
.kd-report-kpi small {
  display: block;
}

.kd-report-kpi strong {
  color: var(--cyan);
  font-size: 21px;
}

.kd-report-kpi small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.kd-report-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.kd-report-toolbar input {
  flex: 1;
  min-width: 0;
}

.kd-report-table-wrap {
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.kd-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.kd-report-table th,
.kd-report-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(55, 90, 136, .3);
  text-align: left;
  vertical-align: top;
}

.kd-report-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #101d31;
  color: #bbaeff;
}

.kd-report-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.kd-report-alert {
  color: #ff9aae;
  font-weight: 700;
}

.kd-sheet-result ul {
  max-height: 220px;
  margin: 10px 0 0;
  padding-left: 20px;
  overflow: auto;
}

.kd-sheet-result li {
  margin: 5px 0;
  color: #ffd28a;
}

.kd-sheet-result .is-duplicate {
  color: #ff879f;
  font-weight: 700;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -5%, rgba(116, 88, 245, 0.22), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(25, 216, 194, 0.14), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

/* HEADER */
.kd-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 10px clamp(14px, 3vw, 40px);
  border-bottom: 1px solid rgba(55, 90, 136, 0.42);
  background: rgba(5, 10, 20, 0.92);
  backdrop-filter: blur(18px);
}

.kd-header-left,
.kd-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.kd-logo-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #7458f5, #ff4d8d);
  color: #fff;
  font-size: 24px;
  box-shadow: 0 6px 18px rgba(116, 88, 245, 0.35);
}

.kd-brand strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.kd-brand small {
  display: block;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

/* COMPACT (i) TOOLTIP PILL */
.kd-info-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-bright);
  border-radius: 99px;
  background: rgba(15, 31, 53, 0.85);
  color: #9ec0e6;
  cursor: pointer;
}

.kd-info-pill .material-symbols-rounded {
  font-size: 18px;
}

.kd-tooltip-box {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 90;
  width: min(360px, 88vw);
  padding: 14px 16px;
  border: 1px solid var(--line-bright);
  border-radius: 14px;
  background: #0a1628;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.18s ease;
  pointer-events: none;
}

.kd-info-pill:hover .kd-tooltip-box,
.kd-info-pill:focus-within .kd-tooltip-box,
.kd-info-pill.open .kd-tooltip-box {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.kd-tooltip-box strong {
  display: block;
  margin-bottom: 6px;
  color: var(--cyan);
  font-size: 12px;
}

.kd-tooltip-box ul {
  margin: 0;
  padding-left: 16px;
}

.kd-tooltip-box li + li {
  margin-top: 4px;
}

/* VIEW SWITCHER */
.kd-view-switcher {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #081220;
  gap: 4px;
}

.kd-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: 700 12px Inter, sans-serif;
  cursor: pointer;
  transition: all 0.18s;
}

.kd-view-btn .material-symbols-rounded {
  font-size: 18px;
}

.kd-view-btn.active {
  background: linear-gradient(135deg, #6850ec, #8f6bff);
  color: #fff;
  box-shadow: 0 4px 12px rgba(104, 80, 236, 0.35);
}

/* ACTOR PICKER & BUTTONS */
.kd-actor-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: #091525;
  color: var(--cyan);
}

.kd-actor-picker .material-symbols-rounded {
  font-size: 18px;
}

.kd-actor-picker select {
  border: 0;
  background: transparent;
  color: var(--text);
  font: 700 12px Inter, sans-serif;
  outline: none;
  cursor: pointer;
}

.kd-actor-picker select option {
  background: #091525;
  color: var(--text);
}

.kd-workspace-picker select {
  max-width: min(280px, 26vw);
  text-overflow: ellipsis;
}

.kd-btn,
.kd-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  font: 700 12px Inter, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.15s, background 0.15s;
}

.kd-btn:active,
.kd-icon-btn:active {
  transform: scale(0.97);
}

.kd-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.kd-btn .material-symbols-rounded,
.kd-icon-btn .material-symbols-rounded {
  font-size: 18px;
}

.kd-icon-btn {
  width: 38px;
  padding: 0;
  border-color: var(--line);
  background: #0b1728;
}

.kd-btn-primary {
  background: linear-gradient(135deg, #6850ec, #936dff);
  box-shadow: 0 6px 18px rgba(104, 80, 236, 0.28);
}

.kd-btn-secondary {
  border-color: var(--line-bright);
  background: #0d1d33;
}

.kd-btn-drive {
  border-color: rgba(37, 184, 105, 0.55);
  background: rgba(37, 184, 105, 0.14);
  color: #6df0a8;
}

.kd-btn-drive:hover {
  background: rgba(37, 184, 105, 0.24);
}

.kd-btn-link {
  border-color: rgba(25, 216, 194, 0.45);
  background: rgba(25, 216, 194, 0.12);
  color: #6bf2e0;
}

.kd-btn-live {
  border-color: rgba(255, 181, 54, 0.6);
  background: linear-gradient(135deg, rgba(255, 181, 54, 0.22), rgba(255, 77, 141, 0.22));
  color: #ffd37a;
}

.kd-btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

/* MAIN SHELL */
.kd-shell {
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 40px) 60px;
}

/* 3 IDOL + 1 MC ROSTER BAR */
.kd-roster-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kd-roster-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(13, 27, 46, 0.92), rgba(8, 18, 32, 0.92));
  cursor: pointer;
  transition: all 0.18s;
}

.kd-roster-card:hover {
  border-color: var(--line-bright);
  transform: translateY(-1px);
}

.kd-roster-card.active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(25, 216, 194, 0.22);
}

.kd-roster-id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.kd-roster-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 19px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--member-color, #7458f5);
  flex-shrink: 0;
}

.kd-roster-meta strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kd-roster-meta small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.kd-roster-stats {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.kd-stat-pill {
  padding: 3px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 10px;
  font-weight: 800;
}

.kd-stat-pill.ready {
  color: #6df0a8;
  background: rgba(37, 184, 105, 0.14);
}

.kd-stat-pill.practice {
  color: #ffd37a;
  background: rgba(255, 181, 54, 0.14);
}

/* TOOLBAR & FILTER CHIPS */
.kd-toolbar {
  display: grid;
  grid-template-columns: 270px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.kd-search-wrap {
  position: relative;
}

.kd-search-wrap .material-symbols-rounded {
  position: absolute;
  top: 9px;
  left: 11px;
  color: var(--muted);
  font-size: 19px;
}

.kd-search-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #081322;
  color: var(--text);
  font: 600 12px Inter, sans-serif;
  outline: none;
}

.kd-search-wrap input:focus {
  border-color: var(--primary);
}

.kd-chip-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}

.kd-chip-scroll::-webkit-scrollbar {
  display: none;
}

.kd-chip {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #091525;
  color: #b4c6dc;
  font: 700 11px Inter, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.kd-chip.active {
  border-color: var(--primary);
  background: rgba(116, 88, 245, 0.24);
  color: #fff;
}

.kd-chip-hot {
  border-color: rgba(255, 77, 141, 0.45);
  color: #ff9ec0;
}

.kd-chip-ready {
  border-color: rgba(37, 184, 105, 0.45);
  color: #7bf0b2;
}

.kd-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kd-toolbar-right select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #081322;
  color: var(--text);
  font: 700 11px Inter, sans-serif;
}

.kd-counter {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.kd-notice {
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line-bright);
  border-radius: 11px;
  background: #0d2138;
  font-size: 12px;
  font-weight: 600;
}

.kd-notice.error {
  border-color: rgba(255, 77, 109, 0.55);
  background: rgba(255, 77, 109, 0.12);
  color: #ff9eae;
}

/* VIDEO CARDS GRID */
.kd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 16px;
}

.kd-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #0d1c30, #081220);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  transition: border-color 0.18s;
}

.kd-card.locked-group {
  border-color: rgba(255, 77, 141, 0.72);
  box-shadow: 0 12px 30px rgba(255, 77, 141, 0.14);
}

.kd-card.ready-live {
  border-color: rgba(37, 184, 105, 0.65);
}

/* VIDEO FRAME & VISUAL OVERLAYS */
.kd-video-wrap {
  position: relative;
  aspect-ratio: 9 / 15;
  max-height: 460px;
  background: #000;
  overflow: hidden;
}

.kd-video-wrap iframe,
.kd-video-wrap video {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: #000;
}

.kd-overlay-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}

.kd-overlay-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  pointer-events: auto;
}

.kd-overlay-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
}

.kd-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 99px;
  background: rgba(5, 11, 21, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.kd-pill.solo {
  border-color: rgba(116, 88, 245, 0.7);
  color: #c5b6ff;
}

.kd-pill.group3,
.kd-pill.duo,
.kd-pill.group_all {
  border-color: rgba(25, 216, 194, 0.7);
  color: #6df5e3;
}

.kd-pill.locked {
  background: linear-gradient(135deg, #ff3377, #ff7b36);
  border: 0;
  color: #fff;
}

.kd-float-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 99px;
  background: rgba(5, 11, 21, 0.84);
  backdrop-filter: blur(8px);
  color: #fff;
  font: 700 10px Inter, sans-serif;
  cursor: pointer;
}

.kd-float-btn .material-symbols-rounded {
  font-size: 15px;
}

.kd-overlay-bottom {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}

.kd-cue-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid rgba(255, 181, 54, 0.75);
  background: rgba(12, 20, 35, 0.9);
  color: #ffd579;
  font: 800 10px Inter, sans-serif;
  cursor: pointer;
}

.kd-duration-pill {
  pointer-events: auto;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(5, 11, 21, 0.88);
  color: #e2ecf7;
  font: 800 10px Inter, sans-serif;
}

/* FLOATING HEART ANIMATION */
.kd-heart-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;
  font-size: 68px;
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0;
  pointer-events: none;
  animation: kdHeartPop 0.75s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes kdHeartPop {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.3) rotate(-12deg); }
  35% { opacity: 1; transform: translate(-50%, -55%) scale(1.18) rotate(8deg); }
  100% { opacity: 0; transform: translate(-50%, -95%) scale(1.4) rotate(0deg); }
}

/* CARD BODY */
.kd-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px 13px;
  flex: 1;
}

.kd-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.kd-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.kd-song-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* TIMESTAMP >>> CHIPS */
.kd-markers-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.kd-marker-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid rgba(116, 88, 245, 0.45);
  border-radius: 7px;
  background: rgba(116, 88, 245, 0.11);
  color: #d4caff;
  font: 700 10px Inter, sans-serif;
  cursor: pointer;
}

.kd-marker-chip:hover {
  background: rgba(116, 88, 245, 0.25);
}

/* STATUS & RECOMMENDATION STRIP */
.kd-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 700;
}

.kd-status-strip.claimed {
  background: rgba(25, 216, 194, 0.1);
  color: #7df7e6;
}

.kd-status-strip.group-hot {
  background: rgba(255, 77, 141, 0.13);
  color: #ff9ec2;
}

.kd-heart-avatars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* QUICK EXTERNAL OPEN ROW (OPEN LINK + OPEN DRIVE + LIVE +1) */
.kd-quick-links {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
}

.kd-quick-links .kd-btn {
  height: 32px;
  padding: 0 9px;
  font-size: 11px;
}

/* PRIMARY CARD ACTIONS (HEART + CLAIM/STATUS + STUDIO) */
.kd-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.kd-card-actions .kd-btn {
  flex: 1;
  height: 35px;
  padding: 0 8px;
  font-size: 11px;
}

.kd-btn-heart {
  border-color: rgba(255, 77, 141, 0.45);
  background: rgba(255, 77, 141, 0.1);
  color: #ff94b9;
}

.kd-btn-heart.liked {
  border-color: #ff4d8d;
  background: linear-gradient(135deg, rgba(255, 77, 141, 0.32), rgba(255, 51, 102, 0.28));
  color: #fff;
}

.kd-card-actions .kd-icon-btn {
  width: 34px;
  height: 35px;
  flex: 0 0 34px;
}

/* VIEW 2: FULL-SCREEN TIKTOK SWIPE THEATER */
body.kd-tiktok-open {
  overflow: hidden;
}

.kd-tiktok-theater {
  position: fixed;
  inset: 0;
  z-index: 92;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kd-tiktok-theater[hidden] {
  display: none !important;
}

.kd-tt-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 14px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 68%, transparent 100%);
  pointer-events: none;
}

.kd-tt-topbar > * {
  pointer-events: auto;
}

.kd-tt-top-left,
.kd-tt-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kd-tt-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 99px;
  background: rgba(10, 18, 32, 0.72);
  backdrop-filter: blur(10px);
  color: #fff;
  font: 700 12px Inter, sans-serif;
  cursor: pointer;
}

.kd-tt-pill-btn.active {
  border-color: var(--cyan);
  background: rgba(25, 216, 194, 0.28);
  color: #7df7e6;
}

.kd-tt-counter {
  padding: 4px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
}

.kd-tt-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 99px;
  background: rgba(8, 15, 28, 0.68);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.kd-tt-tabs::-webkit-scrollbar {
  display: none;
}

.kd-tt-tab {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font: 700 11px Inter, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.kd-tt-tab.active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.kd-tt-actor-select {
  height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(25, 216, 194, 0.45);
  border-radius: 99px;
  background: rgba(9, 21, 37, 0.8);
  color: #fff;
  font: 700 11px Inter, sans-serif;
  outline: none;
}

.kd-tt-track {
  flex: 1;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}

.kd-tt-track::-webkit-scrollbar {
  display: none;
}

.kd-tt-slide {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #0c182c 0%, #000 75%);
  overflow: hidden;
}

.kd-tt-stage {
  position: relative;
  height: 100vh;
  height: 100dvh;
  aspect-ratio: 9 / 16;
  max-width: 100vw;
  background: #000;
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.kd-tt-player-mount {
  width: 100%;
  height: 100%;
  background: #000;
  transition: transform 0.22s ease;
}

.kd-tt-player-mount.mirrored {
  transform: scaleX(-1);
}

.kd-tt-player-mount iframe,
.kd-tt-player-mount video {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  display: block;
}

/* RIGHT VERTICAL ACTION RAIL (TIKTOK APP STYLE) */
.kd-tt-rail {
  position: absolute;
  right: 10px;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 16;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.kd-tt-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #ff4d8d;
  background: #0b1626;
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
  margin-bottom: 4px;
}

.kd-tt-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.kd-tt-action-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 19, 34, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  color: #fff;
  transition: transform 0.14s, background 0.15s;
}

.kd-tt-action:active .kd-tt-action-circle {
  transform: scale(0.9);
}

.kd-tt-action.liked .kd-tt-action-circle {
  background: linear-gradient(135deg, #ff2a75, #ff5e97);
  border-color: #ff94b9;
  box-shadow: 0 0 18px rgba(255, 42, 117, 0.65);
}

.kd-tt-action.claimed .kd-tt-action-circle {
  background: linear-gradient(135deg, #059669, #19d8c2);
  border-color: #6ee7b7;
}

.kd-tt-action.drive .kd-tt-action-circle {
  border-color: rgba(37, 184, 105, 0.6);
  color: #6df0a8;
}

.kd-tt-action.live .kd-tt-action-circle {
  border-color: rgba(255, 181, 54, 0.65);
  color: #ffd37a;
}

.kd-tt-action small {
  font-size: 10px;
  font-weight: 800;
  color: #f8fafc;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
  max-width: 66px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* BOTTOM OVERLAY IN TIKTOK SLIDE */
.kd-tt-bottom {
  position: absolute;
  left: 0;
  right: 68px;
  bottom: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px 14px calc(20px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.5) 62%, transparent 100%);
  pointer-events: none;
}

.kd-tt-bottom > * {
  pointer-events: auto;
}

.kd-tt-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.kd-tt-title {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.kd-tt-sub {
  font-size: 12px;
  font-weight: 600;
  color: #dbeafe;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.kd-tt-cues {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.kd-tt-cues::-webkit-scrollbar {
  display: none;
}

.kd-tt-nav-arrows {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 22;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kd-tt-arrow-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(9, 18, 32, 0.75);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* MOBILE BOTTOM NAVIGATION BAR */
.kd-mobile-nav {
  display: none;
}

/* VIEW 3: MC LIVE CUE BOARD */
.kd-mc-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;
}

.kd-mc-col {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 21, 36, 0.9);
  padding: 12px;
}

.kd-mc-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  font-size: 13px;
}

.kd-mc-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c1a2e;
  margin-bottom: 8px;
}

.kd-mc-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.kd-mc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
  font-size: 10px;
  color: #ffd37a;
}

.kd-mc-actions {
  display: flex;
  gap: 5px;
}

.kd-mc-actions .kd-btn {
  flex: 1;
  height: 30px;
  padding: 0 7px;
  font-size: 10px;
}

/* MODALS */
.kd-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 14, 0.82);
  backdrop-filter: blur(10px);
}

.kd-modal-backdrop[hidden] {
  display: none !important;
}

.kd-modal {
  width: min(760px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px 22px;
  border: 1px solid var(--line-bright);
  border-radius: 20px;
  background: #091525;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

.kd-studio-modal {
  width: min(1060px, 100%);
}

.kd-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.kd-eyebrow {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.kd-modal-header h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

/* FORM */
.kd-source-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.kd-source-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #07101d;
  color: var(--muted);
  font: 700 12px Inter, sans-serif;
  cursor: pointer;
}

.kd-source-tab.active {
  border-color: var(--primary);
  background: rgba(116, 88, 245, 0.2);
  color: #fff;
}

.kd-source-box {
  padding: 12px;
  border: 1px dashed var(--line-bright);
  border-radius: 13px;
  background: rgba(7, 16, 29, 0.65);
  margin-bottom: 14px;
}

.kd-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.kd-full {
  grid-column: 1 / -1;
}

.kd-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #b7c8dc;
  font-size: 11px;
  font-weight: 700;
}

.kd-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kd-mini-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(116, 88, 245, 0.25);
  color: #c5b6ff;
  font-size: 11px;
  cursor: help;
}

.kd-form input,
.kd-form select,
.kd-form textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #06101c;
  color: var(--text);
  font: 600 12px Inter, sans-serif;
  outline: none;
}

.kd-form input:focus,
.kd-form select:focus,
.kd-form textarea:focus {
  border-color: var(--primary);
}

.kd-input-action-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.kd-input-action-row textarea,
.kd-input-action-row input {
  flex: 1;
}

.kd-source-preview {
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(25, 216, 194, 0.12);
  color: #7df7e6;
  font-size: 11px;
  font-weight: 700;
}

.kd-upload-drop {
  align-items: center;
  justify-content: center;
  padding: 18px;
  border: 1px dashed var(--line-bright);
  border-radius: 11px;
  text-align: center;
  cursor: pointer;
}

.kd-upload-drop input {
  display: none;
}

.kd-field-title {
  display: block;
  margin-bottom: 6px;
  color: #b7c8dc;
  font-size: 11px;
  font-weight: 700;
}

.kd-tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kd-pick-chip {
  height: 31px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #07111f;
  color: #9fb4cc;
  font: 700 11px Inter, sans-serif;
  cursor: pointer;
}

.kd-pick-chip.selected {
  border-color: var(--cyan);
  background: rgba(25, 216, 194, 0.2);
  color: #fff;
}

.kd-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.kd-status-text {
  margin-right: auto;
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

/* PRACTICE STUDIO MODAL */
.kd-studio-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kd-studio-body {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 18px;
}

.kd-studio-stage {
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 72vh;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line-bright);
}

.kd-studio-player {
  width: 100%;
  height: 100%;
  transition: transform 0.22s ease;
}

.kd-studio-player.mirrored {
  transform: scaleX(-1);
}

.kd-studio-player iframe,
.kd-studio-player video {
  width: 100%;
  height: 100%;
  border: 0;
}

.kd-countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(5, 10, 20, 0.72);
  color: var(--cyan);
  font-size: 88px;
  font-weight: 900;
}

.kd-studio-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kd-studio-tool-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kd-speed-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.kd-speed-btn,
.kd-step-btn {
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #081322;
  color: var(--muted);
  font: 700 11px Inter, sans-serif;
  cursor: pointer;
}

.kd-speed-btn.active,
.kd-step-btn.active {
  border-color: var(--cyan);
  background: rgba(25, 216, 194, 0.2);
  color: #fff;
}

.kd-section-label {
  margin-bottom: 6px;
  color: #9cb3cc;
  font-size: 11px;
  font-weight: 800;
}

.kd-progress-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kd-studio-usage-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #07111e;
}

.kd-usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
}

.kd-usage-history {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
  font-size: 11px;
  color: var(--muted);
}

.kd-roster-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.kd-roster-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(116, 88, 245, 0.08);
}

.kd-roster-tools > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kd-roster-tools small {
  color: var(--muted);
  line-height: 1.4;
}

.kd-roster-tool-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.kd-roster-edit-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #07111e;
}

.kd-roster-edit-card.is-new {
  border-color: rgba(25, 216, 194, 0.65);
  box-shadow: inset 3px 0 0 #19d8c2;
}

.kd-empty {
  padding: 64px 20px;
  border: 1px dashed var(--line-bright);
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
}

.kd-empty .material-symbols-rounded {
  font-size: 48px;
  color: var(--primary);
}

.kd-mt-8 {
  margin-top: 8px;
}

.kd-sheet-template-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(116, 88, 245, 0.14));
}

.kd-sheet-template-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kd-sheet-template-info strong {
  font-size: 13px;
  color: #e0f2fe;
}

.kd-sheet-template-info small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.kd-sheet-result {
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid rgba(25, 216, 194, 0.4);
  border-radius: 12px;
  background: rgba(25, 216, 194, 0.1);
  color: #a7f3d0;
  font-size: 12px;
  line-height: 1.5;
}

.kd-sheet-result.error {
  border-color: rgba(255, 77, 141, 0.5);
  background: rgba(255, 77, 141, 0.12);
  color: #fecdd3;
}

@media (min-width: 769px) and (max-width: 1180px) {
  .kd-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 14px;
  }

  .kd-view-switcher {
    justify-self: end;
  }

  .kd-header-right {
    grid-column: 1 / -1;
    justify-content: flex-end;
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 1024px) {
  .kd-roster-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .kd-toolbar {
    grid-template-columns: 1fr;
  }
  .kd-mc-board {
    grid-template-columns: repeat(2, 1fr);
  }
  .kd-studio-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .kd-report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kd-report-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .kd-header {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 54px;
    padding: 8px 12px;
    gap: 8px;
  }

  .kd-header-left {
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }

  .kd-header-right {
    justify-content: flex-end;
    width: 100%;
    min-width: 0;
  }

  .kd-brand strong {
    font-size: 13px;
  }

  .kd-brand small {
    font-size: 8px;
  }

  .kd-logo-icon {
    width: 32px;
    height: 32px;
    font-size: 19px;
  }

  /* Bottom nav handles View Switcher, Create & Sheet on mobile */
  .kd-view-switcher,
  #open-create-btn,
  #open-sheet-btn,
  #import-legacy-btn,
  #header-drive-btn span:not(.material-symbols-rounded) {
    display: none;
  }

  .kd-tooltip-box {
    position: fixed;
    top: 62px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  #header-drive-btn {
    width: 34px;
    height: 34px;
    padding: 0;
  }

  .kd-actor-picker {
    height: 34px;
    padding: 0 8px;
  }

  .kd-actor-picker select {
    font-size: 11px;
    max-width: 110px;
  }

  .kd-icon-btn {
    width: 34px;
    height: 34px;
  }

  .kd-shell {
    padding: 12px 10px calc(88px + env(safe-area-inset-bottom, 0px));
  }

  /* Horizontal swipeable Idol/MC strip on mobile */
  .kd-roster-bar {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 8px;
    padding-bottom: 4px;
    margin-bottom: 10px;
    scrollbar-width: none;
  }

  .kd-roster-bar::-webkit-scrollbar {
    display: none;
  }

  .kd-roster-card {
    flex: 0 0 218px;
    scroll-snap-align: start;
    padding: 9px 11px;
  }

  /* Horizontal swipeable MC Live columns on mobile */
  .kd-mc-board {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-bottom: 8px;
  }

  .kd-mc-col {
    flex: 0 0 86vw;
    scroll-snap-align: center;
  }

  /* Full-screen edge-to-edge TikTok stage on mobile */
  .kd-tt-stage {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    aspect-ratio: auto;
    box-shadow: none;
  }

  .kd-tt-topbar {
    flex-wrap: wrap;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 10px;
    gap: 6px;
  }

  .kd-tt-tabs {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .kd-hide-xs {
    display: none;
  }

  .kd-tt-nav-arrows {
    display: none;
  }

  /* Bottom Sheet Modals on Mobile */
  .kd-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .kd-modal {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    padding: 16px 14px calc(22px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
  }

  .kd-form-grid,
  .kd-roster-editor,
  .kd-source-switch {
    grid-template-columns: 1fr;
  }

  .kd-roster-tools,
  .kd-roster-tool-actions {
    align-items: stretch;
    flex-direction: column;
  }

  /* Prevent iOS Safari zoom on input focus */
  .kd-form input,
  .kd-form select,
  .kd-form textarea,
  #kd-search,
  #category-filter {
    font-size: 16px;
  }

  .kd-sheet-template-banner {
    flex-direction: column;
    align-items: stretch;
  }

  /* Fixed Mobile Bottom Navigation Bar */
  .kd-mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 65;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding: 4px 6px env(safe-area-inset-bottom, 0px);
    background: rgba(5, 10, 20, 0.96);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(55, 90, 136, 0.48);
  }

  body.kd-tiktok-open .kd-mobile-nav {
    display: none;
  }

  .kd-mob-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 50px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: 700 10px Inter, sans-serif;
    cursor: pointer;
  }

  .kd-mob-nav-btn .material-symbols-rounded {
    font-size: 21px;
  }

  .kd-mob-nav-btn.active {
    color: var(--cyan);
  }

  .kd-mob-plus-btn {
    justify-self: center;
    width: 46px;
    height: 34px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(90deg, #19d8c2 0%, #7458f5 50%, #ff4d8d 100%);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 14px rgba(255, 77, 141, 0.4);
    cursor: pointer;
  }
}
