:root {
  color-scheme: dark;
  --bg: #05070a;
  --panel: rgba(14, 21, 28, 0.9);
  --panel-strong: rgba(17, 25, 33, 0.98);
  --line: rgba(144, 161, 174, 0.18);
  --text: #f2f7f7;
  --muted: #93a1ad;
  --dim: #65727d;
  --accent: #58d9a5;
  --accent-strong: #7df3bf;
  --accent-soft: rgba(88, 217, 165, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 8px;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #000;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(76, 216, 177, 0.12), transparent 32rem),
    linear-gradient(135deg, #06090d 0%, #0a1118 48%, #040507 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 76%);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible,
pre:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.app-shell {
  position: relative;
  width: min(100%, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  border-inline: 1px solid rgba(255, 255, 255, 0.05);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 18rem),
    rgba(3, 5, 8, 0.6);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 12, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(88, 217, 165, 0.48);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(88, 217, 165, 0.34), transparent 68%),
    #111a20;
  color: #f9fffd;
  font-weight: 900;
  box-shadow: 0 0 0 6px rgba(88, 217, 165, 0.08);
}

.brand strong {
  display: block;
  font-size: 1.04rem;
  line-height: 1.1;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

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

.status-pill,
.ghost-button,
.icon-button,
.timer-button,
.eta-pill,
.input-meta span,
.state-summary span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 18, 25, 0.82);
}

.status-pill {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  color: var(--text);
  font-size: 0.92rem;
  white-space: nowrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(88, 217, 165, 0.72);
}

.workspace {
  padding: 26px clamp(18px, 3vw, 36px) 34px;
}

.progress-rail {
  display: grid;
  grid-template-columns: auto minmax(32px, 150px) auto minmax(32px, 150px) auto minmax(32px, 150px) auto;
  align-items: start;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 26px;
}

.progress-step {
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.progress-step span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  background: rgba(12, 18, 25, 0.9);
  color: var(--muted);
  font-weight: 800;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.02);
}

.progress-step strong {
  font-size: 0.83rem;
  font-weight: 700;
}

.progress-step.is-active,
.progress-step.is-complete {
  color: var(--text);
}

.progress-step.is-active span,
.progress-step.is-complete span {
  border-color: rgba(88, 217, 165, 0.72);
  background: rgba(88, 217, 165, 0.2);
  color: var(--accent-strong);
  box-shadow: 0 0 24px rgba(88, 217, 165, 0.2);
}

.progress-rail i {
  height: 1px;
  margin-top: 18px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.42));
}

.page-stack {
  display: grid;
}

.flow-page {
  display: none;
  min-height: calc(100vh - 170px);
  align-items: center;
  justify-items: center;
}

.flow-page.is-active {
  display: grid;
}

.page-card {
  width: min(100%, 920px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  padding: clamp(22px, 4vw, 42px);
}

.state-card {
  width: min(100%, 820px);
}

.blocker-card {
  width: min(100%, 860px);
}

.reset-card,
.handoff-page-card {
  width: min(100%, 1120px);
}

.page-heading {
  max-width: 720px;
  margin-bottom: 28px;
}

.page-heading h1,
.protocol-head h1,
.handoff-head h1 {
  margin: 6px 0 10px;
  font-size: clamp(1.55rem, 4vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.page-heading p,
.handoff-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.section-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field-block {
  margin-top: 24px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

.hint-button {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.mood-option {
  display: grid;
  min-height: 88px;
  justify-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 12, 17, 0.55);
  color: var(--muted);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.mood-option:hover,
.mood-option.is-selected {
  border-color: rgba(88, 217, 165, 0.8);
  background: rgba(88, 217, 165, 0.12);
  color: var(--text);
}

.mood-face {
  display: grid;
  width: 32px;
  height: 32px;
  margin-top: 11px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 900;
}

.mood-option > span:last-child {
  padding-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(6, 10, 14, 0.62);
}

.segmented button {
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-weight: 800;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.is-selected {
  background: rgba(88, 217, 165, 0.15);
  box-shadow: inset 0 0 0 1px rgba(88, 217, 165, 0.62);
}

.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.state-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.state-summary span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.template-library {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 12, 17, 0.38);
  padding: 16px;
}

.template-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.template-head h2 {
  margin: 4px 0 0;
  font-size: 1rem;
  line-height: 1.25;
}

.template-head > span {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

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

.template-chip {
  display: grid;
  min-height: 66px;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 9, 13, 0.58);
  color: var(--text);
  padding: 11px 12px;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.template-chip:hover {
  border-color: rgba(88, 217, 165, 0.62);
  background: rgba(88, 217, 165, 0.1);
  transform: translateY(-1px);
}

.template-chip span {
  font-size: 0.88rem;
  font-weight: 900;
}

.template-chip small {
  color: var(--muted);
  font-size: 0.76rem;
}

#taskInput {
  width: 100%;
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 9, 13, 0.74);
  color: var(--text);
  line-height: 1.75;
  resize: vertical;
}

#taskInput::placeholder {
  color: #87939d;
}

#taskInput:focus {
  border-color: rgba(88, 217, 165, 0.64);
}

.input-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.input-meta span,
.eta-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
}

.page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

.page-actions.two {
  justify-content: space-between;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 900;
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.primary-button {
  min-width: 180px;
  border: 0;
  background: linear-gradient(135deg, #43c792, #65e0aa);
  color: #052017;
}

.ghost-button {
  min-width: 132px;
  padding: 0 16px;
  color: var(--text);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
  transform: none;
}

.primary-button:disabled:hover,
.ghost-button:disabled:hover {
  transform: none;
}

.reset-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 18px;
  align-items: stretch;
}

.protocol-pane,
.timer-pane {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 12, 17, 0.42);
  padding: 22px;
}

.protocol-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.protocol-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.protocol-list article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  min-height: 82px;
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 12, 17, 0.38);
}

