@layer components {
body {
	font-family: var(--font-sans);
	color: var(--text);
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	position: relative;
	isolation: isolate;
	background: var(--bg);
	background-attachment: fixed;
}

body::before {
	display: none;
}

.app-parallax-bg {
	display: none;
}

a {
	color: inherit;
	text-decoration: none;
}

a:focus-visible {
	outline: none;
	box-shadow: var(--focus-ring);
}

button:focus-visible {
	outline: none;
	box-shadow: var(--focus-ring);
}

input:focus-visible {
	outline: none;
	box-shadow: var(--focus-ring);
}

select:focus-visible {
	outline: none;
	box-shadow: var(--focus-ring);
}

textarea:focus-visible {
	outline: none;
	box-shadow: var(--focus-ring);
}

.page-wrapper {
	flex: 1;
	display: flex;
	flex-direction: column;
}

main {
	flex: 1;
	max-width: var(--layout-max-width);
	width: 100%;
	margin: 0 auto;
	padding: 22px 28px 40px;
}

.navbar {
	background: var(--panel-bg-strong);
	border-bottom: 1px solid var(--glass-border);
	height: var(--navbar-h);
	position: sticky;
	top: 0;
	z-index: var(--z-sticky);
	box-shadow: none;
}

.navbar-inner {
	max-width: var(--layout-max-width);
	margin: 0 auto;
	height: 100%;
	padding: 0 28px;
	display: flex;
	align-items: center;
	gap: 14px;
}

.navbar-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-right: 10px;
}

.logo-mark {
	width: 30px;
	height: 30px;
	background: var(--success);
	border-radius: var(--radius-md);
	display: grid;
	place-items: center;
	color: var(--text-on-accent);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	font-weight: 600;
	box-shadow: none;
}

.logo-info {
	display: flex;
	flex-direction: column;
}

.logo-title {
	font-size: var(--text-sm);
	font-weight: 600;
}

.logo-sub {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--muted);
}

.navbar-links {
	display: flex;
	align-items: center;
	gap: 2px;
	flex: 1;
	width: max-content;
	max-width: 100%;
	padding: 0;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
}

.nav-link {
	min-height: 30px;
	padding: 7px 10px;
	border: 1px solid transparent;
	border-radius: var(--radius-md);
	font-size: var(--text-sm);
	color: var(--muted);
	transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.nav-link:hover {
	background: var(--hover-bg);
	color: var(--text);
}

.nav-link--active {
	border-color: color-mix(in srgb, var(--success) 26%, var(--border));
	background: var(--success);
	color: var(--surface);
	box-shadow: none;
}

.nav-hub { position: relative; }
.nav-hub.is-active .nav-hub__trigger { border-color: color-mix(in srgb, var(--success) 26%, var(--border)); background: var(--success); color: var(--text-on-accent); }
.nav-hub__trigger { border: 1px solid transparent; cursor: pointer; }
.nav-submenu { display: none; position: absolute; top: calc(100% + 5px); left: 0; z-index: var(--z-local-30); min-width: 155px; padding: 5px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-md); }
.nav-hub:hover .nav-submenu { display: grid; }
.nav-hub:focus-within .nav-submenu { display: grid; }
.nav-hub.is-open .nav-submenu { display: grid; }
.nav-submenu a { padding: 8px 10px; color: var(--text); text-decoration: none; font-size: var(--text-sm); }
.nav-submenu a:hover { background: var(--hover-bg); }

.nav-link--disabled {
	color: var(--muted);
	opacity: .55;
	cursor: not-allowed;
	pointer-events: none;
}

.nav-submenu .nav-link--disabled {
	color: var(--muted);
	opacity: .55;
	cursor: not-allowed;
	pointer-events: none;
}
.nav-link--disabled:hover { background: transparent; color: var(--muted); }
.nav-link--disabled small { display: block; font-size: var(--text-xs); letter-spacing: .02em; }

.navbar-end {
	display: flex;
	align-items: center;
	gap: 10px;
}

.navbar-toggle {
	display: none;
	background: var(--control-bg);
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md);
	cursor: pointer;
	padding: 7px 9px;
}

.navbar-toggle span {
	display: block;
	width: 18px;
	height: 2px;
	background: var(--text);
	margin: 3px 0;
	border-radius: var(--radius-sm);
	transition: transform .18s ease, opacity .18s ease;
}

.navbar-toggle.open span:nth-child(1) {
	transform: translateY(5px) rotate(45deg);
}

.navbar-toggle.open span:nth-child(2) {
	opacity: 0;
}

.navbar-toggle.open span:nth-child(3) {
	transform: translateY(-5px) rotate(-45deg);
}

.page-title {
	font-family: var(--font-title);
	font-size: clamp(var(--text-xl), 3vw, var(--text-2xl));
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.08;
	margin-bottom: 3px;
}

.page-header {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 16px;
	align-items: center;
	padding: 4px 0 14px;
	margin-bottom: 14px;
	border: 0;
	border-bottom: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: transparent;
	box-shadow: none;
	overflow: visible;
}

.page-header::before {
	display: none;
}

.page-header--stacked {
	align-items: start;
}

.page-header__body {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.page-header__label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--success);
}

.page-header__meta {
	display: grid;
	align-self: center;
	gap: 2px;
	justify-items: end;
	text-align: right;
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
	padding: 0;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
}

.page-header__meta strong {
	font-size: var(--text-sm);
	color: var(--text);
}

.page-header__tools {
	min-width: min(100%, 420px);
}

.page-sub {
	font-size: var(--text-xs);
	line-height: 1.5;
	max-width: 680px;
	color: var(--muted);
}

.panel-card {
	position: relative;
	display: grid;
	gap: 14px;
	padding: 16px;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md);
	background: var(--panel-bg-strong);
	box-shadow: none;
	overflow: hidden;
}

.panel-card--compact {
	padding: 18px;
}

.panel-card--narrow {
	max-width: 480px;
	margin: 24px auto;
}

.flash-stack {
	display: grid;
	gap: 8px;
}

.flash-stack--spaced {
	margin-bottom: 12px;
}

.flash-stack--global {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: var(--z-toast);
	width: min(380px, calc(100vw - 32px));
	max-height: 40dvh;
	overflow-y: auto;
	pointer-events: none;
}

.flash-stack--global .flash-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: var(--surface);
	pointer-events: auto;
}

.flash-stack--global [data-flash-close] {
	flex-shrink: 0;
	min-width: 44px;
	min-height: 44px;
}

.flash-card {
	padding: 10px 12px;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md);
	background: var(--glass-bg);
	font-size: var(--text-sm);
	line-height: 1.45;
	color: var(--text-2);
}

.flash-card--compact {
	padding: 8px 10px;
}

.flash-card strong {
	text-transform: capitalize;
	color: var(--text);
}

.form-stack {
	display: grid;
	gap: 12px;
}

.form-stack--dense {
	gap: 10px;
}

.form-field {
	display: grid;
	gap: 6px;
}

.form-field-inline {
	display: flex;
	align-items: center;
	gap: 8px;
}

.form-label {
	display: block;
	font-size: var(--text-xs);
	line-height: 1.4;
	color: var(--text-2);
}

.form-control {
	width: 100%;
	max-width: 460px;
	min-height: var(--control-h);
	padding: 10px 12px;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md);
	background: var(--control-bg);
	color: var(--text);
	font: inherit;
	transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.form-select {
	width: 100%;
	max-width: 460px;
	min-height: var(--control-h);
	padding: 10px 12px;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md);
	background: var(--control-bg);
	color: var(--text);
	font: inherit;
	transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.form-control:focus {
	border-color: color-mix(in srgb, var(--success) 48%, var(--border));
	background: color-mix(in srgb, var(--glass-bg-strong) 86%, var(--success-bg));
}

.form-select:focus {
	border-color: color-mix(in srgb, var(--success) 48%, var(--border));
	background: color-mix(in srgb, var(--glass-bg-strong) 86%, var(--success-bg));
}

.form-file {
	width: 100%;
	max-width: 460px;
	min-height: var(--control-h);
	border-radius: var(--radius-md);
	color: var(--text);
	font: inherit;
	transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
	padding: 0;
	border: 0;
	background: transparent;
}

.form-action {
	width: max-content;
	padding: 8px 14px;
}

.form-action--block {
	width: 100%;
	justify-content: center;
}

.form-cap {
	text-transform: capitalize;
}

.inline-form {
	display: inline;
}

.clickable {
	cursor: pointer;
}

.footer-icon {
	opacity: .5;
}

.site-footer {
	border-top: 1px solid var(--glass-border);
	background: var(--panel-bg);
	padding: 14px 28px;
}

.footer-inner {
	max-width: var(--layout-max-width);
	margin: 0 auto;
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--muted);
}

.settings-trigger {
	appearance: none;
	border: 1px solid var(--glass-border);
	background: var(--control-bg);
	color: var(--text);
	width: 34px;
	height: 34px;
	border-radius: var(--radius-md);
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: .18s ease;
	box-shadow: none;
}

.settings-trigger:hover {
	background: var(--glass-bg-strong);
	border-color: var(--border-hi);
}

.theme-switcher {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md);
	background: var(--control-bg);
	box-shadow: none;
}

.font-family-switcher {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md);
	background: var(--control-bg);
	box-shadow: none;
}

.font-switcher {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md);
	background: var(--control-bg);
	box-shadow: none;
}

.ui-settings-modal {
	position: fixed;
	inset: 0;
	z-index: var(--z-modal);
}

.ui-settings-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .34);
}

