:root {
  color-scheme: dark;
  --field: #101923;
  --surface: #182633;
  --paper: #edf1eb;
  --muted: #9aaab5;
  --signal: #ffc15a;
  --urgent: #ff7373;
  --rule: #34424e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--field);
  color: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, a { touch-action: manipulation; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--signal); outline-offset: 5px; }
[hidden] { display: none !important; }
.shell {
  max-width: 1600px;
  min-height: 100svh;
  min-height: 100dvh;
  margin: auto;
  padding: max(22px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}
.masthead, .tools, .brand, .stage-heading, .time-strip, .settings-heading, .setting-actions, .settings-note, footer { display: flex; align-items: center; justify-content: space-between; }
.masthead { gap: 16px; min-height: 44px; }
.brand { justify-content: flex-start; gap: 12px; font-size: 25px; font-weight: 750; white-space: nowrap; }
.brand-en { font-size: 13px; font-weight: 550; margin-left: 1px; color: var(--signal); }
.brand-mark { width: 17px; height: 25px; border-left: 5px solid var(--signal); border-right: 5px solid var(--signal); transform: skew(-12deg); }
.tools { justify-content: flex-end; gap: 22px; }
.quiet-button, .text-button { background: none; border: 0; padding: 8px 0; font-size: 13px; min-height: 44px; }
.quiet-button { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.quiet-button[aria-pressed="true"] { color: var(--signal); }
.indicator { width: 6px; height: 6px; border-radius: 50%; border: 1px solid currentColor; }
[aria-pressed="true"] .indicator { background: currentColor; }
main { flex: 1; display: flex; flex-direction: column; }
.stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: clamp(34px, 6vh, 90px) clamp(30px, 6vh, 80px); }
.stage-heading { gap: 20px; }
h1 { font-size: clamp(18px, 2.2vw, 30px); font-weight: 500; margin: 0; overflow-wrap: anywhere; }
.status { flex-shrink: 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.status::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
body[data-state="running"] .status, body[data-state="ended"] .status { color: var(--signal); }
.clock { container-type: inline-size; margin-block: 12px 22px; }
.day-line { height: 30px; color: var(--signal); font-size: 18px; font-variant-numeric: tabular-nums; }
.digits { display: flex; align-items: baseline; justify-content: center; white-space: nowrap; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: min(17cqw, 250px); font-weight: 500; letter-spacing: -.065em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.fraction { font-size: .44em; letter-spacing: -.035em; color: var(--signal); margin-left: .06em; }
.clock-caption { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; padding-inline: 2.8%; }
.clock-caption span:first-child { width: 84%; text-align: center; word-spacing: 1.1em; }
.clock-caption span:last-child { width: 16%; text-align: right; }
body[data-state="empty"] .digits { color: #70808b; }
body[data-state="empty"] .fraction { color: #8b9aa5; }
.clock.is-warning .digits, .clock.is-warning .fraction { color: var(--urgent); }
.clock.is-warning .digits { animation: urgency 1s steps(1, end) infinite; }
body:has(.is-warning) .status { color: var(--urgent); }
body[data-state="ended"] .digits, body[data-state="ended"] .fraction { color: var(--signal); }
@keyframes urgency { 50% { opacity: .48; } }
.time-strip { gap: 16px; font-size: 13px; border-block: 1px solid var(--rule); padding-block: 15px; color: var(--muted); }
.target-summary { overflow-wrap: anywhere; }
.local-clock { flex-shrink: 0; }
.local-clock time { color: var(--paper); font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 16px; margin-left: 8px; font-variant-numeric: tabular-nums; }
.settings { margin-bottom: 32px; }
.settings-heading { margin-bottom: 8px; gap: 12px; }
h2 { font-weight: 550; font-size: 14px; margin: 0; }
.setting-actions { gap: 24px; }
.text-button { color: var(--muted); }
.text-button:hover, .quiet-button:hover:not(:disabled), footer a:hover { color: var(--paper); }
#share { color: var(--signal); }
#settings-toggle span { margin-left: 6px; }
form { display: grid; grid-template-columns: minmax(230px, 1.3fr) minmax(160px, 1.15fr) minmax(130px, .65fr) 150px; gap: 14px; align-items: end; }
label { display: block; font-size: 12px; color: var(--muted); }
.optional { opacity: .7; margin-left: 4px; }
input, select { display: block; width: 100%; min-width: 0; height: 48px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--paper); padding: 0 12px; margin-top: 9px; font-size: 16px; }
input::placeholder { color: #91a2ae; font-size: 14px; }
input[type="datetime-local"] { -webkit-appearance: none; appearance: none; text-align: left; }
input::-webkit-date-and-time-value { text-align: left; }
input::-webkit-datetime-edit { padding: 0; }
select { padding-right: 8px; }
.start-button { height: 48px; border: 0; border-radius: 6px; background: var(--signal); color: var(--field); font-weight: 650; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.start-button:hover { background: #ffd18a; }
.start-button span { font-size: 22px; font-weight: 400; }
.settings-note { min-height: 36px; font-size: 11px; color: var(--muted); gap: 12px; }
.settings-note .text-button { font-size: 12px; min-height: 36px; }
.feedback { margin: 0; color: var(--signal); font-size: 13px; }
.feedback:not(:empty) { margin-top: 8px; }
footer { gap: 20px; font-size: 11px; color: var(--muted); min-height: 24px; }
footer a { font-weight: 650; font-size: 12px; }
.noscript { padding: 20px; color: var(--signal); }
@media (min-width: 1600px) { .digits { justify-content: space-between; } }
@media (max-width: 900px) {
  form { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .target-field { grid-column: 1; } .label-field { grid-column: 1; grid-row: 2; }
  .warn-field { grid-column: 2; grid-row: 1; }
  .start-button { grid-column: 2; grid-row: 2; }
}
@media (max-width: 540px) {
  .shell { padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
  .brand { gap: 8px; font-size: 23px; } .brand-en { font-size: 11px; }
  .tools { gap: 14px; } .quiet-button { font-size: 11px; gap: 5px; }
  .stage { padding-block: 36px 28px; }
  .stage-heading { align-items: flex-start; gap: 12px; }
  h1 { font-size: 18px; line-height: 1.5; }
  .status { font-size: 11px; padding-top: 5px; }
  .clock { margin-block: 20px; }
  .day-line { font-size: 15px; height: 26px; }
  .digits { font-size: 17cqw; }
  .clock-caption { font-size: 10px; }
  .time-strip { flex-wrap: wrap; gap: 8px; font-size: 11px; padding-block: 12px; }
  .local-clock { margin-left: auto; }
  .local-clock time { font-size: 14px; }
  form { column-gap: 10px; row-gap: 16px; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
  input, select { padding-inline: 9px; }
  input[type="datetime-local"] { font-size: 16px; }
  input::placeholder { font-size: 12px; }
  .start-button { padding-inline: 12px; font-size: 14px; }
  .settings { margin-bottom: 24px; }
  .setting-actions { gap: 18px; }
  footer { gap: 8px; flex-wrap: wrap; font-size: 10px; }
}
@media (max-width: 360px) {
  .shell { padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); }
  .tools { gap: 9px; } .quiet-button { font-size: 10px; }
  form { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
}
@media (orientation: landscape) and (max-height: 600px) {
  .shell { padding-block: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-bottom)); }
  .masthead { min-height: 34px; }
  .quiet-button { min-height: 32px; }
  .brand { font-size: 20px; } .brand-mark { height: 20px; }
  .stage { padding-block: 6px; }
  h1 { font-size: 16px; }
  .clock { margin-block: 0 8px; }
  .day-line { height: 20px; font-size: 14px; }
  .digits { font-size: min(15cqw, 22dvh); line-height: 1.05; }
  .shell:has(#settings-body[hidden]) .digits { font-size: min(17cqw, 35dvh); }
  .clock-caption { display: none; }
  .time-strip { padding-block: 7px; font-size: 11px; }
  .settings { margin-bottom: 4px; }
  .settings-heading { margin-bottom: 0; }
  .settings-heading button { min-height: 32px; }
  form { grid-template-columns: minmax(200px, 1.5fr) minmax(110px, 1fr) minmax(110px, .8fr) 115px; gap: 10px; }
  .target-field, .label-field, .warn-field, .start-button { grid-column: auto; grid-row: auto; }
  input, select { height: 38px; margin-top: 4px; font-size: 16px; padding-inline: 7px; }
  .start-button { height: 38px; font-size: 13px; padding-inline: 10px; }
  .settings-note, .settings-note .text-button { min-height: 28px; }
  footer { min-height: 16px; }
}
@media (orientation: landscape) and (max-height: 600px) and (max-width: 700px) {
  form { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .85fr) 94px; gap: 7px; }
  label { font-size: 11px; }
  input::placeholder { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .clock.is-warning .digits { animation: none; opacity: 1; }
  .clock.is-warning { border-bottom: 3px solid var(--urgent); }
}
