:root {
    --brand-900: #0f2f63;
    --brand-700: #1b4f9f;
    --brand-600: #2563c7;
    --brand-500: #2f7be5;
    --brand-100: #eef4ff;
    --surface-0: #ffffff;
    --surface-1: #f4f7fc;
    --surface-2: #eaf0fa;
    --surface-3: #e0e9f7;
    --text-900: #16233a;
    --text-700: #445675;
    --text-600: #5f7292;
    --text-500: #7487a7;
    --success: #1f9254;
    --danger: #c73737;
    --warning: #d49b16;
    --info: #0f7faa;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-sm: 0 8px 22px rgba(22, 43, 79, 0.08);
    --shadow-md: 0 16px 34px rgba(18, 45, 87, 0.14);
    --shadow-lg: 0 26px 54px rgba(15, 35, 71, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    font-family: "Trebuchet MS", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-900);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 199, 0.14), transparent 30%),
        radial-gradient(circle at top right, rgba(15, 47, 99, 0.1), transparent 24%),
        linear-gradient(180deg, #f4f8ff 0, #ffffff 18rem);
}

a {
    color: var(--brand-600);
    text-decoration: none;
}

a:hover {
    color: var(--brand-700);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    line-height: 1.15;
    color: var(--text-900);
}

h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(1.5rem, 2.4vw, 2.15rem);
    letter-spacing: -0.02em;
}

h3 {
    font-size: clamp(1.2rem, 1.9vw, 1.55rem);
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

main.container {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(216, 227, 245, 0.96);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

#main-content {
    min-height: 60vh;
}

.site-shell {
    min-height: 100vh;
}

.site-header {
    position: relative;
    z-index: 40;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 1200;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--text-900);
    color: #fff;
}

.skip-link:focus {
    top: 1rem;
}

.gtm-noscript {
    display: none;
    visibility: hidden;
}

