:root {
  --bg: #050505;
  --panel: #0a0a0b;
  --panel-soft: #0d0d0f;
  --line: #1b1b1f;
  --line-strong: #29292e;
  --text: #f5f5f7;
  --muted: #97979f;
  --muted-2: #676770;
  --good: #8fe8b1;
  --bad: #ff9ca3;
  --shadow: 0 30px 100px rgba(0,0,0,.42);
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .68; }
.ambient {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(680px 360px at 50% -180px, rgba(255,255,255,.07), transparent 75%);
}
.brandbar {
  position: relative; z-index: 2; max-width: 820px; height: 72px; margin: 0 auto; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 720; letter-spacing: -.02em; }
.mark { display: inline-grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: #f4f4f5; color: #060606; font-size: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.privacy-note { color: var(--muted-2); font-size: 10px; font-weight: 650; }
.shell { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 54px 24px 150px; }
.page[hidden] { display: none !important; }
.page.is-active { animation: page-in .34s cubic-bezier(.22,1,.36,1) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hero { margin-bottom: 26px; }
.hero.compact { margin-bottom: 22px; }
.eyebrow { margin: 0 0 10px; color: #717179; font-size: 10px; line-height: 1; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(33px, 6vw, 48px); line-height: 1; letter-spacing: -.052em; font-weight: 700; }
.hero p:last-child { margin: 12px 0 0; color: var(--muted); max-width: 530px; line-height: 1.5; font-size: 13px; }

.composer, .word-search { border: 1px solid var(--line); background: rgba(9,9,10,.95); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.022); }
.composer { border-radius: 18px; overflow: hidden; transition: border-color .18s ease; }
.composer:focus-within, .word-search:focus-within { border-color: #34343a; }
textarea { width: 100%; min-height: 126px; resize: vertical; border: 0; padding: 16px 18px 13px; background: transparent; color: var(--text); outline: 0; line-height: 1.58; font-size: 15px; }
textarea::placeholder, input::placeholder { color: #55555d; }
.composer-footer { min-height: 50px; border-top: 1px solid #171719; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 9px 8px 16px; }
.composer-footer > span { color: var(--muted-2); font-size: 10px; }
.primary { border: 1px solid rgba(255,255,255,.82); background: #f2f2f3; color: #070707; min-height: 34px; padding: 0 12px; border-radius: 9px; font-weight: 720; font-size: 11px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .16s ease, background .16s ease; }
.primary:hover:not(:disabled) { background: #fff; transform: translateY(-1px); }
.primary:active:not(:disabled) { transform: scale(.985); }
.word-search { border-radius: 16px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 8px; align-items: end; }
.word-entry { min-width: 0; display: grid; grid-template-rows: auto 38px; }
.word-search input { width: 100%; min-width: 0; height: 38px; border: 0; background: transparent; color: var(--text); outline: none; padding: 0 10px; font-size: 14px; }
.compact-button { min-height: 38px; }

.morph-stage { min-width: 0; overflow: hidden; background: #080809; }
.sentence-morph-stage { min-height: 66px; padding: 15px 18px 14px; border-bottom: 1px solid #171719; display: flex; align-items: center; }
.morph-root { min-width: 0; width: 100%; }
.morph-text { margin: 0; color: #e9e9ec; overflow-wrap: anywhere; white-space: pre-wrap; }
.sentence-morph-text { max-height: 2.65em; overflow: hidden; font-size: clamp(17px, 3.2vw, 23px); line-height: 1.3; font-weight: 620; letter-spacing: -.03em; }
.word-morph-stage { min-height: 34px; padding: 5px 10px 0; display: flex; align-items: end; }
.word-morph-text { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.2; color: #85858e; letter-spacing: -.015em; }

.results { margin-top: 14px; display: grid; gap: 10px; }
.result-card { position: relative; border: 1px solid var(--line); border-radius: 15px; background: rgba(9,9,10,.96); padding: 15px; box-shadow: inset 0 1px 0 rgba(255,255,255,.018); animation: card-in .3s cubic-bezier(.22,1,.36,1) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.verdict-top { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; gap: 11px; }
.verdict-dot { width: 8px; height: 8px; border-radius: 999px; margin-top: 5px; box-shadow: 0 0 18px currentColor; }
.verdict-dot.good { color: var(--good); background: currentColor; }
.verdict-dot.bad { color: var(--bad); background: currentColor; }
.verdict-top h2, .error-card h2 { margin: 0; font-size: 13px; font-weight: 720; letter-spacing: -.01em; }
.verdict-top p, .error-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.48; }
.complexity-pill { border: 1px solid #252529; border-radius: 999px; padding: 5px 8px; color: #a1a1a9; font-size: 9px; font-weight: 700; }
.section-label { color: var(--muted-2); font-size: 9px; font-weight: 760; letter-spacing: .11em; text-transform: uppercase; margin-bottom: 10px; }
.best-card { padding-right: 48px; }
.best-copy { color: #f5f5f6; font-size: 16px; line-height: 1.52; letter-spacing: -.018em; }
.icon-button { position: absolute; right: 11px; top: 11px; width: 29px; height: 29px; border-radius: 8px; border: 1px solid #252529; background: #101012; color: #aaaab2; cursor: pointer; }
.icon-button:hover { color: #fff; border-color: #3b3b41; }
.fix-list { display: grid; gap: 9px; }
.fix-row { padding: 11px 0; border-top: 1px solid #171719; }
.fix-row:first-child { border-top: 0; padding-top: 0; }
.fix-row:last-child { padding-bottom: 0; }
.fix-change { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.bad-text { color: #ffb2b7; text-decoration: line-through; text-decoration-thickness: 1px; }
.good-text { color: #cdf4dc; }
.fix-arrow { color: #515158; }
.fix-row p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.fix-row p strong { color: #c5c5ca; margin-right: 5px; }
.quiet { margin: 0; color: var(--muted); font-size: 11px; }
.alternatives { display: grid; gap: 6px; }
.alt-row { width: 100%; border: 1px solid #19191c; border-radius: 11px; background: #080809; color: var(--text); text-align: left; cursor: pointer; padding: 10px 11px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; transition: border-color .15s ease, transform .15s ease; }
.alt-row:hover { border-color: #313137; transform: translateY(-1px); }
.alt-row small { display: block; color: var(--muted-2); text-transform: uppercase; font-size: 8px; font-weight: 760; letter-spacing: .1em; margin-bottom: 5px; }
.alt-row span:first-child { font-size: 11px; line-height: 1.5; }
.copy-glyph { color: #6f6f77; }

.word-summary-card { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.word-summary-card > div { padding: 10px; border: 1px solid #19191c; border-radius: 10px; background: #080809; }
.word-summary-card span { display: block; color: var(--muted-2); font-size: 9px; margin-bottom: 4px; }
.word-summary-card strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.word-summary-card > p { grid-column: 1 / -1; margin: 2px 1px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.forms-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.form-card { min-height: 182px; border: 1px solid var(--line); border-radius: 14px; background: rgba(9,9,10,.96); padding: 14px; display: flex; flex-direction: column; animation: card-in .3s cubic-bezier(.22,1,.36,1) both; }
.form-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pos { color: var(--muted-2); font-size: 8px; font-weight: 760; text-transform: uppercase; letter-spacing: .11em; }
.input-tag { color: #96969f; border: 1px solid #242428; padding: 3px 5px; border-radius: 999px; font-size: 8px; }
.form-word { margin-top: 10px; font-size: 20px; font-weight: 700; letter-spacing: -.035em; overflow-wrap: anywhere; }
.form-definition { margin: 6px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.example { margin-top: auto; padding-top: 11px; border-top: 1px solid #171719; color: #d8d8dd; font-size: 11px; line-height: 1.48; min-height: 48px; }
.shuffle-button, .retry-button { align-self: flex-end; margin-top: 9px; min-height: 28px; border: 1px solid #242428; border-radius: 8px; background: #101012; color: #aaaab2; padding: 0 8px; font-size: 9px; font-weight: 700; cursor: pointer; }
.shuffle-button:hover, .retry-button:hover { color: #fff; border-color: #39393f; }
.unavailable-card p { margin: auto 0 0; color: #62626a; font-size: 10px; }
.error-card { border-color: rgba(255,156,163,.18); }
.retry-button { align-self: auto; }

.skeleton-card { display: grid; gap: 9px; overflow: hidden; }
.skeleton-card i { display: block; height: 12px; border-radius: 7px; background: linear-gradient(90deg,#111114,#1b1b1f,#111114); background-size: 220% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton-card i:nth-child(2) { width: 78%; }
.skeleton-card i:nth-child(3) { width: 56%; }
@keyframes shimmer { to { background-position: -220% 0; } }
.toast { position: fixed; z-index: 150; top: 18px; left: 50%; transform: translate(-50%,-10px); opacity: 0; pointer-events: none; padding: 8px 10px; border-radius: 8px; background: #f4f4f4; color: #070707; font-size: 10px; font-weight: 720; transition: opacity .18s ease, transform .18s ease; box-shadow: 0 12px 30px rgba(0,0,0,.32); }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 680px) {
  .brandbar { padding-inline: 16px; }
  .privacy-note { display: none; }
  .shell { padding: 38px 16px 145px; }
  .hero h1 { font-size: 38px; }
  .sentence-morph-stage { min-height: 60px; padding-inline: 16px; }
  .sentence-morph-text { font-size: 18px; }
  textarea { min-height: 118px; padding-inline: 16px; }
  .word-summary-card, .forms-grid { grid-template-columns: 1fr; }
  .word-summary-card > p { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Live corrections */
.review-panel {
  position: relative;
  border-top: 1px solid #171719;
  background: #070708;
  padding: 10px 12px 12px;
}
.review-head {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.review-head > span {
  color: #777780;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.review-panel.is-reviewing .review-head > span::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 7px;
  border-radius: 50%;
  background: #8f8f98;
  animation: review-pulse 1s ease-in-out infinite;
  vertical-align: 1px;
}
@keyframes review-pulse { 50% { opacity: .25; transform: scale(.78); } }
.review-fix-all {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #28282d;
  border-radius: 7px;
  background: #111113;
  color: #cfcfd4;
  font-size: 9px;
  font-weight: 720;
  cursor: pointer;
}
.review-fix-all:hover { border-color: #414147; color: #fff; }
.review-copy {
  min-height: 42px;
  border: 1px solid #17171a;
  border-radius: 10px;
  background: #09090a;
  padding: 10px 11px;
  color: #cfcfd4;
  font-size: 12px;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.review-muted { color: #686871; }
.review-clean-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--good);
  box-shadow: 0 0 12px rgba(143,232,177,.28);
  vertical-align: 1px;
}
.review-token {
  appearance: none;
  display: inline;
  margin: 0;
  padding: 0 1px 1px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
  line-height: inherit;
  font: inherit;
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.review-token.critical { text-decoration-color: #ff757f; }
.review-token.clarity { text-decoration-color: #7ba8ff; }
.review-token:hover,
.review-token:focus-visible {
  background: rgba(255,255,255,.055);
  color: #fff;
}
.review-popover {
  position: fixed;
  z-index: 140;
  width: min(282px, calc(100vw - 20px));
  border: 1px solid #2c2c31;
  border-radius: 12px;
  background: #0d0d0f;
  padding: 11px;
  box-shadow: 0 22px 55px rgba(0,0,0,.56), inset 0 1px 0 rgba(255,255,255,.025);
}
.suggestion-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.suggestion-top > span {
  color: #85858e;
  font-size: 8px;
  font-weight: 780;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.suggestion-close {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #74747d;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.suggestion-close:hover { background: #17171a; color: #fff; }
.review-popover p {
  margin: 7px 0 10px;
  color: #9898a1;
  font-size: 10px;
  line-height: 1.45;
}
.suggestion-choices { display: grid; gap: 6px; }
.suggestion-choice {
  width: 100%;
  min-height: 33px;
  padding: 7px 9px;
  border: 1px solid #242429;
  border-radius: 8px;
  background: #111113;
  color: #ddddE1;
  text-align: left;
  font-size: 11px;
  font-weight: 680;
  cursor: pointer;
}
.suggestion-choice:hover { border-color: #3c3c42; color: #fff; }
.suggestion-choice.primary-choice {
  background: #efeff1;
  border-color: #efeff1;
  color: #080809;
}
.suggestion-dismiss {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #6f6f78;
  padding: 4px 1px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.suggestion-dismiss:hover { color: #bbbcc2; }

@media (max-width: 680px) {
  .review-panel { padding-inline: 10px; }
  .review-copy { font-size: 12px; line-height: 1.68; }
  .review-popover { width: min(282px, calc(100vw - 20px)); }
}
