@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #15212d;
  --ink-soft: #44515d;
  --muted: #83909b;
  --line: #e4e9ed;
  --line-dark: rgba(255, 255, 255, 0.12);
  --paper: #f5f7f8;
  --white: #ffffff;
  --navy: #0d1826;
  --navy-2: #132436;
  --blue: #1b9ee3;
  --blue-dark: #0a7fbf;
  --cyan: #64e1f0;
  --orange: #ff765e;
  --orange-light: #ffb17f;
  --violet: #9888ee;
  --shadow: 0 22px 60px rgba(19, 35, 50, 0.08);
  --shadow-small: 0 10px 30px rgba(19, 35, 50, 0.07);
  --font-sans: 'Manrope', 'DM Sans', Arial, sans-serif;
  --font-mono: 'DM Mono', monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 3px solid rgba(27, 158, 227, 0.42);
  outline-offset: 3px;
}

.is-hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 40rem;
  height: 40rem;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.15;
}

.ambient-one {
  top: -22rem;
  right: -12rem;
  background: #74d6ef;
}

.ambient-two {
  bottom: -26rem;
  left: -14rem;
  background: #b4a8ff;
}

/* Shared primitives */

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.brand-mark {
  display: inline-flex;
  gap: 3px;
  align-items: flex-end;
  height: 20px;
}

.brand-mark span {
  display: block;
  width: 3px;
  border-radius: 3px;
  background: currentColor;
  transform-origin: bottom;
}

.brand-mark span:nth-child(1) {
  height: 11px;
}

.brand-mark span:nth-child(2) {
  height: 18px;
}

.brand-mark span:nth-child(3) {
  height: 14px;
}

.brand-dark {
  color: var(--ink);
}

.brand-light {
  color: var(--white);
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow-muted {
  color: #8b98a2;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.055em;
}

h1 em,
h2 em,
h3 em {
  color: var(--blue);
  font-style: normal;
}

.button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0) scale(0.98);
}

.button-dark {
  color: var(--white);
  background: var(--navy);
  box-shadow: 0 12px 20px rgba(13, 24, 38, 0.12);
}

.button-dark:hover {
  background: #1a3043;
  box-shadow: 0 16px 28px rgba(13, 24, 38, 0.18);
}

.button-accent {
  color: var(--white);
  background: var(--blue);
  box-shadow: 0 9px 18px rgba(27, 158, 227, 0.2);
}

.button-accent:hover {
  background: var(--blue-dark);
  box-shadow: 0 14px 24px rgba(27, 158, 227, 0.26);
}

.button-light {
  color: #14212d;
  background: var(--white);
}

.button-light:hover {
  background: #eff8fb;
}

.button-outline {
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid #dce3e7;
}

.button-outline:hover {
  color: var(--blue-dark);
  border-color: rgba(27, 158, 227, 0.45);
  background: rgba(255, 255, 255, 0.7);
}

.button-wide {
  width: 100%;
}

.button-arrow {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.7;
  transition: transform 180ms ease;
}

.button:hover .button-arrow {
  transform: translateX(3px);
}

.button-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.6;
}

.plus-icon {
  margin-top: -1px;
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
}

.text-button {
  padding: 0;
  color: var(--blue-dark);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: color 160ms ease;
}

.text-button:hover {
  color: var(--orange);
}

.danger-text {
  color: #b36b6a;
}

.card-surface {
  border: 1px solid rgba(221, 228, 232, 0.8);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.87);
  box-shadow: var(--shadow-small);
}

/* Login */

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  background: #f8fafb;
}

.minimal-login-form {
  width: 100%;
  display: flex;
  justify-content: center;
}

.minimal-password-input {
  width: min(300px, calc(100vw - 48px));
  height: 54px;
  padding: 0 16px;
  border: 1px solid #dce4e8;
  border-radius: 7px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  text-align: center;
  font-size: 20px;
  letter-spacing: 0.22em;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.minimal-password-input:focus {
  border-color: rgba(27, 158, 227, 0.72);
  box-shadow: 0 0 0 4px rgba(27, 158, 227, 0.1);
}

.minimal-continue-button {
  height: 54px;
  margin-left: 8px;
  padding: 0 18px;
  border-radius: 7px;
  color: #fff;
  background: #0d1826;
  font-size: 11px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.minimal-continue-button:hover {
  background: #1b3043;
  transform: translateY(-1px);
}

.minimal-login-error {
  position: fixed;
  top: calc(50% + 43px);
  margin: 0;
  color: #c9675d;
  font-size: 10px;
}

.login-aside {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 54px 58px 48px;
  color: var(--white);
  background: var(--navy);
}

.login-grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 80%, transparent 100%);
}

.login-aside::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 47%, rgba(45, 135, 173, 0.32), transparent 38%), linear-gradient(125deg, rgba(255, 255, 255, 0.06), transparent 36%);
  content: '';
  pointer-events: none;
}

.login-aside .brand,
.aside-caption,
.aside-index {
  position: relative;
  z-index: 2;
}

.login-aside .brand-name {
  font-size: 19px;
}

.orbit {
  position: absolute;
  top: 47%;
  left: 50%;
  border: 1px solid rgba(123, 207, 228, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-21deg);
}

.orbit::after {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #67d3e7;
  box-shadow: 0 0 18px 4px rgba(103, 211, 231, 0.7);
  content: '';
}

.orbit-large {
  width: min(37vw, 560px);
  height: min(37vw, 560px);
  border-color: rgba(123, 207, 228, 0.17);
}

.orbit-large::after {
  top: 16%;
  right: 4%;
}

.orbit-small {
  width: min(27vw, 410px);
  height: min(27vw, 410px);
  transform: translate(-50%, -50%) rotate(57deg);
}

.orbit-small::after {
  bottom: 8%;
  left: 13%;
  width: 5px;
  height: 5px;
}

.login-sculpture {
  position: absolute;
  top: 47%;
  left: 50%;
  width: min(19vw, 280px);
  height: min(30vw, 450px);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.25));
}

.sculpture-glow {
  position: absolute;
  top: 9%;
  left: 13%;
  width: 76%;
  height: 78%;
  border-radius: 49% 49% 43% 44%;
  background: radial-gradient(ellipse at 35% 28%, rgba(130, 235, 244, 0.34), transparent 28%), radial-gradient(ellipse at 61% 56%, rgba(56, 175, 204, 0.33), transparent 44%), linear-gradient(140deg, rgba(111, 218, 231, 0.33), rgba(12, 50, 72, 0.08) 44%, rgba(15, 31, 48, 0.8));
  box-shadow: inset -24px -22px 42px rgba(3, 17, 28, 0.56), inset 12px 8px 28px rgba(137, 234, 240, 0.22), 0 0 45px rgba(67, 192, 216, 0.16);
  transform: rotate(2deg);
}