.container,
.container-fluid {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.container {
    max-width: 1120px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.row > [class*="col"],
.row > .col-sm,
.row > .col-md-3,
.row > .col-md-4,
.row > .col-md-5,
.row > .col-md-6,
.row > .col-md-8,
.row > .col-md-12,
.row > .col-lg-4,
.row > .col-lg-6,
.row > .col-lg-8,
.row > .col-lg-10,
.row > .col-5,
.row > .col-6,
.row > .col-7 {
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.col-5 { width: 41.6667%; }
.col-6 { width: 50%; }
.col-7 { width: 58.3333%; }

@media (min-width: 576px) {
    .col-sm {
        flex: 1 1 0;
        width: auto;
    }
}

@media (min-width: 768px) {
    .col-md-12 { width: 100%; }
    .col-md-8 { width: 66.6667%; }
    .col-md-6 { width: 50%; }
    .col-md-5 { width: 41.6667%; }
    .col-md-4 { width: 33.3333%; }
    .col-md-3 { width: 25%; }
}

@media (min-width: 992px) {
    .col-lg-10 { width: 83.3333%; }
    .col-lg-8 { width: 66.6667%; }
    .col-lg-6 { width: 50%; }
    .col-lg-4 { width: 33.3333%; }
}

.navbar {
    position: relative;
    z-index: 50;
    background: linear-gradient(135deg, #0d2954, #1c519f);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 30px rgba(12, 34, 69, 0.22);
}

.sticky-top {
    position: sticky;
    top: 0;
}

.navbar-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 72px;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: #fff;
    font-weight: 700;
}

.navbar-brand:hover {
    color: #fff;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.brand-copy strong {
    font-size: 1rem;
}

.brand-copy small {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.77rem;
}

.navbar-toggler {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    background: transparent;
    color: #fff;
}

.navbar-toggler-icon::before {
    content: "\2630";
    font-size: 1.35rem;
    line-height: 1;
}

.navbar-collapse,
.collapse {
    display: none;
}

.navbar-collapse.show,
.collapse.show,
.show {
    display: block;
}

.navbar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0.9rem 0 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.72rem 0.95rem;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

@media (min-width: 992px) {
    .navbar-expand-lg .navbar-toggler {
        display: none;
    }

    .navbar-expand-lg .navbar-collapse {
        display: flex !important;
        justify-content: flex-end;
        width: auto;
    }

    .navbar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        margin-top: 0;
    }
}

.footer {
    background: linear-gradient(180deg, #f5f8ff, #ecf2fb);
    border-top: 1px solid #dbe6f5;
}

.footer-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto auto;
    gap: 1rem 1.5rem;
    align-items: center;
    min-height: 96px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.footer-links,
.footer-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-700);
    font-weight: 600;
}

.footer-meta {
    justify-content: flex-end;
}

.footer-social a {
    transition: transform 0.15s ease;
}

.footer-social a:hover {
    transform: translateY(-1px);
}

.page-hero {
    margin-bottom: 1.5rem;
}

.page-hero--home {
    margin-bottom: 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 1.5rem;
    align-items: stretch;
}

.hero-copy,
.hero-panel,
.page-intro,
.surface-panel,
.content-card,
.qr-form-container,
.qr-result-container,
.resultado-container,
.resultado-box {
    border: 1px solid rgba(221, 231, 246, 0.98);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.hero-copy {
    padding: 2rem;
    background:
        linear-gradient(135deg, rgba(15, 47, 99, 0.95), rgba(37, 99, 199, 0.86)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
    color: #fff;
}

.hero-copy h1,
.hero-copy .lead,
.hero-copy a,
.hero-copy li {
    color: inherit;
}

.hero-copy .lead {
    max-width: 40rem;
    color: rgba(255, 255, 255, 0.88);
}

.hero-panel {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.surface-panel {
    padding: 1.5rem;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.surface-panel--search {
    height: 100%;
}

.page-intro {
    padding: 1.5rem;
}

.eyebrow,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand-600);
}

.section-heading {
    margin-bottom: 1.1rem;
}

.section-heading--center {
    text-align: center;
}

.content-section {
    margin-bottom: 1.5rem;
}

.tool-grid,
.info-grid,
.calculator-grid {
    display: grid;
    gap: 1rem;
}

.tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calculator-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-card {
    padding: 1.35rem;
}

.stat-list {
    display: grid;
    gap: 0.7rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid #e3ebf8;
    border-radius: var(--radius-md);
    background: #f8fbff;
}

.hero-actions,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-list,
.info-list {
    display: grid;
    gap: 0.55rem;
}

.hero-list li,
.info-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    color: var(--text-700);
}

.hero-copy .hero-list li {
    color: rgba(255, 255, 255, 0.88);
}

.info-list--columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prose,
.prose p,
.prose li {
    color: var(--text-700);
}

.prose-list {
    margin: 0 0 1rem 1.1rem;
    padding: 0;
}

.card {
    background: var(--surface-0);
    border: 1px solid #e2eaf7;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e5ecf8;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    background: var(--surface-1);
}

.card-body {
    padding: 1.1rem;
}

.card-footer {
    padding: 0.9rem 1rem;
    border-top: 1px solid #e8edf7;
    background: #fbfdff;
}

.feature-card {
    height: 100%;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-card--accent::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-600), #73b0ff);
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem 0;
    font-weight: 700;
}

.feature-header h2 {
    margin-bottom: 0;
    font-size: 1.2rem;
}

.feature-header i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: var(--brand-100);
    color: var(--brand-600);
}

