/* ============================================================
   The room, the intro, and the glass shell around the pages
   (top bar, rail, the big panel), plus overlays.
   ============================================================ */

/* ---------------- the room ---------------- */
.room {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #2a231d;
  pointer-events: none;
}
/* keeps the photo's proportions while covering the screen, so it never stretches */
.room-box {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100vw, 142.02vh);
  height: max(100vh, 70.41vw);
  transform: translate(-50%, -50%);
}
.room-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 1.1s var(--ease);
  animation: roomFocus 2.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.75s both;
}
@keyframes roomFocus {
  from {
    filter: blur(14px) brightness(0.5) saturate(0.7);
    transform: scale(1.18);
  }
}
.room-veil {
  position: absolute;
  inset: 0;
  background: var(--veil);
  transition: background 0.8s;
}


/* ---------------- intro ---------------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(60, 46, 34, 0.55), transparent 60%),
    rgba(14, 11, 9, 0.94);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent var(--iris), #000 calc(var(--iris) + 120px));
  mask: radial-gradient(circle at 50% 50%, transparent var(--iris), #000 calc(var(--iris) + 120px));
  animation:
    iris 1.5s cubic-bezier(0.7, 0, 0.2, 1) 1.15s both,
    bootFade 0.5s ease 2.4s forwards;
  pointer-events: none;
}
@keyframes bootFade {
  to {
    opacity: 0;
  }
}
@keyframes iris {
  to {
    --iris: 150vmax;
  }
}
.boot-stage {
  display: grid;
  justify-items: center;
  gap: 14px;
  color: #f4ece2;
  animation: stageOut 0.6s cubic-bezier(0.6, 0, 0.4, 1) 1.05s both;
}
@keyframes stageOut {
  to {
    opacity: 0;
    transform: scale(1.5);
    filter: blur(12px);
  }
}
.boot-logo {
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--accent) 60%, transparent));
}
.boot-logo .logo-stroke {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 0.6s var(--ease) 0.1s forwards;
}
.boot-logo .logo-stroke.two {
  animation-delay: 0.28s;
}
.boot-logo .logo-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: popIn 0.5s var(--spring) 0.55s both;
}
.boot-word {
  display: flex;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.32em;
  margin-right: -0.32em;
}
.boot-word span {
  display: inline-block;
  animation: letterIn 0.7s var(--ease-out) both;
  animation-delay: calc(0.3s + var(--c) * 0.045s);
}
@keyframes letterIn {
  from {
    opacity: 0;
    transform: translateY(18px) rotateX(70deg);
    filter: blur(8px);
  }
}
.boot-tag {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 236, 226, 0.55);
  animation: rise 0.6s var(--ease) 0.6s both;
}
.boot-bar {
  width: 140px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-top: 6px;
}
.boot-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--peach));
  transform-origin: left;
  animation: barFill 0.95s cubic-bezier(0.6, 0, 0.2, 1) 0.1s both;
}
@keyframes barFill {
  from {
    transform: scaleX(0);
  }
}

/* ---------------- shell ---------------- */
.shell {
  --gutter: clamp(10px, 1.25vw, 28px);
  --rail-w: 68px;
  --rail-gap: -34px;
  position: relative;
  z-index: 1;
  width: min(1720px, calc(100% - var(--gutter) * 2));
  margin: 16px auto 0;
  padding-bottom: 40px;
}
.shell.rail-open {
  --rail-w: 244px;
  --rail-gap: 14px;
}
.frame {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  transition: grid-template-columns 0.7s var(--ease-soft);
}

/* glass is painted on ::before so containers can move without
   becoming a backdrop root (which would turn the glass inside see-through) */
.g-panel,
.g-rail-pill {
  position: relative;
  isolation: isolate;
}
.g-panel::before,
.g-rail-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  border: 1px solid var(--edge);
  box-shadow: var(--glass-shadow);
  background: var(--chrome);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  backdrop-filter: blur(30px) saturate(1.5);
  pointer-events: none;
  animation: fadeGlass 1s var(--ease) var(--in, 0s) backwards;
  transition:
    background-color 0.8s,
    border-color 0.8s;
}
.g-panel::before {
  background: var(--panel);
  -webkit-backdrop-filter: blur(44px) saturate(1.5);
  backdrop-filter: blur(44px) saturate(1.5);
}
@keyframes fadeGlass {
  from {
    opacity: 0;
  }
}
.g-panel {
  --in: calc(var(--base) * 0.83);
}
.g-rail-pill {
  --in: calc(var(--base) * 0.93);
}


