/* ==========================================================================
   Chronological timeline, Today strip & reader tools (Design v8 — editorial + tools)
   Logical properties only (RTL-first). Colours come from app.css tokens.
   ========================================================================== */

.tl, .today, .tl-dev {
  --tl-story: var(--primary);
  --tl-digest: var(--border-strong);
  --tl-quake: #ea580c;
  --tl-report: var(--blue);
  --tl-daily: var(--success);
  --tl-rail-w: 3.1rem;
  --tl-gap: 14px;
  --tl-axis: calc(var(--tl-rail-w) + (var(--tl-gap) / 2));
}

/* ---------- Today strip ---------- */
.today { margin-block: 0 24px; }
.today-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px;
}
.today-chip {
  position: relative; overflow: hidden; min-width: 0;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 20px; box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.today-chip::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 2.5px;
  background: var(--chip-accent, var(--border-strong)); opacity: .82;
}
.today-chip--date { --chip-accent: var(--primary); grid-column: span 2; background: linear-gradient(135deg, var(--primary-soft), var(--card) 65%); }
.today-chip--prayer { --chip-accent: var(--emerald); }
.today-chip--weather { --chip-accent: var(--cyan); }
.today-chip--fx { --chip-accent: var(--blue); }
.today-chip--gold { --chip-accent: var(--amber); }
.today-chip--sea { --chip-accent: var(--secondary); }
.today-chip--holiday { --chip-accent: var(--violet); }
.today-chip:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.today-chip > a, .today-chip--date {
  display: flex; flex-direction: column; justify-content: space-between; gap: 3px;
  padding: 13px 16px 12px; color: inherit; text-decoration: none; height: 100%; box-sizing: border-box;
}
.today-k { font-size: var(--text-xs); color: var(--muted-foreground); font-weight: 700; letter-spacing: .01em; line-height: 1.3; }
.today-v { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; color: var(--foreground); overflow-wrap: anywhere; }
.today-sub { font-size: var(--text-xs); color: var(--muted-foreground); font-variant-numeric: tabular-nums; font-weight: 600; }
.today-sub[data-tl-countdown] { color: var(--emerald); }
.today-sub:empty { display: none; }

@media (max-width: 600px) {
  .today { margin-inline: -16px; }
  .today-list {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    gap: 10px; padding: 2px 16px 10px; scroll-padding-inline: 16px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .today-list::-webkit-scrollbar { display: none; }
  .today-chip { flex: 0 0 auto; min-width: 134px; scroll-snap-align: start; }
  .today-chip--date { min-width: 196px; }
}

.tl-pill:focus-visible, .tl-expand:focus-visible,
.tl-title:focus-visible, .tl-full:focus-visible, .tl-out:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 3px;
}

/* ---------- Frosted editorial day headers ---------- */
.tl-shell { min-width: 0; }
.an-page .tl-shell { max-inline-size: 880px; margin-inline: auto; }
/* Tag pages: the whole stream (pinned overview + days) uses the page width. */
.an-page .tl-shell--wide { max-inline-size: none; margin-inline: 0; }
/* Wide stream: cinematic lead cover, capped so a day header stays near the fold. */
.tl-shell--wide .tl-item--lead .tl-media { max-block-size: 360px; }
@media (min-width: 1000px) { .tl-shell--wide .tl-item--lead .tl-media { aspect-ratio: 21 / 9; } }
.tl { margin-block: 0 20px; }
.tl-group { margin-block: 0 14px; }
.tl-day {
  position: sticky; inset-block-start: var(--header-h); z-index: 6;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(165%);
  backdrop-filter: blur(16px) saturate(165%);
  padding-block: 8px 7px; margin-block-end: 10px;
  border-block-end: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
}
.tl-day-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tl-day-num {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  min-inline-size: 2rem; block-size: 2rem; padding-inline: 6px;
  border-radius: 12px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 13%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  font-size: 1.05rem; font-weight: 900; letter-spacing: -.03em; line-height: 1;
  color: var(--primary); font-variant-numeric: tabular-nums;
}
.tl-day-titles { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.tl-day-title { margin: 0; font-size: 1.12rem; font-weight: 900; letter-spacing: -.015em; line-height: 1.25; color: var(--foreground); }
html[lang="ar"] .tl-day-title { letter-spacing: 0; }
.tl-day-iso { font-size: .72rem; font-weight: 600; color: var(--muted-foreground); font-variant-numeric: tabular-nums; opacity: .78; }
.tl-day-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tl-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 65%, var(--card));
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  font-size: .72rem; font-weight: 700;
  color: var(--foreground); font-variant-numeric: tabular-nums;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.tl-chip:hover { border-color: var(--border-strong); background: var(--card); }