.ui-settings-dialog {
	position: relative;
	width: min(460px, calc(100% - 24px));
	margin: 72px auto 0;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-lg);
	background: var(--panel-bg-strong);
	box-shadow: var(--shadow-md);
	overflow: hidden;
	animation: dialog-in .2s var(--ease-out) both;
}

.ui-settings-content {
	display: grid;
	gap: 14px;
	padding: 14px;
}

.ui-settings-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
}

.ui-settings-close {
	appearance: none;
	border: 1px solid var(--border);
	width: 28px;
	height: 28px;
	border-radius: var(--radius-md);
	background: var(--surface-2);
	color: var(--muted);
	cursor: pointer;
	font-size: var(--text-lg);
	line-height: 1;
}

.ui-settings-group {
	display: grid;
	gap: 8px;
}

.ui-settings-group label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--muted);
}

.theme-chip {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	line-height: 1;
	min-height: 30px;
	padding: 8px 11px;
	border-radius: var(--radius-md);
	cursor: pointer;
	transition: .18s ease;
}

.theme-chip:hover {
	color: var(--text);
	background: var(--hover-bg);
}

.theme-chip.is-active { color: var(--text-on-accent); background: var(--success); }

.theme-chip.form-action {
	border: 1px solid color-mix(in srgb, var(--success) 42%, transparent);
	background: var(--success);
	color: var(--text-on-accent);
	box-shadow: none;
}

.theme-chip.form-action:hover {
	color: var(--text-on-accent);
	border-color: color-mix(in srgb, var(--success-hi) 64%, transparent);
}

.font-chip {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--text);
	font: inherit;
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	line-height: 1;
	padding: 8px 10px;
	border-radius: var(--radius-md);
	cursor: pointer;
	transition: .18s ease;
}

.font-scale-label {
	min-width: 52px;
	text-align: center;
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--muted);
}

.ui-settings-select {
	width: 100%;
	border: 1px solid var(--glass-border);
	background: var(--control-bg);
	color: var(--text);
	border-radius: var(--radius-md);
	padding: 10px 11px;
	font: inherit;
	font-size: var(--text-sm);
}

.badge {
	display: inline-block;
	padding: 6px 12px;
	border-radius: var(--radius-md);
	font-size: var(--text-xs);
	font-weight: 600;
	line-height: 1.2;
	border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
}

.badge-accent {
	background: var(--success-bg);
	color: var(--success);
}

