/* Fonts: Latin subsets from Google Fonts, SIL Open Font License */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Kalam";
  src: url("fonts/kalam-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Kalam";
  src: url("fonts/kalam-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #eef3fb;
  --sheet: #fbfaff;
  --band: #eef2fa;
  --rule: #d8dfee;
  --edge: #c8d2e6;
  --ink: #23304a;
  --muted: #5a6784;
  --pencil: #a93a17;
  --on-ink: #ffffff;
  --bar: #f6c9da;
  --bar-idle: #e4e9f3;
  --on-bar: #23304a;
  --note: #ffe8a3;
  --note-ink: #3a3320;
  --mint: #d5f1e2;
  --sky: #d9e8fb;
  --rose: #fbd9e1;
  --glass: rgb(251 250 255/0.8);
  --shadow: 35 48 74;
  --blend: multiply;
  --wall-filter: none;
  --wall-tint: rgb(18 24 41/0);
  --sans: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --hand: "Kalam", "Segoe Print", "Comic Sans MS", cursive;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121829;
    --sheet: #1a2236;
    --band: #222b42;
    --rule: #2f3a55;
    --edge: #3b4865;
    --ink: #e9eef8;
    --muted: #a4afcb;
    --pencil: #ff9f85;
    --on-ink: #121829;
    --bar: #4b3b63;
    --bar-idle: #283149;
    --on-bar: #f4f0fa;
    --note: #4f4628;
    --note-ink: #f7ecc8;
    --mint: #1e3b33;
    --sky: #20324f;
    --rose: #45263a;
    --glass: rgb(26 34 54/0.82);
    --shadow: 0 0 0;
    --blend: screen;
    --wall-filter: brightness(0.55) saturate(0.9);
    --wall-tint: rgb(18 24 41/0.35);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #121829;
  --sheet: #1a2236;
  --band: #222b42;
  --rule: #2f3a55;
  --edge: #3b4865;
  --ink: #e9eef8;
  --muted: #a4afcb;
  --pencil: #ff9f85;
  --on-ink: #121829;
  --bar: #4b3b63;
  --bar-idle: #283149;
  --on-bar: #f4f0fa;
  --note: #4f4628;
  --note-ink: #f7ecc8;
  --mint: #1e3b33;
  --sky: #20324f;
  --rose: #45263a;
  --glass: rgb(26 34 54/0.82);
  --shadow: 0 0 0;
  --blend: screen;
  --wall-filter: brightness(0.55) saturate(0.9);
  --wall-tint: rgb(18 24 41/0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-color: var(--edge);
  text-underline-offset: 0.1875rem;
}

a:hover {
  text-decoration-color: var(--pencil);
}

:focus-visible {
  outline: 0.125rem solid var(--pencil);
  outline-offset: 0.125rem;
}

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

[hidden] {
  display: none !important;
}

.small {
  font-size: 0.8125rem;
}

.muted {
  color: var(--muted);
}

body.dragging,
body.dragging * {
  cursor: grabbing !important;
  user-select: none;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

.ico {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ico .acc {
  stroke: var(--pencil);
}

.ico .fill {
  fill: var(--pencil);
  stroke: none;
}

.ico.sm {
  width: 1rem;
  height: 1rem;
}

/* Wallpaper */
.wall {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--paper);
}

.wall img,
.wall canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 38% 50%;
  filter: var(--wall-filter);
  transition: filter 0.4s;
}

.wall canvas {
  opacity: 0;
  transition:
    opacity 0.9s,
    filter 0.4s;
}

.wall.live canvas {
  opacity: 1;
}

.wall::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--wall-tint);
  transition: background-color 0.4s;
}

/* Boot sequence */

/* How long the checks take to play out. The screen then waits for a tap or key. */
:root {
  --boot-time: 3s;
  --boot-step: calc(var(--boot-time) / 15);
}

.boot {
  display: none;
}

:root.booting .boot {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  align-content: center;
  gap: 0.375rem;
  padding: 2rem 1.5rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.boot > * {
  width: min(26rem, 100%);
  margin: 0 auto;
}

.boot-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto 0.75rem;
  font-weight: 500;
  color: var(--pencil);
}

