/* HUD, phone, notifications, toasts, cards, the start screen and the round frame. */

:root {
  --ui-text: #f7f2ea;
  --ui-dim: #b9b0ba;
  --ui-faint: rgba(247, 242, 234, 0.46);
  --ui-glass: rgba(30, 26, 34, 0.7);
  --ui-glass-strong: rgba(27, 23, 31, 0.9);
  --ui-edge: rgba(255, 236, 214, 0.13);
  --ui-edge-strong: rgba(255, 236, 214, 0.26);
  --ui-screen: #1a171e;
  --ui-surface: rgba(255, 244, 232, 0.06);
  --ui-surface-2: rgba(255, 244, 232, 0.11);
  --ui-warm: var(--warm, #ffb463);
  --ui-warm-soft: rgba(255, 180, 99, 0.16);
  --ui-warm-ink: #2a1a08;
  --ui-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ui-spring: cubic-bezier(0.34, 1.45, 0.5, 1);
}

.ico {
  flex: none;
  display: block;
}

.glass {
  border: 1px solid var(--ui-edge);
  border-radius: 16px;
  background: var(--ui-glass);
  color: var(--ui-text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}

.ui-lite .glass,
.ui-lite .notice,
.ui-lite .toast,
.ui-lite .card-backdrop {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.ui-lite .glass {
  background: var(--ui-glass-strong);
}

/* ---- HUD ---------------------------------------------------------------- */

.hud {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: 'tl tc tr';
  align-items: start;
  align-content: start;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 14px max(14px, env(safe-area-inset-left));
  font-size: 13px;
  transition: opacity 0.4s ease, visibility 0s linear 0s;
}

.hud.is-waiting,
.hud.is-hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.hud-tl {
  grid-area: tl;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.hud-tc {
  grid-area: tc;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.hud.has-debug .hud-tc {
  padding-top: 22px;
}

.hud-tr {
  grid-area: tr;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.hud-time {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 132px;
  padding: 8px 16px 11px 9px;
  overflow: hidden;
}

.hud-daypart {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ui-warm-soft);
  color: var(--ui-warm);
  transition: background 0.6s ease, color 0.6s ease;
}

.hud-daypart[data-part='night'] {
  background: rgba(150, 165, 255, 0.16);
  color: #bcc6ff;
}

.hud-time-text {
  display: grid;
  gap: 3px;
}

.hud-clock {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 23px;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.hud-room {
  min-height: 14px;
  color: var(--ui-dim);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.2;
}

.hud-day {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.hud-day b {
  display: block;
  height: 100%;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #f08a3c, var(--ui-warm));
  transition: width 0.8s linear;
}

.hud-meters {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
}

.meter {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 16px;
  color: var(--ui-dim);
}

.meter-ico {
  display: grid;
  place-items: center;
  width: 16px;
  transition: color 0.3s ease;
}

.meter-energy .meter-ico { color: var(--energy); }
.meter-focus .meter-ico { color: var(--focus); }
.meter-irritation .meter-ico { color: #ff7d74; }

.meter-name {
  width: 62px;
  font-size: 11.5px;
  font-weight: 500;
}

.meter-track {
  width: calc(92px * var(--stretch, 1));
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition: width 0.7s var(--ui-spring);
}

.meter-fill {
  position: relative;
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.5s var(--ui-ease);
}

.meter-fill::after {
  content: '';
  position: absolute;
  inset: 1px 2px auto 2px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.4);
}

.meter-energy .meter-fill { background: linear-gradient(90deg, #f0962f, #ffd27a); }
.meter-focus .meter-fill { background: linear-gradient(90deg, #4a97ee, #93d2ff); }
.meter-irritation .meter-fill { background: linear-gradient(90deg, #e5484d, #ff9070); }

.meter-num {
  min-width: 22px;
  color: var(--ui-text);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.meter.is-alert .meter-ico,
.meter.is-alert .meter-num {
  color: #ff8a84;
}

.meter.is-alert .meter-track {
  animation: meter-alert 1.1s ease-in-out infinite;
}

@keyframes meter-alert {
  0%, 100% { box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(229, 72, 77, 0); }
  50% { box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(229, 72, 77, 0.38); }
}

.meter-chip {
  position: absolute;
  left: calc(100% + 18px);
  top: -3px;
  padding: 1px 6px;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(20, 17, 24, 0.92);
  color: #8fe3b5;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  animation: chip-float 1.3s var(--ui-ease) forwards;
}

.meter-chip.down,
.meter-irritation .meter-chip.up {
  color: #ff9a94;
}

.meter-irritation .meter-chip.down {
  color: #8fe3b5;
}

@keyframes chip-float {
  0% { opacity: 0; transform: translate(-8px, 4px) scale(0.8); }
  18% { opacity: 1; transform: translate(0, 0) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(0, -16px) scale(1); }
}

.hud-goal {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, 100%);
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
}

.hud-goal-tag {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ui-warm);
  color: var(--ui-warm-ink);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud-objective {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
  text-wrap: balance;
}

.hud-goal.is-new {
  animation: goal-in 0.9s var(--ui-ease);
}

@keyframes goal-in {
  0% { transform: translateY(-10px) scale(0.96); opacity: 0; box-shadow: 0 0 0 0 rgba(255, 180, 99, 0.7); }
  35% { transform: none; opacity: 1; box-shadow: 0 0 0 6px rgba(255, 180, 99, 0.3); }
  100% { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.26), 0 0 0 12px rgba(255, 180, 99, 0); }
}

.hud-points {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.hud-score {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 14px;
}

.hud-score-label {
  color: var(--ui-dim);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hud-score-num {
  min-width: 1.4em;
  font-family: var(--serif);
  font-weight: 560;
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hud-score.is-bump .hud-score-num {
  animation: score-bump 0.5s var(--ui-spring);
}

@keyframes score-bump {
  0% { transform: scale(1); color: var(--ui-text); }
  35% { transform: scale(1.28); color: var(--ui-warm); }
  100% { transform: scale(1); color: var(--ui-text); }
}

.hud-streak {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px 4px 8px;
  border-radius: 999px;
  color: var(--ui-warm);
  font-size: 12px;
  animation: streak-in 0.4s var(--ui-spring);
}

.hud-streak b {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hud-streak span {
  color: var(--ui-text);
  font-weight: 500;
}

.hud-streak span:empty {
  display: none;
}

@keyframes streak-in {
  from { transform: scale(0.7); opacity: 0; }
}

.hud-round-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hud-round-btn:hover {
  transform: translateY(-1px);
  background: var(--ui-glass-strong);
}

.hud-round-btn.is-off {
  color: #ff9a94;
}

.hud-prompt {
  position: absolute;
  left: 50%;
  bottom: max(30px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  max-width: calc(100vw - 32px);
  padding: 8px 18px 8px 9px;
  border-radius: 999px;
  background: var(--ui-glass-strong);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transform: translateX(-50%);
  animation: prompt-in 0.28s var(--ui-spring);
}

.hud-prompt:hover {
  border-color: var(--ui-edge-strong);
}

.hud-prompt .kbd {
  min-width: 30px;
  padding: 4px 8px;
  border: 0;
  border-radius: 9px;
  background: var(--ui-warm);
  color: var(--ui-warm-ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  opacity: 1;
  box-shadow: 0 2px 0 #c97f2f;
}

.hud-prompt small {
  color: var(--ui-dim);
  font-size: 12.5px;
  font-weight: 400;
}

.hud-prompt small:empty {
  display: none;
}

@keyframes prompt-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.94); }
}

/* ---- the phone in the corner --------------------------------------------- */

#phone-layer {
  --phone-w: 372px;
  --phone-h: min(740px, calc(100dvh - 116px));
  --phone-r: max(20px, env(safe-area-inset-right));
  --phone-b: max(20px, env(safe-area-inset-bottom));
}

.phone-button {
  position: absolute;
  right: var(--phone-r);
  bottom: var(--phone-b);
  width: 66px;
  height: 110px;
  padding: 4px;
  border: 0;
  border-radius: 17px;
  background: #0e0c11;
  color: var(--ui-text);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 1.5px #3d3644;
  cursor: pointer;
  pointer-events: auto;
  transform-origin: 50% 100%;
  transition: transform 0.38s var(--ui-ease), opacity 0.25s ease, visibility 0s linear 0s;
}

.phone-button:hover {
  transform: translateY(-4px) rotate(-2deg);
}

.phone-open .phone-button {
  opacity: 0;
  visibility: hidden;
  transform: translateY(130%);
  transition: transform 0.3s ease-in, opacity 0.25s ease, visibility 0s linear 0.3s;
}

.mini-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 100%;
  border-radius: 13px;
  background:
    radial-gradient(120% 70% at 85% 0%, rgba(255, 180, 99, 0.42), transparent 62%),
    linear-gradient(180deg, #2c2433, #17141b);
  overflow: hidden;
}

.mini-island {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 20px;
  height: 6px;
  border-radius: 999px;
  background: #0e0c11;
  transform: translateX(-50%);
}

.mini-moon {
  position: absolute;
  top: 15px;
  left: 50%;
  color: #bcc6ff;
  transform: translateX(-50%);
}

.mini-time {
  margin-top: 6px;
  font-family: var(--serif);
  font-weight: 560;
  font-size: 16px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mini-label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ui-dim);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.mini-label .kbd {
  min-width: 0;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 9px;
  line-height: 1.35;
}

@media (pointer: coarse) {
  .mini-label .kbd { display: none; }
}

.mini-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #17141b;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
  animation: badge-in 0.3s var(--ui-spring);
}

@keyframes badge-in {
  from { transform: scale(0.3); }
}

.phone-button.is-buzzing {
  animation: phone-buzz 0.7s linear;
}

@keyframes phone-buzz {
  0%, 100% { transform: rotate(0); }
  10% { transform: translate(-2px, -3px) rotate(-7deg); }
  20% { transform: translate(2px, -3px) rotate(7deg); }
  30% { transform: translate(-2px, -2px) rotate(-6deg); }
  40% { transform: translate(2px, -2px) rotate(6deg); }
  50% { transform: translate(-1px, -1px) rotate(-4deg); }
  60% { transform: translate(1px, -1px) rotate(4deg); }
  75% { transform: rotate(-2deg); }
  90% { transform: rotate(1deg); }
}

.has-page .phone-button {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 1.5px #ff7d74, 0 0 0 0 rgba(229, 72, 77, 0.7);
  animation: page-ring 1.1s ease-out infinite;
}

@keyframes page-ring {
  0% { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 1.5px #ff7d74, 0 0 0 0 rgba(229, 72, 77, 0.7); }
  100% { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 1.5px #ff7d74, 0 0 0 16px rgba(229, 72, 77, 0); }
}

/* ---- the phone ------------------------------------------------------------ */

.phone-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 100% 100%, rgba(10, 8, 14, 0.62), rgba(10, 8, 14, 0.22) 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.phone-open .phone-scrim {
  opacity: 1;
}

.phone-open .phone-scrim.is-clickable {
  pointer-events: auto;
}

.phone {
  position: absolute;
  right: var(--phone-r);
  bottom: var(--phone-b);
  width: var(--phone-w);
  height: var(--phone-h);
  color: var(--ui-text);
  outline: none;
  visibility: hidden;
  transform: translateY(calc(100% + 60px)) rotate(5deg);
  transform-origin: 100% 100%;
  transition: transform 0.36s cubic-bezier(0.5, 0, 0.9, 0.4), visibility 0s linear 0.36s;
}

.phone-open .phone {
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: transform 0.48s var(--ui-ease), visibility 0s linear 0s;
}

.phone::before,
.phone::after {
  content: '';
  position: absolute;
  width: 4px;
  border-radius: 3px;
  background: #2b2630;
}

.phone::before {
  left: -3px;
  top: 118px;
  height: 34px;
  box-shadow: 0 48px 0 #2b2630;
}

.phone::after {
  right: -3px;
  top: 150px;
  height: 62px;
}

.phone-frame {
  position: relative;
  height: 100%;
  padding: 9px;
  border-radius: 46px;
  background: #0e0c11;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.6),
    0 8px 20px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1.5px #453d4c,
    inset 0 0 0 4px #17141b;
}

.phone-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 37px;
  background:
    radial-gradient(120% 60% at 90% 0%, rgba(255, 180, 99, 0.36), transparent 62%),
    radial-gradient(90% 50% at 0% 100%, rgba(110, 140, 255, 0.16), transparent 65%),
    linear-gradient(180deg, #2c2433, #17141b);
  overflow: hidden;
  isolation: isolate;
}

.phone-status {
  position: relative;
  z-index: 3;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 4px 24px 0 28px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.phone-island {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 92px;
  height: 26px;
  border-radius: 999px;
  background: #0b090d;
  transform: translateX(-50%);
}

.phone-status-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-ico {
  display: grid;
  place-items: center;
  color: #bcc6ff;
}

.status-signal {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 11px;
}

.status-signal i {
  width: 3px;
  border-radius: 1px;
  background: currentColor;
}

.status-signal i:nth-child(1) { height: 4px; }
.status-signal i:nth-child(2) { height: 6px; }
.status-signal i:nth-child(3) { height: 8.5px; }
.status-signal i:nth-child(4) { height: 11px; opacity: 0.35; }

.status-battery {
  position: relative;
  width: 24px;
  height: 12px;
  padding: 1.5px;
  border: 1.2px solid rgba(247, 242, 234, 0.55);
  border-radius: 4px;
}

.status-battery::after {
  content: '';
  position: absolute;
  right: -3.5px;
  top: 3px;
  width: 2px;
  height: 4px;
  border-radius: 0 1px 1px 0;
  background: rgba(247, 242, 234, 0.55);
}

.status-battery i {
  display: block;
  height: 100%;
  border-radius: 1.5px;
  background: var(--ui-text);
  transition: width 0.5s ease, background 0.3s ease;
}

.status-battery i.low {
  background: var(--bad);
}

.phone-views {
  position: relative;
  flex: 1;
  min-height: 0;
}

.phone-home,
.phone-app {
  position: absolute;
  inset: 0;
  transition: transform 0.36s var(--ui-ease), opacity 0.26s ease, visibility 0s linear 0s;
}

.phone-home {
  padding: 4px 18px 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.phone-home::-webkit-scrollbar {
  display: none;
}

.phone-app {
  display: flex;
  flex-direction: column;
  background: var(--ui-screen);
  visibility: hidden;
  opacity: 0;
  transform: translateX(28%);
  transition: transform 0.3s ease-in, opacity 0.2s ease, visibility 0s linear 0.3s;
}

/* The status bar sits on the wallpaper, so the app view reaches up behind it. */
.phone-app::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -46px;
  height: 46px;
  background: var(--ui-screen);
}

/* Text fades out before it reaches the home bar. */
.phone-app::after {
  content: '';
  position: absolute;
  left: 0;
  right: 10px;
  bottom: 0;
  height: 40px;
  background: linear-gradient(180deg, rgba(26, 23, 30, 0), var(--ui-screen) 62%);
  pointer-events: none;
}

.phone-screen[data-view='app'] .phone-app {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: transform 0.36s var(--ui-ease), opacity 0.2s ease, visibility 0s linear 0s;
}

.phone-screen[data-view='app'] .phone-home {
  visibility: hidden;
  opacity: 0;
  transform: scale(0.94);
  transition: transform 0.3s ease, opacity 0.2s ease, visibility 0s linear 0.3s;
}

.home-clock {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 8px 20px;
  text-align: center;
}

.home-time {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 60px;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.home-sub {
  max-width: 280px;
  color: rgba(247, 242, 234, 0.78);
  font-size: 13px;
  line-height: 1.35;
  text-wrap: balance;
}

.phone-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 6px;
}

.app-icon {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--ui-text);
  cursor: pointer;
}

.app-tile {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -8px 14px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s var(--ui-spring), filter 0.15s ease;
}

.app-icon:hover .app-tile {
  transform: translateY(-3px) scale(1.05);
}

.app-icon:active .app-tile {
  transform: scale(0.92);
  filter: brightness(0.85);
}

.app-resume .app-tile { background: linear-gradient(160deg, #ffc47f, #ee8234); }
.app-contributions .app-tile { background: linear-gradient(160deg, #62cf9f, #2a9468); }
.app-articles .app-tile { background: linear-gradient(160deg, #80bcff, #3b78dc); }
.app-judging .app-tile { background: linear-gradient(160deg, #f490a6, #c44a69); }
.app-portfolio .app-tile { background: linear-gradient(160deg, #ab94f4, #6a50cc); }
.app-settings .app-tile { background: linear-gradient(160deg, #958e9c, #544e5c); }

.app-name {
  font-size: 11.5px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.home-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}

.quick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid var(--ui-edge);
  border-radius: 14px;
  background: rgba(20, 17, 24, 0.5);
  color: var(--ui-text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.quick:hover {
  border-color: var(--ui-edge-strong);
}

.quick-dnd[aria-pressed='true'] {
  border-color: transparent;
  background: #c9d1ff;
  color: #1c1f3a;
}

.quick-mute[aria-pressed='false'] {
  color: #ff9a94;
}

.quick-ico {
  display: grid;
}

.home-stack {
  margin-top: 20px;
}

.stack-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  margin-bottom: 8px;
}

.stack-head h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ui-dim);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stack-count:not(:empty) {
  min-width: 19px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ui-surface-2);
  color: var(--ui-text);
  font-size: 11px;
  letter-spacing: 0;
  text-align: center;
}

.stack-clear {
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  background: var(--ui-surface-2);
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.stack-clear:hover {
  background: rgba(255, 244, 232, 0.2);
}

.stack-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack-empty {
  padding: 16px 12px;
  border: 1px dashed var(--ui-edge);
  border-radius: 14px;
  color: var(--ui-dim);
  font-size: 13px;
  text-align: center;
}

.phone-app-head {
  position: relative;
  z-index: 1;
  flex: none;
  display: grid;
  grid-template-columns: 84px 1fr 84px;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  border-bottom: 1px solid var(--ui-edge);
}

.phone-back {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  justify-self: start;
  min-height: 36px;
  padding: 4px 10px 4px 4px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ui-warm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.phone-back:hover {
  background: var(--ui-surface);
}

.phone-app-title {
  margin: 0;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 600;
  text-align: center;
  outline: none;
}

.phone-body {
  flex: 1;
  min-height: 0;
  padding: 16px 16px 44px;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 14px;
  line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 244, 232, 0.2) transparent;
}

.phone-body a:not([class]) {
  color: var(--ui-warm);
}

.phone-lock {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  background:
    radial-gradient(120% 60% at 90% 0%, rgba(255, 180, 99, 0.36), transparent 62%),
    linear-gradient(180deg, #2c2433, #17141b);
  opacity: 0;
  pointer-events: none;
}

.phone-lock strong {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 68px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.lock-ico {
  color: var(--ui-dim);
}

.phone-screen.is-unlocking .phone-lock {
  animation: lock-away 0.86s var(--ui-ease) forwards;
}

@keyframes lock-away {
  0% { opacity: 1; transform: none; }
  52% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-12%); }
}

.phone-homebar {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 150px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: translateX(-50%);
}

.phone-homebar i {
  width: 118px;
  height: 5px;
  border-radius: 999px;
  background: rgba(247, 242, 234, 0.5);
  transition: background 0.15s ease, transform 0.15s ease;
}

.phone-homebar:hover i {
  background: var(--ui-text);
  transform: scaleX(1.06);
}

.phone-close {
  position: absolute;
  top: -10px;
  right: -8px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--ui-edge-strong);
  border-radius: 50%;
  background: #2b2630;
  color: var(--ui-text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.phone-close:hover {
  background: #3a3440;
  transform: scale(1.08);
}

/* ---- inside the apps ------------------------------------------------------ */

.cv-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cv-avatar {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffc47f, #ee8234);
  color: var(--ui-warm-ink);
  font-family: var(--serif);
  font-weight: 560;
  font-size: 23px;
  box-shadow: 0 0 0 2px var(--ui-screen), 0 0 0 3.5px rgba(255, 180, 99, 0.6);
  overflow: hidden;
}

.cv-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cv-id h3 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 23px;
  line-height: 1.1;
}

.cv-title {
  margin-top: 3px;
  font-size: 13.5px;
  font-weight: 500;
}

.cv-place {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  color: var(--ui-dim);
  font-size: 12.5px;
}

.cv-tagline {
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.45;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px 4px 10px;
  border: 1px solid var(--ui-edge-strong);
  border-radius: 999px;
  color: var(--ui-text);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip-link:hover {
  border-color: var(--ui-warm);
  background: var(--ui-warm-soft);
  color: #ffd9ae;
}

.chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ui-surface-2);
  font-size: 12px;
  font-weight: 500;
}

.chip.strong {
  background: var(--ui-warm-soft);
  color: #ffd9ae;
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--ui-edge-strong);
  border-radius: 12px;
  background: var(--ui-surface);
  color: var(--ui-text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, filter 0.15s ease;
}

.ui-btn:hover {
  background: var(--ui-surface-2);
  transform: translateY(-1px);
}

.ui-btn:active {
  transform: none;
}

.ui-btn.primary {
  border-color: transparent;
  background: var(--ui-warm);
  color: var(--ui-warm-ink);
}

.ui-btn.primary:hover {
  background: var(--ui-warm);
  filter: brightness(1.08);
}

.ui-btn.danger {
  border-color: transparent;
  background: var(--bad);
  color: #fff;
}

.ui-btn.wide {
  display: flex;
  width: 100%;
  margin-top: 14px;
}

.app-section {
  margin-top: 24px;
}

.app-heading {
  margin: 0 0 9px;
  color: var(--ui-warm);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.app-text {
  color: rgba(247, 242, 234, 0.86);
}

.app-text + .app-text {
  margin-top: 8px;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  display: grid;
  gap: 1px;
  padding: 0 0 18px 20px;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 12px;
  bottom: -6px;
  width: 1.5px;
  background: var(--ui-edge-strong);
}

.timeline li:last-child::before {
  display: none;
}

.timeline li::after {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 9.5px;
  height: 9.5px;
  border-radius: 50%;
  background: var(--ui-warm);
  box-shadow: 0 0 0 3px rgba(255, 180, 99, 0.2);
}

.timeline-when {
  color: var(--ui-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.timeline strong {
  font-size: 14.5px;
  font-weight: 600;
}

.timeline-where {
  color: var(--ui-dim);
  font-size: 13px;
}

.timeline p {
  margin-top: 6px;
  color: rgba(247, 242, 234, 0.86);
  font-size: 13.5px;
}

.skill-group + .skill-group {
  margin-top: 12px;
}

.skill-label {
  color: var(--ui-dim);
  font-size: 12px;
  font-weight: 500;
}

.skill-group .chip-row {
  margin-top: 6px;
}

.beats {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: beat;
}

.beats li {
  position: relative;
  padding-left: 34px;
  counter-increment: beat;
}

.beats li::before {
  content: counter(beat);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--ui-surface-2);
  color: var(--ui-warm);
  font-size: 12px;
  font-weight: 600;
}

.beats strong {
  font-size: 14.5px;
  font-weight: 600;
}

.beats p {
  margin-top: 3px;
  color: rgba(247, 242, 234, 0.86);
  font-size: 13.5px;
}

.app-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 26px 18px;
  border: 1px dashed var(--ui-edge-strong);
  border-radius: 16px;
  text-align: center;
}

.app-empty strong {
  font-size: 15px;
  font-weight: 600;
}

.app-empty p {
  max-width: 270px;
  color: var(--ui-dim);
  font-size: 13.5px;
}

.app-empty.tall {
  margin-top: 16%;
  padding: 34px 20px;
}

.app-empty-ico {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--ui-warm-soft);
  color: var(--ui-warm);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tile {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--ui-surface);
}

.tile strong {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 26px;
  line-height: 1.05;
}

.tile span {
  color: var(--ui-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-note {
  margin: 12px 0;
  color: var(--ui-dim);
  font-size: 12.5px;
}

.app-note.center {
  margin-top: 22px;
  text-align: center;
}

.app-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--ui-surface-2);
  color: var(--ui-dim);
  transition: border-color 0.15s ease;
}

.app-search:focus-within {
  border-color: var(--ui-warm);
}

.app-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ui-text);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.app-search-input::placeholder {
  color: var(--ui-faint);
}

.app-search-input::-webkit-search-cancel-button {
  filter: invert(1) opacity(0.6);
}

.seg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 12px;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: var(--ui-surface-2);
}

.set-row.stack .seg {
  display: flex;
}

.set-row.stack .seg-btn {
  flex: 1;
}

.seg-btn {
  min-height: 30px;
  padding: 4px 13px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ui-dim);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg-btn:hover {
  color: var(--ui-text);
}

.seg-btn[aria-pressed='true'] {
  background: var(--ui-warm);
  color: var(--ui-warm-ink);
}

.pr-count {
  color: var(--ui-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pr-group {
  border-radius: 16px;
  background: var(--ui-surface);
  overflow: hidden;
}

.pr-group + .pr-group {
  margin-top: 10px;
}

.pr-group header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  padding: 10px 12px;
  background: rgba(255, 244, 232, 0.04);
}

.pr-repo {
  min-width: 0;
  color: var(--ui-text);
  font-size: 13.5px;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.pr-owner {
  color: var(--ui-dim);
}

.pr-repo strong {
  font-weight: 600;
}

.pr-repo:hover strong {
  color: var(--ui-warm);
}

.pr-tally {
  flex: none;
  display: flex;
  gap: 5px;
}

.tally {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tally.merged {
  background: rgba(63, 179, 127, 0.18);
  color: #7fe0b0;
}

.tally.open {
  box-shadow: inset 0 0 0 1px rgba(255, 180, 99, 0.6);
  color: #ffcd96;
}

.pr-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pr {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--ui-edge);
}

.pr-state {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
}

.pr-merged .pr-state {
  background: rgba(63, 179, 127, 0.18);
  color: #7fe0b0;
}

.pr-open .pr-state {
  box-shadow: inset 0 0 0 1px rgba(255, 180, 99, 0.6);
  color: #ffcd96;
}

.pr-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pr-title {
  color: var(--ui-text);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.pr-title:hover {
  color: var(--ui-warm);
  text-decoration: underline;
}

.pr-meta {
  color: var(--ui-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.post,
.project {
  padding: 15px;
  border-radius: 16px;
  background: var(--ui-surface);
}

.post + .post,
.project + .project {
  margin-top: 10px;
}

.post-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.post-top:empty {
  display: none;
}

.tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--ui-warm-soft);
  color: #ffd9ae;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-date {
  color: var(--ui-dim);
  font-size: 12px;
}

.post h3,
.project h3 {
  margin-bottom: 6px;
  font-family: var(--serif);
  font-weight: 560;
  font-size: 19px;
  line-height: 1.2;
}

.post .ui-btn {
  margin-top: 12px;
}

.post-none {
  margin-top: 10px;
  color: var(--ui-dim);
  font-size: 12.5px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn-row:empty {
  display: none;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 12px 0 0;
}

.stats div {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 244, 232, 0.05);
}

.stats dt {
  color: var(--ui-dim);
  font-size: 11px;
}

.stats dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.points {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding-left: 17px;
  color: rgba(247, 242, 234, 0.86);
  font-size: 13px;
}

.points li::marker {
  color: var(--ui-warm);
}

.body-settings .app-section:first-child {
  margin-top: 0;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 14px;
  background: var(--ui-surface);
}

.set-row + .set-row {
  margin-top: 6px;
}

.set-row.stack {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.set-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.set-text strong {
  font-size: 14px;
  font-weight: 600;
}

.set-text span {
  color: var(--ui-dim);
  font-size: 12.5px;
  line-height: 1.35;
}

.set-text span:empty {
  display: none;
}

.set-slider {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider {
  flex: 1;
  height: 24px;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--ui-warm) var(--fill, 80%), rgba(255, 244, 232, 0.16) var(--fill, 80%));
}

.slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--ui-warm) var(--fill, 80%), rgba(255, 244, 232, 0.16) var(--fill, 80%));
}

.slider::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  -webkit-appearance: none;
  appearance: none;
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.set-value {
  width: 28px;
  color: var(--ui-dim);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 244, 232, 0.2);
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch i {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  transition: transform 0.24s var(--ui-spring);
}

.switch[aria-checked='true'] {
  background: var(--ui-warm);
}

.switch[aria-checked='true'] i {
  transform: translateX(20px);
}

.set-restart {
  flex: none;
}

.set-confirm {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.keys {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 13px;
  border-radius: 14px;
  background: var(--ui-surface);
}

.keys div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.keys dt {
  flex: none;
  width: 58px;
}

.keys dd {
  margin: 0;
  color: rgba(247, 242, 234, 0.86);
  font-size: 13px;
}

/* ---- notifications -------------------------------------------------------- */

.notice-rail {
  position: absolute;
  right: var(--phone-r);
  bottom: calc(var(--phone-b) + 122px);
  display: flex;
  flex-direction: column;
  width: min(336px, calc(100vw - 24px));
}

body:has(#round-layer:not([hidden])) #phone-layer:not(.phone-open) .notice-rail {
  width: min(256px, calc(100vw - 24px));
}

.phone-open .notice-rail {
  right: calc(var(--phone-r) + 18px);
  bottom: auto;
  top: calc(100dvh - var(--phone-b) - var(--phone-h) + 52px);
  z-index: 3;
  flex-direction: column-reverse;
  width: calc(var(--phone-w) - 36px);
}

.notice {
  position: relative;
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding: 10px 12px 11px;
  border: 1px solid var(--ui-edge-strong);
  border-radius: 18px;
  background: rgba(44, 38, 50, 0.9);
  color: var(--ui-text);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  pointer-events: auto;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  animation: notice-up 0.36s var(--ui-spring) backwards;
}

.phone-open .notice {
  animation-name: notice-drop;
}

.phone-open .notice:not(.notice-page) {
  background: rgba(50, 43, 57, 0.97);
}

/* Over the open phone only the newest one shows, the rest wait in the list. The switches stay in reach. */
.phone-open .notice:not(.notice-page):not(:last-child) {
  display: none;
}

@keyframes notice-up {
  from { opacity: 0; transform: translate(24px, 10px) scale(0.94); }
}

@keyframes notice-drop {
  from { opacity: 0; transform: translateY(-26px) scale(0.96); }
}

.notice.is-leaving,
.note-row.is-leaving {
  height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  opacity: 0 !important;
  overflow: hidden;
  transition: height 0.24s ease, margin 0.24s ease, padding 0.24s ease, opacity 0.16s ease, transform 0.18s ease-in !important;
}

.note-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
}

.note-tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.note-app {
  flex: 1;
  min-width: 0;
  color: var(--ui-dim);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-when {
  color: var(--ui-faint);
  font-size: 11.5px;
}

.note-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: -2px -4px -2px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 244, 232, 0.1);
  color: var(--ui-text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.note-x:hover {
  background: rgba(255, 244, 232, 0.24);
}

.note-quiet {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  margin: -2px 0;
  padding: 2px 9px 2px 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 244, 232, 0.1);
  color: var(--ui-text);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.note-quiet:hover {
  background: rgba(255, 244, 232, 0.24);
}

.note-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.note-body {
  display: -webkit-box;
  color: rgba(247, 242, 234, 0.8);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.note-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 244, 232, 0.12);
  color: var(--ui-text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.note-btn:hover {
  background: rgba(255, 244, 232, 0.24);
}

/* A page is the one that matters, so it looks nothing like the rest. */
.notice-page {
  padding: 12px 14px 13px;
  border-color: rgba(255, 255, 255, 0.34);
  background: linear-gradient(160deg, #d5383f, #a01f2a);
  color: #fff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  animation: notice-up 0.36s var(--ui-spring) backwards, page-pulse 1.1s ease-out 0.36s infinite;
}

.phone-open .notice-page {
  animation: notice-drop 0.36s var(--ui-spring) backwards, page-pulse 1.1s ease-out 0.36s infinite;
}

@keyframes page-pulse {
  0% { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42), 0 0 0 0 rgba(229, 72, 77, 0.75); }
  100% { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42), 0 0 0 14px rgba(229, 72, 77, 0); }
}

.notice-page .note-tile {
  background: #fff !important;
  color: #b3242e;
}

.notice-page .note-app,
.notice-page .note-when,
.notice-page .note-body {
  color: rgba(255, 255, 255, 0.86);
}

.notice-page .note-title {
  font-size: 16px;
  font-weight: 800;
}

.notice-page .note-btn,
.note-page .note-btn {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.notice-page .note-btn.strong,
.note-page .note-btn.strong {
  background: #fff;
  color: #a01f2a;
}

.notice-page .note-btn.strong:hover,
.note-page .note-btn.strong:hover {
  background: #ffe9e9;
}

.note-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
  padding: 10px 10px 10px 11px;
  border: 1px solid var(--ui-edge);
  border-radius: 15px;
  background: rgba(20, 17, 24, 0.55);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  animation: row-in 0.26s ease backwards;
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(-6px); }
}

.note-row .note-tile {
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 8px;
}

.note-text {
  flex: 1;
  display: grid;
  gap: 1px;
  min-width: 0;
}

.note-row .note-app {
  font-size: 10.5px;
}

.note-row .note-title {
  font-size: 13.5px;
}

.note-row .note-body {
  font-size: 12.5px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.note-row .note-x {
  margin: 0;
}

.note-row.note-page {
  border-color: rgba(255, 255, 255, 0.3);
  background: linear-gradient(160deg, #c9343b, #981d27);
  color: #fff;
}

.note-row.note-page .note-tile {
  background: #fff !important;
  color: #b3242e;
}

.note-row.note-page .note-app,
.note-row.note-page .note-body {
  color: rgba(255, 255, 255, 0.86);
}

/* ---- toasts --------------------------------------------------------------- */

.toasts {
  position: absolute;
  left: 50%;
  bottom: calc(max(30px, env(safe-area-inset-bottom)) + 62px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
  transform: translateX(-50%);
  transition: left 0.3s var(--ui-ease);
}

/* With the phone up, lines centre on what's left of the world. */
.phone-up .toasts {
  left: calc((100vw - 392px) / 2);
  max-width: min(560px, calc(100vw - 440px));
}

/* Banners and lines share a column on narrower screens, so the lines sit on top. */
@media (max-width: 1040px) {
  .toasts {
    bottom: max(calc(max(30px, env(safe-area-inset-bottom)) + 62px), calc(var(--ui-rail-top, 0px) + 10px));
  }
}

.toast {
  padding: 10px 18px;
  border: 1px solid var(--ui-edge-strong);
  border-radius: 16px;
  background: var(--ui-glass-strong);
  color: var(--ui-text);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
  cursor: pointer;
  pointer-events: auto;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  animation: toast-in 0.32s var(--ui-spring);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.95); }
}

/* ---- cards ---------------------------------------------------------------- */

.card-backdrop {
  position: absolute;
  inset: 0;
  display: grid;
  padding: 16px;
  background: rgba(14, 12, 18, 0.68);
  overflow: auto;
  pointer-events: auto;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  transition: opacity 0.2s ease;
  animation: fade-in 0.25s ease;
}

.card-backdrop.is-leaving {
  opacity: 0;
  pointer-events: none;
}

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

.card {
  position: relative;
  width: min(540px, 100%);
  margin: auto;
  padding: 30px 28px 26px;
  border-radius: 22px;
  outline: none;
  overflow: hidden;
  animation: card-in 0.42s var(--ui-spring);
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  background: linear-gradient(90deg, #ee8234, var(--ui-warm));
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(22px) scale(0.95); }
}

.card-writeup .card-title {
  transform-origin: left center;
  animation: title-pop 0.5s var(--ui-ease) 0.14s both;
}

@keyframes title-pop {
  from { opacity: 0; transform: scale(0.9); }
}

.card-heading {
  margin-bottom: 8px;
  color: #a85d14;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel.card .card-title {
  margin: 0;
  font-size: clamp(27px, 5vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.card-lines {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.5;
}

.card-lines p + p {
  margin-top: 6px;
}

.card-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 8px;
  margin: 18px 0 0;
}

.card-stats div {
  padding: 11px 14px 12px;
  border-radius: 14px;
  background: var(--paper-2);
}

.card-stats dt {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-stats dd {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: 32px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.card-fields {
  margin: 18px 0 0;
  border-top: 1px solid var(--line);
}

.card-fields div {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.card-fields dt {
  padding-top: 2px;
  color: #a85d14;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-fields dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.45;
}

.card-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.card-share .btn {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 14px;
}

.card-share-note {
  color: var(--muted);
  font-size: 13px;
}

.card-share-note:empty {
  display: none;
}

.card-share-text {
  flex-basis: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  resize: none;
}

.card .card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.card .card-actions .btn {
  flex: 1 1 auto;
  min-height: 46px;
}

.card .card-actions.stacked {
  flex-direction: column;
}

.card-door {
  width: min(440px, 100%);
  text-align: center;
}

.card-door::before {
  background: repeating-linear-gradient(-45deg, #1d1d1f 0 14px, #f2b33d 14px 28px);
  height: 8px;
}

.card-stamp {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink);
}

.card-door .card-lines {
  color: var(--muted);
}

.card-note {
  width: min(460px, 100%);
}

/* ---- the start screen ----------------------------------------------------- */

#loading {
  background:
    radial-gradient(70% 55% at 50% 0%, rgba(255, 180, 99, 0.2), transparent 70%),
    radial-gradient(ellipse at 50% 40%, var(--night-2), var(--night) 70%);
  color: var(--ui-text);
  transition: opacity 0.5s ease, background-color 0.5s ease;
}

#loading.is-ready {
  background:
    radial-gradient(70% 55% at 50% 0%, rgba(255, 180, 99, 0.24), transparent 70%),
    linear-gradient(180deg, rgba(22, 18, 26, 0.84), rgba(22, 18, 26, 0.62) 45%, rgba(22, 18, 26, 0.9));
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(520px, 100%);
}

#loading-title {
  font-size: clamp(34px, 7vw, 56px);
  text-wrap: balance;
}

#loading-sub {
  color: rgba(247, 242, 234, 0.78);
  font-size: clamp(15px, 2.4vw, 18px);
}

.loading-track {
  width: min(320px, 100%);
  margin: 30px auto 10px;
}

#loading-bar {
  background: linear-gradient(90deg, #ee8234, var(--ui-warm));
}

.loading-pct {
  margin-bottom: 4px;
  color: var(--ui-warm);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#loading-text {
  max-width: 400px;
  color: var(--ui-dim);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#loading-text.is-swapping {
  opacity: 0;
  transform: translateY(4px);
}

#loading.is-ready .loading-track,
#loading.is-ready .loading-pct {
  display: none;
}

#loading.is-ready #loading-text {
  order: 2;
  min-height: 2.9em;
  margin-top: 22px;
  color: rgba(247, 242, 234, 0.82);
  font-size: 14.5px;
  text-wrap: balance;
}

.loading-actions {
  order: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  animation: toast-in 0.45s var(--ui-spring);
}

.loading-start {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 12px 30px 12px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--ui-warm);
  color: var(--ui-warm-ink);
  box-shadow: 0 10px 30px rgba(255, 180, 99, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.14);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.loading-start:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 14px 36px rgba(255, 180, 99, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.14);
}

.loading-start:active {
  transform: translateY(1px);
}

.loading-resume {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 12px 22px;
  border: 1px solid var(--ui-edge-strong);
  border-radius: 999px;
  background: rgba(255, 244, 232, 0.07);
  color: var(--ui-text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.loading-resume:hover {
  background: rgba(255, 244, 232, 0.14);
  transform: translateY(-2px);
}

.loading-keys {
  order: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-top: 14px;
  color: var(--ui-dim);
  font-size: 12.5px;
}

.loading-keys .kbd {
  margin-right: 3px;
}

.loading-plug {
  order: 4;
  max-width: 440px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--ui-edge-strong);
  color: rgba(247, 242, 234, 0.78);
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
  text-wrap: balance;
}

@media (max-width: 520px) {
  .loading-plug {
    margin-top: 18px;
    padding: 14px 0 0;
    font-size: 13px;
  }
}

#loading:not(.is-ready) .loading-plug {
  display: none;
}

.loading-plug strong {
  color: var(--ui-text);
}

.loading-plug a {
  color: var(--ui-warm);
  font-weight: 600;
}

.loading-plug code {
  padding: 1px 7px;
  border: 1px solid var(--ui-edge-strong);
  border-radius: 6px;
  background: rgba(255, 244, 232, 0.07);
  color: var(--ui-text);
  font-size: 12.5px;
  white-space: nowrap;
}

/* ---- the frame around a round ------------------------------------------- */

.round {
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), inset 0 5px 0 var(--ui-warm);
  animation: fade-in 0.28s ease;
}

.round-head {
  min-height: 40px;
}

.round .round-title {
  font-size: clamp(22px, 3.4vw, 28px);
  letter-spacing: -0.01em;
}

.round-close {
  flex: none;
  min-height: 36px;
  padding: 6px 14px;
  border-color: var(--line);
  color: var(--muted);
  font-size: 13.5px;
}

.round-close:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.round-timer {
  height: 8px;
  background: rgba(29, 29, 31, 0.1);
  box-shadow: inset 0 1px 2px rgba(29, 29, 31, 0.12);
}

.round-timer i {
  border-radius: inherit;
}

/* ---- the skip link ------------------------------------------------------- */

#skip-link {
  border-color: var(--ui-edge-strong);
  background: var(--ui-glass-strong);
  color: var(--ui-text);
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

#skip-link:hover {
  border-color: var(--ui-warm);
  background: var(--ui-glass-strong);
  color: var(--ui-warm);
  text-decoration: none;
}

/* ---- focus rings ---------------------------------------------------------- */

.hud button:focus-visible,
.phone-button:focus-visible,
.phone button:focus-visible,
.phone a:focus-visible,
.phone .slider:focus-visible,
.notice button:focus-visible,
.loading-start:focus-visible,
.loading-resume:focus-visible,
.loading-plug a:focus-visible {
  outline: 2.5px solid var(--ui-warm);
  outline-offset: 2px;
}

.loading-start:focus-visible {
  outline-color: #fff;
  outline-offset: 3px;
}

.notice-page button:focus-visible,
.note-page button:focus-visible {
  outline-color: #fff;
}

/* ---- small screens -------------------------------------------------------- */

@media (max-width: 720px) {
  .hud {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      'tl tr'
      'tc tc';
    gap: 8px;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 10px max(10px, env(safe-area-inset-left));
  }

  .hud-tr {
    justify-self: end;
  }

  .hud.has-debug .hud-tc {
    padding-top: 0;
  }

  .meter-name {
    display: none;
  }

  .meter-track {
    width: calc(64px * var(--stretch, 1));
  }

  .hud-goal {
    border-radius: 18px;
  }

  .hud-objective {
    font-size: 13.5px;
  }

  /* The prompt takes the gap between the skip link and the little phone. */
  .hud-prompt {
    left: max(10px, env(safe-area-inset-left));
    right: calc(max(10px, env(safe-area-inset-right)) + 78px);
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 52px);
    width: fit-content;
    max-width: none;
    margin: 0 auto;
    transform: none;
    animation-name: prompt-in-small;
  }

  .toasts {
    bottom: max(calc(max(12px, env(safe-area-inset-bottom)) + 130px), calc(var(--ui-rail-top, 0px) + 10px));
  }
}

@keyframes prompt-in-small {
  from { opacity: 0; transform: translateY(10px) scale(0.94); }
}

@media (max-width: 560px) {
  #phone-layer {
    --phone-w: calc(100vw - 20px);
    --phone-h: calc(100dvh - 72px);
    --phone-r: 10px;
    --phone-b: max(12px, env(safe-area-inset-bottom));
  }

  /* The skip link keeps its corner, so the open phone stops just above it. */
  .phone {
    bottom: calc(var(--phone-b) + 44px);
  }

  .phone-open .notice-rail {
    top: 68px;
  }

  /* Two banners at once is plenty here. The rest wait in the phone. */
  #phone-layer:not(.phone-open) .notice:nth-last-child(n + 3) {
    display: none;
  }

  /* The phone fills the screen, so the HUD and the lines step back. */
  .phone-up .hud,
  .phone-up .toasts {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  }

  .card-backdrop {
    padding: 12px 12px 60px;
  }

  .phone-close {
    top: -8px;
    right: -4px;
  }

  .phone-frame {
    border-radius: 40px;
  }

  .phone-screen {
    border-radius: 32px;
  }

  .app-search-input {
    font-size: 16px;
  }

  .card {
    padding: 22px 18px 18px;
  }

  .card-stats,
  .card-fields,
  .card-share {
    margin-top: 14px;
  }

  .card-stats div {
    padding: 8px 12px 9px;
  }

  .card-stats dd {
    font-size: 27px;
  }

  .card-fields div {
    grid-template-columns: 1fr;
    gap: 1px;
    padding: 7px 0;
  }

  .card .card-actions {
    gap: 8px;
    margin-top: 14px;
  }
}

@media (max-height: 620px) and (min-width: 561px) {
  #phone-layer {
    --phone-h: calc(100dvh - 28px);
    --phone-b: 14px;
  }

  .home-clock {
    padding: 4px 8px 12px;
  }

  .home-time {
    font-size: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone,
  .phone-open .phone {
    transform: none;
  }

  .phone-button.is-buzzing,
  .has-page .phone-button,
  .notice-page,
  .card-writeup .card-title,
  .meter.is-alert .meter-track {
    animation: none;
  }
}
