/* ==========================================================================
   METRO OS — shell
   Tokens, device, status bar, navigation bar, start screen, tiles, Bloom,
   app list, jump list, context menu, action center, switcher, lock screen.
   ========================================================================== */

:root {
  --accent: #1ba1e2;
  --font: "Noto Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --bg: #000;
  --fg: #fff;
  --fg-2: rgba(255, 255, 255, .64);
  --fg-3: rgba(255, 255, 255, .38);
  --line: rgba(255, 255, 255, .22);
  --chrome: #1f1f1f;
  --chrome-2: #2e2e2e;
  --field: #cfcfcf;
  --nav-bg: #000;
  --ctx-bg: #fff;
  --ctx-fg: #000;
  --tile-fg: #fff;

  --sb-h: 26px;
  --nav-h: 48px;

  --e-metro: cubic-bezier(.2, .8, .2, 1);
  --e-out: cubic-bezier(.4, 0, .2, 1);
  --wallpaper: none;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fff;
  --fg: #000;
  --fg-2: rgba(0, 0, 0, .62);
  --fg-3: rgba(0, 0, 0, .38);
  --line: rgba(0, 0, 0, .2);
  --chrome: #dedede;
  --chrome-2: #cdcdcd;
  --field: #e4e4e4;
  --nav-bg: #f1f1f1;
  --ctx-bg: #1f1f1f;
  --ctx-fg: #fff;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: #000;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --------------------------------------------------------------------------
   Device + OS grid
   -------------------------------------------------------------------------- */
.device {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  isolation: isolate;
  container: device / size;
}
.os {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: var(--sb-h) minmax(0, 1fr) var(--nav-h);
  background: var(--bg);
  font-size: 15px;
}
.screen { position: relative; overflow: hidden; }
.brightness {
  position: absolute; inset: 0; z-index: 200; pointer-events: none;
  background: #000; opacity: var(--dim, 0); transition: opacity .3s;
}

/* --------------------------------------------------------------------------
   Status bar + navigation bar
   -------------------------------------------------------------------------- */
.statusbar {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  font-size: 12px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  user-select: none;
  touch-action: none;
}
.statusbar__icons { display: flex; align-items: center; gap: 9px; font-size: 11px; }
.statusbar__icons .is-dot { color: var(--accent); }
.statusbar__time { font-variant-numeric: tabular-nums; }

.navbar {
  position: relative; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--nav-bg);
  color: var(--fg);
}
.navbar button {
  display: grid; place-items: center;
  border: 0; background: none; cursor: pointer;
  font-size: 18px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.navbar button:active { background: color-mix(in srgb, var(--fg) 14%, transparent); }
.navbar .navbar__mark { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   Views (apps, info pages)
   -------------------------------------------------------------------------- */
.views { position: absolute; inset: 0; pointer-events: none; }
.view {
  position: absolute; inset: 0; z-index: 2;
  background: var(--bg);
  overflow: hidden;
  pointer-events: auto;
  transform-origin: 0 50%;
}

/* --------------------------------------------------------------------------
   Home: start + app list side by side
   -------------------------------------------------------------------------- */
.home { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y; }
.home__wall {
  position: absolute; inset: 0 -12% 0 0;
  background: var(--wallpaper) center / cover no-repeat;
  transition: transform .35s var(--e-metro);
}
.home__track {
  position: absolute; inset: 0;
  display: flex; width: 200%;
  transition: transform .35s var(--e-metro);
}
.home__track.is-dragging, .home__track.is-dragging ~ .home__wall { transition: none; }
.home__pane { position: relative; width: 50%; height: 100%; }
.home__pane.is-receded { transform: scale(.94); transition: transform .2s var(--e-out); }

.start {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 12px 8px 28px;
  scrollbar-width: none;
  touch-action: pan-y;
}
.start::-webkit-scrollbar { display: none; }
.tiles-wrap { container-type: inline-size; }
.tiles {
  --cols: 6;
  --gap: 6px;
  --cell: calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols));
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: var(--cell);
  gap: var(--gap);
  grid-auto-flow: row dense;
}
:root[data-cols="4"] .tiles { --cols: 4; --gap: 8px; }

