:root {
  color-scheme: dark;
  --paper: #070c09;
  --panel: #0c1711;
  --raised: #122219;
  --ink: #e9f5eb;
  --muted: #a2b9aa;
  --border: #294637;
  --divider: #20392c;
  --accent: #a2ff78;
  --accent-text: #b9ff9c;
  --accent-dark: #0b180e;
  --accent-line: #529465;
  --warning: #f6cc83;
  --danger: #ffa393;
  --mono: "IBM Plex Mono", Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 780px 420px at 42% 210px, #10312365, transparent),
    linear-gradient(transparent 240px, var(--paper) 720px),
    repeating-linear-gradient(90deg, #6dbd8710 0 1px, transparent 1px 48px) 50% 0 / 100% 720px no-repeat,
    repeating-linear-gradient(#6dbd870b 0 1px, transparent 1px 48px) 0 0 / 100% 720px no-repeat;
}
h1, h2, h3, p, dl, dd { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
a { color: inherit; text-decoration: none; }
a, button, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.65; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.top {
  border-bottom: 1px solid var(--border);
  background: #080e0b;
}
.top-inner, .shell { max-width: 1312px; padding-inline: 32px; margin-inline: auto; }
.top-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  min-height: 70px;
}
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 11px; white-space: nowrap; }
.brand-mark {
  --crest-center: #142c1c;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--accent-line);
  color: var(--accent);
  background: linear-gradient(135deg, #1e3c25, #142c1c 52%, #0c1911);
  box-shadow: inset 0 0 13px #62da7722;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}
.crest {
  display: inline-block;
  flex: none;
  width: 20px;
  aspect-ratio: 1;
  position: relative;
  background: currentColor;
  clip-path: polygon(50% 0, 62% 22%, 85% 15%, 78% 38%, 100% 50%, 78% 62%, 85% 85%, 62% 78%, 50% 100%, 38% 78%, 15% 85%, 22% 62%, 0 50%, 22% 38%, 15% 15%, 38% 22%);
}
.crest::after { content: ""; position: absolute; inset: 31%; background: var(--crest-center, var(--panel)); }
.brand-name { display: flex; align-items: baseline; gap: 7px; font-size: 14px; font-weight: 700; letter-spacing: .03em; }
.brand-name strong { color: var(--accent); font: 700 21px/1 var(--mono); letter-spacing: .055em; }
.nav { display: flex; align-items: center; gap: 5px; }
.nav a {
  display: grid;
  place-items: center;
  min-height: 43px;
  min-width: 68px;
  padding: 8px 17px;
  border: 1px solid transparent;
  color: var(--muted);
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}
.nav a:hover { color: var(--ink); background: var(--raised); }
.nav a[aria-current] {
  color: var(--accent);
  border-color: #294a33;
  border-bottom-color: var(--accent);
  background: linear-gradient(0deg, #193520, #102017);
}
#record { justify-self: end; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.button-primary {
  position: relative;
  color: var(--accent-dark);
  border-color: var(--accent);
  background: var(--accent);
}
.button-primary::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  background: linear-gradient(135deg, transparent 49%, var(--panel) 51%);
  pointer-events: none;
}
.button-primary:hover:enabled { border-color: #c7ffae; background: #c7ffae; box-shadow: 0 0 17px #8dff7142; }
.button-outline { color: var(--accent-text); border-color: #39634a; background: #0b1710; }
.button-outline:hover:enabled { color: var(--accent); border-color: var(--accent-line); background: #183421; }
.motion-enabled :is(.button, .nav a, .path-card, .roster-option) {
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.motion-enabled :is(.button, .path-card):enabled:active { transform: translateY(1px); }
.plus { display: inline-block; width: 12px; height: 12px; position: relative; color: inherit; flex: none; }
.plus::before, .plus::after { content: ""; position: absolute; left: 5px; width: 2px; height: 12px; background: currentColor; }
.plus::after { transform: rotate(90deg); }
.spark { display: inline-block; width: 14px; aspect-ratio: 1; background: currentColor; clip-path: polygon(50% 0, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0 50%, 35% 35%); }

.shell { padding-top: 39px; padding-bottom: 42px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.page-heading > div:first-child { min-width: 0; }
.page-heading h1 {
  padding-inline-start: .32em;
  border-inline-start: 3px solid var(--accent);
  font-size: clamp(34px, 3.65vw, 53px);
  font-weight: 780;
  letter-spacing: -.045em;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.page-heading h1:focus { outline: none; }
.motion-enabled main > section:not([hidden]) > .page-heading { animation: heading-in 240ms ease-out both; }
@keyframes heading-in {
  from { opacity: .62; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.subheading { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.day-dot { flex: none; width: 6px; height: 6px; background: var(--accent); box-shadow: 0 0 9px #96ff7390; }
.date-group { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; white-space: nowrap; }
#today-date { font: 13px var(--mono); }
#plan-marker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid #2e5539;
  color: var(--accent-text);
  background: #12281b;
}
#plan-marker::before { content: ""; width: 5px; height: 5px; background: currentColor; }
.partner-picker { min-height: 40px; }

.dashboard { display: grid; grid-template-columns: minmax(0, 2.18fr) minmax(310px, 1fr); gap: 18px; }
.habitat, .partner-dialog {
  background: radial-gradient(ellipse at 50% 57%, #17412a 0%, #0b2217 39%, #06130d 72%, #030906 100%);
}
.habitat {
  position: relative;
  display: flex;
  align-items: end;
  isolation: isolate;
  overflow: hidden;
  min-height: 465px;
  border: 1px solid #396c4c;
  box-shadow: 0 14px 35px #01060385, 0 0 22px #4ed97415;
}
.habitat::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 7px;
  pointer-events: none;
  --frame-line: #80ec9ca6;
  background:
    linear-gradient(var(--frame-line), var(--frame-line)) left top / 19px 1px no-repeat,
    linear-gradient(var(--frame-line), var(--frame-line)) left top / 1px 19px no-repeat,
    linear-gradient(var(--frame-line), var(--frame-line)) right top / 19px 1px no-repeat,
    linear-gradient(var(--frame-line), var(--frame-line)) right top / 1px 19px no-repeat,
    linear-gradient(var(--frame-line), var(--frame-line)) left bottom / 19px 1px no-repeat,
    linear-gradient(var(--frame-line), var(--frame-line)) left bottom / 1px 19px no-repeat,
    linear-gradient(var(--frame-line), var(--frame-line)) right bottom / 19px 1px no-repeat,
    linear-gradient(var(--frame-line), var(--frame-line)) right bottom / 1px 19px no-repeat;
}
.habitat::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 33%;
  background: linear-gradient(transparent, #030b07e8);
  pointer-events: none;
}
.partner-field {
  --floor-y: 75%;
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: repeating-linear-gradient(0deg, #84ff9c09 0 1px, transparent 1px 4px);
  pointer-events: none;
}
.field-particles { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.motion-enabled .partner-field:has(.field-particles)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 5%, #86faaaa0 10%, #99ffc3 11%, #6dffaa24 12%, transparent 17%);
  mask-image: linear-gradient(90deg, transparent, #000 16% 84%, transparent);
  animation: field-sweep 9s linear infinite;
  pointer-events: none;
}
@keyframes field-sweep {
  0% { opacity: 0; transform: translateY(-18%); }
  12%, 58% { opacity: .34; }
  78%, 100% { opacity: 0; transform: translateY(83%); }
}
.data-rain {
  position: absolute;
  inset: 0 3% 15%;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  overflow: hidden;
  mask-image:
    radial-gradient(ellipse 60% 78% at 50% 55%, #0002 17%, #0008 55%, #000 87%),
    linear-gradient(#000b, #000 22% 68%, transparent 100%);
  mask-composite: intersect;
}
.data-rain span {
  --stream-shift: -75px;
  --stream-duration: 17s;
  --stream-delay: -4s;
  justify-self: center;
  align-self: start;
  color: transparent;
  background: linear-gradient(#55e88019, #57ef8170 38%, #58ed86a6 72%, #a9ffbb 91%, #54d88166 96%, transparent);
  background-clip: text;
  font: 500 clamp(9px, .9vw, 13px)/1 var(--mono);
  letter-spacing: .24em;
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: nowrap;
  transform: translateY(var(--stream-shift));
}
.motion-enabled .data-rain span {
  animation: data-flow var(--stream-duration) ease-in-out var(--stream-delay) infinite alternate;
}
.data-rain span:nth-child(2n) { --stream-shift: -202px; --stream-duration: 21s; --stream-delay: -10s; opacity: .73; }
.data-rain span:nth-child(3n) { --stream-shift: -129px; --stream-duration: 13s; --stream-delay: -6s; }
.data-rain span:nth-child(4n) { justify-self: start; }
.data-rain span:nth-child(4n + 1) { justify-self: end; }
.data-rain span:nth-child(5n) { --stream-shift: -248px; --stream-duration: 19s; --stream-delay: -14s; }
.data-rain span:nth-child(7n) { --stream-shift: 28px; --stream-duration: 22s; --stream-delay: -8s; opacity: .6; }
@keyframes data-flow {
  to { transform: translateY(calc(var(--stream-shift) + 74px)); }
}
.field-grid {
  position: absolute;
  inset: 53% -45% -25%;
  background:
    linear-gradient(90deg, #77ed9d41 1px, transparent 1px),
    linear-gradient(#77ed9d41 1px, transparent 1px);
  background-size: 42px 36px;
  mask-image: linear-gradient(transparent, #000 23%, #0009 58%, transparent 91%);
  transform: perspective(235px) rotateX(48deg);
  transform-origin: center top;
}
.field-ring {
  position: absolute;
  top: var(--floor-y);
  left: 50%;
  width: min(79%, 1020px);
  height: 27%;
  border: 1px solid #75ed9a58;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.field-ring-outer::before, .field-ring-outer::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 13px;
  height: 1px;
  background: #8cf5a6b3;
}
.field-ring-outer::before { left: -7px; }
.field-ring-outer::after { right: -7px; }
.field-ring-middle {
  width: min(61%, 830px);
  height: 21%;
  border-style: dashed;
  border-color: #82fba56b;
}
.field-ring-inner {
  width: min(43%, 610px);
  height: 14%;
  border-color: #9bf5ae9c;
  background: radial-gradient(ellipse, transparent 29%, #6bf99925 78%, #69ee8f39);
  box-shadow: 0 0 17px #5ce38328, inset 0 0 22px #5ce38329;
}

.pet-stage { position: absolute; z-index: 1; inset: 0 0 48px; }
.graphics, .graphics canvas, .pet-poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.graphics canvas { display: block; }
.pet-poster {
  margin: auto;
  object-fit: contain;
  width: min(88%, 430px);
  mask-image: radial-gradient(ellipse 50% 52% at 50% 51%, #000 53%, transparent 98%);
}
.pet-touch { position: absolute; inset: 9% 9% 5%; background: transparent; border: 0; touch-action: pan-y; cursor: grab; }
.pet-touch:active { cursor: grabbing; }
.pet-touch:focus-visible { outline-offset: -4px; }
.model-zoom {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: stretch;
  border: 1px solid #48785b;
  border-radius: 8px;
  background: #071810eb;
}
.model-zoom button {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font: 600 20px/1 var(--mono);
  cursor: pointer;
}
.model-zoom button + button { border-inline-start: 1px solid #48785b; }
.model-zoom [data-zoom="reset"] { width: 56px; color: var(--ink); font-size: 12px; }
.model-zoom button:hover:enabled { background: #193a24; }
.model-zoom button:disabled { opacity: .4; cursor: default; }
.pet-zoom { top: 67px; right: 22px; }
.pet-controls {
  position: absolute;
  z-index: 3;
  top: 21px;
  left: 23px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}
.level-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #4b8a5d;
  color: var(--accent-text);
  background: #0a1b12ef;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}
.level-tag > span:first-child { width: 6px; height: 6px; background: var(--accent); box-shadow: 0 0 8px #97ff778a; }
.pet-caption {
  width: 100%;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  padding: 23px 24px;
  pointer-events: none;
}
.pet-caption h2 { font-size: clamp(28px, 3.5vw, 46px); letter-spacing: -.045em; line-height: 1.12; text-shadow: 0 2px 10px #020b07; }
.pet-caption p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  color: var(--accent-text);
  font: 500 12px var(--mono);
  letter-spacing: .15em;
  text-transform: uppercase;
}
.pet-caption p::before { content: ""; display: block; width: 12px; height: 1px; background: currentColor; opacity: .7; }
.button-glass {
  color: var(--ink);
  border-color: #63a977;
  background: #08180fdf;
  pointer-events: auto;
}
.button-glass .spark, .button-glass .expand-icon { color: var(--accent); }
.button-glass:hover { color: var(--accent-text); border-color: var(--accent); background: #193a24; }
.follow-progress { min-height: 38px; padding-inline: 10px; font-size: 12px; }
.expand-button { position: absolute; top: 21px; right: 22px; z-index: 3; min-height: 38px; }
.expand-icon {
  display: inline-block;
  width: 13px;
  height: 13px;
  flex: none;
  background:
    linear-gradient(currentColor, currentColor) left top / 5px 1px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 1px 5px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 5px 1px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 1px 5px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 5px 1px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 1px 5px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 5px 1px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 1px 5px no-repeat;
}

.metrics { display: grid; grid-template-rows: minmax(auto, 1.25fr) minmax(auto, 1fr); gap: 15px; }
.panel {
  --panel-tick: var(--accent-line);
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(var(--panel-tick), var(--panel-tick)) left top / 29px 2px no-repeat,
    linear-gradient(var(--panel-tick), var(--panel-tick)) right bottom / 15px 1px no-repeat,
    var(--panel-fill, var(--panel));
}
.courage {
  --panel-tick: var(--accent);
  --panel-fill: linear-gradient(145deg, #14291b, #0b1610 68%);
}
.metric-label { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.35; font-weight: 700; }
.metric-label .crest { width: 16px; color: var(--accent); --crest-center: #14291b; }
.number { display: flex; align-items: baseline; gap: 8px; margin-top: 13px; color: var(--accent-text); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.number strong { font-size: clamp(36px, 4.65vw, 65px); line-height: .99; letter-spacing: -.06em; font-weight: 700; }
.number span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.courage-number { margin-top: 17px; margin-bottom: 18px; text-shadow: 0 0 23px #89ff6b38; }
progress {
  --progress-fill: var(--accent);
  --progress-track: #284937;
  display: block;
  width: 100%;
  height: 8px;
  padding: 0;
  border: 0;
  background: var(--progress-track);
  color: var(--accent);
  appearance: none;
  accent-color: var(--accent);
}
progress::-webkit-progress-bar { background: var(--progress-track); }
progress::-webkit-progress-value { background: var(--progress-fill); }
progress::-moz-progress-bar { background: var(--progress-fill); }
#courage-progress {
  --progress-fill: linear-gradient(90deg, #48ce76, var(--accent) 48%, #48ce76);
  height: 13px;
  mask-image: repeating-linear-gradient(90deg, #000 0 calc(10% - 2px), transparent calc(10% - 2px) 10%);
}
.motion-enabled #courage-progress:not([value="0"])::-webkit-progress-value {
  background-size: 200% 100%;
  animation: charge-flow 3.4s linear infinite;
}
.motion-enabled #courage-progress:not([value="0"])::-moz-progress-bar {
  background-size: 200% 100%;
  animation: charge-flow 3.4s linear infinite;
}
@keyframes charge-flow {
  to { background-position: -200% 0; }
}
.metric-line { display: flex; justify-content: space-between; align-items: baseline; gap: 9px; }
.courage .metric-line {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}
.courage .metric-line span { color: var(--muted); }
.courage .metric-line strong { text-align: right; }
.courage .muted { margin-top: 4px; font-size: 12px; }
.rest-note { margin-top: 6px; color: var(--warning); font-size: 12px; }
.evolution-button { width: 100%; margin-top: 12px; }
.small-link { font-size: 13px; font-weight: 680; color: var(--accent-text); white-space: nowrap; }
.small-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.small-link span { margin-left: 2px; }
.activity { position: relative; isolation: isolate; overflow: hidden; }
.activity:has(#partner-sleep:not([hidden]))::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: -57px;
  width: clamp(120px, 16vw, 195px);
  aspect-ratio: 1;
  background:
    repeating-radial-gradient(circle, transparent 0 14px, #6be49537 15px 16px, transparent 17px 20px),
    linear-gradient(90deg, transparent calc(50% - 1px), #6be49537 50%, transparent calc(50% + 1px)),
    linear-gradient(transparent calc(50% - 1px), #6be49537 50%, transparent calc(50% + 1px));
  mask-image: radial-gradient(#000 12%, #0008 55%, transparent 72%);
  pointer-events: none;
}
.activity .number strong { font-size: clamp(27px, 3.4vw, 42px); }
.sleep-reading { margin-top: 15px; color: var(--ink); font-size: clamp(20px, 2.45vw, 34px); font-weight: 750; letter-spacing: -.035em; line-height: 1.25; font-variant-numeric: tabular-nums; }
#partner-sleep-detail, #last-sleep-detail { margin-top: 7px; }
.sleep-summary > p:last-child { margin-top: 18px; }
.sleep-entries { border-top: 1px solid var(--divider); margin-top: 6px; padding-top: 13px; font-size: 13px; }
.sleep-entries summary { color: var(--accent-text); cursor: pointer; font-weight: 680; margin-bottom: 6px; }
.activity-week { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 10px; }
.chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; }
.chart li { min-width: 0; display: flex; flex-direction: column; justify-content: end; align-items: center; }
.chart-bar { width: 100%; height: var(--bar-height); min-height: 4px; background: linear-gradient(#7bdf96, #38704f); }
.chart-bar.empty-bar { background: #294937; }
.chart li:last-child .chart-bar { background: linear-gradient(var(--accent), #50b881); }
.chart li:last-child .chart-bar.empty-bar { background: #497456; }
.mini-chart { gap: 5px; width: min(63%, 150px); height: 42px; }
.mini-chart li { height: 100%; }
.mini-chart .chart-bar { max-width: 16px; }

.path-section { margin-top: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-heading h2, .settings-panel h2 { font-size: 18px; line-height: 1.35; font-weight: 750; letter-spacing: -.02em; }
.path-section .section-heading h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}
.path-section .section-heading h2::before {
  content: "";
  width: 11px;
  height: 11px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-2px);
}
.path-list {
  --path-gap: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--path-gap);
}
.path-list li { position: relative; min-width: 0; }
.path-list li:not(:last-child)::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 100%;
  width: var(--path-gap);
  height: 1px;
  background: var(--accent-line);
}
.path-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 90px;
  padding: 8px;
  border: 1px solid var(--border);
  background: #0c1610;
  color: var(--ink);
  text-align: start;
}
.path-card:disabled { opacity: 1; }
.path-card[aria-pressed="false"]:enabled:hover { border-color: var(--accent-line); background: var(--raised); }
.path-card[aria-pressed="true"] {
  border-color: #76b96f;
  background: linear-gradient(135deg, #1b3623, #101e16);
  box-shadow: inset 3px 0 var(--accent), 0 0 16px #7dff761a;
}
.path-card img, .memory-card img { display: block; object-fit: cover; background: #192b20; border: 1px solid #395a46; flex: none; }
.path-card img { width: clamp(43px, 4.75vw, 68px); aspect-ratio: 1; }
.path-card:disabled img, .memory-card.locked img { filter: grayscale(.75) brightness(.69) contrast(1.11); }
.path-card[aria-pressed="true"] img { border-color: #81bc79; }
.path-copy { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.path-name { font-size: clamp(12px, 1.1vw, 15px); font-weight: 700; line-height: 1.4; }
.path-details {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 7px;
  color: var(--muted);
  font: 11px/1.4 var(--mono);
  overflow-wrap: normal;
  word-break: keep-all;
}
.path-card[aria-pressed="true"] .path-status,
.path-list [aria-current="step"] .path-status { font-weight: 700; color: var(--accent-text); }

.running-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; align-items: start; }
.running-summary { --panel-fill: linear-gradient(145deg, #12271a, #0b1510 70%); }
.week-chart { height: 200px; margin-top: 22px; gap: clamp(7px, 1.9vw, 24px); align-items: stretch; }
.week-chart li { gap: 6px; }
.week-chart .chart-bar { max-width: 42px; }
.chart-label, .chart-value { color: var(--muted); font: 11px var(--mono); white-space: nowrap; }
.chart-value { color: var(--accent-text); }
.running-history .section-heading { margin-bottom: 10px; }
.empty { padding: 40px 10px; text-align: center; color: var(--muted); }
.empty-mark { width: 45px; height: 45px; display: grid; place-items: center; margin: 0 auto; border: 1px dashed var(--accent-line); color: var(--accent); }
.empty p { margin: 13px 0 16px; }
.run-row { display: flex; align-items: center; gap: 16px; padding-block: 12px; border-top: 1px solid var(--divider); }
.run-row > div { flex: 1; min-width: 0; }
.run-row p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.run-row .button { min-height: 38px; }
.run-gain { color: var(--accent-text); font: 13px var(--mono); }
.memories { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 14px; }
.memory-card { height: 100%; display: grid; grid-template-rows: auto 1fr; gap: 12px; padding: 10px 10px 13px; }
.memory-card img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.memory-card > div { display: flex; flex-direction: column; align-items: start; padding-inline: 4px; }
.memory-card h2 { font-size: 16px; line-height: 1.4; }
.memory-card p { margin-top: 3px; margin-bottom: 8px; }
.memory-card button { margin-top: auto; min-height: 38px; padding: 5px 9px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.settings-panel h2 { margin-bottom: 12px; }
.settings-panel > p { margin-block: 9px 8px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 53px; padding-block: 9px; border-top: 1px solid var(--divider); font-size: 14px; }
.setting-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.setting-row strong { font: 12px var(--mono); overflow-wrap: anywhere; }
.setting-row select { min-height: 38px; padding: 5px 9px; border: 1px solid #39634a; border-radius: 2px; background: #07110c; color: var(--ink); }
.setting-row-wrap { flex-wrap: wrap; }
.switch { width: 42px; height: 24px; flex: none; margin: 0; border: 1px solid #54705f; border-radius: 2px; background: #09130d; appearance: none; cursor: pointer; }
.switch::after { content: ""; display: block; width: 15px; height: 16px; margin: 3px; background: #789182; }
.switch:checked { background: #193822; border-color: #75b66e; }
.switch:checked::after { margin-left: 22px; background: var(--accent); }
.switch:disabled { opacity: .55; cursor: default; }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 15px; }
.rules div { border-top: 1px solid var(--divider); padding-top: 10px; font-size: 13px; }
.rules dt { color: var(--muted); }
.rules dd { margin-top: 4px; color: var(--accent-text); font: 700 15px var(--mono); }
.button-group { display: flex; align-items: center; gap: 8px; }
.button-group .button { min-height: 38px; padding-inline: 11px; }

dialog {
  width: min(444px, calc(100% - 32px));
  max-height: calc(100% - 28px);
  padding: 23px;
  border: 1px solid var(--accent-line);
  border-radius: 2px;
  background:
    linear-gradient(var(--accent), var(--accent)) left top / 38px 2px no-repeat,
    linear-gradient(var(--accent-line), var(--accent-line)) right bottom / 22px 2px no-repeat,
    var(--panel);
  color: var(--ink);
  box-shadow: 0 20px 70px #000b, 0 0 32px #54d87a20;
}
dialog::backdrop { background: #030805be; backdrop-filter: blur(3px); }
.motion-enabled dialog[open]:not(.fullscreen-dialog) { animation: dialog-in 180ms ease-out both; }
@keyframes dialog-in {
  from { opacity: .65; transform: translateY(5px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.dialog-heading, .evolution-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-heading h2 { font-size: 24px; letter-spacing: -.03em; }
.roster-dialog { width: min(660px, calc(100% - 24px)); }
.roster-note { margin: 7px 0 15px; }
.roster-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.roster-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 66px;
  padding: 7px;
  text-align: left;
  color: var(--ink);
  background: #0a130e;
  border: 1px solid var(--border);
  border-radius: 2px;
}
.roster-option:hover { background: #152c1d; border-color: var(--accent-line); }
.roster-option[aria-pressed="true"] { background: #183522; border-color: #76b96f; }
.roster-option img { width: 51px; aspect-ratio: 1; border: 1px solid #395a46; object-fit: cover; }
.roster-copy { display: grid; gap: 3px; }
.roster-copy strong { font-size: 14px; }
.roster-copy small { font-size: 11px; color: var(--muted); }
.roster-current { margin-left: auto; color: var(--accent-text); font-size: 11px; white-space: nowrap; }
.close-button { flex: none; min-width: 40px; height: 40px; border: 1px solid #39634a; border-radius: 2px; background: #101e16; color: var(--ink); font-size: 23px; line-height: 1; }
.close-button:hover { background: #193822; border-color: var(--accent-line); color: var(--accent); }
.field-label { display: block; margin: 17px 0 6px; font-size: 13px; font-weight: 700; }
dialog form input { width: 100%; min-width: 0; min-height: 45px; padding: 8px 12px; border: 1px solid #39634a; border-radius: 2px; background: #070f0b; color: var(--ink); }
dialog form input::placeholder { color: #8ca599; }
dialog form input:focus { border-color: var(--accent-line); }
.form-note { margin-top: 8px; overflow-wrap: anywhere; }
.distance-input { position: relative; }
#run-form .distance-input input { padding-right: 55px; }
.distance-input > span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font: 13px var(--mono); color: var(--muted); pointer-events: none; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 20px; }
.button-danger { color: var(--danger); border-color: #754337; background: #241713; margin-right: auto; }
.button-danger:hover { background: #3c231b; border-color: var(--danger); }
.error { margin-top: 8px; font-size: 13px; color: var(--danger); }
.storage-warning { padding: 10px 13px; margin-bottom: 14px; border: 1px solid #754337; background: #241713; color: var(--danger); font-size: 13px; }
.fullscreen-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  color: var(--ink);
  box-shadow: none;
}
body:has(.fullscreen-dialog[open]) { overflow: hidden; }
body:has(dialog[open]) .habitat .data-rain span { animation-play-state: paused; }
.fullscreen-back {
  position: absolute;
  z-index: 2;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  width: 44px;
  height: 44px;
  background: #09180fe0;
  color: var(--ink);
  font-size: 29px;
}
.partner-dialog .partner-field { --floor-y: 82%; }
.partner-dialog .data-rain { inset-inline: 6%; }
.partner-dialog .data-rain span { font-size: clamp(10px, 1.15vw, 17px); letter-spacing: .31em; }
.immersive-stage { position: absolute; inset: 0; }
.immersive-stage .pet-poster { width: min(88%, 74vh, 680px); }
.immersive-stage .pet-touch { inset: 0; touch-action: none; }
.immersive-zoom {
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
}
.immersive-caption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  padding: 28px max(23px, env(safe-area-inset-right)) max(21px, env(safe-area-inset-bottom)) max(23px, env(safe-area-inset-left));
  background: linear-gradient(transparent, #030a06ee);
  pointer-events: none;
}
.immersive-caption h2 { font-size: clamp(25px, 4vw, 43px); line-height: 1.2; }
.immersive-caption p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.evolution-dialog, .evolution-scene { background: #010303; }
.evolution-scene { position: absolute; inset: 0; }
.evolution-scene .pet-poster { width: min(90%, 64vh, 650px); }
#evolution-nickname {
  z-index: 1;
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  inset-inline: 64px;
  text-align: center;
  font-size: clamp(15px, 2.5vw, 22px);
  font-weight: 750;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 8px #000, 0 0 10px #000;
  pointer-events: none;
}
#evolution-name { position: absolute; inset: auto 8px 17%; text-align: center; font-size: clamp(22px, 3vw, 38px); font-weight: 760; text-shadow: 0 2px 8px #000, 0 0 10px #000; }
.evolution-footer {
  position: absolute;
  inset: auto 0 0;
  padding: 18px max(15px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left));
  background: linear-gradient(transparent, #050f09f5);
}
#evolution-status { min-height: 20px; margin-bottom: 5px; color: #d2e6d8; font-size: 13px; }
#evolution-progress { height: 4px; }
.evolution-controls { display: flex; gap: 8px; justify-content: end; margin-top: 11px; }
.evolution-controls .button-outline[aria-pressed="true"] { color: var(--accent); background: #193822; border-color: var(--accent-line); }
.toast {
  position: fixed;
  z-index: 4;
  inset: auto 18px max(19px, env(safe-area-inset-bottom)) auto;
  max-width: min(360px, calc(100% - 36px));
  padding: 12px 16px;
  border: 1px solid var(--accent-line);
  border-inline-start: 3px solid var(--accent);
  background: #0d2115;
  color: var(--ink);
  box-shadow: 0 6px 22px #0008;
  font-size: 14px;
  line-height: 1.45;
}
.toast:empty { visibility: hidden; }
.noscript { padding: 24px; text-align: center; }

@media (orientation: portrait) {
  .partner-dialog .partner-field { --floor-y: 74%; }
}
@media (forced-colors: active) {
  #courage-progress { mask-image: none; }
  .nav a[aria-current], .path-card[aria-pressed="true"] { border-color: Highlight; }
  .switch::after { background: ButtonText; }
  .switch:checked::after { background: Highlight; }
}

@media (max-width: 940px) {
  .top-inner, .shell { padding-inline: 22px; }
  .top-inner { gap: 13px; }
  .nav a { min-width: 56px; padding-inline: 11px; }
  .dashboard { grid-template-columns: minmax(0, 1.75fr) minmax(242px, 1fr); gap: 13px; }
  .habitat { min-height: 405px; }
  .panel { padding: 17px; }
  .path-list { --path-gap: 8px; }
  .path-card { gap: 7px; }
}

@media (max-width: 680px) {
  .top-inner, .shell { padding-inline: 15px; }
  .top-inner { grid-template-columns: minmax(0, 1fr) auto; min-height: 0; padding-top: 10px; gap: 8px 12px; }
  .top-inner .nav { grid-row: 2; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: 8px; }
  .nav a { min-width: 0; min-height: 40px; padding: 7px; }
  .brand-mark { width: 35px; height: 35px; }
  .brand-name strong { font-size: 19px; }
  #record { min-height: 40px; padding-inline: 11px; }
  .shell { padding-top: 24px; }
  .page-heading { margin-bottom: 17px; }
  .partner-heading { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 6px; }
  .partner-heading > div:first-child { display: contents; }
  .partner-heading h1 { grid-column: 1 / -1; }
  .partner-heading .subheading { margin-top: 0; white-space: nowrap; }
  .date-group { flex-wrap: wrap; justify-content: end; gap: 5px 7px; text-align: right; }
  #today-date, #plan-marker { font-size: 11px; }
  #plan-marker { padding: 5px 6px; }
  .date-group .partner-picker { min-height: 36px; font-size: 12px; padding: 5px 8px; }
  .subheading { font-size: 12px; }
  .dashboard, .running-grid, .settings-grid { grid-template-columns: 1fr; gap: 12px; }
  .habitat { min-height: clamp(320px, 88vw, 400px); }
  .pet-controls { left: 15px; top: 14px; min-height: 37px; }
  .follow-progress { min-height: 37px; padding-inline: 7px; }
  .expand-button { right: 15px; top: 14px; min-height: 37px; padding: 5px 9px; font-size: 12px; }
  .pet-zoom { right: 15px; top: 59px; }
  .pet-caption { padding: 17px 16px; }
  .pet-stage { bottom: 40px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; gap: 9px; align-items: stretch; }
  .metrics .panel { padding: 13px; }
  .metrics .metric-label { font-size: 13px; }
  .metrics .number strong { font-size: clamp(28px, 7.9vw, 40px); }
  .metrics .number { gap: 4px; }
  .metrics .number span { font-size: 11px; }
  .metrics .sleep-reading { font-size: clamp(19px, 5.4vw, 26px); }
  .courage-number { margin-top: 13px; margin-bottom: 13px; }
  #courage-progress { height: 10px; }
  .courage .metric-line, .courage .muted, .activity .small-link, .activity-week .muted { font-size: 11px; }
  .courage .metric-line { gap: 4px; margin-top: 10px; padding-top: 7px; }
  .activity-week { margin-top: 15px; gap: 6px; }
  .mini-chart { gap: 3px; }
  .evolution-button { gap: 4px; padding-inline: 5px; white-space: normal; }
  .evolution-button .spark { flex: none; width: 11px; }
  .path-section { margin-top: 21px; }
  .path-list { --path-gap: 5px; }
  .path-card { flex-direction: column; gap: 5px; min-height: 0; text-align: center; padding: 6px 3px; }
  .path-card[aria-pressed="true"] { box-shadow: inset 0 2px var(--accent), 0 0 12px #7dff761a; }
  .path-card img { width: min(92%, 62px); }
  .path-name { font-size: 11px; }
  .path-details { justify-content: center; font-size: 10px; }
  .memories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .memory-card { padding: 8px; }
  .roster-dialog { padding: 15px; }
  .roster-option { min-height: 57px; gap: 6px; }
  .roster-option img { width: 38px; }
  .roster-copy strong { font-size: 13px; }
  .roster-copy small { font-size: 10px; }
  .roster-current { display: none; }
  .immersive-caption { align-items: start; flex-direction: column; }
  #evolution-name { bottom: 22%; }
}

@media (max-width: 355px) {
  .top-inner, .shell { padding-inline: 12px; }
  .brand { gap: 7px; }
  .brand-name { gap: 5px; }
  .pet-controls { gap: 5px; }
  .metrics { grid-template-columns: 1fr; }
}
