/* ManTime (من تایم) design system
   Plain modern CSS, mobile-first, custom-property theming, RTL-first. */

@font-face {
  font-family: "Yekan";
  src: url("../fonts/yekan.fcb37b924ab4.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --mt-font-fa: "Yekan", "Vazirmatn", "Tahoma", system-ui, -apple-system, "Segoe UI", sans-serif;

  --mt-space-1: 0.25rem;
  --mt-space-2: 0.5rem;
  --mt-space-3: 0.75rem;
  --mt-space-4: 1rem;
  --mt-space-6: 1.5rem;
  --mt-space-8: 2rem;
  --mt-space-12: 3rem;

  --mt-radius: 0.75rem;
  --mt-radius-sm: 0.4rem;

  --mt-color-primary: #1e6f5c;
  --mt-color-secondary: #0f766e;
  --mt-color-accent: #f59e0b;

  --mt-bg: #f7f8f7;
  --mt-surface: #ffffff;
  --mt-text: #16221e;
  --mt-text-muted: #5b6b64;
  --mt-border: #e1e6e3;
  --mt-danger: #b3261e;
  --mt-ok: #1e7d43;
}

:root[data-theme="dark"] {
  --mt-bg: #101513;
  --mt-surface: #1a2320;
  --mt-text: #eef3f0;
  --mt-text-muted: #9db2aa;
  --mt-border: #2b3733;
  --mt-danger: #f2938c;
  --mt-ok: #6ee7a0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mt-bg: #101513;
    --mt-surface: #1a2320;
    --mt-text: #eef3f0;
    --mt-text-muted: #9db2aa;
    --mt-border: #2b3733;
    --mt-danger: #f2938c;
    --mt-ok: #6ee7a0;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--mt-font-fa);
  background: var(--mt-bg);
  color: var(--mt-text);
  line-height: 1.7;
  font-size: 1rem;
}

h1, h2, h3 { line-height: 1.35; margin: 0 0 var(--mt-space-4); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 var(--mt-space-4); }

a { color: var(--mt-color-secondary); text-decoration: none; }
a:hover { text-decoration: underline; }

.mt-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--mt-space-4);
}

/* ---------- Header ---------- */
.mt-header {
  background: var(--mt-surface);
  border-bottom: 1px solid var(--mt-border);
  /* Without its own stacking context, the mobile dropdown nav below
     (position: absolute, but z-index: auto) loses to any *later*
     positioned element on the page that also has z-index: auto --
     e.g. the qibla compass, a clock face, or a search-results dropdown
     on /prayer-times/ -- since same-z-index stacking falls back to DOM
     order, and those all come after the header in the document. That
     was the open-menu-looks-broken-and-tangled-with-page-content bug. */
  position: relative;
  z-index: 1000;
}
.mt-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--mt-space-3) var(--mt-space-4);
}
.mt-brand { display: flex; align-items: center; gap: var(--mt-space-3); color: var(--mt-text); }
.mt-brand:hover { text-decoration: none; }
.mt-brand__logo { width: 64px; height: 64px; border-radius: var(--mt-radius-sm); }
.mt-brand__name { font-weight: 700; font-size: 1.1rem; }

@media (max-width: 480px) {
  .mt-brand__logo { width: 48px; height: 48px; }
}

.mt-nav { display: flex; align-items: center; gap: var(--mt-space-4); }
.mt-nav a { color: var(--mt-text); }
.mt-nav-toggle {
  display: none;
  background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--mt-text);
}
.mt-theme-toggle {
  background: none; border: 1px solid var(--mt-border); border-radius: var(--mt-radius-sm);
  padding: var(--mt-space-1) var(--mt-space-2); cursor: pointer;
}

@media (max-width: 720px) {
  .mt-nav-toggle { display: block; }
  .mt-nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    background: var(--mt-surface);
    border-bottom: 1px solid var(--mt-border);
    padding: var(--mt-space-4);
    gap: var(--mt-space-3);
  }
  .mt-nav.is-open {
    display: flex;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  }
  .mt-header__inner { position: relative; }
}

/* Dims + blocks the rest of the page while the mobile drawer is open,
   and doubles as the tap target for "close on click outside" (see
   static/js/nav.js). Sits just under the header's own z-index so the
   open .mt-nav (inside the header) still paints above it. */
.mt-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
}
.mt-nav-backdrop[hidden] { display: none; }

/* Prevents the page behind the open drawer from scrolling. */
body.mt-nav-open-lock { overflow: hidden; }

/* ---------- Layout ---------- */
.mt-main { padding: var(--mt-space-8) var(--mt-space-4); min-height: 60vh; }
.mt-footer {
  border-top: 1px solid var(--mt-border);
  color: var(--mt-text-muted);
  padding: var(--mt-space-6) 0;
  font-size: 0.875rem;
}
.mt-footer__inner { display: flex; justify-content: center; text-align: center; }
.mt-footer__inner p { margin: 0; }
.mt-footer__inner a { color: var(--mt-color-secondary); font-weight: 600; }

/* ---------- Cards ---------- */
.mt-card {
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  padding: var(--mt-space-6);
  margin-bottom: var(--mt-space-6);
}
.mt-card--narrow { max-width: 420px; margin-inline: auto; }
.mt-card--link { display: block; text-align: center; padding: var(--mt-space-4); }

/* ---------- Grid ---------- */
.mt-grid { display: grid; gap: var(--mt-space-4); }
.mt-grid--3 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

@media (max-width: 480px) {
  .mt-grid--3 { grid-template-columns: repeat(2, 1fr); gap: var(--mt-space-2); }
}

