:root {
  --ink: #f5f7ff;
  --text: #e7ecff;
  --muted: #a8b2cf;
  --faint: #77819e;
  --night: #070913;
  --night-2: #0d1122;
  --panel: rgba(18, 23, 42, 0.78);
  --panel-solid: #151a2c;
  --panel-strong: rgba(23, 30, 54, 0.92);
  --line: rgba(190, 210, 255, 0.18);
  --line-bright: rgba(207, 226, 255, 0.34);
  --violet: #b69cff;
  --cyan: #73d9ff;
  --mint: #87f0c5;
  --rose: #ff8db8;
  --amber: #ffd27d;
  --danger: #ff7b8a;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--night);
}

body {
  margin: 0;
  min-width: 1120px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 48% -10%, rgba(70, 94, 166, 0.26), transparent 38%),
    linear-gradient(145deg, #070913 0%, #0b1021 48%, #080a15 100%);
  font-family: "Microsoft YaHei UI", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.46) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.46) 1px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: overlay;
}

.welcome-intro {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.05), transparent 34%),
    #000;
  overflow: hidden;
  cursor: pointer;
  animation: welcomeExit 2.42s ease-in-out forwards;
}

.welcome-intro::before {
  content: "";
  position: absolute;
  inset: -20%;
  opacity: 0.14;
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 12px),
    radial-gradient(circle, rgba(255, 255, 255, 0.28) 0 1px, transparent 1px 9px);
  filter: blur(0.2px);
  transform: rotate(-8deg);
}

.welcome-intro.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.welcome-ink {
  position: relative;
  width: min(88vw, 1080px);
  height: auto;
  overflow: visible;
}

.welcome-lottie {
  position: relative;
  z-index: 2;
  width: min(88vw, 1060px);
  height: min(48vw, 460px);
}

.welcome-fallback {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  display: grid;
  gap: 22px;
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

.welcome-fallback span,
.welcome-fallback strong {
  color: rgba(255, 255, 255, 0.96);
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-shadow:
    2px 0 #6ee7ff,
    -2px 0 #ff7dad,
    0 2px #ffd36f,
    0 0 34px rgba(255, 255, 255, 0.16);
  animation: fallbackWrite 1.38s ease-out both;
}

.welcome-fallback span {
  font-size: clamp(46px, 8vw, 108px);
  font-weight: 720;
}

.welcome-fallback strong {
  font-size: clamp(62px, 10vw, 136px);
  font-weight: 760;
  animation-delay: 0.24s;
}

@keyframes fallbackWrite {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

.ink-line,
.ink-name,
.ink-fill,
.ink-name-fill {
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke fill;
}

.ink-line,
.ink-name {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1500;
  stroke-dashoffset: 1500;
  animation: pencilWrite 1.45s cubic-bezier(0.65, 0, 0.2, 1) forwards;
}

.ink-line {
  font-family: "Segoe Script", "Comic Sans MS", "Bradley Hand ITC", cursive;
  font-size: 112px;
  font-weight: 600;
  stroke-width: 5;
}

.ink-name {
  font-family: "Segoe Script", "Comic Sans MS", "Bradley Hand ITC", cursive;
  font-size: 128px;
  font-weight: 600;
  stroke-width: 5.5;
  animation-delay: 0.25s;
}

.ink-shadow {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 9;
  filter: blur(1.8px);
}

.ink-cyan {
  stroke: #6ee7ff;
}

.ink-rose {
  stroke: #ff7dad;
  animation-delay: 0.06s;
}

.ink-amber {
  stroke: #ffd36f;
  animation-delay: 0.12s;
}

.ink-name.ink-cyan {
  animation-delay: 0.25s;
}

.ink-name.ink-rose {
  animation-delay: 0.31s;
}

.ink-name.ink-amber {
  animation-delay: 0.36s;
}

.ink-fill,
.ink-name-fill {
  fill: rgba(255, 255, 255, 0);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  animation: welcomeFill 0.62s ease 1.45s forwards;
}

.ink-fill {
  font-size: 110px;
}

.ink-name-fill {
  font-size: 124px;
}

@keyframes pencilWrite {
  0% {
    stroke-dashoffset: 1500;
    opacity: 0.18;
  }
  18% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes welcomeFill {
  from {
    fill: rgba(255, 255, 255, 0);
    filter: blur(8px);
  }
  to {
    fill: rgba(255, 255, 255, 0.94);
    filter: blur(0);
  }
}

@keyframes welcomeExit {
  0%,
  78% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

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

button {
  cursor: pointer;
}

.ambient-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 115%, rgba(115, 217, 255, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(10, 13, 30, 0.25), rgba(5, 7, 15, 0.9));
}

.ambient-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0 42%, rgba(2, 4, 11, 0.58) 100%);
}

.glow {
  position: absolute;
  display: block;
  border-radius: 999px;
  filter: blur(68px);
  opacity: 0.58;
  mix-blend-mode: screen;
  animation: slowDrift 14s ease-in-out infinite alternate;
}

.glow-a {
  width: 520px;
  height: 310px;
  left: -120px;
  top: 8%;
  background: rgba(130, 114, 255, 0.55);
}

.glow-b {
  width: 420px;
  height: 420px;
  right: 4%;
  top: -90px;
  background: rgba(95, 207, 255, 0.44);
  animation-duration: 16s;
  animation-delay: -5s;
}

.glow-c {
  width: 460px;
  height: 300px;
  right: 18%;
  bottom: 8%;
  background: rgba(255, 116, 174, 0.34);
  animation-duration: 13s;
  animation-delay: -2s;
}

.glow-d {
  width: 340px;
  height: 340px;
  left: 24%;
  bottom: -120px;
  background: rgba(104, 255, 194, 0.28);
  animation-duration: 15s;
  animation-delay: -8s;
}

@keyframes slowDrift {
  from {
    transform: translate3d(-18px, -10px, 0) scale(0.98);
  }
  to {
    transform: translate3d(26px, 24px, 0) scale(1.08);
  }
}

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 334px 1fr;
  min-height: 100vh;
}

.floating-coach {
  --coach-x: calc(100vw - 260px);
  --coach-y: calc(100vh - 250px);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9;
  display: grid;
  justify-items: center;
  width: 220px;
  pointer-events: none;
  transform: translate3d(var(--coach-x), var(--coach-y), 0);
  transition: filter 0.25s ease;
  will-change: transform;
}

.floating-coach.is-reminding {
  filter: drop-shadow(0 0 26px rgba(115, 217, 255, 0.28));
}

.coach-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(9, 12, 25, 0.72);
  backdrop-filter: blur(26px) saturate(125%);
  overflow-y: auto;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo,
.brand-mark .dot {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, #fff 0 7%, transparent 8%),
    conic-gradient(from 210deg, var(--cyan), var(--violet), var(--rose), var(--mint), var(--cyan));
  box-shadow: 0 0 32px rgba(115, 217, 255, 0.36);
}

.brand-logo {
  display: block;
  object-fit: cover;
  border-radius: 10px;
}

.brand-mark strong,
.brand-mark small {
  display: block;
}

.brand-mark strong {
  color: var(--ink);
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-mark small,
.eyebrow,
.metric-tile span,
.metric-tile small,
label,
.mini-stats,
.estimate-card span {
  color: var(--muted);
  font-size: 12px;
}

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

.cloud-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(154, 202, 255, 0.18);
  border-radius: 10px;
  background:
    radial-gradient(circle at 16% 0%, rgba(111, 211, 255, 0.14), transparent 42%),
    rgba(255, 255, 255, 0.065);
}

.cloud-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cloud-head strong,
.cloud-account span {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.sync-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(144, 160, 184, 0.85);
  box-shadow: 0 0 0 6px rgba(144, 160, 184, 0.1);
}

.sync-dot.is-on {
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(37, 212, 147, 0.14), 0 0 22px rgba(37, 212, 147, 0.38);
}

.sync-dot.is-busy {
  animation: syncPulse 1.1s ease-in-out infinite;
}

