:root {
  color-scheme: light;
  --bg: #eef3ef;
  --surface: #f8faf7;
  --ink: #20312b;
  --muted: #708078;
  --accent: #496f5a;
  --accent-dark: #335441;
  --line: #d7e1da;
  --danger: #924a45;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--ink); }
button, input, textarea { font: inherit; }
button { touch-action: manipulation; }
.hidden { display: none !important; }

.app { min-height: 100dvh; max-width: 620px; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 22px max(18px, env(safe-area-inset-bottom)); display: grid; grid-template-rows: auto 1fr auto; }
header { display: flex; justify-content: space-between; align-items: flex-start; }
.brand, .label { font-size: .75rem; letter-spacing: .18em; font-weight: 800; }
.date { color: var(--muted); margin-top: 5px; font-size: .9rem; }
.icon-button, .close { border: 0; background: transparent; color: var(--muted); font-size: 1.35rem; padding: 5px 8px; cursor: pointer; }
main { min-height: 0; }
.focus { height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 6vh 0 2vh; }
.label { color: var(--accent); margin-bottom: 20px; }
.task { font-size: clamp(2.2rem, 10vw, 4.5rem); line-height: .99; letter-spacing: -.045em; max-width: 11ch; margin: 0; font-weight: 700; }
.project { margin-top: 18px; color: var(--accent); font-size: 1.05rem; font-weight: 650; }
.note { margin-top: 12px; color: var(--muted); line-height: 1.5; max-width: 42ch; }
.spacer { flex: 1; min-height: 22px; }
.primary, .secondary, .capture { min-height: 58px; border-radius: 18px; border: 0; font-weight: 800; letter-spacing: .08em; cursor: pointer; }
.primary { background: var(--accent); color: white; width: 100%; }
.primary:hover { background: var(--accent-dark); }
.primary:disabled, .secondary:disabled { opacity: .55; cursor: wait; }
.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); width: 100%; }
.secondary-row { display: grid; grid-template-columns: 1fr 1.35fr; gap: 12px; }
.completion-final { margin-top: 10px; min-height: 48px; }
.timer { font-variant-numeric: tabular-nums; font-size: clamp(3.6rem, 18vw, 7rem); line-height: 1; letter-spacing: -.06em; margin-top: 28px; }
.paused-tag { color: var(--danger); font-size: .75rem; font-weight: 800; letter-spacing: .16em; margin-top: 12px; }
footer { padding-top: 14px; }
.capture { width: 100%; background: transparent; color: var(--accent); border: 1px solid var(--line); min-height: 48px; }

.modal { position: fixed; inset: 0; z-index: 10; background: rgba(28, 42, 35, .42); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.sheet { width: min(100%, 600px); max-height: 92dvh; overflow-y: auto; background: var(--surface); border-radius: 28px; padding: 22px; box-shadow: 0 18px 60px rgba(26, 43, 34, .22); }
.sheet.compact { padding-bottom: 28px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet h2 { margin: 0; font-size: 1.3rem; }
.voice-wrap { text-align: center; padding: 28px 0 22px; }
.mic { width: 92px; height: 92px; border: 0; border-radius: 50%; background: var(--accent); color: white; font-size: 2rem; cursor: pointer; }
.mic.recording { animation: pulse 1.4s infinite; background: var(--danger); }
@keyframes pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 12px rgba(146, 74, 69, .1); } }
.voice-status { margin-top: 14px; font-weight: 700; }
.record-time { color: var(--danger); margin-top: 5px; font-variant-numeric: tabular-nums; }
audio { width: 100%; margin-bottom: 14px; }
details { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
summary { color: var(--accent); font-weight: 750; cursor: pointer; }
textarea, input { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); padding: 14px; outline: none; }
textarea:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(73, 111, 90, .1); }
textarea { min-height: 110px; resize: vertical; margin: 14px 0 10px; }
.small-note, .feedback { color: var(--muted); font-size: .82rem; text-align: center; margin-top: 12px; }
.small-note.left { text-align: left; margin-top: 3px; overflow-wrap: anywhere; }
.auth-form { display: flex; flex-direction: column; min-height: 0; margin-top: 28px; flex: 1; }
.auth-form label { font-size: .8rem; font-weight: 750; margin: 0 0 7px; }
.auth-form input { margin-bottom: 15px; }
.feedback { color: var(--danger); min-height: 1.25rem; }
.status-card { display: flex; align-items: center; gap: 12px; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 22px 0; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #4c9b69; flex: 0 0 auto; }
.full { margin-bottom: 10px; }
.text-button { display: block; margin: 8px auto 0; border: 0; background: transparent; color: var(--muted); padding: 12px; font-weight: 750; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; width: max-content; max-width: calc(100% - 32px); background: var(--ink); color: white; padding: 12px 16px; border-radius: 12px; font-size: .9rem; box-shadow: 0 8px 30px rgba(0,0,0,.2); }

@media (min-width: 700px) {
  .app { padding-inline: 28px; }
  .modal { align-items: center; }
}

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