.g-panel {
  min-width: 0;
  margin-left: var(--rail-gap);
  padding: 30px clamp(14px, 1.6vw, 26px) 40px calc(max(0px, -1 * var(--rail-gap)) + clamp(14px, 1.6vw, 26px));
  border-radius: 44px;
  min-height: calc(100vh - 32px);
  animation: panelIn 1.1s var(--ease-out) var(--in) backwards;
  transition:
    margin-left 0.7s var(--ease-soft),
    padding-left 0.7s var(--ease-soft);
}
@keyframes panelIn {
  from {
    transform: translateY(26px) scale(0.975);
  }
}

/* ---------------- assistant prompt + orb (sidebar search) ---------------- */
.g-typed {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-typed::after {
  content: attr(data-rest);
  color: var(--chrome-dim);
  border-left: 1.5px solid var(--chrome-ink);
  margin-left: 1px;
  padding-left: 1px;
  animation: caret 1s steps(1) infinite;
}
@keyframes caret {
  50% {
    border-left-color: transparent;
  }
}

/* the assistant orb — three soft blobs swirling inside a glass bead */
.g-orb {
  position: relative;
  isolation: isolate;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 55%, #1b2a4a, #0b1226 70%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 4px 16px -4px rgba(80, 140, 255, 0.7);
}
.g-orb.small {
  width: 30px;
  height: 30px;
  animation: none;
}
.g-orb i {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  mix-blend-mode: screen;
  filter: blur(4px);
  animation: orbSpin 4.5s linear infinite;
}
.g-orb i:nth-child(1) {
  background: radial-gradient(circle at 30% 30%, #4fd1ff 0 35%, transparent 60%);
}
.g-orb i:nth-child(2) {
  background: radial-gradient(circle at 70% 40%, #b46bff 0 35%, transparent 60%);
  animation-duration: 3.4s;
  animation-direction: reverse;
}
.g-orb i:nth-child(3) {
  background: radial-gradient(circle at 50% 75%, #ff6fae 0 32%, transparent 60%);
  animation-duration: 5.8s;
}
.g-orb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.7), transparent 32%);
}
@keyframes orbSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------- sidebar: open glass panel ⇄ folded dock ----------------
   It is the whole navigation (search, pages, notifications, you).
   Collapsed it is the Glassy Dashboard v2 pill with the Sidebar v5 macOS
   Dock; open it is a labelled panel. The grid column and the panel's margin
   ease together when it toggles. */
.g-rail {
  position: sticky;
  top: 16px;
  align-self: start;
  z-index: 20;
  min-width: 0;
}
.g-rail-pill {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 48px 9px 9px;
  border-radius: 34px;
  color: var(--chrome-ink);
  transform-origin: top center;
  animation: railRise 1s var(--ease-out) var(--in) backwards;
  transition:
    padding 0.7s var(--ease-soft),
    border-radius 0.7s var(--ease-soft);
}
@keyframes railRise {
  from {
    transform: translateX(-26px) scaleY(0.88);
  }
}
.g-rail.open .g-rail-pill {
  padding: 14px 12px 12px;
  border-radius: 30px;
}

/* brand (open only) */
.rail-brand {
  display: none;
  align-items: center;
  gap: 11px;
  padding: 2px 4px 6px;
  white-space: nowrap;
}
.g-rail.open .rail-brand {
  display: flex;
  animation: rise 0.5s var(--ease) 0.15s both;
}
.rail-logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.5);
}
.rail-brand b,
.rail-brand small {
  display: block;
}
.rail-brand b {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.rail-brand small {
  font-size: 12px;
  color: var(--chrome-dim);
}

/* sections: a short divider when folded, a title when open */
.rail-group,
.rail-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rail-title {
  align-self: center;
  width: 26px;
  height: 1px;
  margin: 2px 0;
  overflow: hidden;
  font-size: 0;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--chrome-dim);
  background: rgba(255, 255, 255, 0.28);
  transition:
    width 0.7s var(--ease-soft),
    height 0.7s var(--ease-soft),
    margin 0.7s var(--ease-soft),
    background-color 0.3s;
}
.g-rail.open .rail-title {
  align-self: stretch;
  width: auto;
  height: 22px;
  margin: 6px 10px 0;
  font-size: 11px;
  background: transparent;
}
.rail-foot::before {
  content: '';
  align-self: center;
  width: 26px;
  height: 1px;
  margin: 2px 0;
  background: rgba(255, 255, 255, 0.28);
  transition: width 0.7s var(--ease-soft);
}
.g-rail.open .rail-foot::before {
  width: calc(100% - 20px);
  margin: 6px 0 2px;
}