.weather-chip {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 38px;
	max-width: 190px;
	padding: 8px 11px;
	border: 1px solid color-mix(in srgb, var(--border-hi) 82%, transparent);
	border-radius: var(--radius-md);
	background: color-mix(in srgb, var(--surface) 92%, var(--success-bg));
	color: var(--text);
	font: inherit;
	cursor: pointer;
	transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.weather-chip:hover {
	background: color-mix(in srgb, var(--success-bg) 28%, var(--surface));
	border-color: color-mix(in srgb, var(--success) 32%, var(--border-hi));
	transform: translateY(-1px);
}

.weather-chip__temp {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

.weather-chip__city {
	max-width: 92px;
	overflow: hidden;
	color: var(--muted);
	font-size: var(--text-xs);
	line-height: 1;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.weather-icon {
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.weather-icon--sun {
	color: var(--warning);
	fill: color-mix(in srgb, var(--warning) 22%, transparent);
}

.weather-icon--partly {
	color: var(--muted);
	fill: color-mix(in srgb, var(--warning) 14%, transparent);
}

.weather-icon--cloud {
	color: var(--muted);
	fill: color-mix(in srgb, var(--border-hi) 18%, transparent);
}

.weather-icon--rain {
	color: var(--info);
	fill: color-mix(in srgb, var(--info) 14%, transparent);
}

.weather-icon--storm {
	color: var(--chart-5);
	fill: color-mix(in srgb, var(--chart-5) 14%, transparent);
}

.weather-svg {
	display: block;
	flex: 0 0 auto;
	overflow: visible;
}

.weather-svg__spin {
	animation: weather-spin 18s linear infinite;
	transform-origin: center;
}

.weather-svg__spin--offset {
	transform-origin: 24px 22px;
}

.weather-svg__pulse {
	animation: weather-pulse 2.8s ease-in-out infinite;
	transform-origin: center;
}

.weather-svg__drift {
	animation: weather-drift 5.5s ease-in-out infinite;
}

.weather-svg__drift--delay-2 {
	animation-delay: -2s;
}

.weather-svg__rain {
	animation: weather-rain 1.15s ease-in-out infinite;
}

.weather-svg__rain--delay-1 {
	animation-delay: -0.3s;
}

.weather-svg__rain--delay-2 {
	animation-delay: -0.6s;
}

.weather-svg__fog {
	animation: weather-fog 4s ease-in-out infinite;
}

.weather-svg__fog--delay-1 {
	animation-delay: -1s;
}

.weather-svg__fog--delay-2 {
	animation-delay: -2s;
}

.weather-svg__flash {
	animation: weather-flash 2.2s ease-in-out infinite;
}

.weather-modal-shell[hidden] {
	display: none;
}

.weather-modal-shell.hidden {
	display: none;
}

.weather-modal-shell {
	position: fixed;
	inset: 0;
	z-index: var(--z-modal);
	display: grid;
	place-items: center;
	padding: 16px;
	box-sizing: border-box;
}

.weather-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .34);
	backdrop-filter: blur(1px);
}

.weather-modal__dialog {
	position: relative;
	width: min(1120px, 100%);
	min-width: 0;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	max-height: calc(100dvh - 32px);
	animation: dialog-in .2s var(--ease-out) both;
}

.weather-modal-card {
	display: flex;
	flex-direction: column;
	max-height: inherit;
	overflow: hidden;
	border: 1px solid color-mix(in srgb, var(--border-hi) 82%, transparent);
	border-radius: var(--radius-md);
	background: var(--surface);
	box-shadow: 0 18px 54px rgba(15, 23, 42, .18);
}

.weather-modal-card__header {
	flex-shrink: 0;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	padding: 18px 20px 16px;
	border-bottom: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
}

.weather-modal-card__header div {
	display: grid;
	gap: 3px;
}

.weather-modal-card__header h2 {
	margin: 0;
	font-size: var(--text-md);
	font-weight: 700;
	color: var(--text);
}

.weather-modal-card__header p {
	margin: 0;
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
}

.weather-modal__close {
	appearance: none;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	border: 1px solid color-mix(in srgb, var(--border-hi) 72%, transparent);
	border-radius: var(--radius-md);
	background: color-mix(in srgb, var(--surface-2) 82%, var(--success-bg));
	color: var(--muted);
	font-size: var(--text-lg);
	line-height: 1;
	cursor: pointer;
	transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.weather-modal__close:hover {
	background: var(--hover-bg);
	border-color: var(--border-hi);
	color: var(--text);
}

.weather-modal__body {
	display: grid;
	gap: 14px;
	padding: 14px;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
}

.weather-current {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr);
	gap: 16px;
	align-items: stretch;
	padding: 16px;
	border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
	border-radius: var(--radius-md);
	background: color-mix(in srgb, var(--success-bg) 52%, var(--surface));
}

.weather-current__summary {
	display: grid;
	justify-items: start;
	align-content: center;
	gap: 4px;
}

.weather-current__icon {
	display: grid;
	place-items: center;
}

.weather-day__icon {
	display: grid;
	place-items: center;
}

.weather-current__temp {
	font-family: var(--font-mono);
	font-size: var(--text-2xl);
	font-weight: 700;
	line-height: 1;
	color: var(--text);
}

.weather-current__summary strong {
	color: var(--text);
	font-size: var(--text-sm);
	font-weight: 700;
}

.weather-current__stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	margin: 0;
}

.weather-current__stats div {
	display: grid;
	gap: 5px;
	min-height: 72px;
	padding: 12px;
	border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
	border-radius: var(--radius-md);
	background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.weather-current__stats dt {
	margin: 0;
	color: var(--muted);
	font-size: var(--text-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .05em;
}

.weather-current__stats dd {
	margin: 0;
	color: var(--text);
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	font-weight: 700;
}

.weather-forecast {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
	gap: 10px;
}

.weather-day {
	display: grid;
	justify-items: center;
	align-content: start;
	gap: 6px;
	min-height: 0;
	padding: 12px 10px;
	border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
	border-radius: var(--radius-md);
	background: color-mix(in srgb, var(--surface) 94%, var(--surface-2));
	color: var(--text);
	text-align: center;
	transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.weather-day:hover {
	transform: translateY(-1px);
	border-color: color-mix(in srgb, var(--success) 28%, var(--border-hi));
	box-shadow: 0 10px 20px rgba(15, 23, 42, .08);
}

.weather-day__date {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--muted);
}

.weather-day small {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--muted);
}

.weather-day strong {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	font-weight: 700;
	white-space: nowrap;
}

.weather-day p {
	min-height: 28px;
	margin: 0;
	color: var(--muted);
	font-size: var(--text-xs);
	line-height: 1.25;
}

@keyframes weather-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes weather-pulse {
	0% {
		transform: scale(1);
		opacity: .96;
	}
	100% {
		transform: scale(1);
		opacity: .96;
	}
	50% {
		transform: scale(1.08);
		opacity: 1;
	}
}

@keyframes weather-drift {
	0% {
		transform: translateX(0);
	}
	100% {
		transform: translateX(0);
	}
	50% {
		transform: translateX(2px);
	}
}

@keyframes weather-rain {
	0% {
		transform: translateY(-1px);
		opacity: .45;
	}
	50% {
		opacity: 1;
	}
	100% {
		transform: translateY(3px);
		opacity: .35;
	}
}

@keyframes weather-fog {
	0% {
		transform: translateX(-2px);
		opacity: .55;
	}
	100% {
		transform: translateX(-2px);
		opacity: .55;
	}
	50% {
		transform: translateX(2px);
		opacity: .95;
	}
}

@keyframes weather-flash {
	0% {
		opacity: .8;
	}
	78% {
		opacity: .8;
	}
	100% {
		opacity: .8;
	}
	82% {
		opacity: 1;
	}
	90% {
		opacity: 1;
	}
}

.badge-warning {
	background: var(--warning-bg);
	color: var(--warning);
}

.badge-danger {
	background: var(--danger-bg);
	color: var(--danger);
}

.badge-pj {
	background: var(--tag-pj-bg);
	color: var(--pj);
}

.badge-pf {
	background: var(--tag-pf-bg);
	color: var(--pf);
}

@media (max-width: 640px) {
	.nav-hub { width: 100%; }
	.nav-hub__trigger { width: 100%; text-align: left; }
	.nav-submenu { position: static; margin: 2px 10px; box-shadow: none; }
	.navbar-inner {
		padding: 0 18px;
	}

	main {
		padding: 24px 18px 40px;
	}

	.navbar-toggle {
		display: inline-block;
	}

	.weather-chip {
		max-width: 72px;
		padding-inline: 9px;
	}

	.weather-modal-shell {
		padding: 8px;
	}

	.weather-modal__dialog {
		width: 100%;
		max-height: calc(100vh - 16px);
		max-height: calc(100dvh - 16px);
		max-height: calc(100dvh - 16px);
	}

	.weather-current {
		grid-template-columns: 1fr;
		gap: 12px;
		padding: 12px;
	}

	.weather-current__stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.weather-forecast {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.navbar-links {
		display: none;
		position: absolute;
		top: var(--navbar-h);
		left: 12px;
		right: 12px;
		background: var(--glass-bg-strong);
		border: 1px solid var(--glass-border);
		border-radius: var(--radius-lg);
		padding: 12px;
		flex-direction: column;
		align-items: stretch;
		box-shadow: var(--shadow-sm);
	}

	.navbar-links.open {
		display: flex;
	}

	.nav-link {
		width: 100%;
	}

	.page-header {
		grid-template-columns: 1fr;
	}

	.page-header__meta {
		grid-template-columns: 1fr;
		justify-items: start;
		text-align: left;
	}
}

@keyframes dialog-in {
	from {
		opacity: 0;
		transform: translateY(-8px) scale(.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* Componentes da aplicação */

.municipios-page .municipios-layout {
	display: grid;
	align-items: start;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, .95fr);
	gap: 24px;
}

.municipios-page .map-header {
	display: grid;
	align-items: end;
	margin-bottom: 18px;
	padding-bottom: 18px;
	border-bottom: 3px double var(--border);
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 24px;
}

.municipios-page .right-column {
	display: grid;
	min-width: 0;
	gap: 16px;
}

.municipios-page .left-column {
	display: grid;
	min-width: 0;
	gap: 16px;
	align-content: center;
	min-height: 520px;
}

.municipios-page .map-view-switch {
	display: inline-flex;
	align-items: center;
	width: max-content;
	padding: 4px;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md);
	background: var(--surface);
	box-shadow: none;
	gap: 4px;
}

.municipios-page .map-view-pill {
	appearance: none;
	border: 0;
	border-radius: var(--radius-md);
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	font: inherit;
	font-size: var(--text-xs);
	font-weight: 600;
	padding: 8px 12px;
	transition: .18s ease;
}

.municipios-page .map-view-pill:hover {
	color: var(--text);
	background: var(--glass-bg-strong);
}

.municipios-page .map-view-pill.is-active {
	color: var(--success);
	background: color-mix(in srgb, var(--success-bg) 95%, transparent);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 42%, var(--border));
}

.municipios-page .map-view-note {
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
}

.municipios-page .map-panels {
	display: grid;
}

.municipios-page .map-panel {
	display: none;
}

.municipios-page .map-panel.is-active {
	display: block;
}

.municipios-page .selected-mini-map {
	display: grid;
	padding: 0 0 10px;
	border-bottom: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: transparent;
	gap: 10px;
}

.municipios-page .selected-mini-map .map-caption {
	font-size: var(--text-xs);
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	color: var(--muted);
	gap: 10px;
}

.municipios-page .selected-mini-map .map-caption strong {
	font-size: var(--text-xs);
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--text);
}

.municipios-page .clean-section {
	display: grid;
	padding-top: 4px;
	gap: 12px;
}

.municipios-page .dossier-tabs {
	display: flex;
	overflow-x: hidden;
	align-items: center;
	flex-wrap: wrap;
	padding: 4px;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: transparent;
	gap: 4px;
}

.municipios-page .ds-tab--dossier {
	font-size: var(--text-xs);
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	padding: 8px 11px;
	cursor: pointer;
	transition: .15s ease;
	white-space: nowrap;
	color: var(--muted);
	border: 0;
	border-radius: var(--radius-md);
	background: transparent;
	gap: 8px;
}

.municipios-page .ds-tab--dossier:hover {
	color: var(--text);
	background: color-mix(in srgb, var(--surface-2) 80%, transparent);
}

.municipios-page .ds-tab--dossier.is-active {
	color: var(--success);
	background: color-mix(in srgb, var(--success-bg) 95%, transparent);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 42%, var(--border));
}

.municipios-page .tab-icon {
	display: inline-grid;
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	place-items: center;
}

.municipios-page .tab-icon svg {
	display: block;
	width: 14px;
	height: 14px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.municipios-page .control-grid {
	display: grid;
	width: 100%;
	grid-template-columns: repeat(3, minmax(160px, 1fr));
	gap: 10px;
}

.municipios-page .map-controls .control {
	display: grid;
	gap: 4px;
}

.municipios-page .map-controls .control label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}

.municipios-page .map-controls .control select {
	font-size: var(--text-sm);
	padding: 9px 10px;
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
}

.municipios-page .selected-summary {
	display: grid;
	padding: 0 0 8px;
	border-bottom: 1px solid var(--border);
	gap: 12px;
}

.municipios-page .dossier-head {
	display: grid;
	gap: 10px;
}

.municipios-page .dossier-title {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.municipios-page .dossier-title .title-block {
	min-width: 0;
}

.municipios-page .dossier-title .summary-title {
	font-size: var(--text-lg);
	font-weight: 700;
	line-height: 1.15;
}

.municipios-page .dossier-title .summary-sub {
	font-size: var(--text-xs);
	line-height: 1.5;
	margin-top: 4px;
	color: var(--muted);
}

.municipios-page .dossier-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

.municipios-page .icon-btn {
	display: inline-grid;
	width: 32px;
	height: 32px;
	cursor: pointer;
	transition: .15s ease;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
	place-items: center;
}

.municipios-page .icon-btn:hover {
	transform: translateY(-1px);
	color: var(--text);
	border-color: var(--border-hi);
}

.municipios-page .fact-strip {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.municipios-page .fact-card {
	display: grid;
	padding: 0 0 12px;
	border: 0;
	border-bottom: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: transparent;
	gap: 4px;
}

.municipios-page .fact-card label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--muted);
}

.municipios-page .fact-card strong {
	font-size: var(--text-sm);
	line-height: 1.3;
	color: var(--text);
}

.municipios-page .fact-card small {
	font-size: var(--text-xs);
	line-height: 1.35;
	color: var(--muted);
}

.municipios-page .fact-strip:has(.municipio-economia) {
	display: block;
}

.municipios-page .municipio-economia {
	display: grid;
	gap: var(--space-4);
}

.municipios-page .municipio-economia__head {
	display: flex;
	align-items: end;
	justify-content: space-between;
	padding-bottom: var(--space-3);
	border-bottom: 1px solid var(--border);
	gap: var(--space-3);
}

.municipios-page .municipio-economia__head > div {
	display: grid;
	gap: var(--space-1);
}

.municipios-page .municipio-economia__composition {
	display: grid;
	gap: var(--space-1);
}

.municipios-page .municipio-economia__head strong {
	font-size: var(--text-md);
	line-height: 1.2;
}

.municipios-page .municipio-economia__head span {
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
}

.municipios-page .municipio-economia__activity span {
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
}

.municipios-page .municipio-economia-empty {
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
}

.municipios-page .municipio-economia-error {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	padding-block: var(--space-3);
	border-block: 1px solid var(--border);
}

.municipios-page .municipio-economia-error p {
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
	margin: 0;
	min-width: 0;
	overflow-wrap: anywhere;
}

.municipios-page .municipio-economia-retry {
	flex: 0 0 auto;
	border: 1px solid var(--border-strong);
	background: transparent;
	color: var(--text);
	font: inherit;
	font-size: var(--text-xs);
	padding: var(--space-2) var(--space-3);
	cursor: pointer;
}

.municipios-page .municipio-economia-retry:hover {
	border-color: var(--text);
	background: var(--surface-muted);
}

.municipios-page .municipio-economia-retry:focus-visible {
	border-color: var(--text);
	background: var(--surface-muted);
}

.municipios-page .municipio-economia__head small {
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
	white-space: nowrap;
}

.municipios-page .municipio-economia__metrics {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	border-bottom: 1px solid var(--border);
}

.municipios-page .municipio-economia__metrics > div {
	display: grid;
	padding: 0 var(--space-4) var(--space-3) 0;
	gap: var(--space-1);
}

.municipios-page .municipio-economia__metrics > div + div {
	padding-right: 0;
	padding-left: var(--space-4);
	border-left: 1px solid var(--border);
}

.municipios-page .municipio-economia label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--muted);
}