/* ---------- Buttons ---------- */
.mt-btn {
  display: inline-block;
  border: 1px solid var(--mt-border);
  background: var(--mt-surface);
  color: var(--mt-text);
  padding: var(--mt-space-2) var(--mt-space-4);
  border-radius: var(--mt-radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}
.mt-btn--primary {
  background: var(--mt-color-primary);
  border-color: var(--mt-color-primary);
  color: #fff;
}
.mt-btn--ghost {
  background: transparent;
  border-color: var(--mt-color-secondary);
  color: var(--mt-color-secondary);
}
.mt-btn--ghost:hover { background: color-mix(in srgb, var(--mt-color-secondary) 10%, transparent); text-decoration: none; }

/* ---------- Forms ---------- */
.mt-form { display: flex; flex-direction: column; gap: var(--mt-space-2); max-width: 480px; }
.mt-form input, .mt-form select, .mt-form textarea {
  font-family: inherit;
  padding: var(--mt-space-2) var(--mt-space-3);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  background: var(--mt-bg);
  color: var(--mt-text);
}

/* Iranian-format (Persian-digit) stepper time picker, replacing native
   <input type="time"> whose digit glyphs/layout follow the browser/OS
   locale and can't be forced to Persian numerals -- see time-input.js
   and calendars/_time_picker.html. */
.mt-time-picker {
  /* Time values read left-to-right (HH:MM) regardless of the page's RTL
     direction -- same convention as IPs/ports/domains elsewhere on this
     site. Without this, the page's inherited `direction: rtl` reverses
     the visual order of the flex children below: the hour segment
     (first in DOM) renders on the RIGHT and minute (last in DOM) on the
     LEFT, so a user typing left-to-right ends up typing the hour into
     the minute segment and vice versa -- exactly the reported bug
     ("entered 16:23, got told 23:16"). */
  direction: ltr;
  display: inline-flex;
  align-items: center;
  gap: var(--mt-space-3);
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  padding: var(--mt-space-3) var(--mt-space-6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mt-time-picker__segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mt-space-1);
}

.mt-time-picker__step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 1px solid var(--mt-border);
  background: var(--mt-bg);
  color: var(--mt-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.mt-time-picker__step:hover {
  background: color-mix(in srgb, var(--mt-color-primary) 14%, transparent);
  color: var(--mt-color-primary);
}
.mt-time-picker__step:active { transform: scale(0.9); }

.mt-time-picker__value {
  width: 2.8rem;
  border: none;
  background: transparent;
  color: var(--mt-text);
  font-family: inherit;
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 0;
  border-radius: var(--mt-radius-sm);
}
.mt-time-picker__value:focus {
  outline: 2px solid var(--mt-color-primary);
  outline-offset: 2px;
}

.mt-time-picker__unit-label { font-size: 0.68rem; color: var(--mt-text-muted); }

.mt-time-picker__colon {
  font-size: 2rem;
  font-weight: 800;
  color: var(--mt-text-muted);
  align-self: center;
  margin-top: -0.9rem;
}

.mt-form-label { font-weight: 600; font-size: 0.9rem; }

@media (max-width: 480px) {
  .mt-time-picker { padding: var(--mt-space-2) var(--mt-space-3); gap: var(--mt-space-2); }
  .mt-time-picker__value { font-size: 1.6rem; width: 2.3rem; }
  .mt-time-picker__colon { font-size: 1.6rem; margin-top: -0.7rem; }
  .mt-time-picker__step { width: 1.6rem; height: 1.6rem; }
}

/* ---------- Tables ---------- */
.mt-table-scroll { overflow-x: auto; }
.mt-table { width: 100%; border-collapse: collapse; }
.mt-table th, .mt-table td {
  border: 1px solid var(--mt-border);
  padding: var(--mt-space-2) var(--mt-space-3);
  text-align: start;
}
.mt-calendar-grid th, .mt-calendar-grid td { text-align: center; }
.mt-day--holiday { background: color-mix(in srgb, var(--mt-danger) 15%, transparent); }

/* Key-value list -- a mobile-safe alternative to a 2-column <table> for
   short label/value pairs (e.g. NTP status). Rows are a flex row on wide
   screens and stack to a column on narrow ones, so long values (an IP
   address, a hostname) never get squeezed into a too-narrow table cell. */
.mt-kv-list {
  display: flex;
  flex-direction: column;
  gap: var(--mt-space-2);
}
.mt-kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--mt-space-3);
  padding: var(--mt-space-2) var(--mt-space-3);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  flex-wrap: wrap;
}
.mt-kv-row__label { color: var(--mt-text-muted); font-size: 0.85rem; flex-shrink: 0; }
.mt-kv-row__value { font-weight: 700; overflow-wrap: break-word; word-break: break-word; min-width: 0; }

/* ---------- Alerts / badges ---------- */
.mt-alerts { margin-bottom: var(--mt-space-4); }
.mt-alert { padding: var(--mt-space-3); border-radius: var(--mt-radius-sm); margin-bottom: var(--mt-space-2); }
.mt-alert--error { background: color-mix(in srgb, var(--mt-danger) 15%, transparent); color: var(--mt-danger); }
.mt-alert--ok, .mt-alert--success { background: color-mix(in srgb, var(--mt-ok) 15%, transparent); color: var(--mt-ok); }
.mt-alert--info { background: color-mix(in srgb, var(--mt-color-secondary) 12%, transparent); }