.cloud-form,
.cloud-account {
  display: grid;
  gap: 8px;
}

.cloud-form input {
  min-height: 38px;
  border-radius: 8px;
  font-size: 13px;
}

.cloud-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cloud-actions button {
  min-height: 36px;
  border: 1px solid rgba(154, 202, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.cloud-actions button:hover {
  border-color: rgba(115, 217, 255, 0.48);
  background: rgba(115, 217, 255, 0.12);
}

@keyframes syncPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.68;
  }
  50% {
    transform: scale(1.22);
    opacity: 1;
  }
}

.cat-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 250px;
  border: 1px solid rgba(190, 210, 255, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 210, 125, 0.18), transparent 32%),
    radial-gradient(circle at 70% 18%, rgba(182, 156, 255, 0.22), transparent 34%),
    rgba(18, 23, 42, 0.82);
  box-shadow: 0 0 44px rgba(182, 156, 255, 0.1), var(--shadow);
  overflow: hidden;
  cursor: crosshair;
  perspective: 760px;
  isolation: isolate;
}

.floating-coach .cat-stage {
  width: 160px;
  min-height: 132px;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  pointer-events: auto;
}

.cat-stage::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  filter: blur(0.2px);
}

.floating-coach .cat-stage::before {
  display: none;
}

.cat-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 19px;
  width: 180px;
  height: 24px;
  background: rgba(6, 8, 18, 0.5);
  border-radius: 50%;
  filter: blur(9px);
  transform: translateX(-50%);
}

.floating-coach .cat-stage::after {
  bottom: 3px;
  width: 92px;
  height: 13px;
  background: rgba(6, 8, 18, 0.48);
}

.ragdoll-scene {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 250px;
  height: 222px;
  transform-style: preserve-3d;
}

.ragdoll-cat {
  --cat-tilt-x: 0deg;
  --cat-tilt-y: 0deg;
  --head-x: 0px;
  --head-y: 0px;
  --pupil-x: 0px;
  --pupil-y: 0px;
  --tail-swing: 0deg;
  position: relative;
  width: 232px;
  height: 216px;
  transform: rotateX(var(--cat-tilt-x)) rotateY(var(--cat-tilt-y));
  transform-style: preserve-3d;
  transition: transform 0.28s ease-out;
  filter: drop-shadow(0 24px 26px rgba(0, 0, 0, 0.38));
}

.cat-ground,
.cat-tail,
.cat-body,
.cat-ruff,
.cat-paw,
.cat-head,
.cat-ear,
.face-mask,
.muzzle,
.eye,
.nose,
.mouth,
.whiskers {
  position: absolute;
  display: block;
}

.fur::before {
  content: "";
  position: absolute;
  inset: -8%;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.42;
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, 0.58) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 34%, rgba(255, 255, 255, 0.32) 0 1px, transparent 2px),
    radial-gradient(circle at 36% 72%, rgba(123, 91, 75, 0.16) 0 1px, transparent 2px);
  background-size: 18px 16px, 24px 20px, 16px 22px;
  mix-blend-mode: soft-light;
}

.cat-ground {
  left: 50%;
  bottom: 7px;
  width: 162px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(116, 217, 255, 0.22), transparent 68%);
  filter: blur(8px);
  transform: translateX(-50%) translateZ(-40px);
}

.cat-tail {
  right: 22px;
  bottom: 40px;
  width: 54px;
  height: 132px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 52% 18%, rgba(255, 255, 255, 0.26), transparent 20%),
    linear-gradient(100deg, #6d554e, #b59482 52%, #51423f);
  box-shadow: inset 12px 0 22px rgba(255, 255, 255, 0.16), inset -10px -10px 22px rgba(35, 23, 26, 0.32);
  transform: rotate(24deg) translateZ(-28px);
  transform-origin: 50% 92%;
  animation: ragdollTail 5s ease-in-out infinite;
}

