:root {
  color-scheme: dark;
  --bg: #090a09;
  --panel: #111310;
  --panel-raised: #151814;
  --ink: #f3f2e9;
  --muted: #8b9087;
  --faint: #555b53;
  --line: #272b25;
  --line-soft: #1d201c;
  --acid: #d9ff63;
  --acid-2: #a9d632;
  --danger: #ffbd72;
  --red: #ff8f84;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { min-height: 100vh; margin: 0; overflow-x: hidden; background: linear-gradient(180deg, #0d0f0c 0, var(--bg) 42rem); }
button, textarea, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.ambient { position: fixed; z-index: -1; pointer-events: none; border-radius: 999px; filter: blur(100px); opacity: .1; }
.ambient-one { width: 46rem; height: 30rem; top: -18rem; left: -8rem; background: var(--acid); }
.ambient-two { width: 30rem; height: 24rem; right: -14rem; bottom: -10rem; background: #7e9bff; opacity: .055; }

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.logo-mark { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 17px; color: #11140b; background: var(--acid); box-shadow: 0 0 50px #d9ff6324; font-size: 1.35rem; font-weight: 950; letter-spacing: -.06em; }
.logo-mark.small { width: 40px; height: 40px; border-radius: 12px; font-size: 1rem; }
.logo-mark.tiny { width: 31px; height: 31px; border-radius: 9px; font-size: .8rem; box-shadow: none; }
.boot-lockup { display: grid; gap: 1.5rem; justify-items: center; }
.boot-line { width: 74px; height: 2px; overflow: hidden; border-radius: 2px; background: #262a24; }
.boot-line i { display: block; width: 35%; height: 100%; background: var(--acid); animation: boot 1.15s ease-in-out infinite; }
@keyframes boot { from { transform: translateX(-140%); } to { transform: translateX(420%); } }

.login-shell { width: min(960px, 100%); min-height: 570px; display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: #10120f; box-shadow: 0 50px 140px #0009; }
.login-visual { position: relative; overflow: hidden; min-height: 570px; border-right: 1px solid var(--line); background: #0c0e0c; }
.visual-grid { position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(#42483d 1px, transparent 1px), linear-gradient(90deg, #42483d 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(140deg, #000, transparent 78%); }
.visual-copy { position: absolute; width: 64%; padding: 1.4rem; border: 1px solid #33382f; border-radius: 15px; background: #151814e8; box-shadow: 0 18px 45px #0007; transform: rotate(-3deg); }
.visual-copy span { display: block; margin-bottom: 1.1rem; color: #686e64; font-size: .58rem; font-weight: 850; letter-spacing: .15em; }
.visual-copy div { height: 6px; margin: 8px 0; border-radius: 4px; background: #343a32; }
.visual-copy div:nth-child(2n) { width: 76%; }
.visual-copy div:nth-child(3n) { width: 90%; }
.visual-copy-ai { top: 15%; left: 12%; }
.visual-copy-human { right: 10%; bottom: 14%; transform: rotate(2.5deg); border-color: #4b572d; }
.visual-copy-human span { color: var(--acid-2); }
.visual-copy-human div { background: #58643a; }
.visual-arrow { position: absolute; top: 47%; left: 47%; z-index: 2; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--acid); color: #111; box-shadow: 0 10px 35px #0009; font-size: 1.45rem; }
.login-content { align-self: center; padding: clamp(2.2rem, 5vw, 4.7rem); }
.brand-lockup { display: flex; align-items: center; gap: .72rem; }
.brand-lockup strong { font-size: .82rem; font-weight: 900; letter-spacing: .16em; }
.kicker { color: var(--acid-2); font-size: .62rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.login-content > .kicker { display: block; margin-top: 3.5rem; }
.login-content h1 { margin: .8rem 0 1rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.45rem, 4vw, 3.6rem); font-weight: 400; line-height: .98; letter-spacing: -.045em; }
.login-content h1 em { color: var(--acid); font-weight: 400; }
.login-content p { max-width: 380px; margin: 0 0 2rem; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.google-login { width: 300px; min-height: 44px; }
.login-error { margin-top: .8rem; color: var(--red); font-size: .76rem; line-height: 1.4; }
.access-note { display: flex; align-items: center; gap: .5rem; margin-top: 1.2rem; color: var(--faint); font-size: .7rem; }
.access-note i, .private-note i, .service-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--acid-2); box-shadow: 0 0 10px #a9d63288; }

.app-shell { width: 100%; min-height: 100vh; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(1rem, 3.5vw, 3.25rem); border-bottom: 1px solid var(--line-soft); background: #0a0b0ae8; backdrop-filter: blur(18px); }
.brand-divider { width: 1px; height: 18px; margin: 0 .2rem; background: var(--line); }
.brand-section { color: var(--muted); font-family: Georgia, serif; font-size: .9rem; }
.topbar-right, .user-menu { display: flex; align-items: center; }
.topbar-right { gap: 1.5rem; }
.service-status { display: flex; align-items: center; gap: .45rem; color: #747a71; font-size: .67rem; }
.service-status.working i { background: var(--danger); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.user-menu { gap: .65rem; }
.user-menu img, .user-initial { width: 31px; height: 31px; border-radius: 50%; }
.user-menu img { object-fit: cover; }
.user-initial { display: grid; place-items: center; color: #171a12; background: #cbdc9e; font-size: .74rem; font-weight: 850; }
.user-copy strong, .user-copy span { display: block; }
.user-copy strong { max-width: 150px; overflow: hidden; font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.user-copy span { margin-top: 2px; color: var(--faint); font-size: .58rem; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: #6f756d; background: transparent; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: #191c18; }
.icon-button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.page-intro { max-width: 1540px; display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin: 0 auto; padding: 3.25rem clamp(1rem, 3.5vw, 3.25rem) 1.8rem; }
.page-intro h1 { margin: .45rem 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 3.5vw, 3.3rem); font-weight: 400; letter-spacing: -.04em; }
.page-intro p { max-width: 480px; margin: 0 0 .3rem; color: var(--muted); font-size: .83rem; line-height: 1.55; }
.preset-strip { max-width: 1540px; display: flex; align-items: center; gap: .55rem; margin: 0 auto; padding: 0 clamp(1rem, 3.5vw, 3.25rem) 1.2rem; overflow-x: auto; scrollbar-width: none; }
.preset-strip::-webkit-scrollbar { display: none; }
.preset-label { flex: 0 0 auto; margin-right: .35rem; color: var(--faint); font-size: .6rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.preset { flex: 0 0 auto; display: flex; align-items: center; gap: .6rem; padding: .55rem .72rem; border: 1px solid var(--line); border-radius: 9px; color: #a8ada4; background: #10120f; cursor: pointer; transition: .16s ease; }
.preset span { font-size: .7rem; font-weight: 700; }
.preset small { color: #5b6158; font-size: .58rem; font-variant-numeric: tabular-nums; }
.preset:hover { color: var(--ink); border-color: #42483d; transform: translateY(-1px); }
.preset.active { color: #15170f; border-color: var(--acid); background: var(--acid); }
.preset.active small { color: #5a651f; }
.preset.danger:not(.active) { border-color: #4a3a2a; color: #d3ad81; }

.workbench { max-width: 1540px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin: 0 auto; padding: 0 clamp(1rem, 3.5vw, 3.25rem) 2rem; }
.copy-card { min-width: 0; min-height: 680px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: rgba(16, 18, 15, .94); box-shadow: 0 24px 80px #0003; }
.card-head { min-height: 73px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line-soft); }
.card-title { display: flex; align-items: center; gap: .85rem; }
.card-title .step { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid #343931; border-radius: 8px; color: #6a7067; font: 700 .65rem/1 ui-monospace, monospace; }
.card-title h2 { margin: .14rem 0 0; font-size: .92rem; }
.head-actions { display: flex; align-items: center; gap: .8rem; }
.text-stats { color: #656b63; font-size: .65rem; font-variant-numeric: tabular-nums; }
.text-button { padding: .35rem .48rem; border: 0; color: #7c8379; background: transparent; font-size: .67rem; cursor: pointer; }
.text-button:hover { color: var(--ink); }
.textarea-wrap { position: relative; flex: 1; display: flex; min-height: 330px; }
textarea { width: 100%; resize: none; border: 0; outline: none; color: #e7e6de; background: transparent; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; line-height: 1.63; }
#source { flex: 1; padding: 1.35rem 1.4rem 2.3rem; }
#source::placeholder { color: #474c45; }
#source:disabled { opacity: .6; }
.char-limit { position: absolute; right: 1rem; bottom: .7rem; color: #4f554d; font: .58rem/1 ui-monospace, monospace; }
.char-limit.near-limit { color: var(--danger); }
.steering-panel { padding: 1rem 1.2rem 1.15rem; border-top: 1px solid var(--line-soft); background: #0d0f0c; }
.steering-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .85rem; }
.steering-head h3 { margin: .12rem 0 0; font-size: .82rem; }
.dial-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.dial-card { padding: .9rem; border: 1px solid #252a23; border-radius: 12px; background: #131612; }
.dial-top { display: flex; align-items: start; justify-content: space-between; gap: .5rem; }
.dial-top strong, .dial-top span { display: block; }
.dial-top strong { font-size: .78rem; }
.dial-top span { margin-top: .18rem; color: #686e65; font-size: .6rem; }
.dial-reading { text-align: right; }
.dial-reading output, .dial-reading small { display: block; }
.dial-reading output { color: var(--acid); font: 750 1.15rem/1 ui-monospace, monospace; }
.dial-reading small { margin-top: .3rem; color: #59604f; font: .56rem/1 ui-monospace, monospace; }
.range { --range-fill: 50%; width: 100%; height: 3px; margin: 1.1rem 0 .55rem; appearance: none; border-radius: 5px; outline: none; background: linear-gradient(90deg, var(--acid) 0 var(--range-fill), #30352d var(--range-fill) 100%); }
.range::-webkit-slider-thumb { width: 15px; height: 15px; appearance: none; border: 3px solid #131612; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 1px #b6d84f; cursor: grab; }
.range::-moz-range-thumb { width: 10px; height: 10px; border: 3px solid #131612; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 1px #b6d84f; cursor: grab; }
.range-labels { display: flex; justify-content: space-between; color: #454a43; font: .5rem/1 ui-monospace, monospace; }
.overdrive { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; padding: .6rem .7rem; border: 1px solid #57432c; border-radius: 9px; color: #bda785; background: #6e491c14; font-size: .64rem; line-height: 1.4; }
.overdrive svg { flex: 0 0 16px; width: 16px; fill: none; stroke: var(--danger); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.overdrive strong { color: #e2c69c; }
.error-box { margin: .8rem 1.2rem 0; padding: .72rem .8rem; border: 1px solid #693a37; border-radius: 9px; color: #e9a8a1; background: #57211d20; font-size: .7rem; }
.source-footer { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.2rem; border-top: 1px solid var(--line-soft); }
.source-footer > span { color: #565c54; font-size: .6rem; }
kbd { display: inline-grid; min-width: 18px; height: 18px; place-items: center; margin-right: 2px; border: 1px solid #343931; border-radius: 4px; color: #7c8279; background: #171a16; font: .58rem/1 ui-monospace, monospace; }
.generate-button { min-width: 155px; height: 43px; display: flex; align-items: center; justify-content: center; gap: .65rem; padding: 0 1rem; border: 0; border-radius: 10px; color: #15170f; background: var(--acid); box-shadow: 0 8px 25px #d9ff6318; font-size: .75rem; font-weight: 850; cursor: pointer; transition: .17s ease; }
.generate-button:hover { background: #e5ff96; transform: translateY(-1px); box-shadow: 0 12px 30px #d9ff6325; }
.generate-button:disabled { cursor: wait; transform: none; opacity: .82; }
.generate-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button-loader { display: none; width: 13px; height: 13px; border: 2px solid #3d451d55; border-top-color: #1c210d; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.generate-button.loading .button-loader { display: block; }
.generate-button.loading svg { display: none; }
.generate-button.loading .button-label { font-size: 0; }
.generate-button.loading .button-label::after { content: "Rewriting"; font-size: .75rem; }

.output-card { position: relative; background: #121411; }
.copy-button { display: flex; align-items: center; gap: .38rem; padding: .45rem .62rem; border: 1px solid #32372f; border-radius: 8px; color: #a6aca2; background: #171a16; font-size: .65rem; cursor: pointer; }
.copy-button:hover:not(:disabled) { color: var(--ink); border-color: #4b5147; }
.copy-button:disabled { opacity: .35; cursor: default; }
.copy-button svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.output-empty { flex: 1; display: grid; align-content: center; justify-items: center; padding: 3rem; color: #585e56; text-align: center; }
.output-empty strong { margin-top: 1.4rem; color: #858b81; font-family: Georgia, serif; font-size: 1.1rem; font-weight: 400; }
.output-empty p { max-width: 300px; margin: .5rem 0 0; font-size: .69rem; line-height: 1.5; }
.empty-glyph { width: 120px; transform: rotate(-2deg); }
.empty-glyph span { display: block; height: 4px; margin: 9px 0; border-radius: 4px; background: #2b3029; }
.empty-glyph span:nth-child(2) { width: 76%; }
.empty-glyph span:nth-child(3) { width: 92%; }
.empty-glyph span:nth-child(4) { width: 58%; }
.output-loading { flex: 1; padding: 2rem 1.4rem; }
.output-loading span { display: block; height: 11px; margin: 14px 0; overflow: hidden; border-radius: 6px; background: #222620; }
.output-loading span::after { content: ""; display: block; width: 35%; height: 100%; background: linear-gradient(90deg, transparent, #373d34, transparent); animation: skeleton 1.4s ease-in-out infinite; }
.output-loading span:nth-child(2) { width: 84%; }
.output-loading span:nth-child(4) { width: 67%; }
.output-loading span:nth-child(6) { width: 91%; }
.output-loading span:nth-child(7) { width: 54%; }
@keyframes skeleton { from { transform: translateX(-120%); } to { transform: translateX(360%); } }
#output { flex: 1; min-height: 560px; padding: 1.4rem 1.5rem; color: #efeee6; }
.output-footer { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: .7rem 1.2rem; border-top: 1px solid var(--line-soft); color: #5e645c; font: .59rem/1 ui-monospace, monospace; }
.private-note { display: flex; align-items: center; gap: .4rem; }

.site-footer { max-width: 1540px; display: flex; justify-content: space-between; margin: 0 auto; padding: 0 clamp(1rem, 3.5vw, 3.25rem) 2.5rem; color: #41463f; font: .52rem/1 ui-monospace, monospace; letter-spacing: .1em; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 1.5rem; padding: .7rem 1rem; border: 1px solid #3b4234; border-radius: 9px; color: #dce5c8; background: #171b15ed; box-shadow: 0 15px 40px #0008; font-size: .7rem; opacity: 0; transform: translate(-50%, 20px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .login-shell { max-width: 520px; grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-content { padding: 3rem; }
  .login-content > .kicker { margin-top: 3rem; }
  .page-intro { align-items: start; flex-direction: column; padding-top: 2.3rem; }
  .workbench { grid-template-columns: 1fr; }
  .copy-card { min-height: 650px; }
}

@media (max-width: 640px) {
  .center-screen { padding: 1rem; }
  .login-shell { width: 100%; max-width: 100%; min-width: 0; min-height: 540px; border-radius: 20px; }
  .login-content { min-width: 0; padding: 2rem; }
  .google-login { width: 100%; }
  .topbar { height: 62px; }
  .brand-divider, .brand-section, .service-status, .user-copy { display: none; }
  .topbar-right { gap: .5rem; }
  .page-intro { gap: 1rem; padding-bottom: 1.35rem; }
  .page-intro h1 { font-size: 2.15rem; }
  .preset-strip { padding-bottom: 1rem; }
  .preset-label { display: none; }
  .workbench { padding-bottom: 1.2rem; }
  .copy-card { min-height: 620px; border-radius: 14px; }
  .card-head { min-height: 68px; padding: .9rem; }
  .card-title .step, .text-stats { display: none; }
  #source, #output { padding-left: 1rem; padding-right: 1rem; }
  .steering-panel { padding: .9rem; }
  .dial-grid { grid-template-columns: 1fr; }
  .source-footer { padding: .8rem .9rem; }
  .source-footer > span { display: none; }
  .generate-button { width: 100%; }
  .site-footer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
