:root{
  --bg:#f7f8fb;
  --card:#ffffff;
  --muted:#6b7280;
  --accent:#9ae6c7;
  --accent-2:#c7d2fe;
  --radius:14px;
  --shadow: 0 8px 30px rgba(16,24,40,0.06);
  --max-width:1100px;
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: #111827;
}

* { box-sizing: border-box; }
html,body { height:100%; margin:0; background: linear-gradient(180deg,#fbfdff 0%, #f7f8fb 100%); }
.container { max-width:var(--max-width); margin:0 auto; padding:20px; }

.topbar {
  padding:28px 0 8px 0;
}
.topbar h1{ margin:0; font-weight:600; font-size:20px; letter-spacing:-0.2px;}
.topbar .sub{ margin:6px 0 0; color:var(--muted); font-size:13px;}

.main-grid{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap:18px;
  align-items:start;
  margin-top:18px;
}

.controls{
  background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(250,250,255,0.95));
  border-radius:var(--radius);
  padding:18px;
  box-shadow:var(--shadow);
  min-height: 320px;
}

.lang-row { margin-bottom:14px; }
.lang-row label{ display:block; font-size:13px; color:var(--muted); margin-bottom:6px; }
select{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(15,23,42,0.06);
  background:transparent;
  font-size:14px;
  outline:none;
}

.options { display:flex; gap:10px; margin-top:8px; }
.btn{
  background:linear-gradient(180deg,var(--accent), #96e0b7);
  border:none;
  padding:10px 14px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
  box-shadow: 0 6px 18px rgba(40,58,50,0.06);
}
.btn.ghost{
  background:transparent;
  border:1px solid rgba(15,23,42,0.06);
  color:var(--muted);
  font-weight:600;
}

.progress-wrap { margin-top:18px; }
.progress { width:100%; background:rgba(16,24,40,0.05); height:10px; border-radius:8px; overflow:hidden; }
.progress-bar { height:100%; background: linear-gradient(90deg,var(--accent-2),var(--accent)); width:0%; transition:width 260ms linear; }
#progressText{ display:block; color:var(--muted); font-size:12px; margin-top:6px; }

.notes{ color:var(--muted); font-size:13px; margin-top:14px; }

.translate-area{
  min-height:400px;
}

.box-row{ display:flex; gap:12px; }

.box-wrapper { display:flex; flex-direction: column; flex:1; }
.box-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  font-weight:600;
  color:var(--muted);
  font-size:13px;
  border-bottom:1px dashed rgba(15,23,42,0.04);
  background: linear-gradient(90deg, rgba(255,255,255,0.6), rgba(255,255,255,0.45));
  border-top-left-radius:12px;
  border-top-right-radius:12px;
}
.box-actions .icon-btn {
  background:transparent;
  border:none;
  cursor:pointer;
  padding:6px 10px;
  border-radius:8px;
  font-weight:600;
  color:var(--muted);
}
.box-actions .icon-btn:hover { color:#000; }

.input-box-wrapper, .output-box-wrapper { display:flex; flex-direction: column; width:50%; }
.input-box, .output-box {
  width:100%;
  min-height:300px;
  resize:vertical;
  overflow:auto;
  font-size:15px;
  line-height:1.5;
  padding:14px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,0.03);
  box-shadow:var(--shadow);
  background:var(--card);
}
.output-box-wrapper .output-box {
  max-height:540px;
  outline:none;
  white-space:pre-wrap;
}

.hint{ display:block; color:var(--muted); margin-top:10px; font-size:13px; }
.footer{ margin-top:30px; color:var(--muted); font-size:13px; padding-bottom:40px; text-align:center;}

/* responsive */
@media (max-width:900px){
  .main-grid{ grid-template-columns:1fr; }
  .box-row{ flex-direction:column; }
  .input-box-wrapper, .output-box-wrapper { width:100%; }
  .controls{ order:2; }
}
