﻿:root {
  color-scheme: light;
  --bg: #f8f9fa;
  --paper: #ffffff;
  --ink: #242629;
  --muted: #5d6269;
  --line: #d8dadd;
  --soft: #f5f1e4;
  --blue: #2f7897;
  --green: #3b855f;
  --amber: #b7791c;
  --red: #b65648;
  --wood: #8a6548;
  --roof: #6b4f45;
  --shadow: none;
  --small-shadow: none;
  --radius: 3px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}
button { font: inherit; }

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(14px, 3vw, 38px) 42px;
}

.topbar,
.controls,
.button-row,
.flow-card__head,
.room-label,
.focus-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.topbar { align-items: flex-start; margin-bottom: 18px; }
.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
}
h1, h2, p { margin: 0; }
h1 {
  font-size: clamp(1.8rem, 3vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: 0;
}

.day-chip,
.icon-button,
.segmented,
.mini-stat,
.focus-panel,
.today-card,
.flow-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--small-shadow);
}
.day-chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.day-chip__light {
  width: 9px;
  height: 9px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(59, 133, 95, 0.16);
}

.dashboard-strip {
  display: grid;
  grid-template-columns: 0.7fr 0.8fr 2.5fr;
  gap: 12px;
  margin-bottom: 14px;
}
.mini-stat {
  min-height: 78px;
  padding: 14px;
}
.mini-stat span,
.focus-kicker,
.focus-grid span,
.focus-next span {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
}
.mini-stat strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.28rem, 2.2vw, 1.9rem);
  line-height: 1.05;
}
.controls { margin-bottom: 16px; }
.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(78px, 1fr));
  gap: 4px;
  padding: 4px;
}
.segmented__button,
.icon-button {
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.segmented__button {
  min-height: 36px;
  padding: 0 12px;
  font-weight: 900;
}
.segmented__button.is-active {
  color: var(--ink);
  background: #e9eee7;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  font-weight: 900;
}
.button-row { justify-content: flex-end; gap: 8px; }

.demo-note { margin: 0 0 18px; color: #575b66; font-size: 0.85rem; line-height: 1.5; }
:focus-visible { outline: 3px solid #2156b9; outline-offset: 4px; }
.view { display: none; }
.view.is-visible { display: block; }
.house-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: stretch;
}
.house {
  position: relative;
  min-height: 650px;
  padding-top: 62px;
}
.roof {
  position: absolute;
  left: 46px;
  right: 46px;
  top: 0;
  height: 112px;
  background: var(--roof);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  box-shadow: var(--shadow);
}
.roof::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 34px;
  width: 58px;
  height: 42px;
  border: 5px solid rgba(255, 253, 247, 0.8);
  border-radius: 8px;
  transform: translateX(-50%);
}
.house-body {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  min-height: 610px;
  overflow: hidden;
  border: 8px solid #6f5a45;
  border-radius: var(--radius);
  background: #6f5a45;
  box-shadow: var(--shadow);
}
.room {
  position: relative;
  min-height: 305px;
  padding: 12px;
  overflow: hidden;
  border: 2px solid #6f5a45;
  color: var(--theme);
  background: color-mix(in srgb, currentColor 12%, #fffdf7);
  cursor: pointer;
  text-align: left;
  transition: filter 160ms ease, transform 160ms ease;
}
.room:hover,
.room.is-selected {
  filter: saturate(1.08) brightness(1.01);
}
.room.is-selected::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 3px solid currentColor;
  border-radius: 7px;
  pointer-events: none;
}
.room-wall {
  position: absolute;
  inset: 0;
  opacity: 0.9;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.22) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.18) 1px, transparent 1px);
  background-size: 34px 34px;
}
.wall-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 40%, white);
}
.wall-dot--one { left: 22px; top: 70px; }
.wall-dot--two { right: 34px; bottom: 84px; }
.window {
  position: absolute;
  right: 22px;
  top: 62px;
  width: 58px;
  height: 48px;
  border: 4px solid rgba(48, 55, 49, 0.85);
  border-radius: 8px;
  background: #cce8ed;
}
.window span {
  position: absolute;
  left: 25px;
  top: 0;
  width: 4px;
  height: 100%;
  background: rgba(48, 55, 49, 0.7);
}
.shelf {
  position: absolute;
  left: 22px;
  top: 92px;
  width: 84px;
  height: 8px;
  border-radius: 999px;
  background: var(--wood);
}
.shelf i {
  position: relative;
  display: inline-block;
  width: 12px;
  height: 24px;
  margin: -22px 4px 0 0;
  border-radius: 3px;
  background: color-mix(in srgb, currentColor 55%, white);
}
.room-label {
  position: relative;
  z-index: 2;
  min-height: 45px;
  color: var(--ink);
}
.room-kind,
.room-status {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.room-name { display: block; margin-top: 2px; font-size: 1.05rem; }
.room-status {
  min-height: 27px;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.74);
}
.bubble {
  position: absolute;
  z-index: 5;
  left: 26px;
  top: 56px;
  max-width: 174px;
  min-height: 35px;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border: 2px solid rgba(48, 55, 49, 0.76);
  border-radius: 10px 10px 10px 2px;
  color: var(--ink);
  background: white;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.12;
  animation: floatBubble 3.6s ease-in-out infinite;
}
.scene {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 18px;
  height: 190px;
}
.worker {
  position: absolute;
  z-index: 4;
  left: 22%;
  bottom: 32px;
  width: 76px;
  height: 126px;
  transform-origin: bottom center;
  animation: workerBob 2.9s ease-in-out infinite;
}
.worker__head {
  position: absolute;
  left: 18px;
  top: 4px;
  width: 42px;
  height: 44px;
  border: 3px solid #2f372f;
  border-radius: 50% 50% 45% 45%;
  background: #d79c6a;
}
.worker__head::before,
.worker__head::after {
  content: "";
  position: absolute;
  top: 20px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1f271f;
}
.worker__head::before { left: 11px; }
.worker__head::after { right: 11px; }
.worker__head i,
.worker__head b {
  position: absolute;
  top: 29px;
  width: 7px;
  height: 4px;
  border-radius: 50%;
  background: rgba(196, 77, 66, 0.32);
}
.worker__head i { left: 6px; }
.worker__head b { right: 6px; }
.worker__hair {
  position: absolute;
  left: 15px;
  top: 0;
  width: 47px;
  height: 20px;
  border-radius: 50% 50% 16px 16px;
  background: #2d2923;
}
.worker__body {
  position: absolute;
  left: 18px;
  top: 49px;
  width: 42px;
  height: 50px;
  border: 3px solid #2f372f;
  border-radius: 15px 15px 10px 10px;
  background: currentColor;
}
.worker__arm,
.worker__leg {
  position: absolute;
  border-radius: 999px;
  background: #2f372f;
}
.worker__arm { top: 62px; width: 11px; height: 46px; transform-origin: top center; }
.worker__arm--left { left: 7px; transform: rotate(24deg); }
.worker__arm--right { right: 6px; transform: rotate(-25deg); }
.worker__leg { top: 96px; width: 13px; height: 38px; }
.worker__leg--left { left: 22px; transform: rotate(8deg); }
.worker__leg--right { right: 22px; transform: rotate(-8deg); }
.desk {
  position: absolute;
  z-index: 3;
  left: 28%;
  right: 9%;
  bottom: 36px;
  height: 18px;
  border-radius: 999px;
  background: var(--wood);
}
.desk::before,
.desk::after {
  content: "";
  position: absolute;
  top: 16px;
  width: 12px;
  height: 54px;
  border-radius: 5px;
  background: #5d4634;
}
.desk::before { left: 28px; }
.desk::after { right: 28px; }
.screen {
  position: absolute;
  left: 45%;
  bottom: 18px;
  width: 94px;
  height: 62px;
  border: 5px solid #2f372f;
  border-radius: 8px;
  background: #fbfffb;
}
.screen i {
  display: block;
  height: 6px;
  margin: 8px 10px 0;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.82;
}
.screen i:nth-child(2) { width: 48%; opacity: 0.45; }
.screen i:nth-child(3) { width: 66%; opacity: 0.28; }
.keyboard {
  position: absolute;
  left: 46%;
  bottom: 7px;
  width: 85px;
  height: 9px;
  border-radius: 4px;
  background: #2f372f;
}
.mug {
  position: absolute;
  left: 20px;
  bottom: 18px;
  width: 22px;
  height: 25px;
  border: 3px solid #2f372f;
  border-radius: 4px 4px 8px 8px;
  background: #fff9eb;
}
.mug::after {
  content: "";
  position: absolute;
  right: -11px;
  top: 6px;
  width: 10px;
  height: 10px;
  border: 3px solid #2f372f;
  border-left: 0;
  border-radius: 0 8px 8px 0;
}
.box {
  position: absolute;
  display: none;
  width: 40px;
  height: 32px;
  border: 3px solid #2f372f;
  border-radius: 5px;
  background: #dca85d;
}
.box--one { right: 22px; bottom: 20px; }
.box--two { right: 62px; bottom: 50px; transform: scale(0.82); }
.chart {
  position: absolute;
  display: none;
  right: 22px;
  bottom: 22px;
  width: 82px;
  height: 54px;
  border: 4px solid #2f372f;
  border-radius: 8px;
  background: #fbfffb;
}
.chart i {
  position: absolute;
  bottom: 8px;
  width: 12px;
  border-radius: 4px 4px 0 0;
  background: currentColor;
}
.chart i:nth-child(1) { left: 13px; height: 18px; }
.chart i:nth-child(2) { left: 34px; height: 31px; }
.chart i:nth-child(3) { left: 55px; height: 25px; }
.floor-rug {
  position: absolute;
  left: 18%;
  right: 13%;
  bottom: 7px;
  height: 25px;
  border-radius: 50%;
  background: rgba(31, 39, 32, 0.14);
}
.tiny-track {
  position: absolute;
  z-index: 8;
  left: 14px;
  right: 14px;
  bottom: 10px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.72);
}
.tiny-track span,
.focus-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

.room[data-activity="typing"] .worker__arm--right { animation: typeArm 0.55s ease-in-out infinite; }
.room[data-activity="typing"] .screen i { animation: screenBlink 1.3s ease-in-out infinite; }
.room[data-activity="packing"] .box { display: block; }
.room[data-activity="packing"] .worker { animation: packMove 2.6s ease-in-out infinite; }
.room[data-activity="packing"] .worker__arm--right { animation: packArm 1.1s ease-in-out infinite; }
.room[data-activity="scouting"] .worker { animation: scoutWalk 4.2s ease-in-out infinite; }
.room[data-activity="scouting"] .mug { animation: notePop 2.1s ease-in-out infinite; }
.room[data-activity="charting"] .chart { display: block; }
.room[data-activity="charting"] .screen { display: none; }
.room[data-activity="charting"] .worker__arm--left { animation: pointArm 1.3s ease-in-out infinite; }
.room[data-activity="charting"] .chart i { animation: chartPulse 1.5s ease-in-out infinite; }

.focus-panel {
  position: sticky;
  top: 18px;
  min-height: 610px;
  padding: 18px;
  align-self: start;
}
.focus-panel h2 { font-size: 1.75rem; line-height: 1.05; }
.focus-meter {
  height: 13px;
  margin: 22px 0 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7df;
}
.focus-line {
  min-height: 74px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.45;
}
.focus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.focus-grid div {
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
}
.focus-grid strong { display: block; margin-top: 8px; font-size: 1.05rem; line-height: 1.1; }
.focus-next ol { display: grid; gap: 10px; margin: 12px 0 0; padding-left: 20px; }
.focus-next li { line-height: 1.35; }