.sculpture-head {
  position: absolute;
  top: 8%;
  left: 15%;
  width: 70%;
  height: 80%;
  border-radius: 48% 49% 44% 43%;
  background: linear-gradient(105deg, rgba(126, 228, 237, 0.08), transparent 25% 52%, rgba(5, 20, 34, 0.35)), repeating-linear-gradient(164deg, transparent 0 12px, rgba(149, 240, 243, 0.07) 13px, transparent 14px 20px);
  box-shadow: inset 15px 12px 24px rgba(149, 237, 238, 0.12), inset -22px -20px 30px rgba(2, 15, 27, 0.52);
  transform: rotate(2deg);
}

.sculpture-head::before {
  position: absolute;
  top: -2%;
  left: 16%;
  width: 67%;
  height: 41%;
  border-radius: 50% 50% 31% 33%;
  background: linear-gradient(135deg, rgba(136, 234, 237, 0.25), rgba(10, 47, 66, 0.52));
  box-shadow: inset 7px 8px 16px rgba(178, 246, 246, 0.16), inset -16px -12px 19px rgba(1, 16, 28, 0.46);
  content: '';
}

.sculpture-ear {
  position: absolute;
  top: 39%;
  width: 17%;
  height: 20%;
  border: 1px solid rgba(133, 226, 234, 0.32);
  border-radius: 50%;
}

.sculpture-ear-left {
  left: -7%;
}

.sculpture-ear-right {
  right: -7%;
}

.sculpture-face {
  position: absolute;
  inset: 28% 16% 13%;
}

.sculpture-eye {
  position: absolute;
  top: 27%;
  width: 14%;
  height: 3%;
  border-radius: 50%;
  background: rgba(136, 230, 234, 0.45);
  box-shadow: 0 0 9px rgba(99, 219, 232, 0.45);
}

.sculpture-eye-left {
  left: 19%;
}

.sculpture-eye-right {
  right: 19%;
}

.sculpture-nose {
  position: absolute;
  top: 27%;
  left: 47%;
  width: 7%;
  height: 34%;
  border-right: 1px solid rgba(143, 232, 235, 0.31);
  border-radius: 0 50% 50% 0;
  transform: rotate(12deg);
}

.sculpture-mouth {
  position: absolute;
  bottom: 25%;
  left: 37%;
  width: 27%;
  height: 5%;
  border-bottom: 1px solid rgba(142, 233, 236, 0.33);
  border-radius: 50%;
}

.sculpture-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #70e4ee;
  box-shadow: 0 0 13px 3px rgba(112, 228, 238, 0.65);
}

.dot-a {
  top: 36%;
  left: 26%;
}

.dot-b {
  top: 50%;
  right: 17%;
}

.dot-c {
  bottom: 23%;
  left: 31%;
}

.dot-d {
  right: 29%;
  bottom: 13%;
  width: 4px;
  height: 4px;
}

.aside-caption {
  display: flex;
  gap: 10px;
  align-items: center;
  align-self: center;
  margin-bottom: 38px;
  color: rgba(224, 239, 243, 0.66);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.caption-line {
  width: 28px;
  height: 1px;
  background: #6ce0eb;
}

.aside-index {
  margin: 0;
  color: rgba(214, 237, 242, 0.43);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.aside-index span {
  padding: 0 7px;
  color: rgba(214, 237, 242, 0.22);
}

.login-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 7vw;
  background: #f8fafb;
}

.login-card {
  width: min(100%, 425px);
  padding: 4px 0 0;
}

.login-copy {
  margin-top: 74px;
}

.login-copy h1 {
  margin: 15px 0 20px;
  color: var(--ink);
  font-size: clamp(38px, 4.15vw, 62px);
  font-weight: 600;
  line-height: 1.08;
}

.login-copy h1 em {
  color: var(--blue);
  font-weight: 500;
}

.login-description {
  max-width: 380px;
  margin-bottom: 0;
  color: #788692;
  font-size: 13px;
  line-height: 1.75;
}

.login-form {
  margin-top: 44px;
}

.field-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #4e5c67;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.field-label small {
  color: #9aa5ad;
  font-size: 9px;
  font-weight: 500;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
  height: 58px;
  border: 1px solid #d9e2e7;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.65);
  transition: border 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.password-field:focus-within {
  border-color: rgba(27, 158, 227, 0.75);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(27, 158, 227, 0.1);
}

.field-lock {
  display: inline-flex;
  width: 52px;
  align-items: center;
  justify-content: center;
  color: #92a0aa;
}

.field-lock svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.password-field input {
  min-width: 0;
  flex: 1;
  align-self: stretch;
  padding: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  letter-spacing: 0.35em;
}

.password-field input::placeholder {
  color: #aeb8bf;
  font-size: 12px;
  letter-spacing: 0;
}

.password-toggle {
  display: grid;
  width: 50px;
  height: 100%;
  place-items: center;
  color: #8f9ca5;
  background: transparent;
}

.password-toggle:hover {
  color: var(--blue);
}

.eye-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.form-error {
  min-height: 18px;
  margin: 7px 0 0;
  color: #cf655b;
  font-size: 10px;
}

.remember-note {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 16px 0 0;
  color: #9aa5ad;
  font-size: 9px;
  line-height: 1.5;
}

.remember-check {
  display: grid;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #9dd7dd;
  border-radius: 4px;
  background: #eaf9f8;
}

.remember-check svg {
  width: 10px;
  height: 10px;
  stroke: #43afb3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.login-footer {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 76px;
  color: #a1adb5;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.secure-dot,
.save-pulse,
.live-status,
.legend-pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #62c9b3;
  box-shadow: 0 0 0 4px rgba(98, 201, 179, 0.12);
}

/* App header and shell */

.app-view {
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% 7%, rgba(162, 224, 238, 0.18), transparent 20rem),
    linear-gradient(180deg, #f4f7f8 0%, #f7f8f8 100%);
}

/* Minimal 3D workspace */

.minimal-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  color: #d9eef1;
  background: #091521;
}

.minimal-topline {
  position: relative;
  z-index: 4;
  display: flex;
  height: 68px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(20px, 4vw, 68px);
  border-bottom: 1px solid rgba(159, 222, 226, 0.11);
  background: rgba(9, 21, 33, 0.82);
  backdrop-filter: blur(18px);
}

.minimal-brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-self: start;
  color: #f4ffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.minimal-brand .brand-mark {
  height: 17px;
}

.minimal-brand .brand-mark span:nth-child(1) { height: 9px; }
.minimal-brand .brand-mark span:nth-child(2) { height: 15px; }
.minimal-brand .brand-mark span:nth-child(3) { height: 12px; }

.timeline-reading {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: #dff8f7;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.timeline-reading-separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #69d8d5;
  box-shadow: 0 0 0 4px rgba(105, 216, 213, 0.1);
}

.minimal-local-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
  color: rgba(205, 237, 239, 0.52);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.minimal-local-status span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #65d0ba;
  box-shadow: 0 0 0 4px rgba(101, 208, 186, 0.1);
}

.minimal-timeline {
  position: relative;
  z-index: 4;
  display: flex;
  height: 79px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 0.55vw, 9px);
  padding: 0 clamp(20px, 4vw, 68px);
  border-bottom: 1px solid rgba(159, 222, 226, 0.09);
  background: rgba(9, 21, 33, 0.72);
}

