/* 1NFINIT3 FRONT SHELL — QUALIFICATION CANDIDATE
   Owner locks implemented here:
   - root entrance is a fixed viewport, not a scrolling landing page
   - no full-width top navbar/header slab
   - small canonical wordmark centered to the viewport
   - phone drawer overlays only part/about half of the live workspace
   - internal regions own scrolling; body does not
   Exact breakpoint/drawer/gesture measurements remain QALS-unfrozen until real-device qualification.
*/

:root {
  color-scheme: dark;
  --deep-space: #050509;
  --human-white: #F8F7F2;
  --solar-gold: #FFD166;
  --gold-shadow: #6D4608;
  --gold-mid: #D69722;
  --gold-highlight: #FFF2B5;
  --muted: rgba(248,247,242,.64);
  --line: rgba(255,255,255,.12);
  --glass: rgba(12,12,17,.52);
  --glass-strong: rgba(12,12,17,.72);
  --app-height: 100dvh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --float-size: 46px;
  --composer-block: 104px;
  --work-top: calc(var(--safe-top) + 78px);
  --work-bottom: calc(var(--composer-block) + var(--safe-bottom) + 8px);
  /* Candidate only. Owner law is partial/about-half on phone; exact value is not yet canonical. */
  --drawer-size: min(56vw, 320px);
  --radius-panel: 28px;
  --ease-shell: cubic-bezier(.22,.82,.26,1);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--deep-space);
  color: var(--human-white);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea { font: inherit; }
button,
a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.app-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--app-height);
  overflow: hidden;
  isolation: isolate;
  background: var(--deep-space);
}

.live-world {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 62%, rgba(214,151,34,.07), transparent 32%),
    radial-gradient(circle at 78% 22%, rgba(255,255,255,.035), transparent 25%),
    #050509;
  pointer-events: none;
}

.star-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .72;
}

.world-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(5,5,9,.2), transparent 22%, transparent 72%, rgba(5,5,9,.52)),
    radial-gradient(ellipse at center, transparent 42%, rgba(5,5,9,.46) 100%);
}

/* Floating chrome — deliberately no connecting header surface. */
.float-control {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  z-index: 30;
  display: grid;
  place-items: center;
  width: var(--float-size);
  height: var(--float-size);
  padding: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(12,12,17,.40);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 30px rgba(0,0,0,.22);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.float-control::after {
  content: "";
  position: absolute;
  inset: -8px;
}

.float-control:active { transform: scale(.95); }
.float-control:focus-visible { outline: 2px solid var(--solar-gold); outline-offset: 3px; }
.float-control svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.float-left { left: calc(var(--safe-left) + 16px); }
.float-right { right: calc(var(--safe-right) + 16px); }

.brand-anchor {
  position: absolute;
  top: calc(var(--safe-top) + 19px);
  left: 50%;
  z-index: 29;
  display: block;
  width: clamp(98px, 27vw, 126px);
  height: 34px;
  transform: translateX(-50%);
  text-decoration: none;
}
.brand-anchor img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-anchor:focus-visible { outline: 2px solid var(--solar-gold); outline-offset: 6px; border-radius: 8px; }

.workspace {
  position: absolute;
  z-index: 10;
  top: var(--work-top);
  right: 0;
  bottom: var(--work-bottom);
  left: 0;
  min-height: 0;
  overflow: hidden;
  pointer-events: auto;
}

.entrance-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px 24px 80px;
  text-align: center;
}
.entrance-state h1 {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(27px, 7.4vw, 42px);
  line-height: 1.08;
  font-weight: 520;
  letter-spacing: -.035em;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0,0,0,.45);
}

