:root {
  --bg-home: linear-gradient(180deg, #f5f1ea 0%, #fff8f1 48%, #eef4ff 100%);
  --bg-pomodoro: linear-gradient(180deg, #fff3ee 0%, #fff9f5 44%, #eef5ff 100%);
  --bg-info: linear-gradient(180deg, #f2f4ff 0%, #fbfbff 44%, #fffdf8 100%);
  --ink: #152036;
  --muted: #66728b;
  --line: rgba(21, 32, 54, 0.1);
  --line-strong: rgba(21, 32, 54, 0.16);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --blue: #4f76f4;
  --blue-soft: rgba(79, 118, 244, 0.11);
  --teal: #1e8b82;
  --teal-soft: rgba(30, 139, 130, 0.12);
  --gold: #f3b347;
  --gold-soft: rgba(243, 179, 71, 0.16);
  --tomato: #f46d5b;
  --tomato-soft: rgba(244, 109, 91, 0.12);
  --deep: #1a2746;
  --white: #ffffff;
  --shadow: 0 24px 60px rgba(20, 27, 44, 0.1);
  --shadow-strong: 0 34px 84px rgba(20, 27, 44, 0.16);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  overflow-x: hidden;
}

body.page-home {
  background: var(--bg-home);
}

body.page-pomodoro {
  background: var(--bg-pomodoro);
}

body.page-info {
  background: var(--bg-info);
}

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

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: clip;
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(78px);
  opacity: 0.56;
  pointer-events: none;
}

.ambient-one {
  top: -80px;
  left: -96px;
  width: 300px;
  height: 300px;
  background: rgba(79, 118, 244, 0.16);
}

.ambient-two {
  top: 72px;
  right: -110px;
  width: 360px;
  height: 360px;
  background: rgba(244, 109, 91, 0.14);
}

.ambient-three {
  bottom: 48px;
  left: 34%;
  width: 280px;
  height: 280px;
  background: rgba(243, 179, 71, 0.16);
}

.topbar,
.page-main {
  position: relative;
  z-index: 1;
}

.topbar {
  width: min(1220px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), #85a3ff);
  box-shadow: 0 16px 30px rgba(79, 118, 244, 0.22);
}

.brand-copy {
  display: grid;
  gap: 2px;
  line-height: 1.02;
}

.brand-copy strong {
  font-size: 1rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.82rem;
}

.topnav,
.topbar-actions,
.prompt-row,
.chat-actions,
.home-links,
.focus-session-status,
.timer-actions,
.info-footer,
.rail-badges,
.sticker-cloud {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topnav {
  justify-content: center;
}

.topnav a {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(21, 32, 54, 0.06);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.topnav a:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

.topnav a[aria-current="page"] {
  background: var(--ink);
  color: var(--white);
  border-color: transparent;
}

.health-pill,
.support-note,
.rail-badges span,
.sticker-cloud span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.health-pill {
  background: var(--teal-soft);
  color: var(--teal);
}

.system-mode {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.support-note,
.rail-badges span {
  background: rgba(21, 32, 54, 0.06);
  color: var(--ink);
}

.sticker-cloud span:nth-child(1),
.sticker-cloud span:nth-child(4) {
  background: var(--blue-soft);
  color: var(--blue);
}

.sticker-cloud span:nth-child(2) {
  background: var(--gold-soft);
  color: #8f6210;
}

.sticker-cloud span:nth-child(3) {
  background: var(--tomato-soft);
  color: #a14a3a;
}

.page-main {
  width: min(1220px, calc(100% - 32px));
  margin: 18px auto 0;
  padding-bottom: 28px;
}

.page-home .topbar,
.page-home .page-main {
  width: calc(100% - 32px);
}

.page-pomodoro .topbar,
.page-pomodoro .page-main {
  width: calc(100% - 32px);
}

.command-surface,
.timer-shell,
.checklist-shell,
.info-shell,
.visual-card,
.rail-card,
.figure-note-card,
.info-visual-card,
.info-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.command-surface,
.timer-shell,
.checklist-shell,
.info-shell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 255, 0.86));
}

.command-surface {
  min-height: calc(100vh - 126px);
  padding: 28px;
  display: grid;
  gap: 24px;
}

.command-surface-header,
.timer-shell-header,
.checklist-shell-header,
.live-card-header,
.info-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.command-surface-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.command-copy h1,
.timer-shell h1,
.info-copy h1 {
  margin: 12px 0 10px;
  font-family: "Instrument Serif", serif;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 0.9;
  font-weight: 400;
  letter-spacing: -0.05em;
}

.command-copy p,
.visual-card-copy p,
.rail-card p,
.figure-note-copy p,
.focus-stage-mood,
#timer-subtitle,
.info-copy p,
.info-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.panel-kicker {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-button,
.prompt-chip {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.hero-button:hover,
.prompt-chip:hover {
  transform: translateY(-1px);
}

.hero-button.primary {
  background: linear-gradient(135deg, var(--tomato), #ff956b);
  color: var(--white);
  box-shadow: 0 18px 36px rgba(244, 109, 91, 0.24);
}

.hero-button.secondary {
  background: rgba(21, 32, 54, 0.08);
  color: var(--ink);
}

.hero-button.ghost-light {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border: 1px solid rgba(21, 32, 54, 0.08);
}

.prompt-chip {
  background: var(--panel-strong);
  color: var(--ink);
  border: 1px solid rgba(21, 32, 54, 0.08);
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.85fr);
  gap: 22px;
  align-items: stretch;
}

.command-workbench,
.home-rail,
.pomodoro-form,
.focus-inputs {
  display: grid;
  gap: 16px;
}

.chat-feed {
  min-height: 360px;
  max-height: 54vh;
  overflow: auto;
  padding: 18px;
  display: grid;
  gap: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(21, 32, 54, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 255, 0.92));
}

.chat-message {
  max-width: min(780px, 90%);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  border-radius: 20px;
}

.chat-message.assistant {
  justify-self: start;
  background: #ffffff;
  border: 1px solid rgba(21, 32, 54, 0.06);
}

.chat-message.user {
  justify-self: end;
  background: var(--ink);
  color: var(--white);
}

.chat-body {
  white-space: pre-wrap;
  line-height: 1.5;
}

.chat-meta {
  color: inherit;
  opacity: 0.72;
  font-size: 0.82rem;
  font-weight: 700;
}

.chat-form {
  display: grid;
  gap: 14px;
}

.chat-form textarea,
.form-field input,
.form-field select {
  width: 100%;
  border: 1px solid rgba(21, 32, 54, 0.1);
  border-radius: 20px;
  background: #ffffff;
  color: var(--ink);
}

.chat-form textarea {
  min-height: 120px;
  padding: 16px 18px;
  resize: vertical;
}

.form-field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.form-field span {
  font-size: 0.95rem;
}

.form-field input,
.form-field select {
  padding: 14px 16px;
}

.visual-card,
.rail-card,
.figure-note-card,
.info-visual-card,
.info-card {
  padding: 22px;
}

.visual-card {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.92));
}

.visual-card::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -56px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgba(243, 179, 71, 0.14);
  filter: blur(8px);
}