/* buttons: a 50px circle folded, a full-width row open */
.g-rail-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  padding: 0 14px;
  border-radius: 25px;
  color: var(--chrome-ink);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  text-align: left;
  transform-origin: 50% 50%;
  transition:
    color 0.35s,
    background-color 0.25s,
    width 0.7s var(--ease-soft),
    height 0.7s var(--ease-soft),
    border-radius 0.7s var(--ease-soft);
  animation: slideRight 0.7s var(--ease-soft) both;
  animation-delay: calc(var(--base) + 200ms + var(--i, 0) * 50ms);
}
.g-rail-btn > svg,
.g-rail-btn > .avatar,
.g-rail-btn > .g-orb {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  transition: transform 0.3s var(--spring);
}
.g-rail-btn:hover:not(.on),
.g-rail-btn.is-open {
  background: var(--chrome-hover);
}
.g-rail-btn:active > svg {
  transform: scale(0.82);
}
.g-rail-btn.on {
  color: #141414;
}
.g-rail.open .g-rail-btn {
  width: 100%;
  height: 44px;
  border-radius: 14px;
}
.rail-label {
  position: relative;
  z-index: 1;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-width 0.7s var(--ease-soft),
    opacity 0.2s;
}
.g-rail.open .rail-label {
  max-width: 170px;
  opacity: 1;
  transition:
    max-width 0.7s var(--ease-soft),
    opacity 0.4s 0.18s;
}

/* the macOS Dock (folded only): JS eases --m (size) and --g (room) per icon.
   Icons grow from their own centre, so nothing drifts sideways. */
.g-rail:not(.open) [data-dock] {
  scale: var(--m, 1);
  margin-block: calc(var(--g, 0px) / 2);
}

/* search: the assistant orb (and, open, the typing prompt + ⌘K) */
.rail-search {
  gap: 10px;
  padding: 0 6px;
  background: var(--chrome-inset);
}
.rail-search .g-orb {
  width: 38px;
  height: 38px;
  animation: none;
}
.rail-search .g-typed {
  flex: 1;
  font-size: 13.5px;
}
.rail-kbd {
  max-width: 0;
  overflow: hidden;
  padding: 3px 0;
  opacity: 0;
  transition:
    max-width 0.7s var(--ease-soft),
    padding 0.7s var(--ease-soft),
    opacity 0.2s;
}
.g-rail.open .rail-search {
  height: 48px;
  border-radius: 24px;
  margin-bottom: 2px;
}
.g-rail.open .rail-kbd {
  max-width: 44px;
  padding: 3px 7px;
  margin-right: 4px;
  opacity: 0.85;
}

/* footer rows */
.g-rail:not(.open) .rail-more {
  display: none;
}
.rail-user {
  padding: 0 7px;
  gap: 11px;
}
.g-rail.open .rail-user {
  height: 56px;
  margin-top: 2px;
}
.rail-who b,
.rail-who small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-who b {
  font-size: 13.5px;
  font-weight: 600;
}
.rail-who small {
  font-size: 12px;
  font-weight: 400;
  color: var(--chrome-dim);
}
.rail-more {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.7;
}