.flow-board,
.today-board { display: grid; gap: 14px; }
.flow-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flow-card,
.today-card { min-height: 210px; padding: 16px; }
.flow-card__head strong { font-size: 1.08rem; }
.flow-card__head span { color: var(--muted); font-weight: 900; }
.flow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 18px 0; }
.flow-step {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfaf5;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}
.flow-step.is-active { color: white; background: currentColor; border-color: currentColor; }
.flow-card p { color: var(--muted); line-height: 1.4; }
.today-board { grid-template-columns: 0.9fr 1.1fr; }
.today-card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.stack-list { display: grid; gap: 10px; }
.stack-item { padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: #fbfaf5; }
.stack-item strong { display: block; margin-bottom: 4px; }
.stack-item span { color: var(--muted); line-height: 1.35; }

[data-theme="blue"] { --theme: var(--blue); color: var(--theme); }
[data-theme="green"] { --theme: var(--green); color: var(--theme); }
[data-theme="amber"] { --theme: var(--amber); color: var(--theme); }
[data-theme="red"] { --theme: var(--red); color: var(--theme); }

@keyframes workerBob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-4px) rotate(1deg); } }
@keyframes typeArm { 0%, 100% { transform: rotate(-22deg); } 50% { transform: rotate(-42deg); } }
@keyframes screenBlink { 0%, 100% { opacity: 0.82; } 50% { opacity: 0.35; } }
@keyframes packMove { 0%, 100% { transform: translateX(0) translateY(0); } 50% { transform: translateX(18px) translateY(-2px); } }
@keyframes packArm { 0%, 100% { transform: rotate(-20deg); } 50% { transform: rotate(-58deg); } }
@keyframes scoutWalk { 0%, 100% { transform: translateX(-18px) rotate(-2deg); } 50% { transform: translateX(34px) rotate(2deg); } }
@keyframes pointArm { 0%, 100% { transform: rotate(24deg); } 50% { transform: rotate(62deg); } }
@keyframes chartPulse { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.62); } }
@keyframes notePop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes floatBubble { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.is-paused *,
.is-paused *::before,
.is-paused *::after {
  animation-play-state: paused !important;
}

@media (max-width: 1120px) {
  .house-layout,
  .today-board { grid-template-columns: 1fr; }
  .focus-panel { position: static; min-height: auto; }
  .flow-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .shell { padding: 18px 12px 32px; }
  .topbar,
  .controls { flex-direction: column; align-items: stretch; }
  .day-chip,
  .segmented { width: 100%; }
  .button-row { justify-content: flex-start; }
  .dashboard-strip,
  .house-body,
  .flow-board { grid-template-columns: 1fr; }
  .house { padding-top: 42px; }
  .roof { left: 28px; right: 28px; height: 88px; }
  .house-body { min-height: auto; }
  .room { min-height: 300px; }
  .bubble { max-width: 150px; }
}
