/* AUX glass — Astra V1 tokens. Cadence ritual, not Cadence crimson. */

:root {
  --ink: #100C20;
  --raised: #1C1630;
  --inset: #151125;
  --paper: #F4F0FF;
  --support: #C5BDD9;
  --border: #51435F;
  --purple: #A883FF;
  --pale: #D2BCFF;
  --teal: #73E7D3;
  --warm: #FFD39A;
  --error: #FFB7CB;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --font-ui: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --r-panel: 24px;
  --r-ctrl: 16px;
  --hit: 44px;
  --key-h: 64px;
  --banner-h: 0px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --aux-gate-size: 128px;
  --aux-home-size: 88px;
  --aux-menu-size: 176px;
}

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

html,
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--paper);
  font: 17px/1.5 var(--font-ui);
  touch-action: manipulation;
}

body {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
.chip:focus-visible,
.skip-link:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 8px;
  z-index: 80;
  padding: 10px 14px;
  min-height: var(--hit);
  background: var(--teal);
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--r-ctrl);
  font-weight: 600;
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: none;
}

.banner { display: none; }

.atmo {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 12% 8%, rgba(168, 131, 255, 0.28) 0%, transparent 58%),
    radial-gradient(ellipse 80% 55% at 88% 92%, rgba(115, 231, 211, 0.2) 0%, transparent 62%),
    linear-gradient(180deg, #160e2c 0%, var(--ink) 46%, #0c0918 100%);
}

.atmo::after {
  display: none;
}

/* —— Presence —— */

.presence {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.gate-hero { --aux-size: var(--aux-gate-size); min-height: var(--aux-gate-size); }
.rail-hero { --aux-size: var(--aux-home-size); width: var(--aux-home-size); min-height: 0; }
.ring-hero { --aux-size: var(--aux-menu-size); }
#presence { width: 100%; height: auto; }
.presence-mark,
#presence-mark,
#presence #orbWrap,
#presence #orb {
  width: var(--aux-size);
  height: var(--aux-size);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.orbWrap {
  width: var(--aux-size);
  height: var(--aux-size);
  position: relative;
  isolation: isolate;
  pointer-events: auto;
  touch-action: manipulation;
  cursor: pointer;
}
#orbWrap:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
.orbWrap canvas,
#orb {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.presence-label {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  color: var(--support);
  text-align: center;
}

.presence.is-idle .presence-mark {
  animation: none;
}

.presence.is-listening .presence-mark {
  transform: none;
}

.presence.is-doing .looplet-travel {
  animation: travel 1.6s linear 1;
}

.presence.is-sent .presence-mark {
  animation: pulse-out 0.9s var(--ease) 1;
}

.presence.is-blocked .presence-mark {
  filter: drop-shadow(0 0 10px rgba(255, 211, 154, 0.55));
}

.presence.is-blocked .presence-label {
  color: var(--warm);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes travel {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}

@keyframes pulse-out {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.hero-slot {
  display: flex;
  justify-content: center;
  width: 100%;
  flex: 0 0 auto;
  min-height: 220px;
  position: relative;
  z-index: 3;
}

/* —— Gate —— */

.gate {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--banner-h));
  padding: calc(12px + var(--safe-t)) max(16px, var(--safe-r)) calc(20px + var(--safe-b)) max(16px, var(--safe-l));
  overflow: auto;
}

.gate.hold .wordmark,
.gate.hold .kicker,
.gate.hold .gate-lead,
.gate.hold .dots,
.gate.hold .pad,
.gate.hold .gate-msg {
  opacity: 0;
  pointer-events: none;
}

.gate .wordmark,
.gate .kicker,
.gate .gate-lead,
.gate .dots,
.gate .pad,
.gate .gate-msg {
  transition: opacity 0.36s var(--ease);
}

.gate-hero .presence-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.gate-hero .presence-mark,
.gate-hero .orbWrap,
.gate-hero #orb {
  width: var(--aux-size);
  height: var(--aux-size);
}

.wordmark {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--paper);
}

.kicker {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--teal);
}

.gate-lead {
  margin: 12px 0 0;
  color: var(--paper);
  text-align: center;
}

.dots {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  height: 28px;
  margin: 16px 0 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  transform: rotate(45deg);
  background: transparent;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), box-shadow 0.16s;
}

.dot.on {
  background: var(--paper);
  border-color: var(--pale);
  box-shadow: 0 0 10px -2px var(--purple);
}

.dots.err {
  animation: shake 0.32s var(--ease);
}

.dots.err .dot {
  border-color: var(--error);
}

@keyframes shake {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.gate-msg {
  min-height: 24px;
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--support);
  text-align: center;
}

.gate-msg.warn {
  color: var(--warm);
}

.gate-msg.error {
  color: var(--error);
}