.mt-badge {
  display: inline-block;
  padding: var(--mt-space-1) var(--mt-space-3);
  border-radius: 999px;
  font-size: 0.85rem;
}
.mt-badge--holiday { background: color-mix(in srgb, var(--mt-danger) 18%, transparent); color: var(--mt-danger); }
.mt-badge--normal { background: color-mix(in srgb, var(--mt-text-muted) 15%, transparent); }
.mt-badge--ok { background: color-mix(in srgb, var(--mt-ok) 18%, transparent); color: var(--mt-ok); }
.mt-badge--unavailable { background: color-mix(in srgb, var(--mt-danger) 12%, transparent); color: var(--mt-danger); }

/* ---------- Today widget ---------- */
.mt-today-widget { text-align: center; }
.mt-today-widget__clock { font-size: 2.5rem; font-variant-numeric: tabular-nums; margin-bottom: var(--mt-space-2); }
.mt-today-widget__date { color: var(--mt-text-muted); margin-bottom: var(--mt-space-6); }

.mt-stat {
  display: flex;
  flex-direction: column;
  gap: var(--mt-space-1);
  padding: var(--mt-space-3);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  min-width: 0; /* allow the grid item to shrink below its content's natural width */
}
.mt-stat__label { font-size: 0.8rem; color: var(--mt-text-muted); }
.mt-stat__value {
  font-weight: 700;
  overflow-wrap: break-word;
  word-break: break-word;
}
/* A secondary line (e.g. "ماه ۷") kept visually and structurally separate
   from the main value instead of crammed inline -- avoids fragile
   Latin/Persian bidi mixing in one string on narrow screens. */
.mt-stat__sub { font-size: 0.72rem; color: var(--mt-text-muted); }

@media (max-width: 480px) {
  .mt-stat { padding: var(--mt-space-2); }
  .mt-stat__value { font-size: 0.92rem; }
}

.mt-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--mt-space-2); }

.mt-month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--mt-space-4); }

/* ---------- Big visual calendar (homepage + month page) ---------- */
.mt-card--calendar { padding: var(--mt-space-4) var(--mt-space-3); }

.mt-cal {
  max-width: 560px;
  margin-inline: auto;
}

.mt-cal__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--mt-space-4);
  margin-bottom: var(--mt-space-3);
}
.mt-cal__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  min-width: 10ch;
  text-align: center;
}
.mt-cal__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  border: 1px solid var(--mt-border);
  background: var(--mt-bg);
  color: var(--mt-text);
  font-size: 1.2rem;
  line-height: 1;
  transition: background 0.15s ease, transform 0.15s ease;
}
.mt-cal__nav:hover {
  background: color-mix(in srgb, var(--mt-color-primary) 12%, transparent);
  text-decoration: none;
  transform: scale(1.06);
}

.mt-cal__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--mt-space-1);
  margin-bottom: var(--mt-space-1);
  color: var(--mt-text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

.mt-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--mt-space-1);
}

.mt-cal__cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  aspect-ratio: 0.82 / 1;
  border-radius: var(--mt-radius-sm);
  background: var(--mt-bg);
  color: var(--mt-text);
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.mt-cal__cell:not(.mt-cal__cell--empty):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  border-color: var(--mt-border);
}
.mt-cal__cell--empty { background: transparent; pointer-events: none; }

.mt-cal__daynum { font-variant-numeric: tabular-nums; font-size: 1.1rem; }

/* Small Gregorian/Hijri date hints under the Jalali day number. The
   Gregorian one is always Latin digits/English abbreviation regardless
   of page language, since it's a cross-reference to the Gregorian
   calendar, not localized content; the Hijri one uses the same Persian
   month names as the rest of the site. */
.mt-cal__gdate,
.mt-cal__hdate {
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--mt-text-muted);
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.mt-cal__cell--today .mt-cal__gdate,
.mt-cal__cell--today .mt-cal__hdate,
.mt-cal__cell--holiday .mt-cal__gdate,
.mt-cal__cell--holiday .mt-cal__hdate {
  color: inherit;
  opacity: 0.75;
}

.mt-cal__dot {
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--mt-color-accent);
}

.mt-cal__cell--today {
  background: var(--mt-color-primary);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--mt-color-primary) 45%, transparent);
}
.mt-cal__cell--today .mt-cal__dot { background: #fff; }

.mt-cal__cell--holiday {
  background: color-mix(in srgb, var(--mt-danger) 16%, transparent);
  color: var(--mt-danger);
}
.mt-cal__cell--holiday.mt-cal__cell--today {
  background: var(--mt-danger);
  color: #fff;
}

.mt-cal__cell--occasion:not(.mt-cal__cell--holiday):not(.mt-cal__cell--today) {
  background: color-mix(in srgb, var(--mt-color-accent) 14%, transparent);
}

.mt-cal__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mt-space-3);
  justify-content: center;
  margin-top: var(--mt-space-4);
  font-size: 0.7rem;
  color: var(--mt-text-muted);
}
.mt-cal__swatch {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  margin-inline-end: var(--mt-space-1);
  vertical-align: middle;
}
.mt-cal__swatch--holiday { background: var(--mt-danger); }
.mt-cal__swatch--occasion { background: var(--mt-color-accent); }
.mt-cal__swatch--today { background: var(--mt-color-primary); }

.mt-cal__more { text-align: center; margin-top: var(--mt-space-4); }

@media (max-width: 640px) {
  .mt-cal { max-width: 320px; }
  .mt-cal__title { font-size: 0.95rem; min-width: 8ch; }
  .mt-cal__nav { width: 1.7rem; height: 1.7rem; font-size: 0.9rem; }
  .mt-cal__weekdays { font-size: 0.6rem; }
  .mt-cal__daynum { font-size: 0.72rem; }
  .mt-cal__gdate, .mt-cal__hdate { font-size: 0.44rem; }
}