.rail-badge {
  position: absolute;
  top: 3px;
  left: 31px;
  z-index: 2;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--peach);
  color: #2a1609;
  font-size: 10.5px;
  font-weight: 700;
  font-style: normal;
  animation: popIn 0.5s var(--spring);
}
.rail-badge.red {
  background: var(--red);
  color: #fff;
}
.g-rail.open .rail-badge {
  position: relative;
  top: auto;
  left: auto;
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  font-size: 11.5px;
}

/* the white pill that marks the current page */
.g-rail-ind {
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.4);
  transform-origin: 50% 50%;
  transition:
    opacity 0.3s,
    border-radius 0.7s var(--ease-soft);
  animation: popIn 0.7s var(--spring) calc(var(--base) + 650ms) both;
}
.g-rail.open .g-rail-ind {
  border-radius: 14px;
}

/* the round toggle: at the top of the dock when folded, on the top edge when open */
.rail-toggle {
  position: absolute;
  top: 10px;
  right: 19px;
  z-index: 25;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #141414;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.45);
  transition:
    top 0.7s var(--ease-soft),
    right 0.7s var(--ease-soft),
    transform 0.4s var(--spring);
  animation: popIn 0.6s var(--spring) calc(var(--base) + 900ms) both;
}
.rail-toggle:hover {
  transform: scale(1.14);
}
.rail-toggle:active {
  transform: scale(0.88);
}
.rail-toggle svg {
  transition: rotate 0.6s var(--spring);
}
.g-rail:not(.open) .rail-toggle svg {
  rotate: 180deg;
}
.g-rail.open .rail-toggle {
  top: 22px;
  right: -15px;
}

/* pop-overs open beside the sidebar, lined up with its foot */
.pop.rail-pop {
  top: auto;
  bottom: 0;
  left: calc(100% + 14px);
  right: auto;
  transform: translateX(-12px) scale(0.94);
  transform-origin: bottom left;
}
.pop.rail-pop.open {
  transform: none;
}

/* tooltips (folded only); they stay readable while their icon is magnified */
.g-rail-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 16px);
  top: 50%;
  translate: -6px -50%;
  scale: calc(1 / var(--m, 1));
  transform-origin: left center;
  padding: 7px 11px;
  border-radius: 10px;
  background: var(--soft-2);
  color: var(--ink);
  box-shadow: var(--pop-shadow);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.2s,
    translate 0.3s var(--ease);
}
.g-rail:not(.open) .g-rail-btn[data-tip]:hover::after {
  opacity: 1;
  translate: 0 -50%;
}
.g-rail.open .g-rail-btn[data-tip]::after,
.g-rail-btn.is-open[data-tip]::after {
  display: none;
}