.tl-chip--holiday { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 28%, var(--border)); color: var(--primary); }
.tl-chip a { color: inherit; text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.tl-chip a:hover { color: var(--primary); }
.tl-delta { font-weight: 800; padding: 1px 5px; border-radius: 6px; font-size: .68rem; }
.tl-delta--up { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.tl-delta--down { color: var(--destructive); background: color-mix(in srgb, var(--destructive) 14%, transparent); }

/* ---------- Refined rail, hairline spine & type-coloured nodes ---------- */
.tl-list { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 8px; }
.tl-list::before {
  content: ""; position: absolute; inset-block: 14px 20px;
  inset-inline-start: var(--tl-axis); width: 1.5px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 65%, var(--border-strong)) 0%, var(--border) 16%, color-mix(in srgb, var(--border) 75%, transparent) 92%, transparent 100%);
  transform: translateX(-50%);
}
[dir="rtl"] .tl-list::before { transform: translateX(50%); }
.tl-item {
  --dot: var(--tl-digest);
  position: relative; min-width: 0;
  display: grid; grid-template-columns: var(--tl-rail-w) minmax(0, 1fr);
  column-gap: var(--tl-gap); align-items: start;
}
.tl-item::before {
  content: ""; position: absolute;
  inset-inline-start: var(--tl-axis); inset-block-start: 17px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--dot); border: 2px solid var(--background);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--dot) 55%, transparent), 0 0 10px -2px color-mix(in srgb, var(--dot) 50%, transparent);
  transform: translateX(-50%); z-index: 2;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background var(--duration) var(--ease);
}
[dir="rtl"] .tl-item::before { transform: translateX(50%); }
.tl-item:hover::before {
  transform: translateX(-50%) scale(1.22);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 22%, transparent), 0 0 14px -1px var(--dot);
}
[dir="rtl"] .tl-item:hover::before {
  transform: translateX(50%) scale(1.22);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 22%, transparent), 0 0 14px -1px var(--dot);
}
.tl-item--story, .tl-item--staff, .tl-item--citizen { --dot: var(--tl-story); }
.tl-item--story::before, .tl-item--lead::before { width: 11px; height: 11px; }
.tl-item--digest { --dot: var(--tl-digest); }
.tl-item--quake { --dot: var(--tl-quake); }
.tl-item--report { --dot: var(--tl-report); }
.tl-item--daily, .tl-item--weekly { --dot: var(--tl-daily); }

/* ---------- Pinned overview (tag pages): one compact panel, a small rail node per paragraph.
   Phones: vertical rail. ≥ 900px: two columns joined by a horizontal rail per row. ---------- */
.tl-summary {
  position: relative; min-width: 0; margin-block: 0 18px; padding: 12px 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 6%, var(--card)), var(--card) 60%);
  border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border));
  border-radius: 18px;
  scroll-margin-top: calc(var(--header-h) + 12px);
}
.tl-summary-head { display: flex; align-items: center; gap: 8px; min-width: 0; margin-block: 0 10px; }
.tl-summary-badge {
  flex: none; inline-size: 22px; block-size: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gradient-brand); color: #fff;
  box-shadow: 0 0 10px -3px color-mix(in srgb, var(--primary) 60%, transparent);
}
.tl-summary-badge svg { inline-size: 12px; block-size: 12px; }
.tl-summary-title {
  margin: 0; min-width: 0; overflow-wrap: anywhere;
  font-size: .95rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.35; color: var(--foreground);
}
html[lang="ar"] .tl-summary-title { letter-spacing: 0; line-height: 1.5; }
.tl-summary-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.tl-summary-item { position: relative; min-width: 0; padding-inline-start: 20px; }
/* node */
.tl-summary-item::before {
  content: ""; position: absolute; z-index: 1;
  inset-inline-start: 0; inset-block-start: 8px;
  inline-size: 9px; block-size: 9px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
/* spine: from this node down to the next one */
.tl-summary-item::after {
  content: ""; position: absolute;
  inset-inline-start: 4px; inset-block: 21px -20px; inline-size: 1.5px; border-radius: 2px;
  background: color-mix(in srgb, var(--primary) 28%, var(--border));
}
.tl-summary-item:last-child::after { display: none; }
.tl-summary-item p {
  margin: 0; font-size: .93rem; line-height: 1.7; overflow-wrap: anywhere;
  color: color-mix(in srgb, var(--foreground) 88%, var(--muted-foreground));
}
.tl-summary-date {
  display: inline-block; margin-inline-end: 4px; padding: 0 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 13%, transparent); color: var(--primary);
  font-size: .74rem; font-weight: 800; line-height: 1.6; white-space: nowrap;
  font-variant-numeric: tabular-nums; vertical-align: 1px;
}
/* Collapsed (class from app.js; no-JS readers get everything): first two paragraphs,
   each clamped; the second spine fades out to say more follows. */
.tl-summary.is-collapsed .tl-summary-item:nth-child(n + 3) { display: none; }
.tl-summary.is-collapsed .tl-summary-item p {
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.tl-summary.is-collapsed .tl-summary-item:nth-child(2):not(:last-child)::after {
  display: block; background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 28%, var(--border)), transparent);
}
/* The one toggle app.js adds under the list. */
.tl-summary .topic-summary-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  margin-block-start: 10px; margin-inline-start: 20px; padding: 4px 12px; min-height: 32px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)); border-radius: 999px;
  background: var(--card); color: var(--primary);
  font: inherit; font-size: .8rem; font-weight: 800; line-height: 1.2; cursor: pointer;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.tl-summary .topic-summary-toggle[hidden] { display: none; }
.tl-summary .topic-summary-toggle:hover { border-color: var(--primary); background: var(--primary-soft); }
.tl-summary .topic-summary-toggle:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.tl-summary .topic-summary-toggle::after {
  content: ""; flex: none; inline-size: 7px; block-size: 4px; background: currentColor;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: transform var(--duration) var(--ease);
}
.tl-summary .topic-summary-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
.topic-summary-count {
  min-inline-size: 1.6em; padding: 0 6px; border-radius: 999px; text-align: center;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  font-size: .72rem; font-variant-numeric: tabular-nums;
}
@media (min-width: 900px) {
  .tl-summary { padding: 14px 20px; }
  .tl-summary-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; row-gap: 18px; }
  .tl-summary-item { padding-inline-start: 0; padding-block-start: 20px; }
  .tl-summary-item::before { inset-block-start: 0; }
  /* horizontal rail: from this node to the next column's node */
  .tl-summary-item::after { inset-block: 4px auto; inset-inline: 15px -28px; inline-size: auto; block-size: 1.5px; }
  .tl-summary-item:nth-child(2n)::after { inset-inline-end: 0; }
  .tl-summary.is-collapsed .tl-summary-item:nth-child(2):not(:last-child)::after {
    background: color-mix(in srgb, var(--primary) 28%, var(--border));
    -webkit-mask-image: linear-gradient(90deg, #000, transparent); mask-image: linear-gradient(90deg, #000, transparent);
  }
  [dir="rtl"] .tl-summary.is-collapsed .tl-summary-item:nth-child(2):not(:last-child)::after {
    -webkit-mask-image: linear-gradient(270deg, #000, transparent); mask-image: linear-gradient(270deg, #000, transparent);
  }
  .tl-summary.is-collapsed .tl-summary-item p { -webkit-line-clamp: 4; line-clamp: 4; }
  .tl-summary .topic-summary-toggle { margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-summary .topic-summary-toggle, .tl-summary .topic-summary-toggle::after { transition: none; }
}

.tl-rail {
  grid-column: 1; display: flex; flex-direction: column; align-items: flex-end;
  padding-block-start: 12px; padding-inline-end: 2px; text-align: end; min-width: 0;
}
.tl-time {
  font-size: .82rem; font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: -.01em; color: var(--foreground); line-height: 1.2; white-space: nowrap;
  transition: color var(--duration) var(--ease);
}
.tl-item:hover .tl-time { color: var(--primary); }
.tl-rel {
  max-inline-size: 100%; margin-block-start: 3px;
  font-size: .68rem; font-weight: 600; color: var(--muted-foreground); opacity: .82;
  line-height: 1.3; overflow-wrap: anywhere;
}
.tl-rel:empty { display: none; }

/* ---------- Editorial cards ---------- */
.tl-card {
  grid-column: 2; min-width: 0; position: relative; overflow: hidden;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(17, 19, 24, .03), 0 6px 20px -12px rgba(17, 19, 24, .08);
  padding: 11px 14px;
  transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
html[data-theme="dark"] .tl-card {
  background: linear-gradient(165deg, color-mix(in srgb, var(--surface) 45%, var(--card)) 0%, var(--card) 100%);
  border-color: color-mix(in srgb, var(--border) 88%, transparent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .32), 0 10px 28px -14px rgba(2, 6, 23, .72);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .tl-card {
    background: linear-gradient(165deg, color-mix(in srgb, var(--surface) 45%, var(--card)) 0%, var(--card) 100%);
    border-color: color-mix(in srgb, var(--border) 88%, transparent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .32), 0 10px 28px -14px rgba(2, 6, 23, .72);
  }
}
.tl-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 26%, var(--border-strong));
  box-shadow: var(--shadow);
}
.tl-item--story .tl-card {
  background: linear-gradient(165deg, color-mix(in srgb, var(--primary) 3.5%, var(--card)) 0%, var(--card) 52%);
  border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
}
.tl-item--story .tl-card::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; z-index: 3;
  height: 3px; background: var(--gradient-brand);
}
.tl-item--daily .tl-card, .tl-item--weekly .tl-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--success) 9%, var(--card)), var(--card) 68%);
  border-color: color-mix(in srgb, var(--success) 32%, var(--border));
}
.tl-item.is-new .tl-card {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--card) 58%);
}
.tl-item.is-new::before { --dot: var(--primary); width: 13px; height: 13px; }
html[data-theme="dark"] .tl-item.is-new .tl-card {
  background: linear-gradient(135deg, rgba(255, 77, 109, .16), var(--card) 62%);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .tl-item.is-new .tl-card {
    background: linear-gradient(135deg, rgba(255, 77, 109, .16), var(--card) 62%);
  }
}

/* Regular covers sit beside the copy; the links footer spans the whole card below. */
.tl-item--has-media:not(.tl-item--lead) .tl-card {
  display: grid; grid-template-columns: minmax(0, 1fr) 168px;
  column-gap: 14px; row-gap: 5px; align-items: start;
}
.tl-item--has-media:not(.tl-item--lead) .tl-body { display: contents; }
.tl-item--has-media:not(.tl-item--lead) .tl-body > * { grid-column: 1; }
.tl-item--has-media:not(.tl-item--lead) .tl-body > .tl-links { grid-column: 1 / -1; }
.tl-item--has-media:not(.tl-item--lead) .tl-media {
  grid-column: 2; grid-row: 1 / span 3; position: relative;
  display: block; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: 14px; background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(17, 19, 24, .06);
}

/* The first covered article of each day becomes a full-width editorial hero. */
.tl-item--lead .tl-card { padding: 0; }
.tl-item--lead .tl-media {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--surface);
}
.tl-item--lead .tl-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 52%, color-mix(in srgb, var(--card) 22%, transparent) 82%, var(--card) 100%);
}
.tl-item--lead .tl-body { position: relative; z-index: 1; padding: 10px 14px 12px; gap: 6px; }
.tl-item--lead .tl-title { font-size: 1.2rem; line-height: 1.38; letter-spacing: -.012em; }
html[lang="ar"] .tl-item--lead .tl-title { letter-spacing: 0; line-height: 1.44; }
.tl-item--lead .tl-excerpt { -webkit-line-clamp: 3; font-size: .92rem; }
.tl-img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  background: var(--surface); transition: transform .5s var(--ease);
}
.tl-card:hover .tl-img { transform: scale(1.03); }

/* ---------- Card copy, calm meta & actions ---------- */
.tl-body { min-width: 0; display: flex; flex-direction: column; gap: 5px; text-align: start; }
.tl-heading { margin: 0; font-size: inherit; font-weight: inherit; }
.tl-title {
  display: block; font-size: 1.04rem; font-weight: 800; line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--foreground); text-decoration: none; overflow-wrap: anywhere;
  transition: color var(--duration) var(--ease);
}
html[lang="ar"] .tl-title { letter-spacing: 0; line-height: 1.5; }
.tl-title:hover { color: var(--primary); }
.tl-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px;
  font-size: .73rem; line-height: 1.35; color: var(--muted-foreground);
}
.tl-meta .an-badge--inline {
  margin-inline-start: 0; padding: 2px 8px;
  font-size: .69rem; font-weight: 800; letter-spacing: .01em;
}
.tl-meta .an-badge--story {
  background: color-mix(in srgb, var(--primary) 13%, transparent);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 26%, transparent);
}
.tl-town {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--cat, var(--primary)) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat, var(--primary)) 22%, transparent);
  font-weight: 800; font-size: .71rem; color: var(--cat, var(--foreground));
}
.tl-town::before {
  content: ""; inline-size: 5px; block-size: 5px; border-radius: 50%;
  background: currentColor; opacity: .85;
}
.tl-updated {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--success) 13%, transparent);
  color: var(--tl-daily); font-weight: 700; font-size: .7rem;
}
.tl-outlets-wrap {
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 0; max-inline-size: 100%;
}
.tl-stack { display: inline-flex; align-items: center; flex: 0 0 auto; }
.tl-stack-av {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--card);
  color: var(--muted-foreground); font-size: .62rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  text-transform: uppercase;
}
.tl-stack-av + .tl-stack-av { margin-inline-start: -5px; }
.tl-outlets {
  min-width: 0; font-weight: 500; font-size: .73rem;
  color: color-mix(in srgb, var(--muted-foreground) 88%, transparent);
  overflow-wrap: anywhere;
}
.tl-outlets-more {
  display: inline-block; padding: 0 5px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted-foreground); font-weight: 700; font-size: .67rem;
}
.tl-excerpt {
  margin: 0; font-size: var(--text-sm); line-height: 1.6;
  color: color-mix(in srgb, var(--foreground) 72%, var(--muted-foreground));
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}
.tl-excerpt.is-expanded { display: block; -webkit-line-clamp: unset; overflow: visible; }
.tl-expand {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  min-height: 22px; margin-block: -3px 0; padding: 0;
  border: 0; background: transparent; color: var(--muted-foreground);
  font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer;
  transition: color var(--duration) var(--ease);
}
.tl-expand:hover { color: var(--primary); }
.tl-expand::after {
  content: ""; flex: none; inline-size: 7px; block-size: 4px; background: currentColor;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: transform var(--duration) var(--ease);
}
.tl-expand[aria-expanded="true"]::after { transform: rotate(180deg); }

/* Footer links: "Full story" is the primary editorial action;
   "Read at {outlet} ↗" is a quiet, muted attribution link. */
.tl-links {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 12px; margin-block-start: 1px; padding-block-start: 6px;
  border-block-start: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  font-size: var(--text-xs);
}
.tl-links a { overflow-wrap: anywhere; }
.tl-full {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--primary); font-size: .78rem; font-weight: 800;
  text-decoration: none;
  transition: color var(--duration) var(--ease), gap var(--duration) var(--ease);
}
.tl-full::after {
  content: "→"; font-size: .85em; line-height: 1;
  transition: transform var(--duration) var(--ease);
}
[dir="rtl"] .tl-full::after { content: "←"; }
.tl-full:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }
.tl-full:hover::after { transform: translateX(2px); }
[dir="rtl"] .tl-full:hover::after { transform: translateX(-2px); }

a.tl-out {
  margin-inline-start: auto;
  padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  font-size: .68rem; font-weight: 500; line-height: 1.35;
  color: color-mix(in srgb, var(--muted-foreground) 68%, transparent);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
a.tl-out:hover, a.tl-out:focus-visible {
  color: var(--muted-foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--muted-foreground) 55%, transparent);
}

/* ---------- Earthquake variant ---------- */
.tl-card--quake {
  display: flex; align-items: center; gap: 11px; padding: 9px 13px;
  border-color: color-mix(in srgb, var(--tl-quake) 32%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--tl-quake) 8%, var(--card)), var(--card) 70%);
}
.tl-mag {
  --mag-c: var(--amber);
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px;
  background: color-mix(in srgb, var(--mag-c) 14%, var(--card));
  border: 1.5px solid var(--mag-c); color: var(--mag-c);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mag-c) 7%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.tl-mag--minor { --mag-c: var(--amber); }
.tl-mag--mod { --mag-c: #ea580c; }
.tl-mag--strong { --mag-c: var(--destructive); }
.tl-mag-m { font-size: .65rem; font-weight: 800; letter-spacing: .04em; opacity: .85; }
.tl-mag-v { font-size: 1.15rem; font-weight: 900; margin-block-start: 2px; }
.tl-src, .tl-depth { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Seen marker & live pill ---------- */
.tl-marker {
  display: flex; align-items: center; gap: 12px; padding-block: 6px;
  font-size: var(--text-xs); font-weight: 800; color: var(--primary); position: relative; z-index: 2;
}
.tl-marker::before, .tl-marker::after { content: ""; flex: 1; height: 1px; background: var(--primary); opacity: .4; }
.tl-marker span { background: var(--background); padding: 2px 11px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--primary) 55%, var(--border)); }
.tl-pill {
  position: fixed; inset-inline: 0; margin-inline: auto; width: max-content;
  max-width: calc(100vw - 32px);
  inset-block-end: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom, 0px));
  z-index: 60; padding: 10px 22px; border: 0; border-radius: 999px;
  background: var(--primary); color: var(--primary-foreground);
  font: inherit; font-size: var(--text-sm); font-weight: 800;
  box-shadow: var(--shadow-lg); cursor: pointer;
  opacity: 0; transform: translateY(16px); pointer-events: none; visibility: hidden;
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease), visibility 0s linear var(--duration);
}
.tl-pill.is-shown { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
@media (min-width: 960px) { .tl-pill { inset-block-end: calc(24px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Developing & more ---------- */
.tl-dev { margin-block: 28px 16px; }
.tl-dev-title { margin: 0 0 12px; font-size: var(--text-xl); font-weight: 800; color: var(--foreground); }
.tl-more-wrap { margin: 10px 0 0; text-align: center; }
.tl-more-link {
  display: inline-block; padding: 11px 26px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--foreground);
  font-weight: 700; font-size: var(--text-sm); text-decoration: none; background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.tl-more-link:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

/* ---------- Progressive scroll entrance ---------- */
.js-tl-anim .tl-item.tl-will-reveal { opacity: 0; transform: translateY(14px); }
.js-tl-anim .tl-item.is-revealed {
  opacity: 1; transform: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}

/* ---------- Reader toolbar (built by app.js): filters, search, view, shortcuts ---------- */
.tl-bar { container-type: inline-size; margin-block: 0 12px; }
.tl-bar-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.tl-seg {
  grid-column: 1; grid-row: 1; justify-self: start; min-width: 0; max-inline-size: 100%;
  display: flex; gap: 2px; padding: 3px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  background: color-mix(in srgb, var(--surface) 75%, var(--card));
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: 999px;
}
.tl-seg::-webkit-scrollbar { display: none; }
/* Edge fade while more chips hide behind the scroll (JS sets --fs / --fe). */
.tl-seg {
  --fs: 0px; --fe: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fs), #000 calc(100% - var(--fe)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fs), #000 calc(100% - var(--fe)), transparent 100%);
}
[dir="rtl"] .tl-seg {
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 var(--fs), #000 calc(100% - var(--fe)), transparent 100%);
  mask-image: linear-gradient(to left, transparent 0, #000 var(--fs), #000 calc(100% - var(--fe)), transparent 100%);
}
.tl-seg-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-block-size: 32px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted-foreground);
  font: inherit; font-size: .8rem; font-weight: 700; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.tl-seg-btn[hidden] { display: none; }
.tl-seg-btn:hover { color: var(--foreground); }
.tl-seg-btn[aria-pressed="true"] {
  background: var(--card); color: var(--foreground);
  box-shadow: 0 1px 2px rgba(17, 19, 24, .1), 0 0 0 1px color-mix(in srgb, var(--border) 90%, transparent);
}
html[data-theme="dark"] .tl-seg-btn[aria-pressed="true"] { background: var(--border); }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .tl-seg-btn[aria-pressed="true"] { background: var(--border); } }
.tl-seg-ico svg { display: block; inline-size: 14px; block-size: 14px; }
.tl-seg-n {
  min-inline-size: 1.3rem; padding: 3px 5px; border-radius: 999px; box-sizing: border-box;
  background: color-mix(in srgb, var(--muted-foreground) 15%, transparent);
  font-size: .66rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums;
}
.tl-seg-n:empty { display: none; }
.tl-seg-btn[aria-pressed="true"] .tl-seg-n { background: var(--primary); color: var(--primary-foreground); }

.tl-search {
  grid-column: 1 / -1; grid-row: 2; display: none; align-items: center; gap: 8px;
  min-block-size: 38px; padding-inline: 12px; box-sizing: border-box;
  border-radius: 999px; background: var(--card); color: var(--muted-foreground);
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.tl-search svg { flex: none; inline-size: 16px; block-size: 16px; }
.tl-search:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent); }
.tl-bar.is-searching .tl-search { display: flex; }
.tl-search-in {
  flex: 1; min-width: 0; padding: 0; border: 0; outline: none; background: transparent;
  color: var(--foreground); font: inherit; font-size: .86rem;
}
.tl-search-in::placeholder { color: color-mix(in srgb, var(--muted-foreground) 80%, transparent); }
.tl-search-n { flex: none; font-size: .7rem; font-weight: 700; color: var(--muted-foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-search-n:empty { display: none; }

.tl-tools { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 2px; }
.tl-tool {
  inline-size: 36px; block-size: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted-foreground); cursor: pointer;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.tl-tool:hover { background: var(--surface); color: var(--foreground); }
.tl-tool[aria-pressed="true"], .tl-tool[aria-expanded="true"] { background: var(--primary-soft); color: var(--primary); }
.tl-live {
  display: inline-flex; align-items: center; gap: 6px; padding-inline: 6px 8px;
  font-size: .7rem; font-weight: 800; letter-spacing: .02em; color: var(--primary); white-space: nowrap;
}
.tl-live i {
  inline-size: 7px; block-size: 7px; border-radius: 50%; background: currentColor;
  animation: tl-pulse 2.2s var(--ease) infinite;
}
.tl-live.is-off { color: var(--muted-foreground); }
.tl-live.is-off i { animation: none; }
@keyframes tl-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 50%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}
@container (min-width: 640px) {
  .tl-bar-in { grid-template-columns: auto minmax(0, 1fr) auto; }
  .tl-search { grid-column: 2; grid-row: 1; justify-self: end; display: flex; inline-size: 100%; max-inline-size: 300px; }
  .tl-tools { grid-column: 3; }
  .tl-search-btn { display: none; }
}
@container (max-width: 420px) {
  .tl-live span { display: none; }
  .tl-seg-btn { padding: 0 10px; }
}
@media (hover: none), (pointer: coarse) { .tl-keys-btn { display: none; } }

.tl-keys {
  margin-block-start: 8px; padding: 12px 14px; border-radius: 16px;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--border) 90%, transparent); box-shadow: var(--shadow-sm);
}
.tl-keys[hidden] { display: none; }
.tl-keys-title { margin: 0 0 8px; font-size: .78rem; font-weight: 800; color: var(--foreground); }
.tl-keys dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 18px; }
.tl-keys dl > div { display: flex; align-items: center; gap: 10px; }
.tl-keys dt { flex: none; display: inline-flex; gap: 4px; min-inline-size: 62px; }
.tl-keys dd { margin: 0; font-size: .78rem; color: var(--muted-foreground); }
.tl-keys kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-inline-size: 22px; block-size: 22px; padding: 0 6px; box-sizing: border-box;
  border-radius: 6px; border: 1px solid var(--border-strong); border-block-end-width: 2px;
  background: var(--surface); color: var(--foreground);
  font: 700 .68rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Filter results, empty notice */
.tl-item.is-filtered, .tl-group.is-filtered, .tl.is-filtering .tl-marker { display: none; }
.tl.is-filtering .tl-day-toggle { visibility: hidden; }
.tl-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-block: 0 16px; padding: 26px 16px; border-radius: 18px;
  border: 1px dashed var(--border-strong); text-align: center;
  color: var(--muted-foreground); font-size: .9rem;
}
.tl-empty[hidden] { display: none; }
.tl-empty p { margin: 0; }
.tl-clear {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--card); color: var(--foreground);
  font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
  transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
.tl-clear:hover { border-color: var(--primary); color: var(--primary); }

/* Day header: count + collapse */
.tl-day-meta { margin-inline-start: auto; }
.tl-day-toggle {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  min-block-size: 28px; padding-block: 0; padding-inline: 9px 5px; margin-inline-start: auto;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--muted-foreground);
  font: inherit; font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
.tl-day-meta + .tl-day-toggle { margin-inline-start: 0; }
.tl-day-toggle:hover { color: var(--foreground); border-color: var(--border-strong); }
.tl-day-toggle svg { inline-size: 15px; block-size: 15px; transition: transform var(--duration) var(--ease); }
.tl-group.is-collapsed .tl-day-toggle svg { transform: rotate(90deg); }
[dir="rtl"] .tl-group.is-collapsed .tl-day-toggle svg { transform: rotate(-90deg); }
.tl-group.is-collapsed .tl-list { display: none; }
.tl.is-filtering .tl-group.is-collapsed .tl-list { display: flex; }
.tl-group.is-collapsed .tl-day { margin-block-end: 0; }

/* Item actions: save + share — one footer row; the outlet link shortens first. */
.tl-links { flex-wrap: nowrap; }
.tl-full { flex: none; white-space: nowrap; }
a.tl-out { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-acts { display: inline-flex; align-items: center; gap: 2px; margin-block: -5px; margin-inline-start: auto; }
a.tl-out ~ .tl-acts { margin-inline-start: 2px; }
.tl-act {
  inline-size: 30px; block-size: 30px; padding: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  color: color-mix(in srgb, var(--muted-foreground) 82%, transparent);
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.tl-act svg { inline-size: 16px; block-size: 16px; }
.tl-act:hover { background: var(--surface); color: var(--foreground); }
.tl-act:active { transform: scale(.9); }
.tl-act:focus-visible, .tl-tool:focus-visible, .tl-seg-btn:focus-visible, .tl-day-toggle:focus-visible,
.tl-load:focus-visible, .tl-top:focus-visible, .tl-clear:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.tl-act--save[aria-pressed="true"] { color: var(--primary); }
.tl-act--save[aria-pressed="true"] svg { fill: currentColor; }
@media (pointer: coarse) { .tl-act { inline-size: 34px; block-size: 34px; } .tl-acts { gap: 0; margin-block: -8px; margin-inline-end: -6px; } }
.tl-links--acts { justify-content: flex-end; padding-block-start: 0; border-block-start: 0; }
.tl-card--quake .tl-acts { margin-block: 0; }

/* Read (hollow node, softer title) and saved (accent edge) */
.tl-item.is-read .tl-title { color: color-mix(in srgb, var(--foreground) 60%, var(--muted-foreground)); }
.tl-item.is-read .tl-title:hover { color: var(--primary); }
.tl-item.is-read:not(.is-new)::before { background: var(--background); }
.tl-item.is-saved .tl-card::after {
  content: ""; position: absolute; z-index: 3; inset-block: 14px; inset-inline-start: 0;
  inline-size: 3px; background: var(--primary);
  border-start-end-radius: 3px; border-end-end-radius: 3px;
}

/* Keyboard focus (J/K) */
.tl-item { scroll-margin-block: calc(var(--header-h) + 70px) 90px; }
.tl-item.is-focus .tl-card {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent), var(--shadow);
}
.tl-item.is-focus .tl-title:focus-visible { outline: none; }

/* Saved panel */
.tl-saved {
  margin-block: 0 16px; padding: 14px 16px 8px; border-radius: 20px;
  background: var(--card); border: 1px solid color-mix(in srgb, var(--border) 88%, transparent); box-shadow: var(--shadow-sm);
}
.tl-saved[hidden] { display: none; }
.tl-saved-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 6px;
  font-size: 1.05rem; font-weight: 900; color: var(--foreground);
}
.tl-saved-title svg { inline-size: 18px; block-size: 18px; color: var(--primary); fill: currentColor; }
.tl-saved-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl-saved-item {
  display: flex; align-items: center; gap: 12px; padding-block: 10px;
  border-block-start: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.tl-saved-item:first-child { border-block-start: 0; }
.tl-saved-img { flex: none; inline-size: 56px; block-size: 56px; border-radius: 12px; object-fit: cover; background: var(--surface); }
.tl-saved-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tl-saved-link {
  color: var(--foreground); font-size: .94rem; font-weight: 800; line-height: 1.42; text-decoration: none;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.tl-saved-link:hover { color: var(--primary); }
.tl-saved-time { font-size: .72rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.tl-saved-empty { margin: 0; padding: 14px 4px 10px; text-align: center; color: var(--muted-foreground); font-size: .88rem; line-height: 1.6; }
.tl-saved-empty[hidden] { display: none; }

/* Load more + floating buttons + toast */
.tl-more-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; }
.tl-more-wrap[hidden] { display: none; }
.tl-load {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-block-size: 44px; padding: 0 30px; border: 0; border-radius: 999px;
  background: var(--foreground); color: var(--background);
  font: inherit; font-size: var(--text-sm); font-weight: 800; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), opacity var(--duration) var(--ease);
}
.tl-load:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.tl-load[aria-busy="true"] { opacity: .8; cursor: progress; transform: none; }
.tl-load[aria-busy="true"]::before {
  content: ""; inline-size: 14px; block-size: 14px; border-radius: 50%; box-sizing: border-box;
  border: 2px solid currentColor; border-inline-end-color: transparent;
  animation: tl-spin .75s linear infinite;
}
@keyframes tl-spin { to { transform: rotate(360deg); } }
.tl-more-link.tl-more-link--quiet { padding: 10px 16px; border-color: transparent; background: transparent; box-shadow: none; color: var(--muted-foreground); }
.tl-more-link.tl-more-link--quiet:hover { color: var(--primary); transform: none; }

.tl-top {
  position: fixed; z-index: 59; inset-inline-end: 14px;
  inset-block-end: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom, 0px));
  inline-size: 44px; block-size: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--foreground);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow); cursor: pointer;
  opacity: 0; transform: translateY(12px); visibility: hidden; pointer-events: none;
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease), visibility 0s linear var(--duration);
}
.tl-top.is-shown { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.tl-top:hover { color: var(--primary); }
.tl-toast {
  position: fixed; z-index: 61; inset-inline: 0; margin-inline: auto;
  inline-size: max-content; max-inline-size: calc(100vw - 32px); box-sizing: border-box;
  inset-block-end: calc(var(--tabbar-h) + 70px + env(safe-area-inset-bottom, 0px));
  padding: 9px 18px; border-radius: 12px;
  background: var(--foreground); color: var(--background);
  font-size: var(--text-sm); font-weight: 700; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.tl-toast.is-shown { opacity: 1; transform: none; }
@media (min-width: 960px) {
  .tl-top { inset-block-end: calc(24px + env(safe-area-inset-bottom, 0px)); inset-inline-end: 24px; }
  .tl-toast { inset-block-end: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- List view (html.tl-compact): titles only, small thumbnails ---------- */
html.tl-compact .tl-list { gap: 6px; }
html.tl-compact .tl-card { padding: 9px 12px; border-radius: 16px; }
html.tl-compact .tl-item--has-media .tl-card {
  display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 12px; align-items: center; padding-block: 8px; padding-inline: 12px 8px;
}
html.tl-compact .tl-item--has-media .tl-media {
  grid-column: 2; grid-row: 1; inline-size: auto; aspect-ratio: 1 / 1; border-radius: 10px;
}
html.tl-compact .tl-item--has-media .tl-media::after { display: none; }
html.tl-compact .tl-item--has-media .tl-body { display: flex; grid-column: 1; grid-row: 1; padding: 0; }
html.tl-compact .tl-body { gap: 4px; }
html.tl-compact .tl-excerpt, html.tl-compact .tl-expand, html.tl-compact .tl-links,
html.tl-compact .tl-stack, html.tl-compact .tl-card--quake .tl-acts { display: none; }
html.tl-compact .tl-title, html.tl-compact .tl-item--lead .tl-title {
  font-size: .95rem; line-height: 1.42;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
html[lang="ar"].tl-compact .tl-title { line-height: 1.5; }
html.tl-compact .tl-item--story .tl-card::before { height: 2px; }
html.tl-compact .tl-rail { padding-block-start: 9px; }
html.tl-compact .tl-item::before { inset-block-start: 14px; }
html.tl-compact .tl-card--quake { padding: 7px 12px; }
html.tl-compact .tl-mag { width: 40px; height: 40px; border-radius: 12px; }
html.tl-compact .tl-mag-v { font-size: 1rem; }
html.tl-compact .tl-card:hover { transform: none; }

/* ---------- Phones: compact cards, regular covers as square side thumbnails ---------- */
@media (max-width: 600px) {
  .tl, .today, .tl-dev { --tl-rail-w: 2.5rem; --tl-gap: 9px; }
  .tl-day-num { min-inline-size: 2rem; block-size: 2rem; font-size: .92rem; border-radius: 10px; }
  .tl-day-title { font-size: 1.12rem; }
  .tl-item--has-media:not(.tl-item--lead) .tl-card { grid-template-columns: minmax(0, 1fr) 92px; column-gap: 10px; }
  .tl-item--has-media:not(.tl-item--lead) .tl-media { aspect-ratio: 1 / 1; border-radius: 10px; }
  .tl-card { padding: 10px 11px; border-radius: 16px; }
  .tl-item--lead .tl-body { padding: 9px 11px 11px; }
  .tl-item--lead .tl-title { font-size: 1.08rem; }
  .tl-title { font-size: .98rem; }
  .tl-time { font-size: var(--text-xs); }
  .tl-rail { padding-inline-end: 0; padding-block-start: 11px; }
  .tl-item::before { inset-block-start: 16px; }
  .tl-card--quake { gap: 9px; padding: 9px 11px; }
  .tl-mag { width: 42px; height: 42px; }
  .tl-day-meta { order: 3; flex-basis: 100%; margin-inline-start: 0; }
  .tl-day-meta + .tl-day-toggle { margin-inline-start: auto; }
  html.tl-compact .tl-item--has-media .tl-card { grid-template-columns: minmax(0, 1fr) 54px; gap: 10px; }
  .tl-bar { margin-block-end: 10px; }
  .tl-out-k { display: none; }
  .tl-links { column-gap: 8px; }
  /* Outlet alone: its own script decides the side the ellipsis cuts. */
  a.tl-out { unicode-bidi: plaintext; }
  .tl-out-name { unicode-bidi: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .tl-pill, .tl-expand, .tl-expand::after, .tl-card, .tl-img, .today-chip, .tl-item::before, .tl-time, .tl-title, .tl-full, .tl-full::after, .tl-out, .tl-chip, .tl-more-link, .js-tl-anim .tl-item.is-revealed { transition: none; }
  .today-chip:hover, .tl-card:hover, .tl-card:hover .tl-img, .tl-full:hover::after, [dir="rtl"] .tl-full:hover::after, .tl-more-link:hover, .js-tl-anim .tl-item.tl-will-reveal { transform: none; }
  .tl-item:hover::before { transform: translateX(-50%); }
  [dir="rtl"] .tl-item:hover::before { transform: translateX(50%); }
  .js-tl-anim .tl-item.tl-will-reveal { opacity: 1; }
  .tl-live i, .tl-load[aria-busy="true"]::before { animation: none; }
  .tl-top, .tl-toast, .tl-act, .tl-seg-btn, .tl-tool, .tl-load, .tl-search, .tl-day-toggle svg { transition: none; }
  .tl-load:hover, .tl-act:active { transform: none; }
}