.boot-head span {
  color: var(--muted);
}

.boot-lines {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.375rem;
}

.boot-lines li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  animation: boot-line calc(var(--boot-step) * 2.6) both;
  animation-delay: calc(var(--i) * var(--boot-step) + var(--boot-step) * 1.2);
}

.boot-lines li::before {
  content: "";
  order: 1;
  flex: 1;
  border-bottom: 1px dotted var(--edge);
  translate: 0 -0.25rem;
}

.boot-lines li b {
  order: 2;
  font-weight: 500;
  color: var(--muted);
}

.boot-load {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.875rem;
  animation: boot-line calc(var(--boot-step) * 2.6) calc(var(--boot-step) * 7.2)
    both;
}

.boot-bar {
  flex: none;
  width: 7rem;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--rule);
  overflow: hidden;
}

.boot-bar i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--pencil);
  transform-origin: left;
  animation: boot-fill calc(var(--boot-step) * 6) calc(var(--boot-step) * 7.8)
    cubic-bezier(0.4, 0, 0.2, 1) both;
}

.boot-hint {
  margin-top: 1.25rem;
  color: var(--muted);
  animation:
    boot-line calc(var(--boot-step) * 2.6) calc(var(--boot-step) * 10) both,
    boot-wait 2s calc(var(--boot-step) * 13) infinite;
}

:root.phone .boot {
  font-size: 0.75rem;
  padding-inline: 1.25rem;
}