.municipios-page .municipio-economia__metrics strong {
	font-size: var(--text-lg);
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.municipios-page .municipio-economia__metrics small {
	font-size: var(--text-xs);
	color: var(--muted);
}

.municipios-page .municipio-economia__body {
	display: grid;
	grid-template-columns: minmax(180px, .72fr) minmax(0, 1.28fr);
	gap: var(--space-4);
}

.municipios-page .municipio-economia__activity {
	display: grid;
	gap: var(--space-1);
	align-content: start;
	padding-right: var(--space-4);
	border-right: 1px solid var(--border);
}

.municipios-page .municipio-economia__activity strong {
	font-size: var(--text-md);
	line-height: 1.25;
}

.municipios-page .municipio-economia__composition > div {
	display: grid;
	gap: var(--space-2);
}

.municipios-page .municipio-economia__sector {
	display: grid;
	grid-template-columns: minmax(130px, 1fr) minmax(72px, 1.45fr) minmax(48px, auto);
	align-items: center;
	gap: var(--space-2);
}

.municipios-page .municipio-economia__sector > span {
	font-size: var(--text-xs);
	line-height: 1.25;
}

.municipios-page .municipio-economia__sector > strong {
	font-size: var(--text-xs);
	line-height: 1.25;
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.municipios-page .municipio-economia__sector > div {
	height: 6px;
	overflow: hidden;
	background: var(--surface-3);
}

.municipios-page .municipio-economia__sector i {
	display: block;
	width: var(--municipio-economia-share, 0%);
	height: 100%;
	background: var(--success);
}

.municipios-page .municipio-economia__source {
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
	width: max-content;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.municipios-page .municipio-economia__source:hover {
	color: var(--text);
}

.municipios-page .detail-list {
	display: grid;
	gap: 10px;
}

.municipios-page .detail-list.is-tabs {
	gap: 0;
}

.municipios-page .detail-panel {
	display: none;
	padding-top: 8px;
	gap: 10px;
}

.municipios-page .detail-panel.is-active {
	display: grid;
}

.municipios-page .climate-summary {
	display: grid;
	margin-bottom: 10px;
	padding: 0 0 12px;
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: transparent;
	gap: 10px;
}

.municipios-page .climate-summary-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.municipios-page .climate-summary-head strong {
	font-size: var(--text-sm);
}

.municipios-page .climate-summary-head span {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}

.municipios-page .municipio-weather {
	display: grid;
	gap: 10px;
	padding: 12px;
	border: 1px solid color-mix(in srgb, var(--success) 22%, var(--border));
	border-radius: var(--radius-md);
	background: color-mix(in srgb, var(--success-bg) 42%, var(--surface));
}

.municipios-page .municipio-weather__state {
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
}

.municipios-page .municipio-weather__state--error {
	color: var(--danger);
}

.municipios-page .municipio-weather__current {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
}

.municipios-page .municipio-weather__current div {
	display: grid;
	gap: 3px;
}

.municipios-page .municipio-weather__current strong {
	font-family: var(--font-mono);
	font-size: var(--text-2xl);
	line-height: 1;
	color: var(--text);
}

.municipios-page .municipio-weather__current span {
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
}

.municipios-page .municipio-weather__current small {
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
}

.municipios-page .municipio-weather__forecast {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
	gap: 8px;
}

.municipios-page .municipio-weather__forecast div {
	display: grid;
	gap: 3px;
	min-height: 68px;
	padding: 8px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.municipios-page .municipio-weather__forecast span {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--muted);
}

.municipios-page .municipio-weather__forecast small {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--muted);
}

.municipios-page .municipio-weather__forecast strong {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	color: var(--text);
}

.municipios-page .climate-timeline {
	display: grid;
	gap: 8px;
}

.municipios-page .timeline-svg-wrap {
	overflow: hidden;
	padding: 8px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: transparent;
}

.municipios-page .timeline-svg {
	display: block;
	width: 100%;
	height: 104px;
}

.municipios-page .timeline-list {
	display: grid;
	gap: 8px;
}

.municipios-page .timeline-item {
	display: grid;
	align-items: center;
	padding: 8px 10px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: color-mix(in srgb, var(--surface) 92%, transparent);
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 10px;
}

.municipios-page .timeline-dot {
	width: 12px;
	height: 12px;
	border-radius: var(--radius-pill);
	background: var(--success);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--success-bg) 70%, transparent);
}

.municipios-page .timeline-meta {
	display: grid;
	min-width: 0;
	gap: 2px;
}

.municipios-page .timeline-meta strong {
	font-size: var(--text-xs);
	color: var(--text);
}

.municipios-page .timeline-meta small {
	font-size: var(--text-xs);
	color: var(--muted);
}

.municipios-page .timeline-value {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	white-space: nowrap;
	color: var(--success);
}

.municipios-page .detail-card {
	overflow: hidden;
	border-bottom: 1px solid var(--border);
}

.municipios-page .detail-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 12px 0 10px;
	cursor: pointer;
	text-align: left;
	color: var(--text);
	border: 0;
	background: transparent;
	gap: 10px;
}

.municipios-page .detail-toggle strong {
	font-size: var(--text-sm);
}

.municipios-page .detail-toggle span {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	display: block;
	margin-top: 2px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}

.municipios-page .detail-toggle .chev {
	display: grid;
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	transition: transform .15s ease;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	place-items: center;
}

.municipios-page .detail-card.is-open .detail-toggle .chev {
	transform: rotate(180deg);
}

.municipios-page .detail-content {
	font-size: var(--text-sm);
	line-height: 1.6;
	display: none;
	padding: 0 0 12px;
	color: var(--text-2);
	border-top: 0;
}

.municipios-page .detail-card.is-open .detail-content {
	display: grid;
	gap: 8px;
}

.municipios-page .detail-content .detail-line {
	display: flex;
	justify-content: space-between;
	padding-top: 8px;
	border-top: 1px dashed var(--border);
	gap: 10px;
}

.municipios-page .detail-content .detail-line:first-child {
	padding-top: 0;
	border-top: 0;
}

.municipios-page .detail-content .detail-line label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}

.municipios-page .detail-content .detail-line strong {
	font-size: var(--text-sm);
	font-weight: 600;
	text-align: right;
}

.municipios-page .officials-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.municipios-page .official-card {
	display: grid;
	padding: 0 0 12px;
	border: 0;
	border-bottom: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: transparent;
	gap: 10px;
}

.municipios-page .official-card.is-birthday-week {
	padding: 10px;
	border: 1px solid color-mix(in srgb, var(--warning) 52%, var(--border));
	border-radius: var(--radius-md);
	background: color-mix(in srgb, var(--warning-bg) 26%, transparent);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 22%, transparent);
}

.municipios-page .official-card-header {
	display: flex;
	align-items: center;
	padding-bottom: 4px;
	gap: 10px;
}

.municipios-page .official-more-btn {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	width: 28px;
	height: 28px;
	margin-left: auto;
	cursor: pointer;
	transition: .15s ease;
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
}

.municipios-page .official-more-btn:hover {
	color: var(--success);
	border-color: color-mix(in srgb, var(--success) 35%, var(--border));
	background: var(--success-bg);
}

.municipios-page .official-photo {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	display: grid;
	overflow: hidden;
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: color-mix(in srgb, var(--success) 10%, var(--surface-2));
	place-items: center;
}

.municipios-page .official-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.municipios-page .official-meta {
	display: grid;
	min-width: 0;
	gap: 4px;
}

.municipios-page .official-role {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	display: inline-flex;
	align-items: center;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--muted);
	gap: 6px;
}

.municipios-page .birthday-flag {
	display: inline-grid;
	width: 18px;
	height: 18px;
	color: color-mix(in srgb, var(--warning) 75%, var(--text));
	border: 1px solid color-mix(in srgb, var(--warning) 38%, var(--border));
	border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--warning-bg) 72%, transparent);
	place-items: center;
}

.municipios-page .birthday-flag svg {
	display: block;
	width: 12px;
	height: 12px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.municipios-page .official-name {
	font-size: var(--text-sm);
	font-weight: 700;
	line-height: 1.3;
}

.municipios-page .official-party {
	font-size: var(--text-xs);
	line-height: 1.4;
	color: var(--muted);
}

.municipios-page .official-modal-overlay {
	position: fixed;
	z-index: var(--z-modal);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 14px;
	background: rgba(15, 23, 42, .48);
	inset: 0;
}

.municipios-page .official-modal-overlay.is-open {
	display: flex;
}

.municipios-page .official-modal {
	overflow: auto;
	width: min(760px, 100%);
	max-height: 86vh;
	max-height: 86dvh;
	padding: 12px;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md);
	background: var(--surface);
	box-shadow: var(--shadow-md);
}

.municipios-page .official-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--border);
	gap: 8px;
}

.municipios-page .official-modal-head strong {
	font-size: var(--text-sm);
}

.municipios-page .official-modal-close {
	width: 30px;
	height: 30px;
	cursor: pointer;
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
}

.municipios-page .official-modal-identity {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr);
	align-items: center;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--border);
	gap: 12px;
}

.municipios-page .official-modal-photo {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	display: grid;
	overflow: hidden;
	width: 88px;
	height: 112px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: color-mix(in srgb, var(--success) 10%, var(--surface-2));
	place-items: center;
}

.municipios-page .official-modal-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.municipios-page .official-modal-identity-copy {
	display: grid;
	align-content: center;
	gap: 3px;
}

.municipios-page .official-modal-identity-copy span {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}

.municipios-page .official-modal-identity-copy strong {
	font-size: var(--text-md);
	line-height: 1.25;
}

.municipios-page .official-modal-identity-copy small {
	color: var(--muted);
	font-family: inherit;
	font-size: var(--text-xs);
	letter-spacing: 0;
	text-transform: none;
}
.municipios-page .official-modal-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.municipios-page .official-modal-grid > div {
	padding: 8px 10px;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md);
	background: var(--surface);
}

.municipios-page .official-modal-grid > div.official-modal-grid__span-all {
	grid-column: 1 / -1;
}

.municipios-page .official-modal-grid label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	display: block;
	margin-bottom: 4px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}

.municipios-page .official-modal-grid p {
	font-size: var(--text-sm);
	line-height: 1.4;
	margin: 0;
	word-break: break-word;
}

.municipios-page .official-modal-grid p.social-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.municipios-page .official-modal-grid p.social-links a {
	color: var(--accent);
	text-decoration: underline;
	word-break: break-all;
}

.municipios-page .official-modal-grid p.social-links a:hover {
	opacity: 0.8;
}

.municipios-page .selected-summary .summary-title {
	font-size: var(--text-sm);
	font-weight: 700;
}

.municipios-page .selected-summary .summary-sub {
	font-size: var(--text-xs);
	color: var(--muted);
}

.municipios-page .programa-badge {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	display: inline-flex;
	align-items: center;
	margin-top: 4px;
	padding: 4px 10px;
	color: var(--success);
	border-radius: var(--radius-sm);
	background: var(--success-bg);
	gap: 6px;
}

.municipios-page .summary-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
}

.municipios-page .summary-grid .lead-metric {
	display: grid;
	padding: 14px 0 12px;
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: transparent;
	grid-column: 1 / -1;
	gap: 6px;
}

.municipios-page .summary-grid .lead-metric label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--muted);
}

.municipios-page .summary-grid .lead-metric strong {
	font-size: var(--text-2xl);
	line-height: 1;
	letter-spacing: 0;
	color: var(--text);
}

.municipios-page .summary-grid .lead-metric small {
	font-size: var(--text-xs);
	line-height: 1.45;
	color: var(--muted);
}

.municipios-page .summary-grid .ds-metric--observatory strong {
	font-size: var(--text-lg);
}

.municipios-page #mapa-geo {
	position: relative;
	overflow: hidden;
	width: 100%;
	height: 620px;
	background: transparent;
	--municipio-highlight-stroke: var(--success);
	--municipio-highlight-fill: rgba(21, 128, 61, .28);
	--municipio-highlight-fill-hover: rgba(21, 128, 61, .4);
	--municipio-highlight-shadow: rgba(21, 128, 61, .35);
}

.municipios-page .municipio-car-layer {
	margin-top: 14px;
	padding: 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
}

.municipios-page .municipio-car-layer__heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.municipios-page .municipio-car-layer__heading h2,
.municipios-page .municipio-car-layer__heading p {
	margin: 0;
}

.municipios-page .municipio-car-layer__heading h2 {
	font-size: var(--text-md);
}

.municipios-page .municipio-car-layer__heading p,
.municipios-page .municipio-car-layer__status {
	color: var(--text-2);
	font-size: var(--text-sm);
}

.municipios-page .municipio-car-layer__status { margin: 12px 0 0; }
.municipios-page .municipio-car-layer__list { display: grid; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.municipios-page .municipio-car-layer__list button {
	width: 100%;
	min-height: 44px;
	padding: 9px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface-2);
	color: var(--text);
	text-align: left;
	cursor: pointer;
}
.municipios-page .municipio-car-layer__list button:hover,
.municipios-page .municipio-car-layer__list button[aria-pressed="true"] { border-color: var(--success); background: var(--success-bg); }
.municipios-page .municipio-car-layer__list button:focus-visible { outline: 2px solid var(--success); outline-offset: 2px; }
.municipios-page .municipio-car-layer__selection {
	margin-top: 12px;
	padding: 12px;
	border-left: 3px solid var(--success);
	background: var(--surface-2);
}
.municipios-page .municipio-car-layer__selection h3 { margin: 0 0 8px; font-size: var(--text-sm); }
.municipios-page .municipio-car-layer__selection dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 12px; margin: 0; font-size: var(--text-sm); }
.municipios-page .municipio-car-layer__selection dt { color: var(--text-2); }
.municipios-page .municipio-car-layer__selection dd { margin: 0; overflow-wrap: anywhere; }
.municipios-page .mapa-imovel-car { fill: rgba(194, 65, 12, .2); stroke: #9a3412; stroke-width: 1.15; vector-effect: non-scaling-stroke; cursor: pointer; }
.municipios-page .mapa-imovel-car:hover,
.municipios-page .mapa-imovel-car:focus { fill: rgba(194, 65, 12, .42); stroke-width: 2; outline: none; }
.municipios-page .mapa-imovel-car.is-selected { stroke: #7c2d12; stroke-width: 2.4; }
@media (max-width: 640px) {
	.municipios-page .municipio-car-layer { padding: 12px; }
	.municipios-page .municipio-car-layer__heading { align-items: stretch; }
	.municipios-page .municipio-car-layer__heading .ds-btn { width: 100%; }
}

.municipios-page #mapa-estado-overview {
	position: relative;
	overflow: hidden;
	width: 100%;
	height: 620px;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	--municipio-highlight-stroke: var(--success);
	--municipio-highlight-fill: rgba(21, 128, 61, .28);
	--municipio-highlight-fill-hover: rgba(21, 128, 61, .4);
	--municipio-highlight-shadow: rgba(21, 128, 61, .35);
}

.municipios-page .mapa-svg {
	display: block;
	width: 100%;
	height: 100%;
}

.municipios-page .mapa-regional {
	transition: fill .18s ease, opacity .18s ease;
	animation: mapa-fade-in .35s ease both;
	fill: rgba(59, 130, 246, .14);
	stroke: rgba(30, 64, 175, .65);
	stroke-width: 1.1;
}

.municipios-page .mapa-regional:hover {
	opacity: .95;
	fill: rgba(59, 130, 246, .22);
}

.municipios-page .mapa-regional.is-dimmed {
	opacity: .28;
	filter: saturate(.6);
}

.municipios-page .mapa-regional.is-hovered {
	fill: rgba(59, 130, 246, .35);
	stroke: rgba(30, 64, 175, .95);
	stroke-width: 1.6;
	filter: drop-shadow(0 4px 10px rgba(30, 64, 175, .35));
	cursor: pointer;
}

.municipios-page .mapa-selected {
	transition: fill .18s ease, stroke-width .18s ease, filter .18s ease;
	animation: mapa-fade-in .45s ease both;
	fill: var(--municipio-highlight-fill);
	stroke: var(--municipio-highlight-stroke);
	stroke-width: 2.2;
	pointer-events: none;
}

.municipios-page .mapa-selected:hover {
	fill: var(--municipio-highlight-fill-hover);
	stroke-width: 2.8;
	filter: drop-shadow(0 0 6px var(--municipio-highlight-shadow));
}

/* --- Tooltip rico --- */
.municipios-page .ds-tooltip--mapa {
	position: absolute;
	pointer-events: none;
	z-index: var(--z-local-6);
	min-width: 180px;
	max-width: 260px;
	padding: 10px 12px;
	border-radius: var(--radius-md);
	background: rgba(15, 23, 42, .94);
	color: var(--text);
	font-family: var(--font-mono, "IBM Plex Mono", monospace);
	font-size: var(--text-xs);
	line-height: 1.45;
	box-shadow: 0 10px 30px rgba(2, 6, 23, .35), 0 0 0 1px rgba(148, 163, 184, .18);
	opacity: 0;
	transform: translateY(4px);
	transition: opacity .14s ease, transform .14s ease;
	display: grid;
	gap: 2px;
}

.municipios-page .ds-tooltip--mapa.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.municipios-page .ds-tooltip--mapa strong {
	font-size: var(--text-sm);
	color: var(--warning);
	letter-spacing: .2px;
}

.municipios-page .ds-tooltip--mapa span {
	color: var(--text-2);
}

.municipios-page .ds-tooltip--mapa em {
	font-style: normal;
	color: var(--text-2);
}

.municipios-page .ds-tooltip--mapa em b {
	color: var(--success);
	font-weight: 700;
}

.municipios-page .ds-tooltip--mapa small {
	color: var(--border-hi);
	font-size: var(--text-xs);
}

/* --- Controles de zoom flutuantes --- */
.municipios-page .mapa-zoom-controls {
	position: absolute;
	right: 14px;
	bottom: 14px;
	z-index: var(--z-local-5);
	display: grid;
	gap: 6px;
	padding: 6px;
	border-radius: var(--radius-md);
	background: var(--surface);
	box-shadow: 0 0 0 1px var(--border);
}

.municipios-page .mapa-zoom-controls button {
	width: 34px;
	height: 34px;
	border-radius: var(--radius-md);
	border: 0;
	background: transparent;
	color: var(--text);
	font-size: var(--text-lg);
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease, transform .12s ease;
}

.municipios-page .mapa-zoom-controls button:hover {
	background: rgba(59, 130, 246, .14);
	transform: translateY(-1px);
}

.municipios-page .mapa-zoom-controls button:active {
	transform: translateY(0);
}

/* --- Mapa do estado: também interativo --- */

.municipios-page .mapa-overview-base.is-dimmed {
	opacity: .25;
}

.municipios-page .mapa-overview-region.is-dimmed {
	opacity: .25;
}

.municipios-page .mapa-overview-base.is-hovered {
	fill: color-mix(in srgb, var(--municipio-highlight-stroke) 60%, white);
	stroke-width: 1.6;
	filter: drop-shadow(0 4px 10px var(--municipio-highlight-shadow));
}

.municipios-page .mapa-overview-region.is-hovered {
	fill: color-mix(in srgb, var(--municipio-highlight-stroke) 60%, white);
	stroke-width: 1.6;
	filter: drop-shadow(0 4px 10px var(--municipio-highlight-shadow));
}

.municipios-page .mapa-viewport {
	transform-origin: 0 0;
}

.municipios-page .mapa-label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	fill: var(--text);
	paint-order: stroke;
	stroke: rgba(255, 255, 255, .75);
	stroke-width: 3px;
	stroke-linejoin: round;
}

.municipios-page .mapa-overview-base {
	cursor: pointer;
	fill: color-mix(in srgb, var(--surface-2) 52%, var(--border-hi));
	stroke: color-mix(in srgb, var(--border-hi) 88%, var(--muted));
	stroke-width: .9;
	transition: fill .18s ease, opacity .18s ease;
}

.municipios-page .mapa-overview-region {
	cursor: pointer;
	fill: color-mix(in srgb, var(--success) 26%, var(--surface));
	stroke: color-mix(in srgb, var(--success) 46%, var(--border-hi));
	stroke-width: 1;
}

.municipios-page .mapa-overview-selected {
	fill: var(--municipio-highlight-fill);
	stroke: var(--municipio-highlight-stroke);
	stroke-width: 2.2;
	filter: drop-shadow(0 0 5px var(--municipio-highlight-shadow));
}

.municipios-page .mapa-overview-label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	fill: var(--text);
	paint-order: stroke;
	stroke: rgba(255, 255, 255, .9);
	stroke-width: 3px;
	stroke-linejoin: round;
}

.municipios-page .mapa-overview-caption {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	fill: var(--muted);
}

@keyframes mapa-fade-in {
	from {
		opacity: 0;
		transform: translateY(4px) scale(.992);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.municipios-page .municipio-chart {
	width: 100%;
	min-height: 300px;
	padding-top: 8px;
	border-top: 1px solid var(--border);
}

.municipios-page .panel-title {
	font-size: var(--text-xs);
	font-weight: 700;
	display: flex;
	align-items: center;
	margin-bottom: 12px;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--text);
	gap: 12px;
}

.municipios-page .panel-title span {
	flex: 1;
	height: 1px;
	background: var(--border);
}

.municipios-page .panel-title em {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	font-style: normal;
	letter-spacing: .06em;
	color: var(--muted);
}

.municipios-page .municipio-spgg-dee__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
}

.municipios-page .municipio-spgg-dee__block {
	display: grid;
	padding: var(--space-3) var(--space-4) var(--space-3) 0;
	gap: var(--space-3);
}

.municipios-page .municipio-spgg-dee__block + .municipio-spgg-dee__block {
	padding-right: 0;
	padding-left: var(--space-4);
	border-left: 1px solid var(--border);
}

.municipios-page .municipio-spgg-dee__block header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--space-2);
}

.municipios-page .municipio-spgg-dee__block header strong {
	font-size: var(--text-sm);
	line-height: 1.3;
}

.municipios-page .municipio-spgg-dee__block header span {
	font-size: var(--text-xs);
	line-height: 1.4;
	color: var(--muted);
}

.municipios-page .municipio-spgg-dee__metrics {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-3);
}

.municipios-page .municipio-spgg-dee__metrics > div {
	display: grid;
	min-width: 0;
	gap: var(--space-1);
}

.municipios-page .municipio-spgg-dee__metrics label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}

.municipios-page .municipio-spgg-dee__metrics strong {
	font-size: var(--text-md);
	line-height: 1.25;
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

.municipios-page .municipio-spgg-dee__source {
	font-size: var(--text-xs);
	line-height: 1.4;
	color: var(--muted);
	margin: var(--space-2) 0 0;
}
@media (max-width: 960px) {
	.municipios-page .map-header {
		grid-template-columns: 1fr;
	}
	.municipios-page .municipios-layout {
		grid-template-columns: 1fr;
	}
	.municipios-page .control-grid {
		grid-template-columns: 1fr;
	}
	.municipios-page .fact-strip {
		grid-template-columns: 1fr;
	}
	.municipios-page .summary-grid {
		grid-template-columns: 1fr;
	}
	.municipios-page .officials-grid {
		grid-template-columns: 1fr;
	}

	.municipios-page .municipio-economia__metrics {
		grid-template-columns: 1fr;
	}

	.municipios-page .municipio-economia__body {
		grid-template-columns: 1fr;
	}

	.municipios-page .municipio-spgg-dee__grid {
		grid-template-columns: 1fr;
	}

	.municipios-page .municipio-economia__head {
		align-items: start;
		flex-direction: column;
	}

	.municipios-page .municipio-economia__metrics > div + div {
		padding: var(--space-3) 0 0;
		border-top: 1px solid var(--border);
		border-left: 0;
	}

	.municipios-page .municipio-economia__activity {
		padding: 0 0 var(--space-3);
		border-right: 0;
		border-bottom: 1px solid var(--border);
	}

	.municipios-page .municipio-spgg-dee__block {
		padding: var(--space-3) 0;
		border-left: 0;
	}

	.municipios-page .municipio-spgg-dee__block + .municipio-spgg-dee__block {
		padding: var(--space-3) 0;
		border-left: 0;
		border-top: 1px solid var(--border);
	}

	.municipios-page #mapa-geo {
		height: 380px;
	}

	.municipios-page #mapa-estado-overview {
		height: 380px;
	}

	.municipios-page .official-modal-grid {
		grid-template-columns: 1fr;
	}
}

/* Equivalente as regras que o htmx injetaria via \3c style> inline (desativado
   por CSP em aters.html com includeIndicatorStyles=false). */
.htmx-indicator {
	opacity: 0;
}

.htmx-request .htmx-indicator {
	opacity: 1;
	transition: opacity 200ms ease-in;
}

.htmx-request.htmx-indicator {
	opacity: 1;
	transition: opacity 200ms ease-in;
}
    

/* Padronização visual: nomes e territórios, sem modificar os valores de dados. */
[data-name-uppercase] { text-transform: uppercase; }

/* ==========================================================================
   DESIGN SYSTEM — biblioteca de componentes institucional / neo-brutalista
   ==========================================================================
   Constrói inteiramente sobre os tokens de tokens.css (cor de marca segue
   sendo --success, já usada em toda a aplicação — nenhuma paleta nova).
   Só a GEOMETRIA muda entre os dois modos (html.design-institutional /
   html.design-brutalist): raio, espessura de borda, sombra e tipografia.

   Duas partes:
   1. Componentes novos e nomeados (.ds-*) — vocabulário canônico para telas
      novas e para a migração gradual das páginas existentes.
   2. Retrofit de alcance amplo — aplica a MESMA geometria aos componentes
      já existentes no app (painéis, badges, pills, KPIs, abas, tabelas,
      modais — nenhum deles hoje respondia à troca de design) via seletor
      de atributo, sem precisar renomear classe em nenhum template. Usa
      !important deliberadamente: é a técnica que o próprio design de
      referência neo-brutalista usa para uma camada de tema que precisa
      vencer estilo já escrito por página.
   ========================================================================== */

/* -------------------------------------------------------------------------
   1. BOTÃO
   ------------------------------------------------------------------------- */
.ds-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	min-height: var(--control-h);
	padding: 0 16px;
	border: var(--border-w) solid transparent;
	border-radius: var(--radius-md);
	background: var(--surface);
	color: var(--text-2);
	font: inherit;
	font-weight: 650;
	font-size: var(--text-sm);
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: background .16s var(--ease-out), border-color .16s var(--ease-out),
		color .16s var(--ease-out), box-shadow .16s var(--ease-out), transform .16s var(--ease-out);
}
.ds-btn:disabled { opacity: .5; pointer-events: none; }
.ds-btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.ds-btn--primary { background: var(--brand); color: var(--text-on-accent); border-color: var(--brand); }
.ds-btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.ds-btn--secondary { background: var(--surface); color: var(--text-2); border-color: var(--border-hi); }
.ds-btn--secondary:hover { background: var(--hover-bg); color: var(--text); }
.ds-btn--ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.ds-btn--ghost:hover { background: var(--hover-bg); color: var(--text); }
.ds-btn--danger { background: var(--danger); color: var(--text-on-accent); border-color: var(--danger); }
.ds-btn--danger:hover { background: var(--danger-hi); border-color: var(--danger-hi); }
.ds-btn--sm { min-height: 32px; padding: 0 12px; font-size: var(--text-xs); }
.ds-btn--lg { min-height: 48px; padding: 0 20px; font-size: var(--text-sm); }
.ds-btn--block { width: 100%; }
.ds-btn--icon { width: var(--control-h); padding: 0; }

/* -------------------------------------------------------------------------
   2. CARD
   ------------------------------------------------------------------------- */