.start__more {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 4px 4px; padding: 0;
  border: 0; background: none; cursor: pointer;
  font-size: 15px; color: var(--fg);
}
.start__more span.ring {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--fg); display: grid; place-items: center; font-size: 14px;
}
.start__more:active span.ring { background: var(--fg); color: var(--bg); }

/* --------------------------------------------------------------------------
   Tiles
   -------------------------------------------------------------------------- */
.tile {
  --tile-bg: var(--accent);
  position: relative;
  color: var(--tile-fg);
  cursor: pointer;
  container-type: size;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: pan-y;
  outline-offset: 3px;
  transition: transform .2s var(--e-out), opacity .2s;
}
:root[data-tiles="app"] .tile, :root[data-tiles="app"] .applist__icon { --tile-bg: var(--app-color); }
:root[data-tiles="glass"] .tile { --tile-bg: color-mix(in srgb, var(--accent) 62%, transparent); }
.tile[data-size="s"] { grid-column: span 1; grid-row: span 1; }
.tile[data-size="m"] { grid-column: span 2; grid-row: span 2; }
.tile[data-size="w"] { grid-column: span 4; grid-row: span 2; }
.tile[data-size="l"] { grid-column: span 4; grid-row: span 4; }

.tile__inner { position: absolute; inset: 0; perspective: 900px; }
.tile__face {
  position: absolute; inset: 0;
  overflow: hidden;
  background: var(--tile-bg);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .8s var(--e-out);
}
.tile__face--back { transform: rotateX(180deg); }
.tile.is-flipped .tile__face--front { transform: rotateX(-180deg); }
.tile.is-flipped .tile__face--back { transform: rotateX(0deg); }

