/*
 * MAGNETIC OS — phone shell.
 *
 * Same tokens as ~/magnetic-os (globals.css): Magnetic blue #2f6bff is the one
 * brand colour, status hues are reserved, radius 0.625rem, DM Sans, tabular
 * figures. What changes on a phone is the surface stack — the desktop app puts
 * muted panels on a white page; a phone reads right the other way round, so the
 * page is the muted plate and every card is the card colour.
 */

:root {
  --background: oklch(0.968 0 0);
  --surface: #ffffff;
  --foreground: oklch(0.145 0 0);
  --muted: oklch(0.97 0 0);
  --muted-fg: oklch(0.556 0 0);
  --faint: oklch(0.646 0 0);
  --primary: #2f6bff;
  --primary-fg: #ffffff;
  --brand-ink: #1f4fd0;
  --border: oklch(0.922 0 0);
  --hairline: oklch(0 0 0 / 8%);
  --ring: oklch(0 0 0 / 8%);
  --pressed: oklch(0 0 0 / 5%);

  --chart-1: #2f6bff;
  --chart-2: #eb6834;
  --chart-3: #1baf7a;
  --chart-4: #eda100;
  --chart-5: #e87ba4;

  --good: #0ca30c;
  --good-ink: #006300;
  --warning: #fab219;
  --warning-ink: #8a5a00;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-ink: #b02525;

  --radius: 0.625rem;
  --bar: color-mix(in oklch, var(--foreground) 10%, transparent);
  --chrome: color-mix(in oklch, #ffffff 82%, transparent);
  --shadow: 0 1px 2px oklch(0 0 0 / 5%);
  --tabbar: 52px;
}

.dark {
  --background: oklch(0.1279 0 0);
  --surface: oklch(0.205 0 0);
  --foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-fg: oklch(0.708 0 0);
  --faint: oklch(0.62 0 0);
  --primary: #4f7dff;
  --primary-fg: #ffffff;
  --brand-ink: #83a4ff;
  --border: oklch(1 0 0 / 12%);
  --hairline: oklch(1 0 0 / 10%);
  --ring: oklch(1 0 0 / 8%);
  --pressed: oklch(1 0 0 / 7%);

  --chart-1: #4f7dff;
  --chart-2: #d95926;
  --chart-3: #199e70;
  --chart-4: #c98500;
  --chart-5: #d55181;

  --good-ink: #3fce3f;
  --warning-ink: #f3ba45;
  --critical-ink: #ef6a6a;

  --chrome: color-mix(in oklch, oklch(0.1279 0 0) 82%, transparent);
  --shadow: none;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.tabular,
.num {
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ */
/* App frame                                                           */
/* ------------------------------------------------------------------ */

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

#stacks {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.stack {
  position: absolute;
  inset: 0;
  display: none;
}

.stack.active {
  display: block;
}

/* One pushed screen. Screens stack; the one on top slides in from the right. */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--background);
  will-change: transform;
}

.screen.enter {
  animation: push-in 0.34s cubic-bezier(0.32, 0.72, 0, 1);
}

.screen.leave {
  animation: pop-out 0.3s cubic-bezier(0.32, 0.72, 0, 1) forwards;
  pointer-events: none;
}

.screen.behind {
  transform: translate3d(-22%, 0, 0);
  filter: brightness(0.96);
}

.screen.behind-enter {
  animation: behind-in 0.34s cubic-bezier(0.32, 0.72, 0, 1);
}

