:root {
  --bg: #f7f8f3;
  --surface: rgba(255, 255, 255, .86);
  --surface-solid: #fff;
  --surface-soft: #f0f1eb;
  --surface-tint: #f1effd;
  --line: #dde0d7;
  --line-strong: #cdd1c6;
  --text: #20231f;
  --muted: #6d736a;
  --quiet: #92988e;
  --accent: #7259e8;
  --accent-dark: #5d46d2;
  --accent-soft: #ece9ff;
  --mint: #dff5e8;
  --mint-text: #26734a;
  --peach: #ffe9d6;
  --peach-text: #a34f20;
  --danger: #c94949;
  --shadow: 0 20px 55px rgba(51, 49, 39, .09), 0 2px 8px rgba(51, 49, 39, .04);
  --shadow-soft: 0 10px 28px rgba(62, 57, 44, .07);
  --spring: cubic-bezier(.16, 1, .3, 1);
  --spring-pop: cubic-bezier(.34, 1.56, .64, 1);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #171a1d;
  --surface: rgba(34, 38, 42, .9);
  --surface-solid: #22262a;
  --surface-soft: #292e32;
  --surface-tint: #2e2b48;
  --line: #373d40;
  --line-strong: #495054;
  --text: #f4f5ee;
  --muted: #aeb4ab;
  --quiet: #808780;
  --accent: #a994ff;
  --accent-dark: #b7a7ff;
  --accent-soft: #342f53;
  --mint: #203b2e;
  --mint-text: #7fdda6;
  --peach: #442f25;
  --peach-text: #ffae77;
  --danger: #ff8a8a;
  --shadow: 0 24px 60px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .16);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

button,
input,
select { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 32%, transparent);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(6px);
  opacity: .55;
  pointer-events: none;
}

.ambient-one {
  top: -300px;
  right: -100px;
  background: radial-gradient(circle, #e6dcff 0, transparent 68%);
}

.ambient-two {
  left: -250px;
  bottom: -330px;
  background: radial-gradient(circle, #d8f4e3 0, transparent 68%);
}

[data-theme="dark"] .ambient { opacity: .13; }

.app-shell {
  width: min(1240px, calc(100% - 40px));
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -.025em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #8b74f5, #6449dd);
  box-shadow: 0 9px 20px rgba(114, 89, 232, .24);
}

.brand-mark svg { width: 22px; height: 22px; }
.brand-mark path:first-child { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.brand-mark path:last-child { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-dot { color: var(--accent); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--mint-text) 20%, var(--line));
  border-radius: 999px;
  color: var(--mint-text);
  background: color-mix(in srgb, var(--mint) 65%, transparent);
  font-size: 12px;
  font-weight: 700;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #42b979; box-shadow: 0 0 0 4px rgba(66, 185, 121, .12); }

.theme-toggle {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.theme-toggle button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--quiet);
  background: transparent;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .3s var(--spring-pop);
}

.theme-toggle button.active { color: var(--accent); background: var(--accent-soft); transform: scale(1.03); }
.theme-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  align-items: end;
  gap: 40px;
  padding: 12px 4px 18px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.intro > p {
  max-width: 440px;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.workspace {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(340px, 410px) minmax(0, 1fr);
  gap: 16px;
}

.controls-card,
.results-card {
  min-height: 0;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.controls-card { padding: 12px; }

.mode-switch {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 42px;
  padding: 4px;
  margin-bottom: 9px;
  border-radius: 13px;
  background: var(--surface-soft);
}

.mode-switch button {
  position: relative;
  z-index: 2;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: color .25s ease;
}

.mode-switch button.active { color: var(--text); }

.mode-glider {
  position: absolute;
  z-index: 1;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-solid);
  box-shadow: 0 4px 14px rgba(42, 41, 34, .08);
  transition: transform .42s var(--spring);
}

.mode-switch[data-active="random"] .mode-glider { transform: translateX(100%); }

.panel-section { display: none; }
.panel-section.active { display: block; animation: panel-in .34s var(--spring) both; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.control-block {
  padding: 9px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.control-block:last-child { border-bottom: 0; }

.control-heading,
.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 7px;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
}

.dict-count,
.hint {
  color: var(--mint-text);
  font-size: 10.5px;
  font-weight: 700;
}

.value-bubble {
  min-width: 34px;
  padding: 3px 8px;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  transition: transform .35s var(--spring-pop);
}

.value-bubble.bump { transform: scale(1.16) translateY(-2px); }

.choice-row { display: grid; gap: 5px; }
.source-switch { grid-template-columns: 1fr 1fr; }
.position-row { grid-template-columns: repeat(4, 1fr); }

.choice {
  min-height: 34px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-solid);
  font-size: 11.5px;
  font-weight: 730;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .28s var(--spring-pop);
}

.choice.active {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.range {
  --range-progress: 25%;
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0 var(--range-progress), var(--line) var(--range-progress) 100%);
}

.range::-moz-range-track { height: 5px; border-radius: 999px; background: var(--line); }
.range::-moz-range-progress { height: 5px; border-radius: 999px; background: var(--accent); }
.range::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  margin-top: -6px;
  appearance: none;
  border: 4px solid var(--surface-solid);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 8px rgba(114, 89, 232, .4);
}

.range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 4px solid var(--surface-solid);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 8px rgba(114, 89, 232, .4);
}

.range-labels { display: flex; justify-content: space-between; margin-top: 1px; color: var(--quiet); font-size: 9.5px; }

.two-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two-cols .control-block:first-child { border-right: 1px solid color-mix(in srgb, var(--line) 72%, transparent); }

select,
.text-input,
.word-inputs input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface-solid);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

