:root {
  --ink: #eef7ff;
  --muted: #9db1c5;
  --quiet: #6f8498;
  --bg: #07131f;
  --bg-deep: #040b12;
  --panel: #0d1d2b;
  --panel-raised: #112638;
  --line: rgba(157, 196, 224, 0.16);
  --blue: #69c8ff;
  --blue-deep: #1677a8;
  --orange: #ffad5c;
  --green: #75d6aa;
  --red: #ff7b7b;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 13px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --text-scale: 1;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg-deep);
}

body[data-text-scale="large"] {
  --text-scale: 1.12;
}

body[data-text-scale="xlarge"] {
  --text-scale: 1.24;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 300px;
  background: var(--bg-deep);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% -10%, rgba(46, 145, 197, 0.21), transparent 35rem),
    radial-gradient(circle at 100% 26%, rgba(255, 173, 92, 0.08), transparent 25rem),
    linear-gradient(180deg, #081725 0%, var(--bg-deep) 100%);
  color: var(--ink);
  font-size: calc(1rem * var(--text-scale));
  line-height: 1.55;
}

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

button {
  font: inherit;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  transform: translateY(-160%);
  border-radius: 0.7rem;
  background: var(--ink);
  color: var(--bg);
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 840px);
  margin: 0 auto;
  padding: 0.9rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 11, 18, 0.83);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.55rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(105, 200, 255, 0.46);
  border-radius: 0.85rem;
  background: linear-gradient(145deg, rgba(105, 200, 255, 0.22), rgba(22, 119, 168, 0.08));
  color: var(--blue);
  font-size: 1.15rem;
  font-weight: 900;
}

.brand span:last-child {
  display: grid;
  line-height: 1.15;
}

.brand strong {
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 0.24rem;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  min-width: 3rem;
  min-height: 3rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(17, 38, 56, 0.72);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

main {
  width: min(100%, 840px);
  margin: 0 auto;
}

.screen {
  min-height: 66vh;
  padding: clamp(1.35rem, 5vw, 2.75rem) clamp(1rem, 4vw, 2rem) 3.5rem;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--blue);
  font-size: 0.73em;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 7vw, 3.7rem) clamp(1.25rem, 6vw, 3.4rem);
  border: 1px solid rgba(105, 200, 255, 0.22);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(17, 38, 56, 0.96), rgba(8, 23, 37, 0.94)),
    var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel::after {
  position: absolute;
  width: 14rem;
  height: 14rem;
  right: -6rem;
  bottom: -8rem;
  border: 1px solid rgba(105, 200, 255, 0.26);
  border-radius: 50%;
  box-shadow: 0 0 0 2rem rgba(105, 200, 255, 0.025), 0 0 0 4rem rgba(105, 200, 255, 0.02);
  content: "";
}

.hero-panel h1 {
  position: relative;
  z-index: 1;
  max-width: 12ch;
  margin-bottom: 1.2rem;
  font-size: clamp(2.45rem, 11vw, 4.7rem);
}

.hero-panel h1 span {
  color: var(--blue);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 37rem;
  margin-bottom: 1.6rem;
  color: var(--muted);
  font-size: 1.02em;
}

.primary-actions,
.phase-navigation {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  min-height: 3.45rem;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 820;
  text-align: center;
}

.button-primary {
  background: var(--blue);
  color: #032033;
  box-shadow: 0 12px 30px rgba(105, 200, 255, 0.15);
}

.button-secondary {
  border-color: var(--line);
  background: rgba(17, 38, 56, 0.75);
  color: var(--ink);
}

.section-heading {
  margin: 2.6rem 0 1rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.65em;
}

.section-heading-inline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading-inline > span {
  color: var(--quiet);
  font-size: 0.78em;
  font-weight: 750;
}

.quick-grid {
  display: grid;
  gap: 0.75rem;
}

.quick-grid .section-heading {
  grid-column: 1 / -1;
}

.quick-card {
  display: grid;
  min-height: 5.4rem;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(13, 29, 43, 0.86);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.quick-card.accent {
  border-color: rgba(255, 173, 92, 0.28);
  background: linear-gradient(135deg, rgba(255, 173, 92, 0.09), rgba(13, 29, 43, 0.9));
}

.quick-card > span:nth-child(2) {
  display: grid;
  gap: 0.15rem;
}

.quick-card small {
  color: var(--muted);
}

.quick-icon {
  display: grid;
  width: 2.55rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 0.8rem;
  background: rgba(255, 173, 92, 0.16);
  color: var(--orange);
  font-size: 1.15rem;
  font-weight: 900;
}

.quick-icon.quiet {
  background: rgba(105, 200, 255, 0.12);
  color: var(--blue);
}

.phase-rows {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(13, 29, 43, 0.72);
}

.phase-row {
  display: grid;
  width: 100%;
  min-height: 5rem;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.phase-row:last-child {
  border-bottom: 0;
}

.phase-number {
  color: var(--blue);
  font-size: 0.72em;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.phase-copy {
  display: grid;
  gap: 0.15rem;
}

.phase-copy small {
  color: var(--muted);
}

.row-arrow {
  color: var(--quiet);
  font-size: 1.2rem;
}

.resume-tag {
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  background: rgba(117, 214, 170, 0.13);
  color: var(--green);
  font-size: 0.67em;
  font-weight: 850;
  text-transform: uppercase;
}

.privacy-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  margin-top: 1.3rem;
  padding: 1rem;
  border: 1px dashed rgba(117, 214, 170, 0.26);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.83em;
}

.privacy-note span {
  color: var(--green);
  font-weight: 900;
}

.privacy-note p {
  margin: 0;
}

.privacy-note strong {
  color: var(--ink);
}

.screen-topline {
  display: flex;
  min-height: 2.8rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.7rem;
  color: var(--quiet);
  font-size: 0.78em;
  font-weight: 750;
}

.text-button {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}

.phase-heading {
  margin-bottom: 1.5rem;
}

.phase-heading h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2.4rem, 10vw, 4.25rem);
}