.cat-body {
  left: 54px;
  bottom: 12px;
  width: 128px;
  height: 136px;
  border-radius: 47% 47% 42% 42%;
  background:
    radial-gradient(circle at 38% 22%, #fff9e8 0 12%, transparent 33%),
    radial-gradient(circle at 52% 58%, #fff1d3 0 20%, transparent 56%),
    linear-gradient(145deg, #d2b4a4, #f4dfc6 44%, #a98276 100%);
  box-shadow: inset 18px 0 30px rgba(255, 255, 255, 0.28), inset -18px -12px 34px rgba(71, 49, 54, 0.28);
  transform: translateZ(4px);
}

.cat-ruff {
  left: 62px;
  top: 72px;
  width: 108px;
  height: 92px;
  border-radius: 48% 48% 42% 42%;
  background:
    radial-gradient(circle at 50% 32%, #fffaf0, transparent 34%),
    linear-gradient(160deg, #f5e4cf, #c8a795);
  clip-path: polygon(50% 0, 62% 16%, 84% 10%, 77% 31%, 98% 42%, 77% 51%, 88% 76%, 63% 71%, 51% 100%, 38% 72%, 12% 78%, 24% 52%, 2% 42%, 24% 30%, 16% 10%, 39% 16%);
  opacity: 0.95;
  transform: translateZ(16px);
}

.cat-paw {
  bottom: 12px;
  width: 43px;
  height: 34px;
  border-radius: 48% 48% 38% 38%;
  background: linear-gradient(155deg, #f6dcc4, #9b796f);
  box-shadow: inset 8px 2px 14px rgba(255, 255, 255, 0.18);
  transform: translateZ(32px);
}

.paw-left {
  left: 72px;
}

.paw-right {
  right: 66px;
}

.cat-head {
  left: 50%;
  top: 28px;
  width: 122px;
  height: 112px;
  border-radius: 48% 48% 45% 45%;
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.72), transparent 20%),
    linear-gradient(145deg, #f3ddc4, #b89585 54%, #7b5c55);
  box-shadow: inset 18px 6px 28px rgba(255, 255, 255, 0.28), inset -20px -16px 30px rgba(56, 39, 45, 0.28);
  transform: translateX(calc(-50% + var(--head-x))) translateY(var(--head-y)) translateZ(54px);
  transform-style: preserve-3d;
  transition: transform 0.24s ease-out;
}

.cat-ear {
  top: -21px;
  width: 45px;
  height: 50px;
  border-radius: 12px 12px 8px 8px;
  background: linear-gradient(145deg, #75544d, #c1a08d 68%, #604842);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: translateZ(-3px);
}

.cat-ear i {
  position: absolute;
  left: 12px;
  top: 18px;
  width: 21px;
  height: 23px;
  background: rgba(255, 189, 197, 0.44);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: blur(0.2px);
}

.ear-left {
  left: 12px;
  transform: rotate(-16deg) translateZ(-3px);
}

.ear-right {
  right: 12px;
  transform: rotate(16deg) translateZ(-3px);
}

.face-mask {
  left: 27px;
  top: 31px;
  width: 68px;
  height: 65px;
  border-radius: 48% 48% 52% 52%;
  background:
    radial-gradient(circle at 50% 75%, rgba(248, 224, 204, 0.84), transparent 30%),
    linear-gradient(160deg, #6b4f4a, #9b766b 58%, #5a4743);
  opacity: 0.92;
  transform: translateZ(4px);
}

.muzzle {
  left: 38px;
  top: 67px;
  width: 46px;
  height: 28px;
  border-radius: 52% 52% 48% 48%;
  background: rgba(255, 229, 207, 0.78);
  box-shadow: 0 0 14px rgba(255, 241, 225, 0.28);
  transform: translateZ(9px);
}

.eye {
  top: 51px;
  width: 20px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, #f7fdff 0 8%, transparent 9%),
    radial-gradient(circle at 55% 58%, #2c4e80 0 21%, #80d8ff 22% 52%, #235086 53% 72%, #101624 73%);
  box-shadow: 0 0 12px rgba(115, 217, 255, 0.42);
  overflow: hidden;
  transform: translateZ(14px);
}

.eye i {
  position: absolute;
  left: 7px;
  top: 6px;
  width: 7px;
  height: 8px;
  border-radius: 50%;
  background: #05070d;
  transform: translate(var(--pupil-x), var(--pupil-y));
  transition: transform 0.12s ease-out;
}

.eye-left {
  left: 35px;
}

.eye-right {
  right: 35px;
}

.nose {
  left: 56px;
  top: 76px;
  width: 12px;
  height: 9px;
  border-radius: 55% 55% 65% 65%;
  background: #4c3032;
  transform: translateZ(16px);
}

.mouth {
  left: 57px;
  top: 86px;
  width: 10px;
  height: 9px;
  border-bottom: 2px solid rgba(54, 35, 38, 0.78);
  border-radius: 50%;
  transform: translateZ(16px);
}

.whiskers {
  top: 73px;
  width: 42px;
  height: 26px;
  border-top: 1px solid rgba(255, 245, 231, 0.72);
  border-bottom: 1px solid rgba(255, 245, 231, 0.5);
  transform: translateZ(18px);
}

.whiskers::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  border-top: 1px solid rgba(255, 245, 231, 0.58);
}

.whiskers-left {
  left: -18px;
  transform: rotate(-10deg) translateZ(18px);
}

.whiskers-right {
  right: -18px;
  transform: rotate(10deg) translateZ(18px);
}

.cat-stage:hover .cat-head {
  filter: brightness(1.07);
}

@keyframes ragdollTail {
  0%,
  100% {
    transform: rotate(22deg) translateZ(-28px);
  }
  50% {
    transform: rotate(31deg) translateZ(-28px);
  }
}

.lixia-cat-sprite {
  --cat-direction: 1;
  --gaze-x: 0px;
  --gaze-y: 0px;
  position: relative;
  width: 280px;
  height: 220px;
  transform: scaleX(var(--cat-direction));
  transform-origin: 50% 84%;
  will-change: transform;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.3));
}

.hatch-pet {
  position: relative;
  width: 96px;
  height: 104px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 9px 8px rgba(0, 0, 0, 0.34));
  transform-origin: 50% 88%;
}

.hatch-pet-frame {
  width: 192px;
  height: 208px;
  background-image: url("./vendor/hatch-pet/ragdou/spritesheet.webp");
  background-repeat: no-repeat;
  background-size: 1536px 1872px;
  transform: scale(0.5);
  transform-origin: 0 0;
}

.floating-coach.action-sleep .hatch-pet {
  animation: hatchPetSleep 2.8s ease-in-out infinite;
}

.floating-coach.mouse-near .hatch-pet {
  animation: hatchPetHello 0.9s ease-in-out infinite;
}

@keyframes hatchPetSleep {
  0%,
  100% {
    transform: scale(1, 1) translateY(0);
  }
  50% {
    transform: scale(1.02, 0.97) translateY(2px);
  }
}

@keyframes hatchPetHello {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-4deg) translateY(-2px);
  }
}

.lixia-cat-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.lixia-cat-svg * {
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
}

.lixia-shadow {
  fill: rgba(4, 8, 16, 0.36);
  filter: blur(4px);
}

.body-fur,
.head-fur,
.lixia-front-leg-front path:first-child,
.lixia-front-leg-back path:first-child,
.lixia-hind-leg path:first-child {
  fill: url(#lixiaFur);
  stroke: rgba(58, 58, 58, 0.72);
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chest-fluff {
  fill: rgba(255, 252, 244, 0.9);
  stroke: rgba(74, 74, 74, 0.5);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.tail-main {
  fill: url(#lixiaWarmPatch);
  stroke: rgba(58, 58, 58, 0.72);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.tail-tip,
.cheek-patch {
  fill: #bd9a85;
  opacity: 0.92;
}

.fur-line,
.body-line,
.head-line,
.paw-line {
  fill: none;
  stroke: rgba(80, 82, 80, 0.34);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.lixia-ear {
  fill: #fffdf7;
  stroke: rgba(58, 58, 58, 0.78);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.inner-ear {
  fill: rgba(236, 183, 188, 0.56);
  stroke: none;
}

.lixia-muzzle {
  fill: rgba(255, 246, 235, 0.88);
  stroke: none;
}

.lixia-eye ellipse {
  fill: url(#lixiaEye);
  stroke: rgba(50, 74, 94, 0.62);
  stroke-width: 1.2;
}

.lixia-pupil {
  fill: #0a1423;
  transform: translate(var(--gaze-x), var(--gaze-y));
  transition: transform 0.14s ease-out;
}

.sleep-eye {
  fill: none;
  stroke: rgba(64, 64, 64, 0.72);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0;
}

.lixia-nose {
  fill: #cc8490;
  stroke: rgba(70, 44, 47, 0.72);
  stroke-width: 1;
}

.lixia-mouth,
.lixia-whisker {
  fill: none;
  stroke: rgba(64, 64, 64, 0.72);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lixia-whisker {
  stroke: rgba(65, 65, 65, 0.52);
  stroke-width: 1.7;
}

.lixia-head {
  transform-origin: 50% 72%;
}

.lixia-tail {
  transform-origin: 82% 75%;
}

.lixia-leg {
  transform-origin: 50% 18%;
}

.lixia-toy {
  opacity: 0;
  transform-origin: 50% 50%;
}

.lixia-toy circle {
  fill: rgba(115, 217, 255, 0.84);
  stroke: rgba(245, 252, 255, 0.76);
  stroke-width: 2;
}

.lixia-toy path {
  fill: none;
  stroke: rgba(10, 18, 30, 0.48);
  stroke-width: 2;
  stroke-linecap: round;
}

.lixia-zzz {
  opacity: 0;
}

.lixia-zzz text {
  fill: rgba(231, 236, 255, 0.8);
  font: 700 24px "Segoe UI", Arial, sans-serif;
}

.floating-coach.action-walk .lixia-cat-sprite {
  animation: lixiaStepBounce 0.78s ease-in-out infinite;
}

.floating-coach.action-walk .lixia-body-shell,
.floating-coach.action-walk .lixia-head {
  animation: lixiaBodyWalk 0.78s ease-in-out infinite;
}

.floating-coach.action-walk .lixia-tail {
  animation: lixiaTailWalk 0.78s ease-in-out infinite;
}

.floating-coach.action-walk .lixia-front-leg-front {
  animation: lixiaFrontStep 0.78s ease-in-out infinite;
}

.floating-coach.action-walk .lixia-front-leg-back {
  animation: lixiaFrontStep 0.78s ease-in-out infinite reverse;
}

.floating-coach.action-walk .lixia-hind-leg {
  animation: lixiaHindStep 0.78s ease-in-out infinite;
}

.floating-coach.action-play .lixia-cat-sprite {
  animation: lixiaPlayBounce 1.1s ease-in-out infinite;
}

.floating-coach.action-play .lixia-tail {
  animation: lixiaTailPlay 0.8s ease-in-out infinite;
}

.floating-coach.action-play .lixia-front-leg-front {
  animation: lixiaPawPlay 0.7s ease-in-out infinite;
}

.floating-coach.action-play .lixia-toy {
  opacity: 1;
  animation: lixiaToyRoll 1.8s ease-in-out infinite;
}

.floating-coach.action-sleep .lixia-cat-sprite {
  animation: lixiaSleepBreath 3.2s ease-in-out infinite;
}

.floating-coach.action-sleep .lixia-head {
  transform: translateY(8px) rotate(-7deg);
}

.floating-coach.action-sleep .lixia-eye {
  opacity: 0;
}

.floating-coach.action-sleep .sleep-eye,
.floating-coach.action-sleep .lixia-zzz {
  opacity: 1;
}

.floating-coach.action-sleep .lixia-zzz {
  animation: lixiaZzz 2.8s ease-in-out infinite;
}

.floating-coach.mouse-near:not(.action-sleep) .lixia-head {
  animation: lixiaCuriousHead 1.1s ease-in-out infinite;
}

.floating-coach.mouse-near:not(.action-sleep) .lixia-front-leg-front {
  animation: lixiaWavePaw 0.9s ease-in-out infinite;
}

@keyframes lixiaStepBounce {
  0%,
  100% {
    transform: scaleX(var(--cat-direction)) translateY(0);
  }
  50% {
    transform: scaleX(var(--cat-direction)) translateY(-5px);
  }
}

@keyframes lixiaBodyWalk {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-3px) rotate(-1.4deg);
  }
}

@keyframes lixiaTailWalk {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(7deg);
  }
}

@keyframes lixiaFrontStep {
  0%,
  100% {
    transform: rotate(-6deg) translateY(0);
  }
  50% {
    transform: rotate(10deg) translateY(-4px);
  }
}

@keyframes lixiaHindStep {
  0%,
  100% {
    transform: rotate(5deg);
  }
  50% {
    transform: rotate(-8deg) translateY(-3px);
  }
}

@keyframes lixiaPlayBounce {
  0%,
  100% {
    transform: scaleX(var(--cat-direction)) translateY(0) rotate(0deg);
  }
  45% {
    transform: scaleX(var(--cat-direction)) translateY(-7px) rotate(-2deg);
  }
}

@keyframes lixiaTailPlay {
  0%,
  100% {
    transform: rotate(-12deg);
  }
  50% {
    transform: rotate(18deg);
  }
}

@keyframes lixiaPawPlay {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  50% {
    transform: rotate(-24deg) translate(-6px, -12px);
  }
}

@keyframes lixiaToyRoll {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  50% {
    transform: translateX(-24px) rotate(-36deg);
  }
}

@keyframes lixiaSleepBreath {
  0%,
  100% {
    transform: scaleX(var(--cat-direction)) scale(1);
  }
  50% {
    transform: scaleX(var(--cat-direction)) scale(1.025, 0.985);
  }
}

@keyframes lixiaZzz {
  0% {
    transform: translate(0, 8px);
    opacity: 0;
  }
  30%,
  70% {
    opacity: 1;
  }
  100% {
    transform: translate(8px, -10px);
    opacity: 0;
  }
}

@keyframes lixiaCuriousHead {
  0%,
  100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(4deg) translateY(-2px);
  }
}

@keyframes lixiaWavePaw {
  0%,
  100% {
    transform: rotate(-6deg) translateY(0);
  }
  50% {
    transform: rotate(-30deg) translate(-9px, -15px);
  }
}

.coach-bubble {
  position: relative;
  min-height: 78px;
  padding: 16px 18px;
  border: 1px solid rgba(115, 217, 255, 0.22);
  border-radius: 8px;
  background: rgba(9, 13, 28, 0.9);
  color: var(--ink);
  line-height: 1.58;
  box-shadow: 0 0 28px rgba(115, 217, 255, 0.08);
}

.floating-coach .coach-bubble {
  width: min(220px, calc(100vw - 28px));
  min-height: 0;
  margin-bottom: -8px;
  padding: 13px 15px;
  pointer-events: none;
  transform: translateY(0);
  transition: opacity 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.floating-coach.is-reminding .coach-bubble {
  border-color: rgba(135, 240, 197, 0.5);
  background: rgba(10, 18, 30, 0.94);
}

.coach-bubble::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 48px;
  width: 14px;
  height: 14px;
  border-left: 1px solid rgba(115, 217, 255, 0.22);
  border-top: 1px solid rgba(115, 217, 255, 0.22);
  background: rgba(9, 13, 28, 0.95);
  transform: rotate(45deg);
}

.floating-coach .coach-bubble::before {
  top: auto;
  bottom: -8px;
  left: 50%;
  border: 0;
  border-right: 1px solid rgba(115, 217, 255, 0.22);
  border-bottom: 1px solid rgba(115, 217, 255, 0.22);
  transform: translateX(-50%) rotate(45deg);
}

.profile-panel,
.panel,
.knowledge-band,
.metric-tile,
.record-item,
.history-day-summary,
.empty-state {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(24px) saturate(128%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.profile-panel,
.panel,
.knowledge-band,
.metric-tile,
.record-item,
.history-day-summary,
.empty-state,
.photo-drop,
.photo-preview,
.estimate-card,
.macro-line span {
  border-radius: 8px;
}

.profile-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 800px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.15;
  font-weight: 800;
  text-shadow: 0 0 36px rgba(115, 217, 255, 0.16);
}

h2 {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.eyebrow {
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid.two {
  grid-template-columns: 1fr 1fr;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(190, 210, 255, 0.16);
  border-radius: 8px;
  background: rgba(5, 8, 18, 0.64);
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

select option {
  background: #11172b;
  color: var(--ink);
}

input[type="date"] {
  color-scheme: light;
}

textarea {
  resize: vertical;
  min-height: 108px;
  padding: 13px;
  line-height: 1.55;
}

textarea::placeholder {
  color: rgba(168, 178, 207, 0.66);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: rgba(115, 217, 255, 0.76);
  box-shadow: 0 0 0 3px rgba(115, 217, 255, 0.14), 0 0 24px rgba(115, 217, 255, 0.12);
}

input[type="range"] {
  height: 28px;
  padding: 0;
  accent-color: var(--cyan);
}

input[type="date"] {
  color-scheme: dark;
}

* {
  scrollbar-color: rgba(115, 217, 255, 0.34) rgba(5, 8, 18, 0.48);
  scrollbar-width: thin;
}

.workspace {
  padding: 30px 34px 44px;
}

.topbar,
.panel-heading,
.section-heading,
.estimate-card,
.photo-row,
.knowledge-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 22px;
}

.date-picker {
  min-width: 184px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 18, 34, 0.62);
  backdrop-filter: blur(20px);
}

.target-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.trend-panel {
  position: relative;
  margin-bottom: 18px;
  overflow: hidden;
}

.trend-panel::before {
  content: "";
  position: absolute;
  inset: -30% 18% auto auto;
  width: 360px;
  height: 220px;
  background: radial-gradient(circle, rgba(115, 217, 255, 0.18), transparent 66%);
  filter: blur(34px);
  pointer-events: none;
}

.chart-legend,
.trend-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.chart-legend span,
.trend-summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(190, 210, 255, 0.14);
  border-radius: 8px;
  background: rgba(5, 8, 18, 0.38);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-legend span::before {
  content: "";
  width: 18px;
  height: 3px;
  border-radius: 99px;
}

.legend-intake::before {
  background: linear-gradient(90deg, var(--cyan), var(--mint), var(--amber));
  box-shadow: 0 0 14px rgba(115, 217, 255, 0.36);
}

.legend-target::before {
  background: repeating-linear-gradient(90deg, rgba(255, 210, 125, 0.9) 0 5px, transparent 5px 9px);
}

.trend-summary {
  justify-content: flex-start;
  margin: 14px 0 12px;
}

.trend-summary b {
  color: var(--ink);
}

.trend-chart {
  position: relative;
  min-height: 286px;
  border: 1px solid rgba(190, 210, 255, 0.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 22% 22%, rgba(135, 240, 197, 0.13), transparent 32%),
    linear-gradient(180deg, rgba(5, 8, 18, 0.22), rgba(5, 8, 18, 0.54));
  overflow: hidden;
}

.trend-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.weight-panel {
  position: relative;
  margin-top: 18px;
  margin-bottom: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.86)),
    var(--panel);
}

.weight-panel::before {
  content: "";
  position: absolute;
  inset: auto -12% -38% auto;
  width: 340px;
  height: 240px;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.08), transparent 68%);
  filter: blur(42px);
  pointer-events: none;
}

.weight-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 140px 110px auto;
  gap: 8px;
  align-items: center;
}

.weight-form input,
.weight-form button {
  min-height: 40px;
  border-radius: 8px;
}

.weight-form button {
  border: 1px solid rgba(10, 132, 255, 0.16);
  background: #0a84ff;
  box-shadow: 0 10px 24px rgba(10, 132, 255, 0.18);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.weight-form input {
  border-color: rgba(72, 88, 112, 0.14);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
}

.weight-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 12px;
}

.weight-summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(72, 88, 112, 0.1);
  border-radius: 999px;
  background: rgba(245, 247, 251, 0.92);
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.weight-summary b {
  color: #111827;
}

.weight-chart {
  position: relative;
  min-height: 236px;
  border: 1px solid rgba(72, 88, 112, 0.1);
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  overflow: hidden;
}

.weight-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.weight-area {
  fill: url(#weightArea);
}

.weight-line {
  fill: none;
  stroke: url(#weightLine);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: chartDraw 1.4s ease-in-out forwards;
}

.weight-line.glow {
  stroke-width: 9;
  opacity: 0.08;
}

.weight-chart .chart-grid line {
  stroke: rgba(17, 24, 39, 0.08);
}

.weight-chart .chart-axis text {
  fill: #98a2b3;
  font-size: 12px;
  font-weight: 800;
}

.weight-chart .chart-dots circle {
  fill: #fff;
  stroke: #0a84ff;
  filter: drop-shadow(0 4px 10px rgba(10, 132, 255, 0.22));
}

.chart-grid line {
  stroke: rgba(190, 210, 255, 0.1);
  stroke-width: 1;
}

.target-line {
  stroke: rgba(255, 210, 125, 0.74);
  stroke-width: 2;
  stroke-dasharray: 8 8;
}

.target-label,
.chart-axis text {
  fill: rgba(168, 178, 207, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.intake-area {
  fill: url(#intakeArea);
  opacity: 0.95;
}

.intake-stroke {
  fill: none;
  stroke: url(#intakeLine);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1300;
  stroke-dashoffset: 1300;
  animation: chartDraw 1.6s ease-in-out forwards;
}

.intake-stroke.glow {
  stroke-width: 11;
  opacity: 0.24;
  filter: url(#lineGlow);
}

.chart-bar {
  fill: rgba(115, 217, 255, 0.2);
  stroke: rgba(115, 217, 255, 0.18);
  transform-box: fill-box;
  transform-origin: bottom;
  animation: barRise 0.95s ease-out both;
}

.chart-bar.danger {
  fill: rgba(255, 141, 184, 0.24);
  stroke: rgba(255, 141, 184, 0.22);
}

.chart-dots circle {
  fill: #f5f7ff;
  stroke: rgba(115, 217, 255, 0.72);
  stroke-width: 2;
  filter: drop-shadow(0 0 7px rgba(115, 217, 255, 0.42));
}

@keyframes chartDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes barRise {
  from {
    transform: scaleY(0.08);
    opacity: 0.15;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

.metric-tile {
  min-height: 132px;
  padding: 17px;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.metric-tile:hover,
.panel:hover,
.record-item:hover {
  border-color: var(--line-bright);
  background: rgba(24, 31, 57, 0.84);
}

.metric-tile.accent {
  background:
    linear-gradient(145deg, rgba(115, 217, 255, 0.22), rgba(182, 156, 255, 0.16)),
    rgba(20, 26, 48, 0.94);
  border-color: rgba(115, 217, 255, 0.34);
  box-shadow: 0 0 34px rgba(115, 217, 255, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.metric-tile strong {
  display: block;
  margin: 14px 0 4px;
  color: var(--ink);
  font-size: 43px;
  line-height: 1;
}

.daily-grid {
  display: grid;
  grid-template-columns: minmax(390px, 0.86fr) minmax(520px, 1.14fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 20px;
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.progress-panel {
  min-height: 506px;
}

.icon-button,
.ghost-button,
.estimate-card button,
.quick-foods button {
  border: 1px solid rgba(190, 210, 255, 0.22);
  border-radius: 8px;
  background: rgba(16, 21, 40, 0.8);
  color: var(--ink);
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.icon-button:hover,
.ghost-button:hover,
.estimate-card button:hover,
.quick-foods button:hover {
  border-color: rgba(115, 217, 255, 0.58);
  background: rgba(29, 38, 70, 0.92);
  box-shadow: 0 0 24px rgba(115, 217, 255, 0.14);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-size: 22px;
}

.ghost-button {
  height: 38px;
  padding: 0 14px;
}

.bars {
  display: grid;
  gap: 18px;
  margin: 24px 0;
}

.bar-row {
  display: grid;
  gap: 9px;
}

.bar-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.bar-track {
  height: 12px;
  border: 1px solid rgba(190, 210, 255, 0.12);
  border-radius: 999px;
  background: rgba(5, 8, 18, 0.68);
  overflow: hidden;
}

.bar-fill {
  width: 0;
  max-width: 130%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--mint));
  box-shadow: 0 0 18px rgba(115, 217, 255, 0.32);
  transition: width 0.35s ease;
}

.bar-fill.warn {
  background: linear-gradient(90deg, var(--rose), var(--danger));
  box-shadow: 0 0 18px rgba(255, 141, 184, 0.34);
}

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.mini-stats span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(190, 210, 255, 0.12);
}

.mini-stats b {
  color: var(--ink);
}

.log-panel {
  display: grid;
  gap: 14px;
}

.log-panel select {
  width: 120px;
}

.photo-row {
  align-items: stretch;
}

.photo-drop {
  width: 136px;
  min-height: 114px;
  place-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px dashed rgba(190, 210, 255, 0.3);
  background: rgba(6, 10, 22, 0.58);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.photo-drop:hover {
  border-color: rgba(135, 240, 197, 0.62);
  background: rgba(18, 29, 43, 0.78);
}

.photo-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.photo-drop span {
  color: var(--mint);
  font-size: 28px;
}

.photo-drop b {
  color: var(--ink);
  font-size: 13px;
}

.photo-preview {
  flex: 1;
  min-height: 114px;
  border: 1px solid rgba(190, 210, 255, 0.16);
  background:
    radial-gradient(circle at 70% 30%, rgba(115, 217, 255, 0.12), transparent 35%),
    rgba(5, 8, 18, 0.58);
  overflow: hidden;
}

.photo-preview img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.portion-tune {
  width: 170px;
}

.estimate-card {
  padding: 14px 16px;
  border: 1px solid rgba(135, 240, 197, 0.28);
  background:
    linear-gradient(135deg, rgba(135, 240, 197, 0.12), rgba(115, 217, 255, 0.08)),
    rgba(9, 13, 28, 0.82);
  box-shadow: 0 0 28px rgba(135, 240, 197, 0.07);
}

.estimate-card strong,
.estimate-card span {
  display: block;
}

.estimate-card strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 19px;
}

.estimate-card button {
  height: 42px;
  padding: 0 18px;
  border-color: rgba(135, 240, 197, 0.35);
  background: rgba(33, 64, 64, 0.7);
}

.quick-foods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-foods button {
  height: 34px;
  padding: 0 11px;
}

.records-section {
  margin-top: 22px;
}

.history-section {
  margin-top: 18px;
}

.section-heading {
  margin-bottom: 12px;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-button {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(154, 202, 255, 0.42);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.mini-button:hover {
  border-color: rgba(45, 153, 255, 0.72);
  background: rgba(234, 247, 255, 0.92);
  transform: translateY(-1px);
}

.file-restore {
  position: relative;
  overflow: hidden;
}

.file-restore input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.record-list {
  display: grid;
  gap: 10px;
}

.history-day-summary {
  display: grid;
  grid-template-columns: 120px minmax(160px, 1fr) minmax(180px, 1.2fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  color: var(--text);
}

.history-day-summary span {
  color: var(--mint);
  font-weight: 850;
}

.history-day-summary strong {
  color: var(--ink);
  font-size: 18px;
}

.history-day-summary small {
  color: var(--muted);
}

.record-item {
  display: grid;
  grid-template-columns: 82px minmax(260px, 1fr) minmax(320px, 0.9fr) 112px;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 12px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.record-meal {
  color: var(--mint);
  font-weight: 850;
}

.record-desc {
  color: var(--text);
  line-height: 1.45;
}

.record-desc small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.macro-line {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.macro-line span {
  padding: 8px 9px;
  border: 1px solid rgba(190, 210, 255, 0.14);
  background: rgba(5, 8, 18, 0.46);
  color: var(--text);
  font-size: 13px;
}

.delete-button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(190, 210, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 18, 0.52);
  color: var(--rose);
  font-size: 20px;
}

.record-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  min-width: 112px;
}

.detail-button,
.detail-pill {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(115, 217, 255, 0.28);
  border-radius: 8px;
  background: rgba(115, 217, 255, 0.1);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.detail-pill {
  margin-left: auto;
}

.detail-button:hover,
.detail-pill:hover {
  border-color: rgba(135, 240, 197, 0.55);
  background: rgba(135, 240, 197, 0.16);
}

.detail-pill:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.estimate-dialog {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 24px;
}

.estimate-dialog.is-open {
  display: grid;
}

.estimate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 18, 0.62);
  backdrop-filter: blur(10px);
}

.estimate-modal {
  position: relative;
  width: min(1120px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(190, 210, 255, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 217, 255, 0.13), transparent 32%),
    radial-gradient(circle at 90% 16%, rgba(135, 240, 197, 0.12), transparent 34%),
    rgba(247, 251, 255, 0.94);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.34);
}

.estimate-modal > header,
.estimate-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.estimate-editor-head,
.estimate-item-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.2fr) 74px 74px 86px 70px 70px 70px minmax(190px, 1.4fr) 34px;
  gap: 8px;
  align-items: center;
}

.estimate-editor-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.estimate-items {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.estimate-item-row {
  padding: 10px;
  border: 1px solid rgba(154, 202, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.estimate-item-row input,
.estimate-item-row textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid rgba(154, 202, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.estimate-item-row textarea {
  resize: vertical;
}

.estimate-item-row button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(242, 107, 138, 0.28);
  border-radius: 8px;
  background: rgba(242, 107, 138, 0.08);
  color: var(--rose);
  font-size: 18px;
}

.estimate-modal-actions {
  border-top: 1px solid rgba(154, 202, 255, 0.18);
  padding-top: 14px;
}

.estimate-totals {
  margin-left: auto;
  text-align: right;
}

.estimate-totals span,
.estimate-totals small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.estimate-totals strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

#applyEstimateDetailsButton {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(19, 185, 129, 0.28);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(115, 217, 255, 0.18), rgba(135, 240, 197, 0.22));
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.empty-state {
  padding: 26px;
  color: var(--muted);
}

.knowledge-band {
  margin-top: 22px;
  padding: 20px;
  align-items: flex-start;
}

.knowledge-band > div {
  max-width: 430px;
}

.knowledge-band ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

/* Clean three-column dashboard refresh */
:root {
  --ink: #172033;
  --text: #344055;
  --muted: #697386;
  --faint: #94a3b8;
  --night: #f3f7fb;
  --night-2: #eaf0f7;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --panel-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(73, 91, 124, 0.14);
  --line-bright: rgba(38, 104, 190, 0.28);
  --violet: #8c7ae6;
  --cyan: #2b9cff;
  --mint: #13b981;
  --rose: #f26b8a;
  --amber: #f4b740;
  --danger: #ef5768;
  --shadow: 0 22px 70px rgba(38, 55, 84, 0.12);
  color-scheme: light;
}

html,
body {
  background: #f3f7fb;
}

body {
  min-width: 1180px;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 8%, rgba(43, 156, 255, 0.16), transparent 34%),
    radial-gradient(circle at 82% 14%, rgba(19, 185, 129, 0.14), transparent 28%),
    linear-gradient(145deg, #f8fbff 0%, #eef4fa 46%, #f7fbf7 100%);
}

body::before {
  opacity: 0.18;
  background-image: linear-gradient(rgba(55, 75, 110, 0.12) 1px, transparent 1px);
  background-size: 100% 36px;
  mix-blend-mode: normal;
}

.ambient-layer {
  background: transparent;
}

.ambient-layer::after {
  display: none;
}

.glow {
  opacity: 0.26;
  filter: blur(82px);
}

.glow-a {
  background: rgba(43, 156, 255, 0.28);
}

.glow-b {
  background: rgba(19, 185, 129, 0.22);
}

.glow-c {
  background: rgba(244, 183, 64, 0.18);
}

.glow-d {
  background: rgba(140, 122, 230, 0.16);
}

.three-column-shell {
  grid-template-columns: minmax(260px, 0.78fr) minmax(560px, 1.78fr) minmax(360px, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 18px;
}

.left-column,
.right-column {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 36px);
}

.center-column {
  width: 100%;
}

.coach-rail {
  height: auto;
  padding: 0;
  border-right: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  gap: 12px;
}

.workspace {
  padding: 0;
}

.brand-mark,
.profile-panel,
.avatar-card,
.side-targets,
.panel,
.date-picker,
.record-item,
.empty-state,
.history-day-summary,
.meal-group {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(130%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.brand-mark {
  padding: 16px;
  border-radius: 16px;
}

.brand-logo,
.brand-mark .dot {
  border: 0;
  box-shadow: 0 10px 26px rgba(43, 156, 255, 0.22);
}

.brand-mark strong,
h1,
h2,
.metric-tile strong,
.hero-number strong,
.estimate-card strong {
  color: var(--ink);
  text-shadow: none;
}

.brand-mark small,
.eyebrow,
.metric-tile span,
.metric-tile small,
label,
.mini-stats,
.estimate-card span {
  color: var(--muted);
}

.profile-panel,
.avatar-card,
.panel,
.metric-tile,
.record-item,
.empty-state,
.history-day-summary,
.photo-drop,
.photo-preview,
.estimate-card,
.macro-line span,
.date-picker,
.meal-group {
  border-radius: 16px;
}

.profile-panel,
.side-targets {
  padding: 16px;
}

.auth-required {
  display: none !important;
}

body.is-cloud-signed-in .auth-required {
  display: revert !important;
}

body.is-cloud-signed-in main.auth-required,
body.is-cloud-signed-in aside.auth-required,
body.is-cloud-signed-in section.auth-required {
  display: block !important;
}

body.is-cloud-signed-in .side-targets.auth-required {
  display: grid !important;
}

body.is-cloud-signed-in .avatar-card.auth-required {
  display: grid !important;
}

.avatar-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 118px;
  align-items: center;
  min-height: 150px;
  padding: 14px 12px 12px 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(43, 156, 255, 0.18), transparent 30%),
    radial-gradient(circle at 18% 100%, rgba(19, 185, 129, 0.12), transparent 36%),
    rgba(255, 255, 255, 0.78);
}

.avatar-card::before {
  content: "";
  position: absolute;
  right: 18px;
  top: 16px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(43, 156, 255, 0.08);
}

.avatar-copy {
  position: relative;
  z-index: 1;
}

.avatar-copy h2 {
  font-size: 23px;
  line-height: 1.05;
}

.avatar-copy small {
  display: block;
  max-width: 9em;
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 800;
}

.fit-avatar {
  position: relative;
  z-index: 1;
  width: 112px;
  height: 138px;
  justify-self: end;
}

.fit-avatar span,
.fit-avatar i {
  position: absolute;
  display: block;
}

.avatar-shadow {
  left: 22px;
  bottom: 4px;
  width: 72px;
  height: 14px;
  border-radius: 50%;
  background: rgba(38, 55, 84, 0.12);
  filter: blur(3px);
}

.avatar-head {
  left: 38px;
  top: 8px;
  width: 43px;
  height: 48px;
  border-radius: 46% 46% 48% 48%;
  background: linear-gradient(145deg, #ffd7ba, #f0b995);
  box-shadow: inset -6px -6px 10px rgba(174, 98, 70, 0.12);
}

.hair {
  background: #1a2433;
}

.hair-back {
  left: -4px;
  top: -5px;
  width: 49px;
  height: 22px;
  border-radius: 22px 22px 10px 12px;
  transform: rotate(-5deg);
}

.hair-side {
  left: 2px;
  top: -7px;
  width: 31px;
  height: 25px;
  border-radius: 20px 8px 18px 6px;
  transform: rotate(-23deg);
}

.face-eye {
  top: 25px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #172033;
}

.eye-left {
  left: 13px;
}

.eye-right {
  right: 12px;
}

.face-smile {
  left: 16px;
  top: 35px;
  width: 12px;
  height: 6px;
  border-bottom: 2px solid rgba(23, 32, 51, 0.72);
  border-radius: 50%;
}

.avatar-neck {
  left: 51px;
  top: 50px;
  width: 18px;
  height: 16px;
  border-radius: 0 0 7px 7px;
  background: #efb48f;
}

.avatar-body {
  left: 28px;
  top: 60px;
  width: 62px;
  height: 50px;
  border-radius: 16px 16px 13px 13px;
  background: linear-gradient(180deg, #f4f7fb, #e8edf4);
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 -10px 16px rgba(38, 55, 84, 0.08);
}

.avatar-body::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 18px;
  width: 36px;
  height: 14px;
  border-radius: 2px;
  background: #e33131;
}

.avatar-body i {
  left: 16px;
  top: 21px;
  z-index: 1;
  color: #fff;
  font-size: 5px;
  font-weight: 900;
  letter-spacing: 0;
}

body.profile-female .avatar-card {
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 141, 184, 0.18), transparent 30%),
    radial-gradient(circle at 18% 100%, rgba(135, 240, 197, 0.12), transparent 36%),
    rgba(255, 255, 255, 0.78);
}

body.profile-female .hair-back {
  left: -8px;
  top: -6px;
  width: 57px;
  height: 42px;
  border-radius: 28px 28px 22px 22px;
  transform: rotate(-3deg);
}

body.profile-female .hair-side {
  left: 3px;
  top: -9px;
  width: 35px;
  height: 28px;
  border-radius: 22px 8px 18px 8px;
}

body.profile-female .avatar-body {
  border-radius: 18px 18px 22px 22px;
  background: linear-gradient(180deg, #ffe7f0, #ffd2e1);
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
}

body.profile-female .avatar-body::before {
  background: #ff6f9f;
}

body.profile-female .avatar-body i {
  left: 20px;
  color: #fff;
  font-size: 0;
}

body.profile-female .avatar-body i::after {
  content: "MOVE";
  font-size: 5px;
}

.loss-warning {
  display: block;
  min-height: 18px;
  margin-top: 7px;
  color: #d14b68;
  font-size: 12px;
  font-weight: 850;
}

.avatar-arm {
  top: 62px;
  width: 16px;
  height: 47px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd1b0, #e9aa82);
}

.arm-left {
  left: 20px;
  transform: rotate(11deg);
}

.arm-right {
  right: 14px;
  transform: rotate(-12deg);
}

.avatar-leg {
  top: 107px;
  width: 18px;
  height: 27px;
  border-radius: 10px;
  background: #26364d;
}

.leg-left {
  left: 39px;
  transform: rotate(4deg);
}

.leg-right {
  left: 62px;
  transform: rotate(-4deg);
}

.avatar-shoe {
  bottom: 5px;
  width: 24px;
  height: 9px;
  border-radius: 8px 8px 6px 6px;
  background: #172033;
}

.shoe-left {
  left: 33px;
}

.shoe-right {
  left: 61px;
}

.side-targets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.side-targets .metric-tile {
  min-height: 88px;
  padding: 12px;
}

.side-targets .metric-tile strong {
  margin: 6px 0 1px;
  font-size: 27px;
  line-height: 0.95;
}

.side-targets .metric-tile span,
.side-targets .metric-tile small {
  font-size: 11px;
}

.side-targets .metric-tile.accent {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  grid-column: 1 / -1;
  min-height: 78px;
}

.side-targets .metric-tile.accent span,
.side-targets .metric-tile.accent small {
  grid-column: 1;
}

.side-targets .metric-tile.accent strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  margin: 0;
  font-size: 38px;
}

.metric-tile.accent,
.daily-hero {
  background:
    radial-gradient(circle at 12% 12%, rgba(43, 156, 255, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(236, 247, 255, 0.82));
  border-color: rgba(43, 156, 255, 0.22);
  box-shadow: 0 24px 80px rgba(43, 156, 255, 0.14);
}

.metric-tile:hover,
.panel:hover,
.record-item:hover {
  border-color: var(--line-bright);
  background: rgba(255, 255, 255, 0.9);
}

.icon-button,
.ghost-button,
.quick-foods button {
  border: 1px solid rgba(73, 91, 124, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: none;
}

.icon-button:hover,
.ghost-button:hover,
.quick-foods button:hover {
  border-color: rgba(43, 156, 255, 0.32);
  background: #fff;
  box-shadow: 0 10px 24px rgba(43, 156, 255, 0.12);
}

.clean-topbar {
  margin: 4px 0 16px;
}

h1 {
  font-size: 31px;
  letter-spacing: 0;
}

.daily-hero {
  display: grid;
  grid-template-columns: minmax(220px, 0.86fr) minmax(280px, 1fr);
  gap: 20px;
  align-items: start;
}

.hero-number {
  display: grid;
  gap: 6px;
}

.hero-number span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hero-number strong {
  display: block;
  font-size: 26px;
  line-height: 1;
}

.hero-number b {
  font-size: 76px;
  font-weight: 850;
  letter-spacing: 0;
}

.compact-bars {
  margin: 0;
  gap: 12px;
}

.bar-row header {
  color: var(--text);
  font-size: 13px;
}

.bar-track {
  height: 10px;
  border-color: rgba(73, 91, 124, 0.1);
  background: rgba(226, 233, 243, 0.85);
}

.bar-fill {
  background: linear-gradient(90deg, #2b9cff, #13b981);
  box-shadow: none;
}

.bar-fill.warn {
  background: linear-gradient(90deg, #f4b740, #ef5768);
  box-shadow: none;
}

.compact-stats {
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, 1fr);
  padding-top: 6px;
  border-top: 1px solid rgba(73, 91, 124, 0.12);
}

.compact-stats span {
  border-bottom: 0;
  padding: 8px 0;
}

.task-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.task-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(73, 91, 124, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.task-item > span {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(43, 156, 255, 0.26);
  border-radius: 50%;
}

.task-item.is-done > span {
  border-color: rgba(19, 185, 129, 0.45);
  background:
    linear-gradient(135deg, transparent 0 42%, #fff 42% 58%, transparent 58%),
    #13b981;
}

.task-item strong,
.task-item small {
  display: block;
}

.task-item strong {
  color: var(--ink);
  font-size: 13px;
}

.task-item small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.chat-panel {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.log-date-hint {
  display: inline-flex;
  margin-top: 7px;
  padding: 5px 9px;
  border: 1px solid rgba(43, 156, 255, 0.16);
  border-radius: 999px;
  background: rgba(43, 156, 255, 0.08);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.chat-window {
  display: grid;
  gap: 10px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid rgba(73, 91, 124, 0.12);
  border-radius: 16px;
  background:
    radial-gradient(circle at 88% 12%, rgba(19, 185, 129, 0.12), transparent 32%),
    rgba(247, 250, 253, 0.78);
}

.chat-line {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 15px;
  line-height: 1.5;
}

.chat-line span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.chat-line.assistant {
  background: #fff;
  border: 1px solid rgba(73, 91, 124, 0.1);
}

.chat-line.estimate {
  justify-self: end;
  background: linear-gradient(145deg, rgba(43, 156, 255, 0.12), rgba(19, 185, 129, 0.12));
  border: 1px solid rgba(43, 156, 255, 0.16);
}

.log-panel select,
.chat-panel select {
  width: 104px;
}

.chat-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chat-actions #addEstimateButton {
  min-width: 118px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #172033;
  color: #fff;
}

input,
select,
textarea {
  border-color: rgba(73, 91, 124, 0.16);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

select option {
  background: #fff;
  color: var(--ink);
}

textarea::placeholder {
  color: rgba(105, 115, 134, 0.76);
}

.photo-drop,
.photo-preview {
  background: rgba(248, 251, 255, 0.78);
}

.photo-preview img {
  height: 112px;
}

.portion-tune {
  width: 145px;
}

.records-section {
  margin-top: 16px;
}

.section-heading {
  margin-bottom: 10px;
}

.meal-group {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.meal-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  font-weight: 850;
}

.meal-group > header small {
  color: var(--muted);
  font-weight: 700;
}

.timeline-item {
  position: relative;
  grid-template-columns: 18px minmax(180px, 1fr) minmax(250px, 0.9fr) 36px;
  min-height: 64px;
  padding: 10px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.58);
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin: 8px auto 0;
  border-radius: 50%;
  background: #2b9cff;
  box-shadow: 0 0 0 5px rgba(43, 156, 255, 0.1);
}

.record-desc {
  color: var(--ink);
}

.record-desc small {
  color: var(--muted);
}

.macro-line span {
  border-color: rgba(73, 91, 124, 0.1);
  background: rgba(247, 250, 253, 0.76);
  color: var(--text);
}

.delete-button {
  border-color: rgba(239, 87, 104, 0.2);
  background: rgba(255, 255, 255, 0.58);
  color: var(--danger);
}

.trend-summary {
  margin: 12px 0;
}

.trend-summary span,
.chart-legend span {
  border-color: rgba(73, 91, 124, 0.1);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
}

.heatmap-chart {
  min-height: 0;
  padding: 12px;
  background: rgba(248, 251, 255, 0.72);
}

.heatmap-weekdays,
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.heatmap-weekdays {
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.heat-day {
  position: relative;
  height: 34px;
  min-width: 0;
  border: 1px solid rgba(73, 91, 124, 0.08);
  border-radius: 8px;
  background: #edf2f7;
  color: transparent;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.heat-day:hover,
.heat-day.is-selected {
  transform: translateY(-2px);
  border-color: rgba(23, 32, 51, 0.24);
  box-shadow: 0 10px 20px rgba(38, 55, 84, 0.12);
}

.heat-day span {
  position: absolute;
  left: 6px;
  top: 5px;
  color: rgba(23, 32, 51, 0.42);
  font-size: 10px;
}

.heat-day.level-1 {
  background: #dff7ef;
}

.heat-day.level-2 {
  background: #b9efd8;
}

.heat-day.level-3 {
  background: #71d8ad;
}

.heat-day.level-4 {
  background: #13b981;
}

.heat-day.level-over {
  background: #f26b8a;
}

.heat-day.level-4 span,
.heat-day.level-over span {
  color: rgba(255, 255, 255, 0.72);
}

.heatmap-scale {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.heatmap-scale i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.heatmap-scale .level-1 { background: #dff7ef; }
.heatmap-scale .level-2 { background: #b9efd8; }
.heatmap-scale .level-3 { background: #71d8ad; }
.heatmap-scale .level-4 { background: #13b981; }
.heatmap-scale .level-over { background: #f26b8a; }

.history-picker {
  display: none;
}

.history-calendar {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(73, 91, 124, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.calendar-head {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.calendar-head strong {
  display: grid;
  gap: 2px;
  color: var(--ink);
  text-align: center;
  font-size: 17px;
}

.calendar-head strong small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calendar-head button,
.calendar-day {
  border: 1px solid rgba(73, 91, 124, 0.12);
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
}

.calendar-head button {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 20px;
}

.calendar-today {
  width: 100%;
  height: 32px;
  margin-bottom: 10px;
  border: 1px solid rgba(19, 185, 129, 0.18);
  border-radius: 10px;
  background: rgba(19, 185, 129, 0.08);
  color: var(--mint);
  font-size: 12px;
  font-weight: 850;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 6px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
  font-weight: 800;
}

.calendar-day {
  position: relative;
  height: 34px;
  min-width: 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.calendar-day:hover,
.calendar-day.is-selected {
  transform: translateY(-1px);
  border-color: rgba(43, 156, 255, 0.34);
  background: rgba(43, 156, 255, 0.12);
  box-shadow: 0 8px 18px rgba(43, 156, 255, 0.12);
}

.calendar-day.level-1 {
  background: #dff7ef;
}

.calendar-day.level-2 {
  background: #b9efd8;
}

.calendar-day.level-3 {
  background: #71d8ad;
}

.calendar-day.level-4 {
  background: #13b981;
  color: rgba(255, 255, 255, 0.86);
}

.calendar-day.level-over {
  background: #f26b8a;
  color: rgba(255, 255, 255, 0.9);
}

.calendar-day.is-muted {
  color: rgba(105, 115, 134, 0.38);
  background: rgba(241, 245, 249, 0.56);
}

.calendar-day.is-muted.level-1,
.calendar-day.is-muted.level-2,
.calendar-day.is-muted.level-3,
.calendar-day.is-muted.level-4,
.calendar-day.is-muted.level-over {
  opacity: 0.55;
}

.calendar-day.is-today {
  border-color: rgba(19, 185, 129, 0.42);
}

.calendar-day.has-record::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  transform: translateX(-50%);
}

.export-wide {
  width: 100%;
  margin-bottom: 12px;
}

.right-column .history-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  margin-top: 0;
  min-height: 0;
  padding: 20px;
}

.history-list {
  flex: 1 1 auto;
  max-height: none;
  min-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-list .timeline-item {
  grid-template-columns: 18px minmax(170px, 1fr) minmax(220px, 0.9fr) 112px;
}

.history-list .timeline-item .macro-line {
  grid-column: auto;
}

.history-list .timeline-item .record-actions,
.history-list .timeline-item .delete-button {
  position: static;
}

.history-day-summary {
  grid-template-columns: 1fr minmax(150px, 1fr);
}

.floating-coach {
  width: 180px;
  z-index: 7;
}

.floating-coach .coach-bubble {
  width: min(176px, calc(100vw - 28px));
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.45;
  color: #fff;
  background: rgba(23, 32, 51, 0.72);
  border-color: rgba(255, 255, 255, 0.16);
  opacity: 0.72;
}

.floating-coach.is-reminding .coach-bubble,
.floating-coach.mouse-near .coach-bubble {
  opacity: 1;
  background: rgba(23, 32, 51, 0.88);
}

.floating-coach .cat-stage {
  width: 124px;
  min-height: 112px;
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .three-column-shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .left-column,
  .right-column {
    position: static;
    max-height: none;
  }

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

  .daily-hero,
  .task-list {
    grid-template-columns: 1fr;
  }

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

  .timeline-item {
    grid-template-columns: 18px 1fr;
  }

  .timeline-item .macro-line {
    grid-column: 2 / -1;
  }

  .timeline-item .delete-button {
    grid-column: 2;
    justify-self: end;
  }

  .record-actions {
    grid-column: 2;
    justify-self: end;
  }

  .estimate-editor-head {
    display: none;
  }

  .estimate-item-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .estimate-item-row textarea {
    grid-column: 1 / -1;
  }

  .estimate-item-row button {
    grid-column: 2;
    justify-self: end;
  }
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .app-shell,
  .daily-grid {
    grid-template-columns: 1fr;
  }

  .coach-rail {
    position: static;
    height: auto;
  }

  .workspace {
    padding: 22px 18px 32px;
  }

  .topbar,
  .weight-panel .panel-heading,
  .photo-row,
  .knowledge-band {
    align-items: stretch;
    flex-direction: column;
  }

  .weight-form {
    grid-template-columns: 1fr;
  }

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

  .record-item {
    grid-template-columns: 1fr;
  }

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

  .estimate-dialog {
    padding: 10px;
  }

  .estimate-modal {
    width: calc(100vw - 20px);
    padding: 14px;
  }

  .estimate-modal > header,
  .estimate-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .estimate-totals {
    margin-left: 0;
    text-align: left;
  }

  .portion-tune,
  .photo-drop {
    width: 100%;
  }
}

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