/*
 * Clock: the tool's own components, styled in the site's design language (10 Nov 2026, on the UltraCompress Pro template,
 * after Prana Breathing Exercises, whose shared block the first part of this file copies; it came from the Decision Maker,
 * the Employee ID Card Generator, SpinForge and EngCalc). Base: /libs/site-pages.css (tokens, Inter and Space Grotesk,
 * buttons, theme toggle, focus rings) and /libs/shared-nav.css (the site's header and footer). The second part is the
 * original's components (the digital and analogue clock, the alarm form and list, the timer's ring and steppers, the
 * stopwatch and its laps, the city cards, the full screen clock and the ringing window) on the site's tokens; the clock's
 * hands and face are the tool's own --hand-* tokens. Light is the default; dark applies when <html> has no data-theme.
 * Assembled once from Prana's file and the original's style.css, then edited by hand: this file is the source.
 */

/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --radius-lg: 16px;
    --line: rgba(0, 0, 0, 0.1);
    --line-strong: rgba(0, 0, 0, 0.24);
    --ok: #166534;
    --ok-soft: rgba(22, 101, 52, 0.09);
    --bad: #b91c1c;
    --bad-soft: rgba(185, 28, 28, 0.08);
    --warn: #92400e;
    --warn-soft: rgba(217, 119, 6, 0.1);
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.26);
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, 0.1);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, 0.1);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.1);
}

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container { max-width: calc(var(--app-max) + 2 * var(--content-gutter)); margin-top: 16px; }
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }

/* ----- The site header is the first thing on the page and stays at the top ----- */
body { padding-top: 0; }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: 90px; }
@media (max-width: 639.98px) { .theme-toggle { top: 75px; } } /* the header is 81 px tall from 640 px, 65 px below */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ----- Hero ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; max-width: 46rem; margin: 0 auto; }

