:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #0c0c0d;
  --panel-2: #111113;
  --line: #232326;
  --line-strong: #343438;
  --text: #f5f5f7;
  --muted: #8d8d95;
  --muted-2: #66666e;
  --good: #6ee7a8;
  --bad: #ff7f83;
  --warn: #f4cf72;
  --radius: 18px;
  --shadow: 0 28px 70px rgba(0,0,0,.44);
}

* { box-sizing: border-box; }
html { background: var(--bg); 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;
  overflow-x: hidden;
}
button, textarea, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #fafafa;
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -20%, rgba(255,255,255,.055), transparent 35%),
    linear-gradient(rgba(255,255,255,.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 58%);
  opacity: .8;
}

.brandbar {
  position: relative;
  z-index: 3;
  width: min(1120px, calc(100% - 40px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: #f3f3f4;
  color: #09090b;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}
.shortcut { color: var(--muted-2); font-size: 12px; }

.shell {
  position: relative;
  z-index: 2;
  width: min(860px, calc(100% - 40px));
  margin: 64px auto 180px;
}
.page { animation: pageIn .35s cubic-bezier(.2,.8,.2,1) both; }
.page[hidden] { display: none; }
.hero { max-width: 720px; margin-bottom: 28px; }
.compact-hero { margin-bottom: 32px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--muted-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
}
h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.02;
  letter-spacing: -.048em;
  font-weight: 650;
}
.subcopy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.composer, .word-search {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), var(--shadow);
  transition: border-color .2s ease, transform .2s ease;
}
.composer:focus-within, .word-search:focus-within { border-color: var(--line-strong); }
.composer textarea {
  width: 100%;
  min-height: 158px;
  resize: vertical;
  border: 0;
  outline: 0;
  padding: 24px 24px 12px;
  background: transparent;
  color: var(--text);
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.55;
  letter-spacing: -.015em;
}
textarea::placeholder, input::placeholder { color: #55555c; }
.composer-footer {
  padding: 12px 14px 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #171719;
}
.count { color: var(--muted-2); font-size: 12px; }
.primary {
  border: 0;
  border-radius: 12px;
  background: #f3f3f4;
  color: #09090b;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 720;
  font-size: 13px;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, opacity .16s ease;
}
.primary:hover { transform: translateY(-1px); background: #fff; }
.primary:active { transform: translateY(0) scale(.985); }
.primary:disabled { cursor: wait; opacity: .6; transform: none; }
.primary.compact { min-width: 104px; }
.button-arrow { font-size: 16px; }

.word-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
}
.word-search input {
  min-width: 0;
  height: 52px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
}

.results { margin-top: 22px; display: grid; gap: 14px; }
.results:empty { display: none; }
.result-card {
  background: rgba(12,12,13,.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 19px;
  animation: cardIn .34s cubic-bezier(.2,.8,.2,1) both;
}
.result-card:nth-child(2) { animation-delay: .035s; }
.result-card:nth-child(3) { animation-delay: .07s; }
.result-card:nth-child(4) { animation-delay: .105s; }
.result-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.result-title { margin: 0; font-size: 14px; font-weight: 720; letter-spacing: -.01em; }
.result-copy { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d5d5d9;
  background: #0a0a0b;
  font-size: 12px;
  font-weight: 650;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.badge.good::before { background: var(--good); box-shadow: 0 0 0 3px rgba(110,231,168,.08); }
.badge.bad::before { background: var(--bad); box-shadow: 0 0 0 3px rgba(255,127,131,.08); }
.badge.warn::before { background: var(--warn); box-shadow: 0 0 0 3px rgba(244,207,114,.08); }

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.metric {
  background: #09090a;
  border: 1px solid #1a1a1d;
  border-radius: 14px;
  padding: 14px;
}
.metric span { display: block; color: var(--muted-2); font-size: 11px; margin-bottom: 7px; }
.metric strong { font-size: 14px; font-weight: 680; }

.issue-list, .rewrite-list, .forms-grid { display: grid; gap: 10px; margin-top: 14px; }
.issue {
  display: grid;
  grid-template-columns: minmax(0, .9fr) 24px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid #1d1d20;
  border-radius: 13px;
  background: #09090a;
}
.issue .from { color: #ffaaaD; text-decoration: line-through; text-decoration-thickness: 1px; }
.issue .to { color: #dffbea; }
.issue-arrow { color: var(--muted-2); text-align: center; }
.issue small { grid-column: 1 / -1; color: var(--muted); line-height: 1.45; }

.rewrite {
  position: relative;
  padding: 14px 44px 14px 14px;
  border: 1px solid #1d1d20;
  border-radius: 13px;
  background: #09090a;
}
.rewrite-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.rewrite p { margin: 0; color: #e8e8eb; line-height: 1.55; font-size: 14px; }
.copy-button, .shuffle-button {
  border: 1px solid #242428;
  background: #111113;
  color: #b5b5bb;
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, transform .16s ease;
}
.copy-button:hover, .shuffle-button:hover { color: #fff; border-color: #3a3a40; }
.copy-button:active, .shuffle-button:active { transform: scale(.97); }
.copy-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}

.word-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.word-chip {
  background: #09090a;
  border: 1px solid #1d1d20;
  border-radius: 13px;
  padding: 14px;
}
.word-chip span { color: var(--muted-2); font-size: 11px; display: block; margin-bottom: 7px; }
.word-chip strong { font-size: 20px; letter-spacing: -.025em; }
.forms-grid { grid-template-columns: 1fr 1fr; }
.form-card {
  min-height: 198px;
  border: 1px solid #1d1d20;
  border-radius: 14px;
  background: #09090a;
  padding: 15px;
  display: flex;
  flex-direction: column;
}
.form-card.is-unavailable { opacity: .52; }
.form-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pos { color: var(--muted-2); font-size: 10px; font-weight: 760; text-transform: uppercase; letter-spacing: .11em; }
.form-word { margin: 8px 0 0; font-size: 24px; font-weight: 650; letter-spacing: -.03em; }
.definition { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.48; }
.example-wrap { margin-top: auto; padding-top: 16px; }
.example { margin: 0 0 10px; color: #dedee2; font-size: 13px; line-height: 1.5; min-height: 40px; }
.shuffle-button { height: 31px; padding: 0 10px; font-size: 11px; font-weight: 650; }

.loading-card { overflow: hidden; }
.loading-line {
  height: 12px;
  border-radius: 99px;
  margin: 10px 0;
  background: linear-gradient(90deg, #141416 20%, #202024 42%, #141416 64%);
  background-size: 220% 100%;
  animation: shimmer 1.25s linear infinite;
}
.loading-line.w60 { width: 60%; }
.loading-line.w82 { width: 82%; }
.error-card { border-color: rgba(255,127,131,.25); }

.notch {
  --notch-width: 348px;
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 24px;
  width: min(var(--notch-width), calc(100% - 24px));
  transform: translateX(-50%);
  border: 1px solid #29292d;
  border-radius: 22px;
  background: #0b0b0c;
  box-shadow: 0 16px 50px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04);
  overflow: hidden;
  transition: width .38s cubic-bezier(.2,.9,.2,1), border-radius .38s cubic-bezier(.2,.9,.2,1), transform .2s ease;
}
.notch.is-settings-open { --notch-width: 560px; border-radius: 24px; }
.notch-tabs { height: 62px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; }
.notch-tab {
  position: relative;
  height: 44px;
  min-width: 98px;
  padding: 0 13px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #777780;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.notch-tab svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.notch-tab:hover { color: #d5d5d9; }
.notch-tab.is-active { color: #f7f7f8; background: #171719; }
.notch-tab:active { transform: scale(.98); }

.settings-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  border-top: 1px solid transparent;
  padding: 0 15px;
  transition: max-height .38s cubic-bezier(.2,.9,.2,1), opacity .2s ease, border-color .2s ease, padding .38s cubic-bezier(.2,.9,.2,1);
}
.notch.is-settings-open .settings-panel {
  max-height: 520px;
  opacity: 1;
  pointer-events: auto;
  border-color: #202023;
  padding-bottom: 15px;
}
.settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 11px;
}
.settings-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.icon-button { width: 30px; height: 30px; border: 1px solid #252529; border-radius: 9px; background: #111113; cursor: pointer; }
.setting-row {
  border-top: 1px solid #1d1d20;
  padding: 14px 4px;
}
.setting-row strong { display: block; font-size: 12px; margin-bottom: 4px; }
.setting-row span { display: block; color: var(--muted-2); font-size: 11px; line-height: 1.4; }
.inline-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.segmented {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: #09090a;
  border: 1px solid #1c1c1f;
}
.segmented button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 680;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.segmented button.is-selected { background: #1a1a1d; color: #f4f4f5; }
select {
  height: 34px;
  min-width: 82px;
  padding: 0 28px 0 10px;
  border: 1px solid #28282c;
  border-radius: 9px;
  background: #111113;
  color: #dddde1;
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  top: 22px;
  transform: translate(-50%, -12px);
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #2d2d31;
  background: #111113;
  color: #e8e8ea;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.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; }

@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(7px) scale(.994); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes shimmer { to { background-position: -220% 0; } }

@media (max-width: 700px) {
  .brandbar { width: min(100% - 28px, 1120px); height: 64px; }
  .shortcut { display: none; }
  .shell { width: min(100% - 28px, 860px); margin-top: 42px; margin-bottom: 150px; }
  h1 { font-size: 38px; }
  .composer textarea { min-height: 144px; padding: 20px 18px 10px; font-size: 18px; }
  .composer-footer { padding-left: 17px; }
  .metric-row, .forms-grid, .word-summary { grid-template-columns: 1fr; }
  .issue { grid-template-columns: 1fr; }
  .issue-arrow { text-align: left; transform: rotate(90deg); transform-origin: center; width: 18px; }
  .notch { bottom: 12px; }
  .notch.is-settings-open { --notch-width: calc(100% - 24px); }
  .notch-tab { min-width: 86px; padding-inline: 10px; }
  .notch-tab span { font-size: 11px; }
}

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