.conversation-state,
.conversation-scroller {
  position: absolute;
  inset: 0;
  min-height: 0;
}
.conversation-scroller {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding: 14px max(18px, calc((100vw - 780px)/2)) 26px;
}
.conversation-messages {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(100%, 760px);
  margin: 0 auto;
}
.message {
  max-width: min(92%, 680px);
  border-radius: 22px;
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message.user {
  align-self: flex-end;
  padding: 12px 15px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.message.assistant {
  align-self: flex-start;
  width: 100%;
  padding: 2px 0;
}
.runtime-notice {
  width: min(100%, 760px);
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.composer-dock {
  position: absolute;
  z-index: 25;
  right: max(14px, var(--safe-right));
  bottom: max(10px, var(--safe-bottom));
  left: max(14px, var(--safe-left));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}
.composer {
  width: min(100%, 760px);
  padding: 7px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 30px;
  background: rgba(14,14,19,.56);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 18px 48px rgba(0,0,0,.30);
  pointer-events: auto;
}
.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 46px;
}
.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 148px;
  resize: none;
  overflow-y: auto;
  padding: 12px 7px 9px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--human-white);
  line-height: 1.38;
  font-size: 16px;
  caret-color: var(--solar-gold);
}
.composer textarea::placeholder { color: rgba(248,247,242,.46); }
.composer-icon,
.send-button {
  position: relative;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
}
.composer-icon {
  border: 0;
  background: transparent;
}
.composer-icon:active { background: rgba(255,255,255,.08); }
.composer-icon svg,
.send-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.send-button {
  border: 0;
  background: var(--solar-gold);
  color: #161109;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform 140ms ease, opacity 140ms ease;
}
.send-button:active:not(:disabled) { transform: scale(.94); }
.send-button:disabled { opacity: .24; cursor: default; }
.composer-icon:focus-visible,
.send-button:focus-visible { outline: 2px solid var(--solar-gold); outline-offset: 2px; }

.attachment-tray {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 3px 5px 6px;
  scrollbar-width: none;
}
.attachment-tray::-webkit-scrollbar { display: none; }
.attachment-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 190px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 13px;
  background: rgba(255,255,255,.055);
  font-size: 12px;
}
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button {
  width: 23px;
  height: 23px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: inherit;
}

.legal-line {
  margin: 0;
  display: flex;
  gap: 7px;
  color: rgba(248,247,242,.38);
  font-size: 10.5px;
  line-height: 1;
  pointer-events: auto;
}
.legal-line a { text-underline-offset: 2px; }

.drawer-scrim {
  position: absolute;
  inset: 0;
  z-index: 40;
  border: 0;
  background: rgba(0,0,0,.18);
  opacity: 0;
  transition: opacity 220ms ease;
  touch-action: manipulation;
}
.drawer-scrim[hidden] { display: none; }
.drawer-scrim.is-visible { opacity: 1; }

.side-drawer {
  position: absolute;
  z-index: 50;
  top: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  width: var(--drawer-size);
  padding: calc(var(--safe-top) + 12px) 8px calc(var(--safe-bottom) + 9px) max(8px, var(--safe-left));
  transform: translate3d(-100%,0,0);
  background: rgba(8,8,13,.70);
  border-right: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(28px) saturate(128%);
  -webkit-backdrop-filter: blur(28px) saturate(128%);
  box-shadow: 22px 0 55px rgba(0,0,0,.26);
  will-change: transform;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.side-drawer.is-animating { transition: transform 240ms var(--ease-shell); }
.side-drawer[aria-hidden="false"] { transform: translate3d(0,0,0); }
.drawer-grab-zone {
  position: absolute;
  top: 0;
  right: -14px;
  bottom: 0;
  width: 28px;
  pointer-events: none;
}
.drawer-top { padding: 4px 2px 12px; }
.drawer-action,
.account-strip,
.popover-row {
  width: 100%;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.drawer-action {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 9px;
  border-radius: 14px;
}
.drawer-action:active { background: rgba(255,255,255,.075); }
.drawer-action svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.drawer-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 3px 2px 14px;
}
.drawer-section { margin: 0 0 8px; }
.drawer-section a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 9px;
  border-radius: 13px;
  color: rgba(248,247,242,.88);
  text-decoration: none;
  font-size: 14px;
}
.drawer-section a:active { background: rgba(255,255,255,.07); }
.drawer-section-primary { padding-top: 5px; border-top: 1px solid rgba(255,255,255,.08); }
.drawer-label {
  margin: 13px 9px 6px;
  color: rgba(248,247,242,.44);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.route-mark { color: rgba(248,247,242,.48); font-size: 22px; line-height: 1; }

.drawer-bottom {
  padding: 8px 2px 0;
  border-top: 1px solid rgba(255,255,255,.08);
}
.account-strip {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 6px 7px;
  border-radius: 15px;
}
.account-strip:active { background: rgba(255,255,255,.07); }
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(145deg,var(--gold-mid),var(--gold-shadow));
  color: #fff7dc;
  font-size: 13px;
  font-weight: 700;
}
.account-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-copy strong { font-size: 13.5px; font-weight: 590; }
.account-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(248,247,242,.46); font-size: 10.5px; }