/* ----- Small helpers ----- */
main [hidden], .dialog [hidden], .session [hidden] { display: none !important; } /* the script hides parts that carry their own display */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-2); }
.small { font-size: 0.9rem; }
.block { display: block; }
.hint { color: var(--text-3); font-size: 0.8rem; font-weight: 400; line-height: 1.45; }
.err { color: var(--bad); font-size: 0.85rem; font-weight: 600; }
.err:empty { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link:hover { color: var(--link-hover); }
code { font-size: 0.85em; padding: 1px 6px; border-radius: 6px; background: var(--code-bg); color: var(--code-text); }
kbd { font-family: inherit; font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9999px; font-family: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.2; padding: 12px 24px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-strong); border: 1px solid var(--surface-border); padding: 11px 23px; }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn-danger { background: var(--surface); color: var(--danger); border: 1px solid rgba(185, 28, 28, 0.35); padding: 11px 23px; }
.btn-danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; transform: translateY(-2px); }
.btn-sm { font-size: 0.85rem; padding: 9px 16px; }
.btn-secondary.btn-sm, .btn-danger.btn-sm { padding: 8px 15px; }
.btn-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; padding: 0; font-family: inherit; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.icon-btn:hover { border-color: var(--brand); color: var(--link); background: var(--surface); }
.icon-btn.del:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn:focus-visible, .link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Toolbar ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 1.25rem; }
.toolbar-left, .toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 10px; border-radius: 9999px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); min-width: 220px; max-width: 100%; }
.status-icon { font-size: 1.3rem; line-height: 1; }
.status-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.status-main { font-weight: 700; font-size: 0.85rem; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-sub { font-size: 0.72rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--surface-2); max-width: 100%; }
.view-tab { padding: 8px 16px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.view-tab:hover { color: var(--link); }
.view-tab.active { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.view-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.view[hidden] { display: none; }
.shell-hint { margin-top: 14px; }

/* ----- Fields ----- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.label { font-weight: 600; font-size: 0.85rem; color: var(--text-strong); }
.input, .select { width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; background: var(--field); border: 1px solid var(--field-border); border-radius: 12px; font-family: inherit; font-size: 0.95rem; color: var(--text); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder { color: var(--placeholder); }
.input[aria-invalid="true"] { border-color: var(--bad); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
input[type="time"].input { color-scheme: light; width: 9em; }
:root:not([data-theme="light"]) input[type="time"].input { color-scheme: dark; }
.select { width: auto; max-width: 100%; appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; cursor: pointer; }
.select option { color: #0a0a14; background: #fff; }
.num-input { width: 7.5em; }
.num-input.wide { width: 10em; }
.check-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 0.925rem; color: var(--text); padding: 4px 0; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.seg button:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.seg button[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--chip); font-family: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.chip .ico { width: 15px; height: 15px; color: var(--link); }
.chip:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Windows ----- */
.dialog { margin: auto; border: 1px solid var(--surface-border); border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 16px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); }
.dialog--narrow { width: min(420px, calc(100vw - 16px)); }
.dialog--wide { width: min(680px, calc(100vw - 16px)); }
.dialog::backdrop { background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(6px); }
.dialog[open] { animation: pop 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }
.dialog-head { padding: 18px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-title { margin: 0; font-size: 1.15rem; }
.dialog-close { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-strong); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: border-color 0.2s ease, color 0.2s ease; }
.dialog-close:hover { border-color: var(--brand); color: var(--link); }
.dialog-body { padding: 20px; overflow-y: auto; max-height: calc(100vh - 210px); display: flex; flex-direction: column; gap: 14px; }
.dialog-actions { padding: 14px 20px; border-top: 1px solid var(--surface-border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.confirm-message { margin: 0; color: var(--text); }
.help-body h3 { margin: 6px 0 0; font-size: 1rem; }
.help-body p { margin: 0; color: var(--text-2); }

/* ----- Toasts ----- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; background: #0a0a14; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); border-left: 4px solid var(--brand); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); min-width: 260px; max-width: 420px; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; animation: slideIn 0.3s ease; transition: opacity 0.3s ease, transform 0.3s ease; }
.toast button { background: none; border: 0; padding: 0; color: #c4b5fd; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.toast.leaving { opacity: 0; transform: translateX(40px); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.toast.good { border-left-color: #4ade80; }
.toast.bad { border-left-color: #f87171; }

/* ----- Information sections ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); padding: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.step-card { position: relative; padding-top: 24px; }
.step-num { position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; color: var(--text-2); }


/* ===== Clock components ===== */

/* ----- The site's text rules (p, ul, li, headings) must not reach the tool: same weight as the site's, loaded later ----- */
:where(.app-shell) p, :where(.app-shell) ul, :where(.app-shell) ol, :where(.app-shell) li, :where(.dialog) p, :where(.ringing) p { margin: 0; line-height: 1.5; }
:where(.app-shell) ul, :where(.app-shell) ol { padding: 0; list-style: none; }
:where(.app-shell) h2, :where(.app-shell) h3, :where(.dialog) h3, :where(.ringing) h2 { margin: 0; line-height: 1.25; }

/* ----- The clock's own colours ----- */
:root {
    --hand-h: #0a0a14;
    --hand-m: #374151;
    --hand-s: #e11d48;
    --face: #ffffff;
    --face-line: #d1d5db;
    --mark: #9ca3af;
    --ring-bg: #e5e7eb;
    --accent: #6d28d9;
    --accent-soft: rgba(124, 58, 237, 0.08);
    --stop: #b91c1c;
    --run: #16a34a;
}
:root:not([data-theme="light"]) {
    --hand-h: #f3f4f6;
    --hand-m: #c7cbd3;
    --hand-s: #fb7185;
    --face: #101019;
    --face-line: #2f2f3b;
    --mark: #565c69;
    --ring-bg: #2c2c36;
    --accent: #c4b5fd;
    --accent-soft: rgba(196, 181, 253, 0.1);
    --stop: #dc2626;
    --run: #4ade80;
}

/* ----- Layout of a tab ----- */
.app-toolbar .view-tabs { flex: 0 1 auto; overflow-x: auto; scrollbar-width: thin; }
.toolbar-right { margin-left: auto; } /* when the toolbar wraps, the buttons stay on the right, under the tabs */
.view-tab { display: inline-flex; align-items: center; gap: 7px; position: relative; }
.view-tab .ico { width: 16px; height: 16px; }
.tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #6d28d9; color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center; }
.view-tab.active .tab-badge { background: #fff; color: #5b21b6; }
.tab-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--run); animation: blink 1.6s ease-in-out infinite; }
.view-tab.active .tab-dot { background: #fff; }
@keyframes blink { 50% { opacity: 0.3; } }
.screen { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-head h2 { font-size: 1.5rem; color: var(--text-strong); }
.lead { margin-top: 4px; color: var(--text-2); max-width: 72ch; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions.end { justify-content: flex-end; }
.banner { display: flex; align-items: center; gap: 10px 14px; padding: 12px 16px; margin: 0 0 1.25rem; border-radius: 14px; border: 1px solid var(--tint-brand-border); background: var(--tint-brand); font-size: 0.925rem; color: var(--text); }
.banner .ico { color: var(--link); }
.banner-text { flex: 1 1 220px; font-weight: 600; }
.care-line { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--text); padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); }
.care-line .ico { color: var(--warn); margin-top: 2px; }
.card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); padding: 20px; min-width: 0; }
.chip[aria-pressed="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.seg button[aria-pressed="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.chips-label { color: var(--text-2); font-size: 0.875rem; font-weight: 600; align-self: center; }
.time-big { font-family: 'Inter', system-ui, sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1; color: var(--text-strong); }
.controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn.big { padding: 14px 32px; font-size: 1.05rem; min-width: 150px; }
.btn-primary.btn-stop { background: var(--stop); box-shadow: 0 4px 15px rgba(185, 28, 28, 0.3); }
.btn-primary.btn-stop:hover:not(:disabled) { box-shadow: 0 8px 25px rgba(185, 28, 28, 0.4); }
.empty-state { text-align: center; color: var(--text-2); padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ico.big { width: 40px; height: 40px; stroke-width: 1.5; color: var(--text-3); }
.ico.huge { width: 72px; height: 72px; stroke-width: 1.4; }
#i-play { fill: currentColor; stroke: none; }

/* ----- Switches: a 52 x 44 button; the track and the knob are drawn inside it ----- */
.switch-row { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 0.925rem; color: var(--text-strong); }
.dialog .switch-row { display: flex; }
.switch-row .hint { font-weight: 400; display: block; margin-top: 2px; }
.switch { position: relative; width: 52px; height: 44px; flex: none; padding: 0; border: 0; background: transparent; cursor: pointer; }
.switch::before { content: ""; position: absolute; left: 3px; top: 8px; width: 46px; height: 28px; border-radius: 14px; background: var(--line-strong); transition: background 0.2s ease; }
.switch::after { content: ""; position: absolute; top: 12px; left: 7px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s ease; }
.switch[aria-checked="true"]::before { background: var(--gradient-brand); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 16px; }

/* ----- The Clock tab ----- */
.clock-hero { display: grid; gap: 24px; align-items: center; grid-template-columns: minmax(0, 1fr); padding: 32px 24px; }
@media (min-width: 760px) { .clock-hero { grid-template-columns: 1.3fr 1fr; padding: 40px 48px; } }
.clock-digital { text-align: center; min-width: 0; }
@media (min-width: 760px) { .clock-digital { text-align: left; } }
.time-row { display: flex; align-items: flex-end; justify-content: center; gap: 10px; }
@media (min-width: 760px) { .time-row { justify-content: flex-start; } }
#clockTime { font-size: clamp(3.6rem, 15vw, 7rem); }
.time-side { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding-bottom: 6px; }
.time-sec { font-size: clamp(1.2rem, 5vw, 2rem); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); line-height: 1; }
.time-ampm { font-size: 0.95rem; font-weight: 700; color: var(--accent); letter-spacing: 0.06em; }
.clock-date { margin-top: 16px; font-size: 1.15rem; font-weight: 600; color: var(--text-strong); }
.clock-zone { color: var(--text-2); font-size: 0.95rem; margin-top: 2px; }
.clock-analog { display: flex; justify-content: center; }
.analog { width: min(280px, 70vw); height: auto; display: block; }
.analog .face { fill: var(--face); stroke: var(--face-line); stroke-width: 2; }
.analog .hand { stroke-linecap: round; transform-origin: 100px 100px; }
.analog .hand.hour { stroke: var(--hand-h); stroke-width: 6; }
.analog .hand.min { stroke: var(--hand-m); stroke-width: 4; }
.analog .hand.sec { stroke: var(--hand-s); stroke-width: 1.8; }
.analog .pin { fill: var(--hand-s); }
.analog .mark { stroke: var(--mark); stroke-width: 1; }
.analog .mark.major { stroke: var(--text-strong); stroke-width: 2.4; }
.analog .num { fill: var(--text-strong); font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.analog .hand { transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1); }
.analog[data-style="minimal"] .mark:not(.major), .analog[data-style="minimal"] .num { display: none; }
.analog[data-style="minimal"] .face { stroke: transparent; }
.analog[data-style="numbers"] .mark:not(.major) { display: none; }
.analog[data-style="marks"] .num { display: none; }
.analog[data-style="bold"] .hand.hour { stroke-width: 9; }
.analog[data-style="bold"] .hand.min { stroke-width: 6; }
.analog[data-style="bold"] .num { display: none; }
.analog[data-style="bold"] .mark.major { stroke-width: 4; }
.analog[data-style="accent"] .hand.hour, .analog[data-style="accent"] .hand.min { stroke: var(--accent); }
.analog[data-style="accent"] .face { fill: var(--accent-soft); stroke: var(--accent); }
.analog[data-style="accent"] .num { display: none; }
.clock-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
.field.inline .label { white-space: nowrap; }

/* ----- Alarms ----- */
.alarm-form { display: flex; flex-direction: column; gap: 18px; }
.alarm-form h3 { font-size: 1.1rem; color: var(--text-strong); }
.form-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.alarm-form input[type="time"].input { width: 100%; max-width: 12em; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.days { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.day { flex: 1 1 0; min-width: 44px; max-width: 64px; min-height: 40px; padding: 8px 0; border-radius: 12px; border: 1px solid var(--chip-border); background: var(--surface); color: var(--text-2); font-family: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease; }
.day:hover { border-color: var(--brand); color: var(--link); }
.day[aria-pressed="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.day:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.rings-text { font-weight: 600; color: var(--text-strong); min-height: 44px; display: flex; align-items: center; }
.alarm-list { display: flex; flex-direction: column; gap: 10px; }
.alarm { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); }
.alarm-main { min-width: 0; }
.alarm.off .alarm-time { color: var(--text-3); font-weight: 500; }
.alarm.off .alarm-meta { color: var(--text-2); }
.alarm-time { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; color: var(--text-strong); }
.alarm-time small { font-size: 0.9rem; font-weight: 600; margin-left: 4px; color: var(--text-2); }
.alarm-meta { color: var(--text); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.alarm-label { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.alarm-meta .next { color: var(--text-2); }
.alarm-meta .snoozed { color: var(--warn); font-weight: 600; }
.alarm-meta .missed { color: var(--bad); font-weight: 600; }
.alarm-actions { display: flex; align-items: center; gap: 4px; }

/* ----- Timer ----- */
.timer-card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.ring-wrap { position: relative; width: min(300px, 78vw); margin: 0 auto 24px; }
.ring { width: 100%; height: auto; transform: rotate(-90deg); display: block; }
.ring-bg { fill: none; stroke: var(--ring-bg); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--brand); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 339.292; stroke-dashoffset: 0; transition: stroke-dashoffset 0.25s linear, stroke 0.3s; }
.timer-card.done .ring-fg { stroke: var(--run); }
.timer-card.paused .ring-fg { stroke: var(--warn); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 8%; }
.timer-time { font-size: clamp(2.4rem, 11vw, 3.8rem); }
.timer-time.long { font-size: clamp(1.9rem, 8vw, 2.9rem); }
.ring-center .hint { font-size: 0.9rem; color: var(--text-2); }
.timer-setup { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.steppers { display: flex; justify-content: center; gap: 12px; }
.stepper { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.stepper .input { width: 84px; text-align: center; font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; padding: 8px 4px; -moz-appearance: textfield; appearance: textfield; }
.stepper .input::-webkit-outer-spin-button, .stepper .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-btn.icon-btn { width: 44px; height: 38px; border: 1px solid var(--chip-border); background: var(--surface); }
.unit { font-size: 0.75rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
#timerPresets { justify-content: center; }

/* ----- Stopwatch ----- */
.sw-card { text-align: center; }
.sw-display { padding: 16px 0 0; }
#swMain { font-size: clamp(3rem, 14vw, 6rem); }
#swMain.long { font-size: clamp(2.2rem, 10vw, 5rem); }
#swMain.xlong { font-size: clamp(1.8rem, 7.5vw, 4.2rem); }
.laps { padding: 8px 0; }
.laps-head, .lap { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 10px 24px; align-items: center; }
.laps-head { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--surface-border); }
.laps-head span:not(:first-child), .lap span:not(:first-child) { text-align: right; }
.lap-list { margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.lap-list:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.lap { font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--surface-border); color: var(--text); }
.lap:last-child { border-bottom: 0; }
.lap .n { color: var(--text-2); font-weight: 600; }
.lap.best .split { color: var(--ok); font-weight: 700; }
.lap.worst .split { color: var(--bad); font-weight: 700; }
.lap.live { color: var(--text-2); }
.lap-tag { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-right: 8px; }

/* ----- World clock ----- */
.add-city { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.add-city .field.grow { flex: 1 1 260px; }
.world-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .world-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .world-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.city { position: relative; padding: 18px 20px; background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-lg); box-shadow: var(--surface-shadow); display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.city:hover { transform: translateY(-3px); box-shadow: var(--surface-hover-shadow); }
.city.local { border-color: var(--brand); }
.city-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.city-names { min-width: 0; }
.city-name { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong); overflow-wrap: anywhere; }
.city-region { color: var(--text-2); font-size: 0.82rem; }
.city-sky { color: var(--text-3); margin-left: auto; display: inline-flex; }
.city-sky .ico { width: 18px; height: 18px; }
.city-sky.is-day { color: var(--warn); }
.city:not(.local) .city-sky { margin-right: 36px; }
.city-time { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; color: var(--text-strong); }
.city-time small { font-size: 0.9rem; font-weight: 600; color: var(--text-2); margin-left: 4px; }
.city-meta { color: var(--text-2); font-size: 0.875rem; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.city-meta .diff { color: var(--text); font-weight: 600; }
.city-remove { position: absolute; top: 8px; right: 8px; }
.city-remove:hover { border-color: var(--danger); color: var(--danger); }

/* ----- Windows ----- */
.dialog .field > .label { font-weight: 600; font-size: 0.85rem; color: var(--text-strong); }
.dialog-form { display: flex; flex-direction: column; margin: 0; max-height: calc(100vh - 34px); }
.set-group { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--surface-border); }
.set-group:first-child { border-top: 0; padding-top: 0; }
.set-group h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.range { flex: 1 1 160px; min-height: 32px; accent-color: var(--brand); margin: 0; }
.shortcuts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.shortcuts li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shortcuts li span:last-child { color: var(--text-2); text-align: right; }
.help-body .examples { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; font-size: 0.925rem; color: var(--text); }
.help-body .examples li { list-style: disc; }
.help-body:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ----- The full screen clock: the tool's own window over everything ----- */
.focus { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 24px; border: 0; background: #ffffff; color: var(--text-strong); }
:root:not([data-theme="light"]) .focus { background: #0a0a14; }
.focus[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.focus::backdrop { background: #0a0a14; }
.focus-time { font-family: 'Inter', system-ui, sans-serif; font-size: clamp(3.5rem, 17vw, 15rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; line-height: 1; white-space: nowrap; display: flex; align-items: baseline; gap: 0.08em; color: var(--text-strong); }
.focus-time small { font-size: 0.22em; font-weight: 700; color: var(--accent); letter-spacing: 0.04em; }
.focus-date { font-size: clamp(1rem, 3vw, 1.6rem); color: var(--text-2); }
.focus-close { position: absolute; bottom: 24px; opacity: 0; transition: opacity 0.3s; }
.focus:hover .focus-close, .focus-close:focus-visible, .focus.show-ui .focus-close { opacity: 1; }

/* ----- The ringing window ----- */
.ringing { margin: auto; width: min(460px, calc(100vw - 16px)); max-height: calc(100vh - 32px); padding: 32px 24px; border: 1px solid var(--surface-border); border-radius: 24px; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); text-align: center; }
.ringing::backdrop { background: rgba(10, 10, 20, 0.72); backdrop-filter: blur(8px); }
.ringing-inner { display: flex; flex-direction: column; align-items: center; }
.ringing-inner > .ico { color: var(--link); }
.ring-anim { animation: swing 0.8s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes swing { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
.ringing-time { font-family: 'Inter', system-ui, sans-serif; font-size: clamp(2.6rem, 12vw, 4.4rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1; margin-top: 12px; color: var(--text-strong); }
.ringing-title { font-size: 1.4rem; font-weight: 700; margin-top: 10px; color: var(--text-strong); overflow-wrap: anywhere; }
.ringing-sub { color: var(--text-2); margin-top: 6px; overflow-wrap: anywhere; }
.ringing .controls { margin-top: 24px; }

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-toolbar { gap: 10px; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .status-pill { min-width: 0; flex: 1 1 auto; }
    /* five tabs at 16 px do not fit one row on a phone: three, then two wider ones */
    .app-toolbar .view-tabs { width: 100%; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; border-radius: 24px; }
    .view-tab { grid-column: span 2; justify-content: center; padding: 8px 6px; gap: 5px; min-width: 0; }
    .view-tab:nth-child(n+4) { grid-column: span 3; }
    .toolbar-right .btn { flex: 1 1 auto; }
    .card { padding: 16px; }
    .clock-hero { padding: 24px 16px; }
    .alarm { padding: 12px 14px; }
    .laps-head, .lap { padding: 10px 14px; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); }
    .toasts { bottom: 16px; right: 16px; left: 16px; align-items: stretch; }
    .toast { min-width: 0; max-width: none; }
    .dialog-body, .dialog-head, .dialog-actions { padding-left: 16px; padding-right: 16px; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
}
@media (max-width: 459px) {
    .stepper .input { width: 72px; font-size: 1.3rem; }
    .steppers { gap: 8px; }
    .view-tab .ico { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .btn, .info-card, .dialog, .dialog[open], .toast, .seg button, .chip, .view-tab, .switch::before, .switch::after, .city, .day,
    .analog .hand, .ring-fg, .focus-close, .ring-anim, .tab-dot, .ringing { transition: none; animation: none; }
}
@media (forced-colors: active) {
    .analog .hand, .analog .mark, .ring-fg { stroke: CanvasText; }
}
/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026). The clocks and the ring are drawings. */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"],
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]) { min-height: 44px; }
    main .seg button, main .view-tab, main .chip, main .day { min-height: 44px; }
    main .icon-btn, main .step-btn.icon-btn { width: 44px; height: 44px; min-width: 44px; }
    main :is(p, li, .hint, .label, .status-main, .status-sub, .form-hint, .input, .select, kbd, .seg button, .chip, .muted,
        .lead, .alarm-meta, .city-meta, .city-region, .unit, .chips-label, .care-line, .banner, .lap, .laps-head, .rings-text,
        .clock-zone, .day, .view-tab, .lap-tag) { font-size: 1rem; }
    .dialog button, .dialog .btn, .dialog select, .dialog input:not([type="checkbox"]):not([type="range"]) { min-height: 44px; }
    .dialog .dialog-close, .dialog .icon-btn { width: 44px; height: 44px; }
    .dialog .range { min-height: 44px; }
    .dialog :is(p, .hint, .label, .input, li, .switch-row, kbd) { font-size: 1rem; }
    .ringing :is(p, .btn) { font-size: 1rem; }
    .ringing .btn { min-height: 44px; }
}
