:root{
  /* Premium dark theme – deep space with electric blue accent */
  --bg: #080b12;
  --bg-alt: #0d1117;
  --accent: #3b82f6;
  --accent2: #60a5fa;
  --accent-soft: rgba(59,130,246,0.18);
  --accent2-soft: rgba(96,165,250,0.12);
  --panel: rgba(255,255,255,0.04);
  --panel2: rgba(255,255,255,0.08);
  --border: rgba(59,130,246,0.15);
  --text: #f1f5f9;
  --muted: rgba(255,255,255,0.5);
  --shadow: 0 24px 80px rgba(0,0,0,0.7);
  --scroll-track: rgba(255,255,255,0.03);
  --scroll-thumb: rgba(59,130,246,0.25);
  --scroll-thumb-hover: rgba(59,130,246,0.4);
  --glow: 0 0 80px 16px rgba(59,130,246,0.12), 0 0 120px 40px rgba(96,165,250,0.08);
}

html[data-theme="light"]{
  /* Bright light theme – clean white with vivid orange accents */
  --bg: #fefefe;
  --bg-alt: #fff7ed;
  --accent: #ea580c;
  --accent2: #f97316;
  --accent-soft: rgba(234,88,12,0.16);
  --accent2-soft: rgba(249,115,22,0.12);
  --panel: rgba(0,0,0,0.025);
  --panel2: rgba(0,0,0,0.05);
  --border: rgba(234,88,12,0.15);
  --text: #1c1917;
  --muted: rgba(0,0,0,0.55);
  --shadow: 0 24px 64px rgba(234,88,12,0.10), 0 8px 24px rgba(0,0,0,0.06);
  --scroll-track: rgba(0,0,0,0.03);
  --scroll-thumb: rgba(234,88,12,0.25);
  --scroll-thumb-hover: rgba(234,88,12,0.4);
  --glow: 0 0 80px 16px rgba(234,88,12,0.12), 0 0 120px 40px rgba(249,115,22,0.08);
}

html[data-theme="dark"]{ color-scheme: dark; }
html[data-theme="light"]{ color-scheme: light; }

*{box-sizing:border-box}

/* Subtle, consistent scrollbars (where supported) */
*{scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--scroll-track);}
*::-webkit-scrollbar{width:10px; height:10px;}
*::-webkit-scrollbar-track{background: var(--scroll-track); border-radius:999px;}
*::-webkit-scrollbar-thumb{background: var(--scroll-thumb); border-radius:999px; border:2px solid transparent; background-clip: content-box;}
*::-webkit-scrollbar-thumb:hover{background: var(--scroll-thumb-hover); background-clip: content-box;}

body{
  margin:0;
  font-family: 'Inter', ui-sans-serif, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s, color 0.25s;
}

/* Ambient gradient orbs – aurora-like glow */
body::before{
  content:'';
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(1000px 800px at 10% -10%, var(--accent-soft), transparent 50%),
    radial-gradient(800px 700px at 90% 100%, var(--accent2-soft), transparent 45%),
    radial-gradient(600px 500px at 50% 50%, var(--accent-soft), transparent 60%);
  z-index:-1;
  opacity: 0.85;
}

.app-shell{min-height:100vh; display:flex; flex-direction:column;}

.topbar{
  height:60px;
  display:flex;
  align-items:center;
  padding:0 20px;
  border-bottom:1px solid var(--border);
  backdrop-filter: blur(16px);
  background: var(--bg-alt);
  box-shadow: var(--glow);
}
.topbar-spacer{flex:1}

