/* =========================================================
   ONE STEP
   styles.css
   Version 1.00
========================================================= */

:root {
  --background: #f8fafc;
  --foreground: #172033;

  --card: #ffffff;
  --card-subtle: #f3f6fb;

  --primary: #5468e7;
  --primary-dark: #4356d1;
  --primary-soft: #eef0ff;

  --muted: #697386;
  --muted-light: #95a0b2;

  --border: #dce2eb;
  --border-strong: #cad2de;

  --danger: #b73b48;
  --danger-soft: #fff0f1;

  --success: #087d63;

  --shadow:
    0 20px 60px -36px rgba(24, 38, 70, 0.42);

  --header-height: 64px;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}


/* =========================================================
   RESET
========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;

  background: var(--background);
  color: var(--foreground);

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  line-height: 1.45;

  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: var(--primary);
}

.hidden {
  display: none !important;
}


/* =========================================================
   APPLICATION SHELL
========================================================= */

.app-shell {
  width: 100%;
  min-height: 100dvh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;

  width: 100%;
  height: var(--header-height);

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding:
    env(safe-area-inset-top, 0px)
    20px
    0;

  background: rgba(248, 250, 252, 0.91);

  border-bottom: 1px solid rgba(220, 226, 235, 0.55);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  border: 0;
  padding: 8px 4px;

  background: transparent;
  color: var(--foreground);

  font-weight: 750;
  letter-spacing: -0.025em;
}

.brand-icon {
  display: grid;
  place-items: center;

  color: var(--primary);
}

.header-timer {
  padding: 6px 10px;

  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);

  font-size: 0.87rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}


/* =========================================================
   SCREENS
========================================================= */

.screen {
  width: min(100%, 640px);
  min-height: calc(100dvh - var(--header-height));

  margin: 0 auto;

  padding:
    28px
    20px
    max(40px, calc(var(--safe-bottom) + 32px));

  overflow: visible;
}


/*
   iOS Safari does not shrink the layout viewport when the keyboard
   opens -- it simply covers the bottom of the page. src/viewport.js
   measures the covered height from the visual viewport and publishes
   it here, so the page is padded by exactly the keyboard's height
   only while a keyboard is actually open.

   This replaces reserving a blind 48vh of empty space on every
   screen, which left a large dead gap when no keyboard was up.
*/
:root {
  --keyboard-inset: 0px;
}

.setup-screen,
.camera-screen,
.task-screen {
  padding-bottom:
    calc(var(--keyboard-inset) + max(34px, var(--safe-bottom) + 34px));
}


/* =========================================================
   TYPOGRAPHY
========================================================= */

.eyebrow,
.task-eyebrow {
  margin: 0 0 8px;

  color: var(--primary);

  font-size: 0.82rem;
  font-weight: 800;

  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 520px;

  margin-bottom: 14px;

  font-size: clamp(2.4rem, 11vw, 4.15rem);
  line-height: 0.98;

  letter-spacing: -0.057em;
}

h2 {
  margin-bottom: 12px;

  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1;

  letter-spacing: -0.045em;
}

.hero-copy,
.section-heading > p:not(.eyebrow),
.complete-copy {
  max-width: 500px;

  color: var(--muted);

  font-size: 1.06rem;
  line-height: 1.55;
}


/* =========================================================
   SETUP
========================================================= */

.hero-check {
  width: 66px;
  height: 66px;

  display: grid;
  place-items: center;

  margin: 10px 0 26px;

  border-radius: 22px;

  background: var(--primary);
  color: white;

  box-shadow:
    0 22px 48px -25px rgba(84, 104, 231, 0.95);
}