.phase-heading > p:not(.eyebrow) {
  max-width: 35rem;
  color: var(--muted);
}

.compact-heading h1 {
  font-size: clamp(2.35rem, 10vw, 4rem);
}

.progress {
  overflow: hidden;
  height: 0.26rem;
  border-radius: 999px;
  background: rgba(157, 196, 224, 0.12);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-deep), var(--blue));
}

.cue-list {
  display: grid;
  gap: 0.85rem;
}

.cue-card {
  position: relative;
  overflow: hidden;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(13, 29, 43, 0.86);
}

.cue-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0.22rem;
  background: var(--blue);
  content: "";
}

.cue-card.tone-alert::before {
  background: var(--red);
}

.cue-card.tone-attention::before {
  background: var(--orange);
}

.cue-card.tone-positive::before {
  background: var(--green);
}

.cue-card h2 {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.73em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cue-card ul {
  display: grid;
  gap: 0.68rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cue-card li {
  font-size: 1.02em;
  font-weight: 680;
  line-height: 1.43;
}

.emergency-button {
  width: 100%;
  margin: 1rem 0;
  border-color: rgba(255, 173, 92, 0.26);
  background: rgba(255, 173, 92, 0.1);
  color: var(--orange);
}

.reframe-group {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.7rem;
}

.reframe-group > .eyebrow {
  margin-bottom: 0.15rem;
}

.reframe-row {
  display: grid;
  min-height: 4.6rem;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(13, 29, 43, 0.86);
}

.reframe-phrase,
.favorite-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.reframe-phrase {
  padding: 0.9rem 1rem;
  font-size: 1.08em;
  font-weight: 780;
  text-align: left;
}

.favorite-button {
  min-width: 3.8rem;
  border-left: 1px solid var(--line);
  color: var(--orange);
  font-size: 1.35rem;
}

.reframe-overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: #020609;
}

.reframe-overlay[hidden] {
  display: none;
}

.reframe-overlay p {
  display: grid;
  max-width: 18ch;
  place-self: center;
  color: var(--orange);
  font-size: clamp(2.7rem, 12vw, 7rem);
  font-weight: 900;
  line-height: 1.02;
  text-align: center;
}

.overlay-close {
  min-width: 6rem;
  min-height: 3rem;
  justify-self: end;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.overlay-open {
  overflow: hidden;
}

.discreet-screen {
  display: grid;
  min-height: calc(100vh - 5rem);
  align-content: start;
}

.discreet-words,
.discreet-actions {
  display: grid;
  justify-items: center;
  gap: clamp(1.5rem, 7vh, 3.4rem);
}

.discreet-words {
  margin-top: clamp(1rem, 6vh, 3rem);
}

.discreet-words strong {
  font-size: clamp(2.2rem, 9vw, 4.8rem);
  line-height: 1;
}

.discreet-divider {
  width: 4rem;
  height: 1px;
  margin: clamp(2.2rem, 8vh, 4rem) auto;
  background: var(--line);
}

.discreet-actions button {
  padding: 0.25rem;
  border: 0;
  background: transparent;
  color: var(--orange);
  cursor: pointer;
  font-size: clamp(1.75rem, 7vw, 3.3rem);
  font-weight: 850;
}

body[data-discreet="true"] {
  background: #020609;
}

body[data-discreet="true"] .app-footer {
  display: none;
}

.app-footer {
  display: flex;
  width: min(100%, 840px);
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 0.75em;
}

.app-footer p {
  max-width: 34rem;
  margin: 0;
}

.app-footer strong {
  color: var(--muted);
}

.app-footer a {
  color: var(--blue);
  font-weight: 800;
}

.static-fallback ol {
  display: grid;
  gap: 0.6rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  white-space: nowrap !important;
}

@media (min-width: 640px) {
  .primary-actions,
  .phase-navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cue-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .cue-card:only-child {
    grid-column: 1 / -1;
  }
}

@media (hover: hover) {
  .button,
  .quick-card,
  .phase-row,
  .icon-button,
  .reframe-row,
  .text-button {
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
  }

  .button:hover,
  .quick-card:hover,
  .phase-row:hover,
  .icon-button:hover,
  .reframe-row:hover {
    border-color: rgba(105, 200, 255, 0.43);
  }

  .button:hover,
  .quick-card:hover,
  .phase-row:hover {
    transform: translateY(-2px);
  }

  .text-button:hover,
  .app-footer a:hover {
    color: var(--orange);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
