:root {
  --font-scale: 1;
  --bg: #f6f8fb;
  --bg-strong: #edf2f7;
  --surface: #ffffff;
  --surface-muted: #f3f6fa;
  --surface-soft: #f8fafc;
  --text: #1b2430;
  --text-muted: #5b6776;
  --border: #e3e8ef;
  --border-strong: #cfd8e3;
  --primary: #0f4593;
  --primary-strong: #0b3879;
  --secondary: #0d7a92;
  --accent: #0cb2cc;
  --olive: #7baa66;
  --gold: #c6985c;
  --primary-contrast: #ffffff;
  --focus: #0cb2cc;
  --shadow-soft: 0 16px 36px rgba(15, 69, 147, 0.08);
  --shadow-subtle: 0 8px 24px rgba(15, 69, 147, 0.06);
  --radius-card: 24px;
  --radius-pill: 999px;
  --radius-soft: 18px;
  --decor-icon-size: 128px;
}

html[data-theme="dark"] {
  --bg: #0e1721;
  --bg-strong: #111e2b;
  --surface: #172433;
  --surface-muted: #1d2d3d;
  --surface-soft: #15212d;
  --text: #edf2f7;
  --text-muted: #b8c4d1;
  --border: #294053;
  --border-strong: #355169;
  --primary: #68a5f2;
  --primary-strong: #4e93e6;
  --secondary: #54b0c1;
  --accent: #62d3e2;
  --olive: #94bf81;
  --gold: #dfb273;
  --primary-contrast: #08111a;
  --focus: #7dd3fc;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.28);
  --shadow-subtle: 0 10px 24px rgba(0, 0, 0, 0.18);
}

html[data-contrast="high"] {
  --bg: #ffffff;
  --bg-strong: #ffffff;
  --surface: #ffffff;
  --surface-muted: #ffffff;
  --surface-soft: #ffffff;
  --text: #000000;
  --text-muted: #111111;
  --border: #000000;
  --border-strong: #000000;
  --primary: #0038a8;
  --primary-strong: #00256e;
  --secondary: #000000;
  --accent: #ff7a00;
  --primary-contrast: #ffffff;
  --focus: #ff7a00;
}

html[data-theme="dark"][data-contrast="high"] {
  --bg: #000000;
  --bg-strong: #000000;
  --surface: #000000;
  --surface-muted: #000000;
  --surface-soft: #000000;
  --text: #ffffff;
  --text-muted: #f2f2f2;
  --border: #ffffff;
  --border-strong: #ffffff;
  --primary: #7dd3fc;
  --primary-strong: #93c5fd;
  --secondary: #ffffff;
  --accent: #ffb000;
  --primary-contrast: #000000;
  --focus: #ffb000;
  --shadow-soft: none;
  --shadow-subtle: none;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  font-size: calc(100% * var(--font-scale));
}

body {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at top left, rgba(15, 69, 147, 0.08), transparent 28%),
    linear-gradient(180deg, var(--bg-strong) 0%, var(--bg) 22%, var(--bg) 100%);
  color: var(--text);
  font-size: 1rem;
  font-family: 'Merriweather Sans', sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.078;
  mix-blend-mode: multiply;
}

body::before {
  inset: -40vmax;
  background:
    url("../img/bg_central_paty.svg") repeat left top / 280px auto;
  transform: rotate(45deg);
  transform-origin: center;
}

body::after {
  display: none;
}

a {
  color: var(--primary);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--primary-strong);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: none !important;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3000;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.accessibility-bar {
  background: var(--surface);
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  padding: 0;
  font-size: 16px;
}

html[data-theme="dark"] .accessibility-bar {
  background: var(--surface);
}

html[data-theme="dark"][data-contrast="high"] .accessibility-bar,
html[data-contrast="high"] .accessibility-bar {
  background: var(--surface);
  backdrop-filter: none;
}

.accessibility-bar .container {
  min-height: 46px;
  padding-top: 0;
  padding-bottom: 0;
}

.app-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.app-toolbar-label {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.accessibility-bar small {
  font-size: 13px;
}

.app-toolbar-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.2;
}

.app-toolbar-btn-icon {
  width: 46px;
  min-width: 46px;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.app-toolbar-btn[aria-pressed="true"] {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
}

.btn.is-loading,
.guided-link.is-loading {
  pointer-events: none;
}

.btn.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.btn-loading-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  animation: btn-spin 0.7s linear infinite;
}