.visual-card-copy,
.figure-note-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.visual-card-copy h2,
.rail-card h3,
.checklist-shell h2,
.live-card-header h2,
.info-card h2 {
  margin: 0;
  line-height: 1.18;
}

.illustration-asset {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  display: block;
  margin: 0 auto;
}

.illustration-compact {
  width: min(100%, 180px);
}

.visual-card .sticker-cloud {
  justify-content: center;
}

.home-rail {
  min-height: 100%;
}

.rail-card {
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.9));
}

.rail-card-accent {
  background: linear-gradient(180deg, rgba(255, 244, 236, 0.98), rgba(255, 250, 245, 0.9));
}

.pomodoro-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(420px, 1.12fr);
  gap: 24px;
  align-items: stretch;
}

.timer-shell,
.checklist-shell {
  min-height: calc(100vh - 126px);
  padding: 28px;
  display: grid;
  gap: 22px;
}

.pomodoro-stage-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: stretch;
}

.focus-stage-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(250, 252, 255, 0.72));
  border: 1px solid rgba(21, 32, 54, 0.06);
}

.focus-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
}

.focus-state.idle {
  background: var(--blue-soft);
  color: var(--blue);
}

.focus-state.live {
  background: var(--tomato-soft);
  color: var(--tomato);
}