.setup-card {
  margin-top: 28px;
  padding: 20px;

  display: grid;
  gap: 22px;

  border: 1px solid var(--border);

  border-radius: 26px;

  background: var(--card);

  box-shadow: var(--shadow);
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-label,
.session-fieldset legend {
  color: var(--foreground);

  font-size: 0.92rem;
  font-weight: 720;
}

.field-help {
  color: var(--muted);

  font-size: 0.84rem;
  line-height: 1.45;
}

.field-help a {
  font-weight: 700;
  text-underline-offset: 3px;
}


/* =========================================================
   INPUTS
========================================================= */

.text-input,
.select-input,
.textarea-input {
  width: 100%;

  border: 2px solid var(--border);

  outline: none;

  background: white;
  color: var(--foreground);

  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.text-input {
  min-height: 58px;

  padding: 12px 15px;

  border-radius: 17px;

  font-size: 1rem;

  scroll-margin-top: 90px;
}

.goal-input {
  font-size: 1.08rem;
}

.mono-input {
  padding-right: 58px;

  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;

  font-size: 0.94rem;
}

.select-input {
  min-height: 54px;

  padding: 10px 14px;

  border-radius: 15px;

  appearance: auto;
}

.textarea-input {
  min-height: 100px;

  resize: vertical;

  padding: 13px 14px;

  border-radius: 15px;

  line-height: 1.45;

  scroll-margin-top: 90px;
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus {
  border-color: var(--primary);

  box-shadow:
    0 0 0 4px rgba(84, 104, 231, 0.15);
}

.text-input::placeholder,
.textarea-input::placeholder {
  color: var(--muted-light);
}

.password-wrap {
  position: relative;
  display: block;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;

  transform: translateY(-50%);
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-button,
.secondary-button,
.done-button,
.duration-button {
  border: 0;
  outline: none;

  transition:
    transform 100ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.primary-button:active,
.secondary-button:active,
.done-button:active,
.duration-button:active {
  transform: translateY(1px) scale(0.995);
}

.primary-button {
  min-height: 56px;
  width: 100%;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  padding: 12px 20px;

  border-radius: 17px;

  background: var(--primary);
  color: white;

  font-weight: 760;

  box-shadow:
    0 13px 28px -18px rgba(84, 104, 231, 0.9);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.primary-button:disabled {
  opacity: 0.44;
}

.primary-button.compact {
  min-height: 48px;
  width: auto;

  padding: 10px 16px;

  border-radius: 14px;
}

.secondary-button {
  min-height: 49px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 18px;

  border: 1.5px solid var(--border);

  border-radius: 15px;

  background: #fff;
  color: var(--foreground);

  font-weight: 700;
}

.secondary-button:hover {
  background: var(--card-subtle);
}

.icon-button {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 12px;

  background: transparent;

  color: var(--muted);
}

.icon-button:hover {
  background: var(--card-subtle);
}

.text-button {
  border: 0;

  padding: 7px 4px;

  background: transparent;

  color: var(--primary);

  font-size: 0.9rem;
  font-weight: 700;
}

.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* =========================================================
   DURATION
========================================================= */

.session-fieldset {
  margin: 0;
  padding: 0;

  border: 0;
}

.session-fieldset legend {
  margin-bottom: 9px;
}

.duration-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.duration-button {
  min-height: 49px;

  border: 1.5px solid var(--border);

  border-radius: 14px;

  background: white;
  color: var(--foreground);

  font-weight: 700;
}

.duration-button.active {
  border-color: var(--primary);

  background: var(--primary);
  color: white;
}


/* =========================================================
   NOTES / ERRORS
========================================================= */

.privacy-note {
  max-width: 520px;

  margin: 18px auto 0;

  color: var(--muted);

  text-align: center;
  font-size: 0.83rem;
  line-height: 1.45;
}

.error-message {
  margin: 0;

  padding: 11px 13px;

  border-radius: 13px;

  background: var(--danger-soft);
  color: var(--danger);

  font-size: 0.9rem;
  line-height: 1.4;
}


/* =========================================================
   CAMERA
========================================================= */

.camera-screen {
  display: flex;
  flex-direction: column;

  /* No keyboard here, so drop the tall bottom padding the other
     screens keep for it -- it pushed the buttons off-screen. */
  padding-bottom: 0;
}

/* While the live camera runs, the video needs all the room. */
.camera-screen.is-live .section-heading {
  display: none;
}

.camera-screen.is-live {
  padding-top: 12px;
}

.section-heading {
  margin-bottom: 24px;
}

.camera-placeholder,
.camera-stage {
  width: 100%;
  aspect-ratio: 3 / 4;

  border-radius: 26px;

  overflow: hidden;
}

/*
  Sized so heading + preview + the pinned buttons all fit in one
  screen, so the primary action never needs scrolling to.
*/
.camera-placeholder {
  max-height:
    min(
      50vh,
      calc(100dvh - var(--header-height) - 440px)
    );

  min-height: 180px;
}

/* Live: the heading is hidden, and only one button is pinned. */
.camera-stage {
  max-height:
    min(
      66vh,
      calc(100dvh - var(--header-height) - 130px)
    );

  min-height: 240px;
}

.camera-placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;

  border: 2px dashed var(--border-strong);

  background: var(--card-subtle);
  color: var(--muted);

  font-weight: 700;
}

.camera-stage {
  position: relative;

  background: #0a0b0f;
}

.camera-video {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
}

.camera-flash {
  position: absolute;
  inset: 0;

  background: white;
  opacity: 0;

  pointer-events: none;
}

.camera-flash.fire {
  animation: camera-flash 380ms ease-out;
}

@keyframes camera-flash {
  0% {
    opacity: 0.75;
  }

  100% {
    opacity: 0;
  }
}

.scan-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;

  pointer-events: none;
}

.scan-status,
.scan-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 7px 12px;

  border-radius: 999px;

  background: rgba(10, 11, 15, 0.62);
  color: white;

  font-size: 0.84rem;
  font-weight: 750;

  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.scan-status-dot {
  width: 9px;
  height: 9px;

  border-radius: 50%;

  background: #8fa0ff;

  flex-shrink: 0;

  animation: voice-pulse 1.1s ease-in-out infinite;
}

.scan-status[data-tone="warn"] .scan-status-dot {
  background: #ffc857;
}

.scan-status[data-tone="good"] .scan-status-dot {
  background: #4ade80;

  animation: none;
}

.scan-count {
  font-variant-numeric: tabular-nums;
}

.scan-dots {
  display: inline-flex;
  gap: 4px;
}

.scan-dot {
  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: rgba(255, 255, 255, 0.28);

  transition: background-color 200ms ease, transform 200ms ease;
}

.scan-dot.filled {
  background: #4ade80;

  transform: scale(1.15);
}

.scan-thumbs {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;

  display: flex;
  gap: 8px;

  pointer-events: none;
}

.scan-thumb {
  width: 52px;
  height: 52px;

  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;

  object-fit: cover;

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);

  animation: thumb-in 260ms ease-out;
}

@keyframes thumb-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.85);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.camera-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;

  margin-top: auto;
  padding:
    16px
    0
    max(16px, calc(var(--safe-bottom) + 10px));

  display: grid;
  gap: 8px;

  background:
    linear-gradient(
      to top,
      var(--background) 82%,
      rgba(248, 250, 252, 0)
    );
}

.start-camera-button {
  min-height: 68px;

  font-size: 1.14rem;
  font-weight: 800;

  box-shadow:
    0 16px 34px -16px rgba(84, 104, 231, 0.95);
}

.camera-actions .camera-divider {
  margin: 0;
}

/* =========================================================
   CAMERA DIVIDER
========================================================= */

.camera-divider {
  display: flex;
  align-items: center;
  gap: 10px;

  margin: 2px 0;

  color: var(--muted-light);

  font-size: 0.78rem;
  font-weight: 700;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.camera-divider::before,
.camera-divider::after {
  content: "";

  flex: 1;
  height: 1px;

  background: var(--border);
}


/* =========================================================
   TASK SCREEN
========================================================= */

.task-screen {
  display: flex;
  flex-direction: column;
}

.session-goal {
  display: flex;
  flex-direction: column;
  gap: 4px;

  margin-bottom: 20px;

  padding: 13px 15px;

  border-radius: 16px;

  background: var(--primary-soft);
}

.goal-label {
  color: var(--primary-dark);

  font-size: 0.73rem;
  font-weight: 800;

  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#sessionGoalText {
  font-weight: 690;
}


/* =========================================================
   VOICE MODE
========================================================= */

.voice-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;

  margin-top: 16px;
}

.voice-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-left: auto;

  color: var(--muted);

  font-size: 0.83rem;
  font-weight: 700;
}