.guided-link.is-loading {
  opacity: 0.8;
}

.guided-link.is-loading::after {
  content: "";
  width: 1rem;
  height: 1rem;
  margin-left: auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: btn-spin 0.7s linear infinite;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  backdrop-filter: blur(10px);
  background: rgba(246, 248, 251, 0.92);
  border-bottom: 1px solid var(--border);
  font-size: 16px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.site-brand-mark {
  width: 96px;
  height: 36px;
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.site-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

html[data-theme="dark"] .site-brand-mark img {
  opacity: 0;
}

html[data-theme="dark"] .site-brand-mark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--primary);
  -webkit-mask: url("../img/logo-horizontal-azul.svg") center / contain no-repeat;
  mask: url("../img/logo-horizontal-azul.svg") center / contain no-repeat;
}

html[data-contrast="high"] .site-brand-mark img {
  opacity: 1;
}

html[data-contrast="high"] .site-brand-mark::before {
  display: none;
}

.site-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.site-brand-title {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
  color: var(--primary);
}

.app-navbar {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 8px 0;
}

html[data-theme="dark"] .site-header {
  background: rgba(14, 23, 33, 0.94);
}

html[data-theme="dark"][data-contrast="high"] .site-header,
html[data-contrast="high"] .site-header {
  background: var(--surface);
  backdrop-filter: none;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(104, 165, 242, 0.08), transparent 28%),
    linear-gradient(180deg, var(--bg-strong) 0%, var(--bg) 22%, var(--bg) 100%);
}

html[data-theme="dark"] body::before,
html[data-theme="dark"] body::after {
  filter: none;
  opacity: 0.16;
  mix-blend-mode: screen;
}

html[data-contrast="high"] body::before,
html[data-contrast="high"] body::after {
  opacity: 0.03;
  mix-blend-mode: normal;
  filter: none;
}

html[data-theme="dark"][data-contrast="high"] body::before,
html[data-theme="dark"][data-contrast="high"] body::after {
  opacity: 0.035;
  mix-blend-mode: normal;
  filter: brightness(0) saturate(100%) invert(100%);
}

html[data-theme="dark"] .page-hero::after,
html[data-theme="dark"] .page-intro::after,
html[data-theme="dark"] .app-footer::before,
html[data-theme="dark"] .app-footer::after {
  opacity: 0.06;
  filter: brightness(0) saturate(100%) invert(100%);
}

html[data-contrast="high"] .app-footer::before,
html[data-contrast="high"] .app-footer::after,
html[data-contrast="high"] .content-icon-soft::after,
html[data-contrast="high"] .shell-icon-soft::after {
  opacity: 0.03;
  filter: none;
}

html[data-theme="dark"][data-contrast="high"] .app-footer::before,
html[data-theme="dark"][data-contrast="high"] .app-footer::after,
html[data-theme="dark"][data-contrast="high"] .content-icon-soft::after,
html[data-theme="dark"][data-contrast="high"] .shell-icon-soft::after {
  opacity: 0.04;
  filter: brightness(0) saturate(100%) invert(100%);
}

html[data-theme="dark"] .page-hero::before,
html[data-theme="dark"] .page-intro::before {
  opacity: 0.95;
  filter: none;
}

.app-navbar .navbar-toggler {
  border-color: var(--border);
}

.app-navbar .navbar-toggler-icon {
  filter: contrast(0.4);
}

.app-navbar .nav-link {
  color: var(--text);
  font-weight: 700;
  padding: 0.24rem 0.78rem;
  border-radius: 0;
  font-size: 15px;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link.active,
.app-navbar .nav-link:focus,
.app-navbar .nav-link:active,
.app-navbar .dropdown-toggle.show {
  color: var(--primary);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  box-shadow: none;
}

.nav-link-utility {
  color: var(--text-muted) !important;
}

.nav-divider {
  width: 1px;
  height: 18px;
  margin: 0 0.35rem;
  background: var(--border-strong);
}

.dropdown-menu {
  --bs-dropdown-link-color: var(--text);
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-link-hover-bg: var(--surface-muted);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 0.6rem;
}

.dropdown-item {
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item:active,
.dropdown-item.active {
  color: var(--text);
  background: var(--surface-muted);
}

.site-header .dropdown-menu,
.site-header .dropdown-menu.show {
  background: var(--surface) !important;
  background-color: var(--surface) !important;
  background-image: none !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  opacity: 1;
}

.site-header .dropdown-item {
  color: var(--text) !important;
}

.site-header .dropdown-item:hover,
.site-header .dropdown-item:focus,
.site-header .dropdown-item:active,
.site-header .dropdown-item.active {
  background: var(--surface-muted) !important;
  color: var(--text) !important;
}

.site-main {
  margin-top: 24px;
  margin-bottom: 24px;
  padding-bottom: 2rem;
}

.app-alert {
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-subtle);
}

.card,
.table,
.form-control,
.form-select,
.alert,
.pagination .page-link,
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.card {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--border);
}