.minimal-timeline::before {
  position: absolute;
  right: clamp(20px, 4vw, 68px);
  bottom: 25px;
  left: clamp(20px, 4vw, 68px);
  height: 1px;
  background: linear-gradient(
    90deg,
    #66d8d4 0%,
    #ef9674 var(--timeline-progress, 3.33%),
    rgba(129, 198, 204, 0.17) var(--timeline-progress, 3.33%),
    rgba(129, 198, 204, 0.17) 100%
  );
  content: '';
  pointer-events: none;
}

.timeline-day {
  position: relative;
  z-index: 1;
  display: flex;
  width: clamp(22px, 2.8vw, 40px);
  height: 50px;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 0;
  color: rgba(196, 227, 229, 0.44);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 8px;
  transition: color 160ms ease, transform 160ms ease;
}

.timeline-day:hover:not(:disabled) {
  color: #bdf0ed;
  transform: translateY(-2px);
}

.timeline-day:disabled {
  cursor: default;
  opacity: 0.24;
}

.timeline-day-number {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: border 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.timeline-day-marker {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(117, 194, 199, 0.35);
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.timeline-day.has-entries .timeline-day-marker {
  background: #ee9073;
  box-shadow: 0 0 0 3px rgba(238, 144, 115, 0.12);
}

.timeline-day.is-selected .timeline-day-number {
  border-color: #76ded8;
  color: #eafffd;
  background: rgba(90, 205, 202, 0.16);
  box-shadow: 0 0 0 4px rgba(90, 205, 202, 0.08);
}

.timeline-day.is-selected .timeline-day-marker {
  background: #76ded8;
  box-shadow: 0 0 0 3px rgba(118, 222, 216, 0.14);
  transform: scale(1.15);
}

.timeline-day.is-today .timeline-day-number::after {
  position: absolute;
  top: -5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f19b76;
  content: '';
}

.minimal-scene {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(70, 154, 169, 0.22), transparent 27%),
    radial-gradient(ellipse at 50% 78%, rgba(36, 109, 125, 0.14), transparent 36%),
    #091521;
}

.minimal-scene::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  opacity: 0.38;
  background-image: linear-gradient(rgba(123, 202, 210, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(123, 202, 210, 0.045) 1px, transparent 1px);
  background-size: 68px 68px;
  content: '';
  mask-image: radial-gradient(ellipse at center, black, transparent 74%);
  pointer-events: none;
}

.minimal-scene::after {
  position: absolute;
  z-index: 0;
  bottom: -26%;
  left: 50%;
  width: min(72vw, 980px);
  height: 46%;
  border: 1px solid rgba(108, 203, 211, 0.16);
  border-radius: 50%;
  box-shadow: 0 -22px 0 -8px rgba(108, 203, 211, 0.06), 0 -48px 0 -18px rgba(108, 203, 211, 0.045);
  content: '';
  transform: translateX(-50%);
  pointer-events: none;
}

.minimal-webgl {
  position: absolute;
  z-index: 1;
  inset: 0;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.minimal-webgl.is-dragging {
  cursor: grabbing;
}

.minimal-webgl canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.minimal-model-loading,
.minimal-model-error {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px 13px;
  border: 1px solid rgba(122, 211, 215, 0.3);
  border-radius: 6px;
  color: rgba(196, 240, 239, 0.74);
  background: rgba(10, 30, 42, 0.82);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
}

.zone-guide {
  position: absolute;
  z-index: 3;
  top: 28px;
  left: clamp(18px, 3vw, 48px);
  display: none;
  width: 145px;
  padding: 12px 13px;
  border: 1px solid rgba(124, 211, 214, 0.25);
  border-radius: 8px;
  color: rgba(208, 238, 237, 0.65);
  background: rgba(9, 28, 40, 0.72);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.65;
  pointer-events: none;
}

.zone-guide.is-visible {
  display: block;
}

.zone-guide-title {
  display: block;
  margin-bottom: 4px;
  color: #75d9d5;
  font-size: 7px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.zone-guide-line {
  display: flex;
  gap: 7px;
  align-items: center;
}

.zone-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.zone-dot-frontal { background: #ef9a7d; }
.zone-dot-vertex { background: #d66e6c; }
.zone-dot-temporal { background: #d38379; }
.zone-dot-occipital { background: #bd7480; }

.zone-guide-toggle {
  position: absolute;
  z-index: 4;
  top: 28px;
  right: clamp(18px, 3vw, 48px);
  padding: 7px 9px;
  border: 1px solid rgba(125, 210, 213, 0.22);
  border-radius: 5px;
  color: rgba(200, 235, 234, 0.55);
  background: rgba(9, 28, 40, 0.52);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.zone-guide-toggle:hover,
.zone-guide-toggle[aria-pressed='true'] {
  color: #e8ffff;
  border-color: rgba(121, 222, 216, 0.6);
  background: rgba(79, 178, 180, 0.18);
}

.minimal-model-loading > span {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(117, 219, 218, 0.2);
  border-top-color: #7be1dc;
  border-radius: 50%;
  animation: modelSpin 900ms linear infinite;
}

.minimal-model-error {
  display: block;
  color: #f0b1a1;
  border-color: rgba(238, 146, 122, 0.35);
  line-height: 1.5;
  text-align: center;
}

.minimal-scene-hint,
.minimal-scene-credit {
  position: absolute;
  z-index: 3;
  color: rgba(186, 225, 226, 0.42);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}

.mark-context-modal {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 15, 24, 0.28);
  backdrop-filter: blur(5px);
}

.mark-context-card {
  width: min(440px, calc(100vw - 36px));
  padding: 23px;
  border: 1px solid rgba(149, 218, 220, 0.27);
  border-radius: 13px;
  background: rgba(11, 30, 42, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

.mark-context-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 19px;
}

.mark-context-kicker {
  color: #6cd3d1;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.mark-context-heading h2 {
  margin: 9px 0 0;
  color: #edfafa;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.08;
}

.mark-context-heading h2 em {
  color: #ee8b76;
  font-style: normal;
}

.mark-context-close {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid rgba(171, 222, 224, 0.2);
  border-radius: 50%;
  color: rgba(220, 242, 241, 0.62);
  background: transparent;
  font-size: 19px;
  line-height: 1;
}

.mark-context-close:hover {
  color: #fff;
  border-color: rgba(238, 139, 118, 0.7);
}

.context-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.context-option {
  display: grid;
  min-height: 48px;
  grid-template-columns: 25px 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  column-gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(158, 216, 218, 0.16);
  border-radius: 7px;
  color: rgba(224, 244, 243, 0.78);
  background: rgba(128, 208, 211, 0.06);
  font-size: 10px;
  text-align: left;
  transition: color 150ms ease, border 150ms ease, background 150ms ease, transform 150ms ease;
}

.context-option:hover {
  color: #fff;
  border-color: rgba(114, 219, 216, 0.65);
  background: rgba(105, 211, 208, 0.15);
  transform: translateY(-1px);
}

.context-option.is-selected {
  color: #fff;
  border-color: rgba(118, 222, 216, 0.8);
  background: rgba(105, 211, 208, 0.2);
  box-shadow: inset 0 0 0 1px rgba(118, 222, 216, 0.16);
}

.context-option-icon {
  display: grid;
  width: 24px;
  height: 24px;
  grid-row: 1 / span 2;
  place-items: center;
  border-radius: 6px;
  color: #f09b83;
  background: rgba(240, 155, 131, 0.1);
  font-family: Arial, sans-serif;
  font-size: 13px;
}

.context-option small {
  grid-column: 2;
  color: rgba(186, 222, 222, 0.48);
  font-size: 7px;
}

.itch-severity-block,
.signs-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(161, 218, 218, 0.12);
}

.itch-severity-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: rgba(231, 247, 246, 0.82);
  font-size: 9px;
  font-weight: 700;
}

.itch-severity-heading small {
  color: rgba(190, 225, 225, 0.43);
  font-size: 7px;
  font-weight: 400;
}

.itch-severity-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.severity-option {
  display: flex;
  min-height: 45px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  border: 1px solid rgba(161, 218, 218, 0.16);
  border-radius: 6px;
  color: rgba(212, 238, 237, 0.64);
  background: rgba(122, 211, 211, 0.05);
  transition: color 150ms ease, border 150ms ease, background 150ms ease;
}

.severity-option b {
  color: #ed8d76;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
}

.severity-option span {
  font-size: 7px;
}

.severity-option:hover,
.severity-option.is-selected {
  color: #fff;
  border-color: #ee8e76;
  background: rgba(238, 142, 118, 0.16);
}

.sign-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sign-option {
  padding: 6px 8px;
  border: 1px solid rgba(161, 218, 218, 0.16);
  border-radius: 5px;
  color: rgba(212, 238, 237, 0.6);
  background: rgba(122, 211, 211, 0.05);
  font-size: 8px;
  transition: color 150ms ease, border 150ms ease, background 150ms ease;
}

.sign-option:hover,
.sign-option.is-selected {
  color: #fff;
  border-color: rgba(238, 142, 118, 0.7);
  background: rgba(238, 142, 118, 0.14);
}

.save-mark-button {
  width: 100%;
  min-height: 38px;
  margin-top: 17px;
  border-radius: 6px;
  color: #0b222c;
  background: #78d7d1;
  font-size: 10px;
  font-weight: 800;
  transition: opacity 150ms ease, transform 150ms ease, background 150ms ease;
}

.save-mark-button:hover:not(:disabled) {
  background: #9ce8df;
  transform: translateY(-1px);
}

.save-mark-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.mark-tooltip {
  position: absolute;
  z-index: 7;
  min-width: 178px;
  max-width: 245px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 166, 147, 0.35);
  border-radius: 8px;
  color: #f4e9e5;
  background: rgba(21, 29, 38, 0.93);
  box-shadow: 0 13px 34px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transform: translate(12px, 12px);
}

.mark-tooltip-title {
  display: block;
  margin-bottom: 5px;
  color: #f49a80;
  font-size: 10px;
  font-weight: 700;
}

.mark-tooltip-line {
  display: block;
  color: rgba(232, 246, 244, 0.72);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.55;
}

.minimal-scene-hint {
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
}

.minimal-scene-credit {
  right: clamp(20px, 4vw, 68px);
  bottom: 28px;
  color: rgba(186, 225, 226, 0.25);
  font-size: 7px;
  text-transform: none;
}

body.minimal-mode .topbar,
body.minimal-mode > .ambient,
body.minimal-mode .main-content,
body.minimal-mode .app-footer {
  display: none !important;
}

body.minimal-mode .app-view {
  background: #091521;
}

body.minimal-mode .canvas-empty-state {
  display: none;
}

.topbar {
  display: flex;
  height: 75px;
  align-items: center;
  padding: 0 clamp(22px, 5vw, 84px);
  color: var(--white);
  background: var(--navy);
}

.topbar .brand-name {
  font-size: 16px;
}

.top-nav {
  display: flex;
  align-self: stretch;
  gap: 29px;
  margin-left: 78px;
}

.nav-item {
  position: relative;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 0 2px;
  color: rgba(223, 236, 242, 0.51);
  background: transparent;
  font-size: 10px;
  font-weight: 600;
  transition: color 160ms ease;
}

.nav-item::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--cyan);
  content: '';
  opacity: 0;
  transform: scaleX(0.3);
  transition: opacity 160ms ease, transform 160ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--white);
}

.nav-item.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-count {
  display: inline-grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border-radius: 20px;
  color: #a6e9ed;
  background: rgba(93, 212, 224, 0.14);
  font-family: var(--font-mono);
  font-size: 8px;
}

.topbar-actions {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-left: auto;
}

.save-state {
  display: flex;
  gap: 9px;
  align-items: center;
  color: rgba(216, 231, 235, 0.51);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.save-pulse {
  width: 5px;
  height: 5px;
  box-shadow: 0 0 0 3px rgba(98, 201, 179, 0.1);
}

.avatar-button {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid rgba(126, 217, 226, 0.45);
  border-radius: 50%;
  color: #b8f1f1;
  background: rgba(93, 212, 224, 0.08);
  font-family: var(--font-mono);
  font-size: 11px;
  transition: border 160ms ease, background 160ms ease, transform 160ms ease;
}

.avatar-button:hover {
  border-color: var(--cyan);
  background: rgba(93, 212, 224, 0.18);
  transform: rotate(8deg);
}

.main-content {
  width: min(100% - 48px, 1450px);
  margin: 0 auto;
  padding: 51px 0 46px;
}

.welcome-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.welcome-row h2 {
  margin: 12px 0 9px;
  color: var(--ink);
  font-size: clamp(35px, 3.2vw, 51px);
  font-weight: 600;
  line-height: 1;
}

.welcome-row h2 em {
  font-weight: 500;
}

.page-intro {
  margin: 0;
  color: #82909a;
  font-size: 11px;
  line-height: 1.6;
}

.welcome-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 1px;
}

.welcome-actions .button {
  min-height: 41px;
  font-size: 10px;
}

/* 30-day tracker */

.day-tracker {
  margin-top: 24px;
  padding: 19px 23px 15px;
  background: rgba(255, 255, 255, 0.76);
}

.day-tracker-heading,
.day-progress-row,
.day-tracker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.day-tracker-heading h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.day-tracker-heading p {
  margin: 0;
  color: #9aa6ad;
  font-size: 9px;
}

.cycle-status {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f19a72;
  box-shadow: 0 0 0 4px rgba(241, 154, 114, 0.12);
}

.day-navigation {
  display: inline-flex;
  height: 31px;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e5ebed;
  border-radius: 7px;
  background: #fbfcfc;
}

.day-nav-button,
.day-today-button {
  display: grid;
  height: 23px;
  place-items: center;
  border-radius: 4px;
  color: #84949b;
  background: transparent;
  font-size: 9px;
  transition: color 160ms ease, background 160ms ease;
}

.day-nav-button {
  width: 25px;
}

.day-nav-button svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.day-nav-button:hover:not(:disabled),
.day-today-button:hover {
  color: var(--blue-dark);
  background: #eaf7f8;
}

.day-nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.day-today-button {
  min-width: 61px;
  padding: 0 7px;
  color: #4c8990;
  background: #e7f6f5;
  font-weight: 700;
}

.day-progress-row {
  gap: 13px;
  margin-top: 18px;
}

.day-progress-label {
  display: flex;
  min-width: 146px;
  align-items: baseline;
  gap: 9px;
}

.day-progress-label strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.day-progress-label strong span {
  color: #a1adb3;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
}

.day-progress-label > span {
  overflow: hidden;
  color: #9ba7ad;
  font-family: var(--font-mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-progress {
  height: 5px;
  flex: 1;
  overflow: hidden;
  border-radius: 8px;
  background: #edf1f2;
}

.period-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #65d7d8, #f39a76);
  transition: width 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.period-percent {
  min-width: 29px;
  color: #84959b;
  font-family: var(--font-mono);
  font-size: 8px;
  text-align: right;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(30, minmax(13px, 1fr));
  gap: 4px;
  margin-top: 15px;
}

.day-cell {
  position: relative;
  display: flex;
  min-width: 0;
  height: 32px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #9eabb1;
  background: #f2f5f5;
  font-family: var(--font-mono);
  font-size: 7px;
  transition: color 160ms ease, background 160ms ease, border 160ms ease, transform 160ms ease;
}

.day-cell:hover {
  color: #368d96;
  background: #e4f5f4;
  transform: translateY(-2px);
}

.day-cell.is-selected {
  border-color: #53b9bc;
  color: #277c84;
  background: #e2f6f4;
  box-shadow: 0 0 0 2px rgba(83, 185, 188, 0.1);
}

.day-cell.is-today::before {
  position: absolute;
  top: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f19672;
  content: '';
}

.day-cell.has-entries {
  color: #4b8287;
  background: #e9f7f5;
}

.day-cell.has-entries.is-selected {
  background: #dff2f0;
}

.day-cell-count {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #62c9c1;
}

.day-cell.has-entries .day-cell-count {
  background: #ef9876;
  box-shadow: 0 0 0 2px rgba(239, 152, 118, 0.11);
}

.day-tracker-footer {
  min-height: 26px;
  margin-top: 9px;
}

.selected-day-status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: #9aa6ac;
  font-size: 8px;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #61c5bb;
}

.new-period-button {
  color: #b16e64;
}

.metric-strip {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.1fr 1fr;
  gap: 9px;
  margin-top: 35px;
}

.metric-card {
  position: relative;
  display: flex;
  min-height: 112px;
  align-items: center;
  gap: 15px;
  padding: 20px 20px;
  overflow: hidden;
  border: 1px solid #e2e8eb;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.63);
}

.metric-featured {
  border-color: rgba(255, 171, 126, 0.2);
  background: linear-gradient(115deg, rgba(255, 248, 242, 0.96), rgba(255, 255, 255, 0.68));
}

.metric-icon {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
}

.metric-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.metric-icon-warm {
  color: #ed956b;
  background: #fff0e4;
}

.metric-icon-blue {
  color: #4bafda;
  background: #e4f5fa;
}

.metric-icon-lilac {
  color: #8478dd;
  background: #eeebff;
}

.metric-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.metric-label {
  color: #82909a;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.metric-value {
  color: var(--ink);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.07em;
}

.metric-value-small {
  overflow: hidden;
  font-size: 18px;
  letter-spacing: -0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-trend,
.metric-note {
  align-self: flex-end;
  margin-left: auto;
  color: #9aa3aa;
  font-family: var(--font-mono);
  font-size: 8px;
  white-space: nowrap;
}

.metric-trend {
  align-self: center;
  color: #ed956b;
}

.last-entry-line {
  position: absolute;
  right: -12px;
  bottom: -12px;
  width: 92px;
  height: 42px;
  border-top: 1px solid rgba(97, 191, 210, 0.45);
  border-radius: 50%;
  transform: rotate(-24deg);
}

.last-entry-line::after {
  position: absolute;
  top: -5px;
  right: 24px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5cc9d9;
  box-shadow: 0 0 0 5px rgba(92, 201, 217, 0.12);
  content: '';
}

/* 3D workspace */

.workspace-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.82fr) minmax(300px, 0.78fr);
  gap: 18px;
  margin-top: 18px;
}

.viewer-card {
  min-width: 0;
  overflow: hidden;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 25px 0;
}

.card-heading h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.card-heading p {
  margin: 0;
  color: #9aa5ad;
  font-size: 9px;
  line-height: 1.5;
}

.viewer-heading {
  align-items: center;
}

.title-with-status {
  display: flex;
  gap: 9px;
  align-items: center;
}

.live-status {
  width: 5px;
  height: 5px;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(27, 158, 227, 0.1);
}

.viewer-tools {
  display: flex;
  gap: 6px;
}

.tool-button {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #9aa5ad;
  background: transparent;
  font-size: 9px;
  transition: color 160ms ease, border 160ms ease, background 160ms ease;
}

.tool-button svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.tool-button:hover,
.tool-button.is-active {
  color: var(--blue-dark);
  border-color: #d8edf3;
  background: #eef9fb;
}

.tool-icon-only {
  width: 29px;
  justify-content: center;
  padding: 0;
}

.viewer-stage {
  position: relative;
  min-height: 545px;
  margin: 16px 15px 0;
  overflow: hidden;
  border: 1px solid #e8eef0;
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 48%, rgba(207, 239, 241, 0.86), rgba(239, 247, 247, 0.66) 28%, rgba(246, 249, 249, 0.96) 59%),
    #f3f7f7;
}

.viewer-stage::before {
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image: linear-gradient(rgba(131, 178, 185, 0.13) 1px, transparent 1px), linear-gradient(90deg, rgba(131, 178, 185, 0.13) 1px, transparent 1px);
  background-size: 46px 46px;
  content: '';
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 72%);
  pointer-events: none;
}

