/* ═══════════════════════════════════════════════
   RESPONSIVE — Orbit
   Mobile-first breakpoints
   ═══════════════════════════════════════════════ */

/* ── Viewport profiles (specific devices) ── */
body[data-viewport-profile^="iphone"] {
  --shell-padding: clamp(12px, 3.6vw, 16px);
  --nav-height: 62px;
  --fab-size: 50px;
}

body[data-viewport-profile="iphone-pro-max"] {
  --shell-padding: clamp(14px, 3.2vw, 18px);
  --nav-height: 64px;
  --fab-size: 52px;
}

body[data-viewport-profile^="iphone"] #app > * {
  padding-top: calc(clamp(12px, 1.8vh, 20px) + (env(safe-area-inset-top, 0px) * 0.25));
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 44px);
}

body[data-route="welcome"][data-viewport-profile^="iphone"] #app > .welcome-view {
  padding-top: calc(clamp(14px, 2.2vh, 26px) + (env(safe-area-inset-top, 0px) * 0.18));
  padding-bottom: max(var(--space-lg), calc(var(--safe-bottom) + var(--space-md)));
}

body[data-viewport-profile^="iphone"] .welcome-view {
  max-width: 100%;
}

body[data-viewport-profile^="iphone"] .welcome-hero {
  padding: clamp(16px, 3.8vw, 22px);
  border-radius: 22px;
}

body[data-viewport-profile^="iphone"] .welcome-profile-column,
body[data-viewport-profile^="iphone"] .welcome-gate-card {
  padding: 12px;
  border-radius: 16px;
}

body[data-viewport-profile^="iphone"] .welcome-gate-copy {
  font-size: 12.5px;
}

body[data-viewport-profile^="iphone"] .space-view {
  padding: 0;
  gap: 12px;
}

body[data-viewport-profile^="iphone"] .space-header {
  padding: 8px 10px;
}

body[data-viewport-profile^="iphone"] .space-music-list.space-music-list--embed {
  grid-template-columns: 1fr;
}

body[data-viewport-profile^="iphone"] .space-music-embed-wrap {
  aspect-ratio: 16 / 8.8;
  min-height: clamp(190px, 44vw, 240px);
  max-height: 280px;
}

body[data-viewport-profile^="iphone"] .space-music-embed-wrap[data-embed-provider="yandex"][data-embed-layout="track"] {
  aspect-ratio: 16 / 5.8;
  min-height: clamp(140px, 30vw, 180px);
  max-height: 200px;
}

body[data-viewport-profile^="iphone"] .space-music-embed-wrap[data-embed-provider="yandex"][data-embed-layout="album"],
body[data-viewport-profile^="iphone"] .space-music-embed-wrap[data-embed-provider="yandex"][data-embed-layout="playlist"],
body[data-viewport-profile^="iphone"] .space-music-embed-wrap[data-embed-provider="yandex"][data-embed-layout="collection"] {
  aspect-ratio: 16 / 9.3;
  min-height: clamp(200px, 48vw, 280px);
  max-height: 320px;
}

body[data-viewport-profile^="iphone"] .space-music-embed-keepalive {
  width: calc(100vw - 16px);
  height: clamp(62px, 8vw, 72px);
}

body[data-viewport-profile^="iphone"] .space-music-embed-head {
  grid-template-columns: auto minmax(0, 1fr);
}

body[data-viewport-profile^="iphone"] .space-music-embed-state {
  grid-column: 1 / -1;
  justify-self: flex-start;
}

body[data-viewport-profile^="iphone"] .space-music-embed-sub {
  display: none;
}

body[data-viewport-profile^="iphone"] .space-music-embed-main-btn {
  flex: 1 1 100%;
}

body[data-viewport-profile^="iphone"] .space-music-embed-close {
  width: 18px;
  height: 18px;
  top: 4px;
  right: 4px;
}

body[data-viewport-profile^="iphone"] .flow-view {
  gap: var(--space-md);
  padding-bottom: var(--space-xl);
}

body[data-viewport-profile^="iphone"] .flow-mode-switch {
  width: 100%;
}

body[data-viewport-profile^="iphone"] .flow-mode-btn {
  padding: 0 6px;
  font-size: 11px;
}

body[data-viewport-profile^="iphone"] .flow-cmd-panel {
  width: min(100vw - 12px, 700px);
  max-height: min(84dvh, 620px);
  border-radius: 14px;
  padding: 8px;
}

body[data-viewport-profile^="iphone"] .flow-cmd-item {
  padding: 7px 9px;
}

body[data-viewport-profile^="iphone"] .flow-quick-actions {
  grid-template-columns: 1fr;
}

body[data-viewport-profile^="iphone"] .flow-year-grid {
  grid-template-columns: 1fr;
}

body[data-viewport-profile^="iphone"] .flow-extended-stats {
  grid-template-columns: 1fr;
}

body[data-viewport-profile^="iphone"] .sheet {
  max-height: 92dvh;
  padding-left: clamp(12px, 3.8vw, 16px);
  padding-right: clamp(12px, 3.8vw, 16px);
  border-radius: 24px 24px 0 0 / 20px 20px 0 0;
}

body[data-viewport-profile^="iphone"] .nav-bar {
  width: calc(100% - 14px);
}

body[data-viewport-profile^="iphone"] .session-exit-btn {
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  right: auto;
  left: 10px;
  bottom: auto;
  min-height: 34px;
  padding: 0 10px;
  gap: 4px;
}

body[data-viewport-profile^="iphone"] .session-exit-label {
  display: none;
}

body[data-viewport-profile^="iphone"] .session-exit-icon {
  width: 20px;
  height: 20px;
}

body[data-viewport-profile="iphone-pro-max"] .session-exit-btn {
  padding-right: 11px;
}

body[data-viewport-profile="iphone-pro-max"] .session-exit-label {
  display: inline;
}

body[data-viewport-profile^="iphone"][data-viewport-orientation="landscape"] {
  --nav-height: 56px;
  --fab-size: 46px;
}

body[data-viewport-profile^="iphone"][data-viewport-orientation="landscape"] #app > * {
  padding-top: calc(8px + (env(safe-area-inset-top, 0px) * 0.08));
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 28px);
}