html[data-contrast="high"] .card,
html[data-contrast="high"] .page-hero,
html[data-contrast="high"] .page-intro,
html[data-contrast="high"] .cookie-banner-card,
html[data-contrast="high"] .dropdown-menu,
html[data-contrast="high"] .summary-item,
html[data-contrast="high"] .summary-strip,
html[data-contrast="high"] .guided-step,
html[data-contrast="high"] .guided-link,
html[data-contrast="high"] .guided-option span,
html[data-contrast="high"] .selector-card,
html[data-contrast="high"] .utility-panel,
html[data-contrast="high"] .content-panel,
html[data-contrast="high"] .content-panel-grid,
html[data-contrast="high"] .record-table-wrap {
  background: var(--surface) !important;
  box-shadow: none !important;
  border-color: var(--border) !important;
}

.panel-card {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-subtle);
}

.form-control,
.form-select {
  border-radius: 16px;
  min-height: 50px;
  padding: 0.75rem 0.95rem;
  box-shadow: none;
}

.form-control:focus,
.form-control:active,
.form-select:focus,
.form-select:active {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(15, 69, 147, 0.12);
}

textarea.form-control {
  min-height: auto;
  border-radius: 18px;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.text-muted,
small.text-muted {
  color: var(--text-muted) !important;
}

.bg-light,
.form-control.bg-light {
  background-color: var(--surface-muted) !important;
  color: var(--text);
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  margin-bottom: 0;
}

.table thead th {
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 800;
  border-bottom-width: 1px;
  white-space: nowrap;
}

html[data-contrast="high"] .table thead th {
  background: var(--surface-muted);
  color: var(--primary);
}

.table tbody tr:nth-child(even) {
  background: rgba(15, 69, 147, 0.025);
}

.btn {
  border-radius: var(--radius-pill);
  padding: 0.72rem 1.25rem;
  font-weight: 700;
}

.btn-sm {
  padding: 0.5rem 0.85rem;
}

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-strong);
  --bs-btn-hover-border-color: var(--primary-strong);
  --bs-btn-color: var(--primary-contrast);
}

.btn-outline-primary {
  --bs-btn-color: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  --bs-btn-hover-color: var(--primary-contrast);
}

.btn-outline-secondary {
  --bs-btn-color: var(--secondary);
  --bs-btn-border-color: var(--secondary);
  --bs-btn-hover-bg: var(--secondary);
  --bs-btn-hover-border-color: var(--secondary);
  --bs-btn-hover-color: #fff;
}

.btn-outline-danger {
  border-color: #b84141;
  color: #b84141;
}

.btn-outline-danger:hover {
  background: #b84141;
  color: #fff;
}

.btn-success {
  --bs-btn-bg: var(--olive);
  --bs-btn-border-color: var(--olive);
  --bs-btn-hover-bg: #6f9d5c;
  --bs-btn-hover-border-color: #6f9d5c;
  --bs-btn-color: #fff;
}

.btn-brand {
  background: var(--primary);
  border-color: var(--primary);
}

.page-title-block {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.page-title-block h2,
.section-card-title,
.section-title,
.content-card .card-title,
.auth-panel h2,
.intro-panel h2 {
  color: var(--primary);
}

.page-title-block h2,
.section-card-title,
.section-title,
.content-card .card-title,
.page-hero-title {
  position: relative;
}

.page-title-block h2::after,
.section-card-title::after,
.section-title::after,
.content-card .card-title::after,
.page-hero-title::after {
  content: none;
}

.section-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.page-intro,
.page-hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.4rem;
  position: relative;
  overflow: hidden;
}