.protocol-list article:last-child {
  border-bottom: 0;
}

.protocol-list article span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  justify-self: center;
  border-radius: 999px;
  background: var(--accent);
  color: #052017;
  font-size: 0.82rem;
  font-weight: 900;
}

.protocol-list h3,
.protocol-list p {
  margin: 0;
}

.protocol-list h3 {
  font-size: 0.96rem;
}

.protocol-list p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.64;
}

.timer-pane {
  display: grid;
  align-content: center;
  justify-items: center;
}

.timer-ring {
  display: grid;
  width: min(100%, 250px);
  aspect-ratio: 1;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(8, 14, 19, 1) 0 55%, transparent 56%),
    conic-gradient(var(--accent) calc(var(--timer-progress) * 1%), rgba(88, 217, 165, 0.14) 0);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 70px rgba(88, 217, 165, 0.12);
}

.timer-ring > div {
  display: grid;
  width: 68%;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 8, 12, 0.82);
}

.timer-ring strong {
  align-self: end;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.timer-ring span {
  align-self: start;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.86rem;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

.timer-button {
  display: inline-flex;
  min-width: 82px;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text);
  font-weight: 900;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.timer-button:hover {
  border-color: rgba(88, 217, 165, 0.48);
  background: rgba(88, 217, 165, 0.1);
  transform: translateY(-1px);
}

.timer-button.is-primary {
  border-color: rgba(88, 217, 165, 0.4);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.timer-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.timer-button:disabled:hover {
  border-color: var(--line);
  background: rgba(12, 18, 25, 0.82);
}

.timer-button span {
  font-size: 0.92rem;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--text);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  border-color: rgba(88, 217, 165, 0.48);
  background: rgba(88, 217, 165, 0.1);
  transform: translateY(-1px);
}

.icon-button.is-primary {
  border-color: rgba(88, 217, 165, 0.4);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.handoff-cta {
  display: grid;
  width: 100%;
  justify-items: center;
  gap: 8px;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 0%, rgba(88, 217, 165, 0.13), transparent 72%),
    rgba(5, 9, 13, 0.88);
  color: var(--text);
  padding: 18px;
}

.shield-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(88, 217, 165, 0.72);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 900;
}

.handoff-cta strong {
  font-size: 1.16rem;
}

.handoff-cta small {
  color: var(--muted);
  font-size: 0.86rem;
}

.handoff-cta:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.handoff-cta:disabled .shield-mark {
  border-color: var(--line);
  color: var(--muted);
}

.handoff-cta.is-unlocked {
  border-color: rgba(88, 217, 165, 0.38);
}

.handoff-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.handoff-ready {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  border: 1px solid rgba(88, 217, 165, 0.24);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 0% 0%, rgba(88, 217, 165, 0.12), transparent 48%),
    rgba(7, 12, 17, 0.48);
  padding: 18px;
}

.handoff-ready h2,
.handoff-ready p {
  margin: 0;
}

.handoff-ready h2 {
  margin-top: 4px;
  font-size: 1.1rem;
}

