:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #29251e;
  background: #f7f1e7;
  --paper: #fffaf1;
  --ink: #29251e;
  --muted: #645b4e;
  --line: #e1d4c0;
  --rust: #9d402b;
  --rust-hover: #813221;
  --serif: Georgia, "Times New Roman", serif;
  --mono: Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #a74732; outline-offset: 3px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.symbols, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip-link { position: absolute; left: 16px; top: 10px; z-index: 5; padding: 12px; background: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.shell { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 740; font-size: 1.1rem; letter-spacing: -.04em; min-height: 44px; white-space: nowrap; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: #22293a; color: #ffe0a5; border-radius: 50%; }
.brand-mark svg { width: 23px; height: 23px; }
.top-actions, .timer-controls { display: flex; align-items: center; justify-content: center; gap: 9px; }
.quiet, .primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 15px; border-radius: 40px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 670; font-size: .875rem; transition: transform .18s, background .18s, box-shadow .18s; }
.quiet:hover { background: #ede1cf; transform: translateY(-2px); }
.quiet:active, .primary:active { transform: translateY(1px); }
.icon-button { width: 44px; padding: 0; }
h1, h2, p { margin: 0; }
.app-hero { padding-bottom: 16px; }
.intro { padding-block: 29px 22px; }
h1 { font: 400 clamp(2.6rem, 5.1vw, 4.85rem)/1.04 var(--serif); letter-spacing: -.072em; }
h1 em { color: var(--rust); font-weight: 400; }
.intro p { margin-top: 10px; color: #52483b; line-height: 1.5; font-size: 1rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); min-width: 0; border: 1px solid #d9c9b1; border-radius: 25px; overflow: hidden; box-shadow: 0 8px 22px #5a3d1510; }
.timer-card, .companion-card { min-width: 0; }
.timer-card {
  --accent: #9d402b;
  --track: #e4d4c2;
  --tint: #f5e6d9;
  --dial-light: #fcf0de;
  background: radial-gradient(ellipse at 50% 50%, var(--dial-light) 0%, var(--paper) 66%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 21px;
}
.timer-card[data-mode="short"] { --accent: #3e6c59; --track: #cfddd0; --tint: #e6eee3; --dial-light: #eef3e6; }
.timer-card[data-mode="long"] { --accent: #3b607c; --track: #ced9e2; --tint: #e4edf2; --dial-light: #edf2f4; }
.modes { display: flex; gap: 4px; padding: 4px; border: 1px solid #e6d9c5; border-radius: 40px; background: #f1e8d9; max-width: 100%; }
.mode { border: 0; background: transparent; color: #5e5244; border-radius: 40px; padding: 5px 16px; font-size: .875rem; font-weight: 650; min-height: 44px; transition: background .18s; }
.mode:hover { background: #fdf6eb; }
.mode[aria-pressed="true"] { color: var(--accent); background: #fffaf1; box-shadow: 0 1px 3px #5b3d2328; }
.focus-presets { inline-size: min(100%, 300px); margin-block-start: 14px; }
.preset-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-block-end: 5px; color: var(--muted); font-size: .78rem; font-weight: 650; }
#custom-length { font-weight: 500; }
.preset-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.preset-options button { display: grid; place-content: center; gap: 1px; min-block-size: 44px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-size: .78rem; font-weight: 650; line-height: 1.15; }
.preset-options button span { color: var(--muted); font-size: .75rem; font-weight: 500; }
.preset-options button:hover { background: var(--tint); }
.preset-options button[aria-pressed="true"] { background: var(--tint); border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.focus-presets:not([hidden]) + .dial { width: min(270px, 100%); margin-block: 9px 8px; }
.dial { position: relative; width: min(300px, 100%); aspect-ratio: 1; display: grid; place-items: center; margin-block: 14px 12px; }
.dial-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-ticks { stroke: #9f856a; opacity: .55; stroke-width: 3.5; stroke-dasharray: .08 .92; }
.ring-track, .ring-progress { stroke-width: 4; }
.ring-track { stroke: var(--track); }
.ring-progress { stroke: var(--accent); transform-origin: 50% 50%; transform: rotate(-90deg); stroke-dasharray: 100 100; transition: stroke .2s; }
.ring-dot { fill: var(--accent); stroke: var(--paper); stroke-width: 2; transform-origin: 50% 50%; }
.dial-face { text-align: center; z-index: 1; }
.timer-state { font-size: .86rem; font-weight: 670; color: var(--accent); }
.time { font: 400 clamp(3.5rem, 8vw, 5.7rem)/.99 var(--serif); letter-spacing: -.092em; font-variant-numeric: lining-nums tabular-nums; margin-block: 6px 8px; padding-inline-end: .06em; }
.time.wide { font-size: clamp(2.8rem, 7vw, 4.8rem); }
.cycle { color: var(--muted); font-size: .875rem; }
.primary { min-height: 49px; color: #fffaf3; background: var(--rust); border-color: transparent; }
.primary:hover { background: var(--rust-hover); transform: translateY(-2px); box-shadow: 0 4px 10px #81322130; }
.timer-controls .primary { min-width: 167px; }
.timer-controls .icon-button { height: 49px; width: 49px; background: var(--paper); }
.timer-controls .icon-button:hover { background: var(--tint); }
.timer-controls [aria-pressed="true"] { background: var(--tint); color: var(--accent); }
.shortcut { margin-top: 13px; color: var(--muted); font-size: .75rem; }
kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: #fffbf3; font: 600 .72rem var(--mono); }

.companion-card { --sky: #202738; --expedition: #262e40; --starlight: #ffcf94; background: var(--sky); color: #fff2db; position: relative; display: flex; flex-direction: column; }
.companion-card[data-destination="1"] { --sky: #232d3a; --expedition: #293847; --starlight: #c4dfe1; }
.companion-card[data-destination="2"] { --sky: #382b28; --expedition: #4b352b; --starlight: #ffd1a4; }
.companion-card[data-destination="3"] { --sky: #193735; --expedition: #25443f; --starlight: #d5eaa7; }
.companion-copy { z-index: 1; padding: 24px 26px 0; }
.companion-copy h2 { font: 400 clamp(2rem, 4vw, 2.55rem)/1 var(--serif); letter-spacing: -.055em; }
.companion-copy p { position: relative; margin-top: 8px; color: #ece2d2; font-size: .925rem; min-height: 2.95em; line-height: 1.4; }
#adventure-label { display: block; }
.companion-copy p:has(#adventure-label:not([hidden])) #companion-message:not(.greeting) { display: none; }
.companion-copy p:has(.greeting) #adventure-label { display: none; }
.planet { position: relative; flex: 1 0 auto; aspect-ratio: 2.14; min-height: 192px; overflow: hidden; }
.planet canvas { display: block; image-rendering: pixelated; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 72%; }
.crew-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 17px 12px; background: var(--expedition); }
.crew-actions button { min-height: 44px; padding: 4px 3px; border: 1px solid #e6ddc95e; border-radius: 40px; background: transparent; color: #fff2db; font-size: .825rem; font-weight: 650; transition: transform .18s, background .18s, color .18s; }
.crew-actions button:hover { transform: translateY(-2px); background: var(--starlight); color: #252434; }
.crew-actions button:active { transform: translateY(1px); }
.crew-actions button:focus-visible { outline-color: var(--starlight); outline-offset: 2px; }
.expedition { padding: 14px 24px 16px; border-top: 1px solid #e6ddc93d; background: var(--expedition); }
.expedition-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 680; font-size: .95rem; }
.mission-count { color: #f1e5d4; font-size: .8rem; text-align: right; }
.mission-track { display: flex; gap: 6px; margin-block: 9px 8px; }
.mission-track span { flex: 1; background: #f7ead140; height: 5px; border-radius: 5px; }
.mission-track .earned { background: var(--starlight); }
.expedition p { color: #ece2d2; font-size: .825rem; }
.expedition p strong { color: var(--starlight); }

.activity { margin-top: 22px; padding: 15px 0 16px; border-block: 1px solid var(--line); display: grid; align-items: center; grid-template-columns: 1.05fr .85fr 1fr 1fr; gap: 21px; }
.activity h2 { font: 400 1.65rem/1.07 var(--serif); letter-spacing: -.055em; }
.activity p, .stat small, .week-log > span { display: block; color: var(--muted); font-size: .825rem; line-height: 1.3; }
.activity p { margin-top: 5px; }
.stat { display: flex; gap: 10px; align-items: center; }
.stat strong { display: block; font-size: 1.08rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; background: #e9e6d6; color: #4e6450; flex: none; }
.stat-icon.peach { background: #f1dfcc; color: #943d2b; }
.stat-icon svg { width: 18px; height: 18px; }
.week-log { display: grid; gap: 4px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; align-items: end; }
.day { display: grid; gap: 3px; justify-items: center; font-size: .68rem; color: var(--muted); }
.day i { height: 15px; border-radius: 4px; background: #eadfce; display: flex; width: 100%; align-items: end; overflow: hidden; }
.day b { width: 100%; background: #9d402b; height: var(--w); border-radius: 4px; }
.day:last-child { color: var(--ink); font-weight: 750; }
.day:last-child i { background: #e6d1ba; }
.footer { min-height: 28px; text-align: right; color: var(--muted); font-size: .8rem; padding-block: 6px; }
.footer:has(#connection:empty) { display: none; }

dialog { width: min(460px, calc(100% - 32px)); max-height: calc(100% - 28px); border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink); padding: 22px; }
dialog::backdrop { background: #202738b0; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dialog-top h2 { font: 400 2rem/1 var(--serif); letter-spacing: -.04em; }
dialog p { color: var(--muted); margin-block: 12px 20px; line-height: 1.45; }
.durations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.durations label { display: grid; gap: 7px; align-content: end; font-size: .875rem; font-weight: 650; }
.durations input { min-width: 0; width: 100%; padding: 10px; min-height: 44px; border: 1px solid #a3947a; border-radius: 8px; background: #fffdf7; color: var(--ink); }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-block: 12px; font-size: .875rem; }
.check input { width: 18px; height: 18px; accent-color: var(--rust); }

[data-enter] { animation: enter .45s ease both; }
.workspace[data-enter] { animation-delay: .055s; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .shell { width: calc(100% - 48px); }
  .workspace { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .companion-copy { padding-inline: 20px; }
  .expedition { padding-inline: 18px; }
}
@media (max-width: 670px) {
  .shell { width: calc(100% - 32px); }
  .topbar-inner { min-height: 61px; }
  .intro { padding-block: 25px 19px; }
  .intro p { margin-top: 9px; }
  .workspace { grid-template-columns: minmax(0, 1fr); border-radius: 21px; }
  .timer-card { padding-block: 17px 22px; }
  .dial { width: min(244px, 100%); margin-block: 10px; }
  .focus-presets:not([hidden]) + .dial { width: min(230px, 100%); }
  .time { font-size: clamp(3.4rem, 13.4vw, 4.6rem); }
  .time.wide { font-size: clamp(2.9rem, 11.5vw, 3.8rem); }
  .shortcut { display: none; }
  .mode { padding-inline: 11px; }
  .companion-copy { padding-top: 20px; }
  .activity { margin-top: 17px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .activity-copy, .week-log { grid-column: 1 / -1; }
}
@media (max-width: 355px) {
  .timer-controls .primary { min-width: 0; }
  .timer-controls { gap: 7px; }
  .install { padding-inline: 8px; }
  .top-actions { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

