:root {
  color-scheme: dark;
  --bg: #10221e;
  --text: #f0ecdc;
  --muted: #b0bcb4;
  --gold: #dbc088;
  --line: #ffffff20;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at 13% 30%, #203c30 0%, var(--bg) 52%, #0b1815 100%); color: var(--text); }
button, input { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button, input { color: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button { border: 0; }
button:hover { filter: brightness(1.14); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
::selection { color: var(--bg); background: var(--gold); }
.page { max-width: 1300px; margin: auto; padding: 0 54px; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 35px 0 29px; border-bottom: 1px solid var(--line); }
.wordmark { font: 24px Georgia, serif; letter-spacing: 5px; }
.wordmark span { display: block; font: 11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--muted); letter-spacing: .3px; margin-top: 9px; }
.clock-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, 1fr); align-items: center; gap: 70px; padding: 64px 0 60px; }
.dial { position: relative; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 30px 65px #0005, 0 0 0 1px #ddc99330; overflow: hidden; }
.dial img { display: block; width: 100%; height: 100%; }
.dial svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: #000; stroke: #000; stroke-linecap: round; }
.dial-caption { color: var(--muted); font-size: 11px; text-align: center; margin: 28px 0 0; letter-spacing: .4px; }
.dial-caption span { display: inline-block; color: var(--gold); font-size: 17px; margin-right: 8px; vertical-align: -1px; }
.eyebrow { color: var(--gold); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; display: flex; align-items: center; gap: 9px; }
.status-dot { width: 6px; height: 6px; background: #9dbfa0; border-radius: 50%; box-shadow: 0 0 10px #9dbfa030; }
.status-dot.exploring { background: var(--gold); box-shadow: none; }
h1 { font: normal clamp(34px, 3.6vw, 48px)/1.1 Georgia, serif; letter-spacing: -1.6px; margin: 22px 0 31px; }
.maya-display { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; color: var(--gold); }
.maya-display > div { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.maya-display output, .colon { font: 400 clamp(38px, 4.5vw, 58px)/1.1 "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; letter-spacing: -3px; }
.maya-display output { min-width: 2ch; text-align: center; }
.maya-display > div > span { font-size: 10px; color: var(--muted); margin-top: 9px; white-space: nowrap; }
.colon { opacity: .5; font-size: 35px; padding-top: 6px; }
.civil-row { margin-top: 29px; padding: 19px 0 22px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.civil-row > div { display: flex; flex-direction: column; gap: 7px; }
.small-label { font-size: 9px; letter-spacing: 1.8px; color: var(--muted); }
#civil-time { font: 18px "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; }
.time-zone { color: var(--muted); font-size: 11px; text-align: right; overflow-wrap: anywhere; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; background: #0003; padding: 4px; border-radius: 9px; border: 1px solid var(--line); gap: 4px; }
.mode-switch button { border-radius: 6px; background: transparent; color: var(--muted); padding: 12px 8px; font-size: 12px; }
.mode-switch button[aria-pressed="true"] { color: #14251f; background: var(--gold); box-shadow: 0 2px 6px #0003; }
.control-note { font-size: 11px; color: var(--muted); line-height: 1.7; margin: 15px 0 0; }
#explore-controls { padding-top: 18px; }
.time-input-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
input[type="time"] { background: #0003; border: 1px solid #ffffff30; border-radius: 6px; padding: 9px 10px; font-size: 14px; max-width: 165px; }
input[type="range"] { width: 100%; margin: 20px 0 3px; accent-color: var(--gold); cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font: 9px monospace; }
.shortcuts { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.shortcuts button { background: #ffffff09; border: 1px solid var(--line); border-radius: 5px; padding: 9px 12px; font-size: 11px; color: var(--text); }
.input-error { color: #ffbdad; font-size: 12px; line-height: 1.5; }
.input-error:empty { display: none; }
.rhythm-note { font-size: 10px; line-height: 1.8; color: var(--muted); margin: 27px 0 0; }
.rhythm-note > span:first-child { color: var(--gold); }
.approx { display: inline-block; margin-left: 8px; }
.about { display: grid; grid-template-columns: 1fr 1.4fr; gap: 80px; border-top: 1px solid var(--line); padding: 40px 0 50px; scroll-margin-top: 25px; }
h2 { font: normal 30px/1.2 Georgia, serif; letter-spacing: -.7px; margin: 15px 0 0; }
.about-copy { font-size: 13px; color: var(--muted); line-height: 1.8; }
.about-copy p:first-child { margin-top: 0; }
strong { font-weight: 500; color: var(--text); }
details { margin-top: 24px; border-top: 1px solid var(--line); }
summary { padding-top: 17px; color: var(--gold); list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary span { font-size: 20px; font-weight: 300; }
details[open] summary span { transform: rotate(45deg); }
.details-content { padding-top: 16px; }
code { display: block; color: var(--gold); line-height: 1.9; padding: 14px 18px; background: #0003; border-left: 2px solid #dbc08880; font-size: 12px; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 0 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.6; }
.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 (min-width: 1200px) { .readings { padding-right: 12px; } }
@media (max-width: 1000px) {
  .page { padding: 0 32px; }
  .clock-layout { gap: 35px; grid-template-columns: minmax(0, 1fr) minmax(310px, 1fr); padding-top: 48px; }
  .about { gap: 45px; }
}
@media (max-width: 720px) {
  .page { padding: 0 24px; max-width: 560px; }
  .masthead { padding: 25px 0 23px; gap: 15px; }
  .wordmark { font-size: 20px; letter-spacing: 4px; }
  .wordmark span { font-size: 10px; letter-spacing: 0; }
  .clock-layout { grid-template-columns: minmax(0, 1fr); gap: 35px; padding: 33px 0 35px; }
  .dial-section { max-width: 430px; width: 100%; justify-self: center; }
  .dial-caption { font-size: 10px; margin-top: 19px; }
  h1 { font-size: 35px; margin: 17px 0 25px; }
  h1 br { display: none; }
  .maya-display { justify-content: space-around; }
  .maya-display output { font-size: 54px; }
  .colon { font-size: 33px; }
  .about { grid-template-columns: minmax(0, 1fr); gap: 25px; padding: 30px 0; }
  h2 { font-size: 28px; }
  h2 br { display: none; }
  footer { flex-direction: column; gap: 6px; }
}
@media (max-width: 360px) {
  .page { padding: 0 16px; }
  .wordmark span { max-width: 150px; line-height: 1.5; }
  .maya-display output { font-size: 46px; }
}

.header-controls { display: flex; align-items: center; gap: 22px; }
#language-select { font: inherit; font-size: 12px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; max-width: 100%; cursor: pointer; }
@media (max-width: 720px) {
  .masthead { flex-wrap: wrap; }
  .header-controls { width: 100%; justify-content: flex-end; gap: 12px; }
}

/* Keep numeric sequences and the time slider consistent in RTL languages. */
.maya-display, #civil-time, #preview-time, #day-slider, .range-labels,
.details-content code, .time-zone { direction: ltr; unicode-bidi: isolate; }
#civil-time { text-align: start; }
.readings, .about-copy, .about-intro { min-width: 0; }
h1, h2, .about-copy { overflow-wrap: anywhere; }
html:lang(ar) h1, html:lang(ar) h2,
html:lang(ur) h1, html:lang(ur) h2,
html:lang(fa) h1, html:lang(fa) h2,
html:lang(hi) h1, html:lang(hi) h2,
html:lang(bn) h1, html:lang(bn) h2,
html:lang(pa) h1, html:lang(pa) h2,
html:lang(mr) h1, html:lang(mr) h2,
html:lang(te) h1, html:lang(te) h2,
html:lang(ta) h1, html:lang(ta) h2 { letter-spacing: normal; line-height: 1.35; }
[dir="rtl"] .eyebrow, [dir="rtl"] .small-label,
[dir="rtl"] .dial-caption, [dir="rtl"] .wordmark span { letter-spacing: normal; }
[dir="rtl"] .approx { margin-left: 0; margin-right: 8px; }
#language-select { max-width: 230px; }
@media (max-width: 720px) {
  #language-select { max-width: 65%; }
}

/* Allow long translated unit names to wrap on compact screens. */
.maya-display > div { flex: 1; }
.maya-display > div > span { white-space: normal; text-align: center; line-height: 1.5; }

.legal-links { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px 18px; text-align: end; }
.legal-links a:hover { color: var(--gold); text-decoration: underline; }
@media (max-width: 720px) { .legal-links { justify-content: flex-start; text-align: start; } }

footer { flex-wrap: wrap; }
.copyright { flex-basis: 100%; width: 100%; margin: 0; text-align: center; line-height: 1.8; }
.copyright a:hover { color: var(--gold); text-decoration: underline; }
@media (max-width: 720px) { .copyright { flex-basis: auto; margin-top: 12px; } }