.icon-box {
    width: 62px;
    height: 62px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    color: var(--brand-600);
    background: #eaf2ff;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus,
.form-control:focus,
.form-select:focus,
.btn-check:focus + .btn {
    outline: none;
    box-shadow: 0 0 0 0.24rem rgba(47, 123, 229, 0.24);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
    box-shadow: 0 10px 20px rgba(37, 99, 199, 0.22);
}

.btn-secondary {
    color: #fff;
    background: linear-gradient(135deg, #30435d, #496484);
}

.btn-success { color: #fff; background: var(--success); }
.btn-danger { color: #fff; background: var(--danger); }

.btn-link {
    background: transparent;
    color: var(--brand-600);
    padding-left: 0;
    padding-right: 0;
}

.btn-outline-primary {
    color: var(--brand-600);
    border-color: #bdd2f8;
    background: #fff;
}

.btn-outline-secondary {
    color: #516178;
    border-color: #c9d4e9;
    background: #fff;
}

.btn-sm {
    min-height: 38px;
    padding: 0.45rem 0.8rem;
    font-size: 0.875rem;
}

.btn-lg {
    min-height: 54px;
    padding: 0.9rem 1.15rem;
    font-size: 1.02rem;
}

.form-label {
    display: inline-block;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.form-control,
.form-select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #cfdcf1;
    border-radius: 12px;
    background: #fff;
    color: var(--text-900);
    padding: 0.7rem 0.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:hover,
.form-select:hover {
    border-color: #b7cceb;
}

.form-control-lg,
.input-group-lg .form-control,
.input-group-lg .form-select {
    min-height: 56px;
    font-size: 1.04rem;
}

.form-text {
    color: var(--text-600);
    font-size: 0.88rem;
}

.form-message {
    display: block;
    min-height: 1.1rem;
    margin-bottom: 0.5rem;
}

.is-valid {
    border-color: #59be85 !important;
}

.is-invalid {
    border-color: #d75b5b !important;
}

.invalid-feedback {
    color: #b12d2d;
    font-size: 0.84rem;
    margin-top: 0.3rem;
}

.input-group {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.input-group > .form-control,
.input-group > .form-select {
    flex: 1 1 auto;
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .btn,
.input-group > .input-group-text {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group-text {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 0.85rem;
    border: 1px solid #cfdcf1;
    background: #f3f7ff;
    color: var(--text-700);
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table th,
.table td {
    padding: 0.8rem 0.9rem;
    border: 1px solid #e2ebf8;
    vertical-align: top;
}

.table thead th {
    background: #eef4ff;
    font-weight: 700;
}

.table-striped tbody tr:nth-child(odd) {
    background: #fafcff;
}

.table-hover tbody tr:hover {
    background: #f0f6ff;
}

.list-group {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.list-group-item {
    display: block;
    border: 1px solid #e4ebf7;
    padding: 0.85rem 1rem;
    color: var(--text-900);
    background: #fff;
}

.list-group-item + .list-group-item {
    border-top: 0;
}

.list-group-item-action:hover {
    background: #f3f7ff;
}

.list-group-flush .list-group-item {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
}

.search-result-link {
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.search-result-link:hover {
    transform: translateX(2px);
}

.result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    margin-right: 0.8rem;
    border-radius: 999px;
    background: var(--brand-100);
    color: var(--brand-600);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.3rem 0.62rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.alert {
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
}

.alert-info { background: #eef8ff; border-color: #cae8fb; color: #155b76; }
.alert-success { background: #edf9f2; border-color: #caedda; color: #1f6d43; }
.alert-warning { background: #fff7e8; border-color: #f6e1b8; color: #87610e; }
.alert-danger { background: #fff1f1; border-color: #f3cccc; color: #8e2d2d; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    margin: 0 0 1.2rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e3ebf8;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #8ea2c4;
    margin-right: 0.35rem;
}

.breadcrumb-item.active {
    color: var(--text-600);
}

.page-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.page-navigation__label {
    font-weight: 700;
    color: var(--text-700);
}

.toast-container {
    z-index: 1100;
}

.toast {
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-body {
    padding: 0.8rem 0.95rem;
    font-weight: 500;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
    overflow-y: auto;
    background: rgba(12, 23, 42, 0.55);
    padding: 1rem;
}

.modal.show {
    display: block;
}

.modal-dialog {
    width: 100%;
    max-width: 560px;
    margin: 3vh auto;
}

.modal-content {
    border-radius: var(--radius-md);
    border: 1px solid #d8e4f8;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.modal-header,
.modal-body,
.modal-footer {
    padding: 1rem;
}

.modal-header {
    border-bottom: 1px solid #e5ecf8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-footer {
    border-top: 1px solid #e5ecf8;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 8px;
    cursor: pointer;
}

.btn-close::before {
    content: "\00D7";
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

.btn-close-white { color: #fff; }

.tooltip {
    z-index: 1090;
    background: #19253a;
    color: #fff;
    border-radius: 8px;
    font-size: 0.78rem;
    max-width: 240px;
}

.tooltip-inner {
    padding: 0.45rem 0.55rem;
}

.popover {
    z-index: 1090;
    background: #fff;
    border: 1px solid #dce7f7;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    min-width: 210px;
}

.popover-header {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid #e6ecf8;
    font-weight: 700;
}

.popover-body {
    padding: 0.6rem 0.7rem;
    color: var(--text-700);
}

.fade {
    transition: opacity 0.2s ease;
}

.fade-in {
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.spinner-border-sm {
    width: 0.82rem;
    height: 0.82rem;
    border-width: 0.13em;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.qr-form-container,
.qr-result-container {
    padding: 1.25rem;
}

.qr-input-group,
.qr-select-group {
    margin-bottom: 0.85rem;
}

.qr-input,
.qr-select {
    width: 100%;
}

.qr-preview-frame {
    max-width: 400px;
    margin: 0 auto 1rem;
    overflow: hidden;
}

.qr-option-button,
.qr-button {
    min-width: 150px;
}

.resultado-container {
    display: none;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.resultado-box {
    padding: 1rem;
}

.resultado-item {
    border-bottom: 1px solid #ebf0f9;
    padding: 0.6rem 0;
}

.resultado-item:last-child {
    border-bottom: 0;
}

.resultado-label {
    color: var(--text-600);
    font-weight: 600;
}

.resultado-valor {
    color: var(--text-900);
    font-weight: 700;
}

.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1120;
}

.cookie-banner__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid #d6e3f7;
    border-radius: 18px;
    background: rgba(247, 250, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.cookie-banner__text {
    max-width: 48rem;
}

.cookie-banner__text strong {
    display: block;
    margin-bottom: 0.25rem;
}

.cookie-consent-button {
    flex-shrink: 0;
}

.map-card,
.table-card {
    overflow: hidden;
}

.map-embed {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.map-frame {
    display: block;
    width: 100%;
    min-height: 420px;
    border: 0;
}

.nif-page {
    display: grid;
    gap: 1rem;
}

.nif-hero-card {
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(47, 123, 229, 0.16), transparent 32%),
        linear-gradient(180deg, #ffffff, #f7fbff);
}

.nif-hero-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.nif-hero-title {
    margin-bottom: 0;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.nif-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}

.nif-status-badge {
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid #d8e4f8;
    background: #f6f9ff;
    color: var(--text-700);
    font-size: 0.82rem;
}

.nif-status-badge--valid {
    border-color: #cbe8d8;
    background: #eefaf3;
    color: #1e7b49;
}

.nif-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.nif-section-head--stack {
    margin-bottom: 1.25rem;
}

.nif-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.nif-sidebar {
    display: grid;
    gap: 1rem;
}

.nif-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin: 0;
}

.nif-summary-item {
    padding: 1rem;
    border: 1px solid #dde8f8;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.nif-summary-item dt {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-600);
}

.nif-summary-item dd {
    margin: 0;
    color: var(--text-900);
    font-weight: 700;
}

.map-embed--compact {
    border-radius: 0;
}

.map-frame--compact {
    min-height: 320px;
}

.nif-links-list .list-group-item {
    padding: 0;
}

.nif-link-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.9rem 0;
    color: var(--text-900);
}

.nif-link-item span {
    flex: 1 1 auto;
}

.nif-link-item:hover {
    color: var(--brand-700);
}

.nif-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.nif-tag-chip {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid #deebf8;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.nif-tag-chip--featured {
    border-color: #bfd5fa;
    background: linear-gradient(180deg, #ffffff, #f1f7ff);
}

.nif-tag-chip__text {
    font-weight: 700;
    color: var(--text-900);
}

.nif-tag-chip__votes {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.nif-vote-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 36px;
    padding: 0.45rem 0.7rem;
    border: 1px solid #d6e3f7;
    border-radius: 999px;
    background: #fff;
    color: var(--text-700);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.nif-vote-button:hover {
    transform: translateY(-1px);
}

.nif-vote-button--up:hover {
    color: var(--success);
    border-color: rgba(31, 146, 84, 0.35);
    background: rgba(31, 146, 84, 0.06);
}

.nif-vote-button--down:hover {
    color: var(--danger);
    border-color: rgba(199, 55, 55, 0.35);
    background: rgba(199, 55, 55, 0.06);
}

.nif-vote-button:disabled {
    opacity: 0.75;
    cursor: wait;
}

.nif-tag-chip--pulse {
    animation: nifTagPulse 0.32s ease;
}

@keyframes nifTagPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.025); }
    100% { transform: scale(1); }
}

.nif-record-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.nif-record-link {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1rem 1.1rem;
    border: 1px solid #dce8f8;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f6faff);
    box-shadow: var(--shadow-sm);
    color: var(--text-900);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.nif-record-link:hover {
    transform: translateY(-2px);
    border-color: #bfd5fa;
    box-shadow: var(--shadow-md);
    color: var(--text-900);
}

.nif-record-link--next {
    text-align: right;
}

.nif-record-link__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-600);
}

.nif-record-link strong {
    font-size: 1.12rem;
}

.district-emblem {
    width: 140px;
    max-width: 100%;
    margin: 0 auto 1rem;
}

.adsbygoogle-block {
    display: block;
}

.adsense-container--hidden {
    display: none;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 220px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #e1e9f7;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.empty-state i {
    font-size: 2rem;
}

.ratio {
    position: relative;
    width: 100%;
    display: block;
}

.ratio::before {
    content: "";
    display: block;
}

.ratio > img,
.ratio > iframe,
.ratio > video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ratio--16-9::before { padding-top: 56.25%; }
.ratio--4-3::before { padding-top: 75%; }
.ratio--1-1::before { padding-top: 100%; }

.inline-icon-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.inline-favicon {
    display: inline-block;
    vertical-align: middle;
}

.search-shell,
.search-card,
.stack,
.stack-sm {
    width: 100%;
}

.stack {
    display: grid;
    gap: 0.85rem;
}

.stack-sm {
    display: grid;
    gap: 0.5rem;
}

.article {
    margin-bottom: 1rem;
}

blockquote {
    margin: 0.8rem 0;
    padding: 0.8rem 1rem;
    border-left: 4px solid #b8cef2;
    background: #f5f9ff;
    color: var(--text-700);
}

.shadow-none { box-shadow: none !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.border { border: 1px solid #dfe8f7 !important; }
.border-0 { border: 0 !important; }
.border-1 { border: 1px solid #dfe8f7 !important; }
.border-light { border-color: #e8eef9 !important; }
.border-bottom { border-bottom: 1px solid #e3ebf8 !important; }
.border-top-0 { border-top: 0 !important; }

.rounded { border-radius: 8px !important; }
.rounded-3 { border-radius: var(--radius-md) !important; }
.rounded-pill { border-radius: 999px !important; }
.overflow-hidden { overflow: hidden !important; }

.position-fixed { position: fixed !important; }
.bottom-0 { bottom: 0 !important; }
.end-0 { right: 0 !important; }

.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-none { display: none !important; }

.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }

@media (min-width: 768px) {
    .justify-content-md-center { justify-content: center !important; }
}

.flex-column { flex-direction: column !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.g-3 { row-gap: 1rem !important; }
.g-4 { row-gap: 1.4rem !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.min-vh-100 { min-height: 100vh !important; }

.m-0 { margin: 0 !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mx-1 { margin-left: 0.25rem !important; margin-right: 0.25rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-auto { margin-top: auto !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.35rem !important; }
.mb-2 { margin-bottom: 0.65rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.45rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-auto { margin-right: auto !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-auto { margin-left: auto !important; }

.p-0 { padding: 0 !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.35rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.35rem !important; padding-bottom: 1.35rem !important; }
.py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }

.fw-light { font-weight: 300 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }

.display-4 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
}

.h4 { font-size: 1.45rem; font-weight: 600; }
.h5 { font-size: 1.2rem; font-weight: 600; }
.h6 { font-size: 1rem; font-weight: 600; }

.lead {
    font-size: 1.08rem;
    color: var(--text-700);
}

.small,
small {
    font-size: 0.86rem;
}

.opacity-50 { opacity: 0.5 !important; }

.bg-success { background-color: var(--success) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-info { background-color: var(--info) !important; }
.bg-primary { background-color: var(--brand-600) !important; }
.bg-secondary { background-color: #576985 !important; }
.bg-light { background-color: var(--surface-1) !important; }
.bg-white { background-color: #fff !important; }
.bg-primary-light { background-color: var(--brand-100) !important; }

.text-white { color: #fff !important; }
.text-dark { color: var(--text-900) !important; }
.text-primary { color: var(--brand-600) !important; }
.text-secondary { color: var(--text-700) !important; }
.text-muted { color: var(--text-600) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: #b27e09 !important; }
.text-center { text-align: center !important; }
.text-decoration-none { text-decoration: none !important; }

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

.btn-group {
    display: inline-flex;
    gap: 0.3rem;
}

.btn-check {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
}

.form-check-label {
    color: var(--text-700);
}

.list-unstyled {
    list-style: none;
    margin: 0;
    padding: 0;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-thumbnail {
    padding: 0.2rem;
    border: 1px solid #d6e0f1;
    border-radius: 8px;
    background: #fff;
}

.search-form {
    width: 100%;
}

.search-input-group {
    display: flex;
    align-items: stretch;
    border: 1px solid #d2dff4;
    border-radius: 12px;
    background: #fff;
}

.search-input {
    flex: 1 1 auto;
    border: 0;
    padding: 0.75rem 0.9rem;
    font-size: 1rem;
    border-radius: 12px 0 0 12px;
}

.search-input:focus {
    outline: none;
}

.search-suggestions {
    display: none;
}

@media (max-width: 991px) {
    .hero-grid,
    .tool-grid,
    .info-grid,
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .nif-top-grid,
    .nif-record-nav {
        grid-template-columns: 1fr;
    }

    .nif-hero-head {
        flex-direction: column;
    }

    .nif-hero-badges {
        justify-content: flex-start;
    }

    .nif-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    main.container {
        margin-top: 0.7rem;
        padding: 1rem;
    }

    .card-body {
        padding: 0.95rem;
    }

    .hero-copy,
    .page-intro,
    .surface-panel,
    .content-card,
    .qr-form-container,
    .qr-result-container {
        padding: 1.1rem;
    }

    .button-row,
    .hero-actions,
    .cookie-banner__content,
    .page-navigation {
        flex-direction: column;
        align-items: stretch;
    }

    .button-row .btn,
    .hero-actions .btn,
    .page-navigation .btn,
    .cookie-banner__content .btn {
        width: 100%;
    }

    .input-group {
        flex-wrap: wrap;
    }

    .input-group > .form-control,
    .input-group > .form-select,
    .input-group > .btn,
    .input-group > .input-group-text {
        width: 100%;
        border-radius: 12px;
    }

    .info-list--columns {
        grid-template-columns: 1fr;
    }

    .col-5,
    .col-6,
    .col-7 {
        width: 100%;
    }

    .nif-section-head,
    .nif-tag-chip,
    .nif-record-link__meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .nif-tag-chip {
        width: 100%;
    }

    .nif-tag-chip__votes {
        width: 100%;
        justify-content: flex-start;
    }

    .nif-record-link--next {
        text-align: left;
    }

    .map-frame--compact {
        min-height: 260px;
    }
}