.page-hero-soft {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.98) 100%);
  border-color: rgba(15, 69, 147, 0.12);
}

.page-hero-band {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.98) 100%);
  border-color: rgba(15, 69, 147, 0.12);
}

.page-hero-accent {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.98) 100%);
  border-color: rgba(15, 69, 147, 0.12);
}

html[data-theme="dark"] .page-hero-soft {
  background: linear-gradient(180deg, rgba(23, 36, 51, 0.98) 0%, rgba(21, 33, 45, 0.99) 100%);
  border-color: rgba(104, 165, 242, 0.22);
}

html[data-theme="dark"] .page-hero-band {
  background: linear-gradient(180deg, rgba(23, 36, 51, 0.98) 0%, rgba(21, 33, 45, 0.99) 100%);
  border-color: rgba(104, 165, 242, 0.22);
}

html[data-theme="dark"] .page-hero-accent {
  background: linear-gradient(180deg, rgba(23, 36, 51, 0.98) 0%, rgba(21, 33, 45, 0.99) 100%);
  border-color: rgba(104, 165, 242, 0.22);
}

.page-hero::before,
.page-intro::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 58%, var(--accent) 100%);
  pointer-events: none;
  opacity: 0.95;
}

.page-hero::after,
.page-intro::after {
  content: none;
}

.page-hero-title {
  font-size: clamp(1.8rem, 2.6vw, 2.7rem);
  font-weight: 800;
  line-height: 1.08;
  color: var(--primary);
  margin-bottom: 0.7rem;
}

.page-hero-text {
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 56rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.summary-item {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-soft) 100%);
  padding: 1rem 1.1rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.summary-link {
  display: block;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.summary-link:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-subtle);
}

.summary-link .summary-item-label,
.summary-link .summary-item-value {
  text-decoration: none;
}

.summary-item-compact {
  padding: 0.85rem 1rem;
  border-radius: 18px;
}

.summary-item-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary);
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.summary-item-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  overflow-wrap: anywhere;
}

.institution-copy p,
.institution-copy li,
.institution-copy ol,
.institution-copy ul {
  color: var(--text-muted);
}

.institution-copy strong,
.institution-copy b {
  color: var(--text);
}

.selector-card,
.intro-panel,
.content-panel,
.auth-panel,
.utility-panel {
  position: relative;
  overflow: hidden;
}

.content-icon-soft::after,
.shell-icon-soft::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 14px;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: contain;
}

.content-icon-soft::after {
  width: var(--decor-icon-size);
  height: var(--decor-icon-size);
  background-image: url("../img/bg_canto_13.svg");
  opacity: 0.075;
}

.shell-icon-soft::after {
  width: var(--decor-icon-size);
  height: var(--decor-icon-size);
  background-image: url("../img/bg_canto_11.svg");
  opacity: 0.055;
}

html[data-theme="dark"] .content-icon-soft::after,
html[data-theme="dark"] .shell-icon-soft::after {
  filter: brightness(0) saturate(100%) invert(100%);
  opacity: 0.05;
}

.selector-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(243, 246, 250, 0.96) 100%);
}

.utility-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.95) 100%);
}

.content-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 246, 250, 0.96) 100%);
}

.content-panel-grid {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.95) 100%),
    linear-gradient(90deg, rgba(15, 69, 147, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(15, 69, 147, 0.03) 1px, transparent 1px);
  background-size: auto, 18px 18px, 18px 18px;
}

.summary-strip {
  background:
    linear-gradient(90deg, rgba(15, 69, 147, 0.06) 0%, rgba(12, 178, 204, 0.04) 100%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-subtle);
}

html[data-theme="dark"] .selector-card {
  background: rgba(23, 36, 51, 0.98);
}

html[data-theme="dark"] .utility-panel {
  background: rgba(23, 36, 51, 0.98);
}

html[data-theme="dark"] .content-panel {
  background: rgba(23, 36, 51, 0.98);
}

html[data-theme="dark"] .content-panel-grid {
  background: rgba(23, 36, 51, 0.98);
}

html[data-theme="dark"] .summary-strip {
  background: rgba(29, 45, 61, 0.96);
}

.selector-card::before,
.intro-panel::before,
.content-panel::before,
.auth-panel::before,
.utility-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 55%, var(--accent) 100%);
}

.decorative-panel {
  position: relative;
  overflow: hidden;
}

