:root {
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #18233b;
  background: #f3f6fb;
  font-size: 16px;
  font-synthesis: none;
  --surface: #fff;
  --border: #e1e6ef;
  --muted: #5f6d83;
  --input: #fff;
  --input-border: #bcc8db;
  --accent: #2447e8;
  --accent-hover: #1838c5;
  --soft: #eef2fa;
  --soft-text: #31456a;
  --count: #1937b2;
  --focus-ring: #2447e8;
  --error: #b12f3c;
}
html[data-theme="dark"] {
  color: #e7edf8;
  background: #10141d;
  --surface: #191f2c;
  --border: #323b50;
  --muted: #b5c0d3;
  --input: #111827;
  --input-border: #54617a;
  --accent: #4564ef;
  --accent-hover: #526ff5;
  --soft: #293651;
  --soft-text: #e3ebff;
  --count: #a9c0ff;
  --focus-ring: #a9c0ff;
  --error: #ffacb6;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
header, main { max-width: 720px; margin: auto; padding: 0 20px; }
header { min-height: 84px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding-top: 12px; padding-bottom: 12px; }
h1 { margin: 0; font-size: 19px; letter-spacing: -.04em; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; }
.mark { display: grid; place-items: center; background: #2447e8; color: #fff; border-radius: 10px; width: 34px; height: 34px; }
.mark svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; }
button, input, select { font: inherit; }
button { cursor: pointer; min-height: 48px; border: 0; border-radius: 12px; font-weight: 650; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 4px; }
#theme-select { margin-left: auto; max-width: 100%; min-height: 44px; padding: 8px 10px; font-size: .875rem; border: 1px solid var(--input-border); border-radius: 12px; background: var(--surface); color: inherit; cursor: pointer; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; }
.mode-selector { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border-radius: 14px; background: var(--soft); }
.mode-selector button { background: transparent; color: var(--soft-text); min-height: 44px; border-radius: 10px; }
.mode-selector button[aria-pressed="true"] { background: var(--surface); color: var(--count); box-shadow: 0 1px 4px #18233b14; }
.mode-selector button:disabled { opacity: 1; }
.mode-selector button:disabled[aria-pressed="false"] { opacity: .55; }
.timer-face { text-align: center; padding: 31px 0 28px; }
.mode-caption { margin: 0 0 4px; font-size: .9375rem; color: var(--muted); }
#time-display { display: block; color: var(--count); font-size: clamp(3.7rem, 14vw, 6rem); font-weight: 750; line-height: 1.2; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.status { color: var(--muted); min-height: 1.6em; line-height: 1.6; font-size: .9375rem; margin: 12px 0 0; }
.status.completed { color: var(--count); font-weight: 650; }
.duration-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; border-top: 1px solid var(--border); }
label { font-size: .9375rem; font-weight: 650; }
.duration-input { position: relative; width: 120px; flex: 0 0 120px; }
input { width: 100%; min-width: 0; min-height: 48px; border: 1px solid var(--input-border); border-radius: 12px; padding: 10px 33px 10px 12px; background: var(--input); color: inherit; }
input:disabled { opacity: .65; }
.duration-input span { position: absolute; right: 13px; top: 14px; color: var(--muted); pointer-events: none; }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.hint, .error { margin: 8px 0 0; font-size: .8125rem; line-height: 1.6; }
.hint { color: var(--muted); }
.error { color: var(--error); }
.error:empty { display: none; }
.actions { display: grid; grid-template-columns: 1.75fr 1fr; gap: 10px; margin-top: 22px; }
.primary { background: var(--accent); color: white; padding: 14px 16px; }
.primary:hover { background: var(--accent-hover); }
.secondary { background: var(--soft); color: var(--soft-text); padding: 14px 16px; }
.quiet-note { text-align: center; color: var(--muted); font-size: .8125rem; line-height: 1.6; margin: 14px 0; }
.help { padding: 8px 0 22px; color: var(--muted); font-size: .875rem; }
summary { cursor: pointer; width: fit-content; padding: 7px 0; min-height: 36px; }
details p { font-size: .8125rem; line-height: 1.75; margin: 8px 0; }
footer { display: flex; flex-wrap: wrap; gap: 5px 24px; align-items: center; border-top: 1px solid var(--border); padding: 14px 0 28px; color: var(--muted); font-size: .8125rem; }
footer a { color: var(--muted); padding: 9px 0; }
footer details { flex: 1 1 180px; }
.notice { color: var(--error); line-height: 1.6; }
@media (max-width: 420px) {
  header, main { padding-left: 16px; padding-right: 16px; }
  header { min-height: 76px; }
  h1 { font-size: 18px; }
  .panel { padding: 20px; }
  .timer-face { padding: 30px 0 24px; }
  .actions { gap: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background .15s; }
}