.voice-select {
  max-width: 190px;

  padding: 7px 10px;

  border: 1.5px solid var(--border);
  border-radius: 999px;

  background: white;
  color: var(--foreground);

  font-size: 0.83rem;
}

.voice-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  padding: 8px 14px;

  border: 1.5px solid var(--border);
  border-radius: 999px;

  background: white;
  color: var(--muted);

  font-size: 0.86rem;
  font-weight: 700;

  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.voice-toggle-button[aria-pressed="true"] {
  border-color: var(--primary);

  background: var(--primary);
  color: white;
}

.voice-listen-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 8px 14px;

  border: 1.5px solid var(--border);
  border-radius: 999px;

  background: white;
  color: var(--foreground);

  font-size: 0.86rem;
  font-weight: 700;
}

.voice-listen-button.listening {
  border-color: var(--primary);

  background: var(--primary-soft);
  color: var(--primary-dark);
}

.voice-listen-dot {
  width: 9px;
  height: 9px;

  border-radius: 50%;

  background: var(--muted-light);

  flex-shrink: 0;
}

.voice-listen-button.listening .voice-listen-dot {
  background: var(--primary);

  animation: voice-pulse 1.1s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.55;
  }
}

.voice-status {
  width: 100%;

  margin: 0;

  color: var(--muted);

  font-size: 0.83rem;
  line-height: 1.4;
}


