:root {
  --bg: #ffffff; --fg: #1a1a1a; --muted: #5c5c5c; --line: #d9d9d9; --card: #f7f7f5;
  --accent: #0b5cad; --ok: #1d6b35; --ok-bg: #e6f4ea; --warn: #7a4b00; --warn-bg: #fff4d6;
  --err: #a11d1d; --err-bg: #fde8e8; --demo-bg: #fff0b3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414; --fg: #ececec; --muted: #a8a8a8; --line: #3a3a3a; --card: #1e1e1e;
    --accent: #7ab8ff; --ok: #8fd6a2; --ok-bg: #16301f; --warn: #ffd27a; --warn-bg: #3a2c0c;
    --err: #ff9a9a; --err-bg: #3d1515; --demo-bg: #4a3d00;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.top, main, .foot { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.top { padding-top: 16px; }
.brand { font-weight: 700; font-size: 1.25rem; color: var(--fg); text-decoration: none; }
.tagline { margin: 4px 0 12px; color: var(--muted); font-size: .95rem; }
.demo-banner { background: var(--demo-bg); padding: 10px 16px; text-align: center; font-weight: 600; font-size: .95rem; }
.foot { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 12px; padding-bottom: 24px; font-size: .9rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.filters label { min-width: 0; display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); gap: 4px; }
.filters .full, .filters .actions { grid-column: 1 / -1; }
@media (min-width: 640px) { .filters { grid-template-columns: 1fr 2fr 1fr 1fr; } .filters .full { grid-column: 1 / -1; } }
input, select, button, .button { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); min-height: 44px; }
.filters select, .filters input { width: 100%; }
button, .button { background: var(--accent); color: #fff; border-color: var(--accent); cursor: pointer; text-decoration: none; display: inline-block; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
@media (prefers-color-scheme: dark) { button:not(.secondary) { color: #0d1b2a; } }
.actions { display: flex; gap: 8px; }

.count { color: var(--muted); font-size: .9rem; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.card-link { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; color: inherit; text-decoration: none; }
.card-link:hover .card-title, .card-link:focus .card-title { text-decoration: underline; }
.card-meta { color: var(--muted); font-size: .85rem; }
.card-title { font-weight: 600; overflow-wrap: anywhere; }
.card-summary { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .95rem; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.badge { font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--line); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }
.more { margin: 16px 0; width: 100%; }

.notice { padding: 10px 12px; border-radius: 8px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.empty { padding: 24px 0; }
.empty h2 { margin: 0 0 6px; font-size: 1.15rem; }

.detail h1 { font-size: 1.3rem; line-height: 1.35; margin: 4px 0; overflow-wrap: anywhere; }
.detail h2 { font-size: 1.05rem; margin: 20px 0 8px; }
.summary-box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px 10px; margin-top: 12px; }
.summary { white-space: pre-line; }
.facts { padding-left: 18px; }
.facts li { margin-bottom: 8px; }
blockquote { margin: 4px 0 0; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); font-size: .9rem; }
.dl { margin: 0; }
.row { display: grid; grid-template-columns: 11em 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 480px) { .row { grid-template-columns: 1fr; gap: 0; } .row dt { font-size: .85rem; color: var(--muted); } }
dt { color: var(--muted); } dd { margin: 0; overflow-wrap: anywhere; }
.attachments { padding-left: 18px; overflow-wrap: anywhere; }
.source { margin-top: 20px; font-weight: 600; }
.src { display: inline-block; margin-right: 10px; }
.src.ok { color: var(--ok); } .src.err { color: var(--err); }

.main-nav { display: flex; gap: 24px; padding: 8px 0 16px; border-bottom: 1px solid var(--line); }
.main-nav a { text-decoration: none; font-weight: 600; }
.news-intro { margin: 28px 0 20px; }
.news-intro h1 { font-size: 2rem; margin: 0 0 8px; }
.news-intro p { margin: 0; color: var(--muted); max-width: 620px; }
.news-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.news-topics a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-size: .9rem; min-height: 44px; display: flex; align-items: center; }
.news-topics a[aria-current="page"] { background: var(--card); border-color: var(--accent); font-weight: 700; }
.news-item { padding: 26px 0; border-bottom: 1px solid var(--line); }
.news-date { margin: 0 0 8px; color: var(--muted); font-size: .85rem; }
.news-comment { margin: 0 0 12px; font-size: 1.12rem; line-height: 1.65; overflow-wrap: anywhere; }
.news-source { font-size: .9rem; }
.news-note { margin-top: 24px; }

.works table.mobile-ledger { font-variant-numeric: lining-nums tabular-nums; }
.works table.mobile-ledger .ledger-amount { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.works table.mobile-ledger td.ledger-number { text-align: right; white-space: nowrap; }
@media (max-width: 640px) {
  .works table.mobile-ledger { display: block; }
  .works table.mobile-ledger caption { display: block; margin-bottom: 12px; line-height: 1.45; }
  .works table.mobile-ledger thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .works table.mobile-ledger tbody { display: grid; gap: 12px; }
  .works table.mobile-ledger tbody tr { display: block; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
  .works table.mobile-ledger tbody th,
  .works table.mobile-ledger tbody td { display: block; width: 100%; padding: 0; border: 0; overflow-wrap: normal; word-break: normal; line-height: 1.6; }
  .works table.mobile-ledger tbody th { font-size: 1rem; margin-bottom: 12px; }
  .works table.mobile-ledger tbody td + td { margin-top: 14px; }
  .works table.mobile-ledger td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: .76rem; font-weight: 500; letter-spacing: .02em; }
  .works table.mobile-ledger td[data-label='Importo'] { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
  .works table.mobile-ledger td a { overflow-wrap: anywhere; }
  .works table.mobile-ledger td.ledger-number { text-align: left; font-size: 1.2rem; font-weight: 700; }
  .works table.mobile-ledger tbody th,
  .works table.mobile-ledger tbody td { box-sizing: border-box; text-align: left; }
}

/* Editorial polish: shared across news, archive and dossiers. */
:root { --bg: #f8f6f1; --fg: #202e2a; --muted: #59645f; --line: #d9dfd8; --card: #ffffff; --accent: #176450; --brand-mark: #bd5a35; }
.top, main, .foot { max-width: 920px; padding-left: 24px; padding-right: 24px; }
.top { padding-top: 36px; text-align: center; }
.brand { display: inline-block; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2.6rem, 7vw, 4.1rem); font-weight: 700; letter-spacing: -.065em; line-height: 1.08; }
.brand::after { content: '.'; color: var(--brand-mark); }
.brand-logo { display: block; width: min(100%, 410px); aspect-ratio: 2.1 / 1; margin: 0 auto; overflow: hidden; border: 1px solid #e5dfd1; border-radius: 8px; background: #f8f6f1; line-height: 0; box-shadow: 0 5px 18px #20372b12; }
.brand-logo::after { content: none; }
.brand-logo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.tagline { margin: 10px 0 24px; font-size: .95rem; letter-spacing: .015em; }
.main-nav { flex-wrap: wrap; justify-content: center; gap: 6px 24px; border-top: 1px solid var(--line); border-bottom: 2px solid var(--fg); padding: 8px 0; }
.main-nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--fg); font-size: .9rem; }
.main-nav a:hover, .main-nav a[aria-current='page'] { color: var(--accent); text-decoration: underline; text-underline-offset: 6px; }
h1, h2, h3 { letter-spacing: -.025em; text-wrap: balance; }
.news-intro { margin: 30px 0 22px; }
.news-intro h1, main > h1 { font-family: Georgia, 'Times New Roman', serif; font-size: 2.35rem; }
.news-intro[aria-label] { padding: 22px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 3px 12px 12px 3px; background: var(--card); }
.news-intro[aria-label] h2 { margin-top: 0; font-size: 1.15rem; }
.news-intro[aria-label] .news-topics { margin-bottom: 0; }
.news-topics a { border-radius: 999px; background: var(--card); font-size: .85rem; padding: 8px 15px; }
.news-topics a:hover { border-color: var(--accent); }
.news-topics a[aria-current='page'] { background: var(--accent); color: #fff; }
.news-item { padding: 28px 0 30px; }
.news-date { font-size: .78rem; letter-spacing: .04em; }
.news-comment { max-width: 74ch; font-size: 1.08rem; line-height: 1.75; }
.news-source { text-underline-offset: 4px; }
.card { border-radius: 12px; box-shadow: 0 3px 14px #20372b06; }
.card-link { padding: 18px; }
.foot { margin-top: 48px; padding-top: 20px; padding-bottom: 32px; }
:focus-visible { outline: 3px solid var(--brand-mark); outline-offset: 4px; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #17221f; --fg: #f0f0e8; --muted: #b2beb7; --line: #3d4d45; --card: #202e28; --accent: #9ad6b8; --brand-mark: #ec9c73; }
  .news-topics a[aria-current='page'] { color: #17221f; }
}
@media (max-width: 480px) {
  .top, main, .foot { padding-left: 18px; padding-right: 18px; }
  .top { padding-top: 24px; }
  .tagline { font-size: .85rem; margin-bottom: 18px; }
  .main-nav { gap: 2px 18px; }
  .main-nav a { font-size: .85rem; }
  .news-intro[aria-label] { padding: 16px; }
  .news-comment { font-size: 1rem; line-height: 1.7; }
}

/* Shared editorial hierarchy for every section. */
main { padding-top: clamp(28px, 5vw, 48px); }
main#app > h1,
main.works > h1,
main.budget > h1,
#app .news-intro:not([aria-label]) > h1 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 5.8vw, 3.15rem);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -.04em;
  text-wrap: balance;
}
main#app > h1::after,
main.works > h1::after,
main.budget > h1::after,
#app .news-intro:not([aria-label]) > h1::after {
  content: "";
  display: block;
  width: 52px;
  height: 3px;
  margin-top: 16px;
  border-radius: 3px;
  background: var(--brand-mark);
}
#app .news-intro:not([aria-label]) { margin: 38px 0 28px; }
#app .news-intro:not([aria-label]) > p,
main.works > h1 + p,
main.budget > h1 + p {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.1vw, 1.14rem);
  line-height: 1.75;
}
h2, h3 { line-height: 1.22; }
main.budget > section,
main.works > article {
  margin: clamp(34px, 5vw, 56px) 0 0;
  padding: clamp(24px, 4vw, 36px) 0 0;
  border-top: 1px solid var(--line);
}
main.budget > section > h2,
main.works > article > h2,
article.detail > section > h2,
#app .empty h2 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.38rem, 3.2vw, 1.8rem);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.2;
  text-wrap: balance;
}
main.budget > section > .kicker,
main.works > article > .kicker {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .11em;
  line-height: 1.4;
  text-transform: uppercase;
}
main.budget .card h3,
main.works article h3,
article.detail > section h3 {
  margin: 0 0 10px;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}
main.budget .jump { gap: 9px; margin: 24px 0 28px; }
main.budget .jump a,
main.works > nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  text-decoration: none;
  font-size: .9rem;
  line-height: 1.35;
}
main.budget .jump a:hover,
main.works > nav a:hover { border-color: var(--accent); color: var(--accent); }
main.works > nav { display: flex; flex-wrap: wrap; gap: 9px; margin: 24px 0 30px; }
main.budget > .notice,
main.works > .notice { margin: 24px 0; padding: 16px 18px; border-radius: 12px; line-height: 1.65; }
main.budget table,
main.works table {
  margin: 20px 0 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  border-spacing: 0;
  overflow: hidden;
  background: var(--card);
}
main.budget table caption,
main.works table caption { padding: 0 0 12px; font-size: 1rem; line-height: 1.45; }
main.budget table th,
main.works table th { font-weight: 700; }
main.budget table thead,
main.works table thead { background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
main.budget table th,
main.budget table td,
main.works table th,
main.works table td { padding: 12px 14px; line-height: 1.55; }
main.budget details { padding: 18px 0; }
main.budget details summary { line-height: 1.5; }
main#app > .filters {
  gap: 14px;
  margin: 26px 0 30px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 8px 24px #20372b08;
}
main#app > .filters input,
main#app > .filters select { border-radius: 10px; }
main#app > .count { margin: 22px 0 14px; font-size: .9rem; }
main#app .list { gap: 14px; }
main#app .card { border-radius: 14px; }
article.detail {
  margin: 18px 0 0;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 12px 32px #20372b0a;
}
article.detail > .card-meta { margin: 0 0 12px; color: var(--accent); font-weight: 700; letter-spacing: .035em; }
article.detail > h1 {
  margin: 0 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3.3vw, 2.25rem);
  line-height: 1.18;
  letter-spacing: -.025em;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  text-wrap: balance;
}
article.detail > section { margin: 28px 0 0; }
article.detail .summary-box { margin: 0; padding: 22px 24px; border-radius: 14px; }
article.detail .summary-box h2 { margin: 0 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: 1.3rem; }
article.detail .summary { font-size: 1.06rem; line-height: 1.8; }
.news-item { padding: 30px 0 34px; }
.news-date { margin-bottom: 10px; color: var(--accent); font-weight: 650; }
.news-comment { line-height: 1.75; }
.news-source { display: inline-block; margin-top: 2px; font-weight: 650; }
@media (hover: hover) {
  main#app .card { transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
  main#app .card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: 0 8px 24px #20372b10; }
}
@media (max-width: 640px) {
  main.budget > section,
  main.works > article { margin-top: 34px; padding-top: 24px; }
  main.budget table th,
  main.budget table td,
  main.works table th,
  main.works table td { padding: 10px 9px; }
  article.detail { padding: 18px; border-radius: 14px; }
  article.detail > h1 { font-size: 1.32rem; line-height: 1.28; padding-bottom: 16px; }
  article.detail .summary-box { padding: 18px; }
  .news-item { padding: 24px 0 28px; }
}
@media (prefers-reduced-motion: reduce) {
  main#app .card { transition: none; }
}
