/* TLS Status Dashboard — RTL-first, mobile-friendly */

.tls-page {
  max-width: 1200px;
  margin-inline: auto;
}

.tls-hero {
  margin-bottom: 2rem;
}
.tls-hero h1 {
  margin: 0.35rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 2.5vw, 2.35rem);
  line-height: 1.35;
  text-align: right;
}
.tls-hero__lead {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 42rem;
}
.tls-hero__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.tls-meta-item {
  border: 1px solid rgba(12, 28, 36, 0.1);
  background: rgba(255, 253, 249, 0.9);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: right;
}
.tls-meta-item__label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  width: 100%;
}
.tls-meta-item__value {
  font-size: 1.05rem;
  font-weight: 700;
  unicode-bidi: isolate;
  width: 100%;
}
.tls-hero__fresh {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.tls-hero__disclaimer {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* KPIs */
.tls-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}
.tls-kpi {
  border: 1px solid rgba(47, 111, 126, 0.18);
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  display: grid;
  gap: 0.2rem;
}
.tls-kpi--warn {
  border-color: rgba(154, 91, 0, 0.35);
  background: rgba(255, 244, 230, 0.55);
}
.tls-kpi__label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.tls-kpi__value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  unicode-bidi: isolate;
}
.tls-kpi__unit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tls-stale-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  margin: 0 0 1.75rem;
  border-radius: 12px;
  border: 1px solid rgba(154, 91, 0, 0.35);
  background: rgba(255, 244, 230, 0.65);
}
.tls-stale-banner p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Finder */
.tls-finder {
  margin: 0 0 2rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid rgba(47, 111, 126, 0.2);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(47, 111, 126, 0.06), rgba(255, 253, 249, 0.95));
}
.tls-finder h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}
.tls-finder__lead,
.tls-finder__hint {
  margin: 0 0 1rem;
  color: var(--text-muted);
  line-height: 1.75;
}
.tls-finder__step {
  border: 0;
  margin: 0 0 1.25rem;
  padding: 0;
}
.tls-finder__step legend {
  font-weight: 700;
  margin-bottom: 0.65rem;
  padding: 0;
}
.tls-radio-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.tls-radio-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(12, 28, 36, 0.14);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  min-height: 3.25rem;
}
.tls-radio-card:has(input:checked) {
  border-color: #2f6f7e;
  box-shadow: 0 0 0 2px rgba(47, 111, 126, 0.18);
  background: rgba(47, 111, 126, 0.06);
}
.tls-radio-card input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex: 0 0 auto;
  order: -1;
  accent-color: #2f6f7e;
}
.tls-finder__actions {
  display: flex;
  gap: 0.75rem;
}

/* Result */
.tls-result {
  margin: 0 0 2rem;
  padding: 1.25rem 1.35rem;
  border-radius: 14px;
  border: 1px solid rgba(27, 122, 78, 0.28);
  background: rgba(232, 247, 239, 0.45);
}
.tls-result h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
}
.tls-result__box {
  display: grid;
  gap: 0.85rem;
}
.tls-related {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(12, 28, 36, 0.08);
}
.tls-related h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.tls-related__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

/* Sections */
.tls-section {
  margin: 0 0 2.5rem;
}
.tls-section h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
}
.tls-section__sub {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  unicode-bidi: isolate;
  max-width: 36rem;
}
.tls-section__lead {
  margin: 0 0 1rem;
  line-height: 1.8;
  color: var(--text-muted);
}
.tls-legacy-panel {
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(12, 28, 36, 0.1);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.9);
}

