/* Release checker, on top of design system v0.4.3 and /css/toolkit.css.
   Design system tokens only: no raw colors, no shadows on resting surfaces. */

/* heading block */
.hero { margin-bottom: var(--space-6); }
.hero .privacy { margin-bottom: var(--space-6); }

.stat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.stat-grid li { display: flex; }
.stat { flex: 1; display: flex; flex-direction: column; gap: var(--space-1); text-align: left; padding: var(--space-3) var(--space-4);
  background: var(--card); color: var(--card-foreground); border: var(--border-hairline) solid var(--border); border-radius: var(--radius-lg); cursor: pointer;
  transition: border-color var(--duration-fast) var(--easing-out), background-color var(--duration-fast) var(--easing-out); }
.stat:hover { border-color: var(--input); }
.stat.is-on { border-color: var(--primary); box-shadow: inset 0 0 0 var(--border-hairline) var(--primary); }
.stat-num { font-size: var(--text-xl); line-height: var(--leading-xl); font-weight: var(--font-weight-semibold); letter-spacing: var(--tracking-xl); font-variant-numeric: tabular-nums; }
.stat-label { font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--muted-foreground); }

.freshness { display: flex; align-items: flex-start; gap: var(--space-2); margin: var(--space-4) 0 0; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--muted-foreground); }
.freshness > span:last-child { flex: 1 1 0; min-width: 0; }
.freshness a { color: var(--muted-foreground); }
.dot { flex: none; width: var(--size-dot); height: var(--size-dot); margin-top: calc((var(--leading-sm) - var(--size-dot)) / 2); border-radius: var(--radius-full); background: var(--success); }
.freshness.is-error .dot { background: var(--warning); }
.stale-note { margin: var(--space-3) 0 0; display: block; }

.hint { display: flex; gap: var(--space-4); align-items: flex-start; justify-content: space-between; padding: var(--space-4); margin: 0 0 var(--space-6); }
.hint-body { flex: 1 1 0; min-width: 0; }
#hint-close { flex: none; width: calc-size(fit-content, round(up, size, 1px)); }
.hint h2 { font-size: var(--text-base); line-height: var(--leading-base); margin: 0 0 var(--space-1); }
.hint ol { margin: 0; padding-left: var(--space-5); color: var(--muted-foreground); font-size: var(--text-sm); line-height: var(--leading-sm); }
.hint li + li { margin-top: var(--space-1); }

/* views */
.views { margin: 0 0 var(--space-4); }

/* filters */
.controls { display: grid; gap: var(--space-4); padding: var(--space-4); }
.filter-body { display: grid; gap: var(--space-4); }
.filters-btn { display: none; }
.search-wrap .input { padding-right: calc(var(--space-2) + var(--size-control-sm) + var(--space-2)); }
.search-wrap .input::-webkit-search-cancel-button { appearance: none; -webkit-appearance: none; }
.search-wrap .q-clear { position: absolute; right: var(--space-1); }
.search-wrap .input:focus ~ .kbd-hint, .search-wrap .input:not(:placeholder-shown) ~ .kbd-hint { visibility: hidden; }
.controls legend, .field__label { font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: var(--font-weight-medium); color: var(--foreground); margin: 0 0 var(--space-2); padding: 0; }
.field__label { margin: 0; }
.seg { display: flex; width: max-content; max-width: 100%; }
.seg__item span { white-space: nowrap; }

.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip-row label { position: relative; cursor: pointer; }
.chip-row input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip-row span { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--size-control-sm); padding: 0 var(--space-3);
  border: var(--border-hairline) solid var(--border); border-radius: var(--radius-full); background: var(--card); color: var(--foreground);
  font-size: var(--text-sm); line-height: var(--leading-sm); white-space: nowrap; transition: border-color var(--duration-fast) var(--easing-out), background-color var(--duration-fast) var(--easing-out); }
.chip-row label:hover span { border-color: var(--input); }
.chip-row input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-soft-foreground); font-weight: var(--font-weight-medium); }
.chip-row input:focus-visible + span { outline: var(--focus-width) solid var(--ring); outline-offset: var(--focus-offset); }
.chip-row b { font-family: var(--font-mono); font-weight: var(--font-weight-regular); font-size: var(--text-xs); color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.chip-row input:checked + span b { color: var(--primary-soft-foreground); }
/* Zero counts look quieter through a dashed border, not opacity, so the text keeps at least
   4.5:1 contrast in both themes (tests/test_ui.py checks it). */
.chip-row .is-zero span { border-style: dashed; color: var(--muted-foreground); background: var(--background); }
.chip-row .is-zero input:checked + span { border-style: solid; color: var(--primary-soft-foreground); background: var(--primary-soft); }
.select-row { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
.sel { max-width: none; gap: var(--space-2); }

/* results */
.results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); margin: var(--space-6) 0 var(--space-3); min-height: var(--size-control-sm); }
.result-count { margin: 0; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--muted-foreground); }
.result-count strong { color: var(--foreground); font-variant-numeric: tabular-nums; }
.active { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.tag-x { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--size-target-min); padding: 0 var(--space-1) 0 var(--space-2);
  border: 0; border-radius: var(--radius-sm); background: var(--secondary); color: var(--secondary-foreground); font-size: var(--text-sm); line-height: var(--leading-sm); cursor: pointer; }