/*
  Only when a listen produced nothing is there anything to explain,
  so only then does the line look tappable.
*/
.voice-status.has-details {
  color: var(--primary);

  text-decoration: underline;
  text-underline-offset: 2px;

  cursor: pointer;
}


/* =========================================================
   LOADING
========================================================= */

.loading-card {
  min-height: 180px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 16px;

  margin-top: 8px;

  border: 1px solid var(--border);

  border-radius: 24px;

  background: white;

  color: var(--muted);

  text-align: center;

  box-shadow: var(--shadow);
}

.spinner {
  width: 34px;
  height: 34px;

  border: 4px solid var(--primary-soft);
  border-top-color: var(--primary);

  border-radius: 50%;

  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/* =========================================================
   TASK CARD
========================================================= */

.task-card {
  margin-top: 8px;

  padding: 26px 22px 20px;

  border: 1px solid var(--border);

  border-radius: 27px;

  background: white;

  box-shadow: var(--shadow);
}

.task-text {
  margin: 0 0 28px;

  font-size: clamp(1.55rem, 7vw, 2.15rem);
  line-height: 1.15;

  letter-spacing: -0.035em;

  font-weight: 780;
}

.main-task-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.done-button {
  min-height: 58px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  padding: 11px 20px;

  border-radius: 17px;

  background: var(--primary);
  color: white;

  font-size: 1.02rem;
  font-weight: 800;
}

.done-button:hover {
  background: var(--primary-dark);
}

.task-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;

  gap: 4px 8px;

  margin-top: 16px;

  color: var(--muted-light);
}


/* =========================================================
   RESPONSE PANELS
========================================================= */

.response-panel {
  margin-top: 14px;
  padding: 17px;

  border: 1px solid var(--border);

  border-radius: 20px;

  background: white;

  box-shadow:
    0 12px 35px -30px rgba(17, 29, 55, 0.5);
}

.response-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 9px;
}

.response-panel p {
  margin: 0;

  color: var(--foreground);

  line-height: 1.55;
}

.small-close-button {
  width: 36px;
  height: 36px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 10px;

  background: var(--card-subtle);
  color: var(--muted);

  font-size: 1.45rem;
  line-height: 1;
}

.panel-buttons {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;

  gap: 9px;

  margin-top: 12px;
}


/* =========================================================
   TASK ERROR
========================================================= */

.task-error-card {
  margin-top: 8px;
  padding: 20px;

  display: grid;
  gap: 14px;
  justify-items: start;

  border: 1px solid var(--danger-soft);
  border-radius: 24px;

  background: white;

  box-shadow: var(--shadow);
}

.task-error-card .error-message {
  width: 100%;
}

.task-error-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}


/* =========================================================
   END SESSION
========================================================= */

.end-session-button {
  align-self: center;

  margin: 28px auto 0;
  padding: 9px 12px;

  border: 0;

  background: transparent;
  color: var(--muted);

  text-decoration: underline;
  text-underline-offset: 3px;
}


/* =========================================================
   COMPLETE
========================================================= */

.complete-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;

  max-width: 560px;
}

.complete-screen .primary-button {
  margin-top: 8px;
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(84, 104, 231, 0.28);
  outline-offset: 2px;
}

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

    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }
}


/* =========================================================
   DESKTOP
========================================================= */