select { padding: 0 30px 0 10px; font-size: 12px; cursor: pointer; }
.text-input { padding: 0 10px; font-size: 12px; }
.mono { font-family: var(--mono); letter-spacing: .04em; }

select:focus,
.text-input:focus,
.word-inputs input:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
  outline: none;
}

.input-with-note { display: grid; grid-template-columns: minmax(110px, .7fr) 1.3fr; align-items: center; gap: 10px; }
.input-with-note > span { color: var(--quiet); font-size: 10px; line-height: 1.25; }

.word-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.word-inputs label { position: relative; }
.word-inputs label > span {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 1;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}
.word-inputs input { padding: 0 7px 0 24px; font-size: 11px; }
.translit-preview { min-height: 15px; margin: 6px 0 0; color: var(--accent); font-family: var(--mono); font-size: 10px; overflow-wrap: anywhere; }

.primary-action {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 20px);
  min-height: 46px;
  margin: 10px;
  padding: 0 16px;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #826cf0, #684bdd);
  box-shadow: 0 12px 26px rgba(103, 76, 220, .25);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .35s var(--spring-pop), box-shadow .25s ease, filter .25s ease;
}

.primary-action::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at var(--tap-x, 50%) var(--tap-y, 50%), rgba(255,255,255,.38), transparent 42%);
  transition: opacity .35s ease;
}

.primary-action:active { transform: scale(.975); }
.primary-action:active::before { opacity: 1; }
.primary-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--spring-pop); }

.check-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.check-card { position: relative; display: grid; place-items: center; min-height: 58px; padding: 7px 4px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface-solid); cursor: pointer; transition: all .2s ease; }
.check-card input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.check-card span { font-family: var(--mono); font-size: 12px; font-weight: 800; }
.check-card small { font-size: 8.5px; }
.check-card:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--accent-dark); background: var(--accent-soft); }

.check-line { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--text); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.check-line input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.check-line span { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.check-line small { color: var(--quiet); font-family: var(--mono); font-weight: 500; }

.results-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  overflow: hidden;
}

.results-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 46px; margin-bottom: 12px; }
.results-header h2 { margin: 0; font-size: clamp(17px, 2vw, 22px); line-height: 1.15; letter-spacing: -.025em; }
.section-kicker { margin-bottom: 3px; font-size: 9.5px; }
.results-actions { display: flex; gap: 6px; }

.soft-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-solid);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, transform .3s var(--spring-pop), box-shadow .2s ease;
}

.soft-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.soft-button:active { transform: scale(.94); }

.results { display: grid; align-content: start; gap: 8px; }

.result-card {
  --delay: 0ms;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 65px;
  padding: 10px 10px 10px 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  animation: result-in .46s var(--spring) var(--delay) both;
  transition: transform .34s var(--spring), border-color .2s ease, box-shadow .2s ease;
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), #a793ff);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform .34s var(--spring);
}

