
:root{
  --bg:#fff;
  --ink:#0a0a0a;
  --muted:#707070;
  --line:#e8e8e8;
  --line-strong:#d8d8d8;
  --soft:#f7f7f7;
  --pink:#ff4f91;
  --green:#00c853;
  --radius:12px;
  --header-h:56px;
  --max:1480px;
  --font:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);-webkit-font-smoothing:antialiased}
button,input{font:inherit}
button{color:inherit}
a{color:inherit;text-decoration:none}
.site-header{
  position:sticky;top:0;z-index:50;height:var(--header-h);display:flex;
  align-items:center;padding:0 24px;background:rgba(255,255,255,.96);
  backdrop-filter:blur(14px)
}
.brand{font-size:14px;font-weight:800;letter-spacing:.08em;flex:none}
.main-nav{display:flex;align-items:center;gap:18px;font-size:13px;margin-left:auto}
.nav-link,.text-btn,.upload-link{transition:color .16s ease}
.nav-link:hover,.text-btn:hover,.upload-link:hover{color:var(--pink)}
.nav-link.active{color:var(--green)}
.header-actions{justify-self:end;display:flex;gap:10px;align-items:center}
.text-btn,.ghost-btn,.solid-btn,.icon-btn,.segment{border:0;background:none;cursor:pointer}
.text-btn{padding:6px 0;font-size:13px}
.text-btn:disabled{opacity:.35;cursor:not-allowed}
.text-btn.emphasis:not(:disabled){color:var(--green)}
.page-shell{width:min(var(--max),calc(100% - 48px));margin:0 auto;padding:8px 0 16px}
.intro{display:flex;justify-content:space-between;gap:24px;align-items:end;margin-bottom:3px}
.eyebrow,.panel-kicker,.footer-label,.match-label{font-size:10px;font-weight:800;letter-spacing:.16em}
.eyebrow{margin:0 0 10px;color:var(--green)}
h1{font-size:clamp(20px,2vw,30px);line-height:1;letter-spacing:-.03em;margin:0;max-width:620px;font-weight:720}
.subcopy{max-width:620px;font-size:12px;line-height:1.35;color:var(--muted);margin:2px 0 0}
.intro-actions{display:flex;gap:12px;flex-shrink:0;align-items:center}
.ghost-btn,.solid-btn{
  height:auto;padding:6px 0;border-radius:0;font-size:12px;font-weight:700;
  border:0;background:transparent;transition:color .16s ease
}
.ghost-btn{color:var(--ink)}
.ghost-btn:hover{color:var(--pink)}
.solid-btn{color:var(--ink)}
.solid-btn:hover{color:var(--pink)}
.solid-btn:active{color:var(--green)}
.solid-btn:disabled{color:#b7b7b7;background:transparent;cursor:not-allowed}
.workspace{
  display:grid;
  grid-template-columns:minmax(280px,var(--video-col,1fr)) minmax(300px,360px);
  gap:8px;
  align-items:start;
  justify-content:start;
}
.video-panel,.music-panel{border:0;border-radius:0;overflow:visible;background:transparent}
.panel-head{height:36px;padding:0 10px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}
.panel-head>div{display:flex;align-items:center;gap:9px;min-width:0}
.panel-status{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.upload-link{font-size:12px;font-weight:650;cursor:pointer}
.video-stage{
  position:relative;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  overflow:visible;
  width:100%;
  min-height:320px;
}
.video-stage video{
  display:none;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:calc(100vh - 240px);
  background:transparent;
  object-fit:contain;
  object-position:left top;
  border:0;
  outline:0;
  box-shadow:none;
}
.video-stage.has-video video{display:block}
.dropzone{
  position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;
  cursor:pointer;text-align:center;gap:7px;transition:.18s ease
}
.video-stage.has-video .dropzone{display:none}
.dropzone.dragover{background:rgba(255,79,145,.12)}
.dropzone strong{font-size:15px}
.dropzone small{font-size:11px;color:#aaa}
.drop-icon{
  width:40px;height:40px;border:1px solid #4a4a4a;border-radius:50%;display:grid;place-items:center;
  font-size:23px;font-weight:300;margin-bottom:4px
}
.control-strip{
  min-height:38px;padding:3px 8px;display:flex;align-items:center;justify-content:space-between;gap:14px;border-top:1px solid #111;border-bottom:1px solid var(--line)
}
.segmented{display:flex;background:transparent;padding:0;gap:10px}
.segment{padding:6px 0;border-radius:0;font-size:11px;color:var(--muted)}
.segment:hover{color:var(--pink)}
.segment.active{background:transparent;color:var(--green);box-shadow:none}
.mix-control{display:grid;grid-template-columns:auto minmax(80px,150px) 34px;align-items:center;gap:8px;font-size:11px;color:var(--muted)}
input[type="range"]{accent-color:var(--green);width:100%}
.now-playing{min-height:40px;padding:4px 10px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.now-main{display:flex;align-items:center;gap:10px;min-width:0}
.pulse-dot{width:7px;height:7px;border-radius:50%;background:#bbb;flex:none}
.now-playing.active .pulse-dot{background:var(--green);box-shadow:0 0 0 5px rgba(37,182,109,.10)}
.now-title{font-size:12px;font-weight:720;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.now-meta{font-size:10px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.music-panel{display:flex;flex-direction:column;min-height:0}
.search-row{height:36px;padding:3px 8px;border-bottom:1px solid var(--line);position:relative}
.search-row input{
  width:100%;height:31px;border:1px solid var(--line);border-radius:8px;padding:0 32px 0 10px;outline:none;font-size:11px
}
.search-row input:focus{border-color:var(--green)}
.icon-btn{position:absolute;right:16px;top:13px;width:22px;height:22px;color:#999;font-size:18px}
.icon-btn:hover{color:var(--pink)}
.match-card{
  margin:4px 8px 0;border:1px solid rgba(37,182,109,.35);border-radius:10px;padding:10px 11px;
  display:flex;align-items:center;justify-content:space-between;gap:10px
}
.match-card>div{display:grid;gap:3px}
.match-label{color:var(--green)}
.match-card strong{font-size:12px}
.match-card small{font-size:10px;color:var(--muted);line-height:1.35}
.match-score{font-size:12px;font-weight:800;color:var(--green)}
.track-list{overflow:auto;max-height:525px;padding:0 8px 3px}
.track{
  display:grid;grid-template-columns:30px minmax(0,1fr) auto;gap:10px;align-items:center;
  min-height:44px;padding:4px 2px;border-bottom:1px solid var(--line);cursor:pointer
}
.track:last-child{border-bottom:0}
.track:hover .track-title{color:var(--pink)}
.track.selected .track-title,.track.selected .play-btn{color:var(--green)}
.play-btn{
  width:28px;height:28px;border-radius:50%;border:1px solid var(--line);background:#fff;display:grid;place-items:center;
  cursor:pointer;font-size:11px
}
.play-btn:hover{border-color:var(--pink);color:var(--pink)}
.track-copy{min-width:0}
.track-title{font-size:12px;font-weight:720;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.track-meta{font-size:10px;color:var(--muted);margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.track-right{text-align:right;display:grid;gap:3px}
.track-bpm{font-size:10px;font-weight:700}
.track-length{font-size:9px;color:var(--muted)}
.empty{padding:28px 8px;color:var(--muted);font-size:11px;text-align:center}
.footer-actions{
  display:flex;justify-content:space-between;align-items:center;gap:18px;margin-top:4px;padding:4px 2px 0
}
.footer-actions p{font-size:11px;color:var(--muted);margin:5px 0 0}
.toast{
  position:fixed;left:50%;bottom:24px;transform:translate(-50%,10px);opacity:0;pointer-events:none;
  background:#111;color:#fff;border-radius:999px;padding:9px 14px;font-size:11px;transition:.2s ease;z-index:80
}
.toast.show{opacity:1;transform:translate(-50%,0)}
@media (max-width:980px){
  .site-header{display:flex}.main-nav{display:none}
  .workspace{grid-template-columns:1fr}
  .track-list{max-height:none}
  .intro{align-items:flex-start}
}
@media (max-width:680px){
  :root{--header-h:52px}
  .site-header{padding:0 14px}
  .page-shell{width:min(100% - 20px,var(--max));padding-top:8px}
  .intro{display:grid;margin-bottom:3px}
  .intro-actions{justify-content:flex-start}
  h1{font-size:34px}
  .workspace{gap:8px}
  .control-strip{align-items:flex-start;flex-direction:column}
  .mix-control{width:100%;grid-template-columns:auto 1fr 34px}
  .segment{padding:7px 9px;font-size:10px}
  .footer-actions{align-items:flex-start;flex-direction:column}
}



.video-stage.has-video{
  min-height:0;
  width:max-content;
  max-width:100%;
}
.video-stage.has-video video{
  display:block;
}
.video-stage.has-video .dropzone{
  display:none;
}

@media (max-width:680px){
  .video-stage{
    min-height:220px;
    width:100%;
  }
  .video-stage.has-video{
    min-height:0;
    width:max-content;
    max-width:100%;
  }
  .video-stage video{
    max-width:100%;
    max-height:calc(100vh - 190px);
  }
}

.video-panel{
  width:var(--video-col,100%);
  max-width:100%;
}
.music-panel{
  width:100%;
  min-width:0;
}

.video-panel > .panel-head,
.music-panel > .panel-head{
  padding-left:0;
  padding-right:0;
}
.video-panel .control-strip,
.video-panel .now-playing{
  padding-left:0;
  padding-right:0;
}
.music-panel .search-row,
.music-panel .track-list{
  padding-left:0;
  padding-right:0;
}
.music-panel .match-card{
  margin-left:0;
  margin-right:0;
}

.video-stage{
  width:100%;
}
.video-stage.has-video{
  width:100%;
  max-width:100%;
}
.video-stage.has-video video{
  width:100%;
  height:auto;
  max-width:100%;
  max-height:calc(100vh - 220px);
  object-fit:contain;
}

@media (max-width:900px){
  .workspace{
    grid-template-columns:1fr;
    gap:6px;
  }
  .video-panel{
    width:100%;
  }
}

.brand{
  display:flex;
  align-items:center;
  line-height:1;
}



.madice-logo-img{
  display:block;
  width:132px;
  height:auto;
  max-width:none;
  object-fit:contain;
  border:0;
}
@media (max-width:680px){
  .madice-logo-img{width:116px}
}


/* V15 HEADER ONLY OVERRIDE — all body/workspace layout remains exactly V13 */
.site-header{
  position:sticky;
  top:0;
  z-index:50;
  height:56px;
  display:flex;
  align-items:center;
  padding:0 24px;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(14px);
}
.site-header .brand{
  flex:none;
  display:flex;
  align-items:center;
}
.header-right{
  margin-left:auto;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  justify-content:center;
  gap:2px;
}
.language-row{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  min-height:18px;
}
.site-header .main-nav{
  margin-left:0;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:18px;
  font-size:13px;
}
.lang-btn{
  font-size:11px;
  line-height:1;
  color:var(--muted);
  padding:2px 0;
}
.lang-btn.active{
  color:var(--green);
}
@media (max-width:980px){
  .site-header{
    height:auto;
    min-height:56px;
    padding:6px 14px;
  }
  .header-right{
    min-width:0;
  }
  .site-header .main-nav{
    display:flex;
    max-width:72vw;
    overflow-x:auto;
    white-space:nowrap;
    gap:12px;
  }
}

/* V16 FUNCTION LAYER — V15 visual/workspace geometry remains frozen */
.function-row{
  min-height:30px;
  display:flex;
  align-items:center;
  gap:9px;
  padding:3px 0;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
  overflow-x:auto;
}
.function-label{
  flex:none;
  font-size:9px;
  font-weight:800;
  letter-spacing:.14em;
  color:var(--muted);
  min-width:42px;
}
.mini-action{
  flex:none;
  border:0;
  background:transparent;
  padding:3px 0;
  color:var(--muted);
  font-size:10px;
  font-weight:650;
  cursor:pointer;
  text-decoration:none;
}
.mini-action:hover{color:var(--pink)}
.mini-action.selected{color:var(--green)}
.function-status{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--muted);
  font-size:9px;
}
.ai-video-row{
  min-height:32px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:3px 0;
  border-bottom:1px solid var(--line);
}
.ai-video-row[hidden]{display:none}
.ai-video-row input[type="range"]{width:110px}
.inline-slider{
  display:flex;
  align-items:center;
  gap:6px;
  margin-left:auto;
  font-size:9px;
  color:var(--muted);
}
.inline-slider input{width:90px}
.music-mode-row{
  padding-left:0;
  padding-right:0;
  gap:12px;
}
.analysis-line{
  min-height:24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  color:var(--muted);
  font-size:9px;
  border-bottom:1px solid var(--line);
}
.album-picker{
  padding:4px 0;
  border-bottom:1px solid var(--line);
}
.album-picker select{
  width:100%;
  border:0;
  border-bottom:1px solid var(--line);
  background:#fff;
  color:var(--ink);
  font-size:10px;
  padding:5px 0;
  outline:none;
}
.final-action-group{display:flex;align-items:center;gap:16px}
.action-link:hover{color:var(--pink)}
.final-panel{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:8px 2px 0;
  margin-top:4px;
  border-top:1px solid var(--line);
}
.final-panel[hidden]{display:none}
.final-panel p{margin:3px 0 0;font-size:10px;color:var(--muted)}
@media(max-width:680px){
  .function-row{gap:8px}
  .function-status{display:none}
  .inline-slider{margin-left:0}
  .final-panel{align-items:flex-start;flex-direction:column}
}

#analysisMetrics{
  font-size:13px;
  font-weight:750;
  letter-spacing:.01em;
  color:var(--ink);
}
#analysisState{
  font-size:9px;
  color:var(--muted);
}

#analysisState{
  font-size:13px;
  font-weight:750;
  letter-spacing:.01em;
  color:var(--ink);
}

/* V34 semantic-analysis activity indicator */
#analysisState.semantic-thinking{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:7px;
  color:var(--ink);
  font-weight:750;
}
#analysisState.semantic-thinking::after{
  content:"";
  width:18px;
  height:3px;
  border-radius:999px;
  background:linear-gradient(90deg,var(--green),var(--pink),var(--green));
  background-size:200% 100%;
  animation:semanticSweep 1.15s linear infinite;
}
#analysisState.semantic-thinking{
  animation:semanticPulse 1.4s ease-in-out infinite;
}
@keyframes semanticSweep{
  0%{background-position:200% 0}
  100%{background-position:-200% 0}
}
@keyframes semanticPulse{
  0%,100%{opacity:.58}
  50%{opacity:1}
}
@media (prefers-reduced-motion:reduce){
  #analysisState.semantic-thinking,
  #analysisState.semantic-thinking::after{
    animation:none;
  }
}

/* V36 portrait-video spacing: video keeps its own ratio, controls keep readable width */
@media (min-width:901px){
  .workspace{
    grid-template-columns:minmax(360px,var(--video-col,1fr)) minmax(300px,360px);
  }
  .video-panel{
    min-width:360px;
  }
  .video-stage.has-video{
    width:auto;
    max-width:100%;
  }
  .video-stage.has-video video{
    width:auto;
    max-width:100%;
    height:auto;
    display:block;
  }
  .function-row,
  .control-strip,
  .now-playing{
    min-width:360px;
    white-space:normal;
    overflow:visible;
    flex-wrap:wrap;
  }
  .mini-action,
  .segment,
  .function-status{
    white-space:nowrap;
  }
}

#musicCreateStatusRow{
  color:var(--muted);
}
#musicCreateStatus{
  font-weight:750;
  color:var(--ink);
}
#createNewMusicBtn:disabled{
  opacity:.45;
  cursor:wait;
}