.pin-sr {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 16px;
  height: 16px;
  font-size: 16px;
}

.pad,
.key,
.lock-btn,
.menu-btn,
.send-btn {
  touch-action: manipulation;
}

.pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 12px;
  width: min(100%, 280px);
  margin-top: 8px;
}

.key {
  min-width: var(--hit);
  min-height: var(--key-h);
  border: 1px solid var(--border);
  border-radius: var(--r-ctrl);
  background: var(--raised);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  transition: transform 0.12s var(--ease), background 0.12s;
}

.key:active {
  transform: scale(0.96);
  background: #241c3c;
}

.key-ghost {
  background: transparent;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--support);
  letter-spacing: 0.02em;
}

.pad.is-busy {
  pointer-events: none;
  opacity: 0.45;
}

/* —— Shell —— */

.shell {
  position: relative;
  z-index: 2;
  height: calc(100dvh - var(--banner-h));
  padding:
    12px
    max(16px, var(--safe-r))
    max(12px, var(--safe-b))
    max(16px, var(--safe-l));
}

.shell-main {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "rail"
    "chat"
    "composer";
  gap: 10px;
  height: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.chat {
  grid-area: chat;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  overflow: hidden;
}

.transcript {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 36em;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--inset);
  border: 1px solid var(--border);
}

.msg-aux {
  align-self: flex-start;
}

.msg-you {
  align-self: flex-end;
  background: #1a2a32;
  border-color: #2d5a55;
}

.msg p {
  margin: 0;
}

.msg + .msg {
  margin-top: 0;
}

.msg-wait {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 8px 12px;
  flex: 0 0 auto;
  color: var(--support);
  font-size: 14px;
  background: #1a1630;
}
.wait-label { color: var(--support); }
.wait-dots { display: inline-flex; gap: 6px; align-items: center; }
.wait-dots > i {
  display: block;
  width: 6px;
  height: 6px;
  background: var(--teal);
  opacity: 0.4;
  animation: aux-wait-blink 1200ms ease-in-out infinite;
}
.wait-dots > i:nth-child(2) {
  background: var(--purple);
  animation-delay: 160ms;
}
.wait-dots > i:nth-child(3) { animation-delay: 320ms; }
@keyframes aux-wait-blink {
  0%, 65%, 100% { opacity: 0.4; }
  25%, 40% { opacity: 1; }
}

.icebreakers {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.ice-label {
  margin: 12px 0 8px;
  font-size: 14px;
  color: var(--support);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: var(--hit);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--pale);
  background: transparent;
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.chip:active {
  background: #241c3c;
}

.rail {
  grid-area: rail;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 8px;
  min-width: 0;
}

.ring-stage {
  position: relative;
  grid-column: 1;
  grid-row: 1 / 3;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rail-hero {
  width: var(--aux-home-size);
}

.rail-hero .presence-mark,
.rail-hero .orbWrap,
.rail-hero #orb {
  width: var(--aux-size);
  height: var(--aux-size);
}

.rail-hero .presence-label {
  font-size: 14px;
  max-width: 140px;
}

.rail .menu-btn {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  min-width: 72px;
}

.rail .lock-btn {
  grid-column: 2;
  grid-row: 2;
  width: auto;
  min-width: 72px;
  margin-top: 0;
}

.ring-desktop {
  display: none;
}

.menu-btn,
.lock-btn,
.send-btn,
.primary-btn,
.ring-btn,
.icon-btn,
.text-btn {
  min-height: var(--hit);
  min-width: var(--hit);
}

.menu-btn {
  width: 100%;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--border);
  background: var(--raised);
  font-size: 14px;
  font-weight: 600;
  padding: 0 6px;
}

.lock-btn {
  width: 100%;
  margin-top: auto;
  border-radius: var(--r-ctrl);
  border: 1px solid #ff6b81;
  background: #c41e3a;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 0 6px;
}

.composer {
  grid-area: composer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "input send"
    "note note";
  gap: 8px 12px;
  align-items: end;
  padding: 8px 0 0;
}

.composer textarea {
  grid-area: input;
  min-height: var(--hit);
  max-height: 120px;
  resize: none;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--border);
  background: var(--raised);
  padding: 10px 14px;
  line-height: 1.4;
  font-size: 16px;
}

.composer textarea::placeholder {
  color: var(--support);
}

.send-btn,
.primary-btn {
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-ctrl);
  background: var(--teal);
  color: var(--ink);
  font-weight: 700;
}

.send-btn {
  grid-area: send;
}

.primary-btn.pale {
  background: var(--pale);
}

.composer-note {
  grid-area: note;
  margin: 0;
  font-size: 14px;
  color: var(--support);
}

/* —— Demo card —— */

.demo-card {
  align-self: stretch;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.demo-kicker {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--pale);
}