.ds-card {
	border: var(--border-w) solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
	overflow: hidden;
}
.ds-card__header {
	padding: 14px 16px;
	border-bottom: var(--border-w) solid var(--border);
	background: var(--surface-2);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
}
.ds-card__body { padding: 16px; }
.ds-card__footer {
	padding: 14px 16px;
	border-top: var(--border-w) solid var(--border);
	background: var(--surface-2);
	display: flex;
	justify-content: flex-end;
	gap: var(--space-2);
}
.ds-card--hover { transition: box-shadow .18s var(--ease-out), border-color .18s var(--ease-out); cursor: pointer; }
.ds-card--hover:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }

/* -------------------------------------------------------------------------
   3. BADGE / TAG
   ------------------------------------------------------------------------- */
.ds-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-height: 22px;
	padding: 0 9px;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	font-size: var(--text-xs);
	font-weight: 700;
	letter-spacing: .01em;
	white-space: nowrap;
}
.ds-badge--brand { background: var(--brand-bg); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 28%, transparent); }
.ds-badge--ok { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 24%, transparent); }
.ds-badge--warn { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 24%, transparent); }
.ds-badge--danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 24%, transparent); }
.ds-badge--info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 24%, transparent); }
.ds-badge--neutral { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

.ds-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 26px;
	padding: 0 10px;
	border: var(--border-w) solid var(--border-hi);
	border-radius: var(--radius-pill);
	background: var(--surface);
	color: var(--text-2);
	font-size: var(--text-xs);
	font-weight: 650;
}
.ds-tag.is-active { background: var(--brand); border-color: var(--brand); color: var(--text-on-accent); }

/* -------------------------------------------------------------------------
   4. MÉTRICA / KPI
   ------------------------------------------------------------------------- */
.ds-metric {
	padding: 16px;
	border: var(--border-w) solid var(--border);
	border-left: 3px solid var(--brand);
	border-radius: var(--radius-md);
	background: var(--surface);
	display: grid;
	gap: 6px;
}
.ds-metric--warning { border-left-color: var(--warning); }
.ds-metric--danger { border-left-color: var(--danger); }
.ds-metric--info { border-left-color: var(--info); }
.ds-metric__label { color: var(--muted); font-size: var(--text-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.ds-metric__value { font-size: var(--text-2xl); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.ds-metric__meta { color: var(--muted); font-size: var(--text-xs); display: flex; align-items: center; gap: 6px; }
.ds-metric__meta--up { color: var(--success); }
.ds-metric__meta--down { color: var(--danger); }

/* -------------------------------------------------------------------------
   5. TABELA
   ------------------------------------------------------------------------- */
.ds-table-wrap {
	overflow-x: auto;
	border: var(--border-w) solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
}
.ds-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: var(--text-sm); }
.ds-table th { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.ds-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.ds-table thead th { background: var(--surface-2); color: var(--text-2); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.ds-table tbody tr:hover { background: var(--hover-bg); }
.ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ds-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------------------
   6. MODAL
   ------------------------------------------------------------------------- */
.ds-modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: var(--z-modal);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(var(--bg-rgb), .6);
	backdrop-filter: blur(var(--backdrop-blur-soft));
}
.ds-modal-backdrop.is-open { display: flex; }
.ds-modal {
	width: min(560px, 100%);
	max-height: min(88vh, 760px);
	max-height: min(88dvh, 760px);
	overflow: auto;
	border: var(--border-w) solid var(--border-hi);
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: var(--shadow-lg);
}
.ds-modal__header {
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	background: var(--surface-2); border-bottom: var(--border-w) solid var(--border); }
.ds-modal__footer {
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--surface-2); border-top: var(--border-w) solid var(--border); justify-content: flex-end; }
.ds-modal__body { padding: 16px; }

/* -------------------------------------------------------------------------
   7. ALERTA
   ------------------------------------------------------------------------- */
.ds-alert {
	display: flex;
	gap: 11px;
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface-2);
	line-height: 1.4;
}
.ds-alert strong { display: block; margin-bottom: 2px; }
.ds-alert--info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 24%, transparent); }
.ds-alert--ok { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 24%, transparent); }
.ds-alert--warn { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 24%, transparent); }
.ds-alert--danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 24%, transparent); }

/* -------------------------------------------------------------------------
   8. CAMPO DE FORMULÁRIO
   ------------------------------------------------------------------------- */
.ds-field { display: grid; gap: 5px; min-width: 0; }
.ds-field > label { font-size: var(--text-xs); font-weight: 700; color: var(--text-2); }
.ds-field .ds-hint { color: var(--muted); font-size: var(--text-xs); }
.ds-field .ds-error { color: var(--danger); font-size: var(--text-xs); display: none; }
.ds-field.is-invalid .ds-error { display: block; }
.ds-input {
	width: 100%;
	min-height: var(--control-h);
	padding: 9px 11px;
	border: var(--border-w) solid var(--border-hi);
	border-radius: var(--radius-md);
	background: var(--control-bg);
	color: var(--text);
	font: inherit;
	transition: border-color .14s var(--ease-out), box-shadow .14s var(--ease-out);
}
.ds-select {
	width: 100%;
	min-height: var(--control-h);
	padding: 9px 11px;
	border: var(--border-w) solid var(--border-hi);
	border-radius: var(--radius-md);
	background: var(--control-bg);
	color: var(--text);
	font: inherit;
	transition: border-color .14s var(--ease-out), box-shadow .14s var(--ease-out);
}
.ds-textarea {
	width: 100%;
	padding: 9px 11px;
	border: var(--border-w) solid var(--border-hi);
	border-radius: var(--radius-md);
	background: var(--control-bg);
	color: var(--text);
	font: inherit;
	transition: border-color .14s var(--ease-out), box-shadow .14s var(--ease-out); min-height: 92px; resize: vertical; }
.ds-input:focus { outline: 0; border-color: var(--brand); box-shadow: var(--focus-ring); }
.ds-select:focus { outline: 0; border-color: var(--brand); box-shadow: var(--focus-ring); }
.ds-textarea:focus { outline: 0; border-color: var(--brand); box-shadow: var(--focus-ring); }
.ds-field.is-invalid :is(.ds-input, .ds-select, .ds-textarea) { border-color: var(--danger); }

/* -------------------------------------------------------------------------
   9. ABAS / SEGMENTADO
   ------------------------------------------------------------------------- */
.ds-tabs { display: flex; gap: var(--space-4); border-bottom: var(--border-w) solid var(--border); overflow-x: auto; }
.ds-tab {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 10px 2px;
	margin-bottom: -1px;
	border-bottom: 2px solid transparent;
	color: var(--muted);
	font-size: var(--text-sm);
	font-weight: 650;
	white-space: nowrap;
}
.ds-tab:hover { color: var(--text); }
.ds-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.ds-segmented {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface-2);
}
.ds-segmented button {
	min-height: 30px;
	padding: 0 12px;
	border-radius: var(--radius-sm);
	color: var(--muted);
	font-weight: 650;
	font-size: var(--text-xs);
}
.ds-segmented button.is-active { background: var(--brand); color: var(--text-on-accent); }

/* -------------------------------------------------------------------------
   10. ESTADO VAZIO
   ------------------------------------------------------------------------- */
.ds-empty {
	display: grid;
	place-items: center;
	gap: 8px;
	min-height: 160px;
	padding: 24px;
	border: 1px dashed var(--border-hi);
	border-radius: var(--radius-md);
	background: var(--surface-2);
	text-align: center;
	color: var(--muted);
}
.ds-empty strong { color: var(--text); font-size: var(--text-sm); }

/* -------------------------------------------------------------------------
   11. ACORDEÃO (details/summary nativo)
   ------------------------------------------------------------------------- */
.ds-accordion { border: var(--border-w) solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.ds-accordion summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 44px;
	padding: 0 14px;
	font-weight: 650;
	color: var(--text);
}
.ds-accordion summary::-webkit-details-marker { display: none; }
.ds-accordion summary::after { content: "+"; color: var(--muted); font-size: var(--text-lg); }
.ds-accordion[open] summary { border-bottom: 1px solid var(--border); background: var(--surface-2); }
.ds-accordion[open] summary::after { content: "\2212"; }
.ds-accordion__body { padding: 14px; color: var(--text-2); line-height: 1.5; }

/* ==========================================================================
   NEO-BRUTALISTA — camada aplicada só aos componentes .ds-*
   Raio zero (já garantido pelos tokens), borda espessa em tinta sólida,
   sombra dura sem blur, tipografia pesada em caixa alta nos rótulos de
   ação, efeito de "pressionar" no botão (sombra recolhe no clique).
   ========================================================================== */
html.design-brutalist .ds-card {
	box-shadow: var(--shadow-sm);
}
html.design-brutalist .ds-metric {
	box-shadow: var(--shadow-sm);
}
html.design-brutalist .ds-table-wrap {
	box-shadow: var(--shadow-sm);
}
html.design-brutalist .ds-alert {
	box-shadow: var(--shadow-sm);
}
html.design-brutalist .ds-empty {
	box-shadow: var(--shadow-sm);
}
html.design-brutalist .ds-accordion {
	box-shadow: var(--shadow-sm);
}
html.design-brutalist .ds-modal { box-shadow: var(--shadow-lg); }
html.design-brutalist .ds-card--hover:hover { box-shadow: var(--shadow-md); transform: translate(-2px, -2px); }
html.design-brutalist .ds-accordion:hover { box-shadow: var(--shadow-md); transform: translate(-2px, -2px); }

html.design-brutalist .ds-btn {
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
	box-shadow: var(--shadow-sm);
	transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), background .12s var(--ease-out);
}

html.design-brutalist .ds-tag {
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
	box-shadow: var(--shadow-sm);
	transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), background .12s var(--ease-out);
}