body[data-route="welcome"][data-viewport-profile^="iphone"][data-viewport-orientation="landscape"] #app > .welcome-view {
  padding-top: calc(8px + (env(safe-area-inset-top, 0px) * 0.08));
  padding-bottom: max(var(--space-md), calc(var(--safe-bottom) + var(--space-sm)));
}

body[data-viewport-profile^="iphone"][data-viewport-orientation="landscape"] .welcome-hero {
  padding: 12px 14px;
}

body[data-viewport-profile^="iphone"][data-viewport-orientation="landscape"] .welcome-title {
  font-size: clamp(1.5rem, 1.05rem + 2vw, 2rem);
}

body[data-viewport-profile^="iphone"][data-viewport-orientation="landscape"] .welcome-orbit-stage {
  min-height: 140px;
}

body[data-viewport-profile^="iphone"][data-viewport-orientation="landscape"] .session-exit-btn {
  top: calc(env(safe-area-inset-top, 0px) + 6px);
}

body[data-nav-layout="top"][data-viewport-profile^="iphone"] {
  --top-shell-offset: calc(env(safe-area-inset-top, 0px) + 6px);
}

body[data-nav-layout="top"][data-viewport-profile^="iphone"]:not([data-route="welcome"]) #app > * {
  padding-top: calc(var(--top-shell-clearance) + var(--global-player-reserve, 0px));
  padding-bottom: calc(var(--safe-bottom) + var(--space-xl));
}

body[data-nav-layout="top"][data-viewport-profile^="iphone"] .top-shell-nav {
  width: calc(100% - 14px);
}

body[data-nav-layout="top"][data-viewport-profile^="iphone"] .top-shell-frame {
  border-radius: 22px;
  padding: 8px;
  gap: 8px;
}

body[data-nav-layout="top"][data-viewport-profile^="iphone"] .top-shell-id-subtitle {
  display: none;
}

body[data-nav-layout="top"][data-viewport-profile^="iphone"] .top-shell-row.has-player {
  grid-template-columns: minmax(0, 1fr) auto;
}

body[data-nav-layout="top"][data-viewport-profile^="iphone"] .top-shell-row.has-player .top-shell-identity {
  max-width: none;
}

body[data-nav-layout="top"][data-viewport-profile^="iphone"] .top-shell-row.has-player .top-shell-player-host {
  grid-column: 1 / -1;
}

body[data-nav-layout="top"][data-viewport-profile^="iphone"] .global-player-bar.is-inline .global-player-time,
body[data-nav-layout="top"][data-viewport-profile^="iphone"] .global-player-bar.is-inline .global-player-ctrl-back,
body[data-nav-layout="top"][data-viewport-profile^="iphone"] .global-player-bar.is-inline .global-player-ctrl-forward {
  display: none;
}

body[data-nav-layout="top"][data-viewport-profile^="iphone"] .top-shell-tab {
  min-height: 40px;
  padding: 0 10px;
}

body[data-nav-layout="top"][data-viewport-profile^="iphone"][data-viewport-orientation="landscape"] {
  --top-shell-offset: calc(env(safe-area-inset-top, 0px) + 4px);
}

body[data-nav-layout="top"][data-viewport-profile^="iphone"][data-viewport-orientation="landscape"]:not([data-route="welcome"]) #app > * {
  padding-top: calc(var(--top-shell-clearance) + var(--global-player-reserve, 0px));
  padding-bottom: calc(var(--safe-bottom) + var(--space-xl));
}

body[data-viewport-profile="ipad-pro"] {
  --content-max: min(1020px, calc(100vw - 64px));
  --shell-padding: clamp(18px, 2.2vw, 28px);
  --nav-height: 70px;
  --fab-size: 56px;
}

body[data-viewport-profile="ipad-pro"] #app > * {
  padding-top: calc(clamp(18px, 2.2vh, 30px) + (env(safe-area-inset-top, 0px) * 0.18));
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 56px);
}

body[data-route="welcome"][data-viewport-profile="ipad-pro"] #app > .welcome-view {
  padding-top: calc(clamp(18px, 2.2vh, 30px) + (env(safe-area-inset-top, 0px) * 0.12));
  padding-bottom: max(var(--space-xl), calc(var(--safe-bottom) + var(--space-lg)));
}

body[data-viewport-profile="ipad-pro"] .nav-bar {
  width: min(calc(var(--content-max) + 108px), calc(100% - 36px));
  bottom: calc(12px + var(--safe-bottom));
  padding: 7px 12px;
  border-radius: 24px;
}

body[data-viewport-profile="ipad-pro"] .nav-icon-wrap {
  width: 60px;
  height: 32px;
}

body[data-viewport-profile="ipad-pro"] .fab-button {
  width: 54px;
  height: 54px;
  border-radius: 18px;
}

body[data-viewport-profile="ipad-pro"] .session-exit-btn {
  right: max(14px, calc((100vw - var(--content-max)) / 2 + 14px));
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: auto;
  bottom: auto;
}

body[data-viewport-profile="ipad-pro"][data-dev-mode="1"] .session-exit-btn {
  top: calc(env(safe-area-inset-top, 0px) + 106px);
}

body[data-nav-layout="top"][data-viewport-profile="ipad-pro"] {
  --top-shell-offset: calc(env(safe-area-inset-top, 0px) + 10px);
}

body[data-nav-layout="top"][data-viewport-profile="ipad-pro"]:not([data-route="welcome"]) #app > * {
  padding-top: calc(var(--top-shell-clearance) + var(--global-player-reserve, 0px));
  padding-bottom: calc(var(--safe-bottom) + var(--space-2xl));
}

body[data-nav-layout="top"][data-viewport-profile="ipad-pro"] .top-shell-nav {
  width: min(1320px, calc(100% - 26px));
}

body[data-nav-layout="top"][data-viewport-profile="ipad-pro"] .top-shell-menu {
  right: 12px;
}

body[data-viewport-profile="ipad-pro"] .sheet {
  max-width: min(720px, calc(100vw - 72px));
}

body[data-viewport-profile="ipad-pro"] .welcome-view {
  gap: var(--space-lg);
}