.tag-x:hover { background: var(--accent); }
/* PR 8 re-check MF2: a long search (200 characters with no spaces) stays inside the row on a phone.
   The chip may shrink to the row, its label wraps anywhere, and the remove mark keeps its size. */
.results-bar > *, .active { min-width: 0; max-width: 100%; }
.tag-x { max-width: 100%; min-width: 0; text-align: start; }
.tag-x .tag-label { min-width: 0; overflow-wrap: anywhere; }
.tag-x .x { flex: none; }
.tag-x .x { display: inline-grid; place-items: center; width: var(--size-icon-sm); height: var(--size-icon-sm); color: var(--muted-foreground); }
.clear-all { min-height: var(--size-target-min); padding: 0 var(--space-1); border: 0; background: none; font-size: var(--text-sm); color: var(--muted-foreground); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.clear-all:hover { color: var(--foreground); }

.panel-note { font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--muted-foreground); margin: 0 0 var(--space-4); max-width: var(--size-measure); }
.day { margin: 0 0 var(--space-6); }
.day-head { position: sticky; top: var(--sticky-top, var(--size-header)); z-index: var(--z-raised); display: flex; align-items: baseline; gap: var(--space-2); margin: 0 0 var(--space-2);
  padding: var(--space-2) 0; background: var(--background); border-bottom: var(--border-hairline) solid var(--border);
  font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: var(--font-weight-semibold); }
.day-rel, .day-n { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--muted-foreground); font-weight: var(--font-weight-regular); }
.day-n { margin-left: auto; font-variant-numeric: tabular-nums; }

/* one dataset: rows in a single hairline list */
.items { list-style: none; margin: 0; padding: 0; background: var(--card); border: var(--border-hairline) solid var(--border); border-radius: var(--radius-lg); }
.item { padding: var(--space-4); }
.item + .item { border-top: var(--border-hairline) solid var(--border); }
.item-top { display: flex; align-items: flex-start; gap: var(--space-3); }
.item-main { min-width: 0; flex: 1; }
.item h3 { margin: 0; font-size: var(--text-base); line-height: var(--leading-base); }
.item h3 a { color: var(--foreground); text-decoration: none; }
.item h3 a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.item h3 .ext { display: inline-block; width: var(--size-icon-xs); height: var(--size-icon-xs); margin-left: var(--space-1); vertical-align: -0.05em; color: var(--muted-foreground); }
.item-sum { margin: var(--space-1) 0 var(--space-2); color: var(--muted-foreground); font-size: var(--text-sm); line-height: var(--leading-sm); max-width: var(--size-measure); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: var(--space-2) 0 0; padding: 0; list-style: none;
  font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--muted-foreground); }
.meta li { display: inline-flex; align-items: center; gap: var(--space-1); }
.pill { display: inline-flex; align-items: center; gap: var(--space-1); height: var(--space-6); padding: 0 var(--space-2); border-radius: var(--radius-full);
  background: var(--secondary); color: var(--foreground); font-size: var(--text-xs); line-height: var(--leading-xs); font-weight: var(--font-weight-medium); white-space: nowrap; }