.demo-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.demo-artifact {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.demo-artifact h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 17px;
}

.demo-artifact p,
.demo-artifact li {
  font-size: 14px;
  color: var(--paper);
}

.demo-artifact ul {
  margin: 8px 0 0;
  padding-left: 1.2em;
}

.thumb-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.thumb {
  min-height: 72px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(168, 131, 255, 0.35), rgba(115, 231, 211, 0.2));
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  padding: 8px;
  font-size: 14px;
  font-weight: 600;
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-actions button {
  min-height: var(--hit);
  padding: 8px 14px;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--border);
  background: var(--raised);
  font-size: 14px;
  font-weight: 600;
}

.ghost-disabled {
  opacity: 0.7;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
}

.status-icon {
  width: 16px;
  height: 16px;
  border: 2px solid var(--warm);
  border-radius: 3px;
  transform: rotate(45deg);
  flex: 0 0 16px;
}

/* —— Dialogs / sheets —— */

dialog {
  border: 0;
  padding: 0;
  color: var(--paper);
  background: transparent;
}

dialog::backdrop {
  background: rgba(16, 12, 32, 0.72);
}

.ring-dialog {
  width: min(100vw, 420px);
  max-height: 100dvh;
  margin: auto 0 auto auto;
  background: var(--raised);
  border-left: 1px solid var(--border);
  border-radius: var(--r-panel) 0 0 var(--r-panel);
}

.ring-dialog-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 16px calc(16px + var(--safe-b));
  min-height: 100%;
}

.ring-hero .presence-mark,
.ring-hero .presence-mark svg,
.ring-hero .presence-mark .looplet-img {
  width: 96px;
  height: 108px;
}

.ring-phone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.ring-btn {
  width: 100%;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--pale);
  background: var(--inset);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  padding: 0 16px;
}

.sheet,
.preview {
  width: min(100vw, 720px);
  max-height: min(92dvh, 820px);
  margin: auto auto 0;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-panel) var(--r-panel) 0 0;
  overflow: auto;
}

.sheet-handle {
  width: 48px;
  height: 4px;
  border-radius: 4px;
  background: var(--border);
  margin: 10px auto 0;
}

.sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  background: var(--raised);
}

.sheet-bar h2,
.meet-card h2 {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.icon-btn,
.text-btn {
  border: 0;
  background: transparent;
  color: var(--support);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--r-ctrl);
}

.sheet-body {
  padding: 8px 16px calc(24px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet-body h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 14px;
  color: var(--support);
}

.field input:not([type="radio"]),
.field textarea,
.field select {
  min-height: var(--hit);
  border-radius: var(--r-ctrl);
  border: 1px solid var(--border);
  background: var(--inset);
  padding: 10px 14px;
}

.editions {
  display: flex;
  gap: 8px;
}

.editions label {
  flex: 1;
  min-height: var(--hit);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-ctrl);
  padding: 8px;
  font-weight: 600;
}

.editions input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.editions label:has(input:checked) {
  border-color: var(--teal);
}

.empty {
  margin: 0;
  color: var(--support);
  font-size: 17px;
}

.confirm-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--pale);
  background: var(--inset);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.world-card,
.request-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--inset);
}

.meta {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--support);
}

/* —— Meet AUX —— */

.meet {
  width: min(100vw - 24px, 420px);
  margin: auto;
  background: transparent;
}

.meet.meet-entering .meet-card,
.meet.meet-leaving .meet-card {
  opacity: 0;
  transform: translateY(8px);
}

.meet.meet-open .meet-card {
  opacity: 1;
  transform: none;
}

.meet-card {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  padding: 24px 20px 16px;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}

#meet-title:focus,
#meet-title:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 6px;
  border-radius: 8px;
}

.meet-progress {
  margin: 8px 0 16px;
  font-size: 14px;
  color: var(--support);
}

.meet-step h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 24px;
}

.meet-step p {
  margin: 0;
}

.meet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 24px;
}

.meet-actions .primary-btn {
  width: 100%;
}

.meet-actions .text-btn {
  justify-self: start;
}

#meet-skip {
  grid-column: 1 / -1;
  justify-self: center;
}

.noscript {
  position: relative;
  z-index: 3;
  padding: 16px;
}

/* —— Wide shell —— */