html.design-brutalist .ds-segmented button.is-active {
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
	box-shadow: var(--shadow-sm);
	transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), background .12s var(--ease-out);
}
html.design-brutalist .ds-btn:hover { box-shadow: var(--shadow-md); transform: translate(-2px, -2px); }
html.design-brutalist .ds-tag:hover { box-shadow: var(--shadow-md); transform: translate(-2px, -2px); }
html.design-brutalist .ds-btn:active { box-shadow: none; transform: translate(3px, 3px); }
html.design-brutalist .ds-btn--ghost { box-shadow: none; }
html.design-brutalist .ds-btn--ghost:hover { box-shadow: none; transform: none; background: var(--hover-bg); }

html.design-brutalist .ds-badge { font-weight: 800; letter-spacing: .03em; }

html.design-brutalist h1 {
	font-weight: 800;
	letter-spacing: -.01em;
	text-transform: uppercase;
}

html.design-brutalist h2 {
	font-weight: 800;
	letter-spacing: -.01em;
	text-transform: uppercase;
}

html.design-brutalist h3 {
	font-weight: 800;
	letter-spacing: -.01em;
	text-transform: uppercase;
}

html.design-brutalist h4 {
	font-weight: 800;
	letter-spacing: -.01em;
	text-transform: uppercase;
}

/* ==========================================================================
   RETROFIT DE ALCANCE AMPLO — mesma geometria aplicada aos componentes já
   existentes no app (nomes próprios por página: .panel-card, .admin-card,
   .observatory-kpi, .feiras-tab-pill, .official-modal, .app-dialog, ...).
   Seletor de atributo por substring evita ter que enumerar/renomear cada
   um dos ~40 templates; !important é necessário e deliberado aqui, pois é
   uma camada de tema que precisa vencer o CSS específico de cada página.
   Cobre botão/chip, cartão/painel, badge/pill, KPI, aba, tabela e modal —
   os mesmos sete grupos de componente mapeados no design-system.css acima.
   ========================================================================== */

.report-trigger{margin-left:auto}.report-trigger img{width:1.25rem;height:1.25rem;vertical-align:middle;margin-right:.35rem}.report-dialog{width:min(34rem,calc(100vw - 2rem));border:0;border-radius:var(--radius-sm);padding:0}.report-dialog::backdrop{background:rgba(0,0,0,.42)}.report-dialog form{padding:1.25rem}.report-dialog header{display:flex;align-items:center;justify-content:space-between;gap:.75rem}.report-dialog footer{display:flex;align-items:center;justify-content:space-between;gap:.75rem}.report-dialog fieldset{display:grid;gap:.5rem;margin:1rem 0;border:1px solid var(--border);padding:.75rem}.report-dialog select{display:block;width:100%;margin-top:.35rem}.report-dialog__error{color:var(--danger);margin:.75rem 0}@media(max-width:640px){.report-trigger{margin:0}.report-dialog{width:calc(100vw - 1rem)}}

}

@layer themes {
  .ds-metric { border-left:var(--border-w) solid var(--border); padding:var(--space-4); gap:var(--space-2); }
  .ds-metric :is(label,.ds-metric__label) { font-size:var(--text-xs); color:var(--muted); }
  .ds-metric :is(strong,.ds-metric__value) { font-size:var(--text-2xl); font-variant-numeric:tabular-nums; line-height:1.15; }
  .ds-metric :is(small,.ds-metric__meta) { font-size:var(--text-xs); line-height:1.5; color:var(--muted); }
  .ds-metric-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr)); gap:var(--space-4); }
  .ds-tab { display:inline-flex; justify-content:center; align-items:center; min-height:var(--control-h); padding:var(--space-2) var(--space-4); border:var(--border-w) solid var(--border); border-radius:var(--radius-md); color:var(--text-2); background:var(--surface); font:inherit; cursor:pointer; }
  .ds-tab:is(.is-active,[aria-selected="true"],[aria-current="page"]) { color:var(--on-brand); background:var(--brand); border-color:var(--brand); }
  .ds-tab:disabled { opacity:.5; cursor:not-allowed; }
  .ds-tabs { display:flex; flex-wrap:wrap; gap:var(--space-2); }
  .ds-filters { display:flex; flex-wrap:wrap; align-items:end; gap:var(--space-3); padding:var(--space-4); border:var(--border-w) solid var(--border); border-radius:var(--radius-md); background:var(--surface); }
  .ds-filters label { display:grid; gap:var(--space-1); min-width:0; color:var(--text-2); }
  .ds-filter-summary { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2); margin-block:var(--space-3); }
  .ds-filter-summary:empty { display:none; }
  .ds-filter-chip { display:inline-flex; align-items:center; gap:var(--space-2); min-height:var(--control-h); padding:var(--space-2); border:var(--border-w) solid var(--border); border-radius:var(--radius-pill); background:var(--surface-2); }
  .ds-table { font-size:var(--text-sm); font-variant-numeric:tabular-nums; }
  .ds-table :is(td,th) { padding:var(--space-3); }
  .ds-table th { position:sticky; top:0; z-index:var(--z-local); font-size:var(--text-xs); }
  .ds-table [aria-sort] { text-decoration:underline; text-underline-offset:.25em; }
  .ds-table .num { text-align:right; }
  .ds-table--compact :is(td,th) { padding:var(--space-2); }
  .ds-table-wrap { max-width:100%; overflow:auto; }
  .ds-empty { color:var(--muted); background:var(--surface-2); padding:var(--space-6); }
  .ds-error-state { padding:var(--space-4); color:var(--danger); background:var(--danger-bg); border:var(--border-w) solid var(--danger); border-radius:var(--radius-md); }
  .ds-skeleton { min-height:var(--control-h); border-radius:var(--radius-sm); background:var(--skeleton); }
  .ds-metric.is-loading { opacity:.6; }
  .ds-metric.is-loading .ds-metric__value { color:transparent; background:var(--skeleton); }
  html.design-brutalist :is(.ds-card,.ds-metric,.ds-table-wrap,.ds-tab,.ds-filters,.ds-empty) { border-width:var(--border-w); border-color:var(--border-hi); box-shadow:var(--shadow-sm); }
  html.design-brutalist :is(.ds-tab,.ds-btn,.ds-tag) { font-weight:800; }
  :is(.search-modal,.ui-settings-modal,.weather-modal-shell,.official-modal-overlay,.ds-modal-backdrop) { z-index:var(--z-modal); }
  .flash-stack--global { z-index:var(--z-toast); }
  /* Focus must survive page rules and editable surfaces; accessibility exception. */
  /* stylelint-disable declaration-no-important -- Preserve hidden state, keyboard focus, reduced motion or print against inline styles. */
  :is(button,a,input,select,textarea,summary,[tabindex],[contenteditable]):focus-visible { outline:2px solid var(--focus) !important; outline-offset:3px; }
  /* stylelint-enable declaration-no-important */
  @media (max-width:640px) {
    .ds-filters { display:grid; grid-template-columns:minmax(0,1fr); }
    .ds-filters :is(input,select,textarea) { width:100%; min-height:var(--control-h); font-size:var(--text-md); }
    .ds-tab { min-height:var(--control-h); }
    .ds-btn--sm { min-height:var(--control-h); }
  }
  @media (prefers-reduced-motion:no-preference) {
    html.theme-transition :is(body,.ds-card,.ds-metric,.ds-tab,.ds-filters,.app-topbar,.app-sidebar) { transition:background-color .2s, color .2s, border-color .2s; }
    .ds-skeleton { animation:ds-pulse 1.5s ease-in-out infinite alternate; }
    @keyframes ds-pulse { to { opacity:.5; } }
  }
  @media print {
    /* Print intentionally overrides active dark/profile variables and inline map colours. */
    /* stylelint-disable declaration-no-important -- Preserve hidden state, keyboard focus, reduced motion or print against inline styles. */
    html { color-scheme:light; --bg:white !important; --surface:white !important; --surface-2:white !important; --text:black !important; --text-2:black !important; --muted:black !important; }
    /* stylelint-enable declaration-no-important */
    /* stylelint-disable declaration-no-important -- Preserve hidden state, keyboard focus, reduced motion or print against inline styles. */
    body { background:var(--bg) !important; color:var(--text) !important; }
    /* stylelint-enable declaration-no-important */
    /* stylelint-disable declaration-no-important -- Preserve hidden state, keyboard focus, reduced motion or print against inline styles. */
    .app-sidebar { display:none !important; }
    /* stylelint-enable declaration-no-important */
    /* stylelint-disable declaration-no-important -- Preserve hidden state, keyboard focus, reduced motion or print against inline styles. */
    .app-topbar { display:none !important; }
    /* stylelint-enable declaration-no-important */
    /* stylelint-disable declaration-no-important -- Preserve hidden state, keyboard focus, reduced motion or print against inline styles. */
    .ds-filters { display:none !important; }
    /* stylelint-enable declaration-no-important */
    /* stylelint-disable declaration-no-important -- Preserve hidden state, keyboard focus, reduced motion or print against inline styles. */
    .ds-filter-summary { display:none !important; }
    /* stylelint-enable declaration-no-important */
    /* stylelint-disable declaration-no-important -- Preserve hidden state, keyboard focus, reduced motion or print against inline styles. */
    .ds-tooltip { display:none !important; }
    /* stylelint-enable declaration-no-important */
    .ds-table-wrap { overflow:visible; }
  }
}
@layer themes { @media (min-width:961px) { form.ds-filters { position:sticky; top:var(--topbar-height); z-index:var(--z-sticky); } } }
