/* Kick Overlay Studio — desktop editor chrome */
.kos-page {
  --panel: #0c1017;
  --panel-2: #10151e;
  --kos-max: none;
}
.kos-page .wrap {
  width: min(100% - 24px, 1680px);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Full-viewport app shell: nav + intro + editor + OBS tip share one column.
   The sticky site OBS dock used to cover the timeline; keep it in normal flow here. */
body.kos-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding-bottom: 0 !important;
}

body.kos-page > .wrap > .nav,
body.kos-page > .wrap > .addon-hero,
body.kos-page > .wrap > .kos-mobile {
  flex-shrink: 0;
}

/* Slim intro so the canvas/timeline get the vertical room */
body.kos-page .addon-hero.kos-intro {
  padding: 2px 0 0 !important;
}
body.kos-page .addon-hero .crumb {
  margin-bottom: 2px;
  font-size: 0.78rem;
}
body.kos-page .kos-intro-line {
  margin: 0 0 6px;
  padding: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}
body.kos-page .kos-intro-line strong {
  color: var(--ink);
  font-weight: 700;
}

body.kos-page > .obs-dock {
  display: none !important;
}

.kos-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  margin-top: 0;
  margin-bottom: 12px;
}

.kos-privacy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 2px 0 6px;
  flex-shrink: 0;
}
.kos-privacy strong { color: var(--accent); font-weight: 700; }

.kos-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  background: var(--panel);
  flex-shrink: 0;
}
.kos-toolbar .btn {
  padding: 8px 14px;
  font-size: 0.8rem;
}
.kos-name {
  min-width: 160px;
  flex: 1;
  max-width: 280px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 700;
}
.kos-name:focus { outline: 2px solid rgba(83,252,24,0.45); outline-offset: 1px; }
.kos-sep {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 4px;
}
.kos-hint {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kos-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  flex: 1;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #080b10;
}

.kos-col {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  background: var(--panel-2);
}
.kos-col h2 {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.kos-assets { border-right: 1px solid var(--line); }
.kos-props { border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }

.kos-drop {
  border: 1px dashed rgba(83,252,24,0.35);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 10px;
  cursor: pointer;
}
.kos-drop.is-over { background: rgba(83,252,24,0.08); border-color: var(--accent); color: var(--ink); }
.kos-drop input { display: none; }

.kos-asset {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: grab;
  margin-bottom: 6px;
}
.kos-asset:hover { border-color: var(--line); background: rgba(255,255,255,0.03); }
.kos-asset img, .kos-asset video, .kos-thumb {
  width: 44px; height: 32px; object-fit: cover; border-radius: 4px; background: #07090d;
}
.kos-thumb {
  display: grid; place-items: center;
  font-size: 0.62rem; font-weight: 800; color: var(--accent);
}
.kos-asset .nm { font-size: 0.78rem; font-weight: 700; line-height: 1.2; }
.kos-asset .sub { font-size: 0.68rem; color: var(--muted); }
.kos-asset.is-missing { border-color: var(--danger); }

.kos-canvas-wrap {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(45deg, #12161e 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #12161e 25%, transparent 25%) 0 8px / 16px 16px,
    #0a0d13;
  position: relative;
}
.kos-stage {
  flex: 1;
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 12px 16px;
  overflow: hidden;
}
.kos-stage canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(83,252,24,0.35), 0 12px 40px rgba(0,0,0,0.5);
  cursor: default;
}
.kos-empty {
  position: absolute;
  inset: auto 16px 16px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  pointer-events: none;
}

.kos-layer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.kos-layer.is-on { border-color: rgba(83,252,24,0.45); background: rgba(83,252,24,0.08); }
.kos-layer .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kos-iconbtn {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.78rem;
}
.kos-iconbtn:hover, .kos-iconbtn:focus-visible { color: var(--ink); outline: none; }

.kos-field { margin-bottom: 8px; }
.kos-field label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.kos-field input, .kos-field select, .kos-field textarea {
  width: 100%;
  background: #0c1017;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 8px;
  font: inherit;
  font-size: 0.85rem;
  color-scheme: dark;
}
/* Native <select> popups often use light OS chrome while page text is light.
   color-scheme + Canvas system colors keep Type/Easing/Font options readable. */
.kos-field select option,
.kos-field select optgroup {
  background-color: Canvas;
  color: CanvasText;
}
.kos-field textarea { min-height: 64px; resize: vertical; }
.kos-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kos-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.kos-check { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.kos-check input { width: auto; }

.kos-timeline {
  border: 1px solid var(--line);
  border-top: 2px solid rgba(83, 252, 24, 0.4);
  border-radius: 0 0 12px 12px;
  background: var(--panel);
  padding: 8px 12px 10px;
  flex-shrink: 0;
  min-height: 0;
}
.kos-time-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.kos-time-ctrl input[type="range"] { flex: 1; accent-color: var(--accent); }
.kos-tracks { overflow: auto; max-height: 112px; }
.kos-track {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 0.72rem;
}
.kos-track .nm { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kos-bar {
  position: relative;
  height: 18px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
}
.kos-bar span {
  position: absolute;
  top: 2px; bottom: 2px;
  background: rgba(83,252,24,0.45);
  border-radius: 3px;
  min-width: 8px;
  cursor: ew-resize;
}
.kos-playhead {
  position: relative;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  margin-bottom: 6px;
  cursor: pointer;
}
.kos-playhead i {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 16px;
  background: var(--accent);
  pointer-events: none;
}

.kos-banner {
  background: rgba(255,92,122,0.12);
  border: 1px solid rgba(255,92,122,0.4);
  color: #ffc2cd;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.kos-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.62);
  display: none;
  place-items: center;
  z-index: 40;
  padding: 24px;
}
.kos-modal.is-open { display: grid; }
.kos-modal .box {
  width: min(420px, 100%);
  background: #0c1017;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}
.kos-modal h3 { font-family: var(--font-display); margin-bottom: 8px; }
.kos-modal p { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }
.kos-progress {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}
.kos-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

[hidden] { display: none !important; }
.kos-preview-exit {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
}

.kos-mobile {
  display: none;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.kos-mobile strong { color: var(--ink); }

.is-preview .nav,
.is-preview .addon-hero,
.is-preview .obs-dock,
.is-preview .kos-privacy,
.is-preview .kos-toolbar,
.is-preview .kos-assets,
.is-preview .kos-props,
.is-preview .kos-timeline { display: none !important; }
.is-preview .kos-body { grid-template-columns: 1fr; border: 0; flex: 1; min-height: 0; }
.is-preview .kos-shell { flex: 1; height: auto; margin: 0; }
.is-preview .wrap { width: 100%; height: 100%; }

@media (max-width: 960px) {
  body.kos-page { overflow: auto; height: auto; max-height: none; display: block; }
  body.kos-page .wrap { display: block; height: auto; }
  body.kos-page > .obs-dock { display: none !important; }
  .kos-shell { display: none; }
  .kos-mobile { display: block; }
}