/* ---------- Occasion / holiday lists (homepage widgets + dedicated pages) ---------- */
.mt-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--mt-space-3);
  margin-bottom: var(--mt-space-4);
}
.mt-section-head h2 { margin: 0; }

.mt-countdown {
  display: inline-flex;
  align-items: baseline;
  gap: var(--mt-space-1);
  padding: var(--mt-space-1) var(--mt-space-3);
  border-radius: 999px;
  background: color-mix(in srgb, var(--mt-danger) 14%, transparent);
  color: var(--mt-danger);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mt-countdown small { font-weight: 500; font-size: 0.75rem; }

.mt-occ-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--mt-space-2); }

.mt-occ-item {
  display: flex;
  align-items: center;
  gap: var(--mt-space-3);
  padding: var(--mt-space-2) var(--mt-space-3);
  border-radius: var(--mt-radius-sm);
  border: 1px solid var(--mt-border);
  background: var(--mt-bg);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.mt-occ-item:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); }

.mt-occ-item__date {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: var(--mt-radius-sm);
  line-height: 1.2;
}
.mt-occ-item__day { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.mt-occ-item__month { font-size: 0.65rem; }

.mt-occ-item--holiday .mt-occ-item__date {
  background: color-mix(in srgb, var(--mt-danger) 16%, transparent);
  color: var(--mt-danger);
}
.mt-occ-item--occasion .mt-occ-item__date {
  background: color-mix(in srgb, var(--mt-color-secondary) 16%, transparent);
  color: var(--mt-color-secondary);
}

.mt-occ-item__title { font-weight: 600; flex: 1; }

.mt-occ-empty { color: var(--mt-text-muted); padding: var(--mt-space-3); text-align: center; }

/* A negative top margin here used to pull this note up closer to a badge
   right above it (the "days until next holiday" countdown) -- but as a
   BLANKET rule it also pulled the note up into whatever else preceded it
   elsewhere the class is used (e.g. visually overlapping the NTP status
   list on mobile), which is a real bug, not a subtle spacing choice.
   Normal positive spacing everywhere; any one-off tightening belongs on
   a scoped selector, not this shared class. */
.mt-section-note { color: var(--mt-text-muted); font-size: 0.8rem; margin-top: var(--mt-space-2); margin-bottom: var(--mt-space-3); }

/* ---------- Small text utility ---------- */
.mt-text-muted { color: var(--mt-text-muted); }

/* ---------- Visually-hidden but screen-reader-accessible text ---------- */
.mt-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;
}

/* ---------- Qibla compass (backend/templates/calendars/qibla.html) ---------- */
.mt-qibla { text-align: center; }
.mt-qibla .mt-section-note { margin-top: var(--mt-space-4); }
.mt-qibla .mt-section-note + .mt-section-note { margin-top: var(--mt-space-2); }

.mt-compass {
  max-width: 280px;
  margin: var(--mt-space-6) auto;
}
.mt-compass__svg { width: 100%; height: auto; overflow: visible; }

.mt-compass__ring {
  fill: var(--mt-bg);
  stroke: var(--mt-border);
  stroke-width: 2;
}
.mt-compass__ring--inner { fill: none; stroke-width: 1; opacity: 0.6; }

.mt-compass__ticks line {
  stroke: var(--mt-text-muted);
  stroke-width: 2;
}

.mt-compass__cardinal {
  font-size: 0.85rem;
  font-weight: 800;
  fill: var(--mt-text);
  font-family: system-ui, sans-serif;
}

#mt-compass-dial {
  transition: transform 0.25s ease-out;
}
#mt-compass-needle {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.mt-compass__needle-north { fill: var(--mt-danger); }
.mt-compass__needle-south { fill: var(--mt-text-muted); opacity: 0.5; }
.mt-compass__hub { fill: var(--mt-surface); stroke: var(--mt-text); stroke-width: 1.5; }
.mt-compass__center-dot { fill: var(--mt-text); }
.mt-compass__kaaba { font-size: 1rem; }

/* ---------- Sleep cycle calculator (backend/templates/calendars/sleep.html) ---------- */
.mt-sleep-modes {
  display: flex;
  gap: var(--mt-space-2);
  margin-bottom: var(--mt-space-4);
  flex-wrap: wrap;
}
.mt-sleep-mode {
  flex: 1;
  min-width: 180px;
  text-align: center;
  padding: var(--mt-space-2) var(--mt-space-3);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  background: var(--mt-bg);
  color: var(--mt-text);
  font-weight: 600;
}
.mt-sleep-mode.is-active {
  background: var(--mt-color-primary);
  border-color: var(--mt-color-primary);
  color: #fff;
}

.mt-sleep-now-clock {
  text-align: center;
  color: var(--mt-text-muted);
  margin-bottom: var(--mt-space-4);
}
.mt-sleep-now-clock strong {
  color: var(--mt-text);
  font-variant-numeric: tabular-nums;
  font-size: 1.1rem;
}

.mt-sleep-timeline {
  list-style: none;
  margin: var(--mt-space-6) 0 0;
  padding-inline-start: var(--mt-space-6);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--mt-space-4);
}
.mt-sleep-timeline::before {
  content: "";
  position: absolute;
  inset-inline-start: 10px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--mt-border);
}

