:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #5d6470;
  --line: #e2e0da;
  --accent: #1f4e8c;
  --ro: #1f4e8c;
  --ro-bg: #eef3fa;

  --st-not_due: #c9d3df;
  --st-due_no_action: #d9d6cf;
  --st-case_closed: #8fbfb2;
  --st-formal_notice: #f0cf7a;
  --st-reasoned_opinion: #e09a4f;
  --st-referred: #b5552f;
  --st-fines: #9c2f2f;
  --st-ink: #1d1f23;
  --st-ink-dark: #ffffff;
  --st-ink-warm: #1d1f23; /* text on ochre and orange, both themes */
  --edge: #878a90; /* 3:1 against paper: cell outlines, form controls */
  --dim: 0.22; /* squares and band segments outside the selection */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --surface: #1d2026;
    --text: #e8e6e1;
    --muted: #9aa1ad;
    --line: #2e323a;
    --accent: #8db4ea;
    --ro: #8db4ea;
    --ro-bg: #1c2633;

    --st-not_due: #465365;
    --st-due_no_action: #4d4a44;
    --st-case_closed: #3f7a6b;
    --st-formal_notice: #b8963c;
    --st-reasoned_opinion: #c27a33;
    --st-referred: #b5563a;
    --st-fines: #a33a3a;
    --st-ink: #ffffff;
    --st-ink-warm: #15171b;
    --edge: #6b7079;
    --dim: 0.3;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

a { color: var(--accent); }
.muted { color: var(--muted); font-size: 0.9em; }
.note { color: var(--muted); font-size: 0.9rem; }

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.site-nav { margin-left: auto; font-size: 0.9rem; display: flex; gap: 16px; }
.brand { font-weight: 650; color: var(--text); text-decoration: none; }
.badge {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted);
}

main section { margin: 40px 0; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; margin: 4px 0 8px; }
h2 { font-size: 1.3rem; margin: 0 0 14px; }
.eyebrow { color: var(--muted); margin: 32px 0 0; font-size: 0.9rem; }
.full-title { color: var(--muted); max-width: 70ch; margin: 0; }

.keyfacts { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.keyfacts div {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 16px; min-width: 150px; flex: 1 1 150px;
}
.keyfacts dt { color: var(--muted); font-size: 0.85rem; }
.keyfacts dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; }

.ro-card {
  background: var(--ro-bg); border: 1px solid var(--line); border-left: 5px solid var(--ro);
  border-radius: 10px; padding: 20px 22px;
}
.ro-card h2 { margin-bottom: 8px; }
.ro-stage { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.ro-stage .pill { font-size: 1.05rem; padding: 4px 12px; }
.ro-peers { font-size: 1.1rem; margin: 12px 0; }
.ro-facts { padding-left: 20px; margin: 0 0 12px; }
.ro-facts li { margin: 4px 0; }
.src { font-size: 0.9rem; margin: 0; }

.pill {
  display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 0.85rem;
  font-weight: 600; white-space: nowrap; color: var(--st-ink);
}
.st-not_due { background: var(--st-not_due); fill: var(--st-not_due); }
.st-due_no_action { background: var(--st-due_no_action); fill: var(--st-due_no_action); }
.st-case_closed { background: var(--st-case_closed); fill: var(--st-case_closed); }
.st-formal_notice { background: var(--st-formal_notice); fill: var(--st-formal_notice); color: var(--st-ink-warm); }
.st-reasoned_opinion { background: var(--st-reasoned_opinion); fill: var(--st-reasoned_opinion); color: var(--st-ink-warm); }
.st-referred { background: var(--st-referred); fill: var(--st-referred); color: var(--st-ink-dark); }
.st-fines { background: var(--st-fines); fill: var(--st-fines); color: var(--st-ink-dark); }

.dist-fig { margin: 0; }
svg.dist { width: 100%; height: auto; max-width: 760px; display: block; }
svg.dist rect { stroke: var(--edge); stroke-width: 1; } /* 3:1 outline: pale stages stay visible */
svg.dist rect.is-ro { stroke: var(--ro); stroke-width: 2.5; }
.svg-code { font-size: 8px; fill: var(--muted); text-anchor: middle; }
.legend { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.9rem; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }



.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table.states { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.states th, .states td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.states thead th { font-size: 0.82rem; color: var(--muted); font-weight: 600; background: var(--surface); }
.states tbody th { font-weight: 600; white-space: nowrap; }
.states .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.states td:nth-child(3), .states td:nth-child(4) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.states tr.is-ro { background: var(--ro-bg); }
.states tr.is-ro th { box-shadow: inset 4px 0 0 var(--ro); }
.th-sub { font-weight: 400; }
.src-cell { white-space: nowrap; }
.src-cell a { text-decoration: none; font-size: 0.85rem; }

/* Calendar: a dated register. Date | spine with a marker | event. Each row draws the spine coming
   into its marker (::before) and leaving it (::after), so the line stays whole at any row height. */
.cal-intro { max-width: 68ch; margin: 0 0 18px; }
.cal {
  --cal-date: 6.4rem; --cal-col: 18px; --cal-gap: 12px; --cal-mid: 11px; /* half the title line */
  list-style: none; margin: 0; padding: 0; max-width: 760px;
}
.cal > li {
  --pad: 18px;
  position: relative; display: grid; padding-top: var(--pad);
  grid-template-columns: var(--cal-date) var(--cal-col) minmax(0, 1fr); column-gap: var(--cal-gap);
}
.cal > li:first-child { --pad: 0px; }
.cal > li::before, .cal > li::after {
  content: ""; position: absolute; width: 0;
  left: calc(var(--cal-date) + var(--cal-gap) + var(--cal-col) / 2 - 1px);
  border-left: 2px solid var(--line);
}
.cal > li::before { top: 0; height: calc(var(--pad) + var(--cal-mid)); }
.cal > li::after { top: calc(var(--pad) + var(--cal-mid)); bottom: 0; }
.cal > li:first-child::before, .cal > li:last-child::after { display: none; }
/* After today the line is dashed: those dates have not happened yet. */
.cal-today::after, .cal-today ~ li::before, .cal-today ~ li::after { border-left-style: dashed; border-left-color: var(--edge); }

.cal-date {
  grid-column: 1; text-align: right; color: var(--muted); font-size: 0.9rem;
  line-height: calc(var(--cal-mid) * 2); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cal-mark {
  --size: 11px;
  grid-column: 2; justify-self: center; position: relative; z-index: 1;
  width: var(--size); height: var(--size); margin-top: calc(var(--cal-mid) - var(--size) / 2);
  border-radius: 50%; background: var(--bg); border: 2px solid var(--text);
}
.cal-body { grid-column: 3; min-width: 0; }
.cal-title { margin: 0; font-weight: 600; line-height: calc(var(--cal-mid) * 2); overflow-wrap: anywhere; }
.cal-meta { display: block; margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.cal-meta a { color: var(--muted); }

/* The deadline: the one heavy line across the register. */
.cal-deadline { --pad: 14px; border-top: 2px solid var(--text); margin-top: 6px; }
.cal > .cal-deadline:first-child { margin-top: 0; }
.cal-deadline .cal-mark { --size: 15px; background: var(--text); }
.cal-deadline .cal-title { font-weight: 700; font-size: 1.05rem; }
.cal-deadline .cal-date { color: var(--text); font-weight: 650; }
.cal-deadline.is-future { border-top-style: dashed; }
.cal-deadline.is-future .cal-mark { background: var(--bg); }

/* Romania: the blue is Romania's, as everywhere else on the site. */
.cal-who { color: var(--ro); font-weight: 650; margin-right: 0.2em; }
.cal-ro-act .cal-title, .cal-ro-old .cal-title { font-weight: 600; }
/* The rest of an act's official title: two lines here, in full in the notified-measures list. */
.cal-rest {
  margin: 0; font-size: 0.9rem; line-height: 1.45; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.cal-acts .cal-rest { display: -webkit-box; }
.cal-act-name { font-weight: 600; }
.cal-ro-act .cal-mark { background: var(--ro); border-color: var(--ro); }
.cal-ro-old .cal-mark { border-color: var(--ro); }

/* Commission decisions: a status square, as in the EU27 chart, and the stage chip. */
.cal-ce .cal-mark { --size: 13px; border-radius: 3px; border: 1px solid var(--edge); }
.cal-ce .cal-mark.st-formal_notice { background: var(--st-formal_notice); }
.cal-ce .cal-mark.st-reasoned_opinion { background: var(--st-reasoned_opinion); }
.cal-ce .cal-mark.st-referred { background: var(--st-referred); }
.cal-ce .cal-mark.st-fines { background: var(--st-fines); }
.cal-ce .cal-mark.st-case_closed { background: var(--st-case_closed); }
.cal-ce .cal-mark.st-due_no_action { background: var(--st-due_no_action); }
.cal-ce .cal-mark.st-not_due { background: var(--st-not_due); }
.cal-ce .cal-title .pill { vertical-align: 1px; }

.cal-today .cal-mark { --size: 9px; border-color: var(--muted); }
.cal-today .cal-title, .cal-today .cal-date { color: var(--muted); }

.is-future .cal-date, .is-future .cal-title { color: var(--muted); }
.is-future .cal-mark { border-style: dashed; border-color: var(--edge); }

.cal-gap { --pad: 6px; color: var(--muted); font-size: 0.8rem; }
.cal-gap > span { grid-column: 3; padding-bottom: 2px; }
.cal-gap::before, .cal-gap::after { border-left-style: dotted !important; border-left-color: var(--edge) !important; }
.cal-gap::before { height: var(--pad) !important; }

.cal-acts { list-style: none; margin: 8px 0 0; padding: 0; }
.cal-acts li { margin: 0 0 8px; font-size: 0.95rem; line-height: 1.45; overflow-wrap: anywhere; }
.cal-act-date { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; margin-right: 0.3em; }
details.cal-more { border: 0; padding: 0; margin: 4px 0 0; }
details.cal-more > summary { color: var(--accent); font-weight: 600; font-size: 0.9rem; cursor: pointer; }
/* The directive's own sentence for a date: quoted word for word, set off by a hairline. */
.cal-quote blockquote {
  margin: 6px 0 2px; padding: 2px 0 2px 12px; border-left: 1px solid var(--edge);
  max-width: 68ch; font-size: 0.9rem; line-height: 1.5; overflow-wrap: anywhere;
}
.cal-quote .src-line { margin: 2px 0 0; }

@media (max-width: 600px) {
  .cal { --cal-date: 5.2rem; --cal-col: 14px; --cal-gap: 9px; }
  .cal-date { font-size: 0.82rem; }
}

.how ul { padding-left: 20px; max-width: 75ch; }
.how li { margin: 8px 0; }

details { border-bottom: 1px solid var(--line); padding: 8px 0; }
summary { cursor: pointer; font-weight: 600; }
.measures { font-size: 0.9rem; padding-left: 20px; }
.measures li { margin: 4px 0; overflow-wrap: anywhere; }
.measures .journal { display: block; color: var(--muted); font-size: 0.85rem; }

.sources { font-size: 0.9rem; padding-left: 24px; }
.sources li { margin: 4px 0; overflow-wrap: anywhere; }

.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 20px 0 40px; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 600px) {
  .states th, .states td { padding: 7px 8px; }
  .ro-card { padding: 16px; }
}

/* Plain-language layer */
.lead { font-size: 1.2rem; line-height: 1.55; max-width: 68ch; margin: 12px 0 6px; }
.src-line { color: var(--muted); font-size: 0.85rem; margin: 6px 0; }
.src-line a { color: var(--muted); }
a.pill { text-decoration: none; }

details.explain { margin-top: 12px; max-width: 72ch; }
details.explain > summary, details.tech > summary { color: var(--accent); font-weight: 600; }
details.explain p { margin: 8px 0; }
details.tech { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 12px 0; background: var(--surface); }
details.tech[open] > summary { margin-bottom: 8px; }
details.tech ul { padding-left: 20px; }
details.nested { border-bottom: 1px solid var(--line); }

.ro-headline { font-size: 1.35rem; font-weight: 650; line-height: 1.3; margin: 0 0 12px; }
.ro-card details.tech { background: transparent; }

.ladder { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ladder li {
  position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 10px 10px 12px;
  background: var(--surface); display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.ladder .step-n { font-size: 0.75rem; color: var(--muted); font-weight: 700; }
.ladder .step-label { font-weight: 650; font-size: 0.95rem; }
.ladder li.done { opacity: 0.75; }
.ladder li.done .step-n::after { content: " ✓"; }
.ladder li.current { border: 2px solid var(--ro); background: var(--bg); }
.ladder .here {
  margin-top: 6px; align-self: flex-start; font-size: 0.75rem; font-weight: 700;
  background: var(--ro); color: var(--surface); border-radius: 999px; padding: 1px 8px;
}

figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.groups { padding: 0; display: grid; gap: 10px; margin-top: 16px; }
.group { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.group h3 { margin: 0 0 6px; font-size: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.group .count { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.group p { margin: 0; }

.glossary > p { max-width: 72ch; }
.glossary dl { display: grid; gap: 12px; margin: 16px 0; }
.glossary dl > div { border-left: 3px solid var(--line); padding: 2px 0 2px 14px; scroll-margin-top: 16px; }
.glossary dl > div:target { border-left-color: var(--accent); }
.glossary dt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.glossary dd { margin: 6px 0 0; max-width: 72ch; }

@media (max-width: 600px) {
  .ladder { grid-template-columns: repeat(2, 1fr); }
  .lead { font-size: 1.1rem; }
  .ro-headline { font-size: 1.2rem; }
}

/* Browser surfaces */
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
:root { accent-color: var(--accent); caret-color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
a { text-underline-offset: 0.18em; }
/* Links that leave the site (build.py gives them target="_blank"): a small arrow, and for screen
   readers the alternative text after the slash. Browsers without that syntax keep the first rule. */
a[target="_blank"]::after {
  content: "\2197";
  content: "\2197" / " (se deschide într-o filă nouă)";
  display: inline-block; /* keeps the arrow out of the underline */
  margin-left: 0.15em;
  font-size: 0.8em;
  text-decoration: none;
}

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

/* All-directives register */
.wrap.wide { max-width: 1200px; }
.reg-intro { margin: 36px 0 0; }
.reg-intro h1 { margin: 0 0 10px; text-wrap: balance; }
.reg-intro .lead { margin-top: 0; }

.finder-bar {
  position: sticky; top: 0; z-index: 3; background: var(--bg);
  border-bottom: 1px solid var(--line); margin: 24px 0 0; padding: 14px 0 12px;
}
.finder {
  display: grid; grid-template-columns: minmax(240px, 1.2fr) minmax(0, 3fr) auto;
  gap: 12px 16px; align-items: end;
}
.f-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; }
.finder label { display: block; min-width: 0; }
.f-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finder input, .finder select {
  font: inherit; font-size: 0.95rem; width: 100%; min-height: 40px; padding: 7px 10px;
  color: var(--text); background: var(--surface); border: 1px solid var(--edge); border-radius: 8px;
}
.finder input::placeholder { color: var(--muted); }
.finder input:hover, .finder select:hover { border-color: var(--text); }
.f-status { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.f-count { margin: 0; font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.f-count strong { color: var(--text); font-size: 1.05rem; }
.f-reset {
  font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--accent); cursor: pointer;
  background: transparent; border: 1px solid var(--edge); border-radius: 8px; min-height: 40px; padding: 7px 12px;
}
.f-reset:hover { background: var(--surface); border-color: var(--accent); }

.register .legend, .legend { margin: 14px 0 0; }
.cell {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px;
  box-shadow: inset 0 0 0 1px var(--edge);
}

table.register { width: 100%; border-collapse: separate; border-spacing: 0; margin: 14px 0 0; font-size: 0.95rem; }
.register thead th {
  position: sticky; top: var(--finder-h, 0px); z-index: 2; background: var(--bg);
  text-align: left; vertical-align: bottom; font-size: 0.8rem; font-weight: 600; color: var(--muted);
  padding: 10px 12px 8px; border-bottom: 1px solid var(--edge);
}
.register tbody th, .register tbody td {
  text-align: left; vertical-align: top; padding: 12px; border-bottom: 1px solid var(--line); font-weight: 400;
}
.register tbody tr:hover > * { background: var(--surface); }
.register tbody tr:hover > .c-ro { background: var(--ro-bg); }
.register tr[hidden] { display: none; }

.register .c-name a { font-weight: 600; color: var(--text); text-decoration: none; text-wrap: pretty; }
.register .c-name a:hover { color: var(--accent); text-decoration: underline; }
.register .num { display: block; margin-top: 3px; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.register .c-deadline { width: 7.5rem; white-space: nowrap; }
.c-deadline time { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.rel { display: block; font-size: 0.8rem; color: var(--muted); }

.register .c-ro { width: 12.5rem; background: color-mix(in srgb, var(--ro-bg) 75%, transparent); }
.register thead .c-ro { color: var(--ro); background: var(--ro-bg); }
.register .c-ro .pill { white-space: normal; font-size: 0.8rem; line-height: 1.35; padding: 2px 9px; border-radius: 8px; }
.peers { display: block; margin-top: 5px; font-size: 0.8rem; color: var(--muted); }

.register .c-eu { width: 27.5rem; }
.c-eu-label { display: block; margin-bottom: 6px; }
.strip { display: grid; grid-template-columns: 1fr 5px repeat(26, 1fr); column-gap: 2px; max-width: 27rem; }
.strip > :first-child { grid-column: 1; }
.strip > :nth-child(2) { grid-column: 3; }
.strip i { display: block; aspect-ratio: 1; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--edge); }
.strip i.is-ro { box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 2px var(--ro); }
.strip-codes abbr {
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0; text-align: center; text-decoration: none;
  color: var(--muted); font-variant-numeric: tabular-nums; cursor: help;
}
.strip-codes abbr.is-ro { color: var(--ro); font-weight: 800; }
.eu-count { display: block; margin-top: 7px; font-size: 0.8rem; color: var(--muted); }

.no-results td { padding: 36px 12px; }
.no-results p { margin: 0 0 12px; }

.reg-method { max-width: 75ch; margin-top: 48px; }
.reg-method ul { padding-left: 20px; }
.reg-method li { margin: 8px 0; }

@media (max-width: 1080px) {
  .finder { grid-template-columns: 1fr auto; }
  .f-search { grid-column: 1 / -1; }
  .f-filters { grid-column: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-status { grid-column: 2; align-self: end; flex-direction: column; align-items: flex-end; gap: 6px; }
  .register .c-eu { width: 22rem; }
}

/* Phone: each directive becomes a three-line entry; the 27-cell strip keeps its fixed order. */
@media (max-width: 760px) {
  .finder-bar { position: static; }
  .finder { grid-template-columns: 1fr; }
  .f-filters { grid-template-columns: 1fr 1fr; }
  .f-status { grid-column: 1; flex-direction: row; align-items: center; justify-content: space-between; }
  .register thead { display: none; }
  .register, .register tbody { display: block; }
  .register tbody tr {
    display: grid; grid-template-columns: 1fr auto; column-gap: 12px;
    grid-template-areas: "name name" "ro deadline" "eu eu";
    padding: 14px 0; border-bottom: 1px solid var(--line);
  }
  .register tbody tr:hover > * { background: none; }
  .register tbody th, .register tbody td { display: block; padding: 0; border: 0; width: auto; background: none; }
  .register .c-name { grid-area: name; margin-bottom: 10px; }
  .register .c-ro { grid-area: ro; background: none; }
  .register .c-deadline { grid-area: deadline; text-align: right; }
  .register .c-eu { grid-area: eu; margin-top: 12px; }
  .strip { max-width: none; column-gap: 2px; }
  .register .no-results { display: block; }
  .register .no-results td { padding: 24px 0; }
}
@media (max-width: 420px) {
  .f-filters { grid-template-columns: 1fr; }
}


/* Case type next to a stage: "procedură pentru transpunere neconformă" */
.kind { display: inline-block; margin-left: 6px; font-size: 0.85rem; color: var(--muted); }
.register .c-ro .kind { display: block; margin: 4px 0 0; font-size: 0.75rem; }

/* Procedure history: every case on the directive, per state */
.history { margin: 12px 0; }
.history summary { cursor: pointer; padding: 8px 0; }
.cases { list-style: none; padding: 0 0 8px; margin: 0; }
.cases > li { margin: 10px 0 14px; }
.case-head { margin: 0 0 4px; overflow-wrap: anywhere; }
.case-no { font-variant-numeric: tabular-nums; font-weight: 600; }
.case-steps { margin: 0; padding-left: 20px; font-size: 0.9rem; }
.case-steps li { margin: 3px 0; overflow-wrap: anywhere; }
.case-steps time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 4px; }

/* The Court's decision under a referral */
.ruling { margin: 6px 0 4px; padding: 6px 0 6px 12px; border-left: 3px solid var(--st-referred); }
.ruling-none { color: var(--muted); font-size: 0.85rem; border-left-color: var(--line); }
.ruling-head { margin: 0; }
.ruling-sanction { margin: 6px 0 0; font-size: 0.9rem; }
.ruling-points { margin: 6px 0 0; padding-left: 20px; font-size: 0.9rem; }
.ruling-points li { margin: 4px 0; overflow-wrap: anywhere; }
.ro-ruling { margin: 12px 0; padding: 10px 14px; background: var(--ro-bg); border-radius: 8px; }
.ro-ruling p { margin: 4px 0; }
.cal-court .cal-mark { background: var(--st-referred); }
.ro-court { margin: 12px 0; }
.ro-court p { margin: 4px 0; }
.ro-court ul { margin: 4px 0; padding-left: 20px; }

/* ---- Home page: the register read as a picture ---- */
.wrap.home { max-width: 1120px; }
.home .intro { margin-top: 36px; }
.home .intro h1 { margin: 0 0 10px; text-wrap: balance; }
.home .intro .lead { margin-top: 0; }
.home .note { max-width: 68ch; margin: 0; }
.home h2 { margin-bottom: 8px; }
.home .prose { max-width: 68ch; margin: 0; }
.home .src-line { max-width: 75ch; }
.keyfacts dd small { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.lg .cell, .w-name .cell, .sb-legend .cell { margin-right: 0; flex: none; }

/* Stage band: Romania's directives as one proportional band, by stage */
.stagebar { margin: 16px 0 0; }
.bar { display: flex; gap: 2px; height: 34px; width: 100%; }
.bar .seg {
  display: block; flex: 0 1 auto; min-width: 6px; border: 0; padding: 0; border-radius: 3px; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--edge); transition: opacity 0.2s;
}
.bar .seg:hover { box-shadow: inset 0 0 0 1px var(--text); }
.bar.has-active .seg:not([aria-pressed="true"]) { opacity: var(--dim); }
.bar .seg[aria-pressed="true"] { outline: 2px solid var(--ro); outline-offset: 2px; }
.bar-legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.lg {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 4px 12px 4px 8px; cursor: pointer; font-size: 0.9rem; line-height: 1.3;
  color: var(--text); text-decoration: none;
}
.lg:hover { border-color: var(--text); }
.lg[aria-pressed="true"] { border-color: var(--ro); box-shadow: inset 0 0 0 1px var(--ro); background: var(--ro-bg); }
.lg .lg-n { font-weight: 650; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.lg .lg-l { color: var(--text); }
.lg[aria-disabled="true"] { opacity: 0.55; cursor: default; }
.stagebar figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 10px; max-width: 75ch; }
.ro-sentence { margin: 16px 0 0; max-width: 68ch; font-size: 1.05rem; }

/* Explorer controls */
.explorer-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.explorer-head .note { flex: 1 1 100%; }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1.1fr) auto; gap: 12px 16px; align-items: end; margin-top: 14px; }
.toolbar[hidden] { display: none; }
.explorer .f-label { white-space: normal; overflow: visible; }
.toolbar input[type="search"] {
  font: inherit; font-size: 0.95rem; width: 100%; min-height: 40px; padding: 7px 10px;
  color: var(--text); background: var(--surface); border: 1px solid var(--edge); border-radius: 8px;
}
.toolbar input::placeholder { color: var(--muted); }
.toolbar input:hover { border-color: var(--text); }
.views { display: flex; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); overflow: hidden; }
.views label { position: relative; min-height: 40px; display: inline-flex; align-items: center; padding: 6px 14px; cursor: pointer; font-size: 0.95rem; font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); }
.views label:first-child { border-left: 0; }
.views input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.views input:checked + span { color: var(--text); }
.views label:has(input:checked) { background: var(--ro-bg); color: var(--text); box-shadow: inset 0 -3px 0 var(--ro); }
.views label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.chips[hidden] { display: none; }
.chips .f-label { margin: 0 2px 0 0; }
.chips .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.chip { font: inherit; color: inherit; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: 0.88rem; }
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { border-color: var(--ro); box-shadow: inset 0 0 0 1px var(--ro); background: var(--ro-bg); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 4px; }
.explorer .f-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); white-space: normal; }
.explorer .f-count[hidden] { display: none; }
.explorer .f-reset { min-height: 36px; padding: 5px 12px; }
.explorer .f-reset[hidden] { display: none; }
.legend-note { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; color: var(--muted); }
.legend-note span { display: inline-flex; align-items: center; gap: 6px; }
.legend-note i.sq-demo { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--edge); }
.legend-note i.sq-demo.future { border-style: dashed; }

/* Explorer rows: "count · label | one square per directive" */
.rows { margin-top: 10px; }
.row { display: grid; grid-template-columns: 13rem minmax(0, 1fr); column-gap: 20px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); scroll-margin-top: 12px; }
.row:last-child { border-bottom: 1px solid var(--line); }
.row.is-empty .w-count, .row.is-empty .w-name { color: var(--muted); }
.w-label { margin: 0; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.w-count { min-width: 2.6ch; text-align: right; font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; flex: none; }
.w-count small { font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.w-name { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-weight: 600; line-height: 1.3; min-width: 0; }
.w-sub { display: block; width: 100%; font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.cells { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 3px; min-width: 0; }
.w-none { color: var(--muted); font-size: 0.9rem; }
.sq {
  display: block; width: 18px; height: 18px; border-radius: 3px; border: 1px solid var(--edge);
  transition: opacity 0.25s; position: relative; z-index: 0;
}
.sq.future { border-style: dashed; }
.sq.dim { opacity: var(--dim); }
.sq:hover, .sq:focus-visible { outline: 2px solid var(--ro); outline-offset: 1px; z-index: 1; }
.sq.is-open { outline: 2px solid var(--ro); outline-offset: 1px; z-index: 1; }
.sq.moving { transition: transform 0.45s cubic-bezier(0.2, 0, 0.2, 1), opacity 0.25s; }
.row.today { grid-template-columns: 1fr; padding: 6px 0; border-top: 1px dashed var(--edge); }
.row.today p { margin: 0; font-size: 0.85rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .sq, .sq.moving, .bar .seg { transition: none; } }

/* Directive card: opens under the row of the clicked square */
.dcard {
  margin: 4px 0 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 18px 14px; display: grid; gap: 10px; position: relative;
}
.dcard .eyebrow { margin: 0; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; padding-right: 7rem; }
.dcard h3 { margin: 0; font-size: 1.15rem; line-height: 1.3; text-wrap: pretty; max-width: 70ch; }
.dcard-ro { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; background: var(--ro-bg); border-left: 5px solid var(--ro); border-radius: 10px; padding: 10px 14px; }
.dcard-ro .who { color: var(--ro); font-weight: 650; }
.dcard-ro .pill { font-size: 0.95rem; padding: 3px 12px; }
.dcard-ro .meta { color: var(--muted); font-size: 0.9rem; }
.dcard-close { font: inherit; position: absolute; top: 12px; right: 14px; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 0.85rem; font-weight: 600; color: var(--accent); cursor: pointer; }
.dcard-close:hover { border-color: var(--accent); }
.dcard .strip { max-width: 30rem; }
.dcard .eu-count { margin: 0; font-size: 0.88rem; max-width: 75ch; }
.dcard-links { margin: 0; font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* Next deadlines: a short dated list */
.next { list-style: none; margin: 12px 0 0; padding: 0; max-width: 68ch; }
.next li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); column-gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.next li:last-child { border-bottom: 1px solid var(--line); }
.next time { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.next .rel { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.next a { font-weight: 600; color: var(--text); text-decoration: none; }
.next a:hover { color: var(--accent); text-decoration: underline; }
.next .num-line { display: block; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* State bars: 27 small bars, protocol order, Romania first, no rank numbers */
.sbars { list-style: none; margin: 14px 0 0; padding: 0; max-width: 760px; }
.sb { font: inherit; color: inherit; display: grid; grid-template-columns: 3rem minmax(0, 1fr) 3rem; align-items: center; column-gap: 12px; width: 100%; padding: 2px 6px; margin: 0 -6px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; text-align: left; }
.sb:hover { background: var(--surface); }
.sb[aria-pressed="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--edge); }
.sb-row.is-ro .sb { background: var(--ro-bg); }
.sb-row.is-ro .sb-code { color: var(--ro); font-weight: 800; }
.sb-code { font-size: 0.8rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; text-decoration: none; }
.sb-bar { display: flex; gap: 2px; height: 14px; }
.sb-bar i { display: block; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--edge); min-width: 2px; }
.sb-open { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.9rem; font-weight: 600; }
.sb-detail { margin-top: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; max-width: 760px; font-size: 0.95rem; }
.sb-detail[hidden] { display: none; }
.sb-detail p { margin: 0; }
.sb-legend { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; color: var(--muted); }
.sb-legend li { display: inline-flex; align-items: center; gap: 6px; }

/* Record layer: the register of the selection, in a drawer */
#rec { margin-top: 16px; }
#rec .table-wrap { border: 0; border-radius: 0; background: transparent; }
#rec table.register { margin-top: 0; font-size: 0.9rem; min-width: 720px; }
#rec .register thead th { position: static; }
#rec .rec-all { margin-top: 10px; }
.method { max-width: 75ch; margin-top: 28px; }
.method h3 { font-size: 1.05rem; margin: 0; }
.method ul { padding-left: 20px; margin: 10px 0 0; }
.method li { margin: 8px 0; }

/* Tooltip (visual only; the squares carry their own text for screen readers) */
.tip {
  position: fixed; z-index: 20; pointer-events: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--edge); border-radius: 8px; padding: 8px 10px; font-size: 0.85rem; line-height: 1.4;
  max-width: 280px; display: none;
}
.tip strong { display: block; font-weight: 600; }
.tip .pill { display: inline-block; margin-top: 4px; white-space: normal; line-height: 1.35; border-radius: 8px; padding: 2px 9px; }
.tip .meta { color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .toolbar { grid-template-columns: 1fr; }
  .views label { flex: 1 1 auto; justify-content: center; padding: 6px 8px; font-size: 0.9rem; }
  .row { grid-template-columns: 1fr; row-gap: 8px; }
  .sq { width: 16px; height: 16px; }
  .sb { grid-template-columns: 2.6rem minmax(0, 1fr) 2.6rem; }
  #rec table.register { min-width: 0; }
}
@media (max-width: 600px) {
  .bar { height: 28px; }
  .dcard { padding: 14px; }
  .dcard .eyebrow { padding-right: 0; }
  .dcard-close { position: static; justify-self: start; }
  .next li { grid-template-columns: 1fr; row-gap: 2px; }
}

/* ---- Sanctions page (sanctiuni/): what the Court decided Romania must pay ---- */
.sanc-h1 { max-width: 24ch; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin-top: 16px; }
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 24px; }
.sums { display: flex; flex-wrap: wrap; gap: 8px 40px; }
.fig { font-size: 2.1rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin: 0; }
.fig-unit { font-size: 1.1rem; font-weight: 600; letter-spacing: 0; }
.fig-l { color: var(--muted); font-size: 0.9rem; margin: 4px 0 0; }
.sheet-stage { text-align: right; }
.sheet-stage .cal-meta { display: block; }
.sheet-title { font-size: 1.05rem; margin: 16px 0 0; }
.sheet-title a { color: var(--text); text-decoration: none; }
.sheet-title a:hover { color: var(--accent); text-decoration: underline; }
.sheet-ref { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.sheet-about { margin: 12px 0 0; max-width: 68ch; }
.sheet blockquote { margin: 8px 0 2px; padding: 2px 0 2px 12px; border-left: 1px solid var(--edge); max-width: 68ch; font-size: 0.95rem; line-height: 1.5; }
.sheet .src-line { margin-top: 8px; max-width: 75ch; }

/* The case's road: the site's calendar register, compact. The judgment is the heavy row. */
.cal-road { --cal-date: 7rem; margin-top: 16px; }
.cal-road > li { --pad: 14px; }
.cal-term .cal-mark, .cal-judgment .cal-mark { --size: 15px; }
.cal-term .cal-mark { background: var(--bg); }
.cal-judgment .cal-mark { background: var(--text); }
.cal-judgment.is-heavy { border-top: 2px solid var(--text); margin-top: 6px; }
.cal-judgment.is-heavy .cal-date { color: var(--text); font-weight: 650; }
.cal-judgment.is-heavy .cal-title { font-weight: 700; font-size: 1.05rem; }
.cal-today .cal-mark { --size: 9px; border-color: var(--muted); }
.cal-pay { color: var(--muted); }
.cal-pay .cal-mark { border-style: dashed; border-color: var(--edge); background: var(--bg); }
.cal-pay .cal-title { font-weight: 600; }

/* The running penalty: three known numbers, a band that continues dashed, and no total */
.running { margin-top: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.running-h { margin: 0; font-weight: 650; }
.meter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; }
.meter div { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.meter b { display: block; font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.meter span { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.band { position: relative; margin: 18px 0 0; height: 46px; }
.band i { position: absolute; top: 18px; height: 10px; border-radius: 3px; }
.band .band-run { left: 0; width: 78%; background: var(--text); }
.band .band-on { left: 78%; width: 22%; border-top: 2px dashed var(--edge); height: 0; top: 22px; border-radius: 0; }
.band b { position: absolute; top: 0; font-size: 0.8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.band .band-start { left: 0; }
.band .band-today { left: 78%; transform: translateX(-50%); }
.band s { position: absolute; top: 32px; font-size: 0.8rem; color: var(--muted); text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.band .band-days { left: 0; }
.band .band-until { right: 0; }
.running-note { margin: 10px 0 0; max-width: 75ch; }

/* The 27 states, counted: oxblood where the state has a procedure at the fines stage */
.q { display: block; aspect-ratio: 1; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--edge); }
.states { display: grid; grid-template-columns: 1fr 6px repeat(26, 1fr); column-gap: 3px; margin: 14px 0 0; max-width: 860px; }
.states > div:first-child { grid-column: 1; }
.states > div:nth-child(2) { grid-column: 3; }
.states > div { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.states .q { width: 100%; }
.states .q.is-ro { box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 2px var(--ro); }
.states b { font-size: 0.8rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.states b.z { color: var(--edge); font-weight: 400; }
.states abbr { font-size: 0.62rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.states abbr.is-ro { color: var(--ro); font-weight: 800; }
.slist { display: none; flex-wrap: wrap; gap: 6px 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.slist li { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 6px; font-size: 0.85rem; background: var(--surface); }
.slist li.is-ro { background: var(--ro-bg); border-color: var(--ro); }
.slist .q { width: 12px; height: 12px; }
.slist b { font-variant-numeric: tabular-nums; }

/* Referrals with no judgment yet */
.pend { list-style: none; margin: 12px 0 0; padding: 0; max-width: 760px; }
.pend li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); column-gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.pend li:last-child { border-bottom: 1px solid var(--line); }
.pend time { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pend a { font-weight: 600; color: var(--text); text-decoration: none; }
.pend a:hover { color: var(--accent); text-decoration: underline; }
.pend .k { display: block; font-size: 0.85rem; color: var(--muted); }
.params { margin-top: 12px; }
details.tech .prose { margin: 0; max-width: 68ch; }

@media (max-width: 600px) {
  .sheet { padding: 16px; }
  .fig { font-size: 1.7rem; }
  .cal-road { --cal-date: 5.2rem; }
  .meter { grid-template-columns: 1fr; }
  .band b, .band s { font-size: 0.75rem; }
  .states { display: none; }
  .slist { display: flex; }
  .pend li { grid-template-columns: 1fr; row-gap: 2px; }
  .sheet-stage { text-align: left; }
}