/* V38 in-page authentication */
.auth-modal[hidden]{display:none}
.auth-modal{
  position:fixed;
  inset:0;
  z-index:200;
  background:rgba(255,255,255,.82);
  backdrop-filter:blur(10px);
  display:grid;
  place-items:center;
  padding:20px;
}
.auth-box{
  width:min(360px,92vw);
  background:#fff;
  border:1px solid var(--line);
  padding:16px;
}
.auth-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:12px;
}
.auth-input{
  width:100%;
  height:38px;
  border:0;
  border-bottom:1px solid var(--line-strong);
  background:#fff;
  color:var(--ink);
  outline:none;
  padding:0;
  margin-bottom:10px;
  font-size:13px;
}
.auth-input:focus{border-bottom-color:var(--green)}
.auth-submit{margin-top:4px}
.auth-status{
  min-height:18px;
  margin-top:10px;
  font-size:11px;
  color:var(--muted);
}
.auth-status.error{color:var(--pink)}
.auth-status.ok{color:var(--green)}
.auth-foot{
  margin-top:10px;
  font-size:11px;
}

.auth-tabs{
  display:flex;
  gap:18px;
  margin:0 0 12px;
  border-bottom:1px solid var(--line);
}
.auth-tab{
  padding:4px 0 7px;
  color:var(--muted);
}
.auth-tab.active{color:var(--green)}
#authRegisterPane[hidden],#authLoginPane[hidden]{display:none}
.auth-terms{
  display:flex;
  align-items:flex-start;
  gap:7px;
  margin:4px 0 10px;
  font-size:10px;
  color:var(--muted);
  line-height:1.35;
}
.auth-terms input{margin:1px 0 0}

