:root {
	--blue: #092a4b;
	--blue-2: #0f3a63;
	--gold: #87783d;
	--gold-text: #6d6130;
	--gold-fill: #c8b768;
	--gold-soft: #f3edd8;
	--paper: #f6f3ea;
	--line: #e0dccf;
	--ink: #1d2733;
	--muted: #566170;
	--serif: Georgia, "Times New Roman", serif;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
main { flex: 1; }
a { color: var(--blue); }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold-fill); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 40px, 1180px); margin-inline: auto; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; padding: 10px 16px; border-radius: 6px; background: #fff; font-weight: 700; }
.skip:focus { top: 8px; }

.top { background: var(--blue); color: #fff; }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 82px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand img { width: 58px; height: 54px; padding: 3px; border-radius: 6px; background: #fff; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { color: #e5d9a8; font-size: 13px; }
.brand strong { margin-top: 3px; font-family: var(--serif); font-size: 28px; }
.top nav { display: flex; gap: 4px; }
.top nav a { padding: 9px 13px; border-radius: 6px; color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { background: var(--blue-2); color: #e5d9a8; }

.search { margin-top: 26px; padding: 24px; border: 1px solid var(--line); border-top: 4px solid var(--gold-fill); border-radius: 10px; background: #fff; box-shadow: 0 10px 28px rgba(9, 42, 75, .07); }
.search h1 { color: var(--blue); font-family: var(--serif); font-size: 27px; line-height: 1.2; }
.modes { display: inline-flex; margin: 16px 0; padding: 4px; border-radius: 8px; background: var(--paper); }
.modes button { min-width: 110px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; color: var(--blue); font-weight: 700; cursor: pointer; }
.modes button[aria-selected="true"] { background: var(--blue); color: #fff; }
form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.field { display: flex; flex: 0 1 165px; flex-direction: column; gap: 4px; min-width: 0; }
.field--q { flex: 1 1 340px; }
label { color: var(--muted); font-size: 13px; font-weight: 700; }
input, select { width: 100%; height: 46px; padding: 0 11px; border: 1px solid #b8b5aa; border-radius: 7px; background: #fff; }
input:focus, select:focus { border-color: var(--gold); outline: 2px solid var(--gold-fill); outline-offset: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 15px; border: 1px solid var(--blue); border-radius: 7px; background: #fff; color: var(--blue); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer; }
.btn:hover { background: var(--paper); }
.btn--primary { min-height: 46px; padding-inline: 24px; background: var(--blue); color: #fff; font-size: 15px; }
.btn--primary:hover { background: var(--blue-2); }
.form-error { margin-top: 10px; color: #a12020; font-weight: 600; }

#view { margin: 26px 0 44px; }
.home { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.panel > h2 { padding: 13px 18px; background: var(--blue); color: #fff; font-family: var(--serif); font-size: 19px; }
.today { padding: 26px; text-align: center; }
.today .num { color: var(--blue); font-family: var(--serif); font-size: clamp(28px, 4vw, 40px); font-weight: 700; line-height: 1.1; }
.today .date { margin-top: 6px; color: var(--gold-text); font-size: 18px; font-weight: 700; }
.today .meta { margin-top: 6px; color: var(--muted); font-size: 14px; }
.today .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.today .attached { margin-top: 20px; padding: 12px; border-radius: 8px; background: var(--gold-soft); text-align: left; }
.today .attached a { font-weight: 700; }
.cover { display: block; width: min(100%, 430px); margin: 22px auto 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #fff; box-shadow: 0 10px 24px rgba(9, 42, 75, .18); transition: transform .15s ease, box-shadow .15s ease; }
.cover:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(9, 42, 75, .26); }
.cover img { display: block; width: 100%; height: auto; }
.cert { padding: 11px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.latest { list-style: none; margin: 0; padding: 0; }
.latest li + li { border-top: 1px solid var(--line); }
.latest a { display: block; padding: 11px 18px; color: var(--blue); text-decoration: none; }
.latest a:hover { background: var(--paper); }
.latest strong { display: block; font-size: 15px; }
.latest small { color: var(--muted); font-size: 13px; }
.more { display: block; padding: 11px; border-top: 1px solid var(--line); font-weight: 700; text-align: center; text-decoration: none; }
.more:hover { background: var(--paper); }

.head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.head h2 { color: var(--blue); font-family: var(--serif); font-size: 24px; }
.head p { color: var(--muted); font-size: 14px; }
.tools { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.tools .field { flex: 0 0 150px; }
.tools input, .tools select { height: 40px; }

table { width: 100%; border-collapse: collapse; }
thead th { padding: 10px 12px; background: var(--blue); color: #fff; font-size: 13px; text-align: left; }
tbody td { padding: 9px 12px; border-top: 1px solid var(--line); font-size: 15px; vertical-align: middle; }
tbody tr:nth-child(even):not(.child) td { background: #fbfaf5; }
td.actions { width: 1%; white-space: nowrap; text-align: right; }
td.actions .btn { min-height: 34px; padding-inline: 11px; font-size: 13px; }
td.actions .btn + .btn { margin-left: 5px; }
.num-cell { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 5px; background: var(--gold-soft); color: var(--gold-text); cursor: pointer; transition: transform .15s ease; }
.toggle[aria-expanded="true"] { transform: rotate(90deg); }
.spacer { display: inline-block; width: 28px; }
tr.child td { background: var(--gold-soft); }
tr.child .num-cell { padding-left: 34px; color: var(--gold-text); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; background: #e8edf3; color: var(--blue); font-size: 12px; font-weight: 700; }
.badge--extra { background: var(--gold-fill); color: #06203a; }

.hits { display: grid; gap: 10px; }
.hit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 15px 17px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.hit h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; color: var(--blue); font-size: 15.5px; }
.hit p { grid-column: 1; color: #3b4552; font-size: 14.5px; overflow-wrap: anywhere; }
.hit mark { padding: 0 2px; border-radius: 3px; background: #f4df85; color: inherit; font-weight: 700; }
.hit .btn { grid-column: 2; grid-row: 1 / span 2; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; }
.pager span { color: var(--muted); font-size: 14px; }
.state { padding: 30px; border: 1px dashed #bdb9aa; border-radius: 8px; background: #fff; color: var(--muted); text-align: center; }
.foot { padding: 20px 0; background: var(--blue); color: #dce4ec; font-size: 13.5px; }

@media (max-width: 860px) {
	.home { grid-template-columns: 1fr; }
	.top__in { flex-direction: column; align-items: flex-start; gap: 6px; }
	.top nav { width: 100%; overflow-x: auto; }
	.top nav a { padding-inline: 10px; white-space: nowrap; }
}

@media (max-width: 680px) {
	.wrap { width: min(100% - 32px, 1180px); }
	.search { padding: 18px; }
	.modes { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
	.modes button { min-width: 0; padding-inline: 4px; font-size: 14px; }
	.field, .field--q { flex: 1 1 100%; }
	.field:not(.field--q):not([data-for="texto datas"]) { flex-basis: calc(50% - 6px); }
	.field[data-for="texto datas"] { flex: 1 1 calc(50% - 6px); }
	form .btn--primary { width: 100%; }
	thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	table, tbody, tr, td { display: block; }
	tbody tr { position: relative; padding: 11px 12px; border-top: 1px solid var(--line); }
	tbody tr.child { background: var(--gold-soft); }
	tbody td, tbody tr:nth-child(even):not(.child) td, tr.child td { padding: 1px 0; border: 0; background: transparent; }
	td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
	td.actions { width: auto; margin-top: 7px; text-align: left; }
	tr.child .num-cell { padding-left: 0; }
	.hit { grid-template-columns: 1fr; }
	.hit .btn { grid-column: 1; grid-row: auto; width: 100%; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