.mt-sleep-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mt-space-3);
  padding: var(--mt-space-3) var(--mt-space-4);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  background: var(--mt-surface);
}
.mt-sleep-item::before {
  content: "";
  position: absolute;
  inset-inline-start: calc(-1 * var(--mt-space-6) + 5px);
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mt-surface);
  border: 2px solid var(--mt-text-muted);
}
.mt-sleep-item--recommended::before {
  background: var(--mt-ok);
  border-color: var(--mt-ok);
}
.mt-sleep-item--recommended {
  border-color: var(--mt-ok);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--mt-ok) 18%, transparent);
}

.mt-sleep-item__time {
  font-size: 1.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 6.5ch;
}
.mt-sleep-item__meta {
  flex: 1;
  color: var(--mt-text-muted);
  font-size: 0.85rem;
}
.mt-sleep-item__meta strong { color: var(--mt-text); font-weight: 700; }

.mt-sleep-form {
  display: flex;
  gap: var(--mt-space-2);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--mt-space-4);
}

@media (max-width: 480px) {
  .mt-sleep-item { flex-direction: column; align-items: flex-start; }
}

/* ---------- Prayer times (backend/templates/calendars/prayer_times.html) ---------- */
.mt-prayer-search {
  display: flex;
  gap: var(--mt-space-2);
  flex-wrap: wrap;
  align-items: stretch;
  margin-bottom: var(--mt-space-2);
  position: relative;
}
.mt-prayer-search__input {
  flex: 1;
  min-width: 200px;
  padding: var(--mt-space-2) var(--mt-space-3);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  background: var(--mt-surface);
  color: var(--mt-text);
  font-family: inherit;
  font-size: 0.95rem;
}
.mt-prayer-search__results {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline: 0;
  z-index: 20;
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 280px;
  overflow-y: auto;
}
.mt-prayer-search__result {
  display: block;
  width: 100%;
  text-align: start;
  padding: var(--mt-space-2) var(--mt-space-3);
  border: none;
  background: none;
  color: var(--mt-text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}
.mt-prayer-search__result:hover,
.mt-prayer-search__result:focus {
  background: color-mix(in srgb, var(--mt-color-secondary) 10%, transparent);
}

.mt-prayer-city {
  display: flex;
  align-items: center;
  gap: var(--mt-space-2);
  flex-wrap: wrap;
  margin-bottom: var(--mt-space-4);
  font-weight: 700;
}
.mt-prayer-city__badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mt-text-muted);
  background: color-mix(in srgb, var(--mt-color-secondary) 12%, transparent);
  border-radius: 999px;
  padding: 2px var(--mt-space-2);
}

.mt-prayer-settings {
  display: flex;
  gap: var(--mt-space-4);
  flex-wrap: wrap;
  margin-bottom: var(--mt-space-6);
}
.mt-prayer-settings label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--mt-text-muted);
}
.mt-prayer-settings select {
  padding: var(--mt-space-1) var(--mt-space-2);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  background: var(--mt-surface);
  color: var(--mt-text);
  font-family: inherit;
}

.mt-prayer-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--mt-space-8);
  flex-wrap: wrap;
  padding: var(--mt-space-8) var(--mt-space-4);
  border-radius: var(--mt-radius);
  background: linear-gradient(135deg, var(--mt-color-primary), var(--mt-color-secondary));
  color: #fff;
  margin-bottom: var(--mt-space-6);
}
.mt-prayer-ring { position: relative; width: 200px; height: 200px; flex-shrink: 0; }
.mt-prayer-ring__svg { width: 200px; height: 200px; transform: rotate(-90deg); }
.mt-prayer-ring__track { fill: none; stroke: rgba(255, 255, 255, 0.22); stroke-width: 10; }
.mt-prayer-ring__progress {
  fill: none;
  stroke: var(--mt-color-accent);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.mt-prayer-ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
}
.mt-prayer-ring__icon { font-size: 1.9rem; line-height: 1; }
.mt-prayer-ring__label { font-weight: 700; font-size: 0.95rem; margin-top: 4px; }
.mt-prayer-ring__time { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.mt-prayer-ring__countdown { font-size: 0.8rem; opacity: 0.85; margin-top: 2px; direction: ltr; font-variant-numeric: tabular-nums; }
.mt-prayer-hero__info { text-align: center; }
.mt-prayer-hero__info .mt-text-muted { color: rgba(255, 255, 255, 0.75); }

.mt-prayer-timeline {
  border-radius: var(--mt-radius);
  padding: var(--mt-space-6) var(--mt-space-4) var(--mt-space-8);
  margin-bottom: var(--mt-space-6);
  transition: background 0.6s ease;
}
.mt-prayer-timeline.is-day { background: linear-gradient(180deg, #bfe3ff 0%, #eaf6ff 100%); }
.mt-prayer-timeline.is-night { background: linear-gradient(180deg, #16213b 0%, #263a63 100%); }
.mt-prayer-timeline__track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.12);
  margin: 0 var(--mt-space-3);
}
.mt-prayer-timeline.is-night .mt-prayer-timeline__track { background: rgba(255, 255, 255, 0.14); }
.mt-prayer-timeline__fill {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #ffcf6b, var(--mt-color-accent));
}
.mt-prayer-timeline__sun {
  position: absolute;
  top: 50%;
  transform: translate(50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: inset-inline-start 1s linear;
  z-index: 2;
}
.mt-prayer-timeline__mark {
  position: absolute;
  top: 50%;
  transform: translate(50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mt-prayer-timeline__mark-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--mt-color-secondary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.mt-prayer-timeline__mark-label {
  position: absolute;
  top: 16px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
  color: var(--mt-text);
}
.mt-prayer-timeline.is-night .mt-prayer-timeline__mark-label { color: #eef3f0; }
.mt-prayer-timeline__mark.is-active .mt-prayer-timeline__mark-dot {
  background: var(--mt-color-accent);
  border-color: var(--mt-color-accent);
  width: 13px;
  height: 13px;
}

.mt-prayer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--mt-space-3);
}
.mt-prayer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mt-space-1);
  padding: var(--mt-space-4) var(--mt-space-2);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  background: var(--mt-surface);
}
.mt-prayer-card.is-active {
  background: linear-gradient(135deg, var(--mt-color-primary), var(--mt-color-secondary));
  color: #fff;
  border-color: transparent;
}
.mt-prayer-card__icon { font-size: 1.6rem; }
.mt-prayer-card__label { font-weight: 600; font-size: 0.85rem; }
.mt-prayer-card__time { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .mt-prayer-hero { padding: var(--mt-space-6) var(--mt-space-3); }
  .mt-prayer-timeline__mark-label { display: none; }
}

/* ---------- World clock (backend/templates/calendars/world_clock.html) ---------- */
.mt-worldclock-heading { margin-top: var(--mt-space-8); }
.mt-worldclock-iran { display: flex; justify-content: center; margin: var(--mt-space-6) 0; }
.mt-worldclock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--mt-space-4);
}
.mt-worldclock-other {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mt-space-3);
  margin-top: var(--mt-space-4);
}
.mt-worldclock-compare {
  text-align: center;
  max-width: 480px;
  font-size: 0.95rem;
}
.mt-worldclock-compare strong { color: var(--mt-color-secondary); }

.mt-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mt-space-2);
  padding: var(--mt-space-4);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  background: var(--mt-surface);
}
.mt-clock--lg .mt-clock__face { width: 220px; height: 220px; }
.mt-clock--md .mt-clock__face { width: 140px; height: 140px; }

.mt-clock__face {
  position: relative;
  border-radius: 50%;
  background: var(--mt-bg);
  box-shadow: inset 0 0 0 2px var(--mt-border), 0 4px 14px rgba(0, 0, 0, 0.08);
}
.mt-clock__ticks {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--mt-text-muted) 0deg 1deg, transparent 1deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 84%, black 85%, black 92%, transparent 93%);
  mask: radial-gradient(circle, transparent 84%, black 85%, black 92%, transparent 93%);
  opacity: 0.6;
}
.mt-clock__num {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--mt-text-muted);
}
.mt-clock--md .mt-clock__num { font-size: 0.62rem; }
.mt-clock__num-1  { top: 13.6%; left: 71%; }
.mt-clock__num-2  { top: 29%;   left: 86.4%; }
.mt-clock__num-3  { top: 50%;   left: 92%; }
.mt-clock__num-4  { top: 71%;   left: 86.4%; }
.mt-clock__num-5  { top: 86.4%; left: 71%; }
.mt-clock__num-6  { top: 92%;   left: 50%; }
.mt-clock__num-7  { top: 86.4%; left: 29%; }
.mt-clock__num-8  { top: 71%;   left: 13.6%; }
.mt-clock__num-9  { top: 50%;   left: 8%; }
.mt-clock__num-10 { top: 29%;   left: 13.6%; }
.mt-clock__num-11 { top: 13.6%; left: 29%; }
.mt-clock__num-12 { top: 8%;    left: 50%; }

.mt-clock__hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: 50% 100%;
  border-radius: 4px;
  background: var(--mt-text);
}
.mt-clock__hand--hour { width: 5%; height: 26%; margin-inline-start: -2.5%; background: var(--mt-text); }
.mt-clock__hand--minute { width: 3.5%; height: 37%; margin-inline-start: -1.75%; background: var(--mt-text); }
.mt-clock__hand--second { width: 1.5%; height: 40%; margin-inline-start: -0.75%; background: var(--mt-color-accent); }
.mt-clock__hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mt-color-accent);
  transform: translate(-50%, -50%);
}

.mt-clock__digital {
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}
.mt-clock--md .mt-clock__digital { font-size: 0.85rem; }
.mt-clock__label { text-align: center; font-weight: 600; font-size: 0.9rem; }
.mt-clock__label-sub { display: block; font-weight: 400; font-size: 0.72rem; color: var(--mt-text-muted); }

@media (max-width: 480px) {
  .mt-clock--lg .mt-clock__face { width: 170px; height: 170px; }
  .mt-clock--md .mt-clock__face { width: 110px; height: 110px; }
}

/* ---------- Sky map (صور فلکی) ---------- */
.mt-sky-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--mt-space-6);
  align-items: start;
  margin-top: var(--mt-space-6);
}
@media (max-width: 860px) {
  .mt-sky-layout { grid-template-columns: 1fr; }
}
.mt-sky-chart-title {
  font-size: 1.05rem;
  margin: 0 0 var(--mt-space-3);
  color: var(--mt-text);
}
.mt-sky-canvas-box {
  background: radial-gradient(circle at 50% 40%, #0c1226 0%, #05070f 100%);
  border-radius: var(--mt-radius);
  padding: var(--mt-space-3);
  display: flex;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.45), inset 0 0 60px rgba(30, 58, 138, 0.15);
}
#mt-sky-canvas { display: block; max-width: 100%; }
.mt-sky-timebar {
  display: flex;
  align-items: center;
  gap: var(--mt-space-3);
  margin-top: var(--mt-space-4);
}
.mt-sky-timebar-label { color: var(--mt-text-muted); white-space: nowrap; }
.mt-sky-timebar input[type="range"] { flex: 1; accent-color: var(--mt-color-primary); }
.mt-sky-time-value {
  font-weight: bold;
  min-width: 3.2rem;
  text-align: center;
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  padding: 0.15rem 0.4rem;
}
.mt-sky-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--mt-space-3);
  margin-top: var(--mt-space-4);
}
.mt-sky-btn {
  cursor: pointer;
  border: 1px solid var(--mt-border);
  background: var(--mt-surface);
  color: var(--mt-text);
  border-radius: var(--mt-radius-sm);
  padding: 0.55rem 1.1rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mt-sky-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); }
.mt-sky-btn--accent {
  background: var(--mt-color-primary);
  border-color: var(--mt-color-primary);
  color: #fff;
}
.mt-sky-side-title { font-size: 1rem; margin: 0 0 var(--mt-space-3); }
.mt-sky-picker {
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  padding: var(--mt-space-3);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}
.mt-sky-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mt-space-2);
  margin-bottom: var(--mt-space-3);
}
.mt-sky-picker-title { display: flex; gap: var(--mt-space-2); }
.mt-sky-picker-title select {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  background: var(--mt-bg);
  color: var(--mt-text);
}
.mt-sky-picker-nav {
  cursor: pointer;
  border: 1px solid var(--mt-border);
  background: var(--mt-bg);
  color: var(--mt-text);
  border-radius: var(--mt-radius-sm);
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  line-height: 1;
}
.mt-sky-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
}
.mt-sky-picker-wd {
  text-align: center;
  font-size: 0.75rem;
  color: var(--mt-text-muted);
  padding-bottom: 0.25rem;
}
.mt-sky-picker-day {
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mt-text);
  border-radius: var(--mt-radius-sm);
  padding: 0.35rem 0;
  font-family: inherit;
  font-size: 0.85rem;
  transition: background 0.12s ease;
}
.mt-sky-picker-day:hover { background: var(--mt-bg); }
.mt-sky-picker-day.is-today { border-color: var(--mt-color-accent); }
.mt-sky-picker-day.is-selected {
  background: var(--mt-color-primary);
  color: #fff;
  font-weight: bold;
}
.mt-sky-story {
  margin-top: var(--mt-space-8);
  background: linear-gradient(160deg, rgba(30, 58, 138, 0.08), rgba(15, 118, 110, 0.06));
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  padding: var(--mt-space-6);
  line-height: 2;
}
.mt-sky-story h3 { margin: 0 0 var(--mt-space-4); }
.mt-sky-story p { margin: 0 0 var(--mt-space-3); }
.mt-sky-story-outro {
  color: var(--mt-text-muted);
  font-style: italic;
  margin-bottom: 0 !important;
}
.mt-sky-footnote { margin-top: var(--mt-space-6); font-size: 0.85rem; }

/* Sky map: location controls */
.mt-sky-location { margin-bottom: var(--mt-space-6); }
.mt-sky-loc-row {
  display: flex;
  align-items: center;
  gap: var(--mt-space-3);
  margin-bottom: var(--mt-space-3);
}
.mt-sky-loc-label { color: var(--mt-text-muted); font-size: 0.9rem; }
.mt-sky-city-search { position: relative; }
.mt-sky-city-search input {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  background: var(--mt-surface);
  color: var(--mt-text);
}
.mt-sky-city-results {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 30;
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  max-height: 260px;
  overflow-y: auto;
}
.mt-sky-city-result {
  display: block;
  width: 100%;
  text-align: right;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--mt-text);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.5rem 0.75rem;
}
.mt-sky-city-result:hover { background: var(--mt-bg); }

/* Sky map: horoscope card + picker disabled states */
.mt-sky-horoscope {
  background: linear-gradient(150deg, rgba(88, 28, 135, 0.10), rgba(30, 58, 138, 0.10));
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  padding: var(--mt-space-4) var(--mt-space-6);
  margin: var(--mt-space-4) 0;
}
.mt-sky-horoscope h4 { margin: 0 0 var(--mt-space-3); }
.mt-sky-horoscope p { margin: 0 0 var(--mt-space-3); }
.mt-sky-picker-day:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.mt-sky-picker-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* =====================================================================
   2026-07 additions: trilingual header (language switcher), icon-grid
   mobile navigation, homepage hero analog clock, clock-tz caption.
   Appended at the end so the cascade cleanly overrides the older
   720px-breakpoint nav rules above.
   ===================================================================== */

/* ---------- Language switcher ---------- */
.mt-header__actions {
  display: flex;
  align-items: center;
  gap: var(--mt-space-2);
}
.mt-lang {
  display: flex;
  gap: 2px;
  border: 1px solid var(--mt-border);
  border-radius: 999px;
  padding: 2px;
  background: var(--mt-bg);
}
.mt-lang__item {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--mt-text-muted);
  line-height: 1.6;
}
.mt-lang__item:hover { text-decoration: none; color: var(--mt-text); }
.mt-lang__item.is-active {
  background: var(--mt-color-primary);
  color: #fff;
}

/* ---------- Navigation: desktop row / mobile icon grid ---------- */
.mt-nav__icon { display: none; }
.mt-nav a { white-space: nowrap; font-weight: 600; }

/* Desktop: 9 items + brand + actions -- tighten below 1200px so the
   row never wraps into multiple lines. */
@media (min-width: 941px) and (max-width: 1200px) {
  .mt-nav { gap: var(--mt-space-2); }
  .mt-nav a { font-size: 0.85rem; }
}

.mt-nav-toggle {
  align-items: center;
  gap: 6px;
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  padding: 4px 10px;
  background: var(--mt-surface);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
}
.mt-nav-toggle__icon { font-size: 1.05rem; line-height: 1; }

