:root {
  color-scheme: dark;
  --bg: #11110f;
  --panel: #1a1a17;
  --panel-2: #24231e;
  --ink: #f5f0e6;
  --muted: #b7b0a3;
  --line: #3a382f;
  --gold: #e1c27e;
  --green: #8ed0ad;
  --red: #edaa91;
  --focus: #f0cf81;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 0; background: var(--bg); }
body { margin: 0; min-width: 0; color: var(--ink); background: radial-gradient(ellipse at 50% -12%, #30291c 0, var(--bg) 52%); font-size: 16px; line-height: 1.5; }
button, input, select { max-width: 100%; min-width: 0; font: inherit; }
button, select { color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
button { min-height: 44px; padding: .65rem .95rem; cursor: pointer; }
button:hover { border-color: var(--gold); }
button:disabled { opacity: .48; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, select { min-height: 44px; padding: .6rem .72rem; color: var(--ink); background: #11110f; border: 1px solid #504d42; }
input { border-radius: 9px; }
select { border-radius: 9px; }
a { color: var(--gold); text-underline-offset: 3px; }
.wrap { width: min(100% - 32px, 1080px); margin-inline: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: .75rem; font-weight: 750; letter-spacing: .11em; }
.brand-ring { width: 25px; height: 25px; border: 2px solid var(--gold); border-radius: 50%; box-shadow: inset 0 0 0 5px var(--bg), inset 0 0 0 6px var(--gold); }
.local-tag { color: var(--muted); font-size: .78rem; }
.green-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--green); }
.clock-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; margin: 25px 0 15px; padding: clamp(17px, 4vw, 30px); border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #1c1b17, var(--panel)); }
.eyebrow { margin: 0 0 7px; color: var(--gold); font-size: .72rem; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
h1 { max-width: 650px; margin: 0; font: 700 clamp(2rem, 5.5vw, 3.5rem)/1.04 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
h2 { margin: 0; font: 700 1.35rem/1.25 Georgia, "Times New Roman", serif; }
h3 { margin: 0 0 8px; font: 700 1.08rem Georgia, serif; }
.subtle { color: var(--muted); font-size: .88rem; }
.clock-copy .subtle { max-width: 620px; margin: 12px 0 6px; }
.zone-label { margin: 0; color: var(--green); font-size: .8rem; overflow-wrap: anywhere; }
.clock-display { display: flex; align-items: center; gap: 20px; }
.analog { position: relative; flex: 0 0 122px; width: 122px; height: 122px; border: 2px solid var(--gold); border-radius: 50%; background: radial-gradient(circle at center, var(--panel-2) 0 3px, transparent 4px); }
.dial-mark { position: absolute; z-index: 1; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.m12 { top: 8px; left: calc(50% - 2px); }
.m3 { top: calc(50% - 2px); right: 8px; }
.m6 { bottom: 8px; left: calc(50% - 2px); }
.m9 { top: calc(50% - 2px); left: 8px; }
.hand { position: absolute; z-index: 2; bottom: 50%; left: calc(50% - 1px); width: 2px; border-radius: 2px; transform-origin: 50% 100%; background: var(--ink); }
.hour-hand { height: 32px; width: 4px; left: calc(50% - 2px); }
.minute-hand { height: 43px; }
.second-hand { height: 49px; width: 1px; background: var(--red); }
.pin { position: absolute; z-index: 3; top: calc(50% - 4px); left: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.digital { display: grid; gap: 4px; min-width: 98px; }
.time-readout { font: 700 clamp(1.2rem, 3vw, 1.65rem)/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.format-field { margin-top: 7px; color: var(--muted); font-size: .74rem; }
.digital select { width: 100%; padding: .45rem; font-size: .8rem; }
.tabs { display: flex; gap: 7px; max-width: 100%; margin: 0 0 18px; padding: 5px 0 10px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: var(--line) transparent; }
.tab { flex: 0 0 auto; min-height: 40px; padding: .5rem .82rem; white-space: nowrap; color: var(--muted); }
.tab.active { color: var(--ink); border-color: var(--gold); background: #30291c; }
.panel { display: none; min-width: 0; padding: clamp(16px, 3.5vw, 27px); border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.panel.active { display: block; }
[hidden] { display: none !important; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head .eyebrow { margin-bottom: 4px; }
.section-head > .subtle { max-width: 340px; margin: 7px 0 0; text-align: right; }
.next-ending { display: flex; align-items: center; gap: 8px; max-width: 45%; margin: 0; color: var(--muted); font-size: .8rem; text-align: right; }
.shape { flex: 0 0 11px; width: 11px; height: 11px; border: 2px solid var(--gold); transform: rotate(45deg); }
.form-card { display: flex; align-items: end; flex-wrap: wrap; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #151512; }
.field { flex: 1 1 135px; min-width: 0; }
.field.grow { flex: 2 1 220px; }
.field label { display: block; margin: 0 0 5px; color: var(--muted); font-size: .78rem; }
.field input, .field select { width: 100%; }
.duration-field { flex: 1 1 210px; }
.inline-input { display: flex; gap: 6px; }
.inline-input input { flex: 1 1 80px; }
.inline-input select { flex: 1 1 110px; }
.primary { color: #19160f; background: var(--gold); border-color: var(--gold); font-weight: 750; }
.primary:hover { background: #efd28f; }
.secondary { margin-top: 12px; }
.timer-list, .city-list, .alarm-list { display: grid; gap: 9px; margin-top: 12px; }
.timer-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #141411; }
.progress-ring { display: grid; place-items: center; flex: 0 0 62px; width: 62px; height: 62px; border-radius: 50%; background: conic-gradient(var(--gold) var(--progress, 0%), var(--line) 0); }
.progress-ring::before { content: ""; grid-area: 1 / 1; width: 49px; height: 49px; border-radius: 50%; background: var(--panel); }
.timer-shape { position: relative; z-index: 1; grid-area: 1 / 1; width: 10px; height: 10px; border: 2px solid var(--gold); transform: rotate(45deg); }
.timer-card.done .progress-ring { background: conic-gradient(var(--green) 100%, var(--line) 0); }
.timer-card.done .timer-shape { border-color: var(--green); }
.timer-main { min-width: 0; }
.timer-title { display: block; overflow-wrap: anywhere; font-weight: 700; }
.timer-status { color: var(--muted); font-size: .76rem; }
.timer-time { display: block; margin: 1px 0; font: 700 clamp(1.2rem, 4vw, 1.6rem)/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.timer-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.timer-actions button { min-height: 38px; padding: .4rem .6rem; font-size: .76rem; }
.timer-actions .danger { color: var(--red); }
.empty-card { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.empty-card p { margin: 0; }
.empty-ring { flex: 0 0 22px; width: 22px; height: 22px; border: 2px solid var(--gold); border-radius: 50%; }
.note { margin: 12px 0 0; color: var(--muted); font-size: .8rem; }
.interval-settings { margin-bottom: 14px; }
.interval-settings .field { flex: 1 1 140px; }
.phase-card, .stopwatch-card { display: grid; justify-items: center; gap: 11px; padding: clamp(18px, 4vw, 32px); border: 1px solid var(--line); border-radius: 14px; background: #141411; text-align: center; }
.phase-label { color: var(--gold); font-weight: 750; }
.phase-shape { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid currentColor; transform: rotate(45deg); }
.large-clock { font: 700 clamp(2.8rem, 12vw, 5rem)/1 ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.control-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 3px; }
.phase-card .control-row { margin-top: 5px; }
.focus-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; gap: 22px; }
.focus-ring { display: grid; place-items: center; width: min(100%, 300px); aspect-ratio: 1; margin: 0 auto; padding: 11px; border-radius: 50%; background: conic-gradient(var(--gold) var(--progress, 0%), var(--line) 0); }
.focus-ring > div { display: grid; place-items: center; align-content: center; gap: 7px; width: 100%; height: 100%; border-radius: 50%; background: var(--panel); text-align: center; }
.focus-ring strong { font-size: clamp(1.9rem, 8vw, 3.1rem); }
#focus-phase { color: var(--gold); font-size: .8rem; font-weight: 750; }
#focus-round { color: var(--muted); font-size: .76rem; }
.focus-controls { min-width: 0; }
.focus-settings { margin-bottom: 12px; }
.focus-settings .field { flex: 1 1 92px; }
.focus-controls .control-row { justify-content: flex-start; }
.focus-controls .subtle { margin-top: 10px; }
.stopwatch-readout { display: block; font: 700 clamp(2.5rem, 12vw, 5rem)/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.table-wrap { width: 100%; margin-top: 15px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
caption { padding: 8px; }
th, td { padding: 9px 7px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .76rem; }
td { font-size: .86rem; }
.city-form { margin-bottom: 12px; }
.city-card, .alarm-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #141411; }
.city-name, .alarm-name { display: block; font-weight: 700; }
.city-zone, .alarm-date { color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.city-time { display: block; font: 700 1.3rem ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; text-align: right; }
.city-date { color: var(--muted); font-size: .74rem; text-align: right; }
.city-card button, .alarm-card button { min-height: 36px; padding: .35rem .6rem; font-size: .74rem; }
.alarm-card.fired { opacity: .62; }
.alarm-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.alarm-groups h3 { margin-bottom: 7px; }
.alarm-row-main { min-width: 0; }
.alarm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.alarm-actions .danger { color: var(--red); }
.notification-row { justify-content: flex-start; margin-top: 11px; }
.notification-row .subtle { margin: 0; }
.preferences { margin: 23px 0; padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.preferences h2 { font-size: 1.15rem; }
.preferences > p { margin: 5px 0 12px; }
.preference-grid { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.preference-grid label { display: flex; align-items: flex-start; gap: 8px; min-width: 0; color: var(--muted); font-size: .82rem; }
.preference-grid input { flex: 0 0 18px; width: 18px; height: 18px; min-height: 18px; margin: 2px 0 0; accent-color: var(--gold); }
.micro { color: var(--muted); font-size: .75rem; }
.text-button { min-height: 36px; padding: .35rem .55rem; color: var(--muted); background: transparent; border-color: transparent; text-decoration: underline; font-size: .78rem; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 18px auto 0; padding: 17px 0 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: .77rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .clock-card { grid-template-columns: minmax(0, 1fr); }
  .clock-display { justify-content: flex-start; }
  .focus-layout { grid-template-columns: minmax(0, 1fr); }
  .focus-ring { width: min(72vw, 275px); }
}
@media (max-width: 560px) {
  .wrap { width: min(100% - 24px, 1080px); }
  .topbar { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 12px; }
  .clock-card { gap: 18px; }
  .analog { flex-basis: 104px; width: 104px; height: 104px; }
  .hour-hand { height: 27px; }
  .minute-hand { height: 37px; }
  .second-hand { height: 42px; }
  .section-head { flex-direction: column; }
  .section-head > .subtle { text-align: left; }
  .next-ending { max-width: 100%; text-align: left; }
  .form-card > button { flex: 1 1 100%; }
  .timer-card { grid-template-columns: auto minmax(0, 1fr); }
  .timer-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .alarm-groups { grid-template-columns: minmax(0, 1fr); }
  .city-card, .alarm-card { align-items: flex-start; }
  .city-time { font-size: 1.05rem; }
  .notification-row { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 360px) {
  .clock-display { gap: 12px; }
  .analog { flex-basis: 88px; width: 88px; height: 88px; }
  .hour-hand { height: 23px; }
  .minute-hand { height: 30px; }
  .second-hand { height: 34px; }
  .inline-input { flex-direction: column; }
}
@media (prefers-color-scheme: light) {
  :root { color-scheme: light; --bg: #f3eee3; --panel: #fffaf0; --panel-2: #eee7d8; --ink: #1c1a16; --muted: #665f54; --line: #d4cbb9; --gold: #8b5c06; --green: #216343; --red: #a34432; --focus: #146c5d; }
  body { background: radial-gradient(ellipse at 50% -12%, #fff7e4 0, var(--bg) 52%); }
  .clock-card, .panel, .preferences { background: linear-gradient(145deg, #fffaf0, #f1eadb); }
  .form-card, .phase-card, .stopwatch-card, .timer-card, .city-card, .alarm-card { background: #fffaf0; }
  input, select { color: var(--ink); background: #fffdf8; }
  .tab.active { background: #f3e5c6; }
  .progress-ring::before, .focus-ring > div { background: var(--panel); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }