/* 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);
}
.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; }
  .mt-header__inner { position: relative; }
}

/* ---------- 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); }

/* ---------- 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; }
}