.viewer-stage::after {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 64%;
  height: 8%;
  border-radius: 50%;
  background: rgba(52, 146, 166, 0.16);
  filter: blur(24px);
  content: '';
  transform: translate(-50%, 280%);
  pointer-events: none;
}

#headCanvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#headCanvas.is-fallback-hidden {
  display: none;
}

.head-webgl {
  position: absolute;
  z-index: 1;
  inset: 0;
  cursor: grab;
  touch-action: none;
}

.head-webgl.is-dragging {
  cursor: grabbing;
}

.head-webgl canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.model-loading,
.model-error {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid rgba(158, 205, 209, 0.55);
  border-radius: 7px;
  color: #5f9299;
  background: rgba(244, 252, 251, 0.88);
  box-shadow: 0 10px 25px rgba(48, 120, 127, 0.08);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
}

.model-error {
  display: block;
  color: #ad6f68;
  border-color: rgba(222, 166, 153, 0.5);
  background: rgba(255, 247, 244, 0.92);
  line-height: 1.55;
}

.model-loading-ring {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(84, 177, 185, 0.2);
  border-top-color: #4caeb7;
  border-radius: 50%;
  animation: modelSpin 900ms linear infinite;
}

@keyframes modelSpin {
  to { transform: rotate(360deg); }
}