.auth-session-btn{
  margin-left:4px;
  font-size:11px;
  color:var(--muted);
}
.auth-session-btn:hover{color:var(--pink)}

/* V52: ONLY the generated-music ready control */
.generated-ready[hidden]{display:none}
.generated-ready{
  display:flex;
  align-items:center;
  gap:9px;
  padding:7px 0 8px;
  border-bottom:1px solid var(--line);
}
.generated-ready strong{
  font-size:18px;
  line-height:1;
  font-weight:800;
  letter-spacing:-.02em;
  color:var(--ink);
}
.generated-play{
  flex:none;
  border:0;
  background:transparent;
  color:var(--green);
  padding:0;
  font-size:18px;
  line-height:1;
  cursor:pointer;
}
.generated-play:hover{color:var(--pink)}

/* V56 — fine-line sliders only */
input[type="range"]{
  -webkit-appearance:none;
  appearance:none;
  height:14px;
  background:transparent;
  cursor:pointer;
}

/* WebKit / Chrome / Safari */
input[type="range"]::-webkit-slider-runnable-track{
  height:1px;
  background:var(--line-strong);
  border:0;
  border-radius:0;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:2px;
  height:14px;
  margin-top:-6.5px;
  border:0;
  border-radius:0;
  background:var(--green);
  box-shadow:none;
}