.icon-btn{
  border:1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  width:42px;
  height:42px;
  border-radius:12px;
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.icon-btn:hover{ background: var(--accent-soft); border-color: var(--accent); color: var(--accent); box-shadow: 0 2px 10px var(--accent-soft); }
.icon-btn:active{ transform: scale(0.94); }
.icon{font-size:17px; opacity:0.88;}

.main{flex:1; display:flex; justify-content:center; padding:24px 14px 40px;}
@media (max-width: 520px){
  .main{padding:16px 10px 28px;}
}
.page{width:min(920px, 100%); display:none;}
.page-active{display:block;}

.composer{
  position:relative;
  border:1px solid var(--border);
  background: var(--bg-alt);
  border-radius:22px;
  box-shadow: var(--shadow), var(--glow);
  padding:20px;
  transition: box-shadow 0.25s;
}

.composer-title{
  font-size:13px;
  font-weight:600;
  letter-spacing:0.12em;
  text-transform:uppercase;
  color: var(--accent);
  margin:0 0 12px 4px;
}

.composer-input{
  width:100%;
  resize:vertical;
  min-height: clamp(200px, 32vh, 480px);
  max-height: 68vh;
  border-radius:16px;
  border:1px solid var(--border);
  padding:16px 18px;
  background: var(--panel);
  color: var(--text);
  outline:none;
  font-size:15px;
  line-height:1.6;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.composer-input:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
html[data-theme="light"] .composer-input{ background: #fff; }

.composer-input::placeholder{color: var(--muted); opacity:0.8;}

.composer-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:14px;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid var(--border);
  background: var(--panel);
}

.bar-left{display:flex; align-items:center; gap:10px;}
.bar-right{display:flex; align-items:center; gap:10px;}

.pill{
  border:1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius:999px;
  padding:10px 16px;
  cursor:pointer;
  font-size:13px;
  font-weight:500;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.pill-small{
  padding:8px 12px;
  font-size:12px;
}
.pill:hover{ background: var(--accent-soft); border-color: var(--accent); color: var(--accent); box-shadow: 0 2px 12px var(--accent-soft); }

.voice-wrap{position:relative;}
.menu{
  position:absolute;
  left:0;
  top:44px;
  width:280px;
  border:1px solid var(--border);
  background: rgba(20,24,32,0.92);
  backdrop-filter: blur(14px);
  border-radius:14px;
  box-shadow: var(--shadow);
  overflow:hidden;
  display:none;
  z-index:10;
}
html[data-theme="light"] .menu{ background: rgba(255,255,255,0.92); }
.menu-open{display:block;}

.menu-head{display:flex; align-items:center; justify-content:space-between; padding:10px 10px; border-bottom:1px solid var(--border);}
.menu-title{font-size:12px; letter-spacing:0.08em; text-transform:uppercase; color: var(--muted);}
.menu-list{max-height:280px; overflow:auto;}

.menu-item{
  width:100%;
  text-align:left;
  border:0;
  background: transparent;
  color: var(--text);
  padding:10px 12px;
  cursor:pointer;
  font-size:14px;
}
.menu-item:hover{ background: rgba(255,255,255,0.06); }
html[data-theme="light"] .menu-item:hover{ background: rgba(0,0,0,0.06); }

.send{
  width:48px;
  height:48px;
  border-radius:14px;
  border:none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  cursor:pointer;
  font-size:18px;
  display:grid;
  place-items:center;
  transition: transform 0.15s, box-shadow 0.25s;
  box-shadow: 0 6px 24px var(--accent-soft), 0 2px 8px rgba(0,0,0,0.2);
}
.send:hover{ transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 32px var(--accent-soft), 0 4px 12px rgba(0,0,0,0.15); }
.send:active{ transform: scale(0.94); }

.countdown{position:relative; width:44px; height:44px;}
.countdown-ring{
  position:absolute; inset:0;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,0.05);
}
.countdown-text{position:absolute; inset:0; display:grid; place-items:center; font-size:12px; color: var(--text);}

.drop-hint{
  position:absolute;
  inset:12px;
  border-radius:18px;
  border:2px dashed var(--accent);
  background: var(--accent-soft);
  display:grid;
  place-items:center;
  color: var(--accent);
  font-weight:600;
  font-size:15px;
  pointer-events:none;
}
.drop-hint[hidden]{display:none;}

.result{
  margin-top:20px;
  border:1px solid var(--border);
  background: var(--bg-alt);
  border-radius:22px;
  box-shadow: var(--shadow), var(--glow);
  padding:18px;
}

.result-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px;}
.result-title{font-size:12px; font-weight:600; letter-spacing:0.12em; text-transform:uppercase; color: var(--accent);}

.viz-wrap{border-radius:16px; border:1px solid var(--border); background: var(--panel); overflow:hidden;}
html[data-theme="light"] .viz-wrap{ background: #fff; }
.viz{width:100%; display:block;}

.audio{width:100%; margin-top:10px; color-scheme: inherit;}

.clone{
  border:1px solid var(--border);
  background: rgba(255,255,255,0.04);
  border-radius:18px;
  box-shadow: var(--shadow);
  padding:18px;
}
.clone-title{font-size:14px; letter-spacing:0.08em; text-transform:uppercase; color: var(--muted); margin-bottom:10px;}
.clone-body{color: var(--text); line-height:1.55;}

.clone-upload{
  border:1px solid var(--border);
  background: var(--bg-alt);
  border-radius:18px;
  padding:14px;
  margin-top:10px;
}
.clone-upload-title{font-size:12px; font-weight:600; letter-spacing:0.12em; text-transform:uppercase; color: var(--accent);}
.clone-upload-sub{margin-top:6px; color: var(--muted); font-size:13px;}
.clone-upload-row{display:flex; align-items:center; gap:10px; margin-top:12px; flex-wrap:wrap;}
.clone-file{color: var(--text); opacity:0.9; font-size:13px;}

.clone-actions{display:flex; align-items:center; gap:10px; margin-top:14px; flex-wrap:wrap;}
.clone-status{margin-top:12px; color: var(--muted); font-size:13px; min-height:18px;}
.clone-audio{margin-top:14px;}

.footer{
  height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  border-top:1px solid var(--border);
  background: var(--bg-alt);
  color: var(--muted);
  font-size:13px;
  padding:0 20px;
}
.footer-link{color: var(--muted); text-decoration:none; transition: color 0.15s;}
.footer-link:hover{color: var(--accent);}
.footer-sep{opacity:0.45;}