.decorative-panel::after {
  content: none;
}

html[data-theme="dark"] .decorative-panel::after {
  content: none;
}

.selector-description {
  min-height: 92px;
  background: var(--surface-muted);
  border-radius: 18px;
}

.guided-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.guided-step {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
}

.guided-step-number {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  flex: 0 0 auto;
}

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

.guided-link {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  min-height: 112px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.guided-link:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.guided-link strong {
  color: var(--primary);
  font-size: 1rem;
  line-height: 1.25;
}

.guided-link small {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.guided-option {
  display: block;
  cursor: pointer;
}

.guided-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.guided-option span {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  min-height: 96px;
}

html[data-theme="dark"] .guided-step,
html[data-theme="dark"] .guided-option span,
html[data-theme="dark"] .guided-link,
html[data-theme="dark"] .summary-item,
html[data-theme="dark"] .selector-description,
html[data-theme="dark"] .record-table-wrap,
html[data-theme="dark"] .auth-panel .form-check,
html[data-theme="dark"] form .form-check {
  background: rgba(29, 45, 61, 0.96);
}

.guided-option small {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.guided-option input:checked + span {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 69, 147, 0.1);
  background: var(--surface-soft);
}

html[data-theme="dark"] .guided-link:hover {
  border-color: rgba(104, 165, 242, 0.35);
}

.filter-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.05rem;
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.filter-chip:hover {
  text-decoration: none;
  border-color: var(--primary);
  color: var(--primary);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.admin-filter-chip {
  min-height: 52px;
  padding: 0.85rem 1.2rem;
}

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 1.2rem 0;
}

.record-table-wrap {
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
}

.table-truncate {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}

.table-truncate-sm {
  max-width: 140px;
}

.table-truncate-lg {
  max-width: 320px;
}

.table-col-id {
  width: 72px;
  white-space: nowrap;
}

.table-col-compact {
  width: 120px;
  white-space: nowrap;
}

.table-col-status {
  width: 112px;
  white-space: nowrap;
}

.table-sort-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  font-weight: inherit;
}

.table-sort-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.table-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.table-action-btn {
  min-width: 104px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  line-height: 1.2;
  text-align: center;
}

.table-order-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.table-order-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.record-table-wrap .table td > a.d-block.small,
.table-responsive .table td > a.d-block.small {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}

.content-card {
  height: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
}

.content-card::before {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: var(--decor-icon-size);
  height: var(--decor-icon-size);
  background: url("../img/bg_canto_09.svg") no-repeat right bottom / contain;
  opacity: 0.07;
  pointer-events: none;
}

.content-card.post-icon-1::before {
  background-image: url("../img/bg_canto_04.svg");
}

.content-card.post-icon-2::before {
  background-image: url("../img/bg_canto_07.svg");
}

.content-card.post-icon-3::before {
  background-image: url("../img/bg_canto_09.svg");
}

.content-card.post-icon-4::before {
  background-image: url("../img/bg_canto_11.svg");
}

.content-card.post-icon-5::before {
  background-image: url("../img/bg_canto_13.svg");
}

.content-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.18) 100%);
  pointer-events: none;
}

.content-card img,
.content-card .card-img-top,
.content-card .card-body {
  position: relative;
  z-index: 1;
}

html[data-theme="dark"] .content-card {
  background: rgba(23, 36, 51, 0.98);
  border-color: var(--border);
  box-shadow: var(--shadow-subtle);
}

html[data-theme="dark"] .content-card::before {
  opacity: 0.035;
  filter: brightness(0) saturate(100%) invert(100%);
}

html[data-theme="dark"] .content-card::after {
  background: none;
}

html[data-theme="dark"] .content-card .card-text,
html[data-theme="dark"] .content-card .mb-2 {
  color: var(--text-muted) !important;
}

.content-card img {
  border-top-left-radius: calc(var(--radius-card) - 1px);
  border-top-right-radius: calc(var(--radius-card) - 1px);
}

.home-section + .home-section {
  margin-top: 1.5rem;
}

.auth-panel .form-control,
.auth-panel .form-select {
  border-radius: var(--radius-pill);
}

.auth-panel .form-check,
form .form-check {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem 1rem 0.9rem 2.2rem;
}

.auth-panel .form-check-input,
form .form-check-input {
  margin-top: 0.25rem;
}