/* ---------------- page head ---------------- */
.main {
  position: relative;
  container: main / inline-size;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.page-head h1 {
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 600;
  letter-spacing: -1.4px;
  line-height: 1.05;
}
.page-sub {
  margin-top: 10px;
  font-size: 15px;
  color: var(--ink-2);
  animation: rise 0.8s var(--ease) calc(var(--base) + 450ms) both;
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  animation: rise 0.8s var(--ease) calc(var(--base) + 350ms) both;
}

/* ---------------- card glass (every card on every page) ----------------
   Cards sit on the panel, which already frosts the room, so they only tint
   it — no second blur. That keeps scrolling smooth. */
.card,
.kpi {
  position: relative;
  min-width: 0;
  border-radius: var(--r-card);
  padding: 22px;
  background: var(--card-bg);
  border: 1px solid var(--edge-card);
  box-shadow: var(--card-shadow);
  transition:
    border-color 0.8s,
    box-shadow 0.4s;
}
.card > *,
.kpi > * {
  position: relative;
  z-index: 1;
}

/* entrance: rises out of the glass and tilts up — transform and opacity only */
[data-reveal] {
  opacity: 0;
}
[data-reveal].in {
  animation: cardIn 0.95s var(--ease-out) calc(var(--base, 0ms) + var(--i, 0) * 70ms) both;
}
[data-reveal].shown {
  opacity: 1;
  animation: none;
}
@keyframes cardIn {
  0% {
    opacity: 0;
    transform: perspective(1400px) translateY(48px) rotateX(14deg) scale(0.95);
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
/* leaving a page: the cards sink back into the glass */
.main.leaving [data-reveal] {
  animation: cardOut 0.22s ease-in both;
}
@keyframes cardOut {
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}

/* ---------------- bento grid ---------------- */
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.s3 {
  grid-column: span 3;
}
.s4 {
  grid-column: span 4;
}
.s5 {
  grid-column: span 5;
}
.s6 {
  grid-column: span 6;
}
.s7 {
  grid-column: span 7;
}
.s8 {
  grid-column: span 8;
}
.s12 {
  grid-column: span 12;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* ---------------- pop-overs ---------------- */
.pop {
  position: absolute;
  top: calc(100% + 14px);
  z-index: 60;
  width: 340px;
  padding: 10px;
  border-radius: 24px;
  background: var(--soft-2);
  border: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  backdrop-filter: blur(30px) saturate(1.5);
  box-shadow: var(--pop-shadow);
  color: var(--ink);
  opacity: 0;
  transform: translateY(-10px) scale(0.92);
  pointer-events: none;
  transition:
    opacity 0.22s,
    transform 0.5s var(--spring);
}
.pop.left {
  left: 0;
  transform-origin: top left;
}
.pop.right {
  right: 0;
  transform-origin: top right;
}
.pop.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 12px;
}
.user-card strong,
.user-card small {
  display: block;
}
.user-card small {
  color: var(--muted);
}
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border-radius: 13px;
  font-weight: 500;
  text-align: left;
  transition: background-color 0.2s;
}
.menu-item:hover {
  background: var(--soft);
}
.menu-item.danger {
  color: var(--red);
}
.pop hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 6px 4px;
}
.pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 10px;
}
.link {
  color: var(--accent-deep);
  font-weight: 500;
  font-size: 13px;
}
.link:disabled {
  opacity: 0.4;
}
.pop-list {
  display: grid;
  gap: 2px;
}
.pop-note {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 14px;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink-2);
  transition: background-color 0.2s;
}
.pop.open .pop-note {
  animation: rise 0.45s var(--ease) both;
  animation-delay: calc(var(--i) * 45ms + 60ms);
}
.pop-note:hover {
  background: var(--soft);
}
.pop-note strong {
  color: var(--ink);
}
.pop-note small {
  display: block;
  margin-top: 3px;
  color: var(--faint);
}
.pop-note.unread {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.pop-foot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  margin-top: 6px;
  border-radius: 14px;
  font-weight: 500;
  background: var(--soft);
}

/* ---------------- ⌘K palette ---------------- */
.palette-wrap {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 13vh 16px 0;
  background: rgba(20, 14, 8, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.palette-wrap.open {
  opacity: 1;
  pointer-events: auto;
}
.palette {
  width: min(620px, 100%);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(250, 247, 243, 0.82);
  border: 1px solid var(--edge);
  backdrop-filter: blur(40px) saturate(1.7);
  -webkit-backdrop-filter: blur(40px) saturate(1.7);
  box-shadow: var(--pop-shadow);
  color: var(--ink);
  transform: translateY(-16px) scale(0.94);
  transition: transform 0.55s var(--spring);
}
.palette-wrap.open .palette {
  transform: none;
}
.palette-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.palette-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 17px;
}
.palette-search kbd {
  background: var(--line);
  box-shadow: none;
}
.palette-list {
  max-height: min(52vh, 460px);
  overflow: auto;
  padding: 8px;
}
.palette-group {
  padding: 12px 12px 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.palette-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 12px;
  border-radius: 14px;
  text-align: left;
  font-weight: 500;
  transition: background-color 0.15s;
}
.palette-wrap.open .palette-item {
  animation: rise 0.4s var(--ease) both;
  animation-delay: calc(var(--i) * 22ms + 80ms);
}
.palette-item[aria-selected='true'] {
  background: var(--solid);
  color: var(--on-solid);
}
.palette-ic {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--soft);
}
.palette-item[aria-selected='true'] .palette-ic {
  background: rgba(255, 255, 255, 0.14);
}
.palette-ic .swatch {
  width: 16px;
  height: 16px;
}
.palette-label {
  flex: 1;
}
.palette-item kbd {
  background: var(--line);
  box-shadow: none;
}
.palette-go {
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 0.2s,
    transform 0.3s var(--ease);
}
.palette-item[aria-selected='true'] .palette-go {
  opacity: 1;
  transform: none;
}
.palette-empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