/* Firefox */
input[type="range"]::-moz-range-track{
  height:1px;
  background:var(--line-strong);
  border:0;
  border-radius:0;
}
input[type="range"]::-moz-range-progress{
  height:1px;
  background:var(--green);
  border:0;
  border-radius:0;
}
input[type="range"]::-moz-range-thumb{
  width:2px;
  height:14px;
  border:0;
  border-radius:0;
  background:var(--green);
  box-shadow:none;
}

/* remove any previous thick accent treatment */
input[type="range"]{
  accent-color:var(--green);
}


/* V65 — page background theme selector only */
.theme-selector{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-left:8px;
  vertical-align:middle;
}
.theme-dot{
  width:10px;
  height:10px;
  min-width:10px;
  padding:0;
  border-radius:50%;
  border:1px solid currentColor;
  cursor:pointer;
  appearance:none;
  box-shadow:none;
}
.theme-dot.theme-white{ background:#fff; border-color:#9a9a9a; }
.theme-dot.theme-black{ background:#000; border-color:#000; }
.theme-dot.theme-gray{ background:#8b8b8b; border-color:#8b8b8b; }
.theme-dot.is-active{ outline:1px solid #00c853; outline-offset:2px; }

/* Only background/text theme variables. Functional styles stay untouched. */
html[data-page-theme="white"] body{
  background:#fff;
  color:#000;
}
html[data-page-theme="gray"] body{
  background:#8b8b8b;
  color:#000;
}
html[data-page-theme="black"] body{
  background:#000;
  color:#fff;
}

/* Black theme: all visible interface text becomes white. */
html[data-page-theme="black"] body,
html[data-page-theme="black"] body *:not(.theme-dot){
  color:#fff;
}

/* Keep form surfaces readable while following the selected page background. */
html[data-page-theme="black"] input,
html[data-page-theme="black"] textarea,
html[data-page-theme="black"] select,
html[data-page-theme="black"] button:not(.theme-dot){
  background-color:#000;
  color:#fff;
}
html[data-page-theme="gray"] input,
html[data-page-theme="gray"] textarea,
html[data-page-theme="gray"] select,
html[data-page-theme="gray"] button:not(.theme-dot){
  background-color:#8b8b8b;
}

/* Preserve selected green and hover pink rules. */
html[data-page-theme="black"] .selected,
html[data-page-theme="black"] .active,
html[data-page-theme="black"] [aria-selected="true"]{
  color:#00c853 !important;
}


/* V66 — BLACK/WHITE theme + standard MADICE accent colors only */
:root{
  --green:#00E85A;
  --pink:#FF2D8D;
}

/* Gray option removed */
.theme-dot.theme-gray{ display:none !important; }

/* Stronger, cleaner theme dots */
.theme-dot.theme-white{
  background:#fff !important;
  border-color:#9a9a9a !important;
}
.theme-dot.theme-black{
  background:#000 !important;
  border-color:#000 !important;
}
.theme-dot.is-active{
  outline:2px solid var(--green) !important;
  outline-offset:2px;
}

/* BLACK MODE — all interface text must be white */
html[data-page-theme="black"],
html[data-page-theme="black"] body{
  background:#000 !important;
  color:#fff !important;
}

html[data-page-theme="black"] body *:not(.theme-dot){
  color:#fff !important;
}

/* Keep all visible surfaces black so no dark text remains on light boxes */
html[data-page-theme="black"] header,
html[data-page-theme="black"] main,
html[data-page-theme="black"] section,
html[data-page-theme="black"] article,
html[data-page-theme="black"] nav,
html[data-page-theme="black"] aside,
html[data-page-theme="black"] footer,
html[data-page-theme="black"] .panel,
html[data-page-theme="black"] .card,
html[data-page-theme="black"] .track,
html[data-page-theme="black"] .ai-pick,
html[data-page-theme="black"] input,
html[data-page-theme="black"] textarea,
html[data-page-theme="black"] select,
html[data-page-theme="black"] button:not(.theme-dot){
  background-color:#000 !important;
}

/* Standard green selected / active states */
html body .selected,
html body .active,
html body [aria-selected="true"],
html body [aria-pressed="true"]:not(.theme-dot),
html body .track.selected,
html body .track.playing,
html body .segment.active,
html body .segment.selected,
html body .mode.active{
  color:var(--green) !important;
}

/* Standard MADICE hover/link accent */
html body a:hover,
html body button:not(.theme-dot):hover,
html body .track:hover,
html body .mini-action:hover,
html body .text-action:hover{
  color:var(--pink) !important;
}

/* Explicit black-theme exceptions for active/selected accents */
html[data-page-theme="black"] body .selected,
html[data-page-theme="black"] body .active,
html[data-page-theme="black"] body [aria-selected="true"],
html[data-page-theme="black"] body [aria-pressed="true"]:not(.theme-dot),
html[data-page-theme="black"] body .track.selected,
html[data-page-theme="black"] body .track.playing,
html[data-page-theme="black"] body .segment.active,
html[data-page-theme="black"] body .segment.selected,
html[data-page-theme="black"] body .mode.active{
  color:var(--green) !important;
}

html[data-page-theme="black"] body a:hover,
html[data-page-theme="black"] body button:not(.theme-dot):hover,
html[data-page-theme="black"] body .track:hover,
html[data-page-theme="black"] body .mini-action:hover,
html[data-page-theme="black"] body .text-action:hover{
  color:var(--pink) !important;
}

/* Inputs in black theme */
html[data-page-theme="black"] input::placeholder,
html[data-page-theme="black"] textarea::placeholder{
  color:rgba(255,255,255,.62) !important;
}


/* V67 — Save Final Video module only */
.final-save-module{
  margin-top:18px;
  padding-top:10px;
  border-top:1px solid currentColor;
}
.final-save-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.final-save-btn{
  font-weight:700;
}
.final-save-status{
  margin-top:6px;
  font-size:11px;
  opacity:.68;
}
.final-save-progress{
  height:1px;
  margin-top:8px;
  background:rgba(127,127,127,.35);
  overflow:hidden;
}
.final-save-progress-bar{
  width:0%;
  height:100%;
  background:var(--green,#00E85A);
  transition:width .15s linear;
}
.final-save-download{
  display:inline-block;
  margin-top:8px;
  font-size:12px;
  color:var(--pink,#FF2D8D);
  text-decoration:none;
}
.final-save-download:hover{
  color:var(--green,#00E85A) !important;
}

/* V72 — MADICE cosmic workspace. Functional geometry and element IDs stay intact. */
:root{
  --bg:#000;
  --ink:#f6f4ff;
  --muted:rgba(226,222,240,.58);
  --line:rgba(203,192,238,.13);
  --line-strong:rgba(214,204,244,.25);
  --soft:rgba(12,9,22,.72);
  --green:#86efff;
  --pink:#ff69d4;
  --header-h:66px;
}
html,body{min-height:100%;background:#000;color:var(--ink)}
body{position:relative;overflow-x:hidden}
.madice-sky{position:fixed;inset:0;z-index:0;overflow:hidden;background:#000;pointer-events:none}
.madice-sky:after{content:"";position:absolute;inset:0;background:radial-gradient(circle at 44% 24%,rgba(47,25,85,.16),transparent 34%),linear-gradient(180deg,rgba(0,0,0,.04),rgba(0,0,0,.48))}
.madice-stars{position:absolute;inset:0}
.madice-star{position:absolute;border-radius:50%;background:currentColor;box-shadow:0 0 7px currentColor,0 0 15px color-mix(in srgb,currentColor 38%,transparent);animation:madiceTwinkle 4.8s ease-in-out infinite}
.madice-star.named-star{width:28px;height:28px;margin:0;padding:0;border:0;background:transparent;box-shadow:none;transform:translate(-50%,-50%);animation:none;pointer-events:none;overflow:visible}
.madice-star.named-star:before{content:"";position:absolute;left:50%;top:50%;width:var(--madice-star-size,2px);height:var(--madice-star-size,2px);border-radius:50%;background:currentColor;box-shadow:0 0 7px currentColor,0 0 15px color-mix(in srgb,currentColor 38%,transparent);transform:translate(-50%,-50%);animation:madiceNamedTwinkle 4.8s ease-in-out infinite}
.madice-star.named-star:after{content:attr(data-name);position:absolute;left:50%;bottom:calc(100% + 4px);min-width:max-content;max-width:180px;padding:0;color:#fff;background:transparent;border:0;box-shadow:none;text-shadow:0 0 7px currentColor,0 2px 4px #000;font:500 10px/1 var(--font);letter-spacing:.05em;white-space:nowrap;opacity:0;pointer-events:none;transform:translate(-50%,5px) scale(.96);transition:opacity .18s ease,transform .18s ease}
.madice-star.named-star[data-active="true"]:after{opacity:1;transform:translate(-50%,0) scale(1)}
.starry-night .madice-star.named-star{pointer-events:auto;cursor:pointer}
.starry-night .madice-star.named-star:focus-visible{outline:1px solid rgba(255,255,255,.72);outline-offset:1px}
@keyframes madiceTwinkle{0%,100%{opacity:.28;transform:scale(.78)}50%{opacity:.96;transform:scale(1.14)}}
@keyframes madiceNamedTwinkle{0%,100%{opacity:.28;transform:translate(-50%,-50%) scale(.78)}50%{opacity:.96;transform:translate(-50%,-50%) scale(1.14)}}
.site-header,.page-shell,.auth-modal,.toast{position:relative;z-index:2}
.site-header{height:var(--header-h);padding:0 clamp(18px,4vw,68px);background:rgba(0,0,0,.74)!important;border-bottom:1px solid var(--line);backdrop-filter:blur(18px)}
.site-header .brand{font-size:17px;font-weight:700;letter-spacing:.34em;color:#fff!important}
.main-nav{margin-left:auto!important;gap:clamp(13px,1.7vw,28px)!important}
.nav-link{height:auto;padding:0;border:0;background:transparent!important;color:rgba(255,255,255,.58)!important;font-size:11px!important;letter-spacing:.08em;cursor:pointer;white-space:nowrap}
.nav-link.active{color:#fff!important}.theme-selector{display:none!important}
.page-tools{height:22px;display:flex;justify-content:flex-end;align-items:center;gap:12px;margin-bottom:4px}.page-tools .text-btn{font-size:10px!important;color:rgba(255,255,255,.42)!important}.page-tools .lang-btn.active{color:#a995ff!important}
.starry-close{position:fixed;z-index:120;right:26px;top:20px;border:0;background:transparent!important;color:rgba(255,255,255,.72)!important;font:300 27px/1 var(--font);cursor:pointer;opacity:0;visibility:hidden;pointer-events:none}
body.starry-night{overflow:hidden}.starry-night .site-header,.starry-night .page-shell,.starry-night .auth-modal,.starry-night .toast{opacity:0;visibility:hidden;pointer-events:none}.starry-night .madice-sky{z-index:100}.starry-night .starry-close{opacity:1;visibility:visible;pointer-events:auto}
.page-shell{width:min(1520px,calc(100% - clamp(28px,6vw,92px)));padding:30px 0 44px}
.intro{margin:0 0 22px;padding:0 0 18px;border-bottom:1px solid var(--line)}
.eyebrow{color:#a58cff!important;margin-bottom:9px}.intro h1{font-size:clamp(28px,3vw,50px);font-weight:500;letter-spacing:-.045em;background:linear-gradient(90deg,#92eaff,#b99cff 46%,#ff8bdc);-webkit-background-clip:text;background-clip:text;color:transparent!important}
.subcopy{margin-top:9px;color:var(--muted)!important;max-width:680px;line-height:1.55}
.workspace{grid-template-columns:minmax(440px,1fr) minmax(320px,390px);gap:clamp(28px,4vw,64px)}
.video-panel,.music-panel{background:transparent!important}
.panel-head{padding:0;height:42px;border-bottom:1px solid var(--line)}
.panel-kicker,.function-label,.footer-label,.match-label{color:rgba(191,177,235,.72)!important;letter-spacing:.19em}
.panel-status,.function-status,.now-meta,.analysis-line,#analysisState,.track-meta,.track-length{color:var(--muted)!important}
.video-stage{min-height:clamp(330px,48vh,610px);border-bottom:1px solid var(--line);background:radial-gradient(circle at 50% 42%,rgba(59,35,93,.12),transparent 54%)}
.dropzone{color:rgba(255,255,255,.74)!important}.drop-icon{border:0;width:48px;height:48px;font-size:30px;color:#ad9cff!important;text-shadow:0 0 18px rgba(173,156,255,.45)}
.clip-editor{padding:13px 0 5px;border-bottom:1px solid var(--line)}
.clip-editor-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:10px}
.clip-editor-head>div{display:flex;align-items:center;gap:12px}.clip-count{font-size:10px;color:var(--muted)}
.clip-editor-actions{display:flex!important;align-items:center;gap:16px!important}.edit-preview-btn:not(:disabled){color:#8ff3ff!important;text-shadow:0 0 12px rgba(143,243,255,.28)}
.clip-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.clip-item{position:relative;min-width:0;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:7px;padding:9px 22px 9px 0;border:0;border-bottom:1px solid var(--line);background:transparent!important;color:rgba(255,255,255,.58)!important;text-align:left;cursor:pointer}
.clip-item:hover,.clip-item.active{border-bottom-color:rgba(154,238,255,.62);color:#fff!important}
.clip-item.active .clip-index{color:#91efff!important}.clip-index{font:700 9px/1 var(--font);letter-spacing:.12em;color:#a995ff!important}
.clip-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px}.clip-duration{font-size:9px;color:var(--muted)!important}
.clip-remove{position:absolute;right:1px;top:50%;transform:translateY(-50%);font-size:16px;color:rgba(255,255,255,.34)!important}.clip-remove:hover{color:#ff69d4!important}
.edit-intelligence{min-height:32px;display:flex;align-items:center;gap:9px;padding-top:9px;font-size:10px;color:var(--muted)}
.edit-intelligence-primary{padding:8px 0 10px;margin-bottom:2px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.edit-intelligence #editMetrics{margin-left:auto;color:rgba(178,165,220,.66)!important}.edit-pulse{width:5px;height:5px;border-radius:50%;background:#8ff3ff;box-shadow:0 0 9px #8ff3ff}
.edit-intelligence.working .edit-pulse{animation:editPulse .8s ease-in-out infinite alternate}@keyframes editPulse{to{transform:scale(1.9);opacity:.35}}
.function-row,.analysis-line,.album-picker,.control-strip,.generated-ready,.final-panel,.final-save-module{border-color:var(--line)}
.mini-action,.segment,.text-btn,.upload-link{color:rgba(255,255,255,.55)!important}.mini-action.selected,.segment.active,.text-btn.emphasis:not(:disabled){color:#8ff3ff!important}
.now-playing{padding:8px 0;min-height:54px;border-bottom:1px solid var(--line)}
.pulse-dot{background:#7f6d9e}.now-playing.active .pulse-dot{background:#9bf4ff;box-shadow:0 0 13px #65eaff}
.search-row{height:42px;padding:5px 0}.search-row input,.auth-input{background:transparent!important;border:0;border-bottom:1px solid var(--line-strong);border-radius:0;color:#fff!important;padding-left:0}
.search-row input:focus,.auth-input:focus{border-bottom-color:#9d8cff}.icon-btn{right:0}
.album-picker select{background:transparent!important;color:#fff!important;border-color:var(--line-strong)}
.match-card{margin:8px 0 2px;padding:12px 0;border:0;border-bottom:1px solid var(--line);border-radius:0}
.match-score{color:#9bf4ff!important}.track-list{padding:0;max-height:560px;scrollbar-width:thin;scrollbar-color:rgba(170,150,235,.35) transparent}
.track{border-color:var(--line);padding:7px 0}.play-btn{border:0;background:transparent!important;color:rgba(255,255,255,.62)!important}
.footer-actions{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)}
.solid-btn{color:#fff!important;border-bottom:1px solid rgba(153,232,255,.55);padding:7px 0}.solid-btn:disabled{opacity:.35}
.auth-modal{position:fixed;background:rgba(0,0,0,.76)!important}.auth-box{background:rgba(5,3,12,.96)!important;border:1px solid var(--line-strong);box-shadow:0 24px 90px rgba(73,38,116,.22)}
.toast{position:fixed;background:rgba(15,10,25,.94);border:1px solid var(--line);color:#fff}
input[type="range"]::-webkit-slider-runnable-track{background:var(--line-strong)}input[type="range"]::-webkit-slider-thumb{background:#9cf4ff}
@media(max-width:1050px){.site-header{height:auto;min-height:66px;padding-top:9px;padding-bottom:9px}.main-nav{max-width:72vw;overflow-x:auto}.workspace{grid-template-columns:1fr}.music-panel{margin-top:20px}}
@media(max-width:720px){.site-header{align-items:flex-start}.main-nav{max-width:72vw}.page-shell{width:calc(100% - 28px);padding-top:22px}.workspace{display:block}.video-stage{min-height:260px}.intro h1{font-size:34px}.footer-actions{align-items:flex-start}.final-action-group{flex-wrap:wrap}.clip-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.edit-intelligence{align-items:flex-start;flex-wrap:wrap}.edit-intelligence #editMetrics{width:100%;margin-left:14px}}

/* V77 — Stone Match is the second MADICE surface, not a separate landing page. */
.site-header .product-identity{
  display:flex;align-items:center;gap:9px;margin-left:22px;padding-left:22px;
  border-left:1px solid var(--line);color:rgba(255,255,255,.82);
  font-size:12px;font-weight:500;letter-spacing:.055em;white-space:nowrap
}
.product-identity img{
  width:25px;height:25px;display:block;object-fit:contain;
  filter:drop-shadow(0 0 8px rgba(113,118,255,.42));
  animation:productIdentityBreath 7s ease-in-out infinite
}
@keyframes productIdentityBreath{0%,100%{transform:scale(.96);filter:hue-rotate(0deg) saturate(1.02) drop-shadow(0 0 7px rgba(113,118,255,.38))}50%{transform:scale(1.04);filter:hue-rotate(28deg) saturate(1.16) drop-shadow(0 0 11px rgba(255,90,213,.38))}}
.page-shell{padding-top:5px}
.page-tools{height:18px;margin:0 0 1px}
.workspace{margin-top:0}
.video-stage{min-height:clamp(390px,61vh,720px)}
.video-stage video{max-height:calc(100vh - 150px)}
@media(max-width:1050px){
  .site-header .product-identity{margin-left:14px;padding-left:14px}
  .product-identity span{display:none}
  .page-shell{padding-top:4px}
}
@media(max-width:720px){
  .site-header{align-items:center}
  .site-header .product-identity{display:flex;margin-left:10px;padding-left:10px}
  .main-nav{max-width:58vw}
  .page-shell{padding-top:3px}
  .page-tools{height:20px}
  .video-stage{min-height:330px}
}
@media(prefers-reduced-motion:reduce){.product-identity img{animation:none}}

/* Transparent cosmic workspace: every Stone Match surface belongs to one sky. */
html[data-page-theme="black"] header,
html[data-page-theme="black"] main,
html[data-page-theme="black"] section,
html[data-page-theme="black"] article,
html[data-page-theme="black"] nav,
html[data-page-theme="black"] aside,
html[data-page-theme="black"] footer,
html[data-page-theme="black"] .panel,
html[data-page-theme="black"] .card,
html[data-page-theme="black"] .track,
html[data-page-theme="black"] .ai-pick,
html[data-page-theme="black"] input,
html[data-page-theme="black"] textarea,
html[data-page-theme="black"] select,
html[data-page-theme="black"] button:not(.theme-dot){background-color:transparent!important}
.site-header{background:rgba(0,0,0,.22)!important;backdrop-filter:blur(7px)}
.page-shell{background:rgba(0,0,0,.08)!important}
.video-panel,.music-panel,.video-stage,.function-row,.control-strip,.now-playing,.search-row,.album-picker,.match-card,.track-list,.track,.final-panel,.final-save-module{background:transparent!important}
.video-stage{background:radial-gradient(circle at 50% 42%,rgba(71,39,116,.09),transparent 58%)!important}
.auth-modal{background:rgba(0,0,0,.34)!important;backdrop-filter:blur(8px)}
.auth-box{background:rgba(5,3,12,.72)!important;backdrop-filter:blur(16px)}
.toast{background:rgba(9,5,18,.72)!important;backdrop-filter:blur(12px)}
@media(prefers-reduced-motion:reduce){.madice-star{animation:none}}

/* V80 — visible activity directly beneath the player while AI editing works. */
.edit-workline{display:flex;align-items:center;gap:12px;min-height:27px;padding:7px 0 5px;color:rgba(190,181,214,.58);font-size:9px;letter-spacing:.12em;text-transform:uppercase}
.edit-workline-track{position:relative;display:block;flex:1;height:2px;overflow:hidden;background:rgba(142,125,183,.16);box-shadow:0 0 7px rgba(91,213,255,.07)}
.edit-workline-track i{position:absolute;inset:0;display:block;opacity:.25;background:linear-gradient(90deg,transparent 0%,#38e7ff 18%,#725cff 38%,#ff42cd 58%,#ffb52c 76%,#55ffbd 90%,transparent 100%);background-size:220% 100%;transform:scaleX(.08);transform-origin:left center;transition:transform .55s ease,opacity .4s ease,filter .4s ease}
.edit-workline[data-state="working"]{color:rgba(223,218,239,.82)}
.edit-workline[data-state="working"] .edit-workline-track i{opacity:1;transform:scaleX(1);filter:saturate(1.25);animation:madiceWorkFlow 1.45s linear infinite}
.edit-workline[data-state="complete"]{color:rgba(139,238,220,.74)}
.edit-workline[data-state="complete"] .edit-workline-track i{opacity:.72;transform:scaleX(1);background-position:100% 0;filter:saturate(.82)}
.edit-workline[data-state="error"]{color:rgba(255,142,190,.78)}
.edit-workline[data-state="error"] .edit-workline-track i{opacity:.7;transform:scaleX(1);background:linear-gradient(90deg,#ff498d,#ff8a5b)}
@keyframes madiceWorkFlow{0%{background-position:220% 0}100%{background-position:-120% 0}}
@media(prefers-reduced-motion:reduce){.edit-workline[data-state="working"] .edit-workline-track i{animation:none;background-position:50% 0}}

/* V81 — beat-led motion language for the complete multi-clip edit. */
.video-stage.edit-cut{overflow:hidden}
.video-stage.edit-cut video{will-change:transform,filter,opacity;transform-origin:center center}
.video-stage.edit-cut[data-edit-effect="push-in"] video{animation:editPushIn 3s cubic-bezier(.2,.7,.2,1) both}
.video-stage.edit-cut[data-edit-effect="whip-left"] video{animation:editWhipLeft .42s cubic-bezier(.12,.78,.18,1) both}
.video-stage.edit-cut[data-edit-effect="whip-right"] video{animation:editWhipRight .42s cubic-bezier(.12,.78,.18,1) both}
.video-stage.edit-cut[data-edit-effect="pulse"] video{animation:editPulseCut 1.2s ease-out both}
.video-stage.edit-cut[data-edit-effect="lift"] video{animation:editLift 2.8s cubic-bezier(.2,.75,.2,1) both}
.video-stage.edit-cut[data-edit-effect="cinema"] video{animation:editCinema 3.4s ease-out both}
@keyframes editPushIn{0%{opacity:.25;transform:scale(1.08);filter:brightness(1.5) saturate(1.3)}12%{opacity:1}100%{transform:scale(1);filter:none}}
@keyframes editWhipLeft{0%{opacity:.2;transform:translateX(9%) scale(1.06);filter:blur(8px) brightness(1.5)}100%{opacity:1;transform:none;filter:none}}
@keyframes editWhipRight{0%{opacity:.2;transform:translateX(-9%) scale(1.06);filter:blur(8px) brightness(1.5)}100%{opacity:1;transform:none;filter:none}}
@keyframes editPulseCut{0%{opacity:.15;transform:scale(.96);filter:brightness(2) saturate(1.45)}18%{opacity:1;transform:scale(1.035)}100%{transform:none;filter:none}}
@keyframes editLift{0%{opacity:.35;transform:translateY(4%) scale(1.06);filter:brightness(1.3)}16%{opacity:1}100%{transform:none;filter:none}}
@keyframes editCinema{0%{opacity:.25;transform:scale(1.025);filter:contrast(1.18) saturate(.7)}18%{opacity:1}100%{transform:scale(1.06);filter:none}}
@media(prefers-reduced-motion:reduce){.video-stage.edit-cut video{animation:none!important}}