body[data-viewport-profile="ipad-pro"] .welcome-console {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

body[data-viewport-profile="ipad-pro"] .space-view {
  gap: clamp(14px, 1.8vw, 22px);
  padding: clamp(8px, 1vw, 14px);
}

body[data-viewport-profile="ipad-pro"] .space-music-embed-wrap {
  min-height: clamp(260px, 30vw, 420px);
  max-height: 460px;
}

body[data-viewport-profile="ipad-pro"] .space-music-embed-wrap[data-embed-provider="yandex"][data-embed-layout="track"] {
  min-height: clamp(180px, 20vw, 250px);
  max-height: 280px;
}

body[data-viewport-profile="ipad-pro"] .space-music-embed-wrap[data-embed-provider="yandex"][data-embed-layout="album"],
body[data-viewport-profile="ipad-pro"] .space-music-embed-wrap[data-embed-provider="yandex"][data-embed-layout="playlist"],
body[data-viewport-profile="ipad-pro"] .space-music-embed-wrap[data-embed-provider="yandex"][data-embed-layout="collection"] {
  min-height: clamp(280px, 34vw, 440px);
  max-height: 500px;
}

body[data-viewport-profile="ipad-pro"] .space-music-embed-keepalive {
  width: min(calc(var(--content-max, 1020px) + 42px), calc(100vw - 24px));
  height: clamp(64px, 6.5vw, 80px);
}

body[data-viewport-profile="ipad-pro"] .flow-calendar-layout {
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.92fr);
  gap: 14px;
}

body[data-viewport-profile="ipad-pro"] .flow-week-strip,
body[data-viewport-profile="ipad-pro"] .flow-week-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

body[data-viewport-profile="ipad-pro"] .dev-profile-switcher {
  width: min(300px, calc(100vw - 36px));
}

/* ── Mobile modal (phones up to 768px) ── */
@media (max-width: 768px) {
  .tg-section-modal-overlay {
    align-items: flex-end;
    padding: 8px 8px 0;
  }

  .tg-section-modal {
    width: 100%;
    max-height: 100%;
    border-radius: 16px 16px 0 0;
    padding: 10px;
  }

  .tg-section-modal-tabs {
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 8px 4px 2px;
  }

  .tg-section-modal-tabs::-webkit-scrollbar {
    display: none;
  }

  .tg-section-modal-body {
    gap: var(--space-md);
    padding-bottom: calc(var(--safe-bottom) + 12px);
  }

  .tg-hub-grid {
    grid-template-columns: 1fr;
  }

  .tg-ritual-modal-overlay {
    align-items: flex-end;
    padding: 8px 8px 0;
  }

  .tg-ritual-modal {
    width: 100%;
    max-height: 100%;
    border-radius: 16px 16px 0 0;
  }

  .tg-note-modal {
    width: min(500px, calc(100vw - 16px));
    max-height: min(86dvh, 720px);
    overflow-y: auto;
  }

  .dev-profile-switcher {
    right: 8px;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    width: min(240px, calc(100vw - 16px));
  }

  .session-exit-btn {
    right: 8px;
    top: calc(var(--safe-top) + 8px);
    bottom: auto;
  }

  .welcome-console {
    grid-template-columns: 1fr;
  }

  .welcome-ritual-rail {
    grid-template-columns: 1fr;
  }

  .welcome-signal-grid {
    grid-template-columns: 1fr;
  }

  .welcome-step-chip {
    grid-template-columns: auto 1fr;
  }

  .welcome-orbit-user--left {
    left: 8%;
  }

  .welcome-orbit-user--right {
    right: 8%;
  }
}