.tile__icon {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 30cqmin;
}
.tile[data-size="s"] .tile__icon { font-size: 44cqmin; }
.tile[data-size="w"] .tile__icon { font-size: 34cqh; }
.tile[data-size="l"] .tile__icon { font-size: 22cqmin; }
.tile__icon svg { width: 1em; height: 1em; }
.tile__label {
  position: absolute; left: 7px; right: 7px; bottom: 5px;
  font-size: 12px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile[data-size="s"] .tile__label { display: none; }
.tile__badge {
  position: absolute; right: 8px; bottom: 5px;
  font-size: 13px; font-weight: 600;
}
.tile[data-size="s"] .tile__badge { right: 4px; bottom: 2px; font-size: 11px; }
.tile__big {
  position: absolute; left: 8px; top: 4px;
  font-size: 34cqh; font-weight: 300; line-height: 1.05;
}
.tile__text { position: absolute; left: 8px; right: 8px; top: 8px; font-size: 13px; line-height: 1.35; overflow: hidden; max-height: calc(100% - 30px); }
.tile__num { position: absolute; right: 8px; bottom: 4px; font-size: 24cqh; font-weight: 300; line-height: 1; }
.tile__text b { display: block; font-size: 15px; font-weight: 600; }
.tile__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile__img.is-panning { animation: pan-up 6s var(--e-out) forwards; }
.tile__shade::after {
  content: ""; position: absolute; inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
}
.tile__mosaic { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
.tile__mosaic span { display: grid; place-items: center; font-size: 18cqh; font-weight: 300; color: #fff; }

.tile:focus-visible { outline: 2px solid var(--fg); }

/* press tilt is set inline by JS; this keeps it springy */
.is-tilting { transition: transform .08s linear !important; }

/* edit mode */
.tiles.is-editing .tile { transform: scale(.9); opacity: .72; }
.tiles.is-editing .tile .tile__inner { animation: float-edit-1 4.6s ease-in-out infinite; }
.tiles.is-editing .tile:nth-child(4n+2) .tile__inner { animation-name: float-edit-2; animation-duration: 5.2s; }
.tiles.is-editing .tile:nth-child(4n+3) .tile__inner { animation-name: float-edit-3; animation-duration: 4.2s; }
.tiles.is-editing .tile:nth-child(4n+4) .tile__inner { animation-name: float-edit-4; animation-duration: 5.6s; }
.tiles.is-editing .tile.is-selected { transform: none; opacity: 1; z-index: 3; }
.tiles.is-editing .tile.is-selected .tile__inner { animation: none; }
.tile__edit { display: none; }
.tile.is-selected .tile__edit { display: block; }
.tile__edit button {
  position: absolute; z-index: 4;
  width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: var(--fg); color: var(--bg);
  display: grid; place-items: center; font-size: 12px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.tile__edit .tile__unpin { top: -10px; right: -10px; }
.tile__edit .tile__resize { bottom: -10px; right: -10px; }
.tile.is-placeholder .tile__inner { opacity: 0; }
.tile.is-placeholder { outline: 2px dashed var(--fg-3); outline-offset: -2px; }
.tile-ghost {
  position: absolute; z-index: 35; pointer-events: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
  transform: scale(1.06);
  opacity: .96;
}
.tile.is-removing { animation: tile-removal .22s ease-in forwards; }

/* notifications on tiles: a marker for quiet news; a pulse while a call rings */
.tile__dot { position: absolute; right: 6px; top: 6px; z-index: 3; width: 7px; height: 7px; background: #fff; display: none; pointer-events: none; }
.tile.has-dot .tile__dot { display: block; }

/* status bar chips: live things (a call, a recording, a timer) */
.statusbar .chip { display: inline-block; padding: 0 6px; margin-left: 2px; font-size: 11px; line-height: 18px; background: var(--chrome-2); color: var(--fg); border: 0; cursor: pointer; font-variant-numeric: tabular-nums; }
.statusbar .chip--call { background: #3b6d11; color: #eaf3de; }
.statusbar .chip--rec { background: #a32d2d; color: #fcebeb; }

/* incoming call: a banner when you're using Metro OS, full screen when locked */
.callbar { position: absolute; left: 0; right: 0; top: 0; z-index: 85; padding: 10px 12px 12px; background: var(--chrome-2); color: var(--fg); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.callbar__who { display: flex; align-items: center; gap: 10px; }
.callbar__who b { display: block; font-size: 17px; font-weight: 600; }
.callbar__who span { font-size: 12px; color: var(--fg-2); }
.callscreen { position: absolute; inset: 0; z-index: 93; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: 24px; background: var(--accent); color: #fff; animation: fade-in .25s ease-out; }
.callscreen__via { margin: 0; font-size: 14px; opacity: .85; }
.callscreen__name { margin: 8px 0 0; font-size: 38px; font-weight: 300; line-height: 1.1; }
.callscreen__num { margin: 0; font-size: 16px; opacity: .85; font-variant-numeric: tabular-nums; }
.call__av { display: grid; place-items: center; flex: none; color: #fff; font-weight: 300; }
.call__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.call__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 2px solid currentColor; background: none; color: inherit; font-size: 14px; cursor: pointer; }
.call__btn--yes { background: #3b6d11; border-color: #3b6d11; color: #fff; }
.call__btn--no { background: #a32d2d; border-color: #a32d2d; color: #fff; }

/* hold ring — tells you holding will open options */
.holdring {
  position: absolute; z-index: 30; pointer-events: none;
  width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .12);
  animation: hold-grow .45s linear forwards;
}

/* --------------------------------------------------------------------------
   Bloom
   -------------------------------------------------------------------------- */
.bloom { position: absolute; inset: 0; z-index: 40; }
.bloom__scrim {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .38);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  animation: fade-in .22s ease-out both;
}
.bloom.is-closing .bloom__scrim { animation: fade-out .18s ease-in forwards; }
.bloom__origin {
  position: absolute; z-index: 2; cursor: pointer;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
  transition: transform .28s var(--e-metro);
}
.bloom__origin .tile { position: absolute; inset: 0; }
.bloom__sat {
  position: absolute; z-index: 1;
  border: 0; padding: 0; margin: 0;
  background: var(--sat-bg, var(--accent));
  color: #fff; text-align: left;
  cursor: pointer; overflow: hidden;
  container-type: size;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .42);
}
:root[data-tiles="app"] .bloom__sat { --sat-bg: var(--app-color); }
.bloom__sat--sys { --sat-bg: color-mix(in srgb, var(--accent) 55%, #111) !important; }
.bloom__sat:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bloom__sat:active { filter: brightness(1.15); }
.bloom__sat .sat__icon { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42cqmin; }
.bloom__sat--m .sat__icon, .bloom__sat--w .sat__icon { font-size: 26cqmin; }
.bloom__sat .sat__label {
  position: absolute; left: 7px; right: 7px; bottom: 5px;
  font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bloom__sat--s .sat__label { display: none; }
.bloom__hint {
  position: absolute; left: 0; right: 0; bottom: 10px; z-index: 3;
  text-align: center; font-size: 12px; color: rgba(255, 255, 255, .8);
  pointer-events: none;
}

/* live satellites */
.sat-live { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 8px; gap: 4px; font-size: 13px; }
.sat-live__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sat-live__art + .sat-live__body { position: relative; }
.sat-live__title { font-size: 15px; font-weight: 600; line-height: 1.2; }
.sat-live__sub { font-size: 12px; opacity: .85; }
.sat-live__big { font-size: 30cqh; font-weight: 300; line-height: 1; }
.sat-live__controls { margin-top: auto; display: flex; gap: 6px; }
.sat-live__controls button {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid #fff; background: none; color: #fff;
  display: grid; place-items: center; font-size: 12px; cursor: pointer;
}
.sat-live__controls button:active { background: #fff; color: #000; }
.sat-live__progress { height: 3px; background: rgba(255, 255, 255, .3); }
.sat-live__progress i { display: block; height: 100%; background: #fff; width: var(--p, 0%); transition: width .9s linear; }
.sat-live--shade::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(0, 0, 0, .05), rgba(0, 0, 0, .6));
}

/* --------------------------------------------------------------------------
   App list + jump list
   -------------------------------------------------------------------------- */
.applist {
  position: absolute; inset: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 14px 28px 18px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  scrollbar-width: none;
  touch-action: pan-y;
}
.applist::-webkit-scrollbar { display: none; }
.applist__search { position: relative; margin: 2px 0 8px; }
.applist__search input {
  width: 100%; height: 38px;
  border: 2px solid transparent; border-radius: 0;
  background: var(--field); color: #000;
  font: inherit; font-size: 15px;
  padding: 0 36px 0 10px;
}
.applist__search input:focus { outline: none; background: #fff; border-color: var(--accent); }
.applist__search i { position: absolute; right: 12px; top: 11px; color: #333; font-size: 14px; pointer-events: none; }
.applist__letter {
  display: flex; align-items: flex-end;
  width: 46px; height: 46px;
  margin: 12px 0 6px; padding: 0 0 3px 6px;
  border: 2px solid var(--accent); background: none;
  color: var(--accent); font-size: 26px; line-height: 1;
  cursor: pointer;
}
.applist__item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 4px 0;
  border: 0; background: none; text-align: left;
  font-size: 19px; cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transform-origin: 0 50%;
}
.applist__icon {
  --tile-bg: var(--accent);
  flex: none; width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--tile-bg); color: #fff; font-size: 20px;
}
.applist__icon svg { width: 22px; height: 22px; }
.applist__name { display: flex; flex-direction: column; line-height: 1.15; }
.applist__name small { font-size: 12px; color: var(--fg-3); }
.applist__empty { color: var(--fg-2); padding: 12px 0; }

.jumplist {
  position: absolute; inset: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  align-content: start;
  padding: 18px 16px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  perspective: 1000px;
}
.jumplist button {
  aspect-ratio: 1;
  display: flex; align-items: flex-end;
  padding: 0 0 4px 8px;
  border: 0; background: var(--chrome); color: var(--fg-3);
  font-size: 30px; line-height: 1;
  cursor: default;
  transform-origin: 0 50%;
  animation: flip-in .3s ease-out backwards;
}
.jumplist button.has { background: var(--accent); color: #fff; cursor: pointer; }

/* --------------------------------------------------------------------------
   Context menu (hold in the app list)
   -------------------------------------------------------------------------- */
.ctx-scrim { position: absolute; inset: 0; z-index: 44; }
.ctx {
  position: absolute; left: 0; right: 0; z-index: 45;
  padding: 10px 0;
  background: var(--ctx-bg); color: var(--ctx-fg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  animation: ctx-in .22s var(--e-metro) both;
}
.ctx button {
  display: block; width: 100%;
  padding: 10px 22px;
  border: 0; background: none; text-align: left;
  font-size: 19px; cursor: pointer;
}
.ctx button:hover, .ctx button:focus-visible { background: color-mix(in srgb, var(--ctx-fg) 8%, transparent); outline: none; }
.ctx button:active { background: var(--accent); color: #fff; }

/* --------------------------------------------------------------------------
   Action center
   -------------------------------------------------------------------------- */
.ac { position: absolute; inset: 0; z-index: 70; pointer-events: none; }
.ac.is-open { pointer-events: auto; }
.ac__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .3s; }
.ac.is-open .ac__scrim { opacity: 1; }
.ac__panel {
  position: absolute; left: 0; right: 0; top: 0;
  max-height: calc(100% - 36px);
  display: flex; flex-direction: column;
  background: var(--chrome);
  transform: translateY(-102%);
  transition: transform .3s var(--e-out);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.ac.is-open .ac__panel { transform: none; }
.ac__panel.is-dragging { transition: none; }
.ac__head { display: flex; align-items: flex-end; justify-content: space-between; padding: 14px 14px 10px; }
.ac__time { font-size: 30px; font-weight: 300; line-height: 1; }
.ac__date { font-size: 13px; color: var(--fg-2); margin-top: 4px; }
.ac__settings { border: 0; background: none; font-size: 13px; cursor: pointer; color: var(--fg); display: flex; align-items: center; gap: 6px; }
.ac__quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 10px; }
.qa {
  aspect-ratio: 1.2;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 7px 8px;
  border: 0; background: var(--chrome-2); color: var(--fg);
  text-align: left; font-size: 11.5px; line-height: 1.15; cursor: pointer;
}
.qa i { font-size: 16px; }
.qa.is-on { background: var(--accent); color: #fff; }
.qa:active { filter: brightness(1.2); }
.ac__expand { display: block; margin: 4px 10px 0 auto; border: 0; background: none; font-size: 12px; color: var(--fg-2); cursor: pointer; padding: 4px 0; }
.ac__list { flex: 1; overflow-y: auto; padding: 6px 0 4px; min-height: 60px; }
.ac__group { padding: 6px 0; }
.ac__group-title { display: flex; align-items: center; gap: 8px; padding: 0 14px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--fg-2); }
.ac__group-title i { color: var(--accent); }
.note {
  display: block; width: 100%;
  padding: 6px 14px 8px 36px;
  border: 0; background: none; text-align: left; cursor: pointer;
  touch-action: pan-y;
}
.note b { display: block; font-size: 14px; font-weight: 600; }
.note span { display: block; font-size: 13px; color: var(--fg-2); }
.note time { font-size: 11px; color: var(--fg-3); }
.note.is-leaving { animation: slide-out-right .3s ease-in forwards; }
.ac__empty { padding: 18px 14px; color: var(--fg-2); font-size: 14px; }
.ac__foot { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px 4px; border-top: 1px solid var(--line); }
.ac__foot button { border: 0; background: none; font-size: 13px; color: var(--fg); cursor: pointer; padding: 6px 0; }
.ac__handle { height: 18px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.ac__handle::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: var(--fg-3); }

/* toast banner */
.toast {
  position: absolute; left: 0; right: 0; top: 0; z-index: 80;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; min-height: var(--sb-h);
  background: var(--accent); color: #fff;
  font-size: 13.5px; line-height: 1.3; cursor: pointer;
  animation: toast-in .3s var(--e-out) both;
  touch-action: none;
}
.toast b { font-weight: 700; }
.toast.is-leaving { animation: toast-out .25s ease-in forwards; }
.toast--plain { background: var(--chrome-2); color: var(--fg); }

/* --------------------------------------------------------------------------
   App switcher
   -------------------------------------------------------------------------- */
.switcher {
  position: absolute; inset: 0; z-index: 60;
  display: flex; flex-direction: column; justify-content: center;
  background: rgba(0, 0, 0, .86);
  animation: fade-in .2s ease-out;
}
.switcher__track {
  display: flex; gap: 18px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 20%;
  scrollbar-width: none;
}
.switcher__track::-webkit-scrollbar { display: none; }
.card { flex: none; width: 60%; scroll-snap-align: center; color: #fff; touch-action: pan-x; }
.card__title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.card__title i { color: var(--accent); }
.card__shot {
  position: relative; overflow: hidden;
  background: var(--bg); cursor: pointer;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
  transition: transform .25s var(--e-out), opacity .25s;
}
.card__shot > * { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.card__close {
  display: block; margin: 10px auto 0;
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid #fff; background: none; color: #fff; cursor: pointer;
}
.switcher__empty { text-align: center; color: rgba(255, 255, 255, .7); font-size: 15px; }

/* --------------------------------------------------------------------------
   Lock screen
   -------------------------------------------------------------------------- */
.lock {
  position: absolute; inset: 0; z-index: 90;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 22px 96px;
  background: var(--lock-bg, #000) center / cover no-repeat;
  color: #fff;
  cursor: grab;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  will-change: transform;
}
.lock::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(transparent 40%, rgba(0, 0, 0, .45));
  pointer-events: none;
}
.lock > * { position: relative; }
.lock.is-bouncing { animation: lock-bounce .45s var(--e-out); }
.lock__bar { position: absolute; top: 0; left: 0; right: 0; height: var(--sb-h); display: flex; justify-content: space-between; align-items: center; padding: 0 12px; font-size: 12px; }
.lock__time { font-size: 88px; font-weight: 300; line-height: .95; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.lock__ampm { font-size: 26px; letter-spacing: 0; margin-left: 6px; }
.lock__date { font-size: 24px; font-weight: 300; margin-top: 6px; }
.lock__status { margin-top: 18px; font-size: 15px; line-height: 1.35; max-width: 85%; }
.lock__status b { display: block; font-weight: 600; }
.lock__icons { display: flex; gap: 16px; margin-top: 16px; font-size: 15px; }
.lock__icons span { display: flex; align-items: center; gap: 6px; }
.lock__hint {
  position: absolute; left: 0; right: 0; bottom: 34px;
  text-align: center; font-size: 13px; opacity: .85;
  animation: hint-bob 2.4s var(--e-out) infinite;
}
.lock__hint i { display: block; font-size: 16px; margin-bottom: 4px; }

.pin {
  position: absolute; inset: 0; z-index: 91;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 0 18px;
  background: rgba(0, 0, 0, .78);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  color: #fff;
  animation: fade-in .2s ease-out;
}
.pin__prompt { text-align: center; font-size: 16px; margin-bottom: 12px; }
.pin__dots { display: flex; justify-content: center; gap: 14px; height: 18px; margin-bottom: 26px; }
.pin__dots i { width: 14px; height: 14px; border: 2px solid #fff; }
.pin__dots i.is-filled { background: #fff; }
.pin__dots.is-wrong { animation: shake .3s linear 2; }
.pin__pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 16px; }
.pin__pad button {
  height: 58px; border: 0; background: rgba(255, 255, 255, .1); color: #fff;
  font-size: 26px; font-weight: 300; cursor: pointer;
}
.pin__pad button:active { background: var(--accent); }
.pin__pad button small { display: block; font-size: 10px; letter-spacing: .12em; opacity: .7; }

/* --------------------------------------------------------------------------
   Wide screens (full screen mode on a computer, or a tablet held sideways):
   the tile grid gains columns and is centred; reading pages get a
   comfortable column; menus stop stretching edge to edge.
   -------------------------------------------------------------------------- */
.tiles-wrap { margin-inline: auto; }
@container device (min-width: 700px) {
  .start { padding-inline: 24px; }
  .applist { padding-inline: max(18px, calc(50cqw - 300px)); }
  .navbar { grid-template-columns: repeat(3, minmax(0, 140px)); justify-content: center; }
  .jumplist { grid-template-columns: repeat(7, 84px); justify-content: center; align-content: center; }
  .ctx { right: auto; width: min(100%, 420px); }
  .ac__panel { left: auto; width: min(100%, 420px); max-height: 100%; bottom: 0; }
  .ac.is-open .ac__panel { transform: none; }
  .ac__panel { transform: translateX(104%); }
  .card { width: min(60%, 520px); }
  .lock { padding: 0 6cqw 12cqh; }
  .lock__time { font-size: 120px; }
  .pin__pad { width: 360px; margin: 0 auto; }
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@keyframes flip-in { from { transform: perspective(1000px) rotateY(80deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flip-out { from { transform: none; opacity: 1; } to { transform: perspective(1000px) rotateY(-80deg); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes slide-in-right { from { transform: translateX(100%); opacity: 0; } }
@keyframes slide-in-left { from { transform: translateX(-100%); opacity: 0; } }
@keyframes slide-out-right { to { transform: translateX(100%); opacity: 0; } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-10px); } }
@keyframes rise-in { from { transform: translateY(120%); } 70% { transform: translateY(-20%); } to { transform: none; } }
@keyframes ctx-in { from { opacity: 0; transform: translateY(-8px) scaleY(.9); } }
@keyframes toast-in { from { transform: translateY(-100%); } }
@keyframes toast-out { to { transform: translateY(-100%); } }
@keyframes tile-removal { to { transform: scale(0); opacity: 0; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
@keyframes hold-grow { from { transform: scale(.35); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
@keyframes hint-bob { 0%, 100% { transform: none; } 50% { transform: translateY(-8px); } }
@keyframes lock-bounce { 0%, 100% { transform: none; } 40% { transform: translateY(-48px); } }
@keyframes pan-up { from { object-position: center top; } to { object-position: center 70%; } }
@keyframes float-edit-1 { 0%, 100% { transform: none; } 25% { transform: translate(3px, -5px); } 50% { transform: translate(-4px, -2px); } 75% { transform: translate(2px, -4px); } }
@keyframes float-edit-2 { 0%, 100% { transform: none; } 20% { transform: translate(-3px, -4px); } 40% { transform: translate(4px, -1px); } 60% { transform: translate(-1px, -6px); } 80% { transform: translate(3px, -3px); } }
@keyframes float-edit-3 { 0%, 100% { transform: none; } 30% { transform: translate(5px, -3px); } 60% { transform: translate(-2px, -5px); } 90% { transform: translate(4px, -1px); } }
@keyframes float-edit-4 { 0%, 100% { transform: none; } 15% { transform: translate(-4px, -3px); } 35% { transform: translate(3px, -5px); } 55% { transform: translate(-3px, -1px); } 75% { transform: translate(1px, -4px); } 95% { transform: translate(-5px, -2px); } }

/* Less motion: set by Settings › start + theme › Motion. "Follow my device"
   resolves the system's prefers-reduced-motion into this attribute in JS,
   so the user can still choose full motion on a device that asks for less. */
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}

/* lock screen: the newest notification (text only if previews are on) */
.lock__preview { margin-top: 10px; font-size: 14px; max-width: 90%; display: flex; align-items: center; }
.lock__preview:empty { display: none; }

/* ==========================================================================
   Notification motion (0.5)
   ========================================================================== */

/* banner: accent strip from the top, two lines, app icon, "+N", timer line */
.banner {
  position: absolute; left: 0; right: 0; top: 0; z-index: 80;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 10px;
  background: var(--accent); color: #fff;
  cursor: pointer; touch-action: none; overflow: hidden;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
  animation: banner-in .46s cubic-bezier(.2, 1.25, .35, 1) both;
}
.banner.is-dragging { animation: none; }
.banner.is-leaving { animation: banner-out .22s cubic-bezier(.5, 0, .9, .4) forwards; }
.banner__icon {
  flex: none; width: 32px; height: 32px;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .2); font-size: 15px;
  animation: banner-icon .5s .06s cubic-bezier(.2, 1.4, .4, 1) both;
}
.banner__icon svg { width: 16px; height: 16px; }
.banner__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; animation: banner-text .4s .1s var(--e-metro) both; }
.banner__title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner__body { font-size: 13px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner__body:empty, .banner__more:empty { display: none; }
.banner__more { flex: none; padding: 2px 7px; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .24); }
.banner.is-bump .banner__text { animation: banner-bump .38s var(--e-metro); }
.banner.is-bump .banner__more { animation: badge-bump .45s cubic-bezier(.2, 1.5, .4, 1); }
.banner__timer {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: rgba(255, 255, 255, .55); transform-origin: left center;
  animation: banner-timer var(--dwell, 4600ms) linear forwards;
}
.banner.is-dragging .banner__timer { animation-play-state: paused; }
@keyframes banner-in { from { transform: translateY(-105%); } }
@keyframes banner-out { to { transform: translateY(-110%); } }
@keyframes banner-icon { from { transform: scale(.3) rotate(-25deg); opacity: 0; } }
@keyframes banner-text { from { transform: translateX(14px); opacity: 0; } }
@keyframes banner-bump { from { transform: translateY(10px); opacity: .1; } }
@keyframes banner-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* tiles: arrival dip + springy flip, rolling counts, ringing ripple, marker pop */
.tile.is-arriving .tile__face { transition-duration: .75s; transition-timing-function: cubic-bezier(.3, 1.45, .45, 1); }
.tile.is-arriving .tile__inner { animation: tile-arrive .7s cubic-bezier(.3, 1.2, .4, 1); }
@keyframes tile-arrive { 0% { transform: none; } 22% { transform: scale(.92); } 60% { transform: scale(1.035); } 100% { transform: none; } }
.tile__badge.is-bump { animation: badge-bump .5s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes badge-bump { from { transform: translateY(80%) scale(.6); opacity: 0; } }
.tile__count { position: absolute; right: 6px; top: 4px; z-index: 2; font-size: 12px; font-weight: 700; }
.tile.is-ringing::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  border: 2px solid #fff; animation: tile-ripple 1.2s cubic-bezier(.2, .6, .4, 1) infinite;
}
.tile.is-ringing .tile__inner { animation: tile-ring 1.2s ease-in-out infinite; }
@keyframes tile-ring { 0%, 100% { transform: none; } 12% { transform: rotate(-2.5deg) scale(1.03); } 24% { transform: rotate(2.5deg) scale(1.03); } 36% { transform: none; } }
@keyframes tile-ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(1.3); opacity: 0; } }
.tile.has-dot .tile__dot { animation: dot-in .4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes dot-in { from { transform: scale(0); } }

/* calls: the avatar pulses while it rings */
.callbar .call__av, .callscreen.is-ringing .call__av { animation: av-pulse 1.4s ease-out infinite; }
@keyframes av-pulse { from { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); } to { box-shadow: 0 0 0 16px rgba(255, 255, 255, 0); } }
.callbar { animation: banner-in .46s cubic-bezier(.2, 1.25, .35, 1) both; }
.callbar.is-leaving { animation: banner-out .22s ease-in forwards; }

/* action center: notifications slide in one after another; app name opens the app */
.ac.is-entering .note, .ac.is-entering .ac__group-title { animation: note-in .38s var(--e-metro) backwards; animation-delay: calc(var(--i, 0) * 32ms + 90ms); }
@keyframes note-in { from { transform: translateX(28px); opacity: 0; } }
button.ac__group-title { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
button.ac__group-title:hover { color: var(--fg); }