.handoff-ready p:last-child {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.handoff-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.handoff-code {
  min-height: 310px;
  margin: 16px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid rgba(88, 217, 165, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(88, 217, 165, 0.11), transparent 55%),
    rgba(4, 9, 12, 0.95);
  color: #c7f8df;
  padding: 18px 20px;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", "Microsoft YaHei", monospace;
  font-size: 0.92rem;
  line-height: 1.75;
}

.handoff-code.is-collapsed {
  display: none;
}

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

.summary-grid div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 12, 17, 0.48);
  padding: 14px;
}

.summary-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.summary-grid strong {
  display: block;
  font-size: 1rem;
}

.recovery-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 12, 17, 0.42);
  padding: 18px;
}

.recovery-panel h2,
.recovery-panel p,
.today-card h2,
.today-card p {
  margin: 0;
}

.recovery-panel h2,
.today-card h2 {
  margin-top: 4px;
  font-size: 1.14rem;
}

.recovery-panel p:last-child {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.58;
}

.recovery-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.field-block.compact {
  margin-top: 0;
}

.today-card {
  margin-top: 16px;
  border: 1px solid rgba(88, 217, 165, 0.3);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(88, 217, 165, 0.18), transparent 45%),
    radial-gradient(circle at 100% 0%, rgba(95, 142, 255, 0.18), transparent 42%),
    rgba(7, 12, 17, 0.66);
  padding: 18px;
}

.today-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.today-card-head > span {
  border: 1px solid rgba(88, 217, 165, 0.24);
  border-radius: var(--radius);
  background: rgba(5, 9, 13, 0.5);
  color: var(--accent-strong);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.today-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.today-card-grid div,
.today-card-bottom > div {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  background: rgba(5, 9, 13, 0.48);
  padding: 14px;
}

.today-card-grid span,
.today-card-bottom span {
  display: block;
  margin-bottom: 6px;
  color: rgba(214, 232, 230, 0.72);
  font-size: 0.76rem;
}

.today-card strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.today-card-bottom {
  display: grid;
  grid-template-columns: minmax(160px, 0.38fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  margin-top: 10px;
}

.today-card-bottom p {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  background: rgba(5, 9, 13, 0.34);
  color: rgba(242, 247, 247, 0.86);
  padding: 14px;
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  transform: translateY(14px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(88, 217, 165, 0.44);
  border-radius: var(--radius);
  background: rgba(11, 17, 22, 0.96);
  color: var(--text);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 900px) {
  .reset-layout {
    grid-template-columns: 1fr;
  }

  .recovery-panel,
  .today-card-bottom {
    grid-template-columns: 1fr;
  }

  .recovery-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #saveRecovery {
    grid-column: 1 / -1;
  }

  .timer-pane {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  body {
    background: #05070a;
  }

  .app-shell {
    border-inline: 0;
  }

  .topbar {
    min-height: 68px;
    padding: 14px 16px;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .status-pill {
    min-height: 34px;
    max-width: 138px;
    overflow: hidden;
    padding: 0 9px;
    font-size: 0.72rem;
    text-overflow: ellipsis;
  }

  #settingsButton {
    display: none;
  }

  .workspace {
    padding: 20px 14px 24px;
  }

  .progress-rail {
    grid-template-columns: auto minmax(16px, 1fr) auto minmax(16px, 1fr) auto minmax(16px, 1fr) auto;
    gap: 6px;
    margin-bottom: 18px;
  }

  .progress-step span {
    width: 28px;
    height: 28px;
    font-size: 0.78rem;
  }

  .progress-step strong {
    font-size: 0.72rem;
  }

  .progress-rail i {
    margin-top: 14px;
  }

  .flow-page {
    min-height: auto;
  }

  .page-card {
    padding: 18px;
  }

  .page-heading h1,
  .protocol-head h1,
  .handoff-head h1 {
    font-size: 1.55rem;
  }

  .mood-grid {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
    gap: 7px;
  }

  .mood-option {
    min-height: 72px;
  }

  .mood-face {
    width: 28px;
    height: 28px;
  }

  .metric-grid,
  .template-grid,
  .summary-grid,
  .recovery-controls,
  .today-card-grid {
    grid-template-columns: 1fr;
  }

  .template-head {
    flex-direction: column;
  }

  .today-card-head {
    flex-direction: column;
  }

  .template-head > span {
    white-space: normal;
  }

  #taskInput {
    min-height: 250px;
  }

  .page-actions,
  .page-actions.two,
  .handoff-ready,
  .handoff-head,
  .protocol-head {
    align-items: stretch;
  }

  .handoff-ready {
    grid-template-columns: 1fr;
  }

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

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .timer-ring {
    width: min(100%, 224px);
  }

  .handoff-code {
    max-height: 360px;
    min-height: 260px;
    font-size: 0.82rem;
  }
}

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