.screen.behind-leave {
  animation: behind-out 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes push-in {
  from {
    transform: translate3d(100%, 0, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes pop-out {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(100%, 0, 0);
  }
}

@keyframes behind-in {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-22%, 0, 0);
  }
}

@keyframes behind-out {
  from {
    transform: translate3d(-22%, 0, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen.enter,
  .screen.leave,
  .screen.behind-enter,
  .screen.behind-leave,
  .sheet,
  .backdrop {
    animation-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* Navigation bar + large title                                        */
/* ------------------------------------------------------------------ */

.navbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  padding-top: env(safe-area-inset-top);
  height: calc(46px + env(safe-area-inset-top));
  background: var(--chrome);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  transition: box-shadow 0.2s ease;
}

.navbar.scrolled {
  box-shadow: 0 0.5px 0 var(--hairline);
}

.navbar .compact {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: env(safe-area-inset-top);
  height: 46px;
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
  max-width: 58%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar.scrolled .compact {
  opacity: 1;
}

.navbtn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 38px;
  min-width: 38px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--primary);
  font-size: 15px;
  font-weight: 500;
}

.navbtn:active {
  background: var(--pressed);
}

.navbtn .icon {
  width: 21px;
  height: 21px;
}

.navbar .spacer {
  flex: 1;
}

.scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: calc(28px + var(--tabbar) + env(safe-area-inset-bottom));
}

.lt {
  padding: 2px 20px 10px;
}

.lt h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.033em;
}

.lt p {
  margin: 7px 0 0;
  color: var(--muted-fg);
  font-size: 14.5px;
  line-height: 1.42;
}

/* ------------------------------------------------------------------ */
/* Tab bar                                                             */
/* ------------------------------------------------------------------ */

.tabbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--chrome);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -0.5px 0 var(--hairline);
}

.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--tabbar);
  color: var(--faint);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}

.tabbar button .icon {
  width: 23px;
  height: 23px;
}

.tabbar button.active {
  color: var(--primary);
}

.tabbar button:active .icon {
  transform: scale(0.92);
}

.tabbar .icon {
  transition: transform 0.12s ease;
}

.tabdot {
  position: absolute;
  top: 6px;
  margin-left: 15px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--critical);
  box-shadow: 0 0 0 2px var(--background);
}

/* ------------------------------------------------------------------ */
/* Surfaces                                                            */
/* ------------------------------------------------------------------ */

.sec {
  margin: 18px 0 0;
  padding: 0 16px;
}

.sec:first-child {
  margin-top: 4px;
}

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 8px;
}

.sec-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.sec-head .more {
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.sec-note {
  padding: 0 4px 10px;
  margin-top: -4px;
  color: var(--muted-fg);
  font-size: 13.5px;
  line-height: 1.4;
}

.card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--ring), var(--shadow);
  overflow: hidden;
}

.card + .card {
  margin-top: 12px;
}

.pad {
  padding: 14px 16px;
}

.rows > * + * {
  box-shadow: inset 0 0.5px 0 var(--hairline);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 16px;
  text-align: left;
  min-height: 52px;
}

.row:active {
  background: var(--pressed);
}

.row .body {
  flex: 1;
  min-width: 0;
}

.row .t {
  display: block;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row .t.wrap {
  white-space: normal;
  overflow: visible;
}

.row .s {
  display: block;
  margin-top: 2px;
  color: var(--muted-fg);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row .trail {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-fg);
  font-size: 13px;
  text-align: right;
}

.chev {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: color-mix(in oklch, var(--muted-fg) 55%, transparent);
}

.row .lead-num {
  flex-shrink: 0;
  width: 42px;
  color: var(--muted-fg);
  font-size: 13px;
}

/* ------------------------------------------------------------------ */
/* Figures                                                             */
/* ------------------------------------------------------------------ */

.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--ring), var(--shadow);
  padding: 13px 14px 14px;
  text-align: left;
  display: block;
  width: 100%;
}

.kpi:active {
  background: var(--pressed);
}

.kpi .l {
  display: flex;
  min-height: 18px;
  align-items: center;
  gap: 5px;
  color: var(--muted-fg);
  font-size: 12.5px;
  font-weight: 500;
}

.kpi .v {
  display: block;
  margin-top: 6px;
  font-size: 25px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.kpi .v small {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-fg);
  letter-spacing: 0;
}

.kpi .b {
  display: block;
  margin-top: 5px;
  color: var(--muted-fg);
  font-size: 12px;
  line-height: 1.35;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
}

.delta.up {
  color: var(--good-ink);
}

.delta.down {
  color: var(--critical-ink);
}