@keyframes boot-line {
  from {
    opacity: 0;
    translate: 0 0.375rem;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes boot-wait {
  50% {
    opacity: 0.4;
  }
}

@keyframes boot-fill {
  from {
    scale: 0 1;
  }
  to {
    scale: 1 1;
  }
}

/* Log-on */
.logon {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem;
  background: color-mix(in oklab, var(--paper) 30%, transparent);
  -webkit-backdrop-filter: blur(1.375rem) saturate(1.2);
  backdrop-filter: blur(1.375rem) saturate(1.2);
}

.logon-tools {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  max-width: calc(100% - 2rem);
}

.logon-card {
  width: min(22.5rem, 100%);
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 1.875rem 1.5rem 1.375rem;
  border-radius: 1.25rem;
  text-align: center;
  background: var(--glass);
  box-shadow: 0 1.5rem 3.75rem -1.875rem rgb(var(--shadow) / 0.7);
}

@media (prefers-reduced-motion: no-preference) {
  .logon.reveal .logon-card {
    animation: rise 0.42s cubic-bezier(0.2, 0.8, 0.3, 1) both;
  }

  :root.phone .logon.reveal .lock-time {
    animation: rise 0.42s 60ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 1rem;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.avatar {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;
  border: 0.25rem solid var(--bar);
  box-shadow: 0 0.75rem 1.875rem -0.75rem rgb(var(--shadow) / 0.6);
}

.logon-name {
  margin: 0.5rem 0 0;
  font-size: 2rem;
  font-stretch: 120%;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.logon-role {
  margin: 0;
  color: var(--muted);
}

.logon-for {
  margin: -0.5rem 0 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--rose);
  color: var(--ink);
  font-size: 0.8125rem;
}

.logon-for b {
  font-weight: 650;
}

.logon-proof {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.4;
  text-wrap: balance;
}

.logon-proof b {
  color: var(--pencil);
  font-weight: 650;
  white-space: nowrap;
}

.logon-open {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

.logon-open i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #2e9e62;
}

@media (prefers-reduced-motion: no-preference) {
  .logon-open i {
    animation: live 2s ease-in-out infinite;
  }
}

@keyframes live {
  50% {
    box-shadow: 0 0 0 0.25rem rgb(46 158 98 / 0.25);
  }
}

.logon-msg {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  min-height: 1.25rem;
}

.progress {
  width: 12.5rem;
  height: 0.25rem;
  border-radius: 0.125rem;
  background: var(--rule);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 0.9s cubic-bezier(0.3, 0.6, 0.2, 1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0 1.125rem;
  border-radius: 0.625rem;
  border: 1px solid var(--ink);
  background: transparent;
  font-weight: 560;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
}

.btn-primary:hover {
  background: color-mix(in oklab, var(--ink) 85%, var(--pencil));
}

.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.875rem 0 0.625rem;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--glass);
  font-size: 0.875rem;
  font-weight: 520;
}

.chip-btn:hover {
  border-color: var(--ink);
}

.tgl-ico {
  display: grid;
  place-items: center;
}

.linkish {
  border: 0;
  background: none;
  padding: 0.25rem;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--edge);
  text-underline-offset: 0.1875rem;
  font-size: 0.875rem;
}

.linkish:hover {
  color: var(--ink);
  text-decoration-color: var(--pencil);
}

/* Desktop */
.desk {
  position: fixed;
  inset: 0 0 3.25rem 0;
  z-index: 1;
  overflow: hidden;
}

.desk[inert],
.taskbar[inert],
.dock[inert] {
  visibility: hidden;
}

.dock,
.lock-time,
.swipe-hint {
  display: none;
}

.icons {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  bottom: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.125rem 1rem;
}

.icon {
  width: 6rem;
  display: grid;
  justify-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.125rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  text-align: center;
}

.icon:focus-visible {
  outline: none;
}

.icon-tile {
  width: 3.125rem;
  height: 3.125rem;
  border-radius: 0.875rem;
  background: var(--sheet);
  border: 1px solid var(--edge);
  display: grid;
  place-items: center;
  box-shadow: 0 0.625rem 1.25rem -0.75rem rgb(var(--shadow) / 0.7);
  transition: translate 0.15s;
}

.icon-tile svg {
  width: 1.875rem;
  height: 1.875rem;
}

.icon-tile.photo {
  overflow: hidden;
  border: 0.125rem solid var(--bar);
}

.icon-tile.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}

.icon-label {
  font-size: 0.8125rem;
  font-weight: 560;
  line-height: 1.25;
  padding: 0.125rem 0.4375rem;
  border-radius: 0.375rem;
  background: var(--glass);
  -webkit-backdrop-filter: blur(0.5rem);
  backdrop-filter: blur(0.5rem);
  overflow-wrap: anywhere;
}

.icon:hover .icon-tile {
  translate: 0 -0.125rem;
}

.icon:focus-visible .icon-tile {
  outline: 0.125rem solid var(--pencil);
  outline-offset: 0.125rem;
}

.icon:focus-visible .icon-label,
.icon:active .icon-label {
  background: var(--ink);
  color: var(--on-ink);
}

@keyframes pop {
  from {
    opacity: 0;
    scale: 0.6;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .desk.booting .icon {
    animation: pop 0.36s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
    animation-delay: calc(var(--i) * 40ms + 100ms);
  }
}

.bginfo {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  margin: 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.125rem 0.875rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  background: var(--glass);
  -webkit-backdrop-filter: blur(0.75rem);
  backdrop-filter: blur(0.75rem);
  font-size: 0.8125rem;
  color: var(--muted);
}

.bginfo dt {
  font-stretch: 75%;
  font-weight: 600;
}

.bginfo dd {
  margin: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.note {
  position: absolute;
  width: 13.75rem;
  padding: 1rem 1rem 1.125rem;
  background: var(--note);
  color: var(--note-ink);
  font-family: var(--hand);
  font-size: 1.0625rem;
  line-height: 1.35;
  rotate: var(--r, -2deg);
  box-shadow:
    0 1px 1px rgb(var(--shadow) / 0.12),
    0 0.875rem 1.5rem -0.875rem rgb(var(--shadow) / 0.6);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.note::before {
  content: "";
  position: absolute;
  top: -0.625rem;
  left: 50%;
  width: 4.25rem;
  height: 1.25rem;
  translate: -50% 0;
  rotate: 4deg;
  background: color-mix(in oklab, var(--rose) 75%, transparent);
  border: 1px solid color-mix(in oklab, var(--edge) 50%, transparent);
}

.note b {
  font-weight: 700;
}

/* Taskbar */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.25rem;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding-inline: 1rem;
  background: var(--glass);
  -webkit-backdrop-filter: blur(1.125rem) saturate(1.3);
  backdrop-filter: blur(1.125rem) saturate(1.3);
  border-top: 1px solid color-mix(in oklab, var(--edge) 70%, transparent);
}

.cmd {
  display: flex;
  align-items: center;
  height: 2.125rem;
  flex: 0 1 15.625rem;
  min-width: 9.375rem;
  border: 1px solid var(--edge);
  border-radius: 0.625rem;
  background: var(--sheet);
  overflow: hidden;
}

.cmd:focus-within {
  border-color: var(--ink);
}

.cmd span {
  padding-left: 0.625rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.cmd input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 0.375rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  text-transform: uppercase;
  outline: none;
}

.cmd input::placeholder {
  text-transform: none;
  color: var(--muted);
}

.cmd button {
  height: 100%;
  width: 2.25rem;
  border: 0;
  border-left: 1px solid var(--edge);
  background: transparent;
  display: grid;
  place-items: center;
}

.cmd button:hover {
  background: var(--band);
}

.tasks {
  display: flex;
  gap: 0.375rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.task {
  flex: none;
  height: 2.125rem;
  max-width: 11.875rem;
  padding: 0 0.75rem;
  border: 1px solid var(--edge);
  border-radius: 0.625rem;
  background: var(--sheet);
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task[aria-current="true"] {
  background: var(--bar);
  color: var(--on-bar);
  border-color: transparent;
  font-weight: 600;
}

.tray {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: none;
}

.tray > button {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  background: transparent;
  display: grid;
  place-items: center;
}

.tray > button:hover {
  border-color: var(--edge);
  background: var(--sheet);
}

.clock {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-left: 0.375rem;
}

.status {
  position: fixed;
  left: 1rem;
  bottom: 3.875rem;
  z-index: 9001;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100vw - 2rem);
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  background: var(--sheet);
  border: 1px solid var(--edge);
  box-shadow: 0 0.75rem 1.5rem -0.875rem rgb(var(--shadow) / 0.6);
  font-size: 0.8125rem;
  opacity: 0;
  translate: 0 0.375rem;
  pointer-events: none;
  transition:
    opacity 0.18s,
    translate 0.18s;
}

.status.show {
  opacity: 1;
  translate: 0 0;
}

.status.err {
  border-color: var(--pencil);
  color: var(--pencil);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
  }
}

.device-note {
  display: none;
  gap: 0.625rem;
  align-items: flex-start;
  margin: 0.375rem 0 0;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  background: var(--sky);
  color: var(--ink);
  font-size: 0.8125rem;
  line-height: 1.45;
  text-align: left;
}

.device-note svg {
  flex: none;
  margin-top: 0.125rem;
}

.device-note b {
  font-weight: 650;
}

:root.phone .device-note {
  display: flex;
}

@media (pointer: coarse) and (max-width: 1024px) {
  .device-note {
    display: flex;
  }
}

.note-share {
  margin-top: 0.375rem;
  padding: 0.375rem 0;
  border: 0;
  background: none;
  color: var(--pencil);
  font: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.1875rem;
}

/* Phone lock screen */
:root.phone .logon {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  align-items: center;
  gap: 0.75rem;
  padding: calc(1.125rem + env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    calc(0.875rem + env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  overflow: hidden;
  touch-action: none;
}

:root.phone .logon-tools {
  top: calc(0.75rem + env(safe-area-inset-top));
}

:root.phone .lock-time {
  display: grid;
  justify-items: center;
  margin-top: 2.25rem;
  color: var(--ink);
}

:root.phone .lock-time b {
  font-size: min(4.5rem, 20vw);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

:root.phone .lock-time span {
  margin-top: 0.375rem;
  font-size: 1rem;
  font-weight: 560;
}

:root.phone .logon-card {
  gap: 0.625rem;
  padding: 1.375rem 1.25rem 1.125rem;
}

:root.phone .avatar {
  width: 5.5rem;
  height: 5.5rem;
}

:root.phone .logon-name {
  margin-top: 0.25rem;
  font-size: 1.625rem;
}

:root.phone .logon-proof {
  font-size: 0.875rem;
}

:root.phone .logon-open {
  margin-bottom: 0.125rem;
}

:root.phone .progress,
:root.phone .logon-msg {
  display: none;
}

:root.phone .swipe-hint {
  display: grid;
  justify-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
}

:root.phone .swipe-hint i {
  width: 8.375rem;
  height: 0.3125rem;
  border-radius: 0.1875rem;
  background: var(--ink);
}

:root.phone.short .logon {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  column-gap: 1.5rem;
}

:root.phone.short .logon-tools {
  right: auto;
  left: max(1rem, env(safe-area-inset-left));
}

:root.phone.short .lock-time {
  margin-top: 0;
  align-self: end;
}

:root.phone.short .logon-card {
  grid-column: 2;
  grid-row: 1 / span 2;
}

:root.phone.short .avatar {
  display: none;
}

:root.phone.short .swipe-hint {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
}

@media (prefers-reduced-motion: no-preference) {
  .swipe-hint span {
    animation: nudge 2.6s ease-in-out infinite;
  }
}

@keyframes nudge {
  0%,
  70%,
  100% {
    translate: 0 0;
  }
  82% {
    translate: 0 -0.375rem;
  }
}

/* iOS zooms into inputs under 16px */
@media (pointer: coarse) {
  input,
  textarea {
    font-size: max(16px, 1rem) !important;
  }
}

/* UI scale and quick settings */
.scale-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 2.25rem;
  padding: 0 0.3125rem 0 0.75rem;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--glass);
  font-size: 0.875rem;
  font-weight: 520;
  white-space: nowrap;
}

.scale-chip select {
  height: 1.75rem;
  padding: 0 0.375rem;
  border: 0;
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tray .scale-chip {
  height: 2.25rem;
  padding: 0 0.1875rem 0 0.5rem;
  border-color: transparent;
  background: transparent;
}

.tray .scale-chip:hover {
  border-color: var(--edge);
  background: var(--sheet);
}

.tray .quick-btn {
  display: none;
}

.quick {
  position: fixed;
  inset: auto;
  top: calc(var(--status-h, 3.25rem) + 0.5rem);
  right: 0.75rem;
  width: min(18.75rem, calc(100vw - 1.5rem));
  margin: 0;
  padding: 0.625rem;
  border: 1px solid var(--edge);
  border-radius: 1.125rem;
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 1.5rem 3.125rem -1.5rem rgb(var(--shadow) / 0.7);
}

.quick-title {
  margin: 0.25rem 0.5rem 0.5rem;
  font-size: 0.8125rem;
  font-stretch: 75%;
  font-weight: 600;
  color: var(--muted);
}

.quick-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0 0.625rem;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--ink);
  font-size: 0.9375rem;
  text-align: left;
}

.quick-row + .quick-row {
  margin-top: 0.125rem;
}

.quick-row[aria-pressed="true"] {
  background: var(--sky);
}

.quick-row select {
  min-height: 2.25rem;
  padding: 0 0.5rem;
  border: 1px solid var(--edge);
  border-radius: 0.625rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

:root.phone .logon.scrolls {
  align-content: start;
  overflow-y: auto;
  touch-action: pan-y;
}

:root.phone .logon .swipe-hint {
  touch-action: none;
  padding-block: 0.5rem;
}

:root.phone .logon {
  grid-template-rows: auto auto 1fr auto;
}

:root.phone .logon-tools {
  position: static;
  justify-self: end;
  max-width: 100%;
}

:root.phone .lock-time {
  margin-top: 0.75rem;
}

:root.phone.short .logon {
  grid-template-rows: 1fr auto;
}

:root.phone.short .logon-tools {
  position: absolute;
}