@keyframes result-in {
  from { opacity: 0; transform: translateY(13px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.password-wrap { min-width: 0; }
.result-password {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(14px, 1.75vw, 19px);
  font-weight: 720;
  letter-spacing: -.025em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-subline { display: block; margin-top: 3px; color: var(--quiet); font-size: 9.5px; }
.seg-word { color: var(--text); }
.seg-insert { color: var(--peach-text); font-weight: 850; }
.seg-sep { color: var(--accent); }

.result-actions { display: flex; gap: 5px; margin-left: 12px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
  transition: transform .3s var(--spring-pop), color .2s ease, border-color .2s ease, background .2s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.copied { border-color: transparent; color: var(--mint-text); background: var(--mint); transform: scale(1.08); }

.breakdown-panel {
  position: absolute;
  z-index: 5;
  inset: 78px 22px auto;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface-solid) 94%, var(--accent-soft));
  box-shadow: var(--shadow);
  animation: breakdown-in .42s var(--spring-pop) both;
}

@keyframes breakdown-in {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.breakdown-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.breakdown-head h3 { margin: 0; font-size: 13px; }
.breakdown-close { width: 30px; height: 30px; border: 0; border-radius: 8px; color: var(--muted); background: var(--surface-soft); cursor: pointer; }
.breakdown-row { display: grid; grid-template-columns: 1fr 1.45fr; gap: 14px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 11px; }
.breakdown-row span:first-child { color: var(--muted); }
.breakdown-row span:last-child { font-family: var(--mono); font-weight: 650; overflow-wrap: anywhere; }

.strength-box {
  margin-top: auto;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 16px;
  background: linear-gradient(130deg, color-mix(in srgb, var(--surface-tint) 82%, var(--surface-solid)), var(--surface-solid));
  animation: strength-in .4s var(--spring) both;
}

@keyframes strength-in { from { opacity: 0; transform: translateY(8px); } }
.strength-topline { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.strength-label { margin-right: 7px; color: var(--muted); font-size: 10px; }
.strength-topline strong { color: var(--accent-dark); font-size: 12px; }
.strength-bits { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.strength-track { height: 5px; margin: 8px 0; overflow: hidden; border-radius: 999px; background: var(--line); }
.strength-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e78667, #e3b75e 42%, #64c590 75%, #7259e8); transition: width .65s var(--spring); }
.strength-facts { display: flex; justify-content: space-between; color: var(--muted); font-size: 9.5px; }
.strength-facts b { color: var(--text); font-family: var(--mono); }
.strength-box p { margin: 6px 0 0; color: var(--quiet); font-size: 9px; line-height: 1.35; }

.empty-state { position: absolute; inset: 80px 22px 22px; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); font-size: 12px; background: var(--surface); }
.loader-mark { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.quick-notes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 5vw, 60px);
  min-height: 52px;
  color: var(--muted);
  font-size: 10.5px;
}
.quick-notes span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.quick-notes svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  padding: 11px 18px;
  border-radius: 999px;
  color: #fff;
  background: #252824;
  box-shadow: 0 14px 40px rgba(0,0,0,.22);
  font-size: 12px;
  font-weight: 750;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 140%) scale(.9);
  transition: transform .52s cubic-bezier(.18, 1.25, .4, 1), opacity .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

@media (hover: hover) and (pointer: fine) {
  .choice:hover { border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); transform: translateY(-1px); }
  .primary-action:hover { filter: saturate(1.08) brightness(1.03); box-shadow: 0 15px 32px rgba(103, 76, 220, .3); transform: translateY(-2px); }
  .primary-action:hover svg { transform: translateX(4px); }
  .soft-button:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow-soft); transform: translateY(-1px); }
  .result-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); box-shadow: var(--shadow-soft); }
  .result-card:hover::before { transform: scaleY(1); }
  .icon-btn:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); transform: scale(1.06); }
}

@media (min-width: 921px) and (min-height: 690px) {
  body { overflow: hidden; }
}

@media (max-height: 780px) and (min-width: 921px) {
  .topbar { min-height: 54px; }
  .intro { padding: 5px 4px 12px; }
  .intro h1 { font-size: 31px; }
  .intro > p { font-size: 12px; }
  .quick-notes { min-height: 42px; }
  .controls-card { overflow-y: auto; scrollbar-width: thin; }
  .result-card { min-height: 59px; }
  .strength-box { padding: 11px 14px; }
}

@media (max-width: 920px) {
  .app-shell { width: min(720px, calc(100% - 28px)); display: block; }
  .intro { grid-template-columns: 1fr; gap: 8px; padding-bottom: 16px; }
  .intro > p { max-width: 620px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .results-card { min-height: 520px; margin-top: 0; }
  .quick-notes { flex-wrap: wrap; gap: 10px 24px; padding: 18px 0; }
}

@media (max-width: 560px) {
  .app-shell { width: min(calc(100% - 20px), 480px); }
  .topbar { min-height: 58px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 31px; height: 31px; }
  .privacy-pill { display: none; }
  .intro { padding: 12px 2px 14px; }
  .intro h1 { font-size: clamp(27px, 9vw, 35px); }
  .intro > p { font-size: 12.5px; }
  .workspace { gap: 10px; }
  .controls-card,
  .results-card { border-radius: 20px; }
  .controls-card { padding: 9px; }
  .results-card { min-height: 510px; padding: 15px; }
  .results-header { margin-bottom: 10px; }
  .results-header h2 { font-size: 17px; }
  .soft-button span { display: none; }
  .soft-button { width: 38px; justify-content: center; padding: 0; }
  .position-row { grid-template-columns: repeat(2, 1fr); }
  .word-inputs { grid-template-columns: 1fr; }
  .word-inputs input { font-size: 12px; }
  .result-card { min-height: 62px; padding-left: 12px; }
  .result-password { font-size: clamp(12px, 4vw, 16px); }
  .result-actions { margin-left: 7px; }
  .icon-btn { width: 36px; height: 36px; }
  .breakdown-panel { inset: 72px 15px auto; }
  .breakdown-row { grid-template-columns: 1fr; gap: 3px; }
  .quick-notes { justify-content: flex-start; padding-inline: 4px; }
}

@media (max-width: 380px) {
  .two-cols { grid-template-columns: 1fr; }
  .two-cols .control-block:first-child { border-right: 0; }
  .input-with-note { grid-template-columns: 1fr; gap: 4px; }
  .check-grid { grid-template-columns: repeat(2, 1fr); }
}

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