.pill::before { content: ""; width: var(--size-dot); height: var(--size-dot); border-radius: var(--radius-full); background: var(--muted-foreground); }
.k-new { background: var(--success-soft); } .k-new::before { background: var(--success); }
.k-release { background: var(--primary-soft); } .k-release::before { background: var(--primary); }
.k-updated { background: var(--info-soft); } .k-updated::before { background: var(--info); }
.k-planned, .k-rescheduled { background: var(--warning-soft); } .k-planned::before, .k-rescheduled::before { background: var(--warning); }
.k-removed { background: var(--secondary); }
.cat { display: inline-flex; align-items: center; height: var(--space-6); padding: 0 var(--space-2); border: var(--border-hairline) solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--foreground); white-space: nowrap; }
.toggle { flex: none; }
.toggle .icon { transition: transform var(--duration-base) var(--easing-out); }
.toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.details { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--duration-base) var(--easing-out); }
.details.is-open { grid-template-rows: 1fr; }
.details > div { overflow: hidden; }
.details-inner { margin-top: var(--space-3); padding-top: var(--space-3); border-top: var(--border-hairline) solid var(--border); display: grid; gap: var(--space-3); }
.dates { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: var(--space-3) var(--space-4); margin: 0; }
.dates div { min-width: 0; }
.dates dt { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--muted-foreground); }
.dates dd { margin: 0; font-size: var(--text-sm); line-height: var(--leading-sm); font-variant-numeric: tabular-nums; }
.links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.links a { display: inline-flex; align-items: center; min-height: var(--size-control-sm); padding: 0 var(--space-3); border: var(--border-hairline) solid var(--input); border-radius: var(--radius-md);
  background: var(--card); color: var(--foreground); font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: var(--font-weight-medium); text-decoration: none; }
.links a:hover { background: var(--accent); }
.links a.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.links a.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.overdue { color: var(--warning); font-weight: var(--font-weight-medium); }
.more-wrap { display: flex; justify-content: flex-start; margin: var(--space-4) 0 0; }
mark { background: var(--primary-soft); color: var(--primary-soft-foreground); border-radius: var(--radius-sm); padding: 0 0.1em; }

/* states */
/* v0.4.2 states sit top left (24px in), so no edge is centered onto a half pixel. */
.empty { max-width: none; padding: var(--space-6);
  background: var(--card); border: var(--border-hairline) solid var(--border); border-radius: var(--radius-lg); }
.empty h2 { margin: 0; }
.empty .state__text { max-width: var(--size-measure); }
.error { margin: var(--space-4) 0; }
.error .state { padding: var(--space-6); }
.error .state__icon { color: var(--destructive); }
/* The placeholder is a day block built from the real classes: a date line, then three rows with a title line, a
   pill line and the Details button, so it has the size and shape of the list that replaces it (Testingralph SF3). */
.sk-list .day-head { position: static; }
.sk-list .sk-date { width: 9rem; height: var(--leading-sm); }
.sk-list .sk-title { width: 60%; height: var(--leading-base); }
.sk-list .sk-meta { width: 40%; height: var(--space-6); margin-top: var(--space-2); }
.sk-list .sk-btn { flex: none; width: var(--space-16); height: var(--size-control-sm); }
/* On phones most dataset names wrap to two lines, so the skeleton title does too. */
@media (max-width: 520px) { .sk-list .sk-title { width: 90%; height: calc(2 * var(--leading-base)); } }
.slow-note:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: var(--space-3) 0 0; font-size: var(--text-sm); line-height: var(--leading-sm); }

/* about */
.about { margin-top: var(--space-12); padding-top: var(--space-6); border-top: var(--border-hairline) solid var(--border); }
.about .block-title { margin-bottom: var(--space-4); }
.about-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
.about h3 { font-size: var(--text-base); line-height: var(--leading-base); margin: 0 0 var(--space-2); }
.about h3:not(:first-child) { margin-top: var(--space-4); }
.about p, .about li { margin: 0; color: var(--muted-foreground); font-size: var(--text-sm); line-height: var(--leading-sm); }
.about ul { padding-left: var(--space-5); margin: 0; }
.about li + li { margin-top: var(--space-2); }
.defs { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-3); align-items: center; margin: var(--space-3) 0 0; font-size: var(--text-sm); line-height: var(--leading-sm); }
.defs dt { display: flex; }
.defs dd { margin: 0; color: var(--muted-foreground); }

@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .select-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .about-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); }
}
@media (max-width: 767px) {
  .controls { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); }
  .filter-body { grid-column: 1 / -1; display: none; }
  .filter-body.is-open { display: grid; }
  .filters-btn { display: inline-flex; }
  .filters-btn[aria-expanded="true"] { border-color: var(--primary); }
  .filters-n { background: var(--primary); color: var(--primary-foreground); }
  .kbd-hint { display: none; }
  .search-wrap .input { padding-right: calc(var(--space-1) + var(--size-control-sm)); }
}
@media (max-width: 520px) {
  .item-top { flex-direction: column; gap: var(--space-2); }
  .seg { width: 100%; }
  .seg__item { flex: 1 1 0; min-width: 0; }
  .seg__item span { width: 100%; justify-content: center; padding-inline: var(--space-1); }
  /* Three tabs share a phone width, so none scrolls out of view. */
  .views { gap: 0; }
  .views .tab { flex: 1 1 auto; min-width: 0; justify-content: center; padding-inline: var(--space-1); gap: var(--space-1); }
}