.delta.flat {
  color: var(--muted-fg);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

.badge.good {
  background: color-mix(in oklch, var(--good) 13%, transparent);
  color: var(--good-ink);
}

.badge.warning {
  background: color-mix(in oklch, var(--warning) 20%, transparent);
  color: var(--warning-ink);
}

.badge.critical {
  background: color-mix(in oklch, var(--critical) 14%, transparent);
  color: var(--critical-ink);
}

.badge.brand {
  background: color-mix(in oklch, var(--primary) 13%, transparent);
  color: var(--primary);
}

.badge.neutral {
  background: var(--muted);
  color: var(--muted-fg);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.dot.good {
  background: var(--good);
}
.dot.warning {
  background: var(--warning);
}
.dot.critical {
  background: var(--critical);
}
.dot.muted {
  background: color-mix(in oklch, var(--muted-fg) 45%, transparent);
}

.bar {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: var(--bar);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.bar > i.good {
  background: var(--good);
}
.bar > i.warning {
  background: var(--warning);
}
.bar > i.critical {
  background: var(--critical);
}

.avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.avatar.sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 11px;
}

.avatar.lg {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 16px;
}

.thumb {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--muted);
  color: color-mix(in oklch, var(--muted-fg) 70%, transparent);
  font-size: 10px;
  font-weight: 600;
  overflow: hidden;
}

/* Tinted stat — the "needs attention" block from the desktop app. */
.tint {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  text-align: left;
}

.tint:active {
  filter: brightness(0.97);
}

.tint .v {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  min-width: 40px;
}

.tint .l {
  font-size: 13.5px;
  line-height: 1.3;
  font-weight: 500;
}

.tint.orange {
  background: color-mix(in oklch, var(--serious) 15%, transparent);
  color: color-mix(in oklch, var(--serious) 82%, var(--foreground));
}

.tint.amber {
  background: color-mix(in oklch, var(--warning) 18%, transparent);
  color: var(--warning-ink);
}

.tint.blue {
  background: color-mix(in oklch, var(--primary) 12%, transparent);
  color: var(--primary);
}

.tint.green {
  background: color-mix(in oklch, var(--good) 12%, transparent);
  color: var(--good-ink);
}

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

/* ------------------------------------------------------------------ */
/* Controls                                                            */
/* ------------------------------------------------------------------ */

.seg {
  display: flex;
  gap: 2px;
  margin: 0 16px 2px;
  padding: 2px;
  background: var(--muted);
  border-radius: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}

.seg::-webkit-scrollbar {
  display: none;
}

.seg button {
  flex: 1 0 auto;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted-fg);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg button.active {
  background: var(--surface);
  color: var(--foreground);
  font-weight: 600;
  box-shadow: var(--shadow), 0 0 0 0.5px var(--ring);
}

.chips {
  display: flex;
  gap: 7px;
  padding: 0 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--ring);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-fg);
}

.chip.active {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 15px;
  font-weight: 550;
}

.btn:active {
  filter: brightness(0.93);
}

.btn.ghost {
  background: var(--surface);
  color: var(--foreground);
  box-shadow: 0 0 0 1px var(--ring);
}

.btn.wide {
  width: 100%;
}

.btnrow {
  display: flex;
  gap: 8px;
  padding: 0 16px;
}

/* ------------------------------------------------------------------ */
/* Board (horizontal, the kanban read on a phone)                      */
/* ------------------------------------------------------------------ */

.board {
  display: flex;
  gap: 10px;
  padding: 2px 16px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.board::-webkit-scrollbar {
  display: none;
}

.col {
  flex: 0 0 78vw;
  max-width: 320px;
  scroll-snap-align: center;
  background: color-mix(in oklch, var(--foreground) 4%, transparent);
  border-radius: 14px;
  padding: 8px;
}

.col > .h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 8px;
  font-size: 13.5px;
  font-weight: 650;
}

.col > .h .n {
  color: var(--muted-fg);
  font-weight: 600;
}

.bcard {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--ring);
  padding: 11px 12px;
}

.bcard + .bcard {
  margin-top: 7px;
}

.bcard:active {
  background: var(--pressed);
}