.form-control[type="file"] {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.form-control[type="file"]::file-selector-button {
  background: var(--surface-muted);
  color: var(--text);
  border: 0;
  border-right: 1px solid var(--border);
  padding: 0.625rem 0.9rem;
  margin: -0.375rem 0.75rem -0.375rem -0.75rem;
}

html[data-theme="dark"] .form-control[type="file"] {
  background-color: var(--surface-soft);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .form-control[type="file"]::file-selector-button {
  background: rgba(29, 45, 61, 0.96);
  color: var(--text);
  border-right-color: var(--border);
}

html[data-theme="dark"] .form-control[type="file"]:hover::file-selector-button,
html[data-theme="dark"] .form-control[type="file"]:focus::file-selector-button,
html[data-theme="dark"] .form-control[type="file"]:active::file-selector-button {
  background: var(--primary);
  color: var(--primary-contrast);
}

html[data-theme="dark"] .dropdown-menu {
  --bs-dropdown-link-color: var(--text);
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-link-hover-color: var(--text);
  --bs-dropdown-link-hover-bg: rgba(29, 45, 61, 0.98);
  --bs-dropdown-link-active-color: var(--text);
  --bs-dropdown-link-active-bg: rgba(29, 45, 61, 0.98);
  background-color: var(--surface);
  background-image: none;
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .dropdown-item:active,
html[data-theme="dark"] .dropdown-item.active {
  color: var(--text);
  background: rgba(29, 45, 61, 0.98);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-control:active,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .form-select:active {
  background-color: var(--surface-soft);
  color: var(--text);
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(104, 165, 242, 0.18);
}

html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus,
html[data-theme="dark"] textarea:-webkit-autofill,
html[data-theme="dark"] textarea:-webkit-autofill:hover,
html[data-theme="dark"] textarea:-webkit-autofill:focus,
html[data-theme="dark"] select:-webkit-autofill,
html[data-theme="dark"] select:-webkit-autofill:hover,
html[data-theme="dark"] select:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  border-color: var(--primary);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-soft) inset, 0 0 0 0.2rem rgba(104, 165, 242, 0.18);
  box-shadow: 0 0 0 1000px var(--surface-soft) inset, 0 0 0 0.2rem rgba(104, 165, 242, 0.18);
  transition: background-color 9999s ease-out 0s;
}

.page-stack > * + * {
  margin-top: 1.4rem;
}

.institution-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.4rem;
}

.footer-brand {
  color: var(--text-muted);
}

.footer-title,
.footer-links-title {
  color: var(--primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.app-footer {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-soft) 0%, var(--surface) 100%);
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.app-footer::before {
  content: "";
  position: absolute;
  left: -18px;
  bottom: -18px;
  width: var(--decor-icon-size);
  height: var(--decor-icon-size);
  background: url("../img/bg_canto_13.svg") no-repeat left bottom / contain;
  opacity: 0.09;
  pointer-events: none;
}

.app-footer::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 24px;
  width: var(--decor-icon-size);
  height: var(--decor-icon-size);
  background: url("../img/bg_canto_04.svg") no-repeat right top / contain;
  opacity: 0.07;
  pointer-events: none;
}

.app-footer a {
  color: var(--secondary);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

.developer-credit-bar {
  border-top: 1px solid var(--border);
  background: transparent;
  color: #111827;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.developer-credit-bar .container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
  text-align: center;
}

html[data-theme="dark"] .developer-credit-bar {
  color: var(--text);
}

html[data-contrast="high"] .developer-credit-bar,
html[data-theme="dark"][data-contrast="high"] .developer-credit-bar {
  border-top: 2px solid var(--border);
  color: var(--text);
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 20px;
  z-index: 1600;
  padding: 0 16px;
}

.cookie-banner-card {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.cookie-banner-copy {
  min-width: 0;
}

.cookie-banner-copy strong {
  display: block;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.cookie-banner-copy p {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  flex: 0 0 auto;
}

html[data-theme="dark"] .cookie-banner-card {
  background: rgba(23, 36, 51, 0.96);
}

html[data-contrast="high"] .cookie-banner-card {
  background: var(--surface);
  backdrop-filter: none;
}

.badge {
  border-radius: 999px;
  padding: 0.45rem 0.6rem;
  font-weight: 700;
}

.pagination .page-link {
  border-radius: 999px;
  margin: 0 0.2rem;
  min-width: 42px;
  text-align: center;
}

.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

code {
  color: var(--primary);
  background: var(--surface-muted);
  padding: 0.18rem 0.4rem;
  border-radius: 8px;
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

@media (max-width: 991.98px) {
  :root {
    --decor-icon-size: 104px;
  }

  .app-navbar {
    padding: 6px 0;
  }

  .navbar-collapse {
    padding-top: 0.55rem;
  }

  .institution-grid {
    grid-template-columns: 1fr;
  }

  .guided-steps,
  .guided-options {
    grid-template-columns: 1fr;
  }

  .app-toolbar {
    justify-content: flex-start;
  }
}

@media (min-width: 768px) {
  .mobile-stack-table {
    table-layout: fixed;
    width: 100%;
  }

  .mobile-stack-table td,
  .mobile-stack-table th {
    min-width: 0;
  }
}

@media (max-width: 767.98px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(15, 69, 147, 0.08), transparent 28%),
      linear-gradient(180deg, var(--bg-strong) 0%, var(--bg) 22%, var(--bg) 100%);
  }

  body::before {
    background: url("../img/bg_central_paty.svg") repeat left top / 190px auto;
  }

  .site-brand-mark {
    width: 82px;
    height: 30px;
  }

  .site-brand-mark img {
    width: 100%;
  }

  .site-brand-title {
    font-size: 16px;
  }

  .page-hero,
  .page-intro,
  .card {
    border-radius: 22px;
  }

  .page-hero::before,
  .page-intro::before {
    width: 100%;
    height: 5px;
  }

  .page-hero::after,
  .page-intro::after {
    content: none;
  }

  .page-title-block {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .summary-item {
    padding: 0.85rem 0.9rem;
    border-radius: 18px;
  }

  .summary-item-label {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .summary-item-value {
    font-size: clamp(1.15rem, 5vw, 1.45rem);
    line-height: 1.1;
  }

  .record-table-wrap,
  .table-responsive {
    overflow: visible;
    border-radius: 18px;
  }

  .mobile-stack-table {
    min-width: 0 !important;
    margin-bottom: 0;
  }

  .mobile-stack-table thead {
    display: none;
  }

  .mobile-stack-table,
  .mobile-stack-table tbody,
  .mobile-stack-table tr,
  .mobile-stack-table td {
    display: block;
    width: 100%;
  }

  .mobile-stack-table tbody {
    display: grid;
    gap: 0.85rem;
    padding: 0.25rem;
  }

  .mobile-stack-table tr {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
  }

  html[data-theme="dark"] .mobile-stack-table tr {
    background: rgba(29, 45, 61, 0.96);
  }

  .mobile-stack-table td {
    display: grid;
    grid-template-columns: minmax(92px, 38%) 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.7rem 0.9rem;
    border: 0;
    border-bottom: 1px solid var(--border);
    white-space: normal;
    word-break: break-word;
  }

  .mobile-stack-table td:last-child {
    border-bottom: 0;
  }

  .mobile-stack-table td::before {
    content: attr(data-label);
    font-size: 0.74rem;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 800;
    color: var(--secondary);
  }

  .table-truncate,
  .table-truncate-sm,
  .table-truncate-lg,
  .record-table-wrap .table td > a.d-block.small,
  .table-responsive .table td > a.d-block.small {
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    cursor: inherit;
  }

  .mobile-stack-table td.table-actions {
    grid-template-columns: 1fr;
  }

  .mobile-stack-table td.table-actions::before {
    margin-bottom: 0.15rem;
  }

  .mobile-stack-table td.table-actions .d-flex,
  .mobile-stack-table td.table-actions form {
    width: 100%;
  }

  .mobile-stack-table td.table-actions .btn,
  .mobile-stack-table td.table-actions .d-flex {
    width: 100%;
  }

  .mobile-stack-table td.table-actions .d-flex {
    gap: 0.5rem !important;
  }

  .mobile-stack-table td.table-actions .btn {
    justify-content: center;
  }

  .cookie-banner {
    bottom: 12px;
    padding: 0 10px;
  }

  .cookie-banner-card {
    flex-direction: column;
    align-items: stretch;
    border-radius: 18px;
  }

  .cookie-banner-actions {
    width: 100%;
  }

  .cookie-banner-actions .btn {
    width: 100%;
  }
}