/* ---------------- toasts ---------------- */
.toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 130;
  display: grid;
  gap: 10px;
  justify-items: end;
}
.toast {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  padding: 13px 16px 13px 13px;
  border-radius: 20px;
  text-align: left;
  background: rgba(24, 21, 18, 0.82);
  color: #fff;
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.6s var(--spring) both;
}
.toast.leaving {
  animation: toastOut 0.3s var(--ease) both;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(60px) scale(0.9);
  }
}
@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
}
.toast-ic {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  color: #fff;
}
.toast-txt strong,
.toast-txt small {
  display: block;
}
.toast-txt small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.66);
}
.toast-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--peach));
  transform-origin: left;
  animation: timer linear both;
}
@keyframes timer {
  to {
    transform: scaleX(0);
  }
}

/* ---------------- signed out ---------------- */
.signed-out {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.so-card {
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 40px 32px;
  border-radius: 36px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  backdrop-filter: blur(30px) saturate(1.5);
  box-shadow: var(--glass-shadow);
  animation: cardIn 1s var(--ease-out) both;
}
.so-card h2 {
  font-size: 28px;
  letter-spacing: -0.8px;
}
.so-card p {
  color: var(--muted);
  margin-bottom: 8px;
}

/* ============================================================
   Responsive
   ============================================================ */
@container main (max-width: 1000px) {
  .s3,
  .s4,
  .s5 {
    grid-column: span 6;
  }
  .s7,
  .s8 {
    grid-column: span 12;
  }
}
@media (max-width: 720px) {
  .shell,
  .shell.rail-open {
    --rail-w: 0px;
    --rail-gap: 0px;
  }
  .shell {
    --gutter: 10px;
    margin-top: 10px;
    padding-bottom: 110px;
  }
  .frame {
    display: block;
  }
  .g-panel {
    margin-left: 0;
    padding: 24px 14px 30px;
    border-radius: 32px;
  }
  .s3,
  .s4,
  .s5,
  .s6,
  .s7,
  .s8 {
    grid-column: span 12;
  }
  .bento {
    gap: 14px;
  }
  .stack {
    gap: 14px;
  }
  .card,
  .kpi {
    padding: 18px;
    border-radius: 26px;
  }

  /* the rail becomes a floating bar at the bottom (always folded, no dock) */
  .g-rail {
    position: fixed;
    top: auto;
    bottom: 12px;
    left: 50%;
    translate: -50% 0;
    margin: 0;
    z-index: 50;
  }
  .g-rail-pill,
  .rail-group {
    flex-direction: row;
    gap: 4px;
  }
  .g-rail-pill {
    width: auto;
    padding: 6px;
    border-radius: 999px;
    animation-name: railUp;
  }
  @keyframes railUp {
    from {
      transform: translateY(30px) scale(0.9);
    }
  }
  .rail-brand,
  .rail-title,
  .rail-foot,
  .rail-toggle,
  .rail-pop,
  .g-rail-btn[data-rail='activity'],
  .g-rail-btn[data-rail='media'] {
    display: none !important;
  }
  .g-rail-btn {
    width: 42px;
    height: 42px;
    padding: 0 10px;
  }
  .rail-search {
    padding: 0 4px;
  }
  .rail-search .g-orb {
    width: 34px;
    height: 34px;
  }
  .g-rail-btn > svg {
    width: 20px;
    height: 20px;
  }
  .g-rail-btn[data-tip]::after {
    display: none;
  }
  .rail-badge {
    top: 0;
    left: 25px;
  }
  .toasts {
    left: 10px;
    right: 10px;
    bottom: 84px;
    justify-items: center;
  }
}
.self-start {
  align-self: start;
}