.focus-state.done {
  background: var(--teal-soft);
  color: var(--teal);
}

.focus-stage {
  position: relative;
  width: min(310px, 100%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  animation: focusFloat 3.6s ease-in-out infinite;
}

.focus-stage-orbit {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  border: 1px dashed rgba(36, 57, 93, 0.18);
  animation: rotateOrbit 18s linear infinite;
}

.focus-stage .orbit-two {
  inset: -10px;
  border-style: solid;
  border-color: rgba(36, 57, 93, 0.08);
  opacity: 0.78;
  animation-direction: reverse;
  animation-duration: 24s;
}

.focus-stage-body {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 24%, rgba(255, 245, 196, 0.98), rgba(255, 208, 132, 0.96) 32%, rgba(255, 144, 104, 0.98) 68%, rgba(244, 109, 91, 1) 100%);
  box-shadow: inset -16px -18px 0 rgba(168, 30, 22, 0.12), 0 24px 60px rgba(18, 28, 45, 0.14);
}

.focus-stage-body::before {
  content: "";
  position: absolute;
  inset: 34px auto auto 56px;
  width: 92px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
  filter: blur(6px);
}

.focus-stage-face {
  position: absolute;
  top: 74px;
  left: 50%;
  width: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform: translateX(-50%);
}

.focus-stage-eye {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--deep);
}

.focus-stage-mouth {
  position: absolute;
  left: 50%;
  top: 22px;
  width: 38px;
  height: 20px;
  border-bottom: 5px solid var(--deep);
  border-radius: 0 0 22px 22px;
  transform: translateX(-50%);
}

.focus-stage-time {
  position: relative;
  z-index: 1;
  color: var(--white);
  font-size: clamp(3.4rem, 10vw, 5rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.focus-stage-mood {
  text-align: center;
}

.focus-stage[data-status="live"] {
  animation-duration: 2s;
}

.focus-stage[data-status="live"] .focus-stage-body {
  animation: focusPulse 1.5s ease-in-out infinite;
}

.focus-stage[data-status="live"] .focus-stage-orbit {
  border-color: rgba(243, 179, 71, 0.36);
}

.focus-stage[data-status="done"] {
  animation: none;
}

.focus-stage[data-status="done"] .focus-stage-body {
  background: radial-gradient(circle at 34% 28%, #c9f0e2 0%, #82d2bc 44%, #3d9e8f 100%);
}

.focus-stage[data-status="sad"] .focus-stage-body {
  background: radial-gradient(circle at 34% 28%, #ffdcb8 0%, #ffb37b 42%, #df775f 100%);
}

.focus-stage[data-status="sad"] .focus-stage-mouth {
  top: 28px;
  border-bottom: 0;
  border-top: 5px solid var(--deep);
  border-radius: 24px 24px 0 0;
}

.focus-stage[data-status="celebrate"] {
  animation: focusCelebrate 1s ease-in-out infinite;
}

.figure-note-card {
  height: 100%;
  align-content: start;
  gap: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 245, 240, 0.9));
}

.checklist-shell-header,
.live-card-header {
  align-items: center;
}

.pomodoro-form {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(21, 32, 54, 0.06);
}

.focus-checklist {
  display: grid;
  gap: 12px;
}

.focus-checklist.empty {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(21, 32, 54, 0.12);
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(21, 32, 54, 0.08);
  background: rgba(255, 255, 255, 0.82);
  animation: checklistIn 220ms ease;
}

.checklist-item label {
  flex: 1;
}

.checklist-item input {
  width: 18px;
  height: 18px;
}

.focus-result {
  width: 100%;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  background: rgba(22, 124, 112, 0.1);
  border: 1px solid rgba(22, 124, 112, 0.16);
}

.focus-result.hidden {
  display: none;
}

.focus-result.success {
  background: linear-gradient(180deg, rgba(255, 244, 210, 0.96), rgba(255, 234, 182, 0.88));
  border-color: rgba(204, 151, 42, 0.22);
}

.focus-result.progress {
  background: linear-gradient(180deg, rgba(236, 243, 255, 0.96), rgba(225, 238, 255, 0.88));
  border-color: rgba(52, 103, 235, 0.18);
}

.focus-result.underused {
  background: linear-gradient(180deg, rgba(255, 235, 229, 0.96), rgba(255, 220, 213, 0.88));
  border-color: rgba(244, 100, 75, 0.2);
}

.focus-result-emoji {
  display: inline-block;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1;
}

.focus-result.success .focus-result-emoji {
  animation: resultCelebrate 0.9s ease-in-out infinite;
}

.focus-result.progress .focus-result-emoji {
  animation: resultNod 1.8s ease-in-out infinite;
}

.focus-result.underused .focus-result-emoji {
  animation: resultSway 2.4s ease-in-out infinite;
}

.focus-result-band {
  display: inline-flex;
  margin: 10px auto 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(21, 32, 54, 0.06);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.focus-result.success .focus-result-band {
  background: rgba(204, 151, 42, 0.16);
  color: #996300;
}

.focus-result.progress .focus-result-band {
  background: rgba(52, 103, 235, 0.12);
  color: var(--blue);
}

.focus-result.underused .focus-result-band {
  background: rgba(244, 100, 75, 0.14);
  color: #9a4936;
}

.focus-result strong {
  display: block;
  margin-bottom: 8px;
}

.focus-result p {
  margin: 0;
  line-height: 1.5;
}

.focus-result-meta {
  margin-top: 10px;
  font-weight: 700;
}

.info-shell {
  min-height: calc(100vh - 126px);
  padding: 28px;
  display: grid;
  gap: 24px;
}

.info-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
}

.info-copy {
  display: grid;
  gap: 12px;
}

.info-visual-card {
  display: grid;
  gap: 14px;
  align-content: center;
  justify-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 255, 0.9));
}

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