/* Cards */
.tls-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.tls-card-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tls-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.35rem;
  border: 1px solid rgba(12, 28, 36, 0.12);
  border-radius: 14px;
  background: #fff;
  min-width: 0;
}
.tls-card--stale {
  border-color: rgba(154, 91, 0, 0.35);
}
.tls-card--highlight {
  box-shadow: 0 0 0 3px rgba(47, 111, 126, 0.22);
}
.tls-card--dim {
  opacity: 0.35;
}
.tls-card__title {
  margin: 0;
  font-size: 1.15rem;
  font-family: var(--font-display);
  line-height: 1.45;
  text-align: right;
}
.tls-card__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  unicode-bidi: isolate;
  direction: ltr;
  text-align: start;
  max-width: 100%;
}
.tls-card__status-rows {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}
.tls-status-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem;
  align-items: center;
}
.tls-status-row dt {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}
.tls-status-row dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.tls-card__explain,
.tls-card__note {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.8;
}
.tls-card__note {
  color: var(--text-muted);
}
.tls-card__dates,
.tls-card__ref-dates {
  margin: 0;
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(247, 244, 239, 0.7);
  border: 1px solid rgba(12, 28, 36, 0.06);
}
.tls-card__dates > div,
.tls-card__ref-dates > div {
  display: grid;
  gap: 0.15rem;
}
.tls-card__dates dt,
.tls-card__ref-dates dt {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}
.tls-card__dates dd,
.tls-card__ref-dates dd {
  margin: 0;
  font-weight: 600;
}
.tls-card__ref-meaning {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.tls-card__age {
  font-size: 0.8rem;
  color: #7a3e00;
  unicode-bidi: isolate;
}
.tls-action {
  margin-top: auto;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  background: rgba(47, 111, 126, 0.07);
  border: 1px solid rgba(47, 111, 126, 0.14);
}
.tls-action__title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}
.tls-action__body {
  margin: 0;
  line-height: 1.75;
  font-size: 0.92rem;
}
.tls-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tls-card__actions .btn {
  flex: 1 1 auto;
  text-align: center;
  justify-content: center;
}
.tls-card__secondary {
  pointer-events: none;
  opacity: 0.92;
}
.tls-ext {
  unicode-bidi: isolate;
}

/* Badges */
.tls-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
  line-height: 1.4;
}
.tls-badge--ok {
  background: rgba(27, 122, 78, 0.12);
  color: #0f5c38;
  border-color: rgba(27, 122, 78, 0.28);
}
.tls-badge--warn {
  background: rgba(184, 135, 59, 0.14);
  color: #7a3e00;
  border-color: rgba(184, 135, 59, 0.35);
}
.tls-badge--bad {
  background: rgba(160, 40, 40, 0.1);
  color: #8a1f1f;
  border-color: rgba(160, 40, 40, 0.28);
}
.tls-badge--muted {
  background: rgba(12, 28, 36, 0.06);
  color: #445;
  border-color: rgba(12, 28, 36, 0.12);
}

/* Filter */
.tls-filter {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1rem;
}
.tls-filter__chips {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}
.tls-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(12, 28, 36, 0.14);
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tls-chip.is-active {
  background: #0c1c24;
  color: #fff;
  border-color: #0c1c24;
}
.tls-filter__search input {
  width: 100%;
  font: inherit;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(12, 28, 36, 0.16);
  border-radius: 10px;
  background: #fff;
}

/* Glossary */
.tls-glossary {
  margin: 0 0 2rem;
}
.tls-glossary h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
}
.tls-accordion {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.tls-accordion details,
.tls-glossary__full {
  border: 1px solid rgba(12, 28, 36, 0.1);
  border-radius: 10px;
  background: rgba(255, 253, 249, 0.85);
  padding: 0.7rem 0.95rem;
}
.tls-accordion summary,
.tls-glossary__full > summary {
  cursor: pointer;
  font-weight: 700;
}
.tls-accordion p {
  margin: 0.55rem 0 0;
  color: var(--text-muted);
  line-height: 1.75;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (max-width: 1100px) {
  .tls-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .tls-hero__meta,
  .tls-summary {
    grid-template-columns: 1fr 1fr;
  }
  .tls-radio-cards,
  .tls-card-grid,
  .tls-card-grid--2 {
    grid-template-columns: 1fr;
  }
  .tls-stale-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .tls-stale-banner .btn,
  .tls-card__actions .btn,
  .tls-finder__actions .btn {
    width: 100%;
  }
  .tls-status-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}
@media (max-width: 430px) {
  .tls-hero__meta,
  .tls-summary {
    grid-template-columns: 1fr;
  }
  .tls-finder,
  .tls-card,
  .tls-legacy-panel {
    padding: 1rem;
  }
}