.bcard .t {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bcard .m .avatar {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 9px;
}

.bcard .m {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted-fg);
  font-size: 12px;
}

/* ------------------------------------------------------------------ */
/* Charts                                                             */
/* ------------------------------------------------------------------ */

.chart {
  display: block;
  width: 100%;
  overflow: visible;
}

.chart .axis {
  fill: var(--muted-fg);
  font-size: 10px;
  font-weight: 500;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 16px 0;
  color: var(--muted-fg);
  font-size: 12.5px;
}

.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 5px;
}

/* ------------------------------------------------------------------ */
/* Detail blocks                                                       */
/* ------------------------------------------------------------------ */

.kv {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  font-size: 14.5px;
}

.kv .k {
  color: var(--muted-fg);
  flex-shrink: 0;
}

.kv .v {
  text-align: right;
  font-weight: 500;
}

.prose {
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted-fg);
  white-space: pre-wrap;
}

.hero {
  padding: 4px 20px 8px;
}

.hero .big {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.hero .sub {
  margin-top: 6px;
  color: var(--muted-fg);
  font-size: 14px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.grid2 > * {
  padding: 13px 16px;
  box-shadow: inset 0 0.5px 0 var(--hairline), inset 0.5px 0 0 var(--hairline);
}

.grid2 > *:nth-child(-n + 2) {
  box-shadow: inset 0.5px 0 0 var(--hairline);
}

.grid2 > *:nth-child(odd) {
  box-shadow: inset 0 0.5px 0 var(--hairline);
}

.grid2 > *:first-child {
  box-shadow: none;
}

.cell .l {
  color: var(--muted-fg);
  font-size: 12.5px;
  font-weight: 500;
}

.cell .v {
  margin-top: 4px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
}

.tag {
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--muted);
  color: var(--muted-fg);
  font-size: 12.5px;
  font-weight: 500;
}

.empty {
  padding: 26px 16px;
  text-align: center;
  color: var(--muted-fg);
  font-size: 14px;
}

.timeline {
  padding: 4px 0;
}

.tl {
  display: flex;
  gap: 12px;
  padding: 8px 16px;
}

.tl .t {
  flex-shrink: 0;
  width: 40px;
  color: var(--muted-fg);
  font-size: 12.5px;
  padding-top: 1px;
}

.tl .x {
  font-size: 14px;
  line-height: 1.4;
}

.tl .x .sp {
  font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Sheet                                                               */
/* ------------------------------------------------------------------ */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: oklch(0 0 0 / 38%);
  animation: fade 0.22s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.sheet {
  position: fixed;
  z-index: 41;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  background: var(--background);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 40px oklch(0 0 0 / 22%);
  animation: sheet-up 0.34s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom);
}

.sheet.closing {
  animation: sheet-down 0.26s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

@keyframes sheet-up {
  from {
    transform: translate3d(0, 100%, 0);
  }
}

@keyframes sheet-down {
  to {
    transform: translate3d(0, 100%, 0);
  }
}

.grabber {
  flex-shrink: 0;
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--muted-fg) 40%, transparent);
  margin: 8px auto 4px;
}

.sheet .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 10px;
}

.sheet .head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sheet .scroll {
  padding-bottom: 20px;
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 10px;
  padding: 0 12px;
  height: 38px;
  border-radius: 10px;
  background: var(--muted);
}

.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 16px;
}

.searchbar .icon {
  width: 17px;
  height: 17px;
  color: var(--muted-fg);
  flex-shrink: 0;
}

.grid-more {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--ring);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

.tile:active {
  background: var(--pressed);
}

.tile .icon {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.icon {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark {
  fill: currentColor;
  stroke: none;
}

/* Loading */
#boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--background);
  color: var(--primary);
  z-index: 100;
  transition: opacity 0.25s ease;
}

#boot.gone {
  opacity: 0;
  pointer-events: none;
}

#boot svg {
  width: 44px;
  height: 44px;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

/* Root screens carry the mark where a pushed screen carries Back. */
.brandmark {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 10px;
  color: var(--foreground);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brandmark svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}