/* Widen the hamburger breakpoint (was 720px): between 720 and 940 the
   9-item nav used to wrap into several ugly lines. */
@media (max-width: 940px) {
  .mt-nav-toggle { display: inline-flex; }
  .mt-header__inner { position: relative; }
  .mt-nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    grid-template-columns: 1fr 1fr;
    gap: var(--mt-space-2);
    background: var(--mt-surface);
    border-bottom: 1px solid var(--mt-border);
    padding: var(--mt-space-4);
  }
  .mt-nav.is-open {
    display: grid;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  }
  .mt-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--mt-border);
    border-radius: var(--mt-radius-sm);
    background: var(--mt-bg);
    white-space: normal;
  }
  .mt-nav a:hover { text-decoration: none; border-color: var(--mt-color-primary); }
  .mt-nav__icon { display: inline; font-size: 1.15rem; }
}
@media (min-width: 941px) {
  .mt-nav-toggle { display: none; }
  .mt-nav { display: flex; }
}
@media (max-width: 420px) {
  .mt-brand__name { display: none; }
}

/* ---------- Homepage hero analog clock ---------- */
:root {
  --mt-analog-face-1: #ffffff;
  --mt-analog-face-2: #e9efec;
  --mt-analog-bezel-1: #cfd9d4;
  --mt-analog-bezel-2: #8fa39a;
  --mt-analog-rim: rgba(22, 34, 30, 0.12);
  --mt-analog-tick: rgba(22, 34, 30, 0.35);
  --mt-analog-tick-major: rgba(22, 34, 30, 0.75);
  --mt-analog-num: #33443d;
  --mt-analog-hand: #23332d;
  --mt-analog-second: var(--mt-color-accent);
}
:root[data-theme="dark"] {
  --mt-analog-face-1: #223029;
  --mt-analog-face-2: #17201c;
  --mt-analog-bezel-1: #3a4a43;
  --mt-analog-bezel-2: #141b18;
  --mt-analog-rim: rgba(255, 255, 255, 0.08);
  --mt-analog-tick: rgba(238, 243, 240, 0.35);
  --mt-analog-tick-major: rgba(238, 243, 240, 0.75);
  --mt-analog-num: #cfe0d8;
  --mt-analog-hand: #eef3f0;
  --mt-analog-second: var(--mt-color-accent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mt-analog-face-1: #223029;
    --mt-analog-face-2: #17201c;
    --mt-analog-bezel-1: #3a4a43;
    --mt-analog-bezel-2: #141b18;
    --mt-analog-rim: rgba(255, 255, 255, 0.08);
    --mt-analog-tick: rgba(238, 243, 240, 0.35);
    --mt-analog-tick-major: rgba(238, 243, 240, 0.75);
    --mt-analog-num: #cfe0d8;
    --mt-analog-hand: #eef3f0;
    --mt-analog-second: var(--mt-color-accent);
  }
}

.mt-analog {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mt-space-1);
  margin-bottom: var(--mt-space-2);
}
.mt-analog__svg {
  width: min(240px, 62vw);
  height: auto;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.18));
}
.mt-analog__tick { stroke: var(--mt-analog-tick); stroke-width: 1; }
.mt-analog__tick--major { stroke: var(--mt-analog-tick-major); stroke-width: 2.4; stroke-linecap: round; }
.mt-analog__num {
  fill: var(--mt-analog-num);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mt-font-fa);
}
.mt-analog__hand { stroke: var(--mt-analog-hand); stroke-linecap: round; }
.mt-analog__hand--hour { stroke-width: 5.2; }
.mt-analog__hand--minute { stroke-width: 3.4; }
.mt-analog__hand--second { stroke: var(--mt-analog-second); stroke-width: 1.6; }
.mt-analog__hub-outer { fill: var(--mt-analog-second); }
.mt-analog__hub { fill: var(--mt-analog-face-1); }
.mt-analog__caption {
  font-size: 0.78rem;
  color: var(--mt-text-muted);
}

/* Caption under the big digital clock naming its timezone */
.mt-today-widget__tz {
  margin: calc(-1 * var(--mt-space-3)) 0 var(--mt-space-2);
  font-size: 0.78rem;
  color: var(--mt-text-muted);
  text-align: center;
}

/* ---------- Calendar: bigger everywhere + year/month jump selects ---------- */
.mt-cal { max-width: 860px; }
.mt-cal__daynum { font-size: 1.45rem; font-weight: 700; }
.mt-cal__gdate, .mt-cal__hdate { font-size: 0.72rem; }
.mt-cal__cell { padding: var(--mt-space-2) var(--mt-space-1); min-height: 4.6rem; }
.mt-cal__grid { gap: var(--mt-space-2); }
.mt-cal__weekdays { font-size: 1rem; }
@media (max-width: 480px) {
  .mt-cal__daynum { font-size: 1.15rem; }
  .mt-cal__gdate, .mt-cal__hdate { font-size: 0.58rem; }
  .mt-cal__cell { min-height: 3.9rem; padding: var(--mt-space-1); }
  .mt-cal__grid { gap: var(--mt-space-1); }
}
.mt-cal__jump { display: inline-flex; gap: var(--mt-space-1); align-items: center; }
.mt-cal__jump select {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--mt-text);
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-sm);
  padding: 4px 8px;
  cursor: pointer;
}

/* Brand name must stay visible on phones too (shrunk, not hidden). */
@media (max-width: 420px) {
  .mt-brand__name { display: inline; font-size: 0.95rem; }
}