#headCanvas.is-dragging {
  cursor: grabbing;
}

.stage-topline,
.stage-bottomline,
.stage-help,
.canvas-empty-state {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.stage-topline {
  top: 17px;
  right: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #93a1a7;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stage-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #50c9bb;
  box-shadow: 0 0 0 4px rgba(80, 201, 187, 0.1);
}

.view-label {
  color: #9eabb1;
}

.canvas-empty-state {
  top: 50%;
  left: 50%;
  display: flex;
  gap: 8px;
  align-items: center;
  color: rgba(63, 126, 139, 0.62);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.45;
  text-transform: uppercase;
  transform: translate(-50%, 230px);
  transition: opacity 220ms ease;
}

.head-webgl ~ .canvas-empty-state {
  z-index: 5;
}

.canvas-empty-state.is-hidden {
  opacity: 0;
}

.empty-crosshair {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid rgba(68, 161, 177, 0.58);
  border-radius: 50%;
  color: #4fa8b9;
  font-size: 16px;
  line-height: 1;
}

.stage-help {
  right: 21px;
  bottom: 69px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #a6b2b6;
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
}

.mouse-icon {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 21px;
  border: 1px solid #aab8bc;
  border-radius: 8px;
}

.mouse-icon::before {
  position: absolute;
  top: 4px;
  left: 6px;
  width: 1px;
  height: 5px;
  background: #aab8bc;
  content: '';
}

.mouse-icon i {
  position: absolute;
  top: 3px;
  left: 5px;
  width: 3px;
  height: 5px;
  border-radius: 4px;
  background: #5daeb8;
  animation: scrollHint 1.8s ease-in-out infinite;
}

@keyframes scrollHint {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(5px); opacity: 0.25; }
}