@media (min-width: 900px) {
  :root { --aux-gate-size: 240px; --aux-home-size: 192px; }
  .shell {
    padding: 24px max(24px, var(--safe-r)) max(24px, var(--safe-b)) max(24px, var(--safe-l));
  }

  .shell-main {
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "chat rail"
      "composer rail";
    gap: 24px;
  }

  .rail {
    display: flex;
    flex-direction: column;
    background: var(--raised);
    border: 1px solid var(--border);
    border-radius: var(--r-panel);
    padding: 24px 16px 16px;
    min-height: 0;
  }

  .ring-stage {
    grid-column: auto;
    grid-row: auto;
    flex: 1;
    min-height: 280px;
  }

  .rail-hero {
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    width: var(--aux-home-size);
    z-index: 1;
    pointer-events: none;
  }

  .rail-hero .presence,
  .rail-hero .presence-mark,
  .rail-hero .presence-mark svg,
  .rail-hero .presence-mark .looplet-img,
  .rail-hero .orbWrap,
  .rail-hero #orb {
    width: var(--aux-size);
    height: var(--aux-size);
  }

  .rail-hero .presence-label {
    max-width: 160px;
    pointer-events: auto;
  }

  .ring-desktop {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    width: 100%;
    height: 100%;
    min-height: 300px;
    padding-top: 8px;
  }

  .ring-desktop [data-dest="friends"] {
    grid-column: 1;
    grid-row: 1;
  }

  .ring-desktop [data-dest="worlds"] {
    grid-column: 2;
    grid-row: 1;
  }

  .ring-desktop [data-dest="ask-dad"] {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: center;
    width: min(100%, 200px);
  }

  .menu-btn {
    display: none;
  }

  .lock-btn,
  .rail .lock-btn {
    width: 100%;
    margin-top: auto;
    grid-column: auto;
    grid-row: auto;
  }

  .gate-hero .presence-mark,
  .gate-hero .presence-mark svg,
  .gate-hero .presence-mark .looplet-img,
  .gate-hero .orbWrap,
  .gate-hero #orb {
    width: var(--aux-size);
    height: var(--aux-size);
  }

  .composer {
    padding: 0;
  }
}

@media (max-height: 520px) {
  .ring-phone {
    display: flex;
    flex-direction: column;
  }

  .gate {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .presence.is-idle .presence-mark,
  .presence.is-doing .looplet-travel,
  .presence.is-sent .presence-mark,
  .dots.err,
  .meet-card,
  .gate .wordmark,
  .gate .kicker,
  .gate .gate-lead,
  .gate .dots,
  .gate .pad,
  .gate .gate-msg,
  .wait-dots i,
  .wait-dots > i {
    animation: none !important;
    opacity: 0.8 !important;
  }

  .presence.is-listening .presence-mark {
    transform: none;
  }

  .meet.meet-entering .meet-card,
  .meet.meet-leaving .meet-card {
    opacity: 1;
    transform: none;
  }
}

/* Phone shell — do not touch the ≥900 computer layout. */
@media (max-width: 899px) {
  .gate {
    justify-content: flex-start;
    padding-top: calc(8px + var(--safe-t));
    padding-bottom: calc(8px + var(--safe-b));
  }

  .hero-slot {
    min-height: var(--aux-gate-size);
  }

  .gate-hero .presence-mark,
  .gate-hero .orbWrap,
  .gate-hero #orb {
    width: var(--aux-size);
    height: var(--aux-size);
  }

  .wordmark {
    font-size: 32px;
    margin-top: 0;
  }

  .kicker {
    margin-top: 4px;
  }

  .gate-lead {
    margin-top: 8px;
    font-size: 15px;
  }

  .dots {
    margin: 10px 0 4px;
  }

  .pad {
    width: min(100%, 300px);
    gap: 8px;
  }

  .key {
    min-height: 52px;
  }

  .shell {
    padding: 8px max(12px, var(--safe-r)) max(8px, var(--safe-b)) max(12px, var(--safe-l));
  }

  .shell-main {
    gap: 8px;
  }

  .rail-hero {
    width: var(--aux-home-size);
  }

  .rail-hero .presence-mark,
  .rail-hero .orbWrap,
  .rail-hero #orb {
    width: var(--aux-size);
    height: var(--aux-size);
  }

  .rail-hero .presence-label {
    font-size: 12px;
    max-width: 96px;
  }

  .ice-label {
    display: none;
  }

  .icebreakers {
    padding: 8px 12px 10px;
  }

  .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .chip {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 40px;
    font-size: 13px;
  }

  .composer-note {
    display: none;
  }

  .transcript {
    padding: 10px 12px;
    gap: 8px;
  }

  .msg {
    max-width: 100%;
    padding: 8px 12px;
    font-size: 15px;
  }

  .demo-card {
    max-height: 34vh;
    overflow: auto;
  }
}

body.is-gate #shell,
body.is-shell #gate {
  display: none;
}

body.is-shell .skip-link {
  /* href updated in JS */
}

@media (min-width: 900px) and (max-height: 760px) {
  :root { --aux-gate-size: 220px; }
}
@media (max-width: 899px) and (max-height: 600px) {
  :root { --aux-gate-size: 96px; }
}