.info-card {
  background: var(--panel-strong);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@keyframes rotateOrbit {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes focusFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes focusPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes focusCelebrate {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.03);
  }
}

@keyframes resultCelebrate {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.06);
  }
}

@keyframes resultNod {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(6deg);
  }
}

@keyframes resultSway {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-6deg);
  }
  75% {
    transform: rotate(6deg);
  }
}

@keyframes checklistIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .home-layout,
  .pomodoro-layout,
  .info-hero {
    grid-template-columns: 1fr;
  }

  .pomodoro-stage-wrap {
    grid-template-columns: 1fr;
  }

  .figure-note-card {
    grid-template-columns: 180px 1fr;
    display: grid;
    align-items: center;
  }
}

@media (max-width: 920px) {
  .topbar,
  .command-surface-header,
  .timer-shell-header,
  .checklist-shell-header,
  .live-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .command-surface-meta {
    justify-content: flex-start;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .chat-feed {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .topbar,
  .page-main {
    width: calc(100% - 20px);
  }

  .page-home .topbar,
  .page-home .page-main {
    width: calc(100% - 20px);
  }

  .page-pomodoro .topbar,
  .page-pomodoro .page-main {
    width: calc(100% - 20px);
  }

  .topbar {
    margin-top: 10px;
    padding: 16px;
    border-radius: 26px;
  }

  .command-surface,
  .timer-shell,
  .checklist-shell,
  .info-shell {
    min-height: auto;
    padding: 22px;
    border-radius: 24px;
  }

  .topnav {
    width: 100%;
  }

  .topnav a {
    flex: 1;
    text-align: center;
  }

  .topbar-actions,
  .prompt-row,
  .chat-actions,
  .home-links,
  .timer-actions,
  .info-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-button,
  .prompt-chip {
    width: 100%;
  }

  .focus-stage {
    width: min(80vw, 300px);
  }

  .focus-stage-time {
    font-size: clamp(3.2rem, 16vw, 4.8rem);
  }

  .figure-note-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}