.stage-bottomline {
  right: 20px;
  bottom: 16px;
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.orientation-controls {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(207, 221, 223, 0.82);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
  pointer-events: auto;
}

.orientation-button {
  min-height: 23px;
  padding: 0 8px;
  border-radius: 4px;
  color: #9aa8ad;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
  transition: color 160ms ease, background 160ms ease;
}

.orientation-button:hover,
.orientation-button.is-active {
  color: #267d8e;
  background: #e3f4f4;
}

.zoom-controls {
  display: inline-flex;
  height: 27px;
  align-items: center;
  border: 1px solid rgba(207, 221, 223, 0.82);
  border-radius: 6px;
  color: #8b9ca0;
  background: rgba(255, 255, 255, 0.65);
  font-family: var(--font-mono);
  font-size: 8px;
  pointer-events: auto;
}

.zoom-controls button {
  display: grid;
  width: 27px;
  height: 25px;
  place-items: center;
  color: #7b9299;
  background: transparent;
  font-size: 16px;
  line-height: 1;
}

.zoom-controls button:hover {
  color: var(--blue-dark);
  background: #eaf7f8;
}

.zoom-controls span {
  min-width: 39px;
  text-align: center;
}

.viewer-footer {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 25px;
}

.model-credit {
  margin-left: auto;
  color: #b1bcc0;
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.viewer-legend-copy {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #9aa5ad;
  font-size: 9px;
}

.legend-pulse {
  width: 5px;
  height: 5px;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(27, 158, 227, 0.1);
}

/* Insight cards */

.insights-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}

.intensity-card,
.zones-card {
  padding-bottom: 18px;
}

.compact-heading {
  padding: 22px 22px 0;
}

.compact-heading h3 {
  font-size: 13px;
}

.info-mark {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid #d8e0e4;
  border-radius: 50%;
  color: #9aa6ad;
  font-family: Georgia, serif;
  font-size: 11px;
  cursor: help;
}

.intensity-scale {
  padding: 26px 22px 17px;
}

.scale-bar {
  display: flex;
  gap: 3px;
  height: 6px;
}

.scale-bar span {
  flex: 1;
  border-radius: 5px;
  transform: skewX(-19deg);
}

.scale-bar span:nth-child(1) { background: #bce9ed; }
.scale-bar span:nth-child(2) { background: #80dce4; }
.scale-bar span:nth-child(3) { background: #54c1d2; }
.scale-bar span:nth-child(4) { background: #279fc1; }
.scale-bar span:nth-child(5) { background: #f48c75; }

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  color: #a5afb4;
  font-family: var(--font-mono);
  font-size: 8px;
}

.intensity-readout {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 14px;
  margin: 0 22px;
  padding: 0 14px;
  border: 1px solid #e9edef;
  border-radius: 8px;
  background: #fbfcfc;
}

.readout-orb {
  display: inline-block;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 7px solid rgba(100, 225, 240, 0.23);
  border-radius: 50%;
  background: #6bd5df;
  box-shadow: 0 0 0 5px rgba(100, 225, 240, 0.08);
}

.intensity-readout strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.intensity-readout small {
  display: block;
  color: #9aa6ad;
  font-size: 8px;
}

.small-count {
  color: #a0abb2;
  font-family: var(--font-mono);
  font-size: 8px;
}

.zone-list {
  display: flex;
  min-height: 174px;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 23px 22px 5px;
}

.zone-empty {
  display: flex;
  min-height: 126px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #a7b1b6;
  text-align: center;
}

.zone-empty-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px dashed #b9dfe1;
  border-radius: 50%;
  color: #6cbfc8;
  font-size: 15px;
}

.zone-empty span:last-child {
  max-width: 180px;
  font-size: 9px;
  line-height: 1.45;
}

.zone-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.9fr) minmax(80px, 1.4fr) auto;
  gap: 10px;
  align-items: center;
}

.zone-row-label {
  overflow: hidden;
  color: #697984;
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zone-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: #edf1f2;
}

.zone-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #64d8e1, #f78a76);
  transition: width 450ms cubic-bezier(0.22, 1, 0.36, 1);
}

.zone-row-count {
  min-width: 28px;
  color: #8d9aa2;
  font-family: var(--font-mono);
  font-size: 8px;
  text-align: right;
}

.privacy-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid rgba(145, 218, 218, 0.35);
  border-radius: 10px;
  background: linear-gradient(115deg, rgba(232, 250, 248, 0.9), rgba(244, 250, 250, 0.8));
}

.privacy-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #4eb5ad;
  background: rgba(98, 201, 179, 0.13);
}

.privacy-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.privacy-card strong {
  display: block;
  margin: 1px 0 5px;
  color: #467d7c;
  font-size: 10px;
}