/* ── Medium (640px+) ── */
@media (min-width: 640px) {
  .goals-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .orbit-hero {
    padding: var(--space-lg) var(--space-xl);
  }

  .flow-day-cell {
    min-height: 82px;
  }

  .sheet {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .space-dream-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .space-avatar {
    width: 128px;
    height: 128px;
  }
}

/* ── Small phones (<=520px) ── */
@media (max-width: 520px) {
  .welcome-view {
    gap: var(--space-md);
  }

  .welcome-title {
    font-size: clamp(1.7rem, 1.2rem + 2.6vw, 2.3rem);
  }

  .welcome-orbit-stage {
    min-height: 170px;
  }

  .welcome-orbit-avatar {
    width: 52px;
    height: 52px;
  }

  .welcome-orbit-user--left {
    left: 4%;
  }

  .welcome-orbit-user--right {
    right: 4%;
  }

  .welcome-profile-btn {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      'avatar text'
      'arrow arrow';
    row-gap: 8px;
  }

  .welcome-profile-avatar-wrap {
    grid-area: avatar;
  }

  .welcome-profile-text {
    grid-area: text;
  }

  .welcome-profile-arrow {
    grid-area: arrow;
    justify-self: end;
  }

  .welcome-profile-state {
    font-size: 9px;
    letter-spacing: 0.02em;
    padding: 0 6px;
  }

  .welcome-gate-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .welcome-brand-badge {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .welcome-brand-badge-icon {
    justify-self: flex-start;
  }

  .welcome-input--emoji {
    max-width: 100%;
    text-align: left;
    font-size: 16px;
  }

  .welcome-cta {
    width: 100%;
  }

  .welcome-launch-card {
    padding: 16px;
  }

  .welcome-launch-line {
    font-size: 13px;
  }

  .dev-profile-switcher {
    width: calc(100vw - 16px);
    right: 8px;
  }

  .session-exit-btn {
    right: 8px;
    top: calc(var(--safe-top) + 8px);
    bottom: auto;
    min-height: 34px;
    padding: 0 12px;
    font-size: 10.5px;
  }

  /* ── Together responsive (mobile) ── */
  .tg-hub-card {
    min-height: auto;
    padding: 10px;
  }

  .tg-hub-title {
    font-size: 0.94rem;
  }

  .tg-hub-subtitle {
    font-size: 0.75rem;
  }

  .tg-section-modal-tab {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.73rem;
  }

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

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

  .tg-goal-context {
    font-size: 10px;
  }

  .tg-goal-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tg-goal-actions {
    width: 100%;
    margin-left: 0;
  }

  .tg-goal-actions .btn {
    flex: 1;
    min-width: 0;
  }

  .tg-digest-grid {
    grid-template-columns: 1fr;
  }

  .tg-digest-insights,
  .tg-digest-actions {
    grid-template-columns: 1fr;
  }

  .tg-digest-score-value {
    font-size: 1.28rem;
  }

  .tg-checkin-meta {
    flex-wrap: wrap;
  }

  .tg-checkin-shortcut {
    width: 100%;
  }

  .tg-checkin-pulse-grid,
  .tg-checkin-pulse-people {
    grid-template-columns: 1fr;
  }

  .tg-checkin-send {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }

  .tg-pulse-factor {
    grid-template-columns: auto minmax(0, 1fr) auto auto 48px;
    gap: 4px;
  }

  .tg-pulse-factor-score {
    min-width: 30px;
    font-size: 10px;
  }

  .tg-pulse-analytics {
    grid-template-columns: 1fr;
  }

  .tg-pulse-trend-chart {
    gap: 3px;
  }

  .tg-pulse-controls {
    justify-content: stretch;
  }

  .tg-pulse-autoplan-open,
  .tg-pulse-history-open {
    width: 100%;
    justify-content: center;
  }

  .tg-pulse-history-overlay {
    padding: 8px;
  }

  .tg-pulse-history-modal {
    border-radius: 14px;
    padding: 10px;
    max-height: 88vh;
  }

  .tg-pulse-history-row {
    grid-template-columns: 1fr 1fr auto;
    gap: 7px;
  }

  .tg-pulse-history-date {
    font-size: 11px;
  }

  .tg-ritual-presets {
    grid-template-columns: 1fr;
  }

  .tg-hero-avatar {
    width: 52px;
    height: 52px;
  }

  .tg-nudge-btn {
    min-width: 62px;
    padding: var(--space-xs) var(--space-sm);
  }

  .tg-nudge-stat {
    font-size: 10px;
  }

  .tg-nudge-quick-btn {
    min-height: 28px;
    padding: 0 10px;
    font-size: 10px;
  }

  .tg-nudge-received-card {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "emoji body"
      "time time"
      "actions actions";
    align-items: start;
  }

  .tg-nudge-received-time {
    justify-self: start;
  }

  .tg-nudge-received-actions {
    justify-content: stretch;
  }

  .tg-nudge-reply-btn {
    width: 100%;
  }

  .tg-notify-actions {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
  }

  .tg-chat-thread-row {
    gap: 6px;
  }

  .tg-chat-thread-chip {
    min-height: 32px;
    padding: 0 10px;
  }

  .tg-chat-messages {
    max-height: 240px;
  }

  .tg-chat-msg-row {
    gap: 6px;
  }

  .tg-chat-msg-avatar {
    width: 20px;
    height: 20px;
    font-size: 9px;
  }

  .tg-chat-msg {
    max-width: 94%;
  }

  .tg-chat-actions {
    justify-content: stretch;
  }

  .tg-chat-send-btn {
    width: 100%;
    min-width: 0;
  }

  .tg-note-modal {
    padding: 12px;
    border-radius: 16px;
  }

  .tg-note-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .geo-z-map {
    height: 300px;
  }

  .geo-z-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .geo-z-btn {
    justify-content: center;
  }

  .geo-z-manual-row {
    grid-template-columns: 1fr;
  }

  .geo-z-ring {
    width: 44px;
    height: 44px;
  }
  .geo-z-pulse {
    width: 44px;
    height: 44px;
    margin-left: -22px;
  }

  .geo-z-empty-title {
    font-size: 16px;
  }
  .geo-z-empty-text {
    font-size: 12px;
  }

  .tg-ritual-game-top {
    grid-template-columns: 1fr;
  }

  .tg-ritual-care-bank {
    justify-self: start;
  }

  .tg-ritual-cover-image {
    height: 124px;
  }

  .tg-ritual-milestone-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .tg-ritual-milestone-state {
    grid-column: 1 / -1;
    text-align: left;
  }

  .tg-ritual-history-map {
    grid-template-columns: repeat(14, minmax(0, 1fr));
  }

  .tg-ritual-task-reward {
    flex-direction: column;
    align-items: flex-start;
  }

  .tg-ritual-task-reward-btn {
    width: 100%;
  }

  .tg-ritual-actions {
    flex-wrap: wrap;
  }

  .tg-ritual-open {
    width: 100%;
  }

  .tg-ritual-cover-large .tg-ritual-cover-image {
    height: 170px;
  }

  .tg-ritual-rule-row {
    flex-wrap: wrap;
  }

  .tg-ritual-achievements-grid {
    grid-template-columns: 1fr;
  }

  .tg-chat-composer-meta {
    flex-wrap: wrap;
  }

  .tg-chat-shortcut {
    width: 100%;
  }

  .tg-chat-jump-btn {
    width: 100%;
  }

  /* ── Space responsive ── */
  .space-dream-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .space-dream-stat:last-child {
    grid-column: span 2;
  }

  .space-dream-composer-grid,
  .space-dream-image-row {
    grid-template-columns: 1fr;
  }

  .space-avatar {
    width: 100px;
    height: 100px;
  }

  .space-attach-controls {
    grid-template-columns: 1fr;
  }

  .space-attach-list,
  .space-post-attachments {
    grid-template-columns: 1fr;
  }

  .space-quick-actions {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .space-reaction-bar {
    flex-wrap: wrap;
  }

  .space-comment-input-row {
    flex-direction: column;
  }

  .space-comment-input-row .space-input {
    width: 100%;
  }

  .flow-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .flow-title-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .flow-mode-switch {
    width: 100%;
  }

  .flow-mode-btn {
    padding: 0 8px;
    font-size: 12px;
  }

  .flow-cmd-overlay {
    align-items: center;
    padding: 10px 8px;
  }

  .flow-cmd-panel {
    width: min(100vw - 10px, 700px);
  }

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

  .flow-context-actions {
    grid-template-columns: 1fr;
  }

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

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

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

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

  .flow-week-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .flow-day-actions {
    grid-template-columns: 1fr;
  }

  .flow-day-dashboard-actions {
    grid-template-columns: 1fr;
  }

  .flow-day-tabs {
    width: 100%;
  }

  .flow-week-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .flow-week-day {
    min-height: 76px;
  }

  .flow-item-row {
    align-items: flex-start;
  }

  .flow-note-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .flow-note-actions .btn {
    width: 100%;
  }

  .flow-attach-preview {
    max-width: 100%;
  }

  /* ── Board responsive (mobile) ── */
  .board-mobile-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .board-mobile-tab {
    appearance: none;
    border: 2px solid var(--comic-border);
    border-radius: var(--radius-sm, 8px);
    background: var(--comic-bg);
    color: var(--comic-ink);
    font-family: var(--font-body, sans-serif);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 4px;
    cursor: pointer;
    text-align: center;
    transition: background 100ms;
  }
  .board-mobile-tab.active {
    background: var(--comic-ink);
    color: var(--comic-bg);
    box-shadow: 2px 2px 0 var(--comic-shadow);
  }

  .board-columns {
    grid-template-columns: 1fr;
  }

  .board-column {
    display: none;
  }
  .board-column.mobile-active {
    display: flex;
  }

  .board-filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .board-stats {
    flex-direction: column;
    align-items: stretch;
  }

  .sheet-actions.has-danger {
    grid-template-columns: 1fr;
  }

  .sheet-attach-row {
    grid-template-columns: 1fr;
  }

  .sheet-attach-file,
  .sheet-attach-remove {
    grid-column: auto;
    justify-self: stretch;
  }

  .sheet-view-attach-actions {
    grid-template-columns: 1fr;
  }

  .orbit-capture-popover {
    width: min(300px, calc(100vw - 44px));
  }

  .orbit-capture-row.orbit-capture-row-wide {
    grid-template-columns: 1fr 1fr;
  }

  .orbit-capture-row.orbit-capture-row-wide .orbit-capture-link {
    grid-column: 1 / -1;
  }

  .orbit-capture-shortcuts {
    grid-template-columns: 1fr 1fr;
  }

  .smart-notify-stack {
    left: 10px;
    right: 10px;
    width: auto;
  }

  .notify-hub-toggle {
    left: 10px;
    right: auto;
    padding: 0 12px;
  }

  .notify-hub-overlay {
    justify-content: center;
    padding-left: 8px;
    padding-right: 8px;
  }

  .notify-hub-panel {
    width: 100%;
    max-height: min(78vh, 680px);
    border-radius: 18px;
  }

  .notify-hub-quick-actions .notify-hub-btn {
    min-height: 32px;
  }

  .notify-hub-quick-preset {
    min-height: 25px;
    font-size: 11px;
    padding: 0 7px;
  }

  .top-shell-nav {
    width: calc(100% - 14px);
  }

  .top-shell-frame {
    border-radius: 22px;
    padding: 8px;
    gap: 8px;
  }

  .top-shell-row {
    gap: 8px;
  }

  .top-shell-row.has-player {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .top-shell-row.has-player .top-shell-identity {
    max-width: none;
  }

  .top-shell-row.has-player .top-shell-player-host {
    grid-column: 1 / -1;
  }

  .top-shell-actions {
    gap: 6px;
  }

  .top-shell-action {
    min-height: 44px;
    min-width: 44px;
    padding: 0 10px;
  }

  .top-shell-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 2px 4px;
  }

  .top-shell-tabs::-webkit-scrollbar {
    display: none;
  }

  .top-shell-tab {
    flex: 0 0 auto;
    min-width: 104px;
    min-height: 42px;
    padding: 0 12px;
  }

  .top-shell-tab-label {
    font-size: 13px;
  }

  .top-shell-quick-add {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 2px 4px;
  }

  .top-shell-quick-add::-webkit-scrollbar {
    display: none;
  }

  .top-shell-quick-btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }

  .global-player-bar.is-inline .global-player-time,
  .global-player-bar.is-inline .global-player-ctrl-back,
  .global-player-bar.is-inline .global-player-ctrl-forward {
    display: none;
  }

  .top-shell-menu {
    top: var(--top-shell-menu-top);
    right: 8px;
    width: min(292px, calc(100vw - 16px));
  }

  .nav-bar {
    width: calc(100% - 16px);
    padding: 4px 6px;
    gap: 0;
  }

  .nav-icon-wrap {
    width: 48px;
    height: 28px;
  }

  .orbit-task-row.has-multi-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .orbit-task-row.has-multi-actions .orbit-task-main {
    width: 100%;
  }

  .orbit-task-actions {
    max-width: none;
    width: 100%;
    justify-content: flex-start;
  }

  .orbit-task-action {
    min-height: 30px;
    font-size: 12px;
  }

  .nav-label {
    font-size: 10px;
  }

  .fab-button {
    width: 44px;
    height: 44px;
  }

  .nav-fab-spacer {
    width: 46px;
  }
}

/* ── Extra small phones (<=420px) ── */
@media (max-width: 420px) {
  .orbit-capture-row,
  .orbit-capture-actions {
    grid-template-columns: 1fr;
  }

  .orbit-capture-shortcuts {
    grid-template-columns: 1fr;
  }

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

  .space-filter-row,
  .space-dream-image-row,
  .space-composer-actions,
  .space-post-actions,
  .space-post-attach-actions {
    width: 100%;
  }

  .space-filter-row .space-chip,
  .space-dream-image-row .space-btn,
  .space-composer-actions .space-btn,
  .space-post-actions .space-btn,
  .space-post-attach-actions .space-btn {
    width: 100%;
    justify-content: center;
  }

  .sheet-choice-row {
    gap: 6px;
  }

  .space-status-emoji-row {
    gap: 4px;
  }

  .space-status-emoji-btn {
    font-size: 1.2rem;
    padding: 4px 6px;
  }

  .fab-menu-card {
    grid-template-columns: 1fr;
  }

  .fab-menu-item {
    min-height: 62px;
  }

  .flow-note-actions {
    grid-template-columns: 1fr;
  }

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

/* ── Large (960px+) ── */
@media (min-width: 960px) {
  :root {
    --content-max: 800px;
    --nav-height: 68px;
  }

  .goals-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-bar {
    width: min(calc(var(--content-max) + 80px), calc(100% - 28px));
    gap: 0;
    padding: 6px 10px;
  }

  .nav-item {
    min-height: calc(var(--nav-height) - 16px);
  }

  .flow-calendar-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
  }

  .flow-recent-panel {
    max-width: 760px;
  }

  .tg-countdown-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tg-goal-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
  }

  .tg-digest-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tg-hub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .space-dream-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Extra large (1200px+) ── */
@media (min-width: 1200px) {
  :root {
    --content-max: 880px;
  }
}

/* ── Touch devices ── */
@media (hover: none) and (pointer: coarse) {
  .glass-card:hover {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .nav-item:hover {
    color: inherit;
  }

  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .task-check-circle {
    width: 28px;
    height: 28px;
  }

  .fab-menu-item {
    min-width: 0;
    min-height: 72px;
    height: auto;
    padding: 8px 6px;
  }

  .viewer-chip {
    padding: var(--space-sm) var(--space-lg);
    min-height: 40px;
  }
}

@media (max-width: 900px) {
  .settings-center-modal {
    width: min(100vw - 10px, 980px);
    max-height: calc(100dvh - 12px);
    border-radius: 16px;
  }

  .settings-center-layout {
    grid-template-columns: 1fr;
  }

  .settings-center-nav {
    border-right: 0;
    border-bottom: 1px solid color-mix(in oklab, var(--comic-border) 24%, transparent);
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
  }

  .settings-center-nav::-webkit-scrollbar {
    display: none;
  }

  .settings-center-nav-btn {
    flex: 0 0 auto;
    min-height: 36px;
    font-size: 15px;
    padding: 0 10px;
    border-radius: 10px;
  }
}

@media (max-width: 640px) {
  .settings-center-overlay {
    padding: max(6px, calc(var(--safe-top) + 4px)) 6px max(6px, calc(var(--safe-bottom) + 4px));
  }

  .settings-center-modal {
    border-radius: 14px;
  }

  .settings-center-head {
    padding: 12px 12px 10px;
    gap: 8px;
  }

  .settings-center-title {
    font-size: 1.35rem;
  }

  .settings-center-subtitle {
    font-size: 12px;
  }

  .settings-center-body {
    padding: 10px;
  }

  .settings-two-col,
  .settings-two-col-emoji {
    grid-template-columns: 1fr;
  }

  .settings-space-row {
    grid-template-columns: 1fr;
  }

  .settings-toggle-row {
    align-items: flex-start;
  }

  .settings-safety-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-safety-actions .settings-btn {
    width: 100%;
  }

  .settings-center-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-footer-actions {
    width: 100%;
    justify-content: stretch;
  }

  .settings-footer-actions .settings-btn {
    flex: 1 1 auto;
  }

  .coupon-med-ticket {
    grid-template-columns: 1fr;
    min-height: unset;
    gap: 12px;
    padding: 14px;
  }

  .coupon-med-left,
  .coupon-med-right {
    min-height: unset;
  }

  .coupon-med-left-title,
  .coupon-med-right-title {
    font-size: clamp(1.8rem, 1.35rem + 2.4vw, 2.1rem);
  }

  .coupon-med-right-subtitle {
    margin: 6px 0 10px;
  }

  .coupon-med-right-copy {
    max-width: none;
  }

  .coupon-med-footer {
    min-height: 74px;
    padding: 10px 14px;
    gap: 14px;
  }

  .coupon-med-footer-mark {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }

  .coupon-med-footer-title {
    font-size: clamp(1.7rem, 1.25rem + 3.2vw, 2.35rem);
  }
}

/* ── Landing auth refinements ── */
@media (min-width: 900px) {
  .welcome-view--landing {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    align-items: stretch;
  }

  .welcome-landing-hero,
  .welcome-auth-shell {
    height: 100%;
  }

  .welcome-landing-hero {
    display: grid;
    align-content: space-between;
  }
}

@media (max-width: 768px) {
  .welcome-view--landing {
    align-content: start;
  }

  .welcome-brand-word {
    font-size: clamp(1.52rem, 1.08rem + 3.1vw, 2.2rem);
  }

  .welcome-auth-shell {
    padding: 14px;
  }

  .welcome-auth-links {
    justify-content: space-between;
  }

  .welcome-auth-modal {
    padding: 10px;
  }

  .welcome-auth-modal-card {
    width: min(560px, calc(100vw - 12px));
    max-height: min(90dvh, 760px);
    border-radius: 16px;
  }
}

@media (max-width: 520px) {
  .welcome-auth-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .welcome-auth-users-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .welcome-auth-user-chip {
    justify-content: center;
  }

  .welcome-auth-modal {
    padding: 8px;
  }

  .welcome-auth-modal-card {
    padding: 12px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .nebula,
  .stars-layer,
  .stars-md::before,
  .stars-md::after,
  .orbit-hero {
    animation: none !important;
  }

  .sheet {
    animation: none !important;
  }
}

/* ═══════ WELCOME REWRITE V3 RESPONSIVE ═══════ */
@media (max-width: 1080px) {
  .welcome-view--landing {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .welcome-auth-shell {
    order: 1;
  }

  .welcome-landing-hero {
    order: 2;
    min-height: 320px;
  }
}

@media (max-width: 680px) {
  .welcome-landing-hero,
  .welcome-auth-shell {
    border-radius: 20px;
    padding: 14px;
  }

  .welcome-brand-word {
    font-size: clamp(1.72rem, 1.16rem + 3.2vw, 2.6rem);
    letter-spacing: 0.06em;
  }

  .welcome-brand-note {
    font-size: 14px;
  }

  .welcome-brand-quote {
    font-size: 13px;
    padding: 8px 12px;
  }

  .welcome-auth-title-main {
    font-size: clamp(1.55rem, 1.12rem + 2.2vw, 2rem);
  }

  .welcome-auth-copy-main {
    font-size: 14px;
  }

  .welcome-auth-input {
    min-height: 46px;
    border-radius: 14px;
  }

  .welcome-auth-submit {
    min-height: 48px;
    border-radius: 14px;
    font-size: 14px;
  }

  .welcome-auth-links {
    gap: 10px;
  }

  .welcome-auth-link {
    font-size: 13px;
  }

  .welcome-auth-users-grid {
    gap: 7px;
  }

  .welcome-auth-user-chip {
    min-height: 32px;
    font-size: 13px;
  }

  .welcome-auth-modal {
    padding: 8px;
  }

  .welcome-auth-modal-card {
    border-radius: 16px;
    padding: 12px;
  }
}

@media (max-width: 520px) {
  .welcome-brand-quote {
    display: none;
  }

  .welcome-auth-links {
    flex-direction: column;
    align-items: flex-start;
  }

  .welcome-auth-users-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .welcome-auth-user-chip {
    justify-content: center;
  }
}

/* ═══════ WELCOME REWRITE V4 RESPONSIVE ═══════ */
@media (max-width: 1180px) {
  body[data-route="welcome"] #app {
    max-width: 100vw;
  }

  .welcome-view--landing {
    width: min(1080px, 100%);
    gap: clamp(14px, 2.6vw, 26px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.94fr);
  }
}

@media (max-width: 980px) {
  body[data-route="welcome"] #app > .welcome-view {
    min-height: auto;
    padding-left: 10px;
    padding-right: 10px;
  }

  .welcome-view--landing {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .welcome-view--landing::before {
    inset: -10% -6%;
  }

  .welcome-view--landing::after {
    inset: 2% 0;
    border-radius: 26px;
  }

  .welcome-auth-shell {
    order: 1;
  }

  .welcome-landing-hero {
    order: 2;
    min-height: 320px;
  }
}

@media (max-width: 720px) {
  .welcome-landing-hero,
  .welcome-auth-shell {
    border-radius: 20px;
    padding: 14px;
  }

  .welcome-brand-word {
    flex-wrap: wrap;
    white-space: normal;
    font-size: clamp(1.9rem, 1.24rem + 3.4vw, 2.8rem);
    letter-spacing: 0.06em;
  }

  .welcome-brand-word .glyph.gap {
    width: 0;
    flex-basis: 100%;
  }

  .welcome-auth-title-main {
    font-size: clamp(1.62rem, 1.1rem + 2vw, 2.1rem);
  }

  .welcome-auth-copy-main {
    font-size: 14px;
  }

  .welcome-auth-input {
    min-height: 46px;
    border-radius: 14px;
    font-size: 15px;
  }

  .welcome-auth-submit {
    min-height: 48px;
    border-radius: 14px;
    font-size: 14px;
  }

  .welcome-auth-link {
    font-size: 13px;
  }
}

@media (max-width: 520px) {
  body[data-route="welcome"] #app > .welcome-view {
    padding-top: calc(8px + (var(--safe-top) * 0.1));
    padding-bottom: max(var(--space-sm), calc(var(--safe-bottom) + 8px));
  }

  .welcome-view--landing {
    gap: 10px;
  }

  .welcome-view--landing::after {
    display: none;
  }

  .welcome-auth-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .welcome-auth-users-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .welcome-auth-user-chip {
    justify-content: center;
  }
}

@media (hover: none) {
  body[data-route="welcome"] .welcome-landing-hero:hover,
  body[data-route="welcome"] .welcome-auth-shell:hover {
    transform: none;
  }
}

/* ═══════ WELCOME REWRITE V5 RESPONSIVE ═══════ */
@media (max-width: 1060px) {
  .welcome-view--landing {
    width: min(960px, 100%);
    grid-template-columns: 1fr;
    gap: 12px;
    align-content: start;
  }

  .welcome-auth-shell {
    order: 1;
  }

  .welcome-landing-hero {
    order: 2;
    min-height: 280px;
  }
}

@media (max-width: 760px) {
  body[data-route="welcome"] #app > .welcome-view {
    min-height: auto;
    padding-left: 8px;
    padding-right: 8px;
  }

  .welcome-landing-hero,
  .welcome-auth-shell {
    border-radius: 18px;
    padding: 14px;
  }

  .welcome-brand-word {
    font-size: clamp(1.42rem, 1rem + 2.4vw, 2rem);
    letter-spacing: 0.046em;
  }

  .welcome-auth-title-main {
    font-size: clamp(1.56rem, 1.04rem + 2.1vw, 2.02rem);
  }

  .welcome-auth-input {
    min-height: 46px;
    border-radius: 13px;
    font-size: 14px;
  }

  .welcome-auth-submit {
    min-height: 48px;
    border-radius: 13px;
    font-size: 13px;
  }
}

@media (max-width: 520px) {
  body[data-route="welcome"] #app > .welcome-view {
    padding-top: calc(6px + (var(--safe-top) * 0.08));
    padding-bottom: max(8px, calc(var(--safe-bottom) + 6px));
  }

  .welcome-brand-word {
    flex-wrap: wrap;
    white-space: normal;
  }

  .welcome-brand-word .glyph.gap {
    width: 0;
    flex-basis: 100%;
  }

  .welcome-brand-quote {
    display: none;
  }

  .welcome-auth-links {
    gap: 8px;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* ═══════ WELCOME REWRITE V6 RESPONSIVE ═══════ */
@media (max-width: 1180px) {
  .welcome-view--landing {
    width: min(1000px, 100%);
    gap: clamp(14px, 2.6vw, 24px);
  }
}

@media (max-width: 860px) {
  .welcome-auth-copy-main {
    max-width: 44ch;
  }

  .welcome-auth-link {
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .welcome-brand-sub {
    font-size: 11px;
  }

  .welcome-auth-field {
    gap: 5px;
  }

  .welcome-auth-users {
    padding-top: 8px;
  }
}

@media (max-width: 760px) {
  .welcome-auth-shell::before {
    opacity: 0.46;
  }

  .welcome-auth-shell::after {
    opacity: 0.26;
  }
}

@media (max-width: 520px) {
  .welcome-landing-hero::before,
  .welcome-landing-hero::after,
  .welcome-auth-shell::before,
  .welcome-auth-shell::after {
    transform: none !important;
  }
}

/* ═══════ WELCOME ELEVATION V8 RESPONSIVE ═══════ */
@media (max-width: 1180px) {
  body[data-route="welcome"] .welcome-view--landing {
    width: min(1100px, 100%);
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.94fr);
  }

  body[data-route="welcome"] .welcome-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body[data-route="welcome"] #app > .welcome-view {
    padding-left: 10px;
    padding-right: 10px;
  }

  body[data-route="welcome"] .welcome-view--landing {
    grid-template-columns: 1fr;
    align-content: start;
  }

  body[data-route="welcome"] .welcome-auth-shell {
    order: 1;
  }

  body[data-route="welcome"] .welcome-landing-hero {
    order: 2;
    min-height: auto;
  }

  body[data-route="welcome"] .welcome-hero-grid {
    grid-template-columns: 1fr;
  }

  body[data-route="welcome"] .welcome-profile-orbit {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  body[data-route="welcome"] .welcome-landing-hero,
  body[data-route="welcome"] .welcome-auth-shell {
    border-radius: 22px;
    padding: 16px;
  }

  body[data-route="welcome"] .welcome-brand-word {
    font-size: clamp(1.9rem, 1.24rem + 4vw, 3rem);
    letter-spacing: 0.1em;
  }

  body[data-route="welcome"] .welcome-hero-title {
    max-width: none;
    font-size: clamp(1.54rem, 1.08rem + 2.6vw, 2.34rem);
  }

  body[data-route="welcome"] .welcome-hero-metrics,
  body[data-route="welcome"] .welcome-feature-grid,
  body[data-route="welcome"] .welcome-auth-security-grid {
    grid-template-columns: 1fr;
  }

  body[data-route="welcome"] .welcome-hero-cta-row,
  body[data-route="welcome"] .welcome-auth-links {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-route="welcome"] .welcome-hero-cta,
  body[data-route="welcome"] .welcome-auth-submit {
    width: 100%;
  }

  body[data-route="welcome"] .welcome-auth-profile-head,
  body[data-route="welcome"] .welcome-orbit-user-line {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  body[data-route="welcome"] #app > .welcome-view {
    padding-top: calc(8px + (var(--safe-top) * 0.1));
    padding-bottom: max(10px, calc(var(--safe-bottom) + 8px));
  }

  body[data-route="welcome"] .welcome-view--landing {
    gap: 12px;
  }

  body[data-route="welcome"] .welcome-brand-word {
    flex-wrap: wrap;
    white-space: normal;
  }

  body[data-route="welcome"] .welcome-brand-word .glyph.gap {
    width: 0;
    flex-basis: 100%;
  }

  body[data-route="welcome"] .welcome-hero-top,
  body[data-route="welcome"] .welcome-auth-frame-top,
  body[data-route="welcome"] .welcome-hero-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-route="welcome"] .welcome-hero-status-cluster,
  body[data-route="welcome"] .welcome-hero-trust {
    width: 100%;
  }

  body[data-route="welcome"] .welcome-brand-quote {
    display: none;
  }

  body[data-route="welcome"] .welcome-orbit-user-card,
  body[data-route="welcome"] .welcome-auth-profile-actions {
    grid-template-columns: 1fr;
  }

  body[data-route="welcome"] .welcome-auth-profile-actions {
    display: grid;
  }
}

@media (max-width: 920px) {
  body[data-route="welcome"] .welcome-hero-summary {
    grid-template-columns: 1fr;
  }

  body[data-route="welcome"] .welcome-hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body[data-route="welcome"] .welcome-auth-security-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  body[data-route="welcome"] .welcome-auth-signal-card {
    min-height: 0;
  }

  body[data-route="welcome"] .welcome-hero-bottom {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 1080px) {
  body[data-route="welcome"] .welcome-prime-view {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  body[data-route="welcome"] .wp-hero-grid {
    grid-template-columns: 1fr;
  }

  body[data-route="welcome"] .wp-hero {
    min-height: auto;
  }

  body[data-route="welcome"] .wp-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body[data-route="welcome"] .welcome-prime-view {
    gap: 14px;
  }

  body[data-route="welcome"] .wp-hero,
  body[data-route="welcome"] .wp-auth {
    border-radius: 22px;
    padding: 16px;
  }

  body[data-route="welcome"] .wp-actions,
  body[data-route="welcome"] .wp-links,
  body[data-route="welcome"] .wp-profile-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body[data-route="welcome"] .wp-cta,
  body[data-route="welcome"] .wp-submit,
  body[data-route="welcome"] .wp-profile-btn {
    width: 100%;
  }

  body[data-route="welcome"] .wp-signal-grid {
    grid-template-columns: 1fr;
  }

  body[data-route="welcome"] .wp-profile-head,
  body[data-route="welcome"] .wp-orbit-line,
  body[data-route="welcome"] .wp-hero-top,
  body[data-route="welcome"] .wp-auth-top,
  body[data-route="welcome"] .wp-hero-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 1180px) {
  body[data-route="welcome"] .welcome-prime-view {
    grid-template-columns: 1fr;
  }

  body[data-route="welcome"] .wp-headline {
    max-width: 10ch;
  }

  body[data-route="welcome"] .wp-auth-title {
    max-width: 12ch;
  }
}

@media (max-width: 860px) {
  body[data-route="welcome"] .wp-feature-list {
    gap: 8px;
  }

  body[data-route="welcome"] .wp-stage {
    width: 100%;
    justify-self: stretch;
  }

  body[data-route="welcome"] .wp-auth-signals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-route="welcome"] .wp-form-shell {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  body[data-route="welcome"] .wp-headline,
  body[data-route="welcome"] .wp-auth-title {
    max-width: none;
  }

  body[data-route="welcome"] .wp-feature-item {
    grid-template-columns: 1fr;
  }

  body[data-route="welcome"] .wp-feature-index {
    width: 28px;
    height: 28px;
  }

  body[data-route="welcome"] .wp-auth-signals {
    grid-template-columns: 1fr;
  }

  body[data-route="welcome"] .wp-form-shell {
    width: 100%;
  }

  body[data-route="welcome"] .wp-footnote {
    max-width: none;
  }
}