.quantum-panel {
  border: 1px solid rgba(255,255,255,.13);
  background:
    linear-gradient(145deg, rgba(255,255,255,.035), transparent 34%),
    rgba(13,13,18,.70);
  backdrop-filter: blur(30px) saturate(130%);
  -webkit-backdrop-filter: blur(30px) saturate(130%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 26px 80px rgba(0,0,0,.46);
}

.account-popover {
  position: absolute;
  z-index: 60;
  left: max(10px, var(--safe-left));
  bottom: calc(var(--safe-bottom) + 72px);
  width: max(200px, calc(var(--drawer-size) - 20px));
  padding: 8px;
  border-radius: 20px;
}
.account-popover[hidden] { display: none; }
.popover-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 13.5px;
}
.popover-row:active { background: rgba(255,255,255,.07); }

.modal-layer {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: max(16px, var(--safe-top)) max(14px, var(--safe-right)) max(16px, var(--safe-bottom)) max(14px, var(--safe-left));
}
.modal-layer[hidden] { display: none; }
.modal-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(0,0,0,.36);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.auth-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  max-height: calc(var(--app-height) - max(32px, var(--safe-top)) - max(32px, var(--safe-bottom)));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 22px 22px;
  border-radius: var(--radius-panel);
  text-align: center;
}
.modal-close {
  position: absolute;
  top: 11px;
  right: 11px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: rgba(248,247,242,.78);
  cursor: pointer;
}
.modal-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.auth-brand { display: block; width: 116px; height: 40px; object-fit: contain; margin: 3px auto 14px; }
.auth-panel h2 { margin: 0; font-size: 27px; line-height: 1.1; font-weight: 530; letter-spacing: -.025em; }
.auth-copy { margin: 10px auto 20px; max-width: 31ch; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.oauth-button,
.primary-button {
  width: 100%;
  min-height: 50px;
  border-radius: 999px;
  cursor: pointer;
}
.oauth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.055);
  color: var(--human-white);
}
.google-g { font-weight: 800; color: var(--solar-gold); }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 15px 0; color: rgba(248,247,242,.42); font-size: 11px; }
.auth-or::before,
.auth-or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.10); }
.email-auth { display: grid; gap: 9px; text-align: left; }
.email-auth label { padding-left: 4px; color: rgba(248,247,242,.62); font-size: 12px; }
.email-auth input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  outline: 0;
  background: rgba(0,0,0,.25);
  color: var(--human-white);
}
.email-auth input:focus { border-color: rgba(255,209,102,.72); box-shadow: 0 0 0 3px rgba(255,209,102,.10); }
.primary-button { margin-top: 3px; border: 0; background: var(--human-white); color: #111114; font-weight: 650; }
.auth-status { margin: 13px 2px 0; color: rgba(248,247,242,.62); font-size: 12px; line-height: 1.42; }

.toast-region {
  position: absolute;
  z-index: 100;
  left: 50%;
  bottom: calc(var(--composer-block) + var(--safe-bottom) + 18px);
  display: grid;
  gap: 8px;
  width: min(calc(100% - 28px), 420px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  justify-self: center;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 999px;
  background: rgba(13,13,18,.84);
  color: rgba(248,247,242,.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
  font-size: 12px;
}

[hidden] { display: none !important; }

@media (min-width: 720px) {
  :root {
    --float-size: 48px;
    --work-top: calc(var(--safe-top) + 88px);
    /* Intermediate/desktop drawer geometry remains qualification-only. */
    --drawer-size: min(34vw, 352px);
  }
  .brand-anchor { width: 132px; top: calc(var(--safe-top) + 20px); }
  .float-left { left: calc(var(--safe-left) + 24px); }
  .float-right { right: calc(var(--safe-right) + 24px); }
  .entrance-state { padding-bottom: 96px; }
  .composer-dock { right: max(22px,var(--safe-right)); left: max(22px,var(--safe-left)); }
}

@media (max-height: 620px) {
  :root { --work-top: calc(var(--safe-top) + 66px); }
  .float-control { top: calc(var(--safe-top) + 9px); }
  .brand-anchor { top: calc(var(--safe-top) + 13px); height: 30px; }
  .entrance-state { padding-bottom: 34px; }
  .entrance-state h1 { font-size: clamp(23px, 6vw, 32px); }
  .legal-line { display: none; }
}

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


/* QALS VISUAL LOCK V2 — 2026-09-06
   Owner visual correction: smaller controls/brand/composer, narrow floating clear-glass
   navigation blade, and bottom-sheet authentication. This block intentionally overrides
   earlier qualification candidate geometry without deleting provenance. */
:root {
  --float-size: 40px;
  --drawer-size: clamp(138px, 38vw, 156px);
  --glass-clear: rgba(15,15,22,.18);
  --glass-control: rgba(15,15,22,.24);
  --glass-panel: rgba(15,15,22,.28);
  --glass-sheet: rgba(15,15,22,.44);
  --glass-edge: rgba(255,255,255,.18);
  --glass-edge-soft: rgba(255,255,255,.10);
}

.float-control {
  top: calc(var(--safe-top) + 12px);
  border-color: var(--glass-edge-soft);
  background: var(--glass-control);
  backdrop-filter: blur(12px) saturate(118%);
  -webkit-backdrop-filter: blur(12px) saturate(118%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 8px 22px rgba(0,0,0,.14);
}
.float-control svg { width: 18px; height: 18px; stroke-width: 1.65; }
.float-left { left: calc(var(--safe-left) + 14px); }
.float-right { right: calc(var(--safe-right) + 14px); }

.brand-anchor {
  top: calc(var(--safe-top) + 14px);
  width: clamp(76px, 21vw, 92px);
  height: 28px;
}

.entrance-state { padding: 18px 22px 54px; }
.entrance-state h1 {
  max-width: 25ch;
  font-size: clamp(24px, 6.4vw, 34px);
  line-height: 1.1;
  font-weight: 470;
  letter-spacing: -.03em;
}

.composer-dock {
  right: max(18px, var(--safe-right));
  bottom: max(12px, var(--safe-bottom));
  left: max(18px, var(--safe-left));
  gap: 6px;
}
.composer {
  width: min(100%, 620px);
  padding: 4px 5px;
  border-color: var(--glass-edge-soft);
  border-radius: 25px;
  background: var(--glass-control);
  backdrop-filter: blur(14px) saturate(122%);
  -webkit-backdrop-filter: blur(14px) saturate(122%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 10px 30px rgba(0,0,0,.16);
}
.composer-row { min-height: 42px; gap: 1px; }
.composer textarea {
  max-height: 136px;
  padding: 10px 5px 8px;
  font-size: 15px;
  line-height: 1.36;
}
.composer-icon,
.send-button {
  flex-basis: 40px;
  width: 40px;
  height: 40px;
}
.composer-icon svg,
.send-button svg { width: 19px; height: 19px; stroke-width: 1.65; }
.send-button { box-shadow: inset 0 1px 0 rgba(255,255,255,.28); }
.legal-line { font-size: 9.5px; opacity: .86; }

.drawer-scrim { background: rgba(0,0,0,.10); }
.side-drawer {
  top: calc(var(--safe-top) + 72px);
  bottom: calc(var(--composer-block) + var(--safe-bottom) + 16px);
  left: max(10px, var(--safe-left));
  width: var(--drawer-size);
  min-height: 220px;
  padding: 9px 7px;
  border: 1px solid var(--glass-edge);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.012) 36%, transparent 64%),
    var(--glass-panel);
  backdrop-filter: blur(16px) saturate(128%);
  -webkit-backdrop-filter: blur(16px) saturate(128%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 18px 42px rgba(0,0,0,.18);
  overflow: hidden;
}
.drawer-grab-zone { right: -10px; width: 20px; }
.drawer-top { padding: 1px 0 7px; }
.drawer-action { gap: 7px; min-height: 36px; padding: 6px 7px; border-radius: 11px; font-size: 12.5px; }
.drawer-action svg { flex-basis: 16px; width: 16px; height: 16px; stroke-width: 1.55; }
.drawer-scroll { padding: 1px 0 8px; }
.drawer-section { margin-bottom: 4px; }
.drawer-section a { min-height: 35px; padding: 6px 7px; border-radius: 10px; font-size: 12.5px; }
.drawer-section-primary { padding-top: 4px; border-top-color: rgba(255,255,255,.07); }
.drawer-label { margin: 10px 7px 4px; font-size: 9.5px; letter-spacing: .07em; }
.route-mark { font-size: 17px; }
.drawer-bottom { padding: 6px 0 0; border-top-color: rgba(255,255,255,.07); }
.account-strip { grid-template-columns: 28px minmax(0,1fr) auto; gap: 6px; min-height: 42px; padding: 5px; border-radius: 11px; }
.avatar { width: 28px; height: 28px; font-size: 11px; }
.account-copy strong { font-size: 11.5px; }
.account-copy small { font-size: 9px; }

.quantum-panel {
  border-color: var(--glass-edge);
  background:
    linear-gradient(145deg, rgba(255,255,255,.05), transparent 34%),
    var(--glass-sheet);
  backdrop-filter: blur(18px) saturate(126%);
  -webkit-backdrop-filter: blur(18px) saturate(126%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 24px 62px rgba(0,0,0,.26);
}
.auth-drag-handle {
  width: 38px;
  height: 4px;
  margin: -12px auto 15px;
  border-radius: 999px;
  background: rgba(248,247,242,.34);
  touch-action: none;
  cursor: grab;
}
.auth-drag-handle:active { cursor: grabbing; }

@media (max-width: 719px) {
  .modal-layer {
    place-items: end center;
    padding: 0 max(10px, var(--safe-right)) max(8px, var(--safe-bottom)) max(10px, var(--safe-left));
  }
  .modal-scrim { background: rgba(0,0,0,.24); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
  .auth-panel {
    width: min(100%, 520px);
    max-height: min(78dvh, calc(var(--app-height) - var(--safe-top) - 18px));
    padding: 24px 18px 18px;
    border-radius: 30px;
    transform: translate3d(0,var(--auth-drag-y,0px),0);
    will-change: transform;
  }
  .auth-brand { width: 88px; height: 30px; margin-bottom: 10px; }
  .auth-panel h2 { font-size: 24px; }
  .auth-copy { margin: 8px auto 16px; font-size: 12.5px; }
  .oauth-button,.primary-button { min-height: 46px; }
  .email-auth input { height: 46px; }
}

@media (min-width: 720px) {
  :root { --float-size: 42px; --drawer-size: clamp(148px, 18vw, 180px); }
  .brand-anchor { width: 96px; top: calc(var(--safe-top) + 15px); }
  .composer-dock { right: max(24px,var(--safe-right)); left: max(24px,var(--safe-left)); }
  .side-drawer { top: calc(var(--safe-top) + 80px); }
}

/* QALS visual correction after first 390×844 render: keep the blade compact and fully off-canvas when closed. */
.side-drawer {
  bottom: auto;
  height: min(500px, calc(var(--app-height) - var(--safe-top) - var(--composer-block) - 108px));
  transform: translate3d(calc(-100% - 18px),0,0);
}
@media (min-width: 720px) {
  .side-drawer { height: min(560px, calc(var(--app-height) - var(--safe-top) - var(--composer-block) - 124px)); }
}