.privacy-card p {
  margin: 0;
  color: #78a2a1;
  font-size: 8px;
  line-height: 1.5;
}

/* Bottom history */

.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.82fr) minmax(300px, 0.78fr);
  gap: 18px;
  margin-top: 18px;
}

.history-card {
  min-height: 240px;
  overflow: hidden;
}

.history-list {
  display: flex;
  flex-direction: column;
  padding: 16px 25px 18px;
}

.history-empty {
  display: flex;
  min-height: 125px;
  align-items: center;
  justify-content: center;
  color: #a4afb5;
  font-size: 10px;
  text-align: center;
}

.history-row {
  display: grid;
  grid-template-columns: 36px minmax(100px, 0.7fr) minmax(150px, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 47px;
  border-bottom: 1px solid #eef1f2;
}

.history-row:last-child {
  border-bottom: 0;
}

.history-dot {
  position: relative;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  color: #218da5;
  background: #e3f5f5;
  font-family: var(--font-mono);
  font-size: 8px;
}

.history-dot::after {
  position: absolute;
  inset: -3px;
  border: 1px solid rgba(79, 193, 204, 0.22);
  border-radius: 50%;
  content: '';
}

.history-time {
  color: #77868f;
  font-family: var(--font-mono);
  font-size: 9px;
}

.history-zone {
  color: #61717d;
  font-size: 10px;
  font-weight: 600;
}

.history-intensity {
  color: #a0abb2;
  font-family: var(--font-mono);
  font-size: 8px;
  text-align: right;
}

.doctor-card {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  padding: 23px 25px;
  border-radius: 12px;
  color: var(--white);
  background: linear-gradient(137deg, #15546a 0%, #1a8191 53%, #66c6c3 140%);
  box-shadow: 0 16px 34px rgba(33, 128, 143, 0.16);
}

.doctor-card::after {
  position: absolute;
  right: -22px;
  bottom: -76px;
  width: 250px;
  height: 180px;
  border: 1px solid rgba(184, 246, 241, 0.27);
  border-radius: 50%;
  box-shadow: 0 -22px 0 -10px rgba(184, 246, 241, 0.1), 0 -42px 0 -20px rgba(184, 246, 241, 0.08);
  content: '';
  transform: rotate(-14deg);
}

.doctor-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doctor-kicker {
  color: rgba(226, 252, 249, 0.68);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.doctor-spark {
  color: #baf4ec;
  font-size: 18px;
}

.doctor-card h3 {
  position: relative;
  z-index: 1;
  margin: 27px 0 12px;
  color: var(--white);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.08;
}

.doctor-card h3 em {
  color: #c0f7f0;
  font-weight: 500;
}

.doctor-card p {
  position: relative;
  z-index: 1;
  max-width: 285px;
  margin-bottom: 21px;
  color: rgba(230, 252, 249, 0.7);
  font-size: 9px;
  line-height: 1.65;
}

.doctor-card .button {
  position: relative;
  z-index: 1;
  min-height: 38px;
  padding: 0 14px;
  font-size: 9px;
}

.app-footer {
  display: flex;
  width: min(100% - 48px, 1450px);
  min-height: 66px;
  align-items: center;
  gap: 15px;
  margin: 0 auto;
  color: #a2adb3;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.footer-separator {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #b5c0c4;
}

.app-footer button {
  padding: 0;
  color: #9aa6ad;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
}

.app-footer button:hover {
  color: var(--blue-dark);
}

/* Modal and toast */

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  overflow: auto;
  padding: 28px;
  place-items: center;
  background: rgba(12, 25, 36, 0.62);
  backdrop-filter: blur(8px);
  animation: fadeIn 180ms ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.doctor-modal {
  width: min(100%, 700px);
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding: 30px 32px 27px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 15px;
  background: #fbfcfc;
  box-shadow: 0 30px 100px rgba(5, 19, 31, 0.28);
  animation: modalUp 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.modal-header h2 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 32px;
  font-weight: 600;
}

.modal-close {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid #e0e7e9;
  border-radius: 50%;
  color: #8c9ba2;
  background: white;
  transition: color 160ms ease, border 160ms ease, transform 160ms ease;
}

.modal-close:hover {
  color: var(--orange);
  border-color: #f3c4b7;
  transform: rotate(90deg);
}

.modal-close svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.5;
}

.report-meta {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 13px 15px;
  border: 1px solid #d5eeee;
  border-radius: 8px;
  color: #639296;
  background: #f0fbfa;
}

.report-meta-icon {
  color: #50b7b5;
  font-size: 15px;
  line-height: 1;
}

.report-meta p {
  margin: 0;
  font-size: 9px;
  line-height: 1.55;
}

.report-meta strong {
  color: #398184;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 16px;
}

.report-stats > div {
  display: flex;
  min-height: 70px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid #e7ecee;
  border-radius: 8px;
  background: white;
}

.report-stats span {
  color: #98a5ac;
  font-size: 8px;
}

.report-stats strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
}

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

.report-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.report-section-title h3 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.report-section-title span {
  color: #a0acb1;
  font-family: var(--font-mono);
  font-size: 8px;
  text-transform: uppercase;
}

.report-zone-rows,
.report-history-rows {
  border: 1px solid #e8edef;
  border-radius: 8px;
  background: white;
}

.report-zone-row {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  gap: 12px;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border-bottom: 1px solid #eff2f3;
}

.report-zone-row:last-child,
.report-history-row:last-child {
  border-bottom: 0;
}

.report-zone-row > span:first-child {
  overflow: hidden;
  color: #667781;
  font-size: 9px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-bar {
  height: 5px;
  overflow: hidden;
  border-radius: 4px;
  background: #edf1f2;
}

.report-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5bcbd5, #f28b78);
}

.report-zone-row > span:last-child {
  color: #84939b;
  font-family: var(--font-mono);
  font-size: 8px;
  text-align: right;
}

.report-history-row {
  display: grid;
  grid-template-columns: 100px 1fr 70px;
  gap: 12px;
  align-items: center;
  min-height: 35px;
  padding: 0 13px;
  border-bottom: 1px solid #eff2f3;
}

.report-history-row span {
  color: #84939b;
  font-family: var(--font-mono);
  font-size: 8px;
}

.report-history-row strong {
  overflow: hidden;
  color: #667781;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-history-row span:last-child {
  color: #b08b7d;
  text-align: right;
}

.report-empty {
  padding: 18px;
  color: #9ba8ae;
  font-size: 9px;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 9px;
  margin-top: 25px;
}

.modal-actions .button {
  min-height: 40px;
  font-size: 9px;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 26px;
  bottom: 25px;
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 190px;
  padding: 12px 15px;
  border: 1px solid rgba(137, 211, 207, 0.38);
  border-radius: 9px;
  color: #427e7c;
  background: rgba(244, 255, 253, 0.95);
  box-shadow: 0 16px 35px rgba(15, 69, 78, 0.15);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #59b9ae;
  font-size: 11px;
}

/* Responsive */

@media (max-width: 1100px) {
  .login-view {
    grid-template-columns: minmax(330px, 0.8fr) minmax(440px, 1.2fr);
  }

  .login-aside {
    padding-right: 35px;
    padding-left: 35px;
  }

  .login-content {
    padding-right: 6vw;
    padding-left: 6vw;
  }

  .top-nav {
    margin-left: 45px;
  }

  .main-content,
  .app-footer {
    width: min(100% - 34px, 1450px);
  }

  .metric-card {
    padding-right: 13px;
    padding-left: 13px;
  }

  .metric-trend,
  .metric-note {
    display: none;
  }

  .viewer-stage {
    min-height: 500px;
  }
}

@media (max-width: 860px) {
  .login-view {
    display: block;
  }

  .login-aside {
    display: none;
  }

  .login-content {
    min-height: 100vh;
    padding: 38px 25px;
  }

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

  .login-copy {
    margin-top: 73px;
  }

  .login-footer {
    margin-top: 70px;
  }

  .topbar {
    padding: 0 18px;
  }

  .top-nav {
    gap: 16px;
    margin-left: 30px;
  }

  .save-state {
    display: none;
  }

  .main-content,
  .app-footer {
    width: min(100% - 28px, 700px);
  }

  .welcome-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome-actions {
    width: 100%;
  }

  .welcome-actions .button {
    flex: 1;
  }

  .day-tracker {
    padding-right: 17px;
    padding-left: 17px;
  }

  .day-tracker-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .day-navigation {
    align-self: flex-end;
  }

  .day-strip {
    gap: 3px;
  }

  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .workspace-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .insights-column {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .privacy-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .minimal-login-form {
    align-items: center;
    flex-direction: column;
    gap: 8px;
  }

  .minimal-password-input {
    width: min(300px, calc(100vw - 40px));
  }

  .minimal-continue-button {
    width: min(300px, calc(100vw - 40px));
    height: 46px;
    margin-left: 0;
  }

  .minimal-login-error {
    top: calc(50% + 74px);
  }
  .minimal-topline {
    height: 59px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .minimal-brand {
    font-size: 12px;
  }

  .minimal-local-status {
    font-size: 7px;
  }

  .timeline-reading {
    gap: 7px;
    font-size: 8px;
  }

  .minimal-timeline {
    height: 70px;
    gap: 1px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .minimal-timeline::before {
    right: 10px;
    bottom: 23px;
    left: 10px;
  }

  .timeline-day {
    width: calc((100vw - 20px) / 15);
    height: 46px;
    font-size: 7px;
  }

  .timeline-day-number {
    width: 20px;
    height: 20px;
  }

  .minimal-scene-hint {
    bottom: 21px;
    width: 100%;
    text-align: center;
  }

  .minimal-scene-credit {
    right: 13px;
    bottom: 8px;
    font-size: 6px;
  }

  .mark-context-card {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 18px 14px;
  }

  .mark-context-heading h2 {
    font-size: 21px;
  }

  .zone-guide {
    top: 17px;
    left: 12px;
  }

  .zone-guide-toggle {
    top: 17px;
    right: 12px;
  }

  .context-options {
    gap: 5px;
  }

  .context-option {
    min-height: 44px;
    padding-right: 7px;
    padding-left: 7px;
    font-size: 9px;
  }

  .mark-context-modal {
    align-items: start;
    overflow-y: auto;
    padding: 12px;
  }

  .itch-severity-heading {
    display: block;
  }

  .itch-severity-heading small {
    display: block;
    margin-top: 4px;
  }

  .severity-option span {
    font-size: 6px;
  }

  body.minimal-mode .minimal-scene {
    min-height: calc(100vh - 129px);
  }

  body.minimal-mode .minimal-webgl {
    height: calc(100dvh - 129px);
  }

  .topbar {
    height: 64px;
  }

  .topbar .brand-name {
    font-size: 14px;
  }

  .top-nav {
    gap: 13px;
    margin-left: 22px;
  }

  .nav-item {
    font-size: 9px;
  }

  .topbar-actions {
    gap: 0;
  }

  .main-content {
    padding-top: 35px;
  }

  .welcome-row h2 {
    font-size: 38px;
  }

  .welcome-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .welcome-actions .button {
    flex: unset;
  }

  .day-tracker {
    padding: 16px 12px 12px;
  }

  .day-tracker-heading {
    gap: 12px;
  }

  .day-tracker-heading p {
    max-width: 220px;
    line-height: 1.45;
  }

  .day-progress-row {
    gap: 8px;
  }

  .day-progress-label {
    min-width: 83px;
    display: block;
  }

  .day-progress-label > span {
    display: block;
    margin-top: 4px;
    max-width: 83px;
  }

  .day-strip {
    grid-template-columns: repeat(15, minmax(13px, 1fr));
    row-gap: 5px;
  }

  .day-cell {
    height: 29px;
  }

  .metric-strip {
    gap: 7px;
  }

  .metric-card {
    min-height: 100px;
    gap: 9px;
    padding: 14px 11px;
  }

  .metric-icon {
    width: 32px;
    height: 32px;
  }

  .metric-icon svg {
    width: 17px;
    height: 17px;
  }

  .metric-label {
    font-size: 8px;
  }

  .metric-value {
    font-size: 22px;
  }

  .metric-value-small {
    font-size: 14px;
  }

  .card-heading {
    padding-right: 17px;
    padding-left: 17px;
  }

  .viewer-tools .tool-button span {
    display: none;
  }

  .viewer-stage {
    min-height: 450px;
    margin-right: 9px;
    margin-left: 9px;
  }

  .stage-help {
    display: none;
  }

  .stage-bottomline {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .orientation-controls {
    gap: 0;
  }

  .orientation-button {
    padding: 0 5px;
    font-size: 7px;
  }

  .viewer-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 17px;
  }

  .model-credit {
    margin-left: 0;
    white-space: normal;
  }

  .insights-column {
    display: flex;
  }

  .history-row {
    grid-template-columns: 32px 72px minmax(0, 1fr);
    gap: 9px;
    padding: 4px 0;
  }

  .history-intensity {
    display: none;
  }

  .history-list {
    padding-right: 17px;
    padding-left: 17px;
  }

  .doctor-card {
    min-height: 235px;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 17px 0 20px;
  }

  .footer-separator {
    display: none;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .doctor-modal {
    padding: 22px 17px;
  }

  .modal-header h2 {
    font-size: 27px;
  }

  .report-stats {
    gap: 5px;
  }

  .report-stats > div {
    padding: 0 9px;
  }

  .report-stats span {
    min-height: 20px;
    line-height: 1.3;
  }

  .report-zone-row {
    grid-template-columns: 84px 1fr 25px;
    gap: 7px;
    padding: 0 9px;
  }

  .report-history-row {
    grid-template-columns: 70px 1fr 54px;
    gap: 7px;
    padding: 0 9px;
  }

  .modal-actions {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.is-locked {
  overflow: hidden;
}

body.is-locked .app-view {
  display: none;
}

body.is-locked .toast {
  display: none;
}
