:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #eef7f7;
  background: #0a1013;
  --muted: #a7b9bf;
  --line: #2a4045;
  --accent: #90f6e2;
  --panel: #121c21;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse at 75% 0%, #142e31 0, transparent 62%);
}
.frame { width: min(1056px, 100%); margin-inline: auto; padding-inline: max(24px, env(safe-area-inset-left)); }
.masthead { border-bottom: 1px solid #25383e; padding-top: env(safe-area-inset-top); }
.bar { min-height: 77px; display: flex; align-items: center; gap: 12px; }
.bar img { border-radius: 12px; }
.brand { font-size: 1.08rem; font-weight: 750; letter-spacing: .06em; }
.brand span { color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: .35rem; }
main { padding-block: clamp(32px, 6vw, 72px) 44px; }
h1 { margin: 0; font-size: clamp(2.05rem, 5vw, 3.75rem); line-height: 1.06; letter-spacing: -.055em; font-weight: 690; }
.intro p { margin: 14px 0 30px; color: var(--muted); font-size: 1.05rem; }
.modes { display: inline-flex; gap: 4px; background: #0d171a; border: 1px solid var(--line); padding: 4px; margin: 0 0 16px; border-radius: 14px; min-width: 0; }
.modes label { position: relative; cursor: pointer; }
.modes input, .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.modes span { display: grid; place-items: center; min-height: 44px; padding: 5px 16px; text-align: center; color: var(--muted); border-radius: 10px; font-size: .94rem; font-weight: 650; }
.modes input:checked + span { background: #223b3e; color: var(--accent); }
.modes input:focus-visible + span, :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); overflow: hidden; }
.result { background: #132227; border-color: #315154; }
.panel-head, .panel-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 18px; }
.panel-head { border-bottom: 1px solid var(--line); min-height: 62px; font-weight: 650; }
.panel-head h2 { margin: 0; font-size: 1rem; }
.panel-foot { min-height: 60px; margin-top: auto; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
button, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
select { min-height: 44px; appearance: none; background: #16272b; border: 1px solid var(--line); border-radius: 9px; color: inherit; padding: 0 30px 0 10px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, #a7b9bf 50%), linear-gradient(135deg, #a7b9bf 50%, transparent 50%); background-position: calc(100% - 15px) center, calc(100% - 10px) center; background-size: 5px 5px; background-repeat: no-repeat; }
.language { font-size: .94rem; color: var(--accent); max-width: 59%; }
textarea, .output { padding: 19px 18px; min-height: 230px; width: 100%; margin: 0; font-size: 1rem; line-height: 1.58; }
textarea { display: block; resize: vertical; color: inherit; background: transparent; border: 0; }
textarea:focus-visible, .output:focus-visible { outline-offset: -3px; }
textarea::placeholder, .empty { color: var(--muted); }
.output { white-space: pre-wrap; overflow-wrap: anywhere; }
.actions, .options { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.actions { justify-content: space-between; margin-top: 16px; }
.tone, .check { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--muted); }
.check { cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.primary, .ghost { border-radius: 11px; min-height: 44px; border: 1px solid transparent; font-weight: 680; }
.primary { padding: 0 23px; color: #09241f; background: var(--accent); }
.primary:hover:not(:disabled) { background: #b6ffef; }
.ghost { background: #1b2b30; border-color: #30484e; padding: 0 10px; color: #ddf1f0; font-size: .875rem; }
.ghost:hover:not(:disabled) { background: #284247; }
.status, .privacy { line-height: 1.5; color: var(--muted); font-size: .9rem; }
.status:empty { display: none; }
.status[data-error] { color: #ffc0b8; }
.back { margin-top: 16px; }
.back summary { padding: 14px 18px; cursor: pointer; font-weight: 650; }
.back .output { min-height: auto; padding-top: 0; }
@media (max-width: 680px) {
  .frame { padding-inline: 16px; }
  .bar { min-height: 64px; }
  .panels { grid-template-columns: 1fr; }
  .modes { display: flex; }
  .modes label { flex: 1; }
  .modes span { padding-inline: 6px; }
  textarea, .output { min-height: 146px; }
  .panel-head, .panel-foot { padding-inline: 12px; }
  .actions { justify-content: stretch; }
  .primary { width: 100%; }
}
.kova-footer { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 20px; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.kova-footer h2 { margin: 0 0 4px; color: #eef7f7; font-size: .95rem; font-weight: 650; }
.kova-footer p { max-width: 62ch; margin: 0 0 8px; }
.kova-footer a { color: var(--accent); text-underline-offset: .18em; }
