:root {
  --ink: #171717;
  --paper: #f5f0e7;
  --orange: #ff7040;
  --yellow: #ffd84a;
  --violet: #9b66ff;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 18%, #ff70402d 0 12%, transparent 28%),
    radial-gradient(circle at 92% 82%, #9b66ff2a 0 12%, transparent 30%),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, select, textarea { font: inherit; }
header {
  height: 78px;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid #17171735;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f5f0e7d9;
  backdrop-filter: blur(12px);
}
.brand, .back { color: var(--ink); text-decoration: none; font-weight: 900; }
.brand { font-size: 20px; letter-spacing: -0.04em; }
.brand span { color: var(--orange); }
.back { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
main { width: min(1500px, 100%); margin: 0 auto; padding: clamp(52px, 8vw, 110px) clamp(20px, 5vw, 72px) 52px; }
.intro { max-width: 900px; margin-bottom: clamp(42px, 7vw, 80px); }
.eyebrow { margin: 0 0 20px; font-size: 12px; font-weight: 900; letter-spacing: .13em; }
h1 { margin: 0; font-size: clamp(66px, 11vw, 150px); line-height: .78; letter-spacing: -.075em; }
h1 em { color: var(--orange); font-family: Georgia, serif; font-weight: 400; }
.intro > p:last-child { max-width: 660px; margin: 34px 0 0; font-size: clamp(18px, 2vw, 25px); line-height: 1.45; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 210px minmax(0, 1fr); gap: 18px; align-items: stretch; }
.panel {
  min-height: 470px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 9px 9px 0 var(--ink);
}
.result-panel { background: #fffaf0; }
.panel-head { min-height: 58px; padding: 12px 17px; border-bottom: 1px solid #17171745; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head label, .controls label { font-size: 12px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
#counter { color: #1717179c; font-size: 12px; font-weight: 700; }
textarea { width: 100%; flex: 1; min-height: 390px; padding: 24px; border: 0; outline: 0; resize: vertical; background: transparent; color: var(--ink); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.6; }
textarea::placeholder { color: #17171762; }
.controls { padding: 20px 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
select { width: 100%; padding: 13px 12px; border: 1px solid var(--ink); border-radius: 6px; background: #fff; color: var(--ink); font-weight: 750; }
#rewrite { min-height: 70px; padding: 16px; border: 1px solid var(--ink); border-radius: 7px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, var(--orange), var(--yellow)); color: var(--ink); cursor: pointer; font-weight: 950; text-transform: uppercase; letter-spacing: .06em; box-shadow: 6px 6px 0 var(--ink); transition: transform .15s, box-shadow .15s; }
#rewrite:hover { transform: translate(2px, 2px); box-shadow: 4px 4px 0 var(--ink); }
#rewrite:disabled { cursor: wait; filter: grayscale(.35); opacity: .72; }
#rewrite b { font-size: 25px; }
#status { min-height: 40px; margin: 7px 0 0; color: #171717a6; font-size: 12px; line-height: 1.45; }
#status.error { color: #b01919; font-weight: 800; }
#status.success { color: #087740; font-weight: 800; }
.result-actions { display: flex; gap: 7px; }
.small-button { padding: 8px 10px; border: 1px solid var(--ink); border-radius: 4px; background: #fff; cursor: pointer; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.small-button:disabled { opacity: .35; cursor: default; }
.privacy { max-width: 760px; margin: 34px auto 0; color: #171717a0; text-align: center; font-size: 12px; line-height: 1.5; }
@media (max-width: 950px) {
  .workspace { grid-template-columns: 1fr; }
  .controls { padding: 8px 0; display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .controls label { grid-column: 1 / -1; }
  #status { grid-column: 1 / -1; }
  .panel { min-height: 350px; }
  textarea { min-height: 280px; }
}
@media (max-width: 540px) {
  header { height: 66px; }
  main { padding-top: 46px; }
  h1 { font-size: clamp(58px, 22vw, 90px); }
  .controls { grid-template-columns: 1fr; }
  .controls label, #status { grid-column: auto; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .result-actions { width: 100%; }
  .result-actions button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { #rewrite { transition: none; } }