@media (min-width: 700px) {
  :root {
    --header-height: 68px;
  }

  .screen {
    padding-left: 28px;
    padding-right: 28px;
  }

  .setup-screen {
    padding-top: 46px;
  }

  .setup-card {
    margin-top: 35px;
    padding: 24px;
  }

  .camera-placeholder,
  .camera-stage {
    aspect-ratio: 4 / 3;
  }
}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 390px) {
  .screen {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-header {
    padding-left: 16px;
    padding-right: 16px;
  }

  .setup-card {
    padding: 17px;
  }

  .task-card {
    padding-left: 18px;
    padding-right: 18px;
  }

  .task-secondary-actions {
    gap: 1px 5px;
  }

  .text-button {
    font-size: 0.84rem;
  }
}


/* =========================================================
   API KEY: REMEMBER
========================================================= */

.remember-row {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 4px 0;

  color: var(--foreground);

  font-size: 0.92rem;
  font-weight: 650;
}

.remember-row input {
  width: 20px;
  height: 20px;

  margin: 0;

  accent-color: var(--primary);
}


/* =========================================================
   GOAL SUGGESTIONS
========================================================= */

.select-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-row .select-input {
  flex: 1;
  min-width: 0;
}

/* Only offered for goals the user has actually saved. */
.select-forget {
  flex-shrink: 0;

  width: 46px;
  height: 46px;

  border: 1.5px solid var(--border);
  border-radius: 14px;

  font-size: 1.35rem;
  line-height: 1;
}

.select-forget:hover,
.select-forget:active {
  border-color: var(--danger);

  background: var(--danger-soft);
  color: var(--danger);
}

.goal-input-wrap {
  position: relative;
  display: block;
}

.goal-input-wrap .goal-input {
  padding-right: 58px;
}

.goal-mic {
  position: absolute;
  top: 50%;
  right: 8px;

  transform: translateY(-50%);
}

.goal-mic.listening {
  background: var(--primary-soft);
  color: var(--primary-dark);

  animation: voice-pulse 1.1s ease-in-out infinite;
}


/* =========================================================
   PAN HELP BUTTON
========================================================= */

.scan-help-button {
  position: absolute;
  right: 12px;
  bottom: 12px;

  width: 36px;
  height: 36px;

  border: 0;
  border-radius: 50%;

  background: rgba(10, 11, 15, 0.62);
  color: white;

  font-size: 1.05rem;
  font-weight: 800;

  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}


/* =========================================================
   DIALOG (POP-UP)
========================================================= */

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;

  display: grid;
  place-items: center;

  padding:
    20px
    20px
    max(20px, var(--safe-bottom));

  background: rgba(17, 24, 39, 0.5);

  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);

  animation: dialog-fade 160ms ease-out;
}

.dialog {
  width: min(100%, 400px);
  max-height: 100%;

  overflow-y: auto;

  padding: 26px 22px 20px;

  border-radius: 28px;

  background: white;

  box-shadow: 0 30px 80px -20px rgba(10, 16, 32, 0.6);

  outline: none;

  animation: dialog-pop 220ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.dialog-art {
  display: grid;
  place-items: center;

  margin: -4px 0 14px;

  color: var(--primary);
}

.dialog-title {
  margin: 0 0 10px;

  font-size: 1.55rem;
  line-height: 1.1;

  letter-spacing: -0.03em;
}

.dialog-body {
  color: var(--muted);

  font-size: 1.02rem;
  line-height: 1.5;
}

.dialog-body p {
  margin: 0 0 10px;
}

.dialog-body ol {
  margin: 0 0 6px;
  padding-left: 22px;
}

.dialog-body li {
  margin-bottom: 8px;
}

.dialog-body strong {
  color: var(--foreground);
}

.dialog-actions {
  display: grid;
  gap: 10px;

  margin-top: 20px;
}

.dialog-actions.row {
  grid-template-columns: 1fr 1fr;
}

@keyframes dialog-fade {
  from {
    opacity: 0;
  }
}

@keyframes dialog-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}

.pan-art-phone {
  animation: pan-sweep 2.4s ease-in-out infinite;
}

@keyframes pan-sweep {
  0%,
  100% {
    transform: translateX(-26px) rotate(-8deg);
  }

  50% {
    transform: translateX(26px) rotate(8deg);
  }
}

body.dialog-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .pan-art-phone {
    animation: none;
  }
}


/* =========================================================
   INLINE LINK BUTTON
========================================================= */

.link-button {
  padding: 0;

  border: 0;
  background: transparent;

  color: var(--primary);

  font: inherit;
  font-weight: 700;

  text-decoration: underline;
  text-underline-offset: 3px;
}
