:root{
  --bg:#0f0c0a;
  --panel:#15110e;
  --panel2:#1a1511;
  --text:#f7f4ef;
  --muted:#c9c1b8;
  --line:rgba(247,244,239,.12);
  --accent:#f0b35a;
  --accent2:#ff7a59;
  --shadow: 0 12px 40px rgba(0,0,0,.45);
  --radius: 18px;
  --radius2: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(240,179,90,.10), transparent 55%),
    radial-gradient(800px 600px at 80% 20%, rgba(255,122,89,.08), transparent 55%),
    radial-gradient(900px 700px at 50% 110%, rgba(240,179,90,.06), transparent 60%),
    var(--bg);
}

.wrap{ width:min(1200px, 100% - 28px); margin:0 auto; }

.topbar{
  position:sticky; top:0; z-index:50;
  background: rgba(15,12,10,.72);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}

.topbar .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 0;
}

.brand{ display:flex; align-items:center; gap:12px; min-width:0; }
.mark{
  width:44px; height:44px;
  display:grid; place-items:center;
  border-radius:14px;
  background: linear-gradient(145deg, rgba(240,179,90,.14), rgba(255,122,89,.08));
  border:1px solid rgba(240,179,90,.22);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  color:var(--text);
}
.brandtext{ min-width:0; }
.title{
  font-weight:800;
  letter-spacing:.2px;
  font-size:16px;
  line-height:1.15;
}
.subtitle{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:min(720px, 62vw);
}

.top-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }

.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:700;
  letter-spacing:.2px;
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
  box-shadow: 0 10px 20px rgba(0,0,0,.25);
}
.btn:hover{ background: rgba(255,255,255,.06); border-color: rgba(240,179,90,.26); }
.btn:active{ transform: translateY(1px); }
.btn.primary{
  background: linear-gradient(135deg, rgba(240,179,90,.95), rgba(255,122,89,.85));
  color:#1b120c;
  border-color: rgba(240,179,90,.55);
}
.btn.primary:hover{ border-color: rgba(255,255,255,.22); }
.btn.ghost{
  background: transparent;
  box-shadow:none;
}
.btn.tiny{
  padding:8px 10px;
  border-radius:12px;
  font-weight:700;
  box-shadow:none;
}

.main{
  display:grid;
  grid-template-columns: 1.25fr .95fr;
  gap:16px;
  padding:16px 0 22px;
}

.panel{
  background: linear-gradient(180deg, rgba(26,21,17,.88), rgba(21,17,14,.88));
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.left{ padding:14px; }
.right{
  padding:14px;
  display:flex;
  flex-direction:column;
  min-height: 520px;
}

.section{
  border:1px solid var(--line);
  border-radius: var(--radius2);
  padding:12px;
  background: rgba(0,0,0,.16);
  margin-bottom:12px;
}

.section h2{
  margin:0 0 10px;
  font-size:15px;
  letter-spacing:.2px;
}

.sectionhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.sectionhead h2{ margin:0; }

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 780px){
  .grid2{ grid-template-columns: 1fr; }
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:10px;
}
.field span{
  font-weight:800;
  font-size:12px;
  letter-spacing:.18px;
  color: rgba(247,244,239,.92);
}
.field small{
  color: var(--muted);
  font-size:11px;
  line-height:1.25;
}
input, select, textarea{
  width:100%;
  background: rgba(255,255,255,.04);
  border:1px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  padding:10px 12px;
  outline:none;
}

/*
  Language dropdowns can render with a native white options panel.
  Force black text + white background for readability.
*/
#outputLang, #speechLang, #typedLang{
  background: #fff;
  color: #000;
}
#outputLang option, #speechLang option, #typedLang option{
  color: #000;
  background: #fff;
}
textarea{ resize: vertical; min-height: 92px; }
input:focus, select:focus, textarea:focus{
  border-color: rgba(240,179,90,.35);
  box-shadow: 0 0 0 3px rgba(240,179,90,.12);
}
select{ cursor:pointer; }

/* Global select readability: native dropdown panels are often white */
select{
  background: #fff;
  color: #000;
}
select option{
  background: #fff;
  color: #000;
}


.hint{ color: var(--muted); }

.row{ display:flex; align-items:center; gap:10px; }

.check{ display:flex; align-items:center; gap:10px; cursor:pointer; user-select:none; }
.check input{ width:18px; height:18px; margin:0; }

.selector{
  border:1px solid var(--line);
  border-radius: 16px;
  padding:10px;
  background: rgba(255,255,255,.03);
  margin-bottom:10px;
}
.selector .head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.selector .meta{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
.selector .label{
  font-weight:900;
  letter-spacing:.2px;
  font-size:13px;
}
.selector .help{
  color: var(--muted);
  font-size:11px;
  line-height:1.25;
}
.selector .controls{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.pill{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  font-size:12px;
}
.pill input{ width:16px; height:16px; }
.dice{
  width:38px;
  height:34px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor:pointer;
}
.dice:hover{ border-color: rgba(240,179,90,.28); }

.selector .body{
  margin-top:10px;
}
.selector.collapsed .body{ display:none; }
.selector.collapsed{ padding-bottom:8px; }

.tagtray{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  min-height: 38px;
}
.tag{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius: 999px;
  border:1px solid rgba(240,179,90,.22);
  background: rgba(240,179,90,.10);
  font-size:12px;
  font-weight:800;
}
.tag button{
  border:none;
  background: rgba(0,0,0,.22);
  color: var(--text);
  width:20px; height:20px;
  border-radius:999px;
  cursor:pointer;
}
.tag button:hover{ background: rgba(0,0,0,.34); }

.outputhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.outputhead h2{
  margin:0;
  font-size:15px;
  letter-spacing:.2px;
}
.muted{ color: var(--muted); font-size:12px; }

.output{
  flex:1;
  min-height: 420px;
  font-family: var(--mono);
  line-height: 1.35;
  border-radius: 16px;
  background: rgba(0,0,0,.22);
}

.outputhint{ margin-top:10px; line-height:1.25; }

/* Translation status (browser Translator API) */
.translate-status{
  margin: 6px 0 10px;
  min-height: 16px;
}

.foot{
  margin-top:10px;
  padding-top:6px;
  border-top:1px dashed rgba(247,244,239,.12);
}

.mobile-tabs{ display:none; }

@media (max-width: 980px){
  .main{ grid-template-columns: 1fr; }
  .right{ min-height: 380px; }
  .subtitle{ max-width: 60vw; }
}

@media (max-width: 700px){
  .top-actions .btn{ padding:9px 10px; border-radius:13px; }
  .mobile-tabs{
    display:flex;
    gap:10px;
    margin-bottom:12px;
  }
  .tab{
    flex:1;
    padding:10px 12px;
    border-radius: 14px;
    border:1px solid var(--line);
    background: rgba(255,255,255,.03);
    color: var(--text);
    font-weight:900;
    cursor:pointer;
  }
  .tab.active{
    background: rgba(240,179,90,.12);
    border-color: rgba(240,179,90,.25);
  }
  .panel.right{ display:none; }
  body[data-mobile-tab="output"] .panel.right{ display:flex; }
  body[data-mobile-tab="output"] .panel.left{ display:none; }
}


/* Generate button is reserved for future API-powered generation. */
#btnGenerate{ display:none; }
