:root {
  font-family: "Montserrat", "Segoe UI", Tahoma, sans-serif;
  line-height: 1.6;
  color: #0d2744;
  background-color: #f5f7fb;
  --color-navy: #0d2744;
  --color-royal: #0d3b66;
  --color-royal-dark: #082643;
  --color-azure: #1b6dc1;
  --color-azure-light: #2d8ff4;
  --color-crimson: #c1121f;
  --color-crimson-light: #f25c68;
  --color-ice: #f5f7fb;
  --color-sky: #e4edf9;
  --color-stone: #5f6c87;
  --color-muted: #7c8aa5;
  --color-soft: rgba(13, 59, 102, 0.08);
  --color-outline: rgba(13, 59, 102, 0.12);
  --shadow-sm: 0 8px 24px rgba(13, 59, 102, 0.08);
  --shadow-md: 0 14px 40px rgba(13, 59, 102, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(193, 18, 31, 0.12), transparent 55%),
    radial-gradient(circle at top right, rgba(27, 109, 193, 0.18), transparent 60%),
    linear-gradient(180deg, var(--color-ice) 0%, #eef2fa 100%);
  color: var(--color-navy);
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4 {
  font-family: "Playfair Display", "Times New Roman", serif;
  margin: 0;
  color: var(--color-royal);
}

p {
  margin: 0 0 1rem;
  color: var(--color-stone);
}

a {
  color: var(--color-azure);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  color: var(--color-azure-light);
}

strong {
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-shell {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-decor {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.decor-layer {
  position: absolute;
  border-radius: 50%;
  filter: blur(0);
  opacity: 0.45;
}

.decor-layer--one {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(193, 18, 31, 0.28) 0%, transparent 70%);
  top: -160px;
  left: -120px;
}

.decor-layer--two {
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(27, 109, 193, 0.25) 0%, transparent 68%);
  top: -220px;
  right: -160px;
}

.decor-layer--three {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, transparent 70%);
  bottom: -140px;
  right: 18%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 1.6rem;
  padding: 1.1rem clamp(2vw, 2.6vw, 3.5rem);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(13, 59, 102, 0.08);
  box-shadow: 0 8px 20px rgba(13, 59, 102, 0.05);
}

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

.site-logo__mark {
  position: relative;
  width: 68px;
  height: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.2rem;
}

.site-logo__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.site-logo__crest {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background:
    conic-gradient(from 200deg, var(--color-crimson) 0deg 180deg, var(--color-azure) 180deg 360deg);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6), 0 12px 20px rgba(13, 59, 102, 0.18);
}

.site-logo__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
  gap: 0.05rem;
}

.site-logo__title {
  font-family: "Playfair Display", serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--color-royal);
}

.site-logo__subtitle {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.site-logo__footnote {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(13, 59, 102, 0.6);
}

.site-logo__mark.has-image .site-logo__crest {
  display: none;
}

.site-logo__mark.has-image .site-logo__image {
  display: block;
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.site-nav__link {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--color-muted);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.site-nav__link:hover {
  color: var(--color-royal);
  background: rgba(27, 109, 193, 0.08);
}

.site-nav__link.is-active {
  background: linear-gradient(120deg, var(--color-azure), var(--color-azure-light));
  color: #fff;
  box-shadow: 0 12px 24px rgba(27, 109, 193, 0.25);
}

.site-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: end;
  margin-left: auto;
}

.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.site-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background: rgba(27, 109, 193, 0.1);
  color: var(--color-royal);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.site-pill:hover {
  background: rgba(27, 109, 193, 0.2);
  transform: translateY(-1px);
}

.site-inline-form {
  margin: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.button:focus-visible {
  outline: 2px solid var(--color-azure);
  outline-offset: 3px;
}

.button--primary {
  background: linear-gradient(130deg, var(--color-crimson), var(--color-crimson-light));
  color: #fff;
  box-shadow: 0 12px 28px rgba(193, 18, 31, 0.24);
}

.button--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(193, 18, 31, 0.3);
}

.button--outline {
  background: rgba(255, 255, 255, 0.7);
  color: var(--color-royal);
  border: 1px solid var(--color-azure);
  box-shadow: 0 8px 18px rgba(27, 109, 193, 0.18);
}

.button--outline:hover {
  background: rgba(27, 109, 193, 0.08);
}

.button--ghost {
  background: rgba(27, 109, 193, 0.12);
  color: var(--color-royal);
  border: 1px solid transparent;
}

.button--ghost:hover {
  background: rgba(27, 109, 193, 0.2);
}

.button--soft {
  background: rgba(27, 109, 193, 0.12);
  color: var(--color-royal);
  border: 1px solid rgba(27, 109, 193, 0.24);
  box-shadow: none;
}

.button--soft:hover {
  background: rgba(27, 109, 193, 0.2);
  color: var(--color-royal-dark);
  border-color: rgba(27, 109, 193, 0.35);
}

.button--block {
  width: 100%;
}

.link-arrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--color-azure);
}

.link-arrow::after {
  content: "→";
  transition: transform 0.2s ease;
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

.link-danger {
  background: none;
  border: none;
  color: var(--color-crimson);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.link-danger:hover {
  color: #a50b19;
}

.content-surface {
  position: relative;
  width: min(1320px, 96vw);
  margin: 3rem auto 4rem;
  padding: clamp(2.4rem, 4vw, 3.6rem);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
}

.surface-home {
  padding-top: clamp(2.6rem, 5vw, 4rem);
}

.surface-auth,
.surface-admin {
  background: rgba(255, 255, 255, 0.9);
}

.surface-profile {
  background: rgba(255, 255, 255, 0.95);
}

.hero {
  padding: clamp(2.8rem, 6vw, 4.5rem) 0;
}

.hero--home {
  padding-top: clamp(1.8rem, 4vw, 3.2rem);
  padding-bottom: 0;
}

.hero__legend {
  width: min(1320px, 94vw);
  margin: 0 auto 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1.55rem;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(193, 18, 31, 0.16), rgba(193, 18, 31, 0.08));
  color: var(--color-crimson);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

.hero__badge--motto {
  background: linear-gradient(120deg, rgba(27, 109, 193, 0.16), rgba(45, 143, 244, 0.08));
  color: var(--color-azure);
}

.hero__badge-divider {
  opacity: 0.6;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(2.4rem, 5vw, 5rem);
  align-items: stretch;
  width: min(1320px, 94vw);
  margin: 0 auto;
  padding: 0 clamp(3rem, 6vw, 5rem);
}

.hero__content > h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
}

.hero__content > p {
  font-size: 1.05rem;
  margin-top: 1rem;
  max-width: 48ch;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.hero-card {
  background: linear-gradient(150deg, rgba(13, 59, 102, 0.92), rgba(13, 59, 102, 0.7));
  border-radius: var(--radius-md);
  padding: clamp(1.9rem, 3vw, 2.4rem);
  color: #f4f7fb;
  box-shadow: 0 18px 36px rgba(13, 59, 102, 0.32);
  width: 100%;
}

.hero__media {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}

.hero-card__title {
  margin-bottom: 0.8rem;
  color: #fff;
  font-size: 1.6rem;
}

.hero-card__caption {
  font-size: 0.95rem;
  color: rgba(244, 247, 251, 0.85);
}

.hero-card__list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.hero-card__list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
}

.hero-card__list li::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.4));
}

.hero--profile {
  padding-bottom: 1rem;
}

.page-hero {
  padding: clamp(2.5rem, 5vw, 3.5rem) clamp(4vw, 6vw, 6rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-hero__content {
  width: min(720px, 100%);
  text-align: center;
}

.page-hero__content p {
  margin-top: 0.8rem;
  font-size: 1.05rem;
}

.page-hero--compact {
  padding-bottom: 1.5rem;
}

.module {
  display: grid;
  gap: 1.8rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.module:last-child {
  margin-bottom: 0;
}

.module__headline > h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  margin-bottom: 0.5rem;
}

.module__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.pillars {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.pillar {
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-sky);
  border: 1px solid rgba(13, 59, 102, 0.12);
  box-shadow: 0 10px 22px rgba(13, 59, 102, 0.08);
}

.pillar h3 {
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
}

.module--callout .callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.8rem 2.2rem;
  border-radius: var(--radius-md);
  background: linear-gradient(125deg, rgba(193, 18, 31, 0.12), rgba(27, 109, 193, 0.12));
  border: 1px solid rgba(193, 18, 31, 0.18);
}

.module--learning .module__header p,
.module--map .module__header p {
  max-width: 520px;
}

.pathway-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.pathway-card {
  display: grid;
  gap: 0.75rem;
  padding: 1.6rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(27, 109, 193, 0.12);
  box-shadow: 0 16px 32px rgba(13, 59, 102, 0.1);
  min-height: 100%;
}

.pathway-card h3 {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 1.2rem;
  color: var(--color-royal);
}

.pathway-card p {
  margin: 0;
  color: var(--color-muted);
  font-weight: 600;
}

.pathway-card__list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--color-stone);
  font-size: 0.9rem;
  display: grid;
  gap: 0.3rem;
}

.pathway-card__empty {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-muted);
}

.sermon-card {
  padding: 1.8rem 2.2rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(27, 109, 193, 0.12), rgba(27, 109, 193, 0.06));
  border: 1px solid rgba(27, 109, 193, 0.18);
  box-shadow: 0 18px 36px rgba(13, 59, 102, 0.12);
  display: grid;
  gap: 1rem;
}

.sermon-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.sermon-card__tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sermon-card__date {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.sermon-card__title {
  font-size: 1.5rem;
  color: var(--color-royal);
}

.sermon-card__lead {
  margin: 0;
  color: var(--color-stone);
  font-size: 1rem;
}

.sermon-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sermon-card--hero {
  width: 100%;
  padding: 1.6rem 2rem;
  background: linear-gradient(150deg, rgba(27, 109, 193, 0.18), rgba(27, 109, 193, 0.06));
}

.sermon-card--hero .sermon-card__title {
  font-size: 1.35rem;
}

.sermon-card--hero .sermon-card__lead {
  font-size: 0.95rem;
  color: var(--color-royal);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-board {
  display: grid;
  gap: 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: stretch;
}

.map-board__canvas {
  min-height: 260px;
  border-radius: var(--radius-md);
  border: 2px dashed rgba(27, 109, 193, 0.22);
  background: rgba(27, 109, 193, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.6rem;
  gap: 0.6rem;
  color: var(--color-muted);
}

.map-board__canvas code {
  background: rgba(27, 109, 193, 0.1);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.85rem;
  color: var(--color-royal);
}

.map-board__address {
  margin: 0.4rem 0 0;
  color: var(--color-royal);
}

.map-board__details {
  display: grid;
  gap: 0.8rem;
  padding: 1.6rem;
  border-radius: var(--radius-md);
  background: rgba(244, 247, 251, 0.9);
  border: 1px solid rgba(13, 59, 102, 0.12);
  box-shadow: 0 16px 32px rgba(13, 59, 102, 0.1);
}

.map-board__details ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--color-muted);
}

.callout__content h2 {
  font-size: 1.6rem;
}

.document-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.15rem;
}

.document-feed--admin {
  gap: 1rem;
}

.document-card {
  background: rgba(244, 247, 251, 0.8);
  border-radius: var(--radius-sm);
  padding: 1rem 1.4rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: center;
  border: 1px solid rgba(13, 59, 102, 0.08);
  box-shadow: 0 10px 24px rgba(13, 59, 102, 0.08);
  max-width: 100%;
}

.document-card--compact {
  padding: 0.85rem 1.1rem;
  gap: 1rem;
  box-shadow: 0 8px 18px rgba(13, 59, 102, 0.06);
  background: rgba(255, 255, 255, 0.92);
}

.document-card--row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.6rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(27, 109, 193, 0.1);
  box-shadow: 0 12px 28px rgba(13, 59, 102, 0.08);
}

.document-card__type {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--color-azure), var(--color-azure-light));
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.document-card__body {
  display: grid;
  gap: 0.4rem;
}

.document-card__title {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-royal);
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.document-card__meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.document-card__meta--muted {
  font-size: 0.85rem;
}

.document-card__actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.document-card--row .document-card__actions {
  margin-left: auto;
}

.document-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.document-card--compact .document-card__type {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.document-card--compact .document-card__title {
  font-size: 1rem;
  -webkit-line-clamp: 2;
}

.document-card--compact .document-card__actions {
  gap: 0.45rem;
}

.document-card--compact .button {
  font-size: 0.82rem;
  padding: 0.45rem 0.9rem;
}

.document-card--row .document-card__type {
  width: 56px;
  height: 56px;
}

.document-card--row .document-card__body {
  flex: 1;
  display: grid;
  gap: 0.35rem;
}

.document-card--row .document-card__actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.document-card--row .document-card__title {
  font-size: 1.05rem;
  -webkit-line-clamp: 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(193, 18, 31, 0.12);
  color: var(--color-crimson);
  font-size: 0.8rem;
  font-weight: 600;
  width: fit-content;
}

.badge--soft {
  background: rgba(27, 109, 193, 0.12);
  color: var(--color-royal);
}

.empty {
  margin: 0;
  color: var(--color-muted);
}

.empty--center {
  text-align: center;
}

.empty-card {
  text-align: center;
  padding: 2.2rem;
  border-radius: var(--radius-md);
  background: rgba(244, 247, 251, 0.8);
  border: 1px dashed rgba(13, 59, 102, 0.2);
}

.auth-layout {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-layout--register {
  align-items: start;
}

.auth-panel {
  padding: 2.4rem;
  border-radius: var(--radius-md);
  background: rgba(244, 247, 251, 0.92);
  border: 1px solid rgba(13, 59, 102, 0.12);
  box-shadow: 0 12px 30px rgba(13, 59, 102, 0.12);
}

.auth-panel__header p {
  color: var(--color-muted);
}

.auth-panel__footer {
  margin-top: 1.8rem;
  color: var(--color-muted);
}

.auth-highlight {
  padding: 2.4rem;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(27, 109, 193, 0.18), rgba(27, 109, 193, 0.08));
  border: 1px solid rgba(27, 109, 193, 0.16);
  box-shadow: 0 16px 32px rgba(27, 109, 193, 0.16);
  color: var(--color-royal);
}

.auth-highlight h3 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
}

.checklist {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.checklist li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--color-royal);
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-crimson);
  font-weight: 700;
}

.form-grid {
  display: grid;
  gap: 1.25rem;
}

.form-field {
  display: grid;
  gap: 0.55rem;
}

.form-label {
  font-weight: 600;
  color: var(--color-royal);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(13, 59, 102, 0.18);
  background: rgba(255, 255, 255, 0.95);
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--color-azure);
  box-shadow: 0 0 0 4px rgba(27, 109, 193, 0.2);
  outline: none;
}

.form-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.form-hint--status {
  display: block;
  font-weight: 600;
  color: var(--color-muted);
}

.form-hint--status[data-state="success"] {
  color: var(--color-emerald);
}

.form-hint--status[data-state="error"] {
  color: var(--color-crimson);
}

.form-messages {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
}

.form-messages--error {
  background: rgba(193, 18, 31, 0.12);
  color: var(--color-crimson);
  border: 1px solid rgba(193, 18, 31, 0.4);
}

.form-messages--success {
  background: rgba(27, 109, 193, 0.12);
  color: var(--color-royal);
  border: 1px solid rgba(27, 109, 193, 0.35);
}

.avatar-ring {
  width: clamp(90px, 12vw, 120px);
  height: clamp(90px, 12vw, 120px);
  border-radius: 50%;
  background: linear-gradient(140deg, var(--color-crimson), var(--color-azure));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 2.8rem);
  font-weight: 700;
  box-shadow: 0 16px 32px rgba(13, 59, 102, 0.25);
}

.stat-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(27, 109, 193, 0.08);
}

.stat__label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.stat__value {
  font-weight: 600;
  color: var(--color-royal);
}

.history-feed {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
}

.history-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.3rem;
  border-radius: var(--radius-sm);
  background: rgba(244, 247, 251, 0.8);
  border: 1px solid rgba(13, 59, 102, 0.08);
  box-shadow: 0 10px 24px rgba(13, 59, 102, 0.08);
}

.history-card__type {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: linear-gradient(145deg, rgba(27, 109, 193, 0.92), rgba(27, 109, 193, 0.7));
  color: #fff;
}

.history-card__title {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  color: var(--color-royal);
}

.history-card__meta {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.history-card__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-grid {
  display: grid;
  gap: 2.2rem;
}

.admin-card {
  padding: 2.2rem;
  border-radius: var(--radius-md);
  background: rgba(244, 247, 251, 0.9);
  border: 1px solid rgba(13, 59, 102, 0.12);
  box-shadow: 0 14px 34px rgba(13, 59, 102, 0.12);
}

.admin-card__header h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 1.6rem;
}

.admin-card__header p {
  color: var(--color-muted);
  margin-top: 0.4rem;
}

.admin-card--recent {
  padding-top: 1.8rem;
}

.admin-categories {
  display: grid;
  gap: 2.2rem;
}

.category-deck {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
}

.category-chip {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 1.2rem;
  align-items: center;
  padding: 1rem 1.4rem;
  border-radius: var(--radius-sm);
  background: rgba(244, 247, 251, 0.86);
  border: 1px solid rgba(13, 59, 102, 0.1);
  box-shadow: 0 8px 22px rgba(13, 59, 102, 0.09);
}

.category-chip__badge {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(193, 18, 31, 0.9), rgba(193, 18, 31, 0.7));
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
}

.category-chip__handle {
  width: 16px;
  height: 44px;
  border-radius: 999px;
  background-image: radial-gradient(
      circle at 4px 6px,
      rgba(13, 59, 102, 0.35) 20%,
      transparent 20%
    ),
    radial-gradient(
      circle at 4px 16px,
      rgba(13, 59, 102, 0.35) 20%,
      transparent 20%
    ),
    radial-gradient(
      circle at 4px 26px,
      rgba(13, 59, 102, 0.35) 20%,
      transparent 20%
    );
  background-size: 10px 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

[data-reorder-state="active"] .category-chip__handle {
  opacity: 0.7;
}

.category-chip__body h3 {
  font-family: "Montserrat", sans-serif;
  margin: 0;
  font-size: 1.1rem;
}

.category-chip__body p {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.category-chip__meta {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.category-chip__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.category-chip__controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.subcategory-board {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(27, 109, 193, 0.06);
  border: 1px solid rgba(27, 109, 193, 0.12);
}

.subcategory-board h4 {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 0.95rem;
  color: var(--color-royal);
}

.subcategory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.subcategory-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.subcategory-count {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.subcategory-item__controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.order-button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(27, 109, 193, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-royal);
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.order-button:hover {
  transform: translateY(-1px);
  border-color: rgba(27, 109, 193, 0.6);
  box-shadow: 0 8px 18px rgba(13, 59, 102, 0.12);
}

.subcategory-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.subcategory-form .form-input {
  flex: 1 1 200px;
  min-width: 160px;
}

.subcategory-empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-muted);
}

.library-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 2.4rem;
}

.library-sidebar {
  display: grid;
  gap: 1.4rem;
  padding: 1.6rem;
  border-radius: var(--radius-md);
  background: rgba(244, 247, 251, 0.92);
  border: 1px solid rgba(13, 59, 102, 0.08);
  box-shadow: 0 14px 32px rgba(13, 59, 102, 0.08);
  position: sticky;
  top: 6.5rem;
  max-height: calc(100vh - 7.5rem);
  overflow: hidden;
}

.library-sidebar__header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-family: "Montserrat", sans-serif;
  color: var(--color-royal);
}

.library-sidebar__header p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-muted);
}

.library-sidebar__nav {
  display: grid;
  gap: 0.6rem;
  overflow-y: auto;
  padding-right: 0.4rem;
}

.library-tab {
  display: grid;
  gap: 0.05rem;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(27, 109, 193, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-royal);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.library-tab:hover {
  transform: translateX(4px);
  box-shadow: 0 12px 24px rgba(13, 59, 102, 0.12);
}

.library-tab.is-active {
  border-color: rgba(27, 109, 193, 0.45);
  background: linear-gradient(135deg, rgba(27, 109, 193, 0.18), rgba(27, 109, 193, 0.08));
  box-shadow: 0 16px 32px rgba(13, 59, 102, 0.16);
}

.library-tab__name {
  font-size: 0.95rem;
}

.library-tab__count {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.library-stage {
  display: grid;
  gap: 2.2rem;
}

.library-shell[data-enhanced="true"] .library-panel {
  display: none;
}

.library-panel {
  display: grid;
  gap: 1.8rem;
  padding: 2.2rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(13, 59, 102, 0.08);
  box-shadow: 0 28px 56px rgba(13, 59, 102, 0.12);
}

.library-shell[data-enhanced="true"] .library-panel.is-active {
  display: grid;
}

.library-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 1.6rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.library-panel__header h2 {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--color-royal);
}

.library-panel__header p {
  margin: 0.6rem 0 0;
  color: var(--color-muted);
}

.library-panel__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-azure);
}

.library-panel__section {
  display: grid;
  gap: 1rem;
}

.library-panel__section-header {
  display: grid;
  gap: 0.35rem;
}

.library-panel__section-header h3 {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 1.2rem;
  color: var(--color-royal);
}

.library-panel__empty {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-muted);
  background: rgba(244, 247, 251, 0.8);
  border: 1px dashed rgba(27, 109, 193, 0.2);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.4rem;
  text-align: center;
}

.library-document-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.library-document-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.library-document-list {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr;
}

.library-document-list .document-card {
  width: 100%;
}

.library-accordion {
  display: grid;
  gap: 1rem;
}

.library-accordion__item {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(27, 109, 193, 0.16);
  background: rgba(244, 247, 251, 0.92);
  overflow: hidden;
}

.library-accordion__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-royal);
}

.library-accordion__summary::-webkit-details-marker {
  display: none;
}

.library-accordion__name {
  font-size: 1rem;
}

.library-accordion__count {
  font-size: 0.82rem;
  color: var(--color-muted);
}

.library-accordion__item[open] {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 28px rgba(13, 59, 102, 0.12);
}

.library-accordion__item[open] .library-accordion__summary {
  border-bottom: 1px solid rgba(27, 109, 193, 0.12);
}

.library-accordion__item > .library-document-grid,
.library-accordion__item > p {
  padding: 1.1rem 1.2rem 1.3rem;
}

@media (max-width: 1080px) {
  .library-shell {
    grid-template-columns: 1fr;
  }

  .library-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .library-panel {
    padding: 1.6rem;
  }

  .library-document-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 640px) {
  .document-card {
    grid-template-columns: minmax(0, 1fr);
    justify-items: flex-start;
  }

  .document-card__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .document-card--row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }
}


.chatbot {
  position: fixed;
  bottom: 1.8rem;
  right: 1.8rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.chatbot__trigger {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--color-azure), var(--color-azure-light));
  color: #fff;
  font-weight: 700;
  font-size: 1.6rem;
  box-shadow: 0 16px 34px rgba(27, 109, 193, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot__trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(27, 109, 193, 0.38);
}

.chatbot__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  animation: chatbotPulse 2.2s ease-in-out infinite;
}

.chatbot__icon {
  font-size: 1.6rem;
  font-weight: 700;
}

.chatbot__trigger-label {
  position: absolute;
  right: 72px;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(13, 39, 68, 0.9);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 12px 24px rgba(13, 39, 68, 0.24);
}

.chatbot__panel {
  width: min(360px, 88vw);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 22px;
  box-shadow: 0 24px 48px rgba(13, 39, 68, 0.28);
  border: 1px solid rgba(13, 59, 102, 0.1);
  overflow: hidden;
  transform-origin: bottom right;
  animation: chatbotPanelIn 0.25s ease-out;
}

.chatbot__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  background: linear-gradient(135deg, rgba(27, 109, 193, 0.85), rgba(27, 109, 193, 0.65));
  color: #fff;
}

.chatbot__header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chatbot__expand {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.chatbot__expand:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.05);
}

.chatbot__header h2 {
  font-family: "Montserrat", sans-serif;
  margin: 0;
}

.chatbot__header p {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.82);
}

.chatbot__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.chatbot__close:hover {
  transform: rotate(90deg);
  background: rgba(255, 255, 255, 0.32);
}

.chatbot__log {
  max-height: 260px;
  overflow-y: auto;
  padding: 1.2rem 1.4rem;
  display: grid;
  gap: 0.75rem;
  background: rgba(244, 247, 251, 0.6);
}

.chatbot--expanded .chatbot__panel {
  width: min(560px, 94vw);
}

.chatbot--expanded .chatbot__log {
  max-height: 420px;
}

.chatbot--expanded .chatbot__panel {
  box-shadow: 0 32px 60px rgba(13, 39, 68, 0.3);
}

.chatbot__placeholder {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.chatbot__bubble {
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 10px 18px rgba(13, 39, 68, 0.12);
  display: grid;
  gap: 0.55rem;
}

.chatbot__bubble--user {
  background: linear-gradient(135deg, rgba(193, 18, 31, 0.85), rgba(193, 18, 31, 0.75));
  color: #fff;
  justify-self: end;
}

.chatbot__bubble--bot {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(13, 59, 102, 0.1);
  color: var(--color-royal);
  justify-self: start;
}

.chatbot__paragraph {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: inherit;
}

.chatbot__bubble p + p {
  margin-top: 0.4rem;
}

.chatbot__list {
  margin: 0.2rem 0 0.4rem 0;
  padding-left: 1.1rem;
  list-style-position: outside;
  color: inherit;
}

.chatbot__list.chatbot__list--ordered {
  list-style: decimal;
}

.chatbot__list:not(.chatbot__list--ordered) {
  list-style: disc;
}

.chatbot__list li {
  margin: 0 0 0.35rem;
  font-size: 0.94rem;
  line-height: 1.45;
}

.chatbot__list li:last-child {
  margin-bottom: 0;
}

.chatbot__bubble code {
  font-family: "Fira Code", "Consolas", monospace;
  background: rgba(13, 59, 102, 0.1);
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  font-size: 0.88rem;
}

.chatbot__bubble a {
  color: var(--color-azure);
  text-decoration: underline;
}

.chatbot__bubble a:hover {
  color: var(--color-azure-light);
}

.chatbot__status {
  min-height: 1.4rem;
  padding: 0 1.4rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.chatbot__form {
  padding: 1.2rem 1.4rem 1.5rem;
  display: grid;
  gap: 0.6rem;
}

.chatbot--expanded .chatbot__form {
  padding: 1.4rem 1.6rem 1.8rem;
}

.chatbot__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-royal);
}

.chatbot__input-group {
  display: flex;
  gap: 0.6rem;
}

.chatbot__input {
  flex: 1;
  border-radius: 14px;
  border: 1px solid rgba(13, 59, 102, 0.18);
  padding: 0.7rem 0.95rem;
  font-size: 0.95rem;
}

.chatbot__input:focus {
  outline: none;
  border-color: var(--color-azure);
  box-shadow: 0 0 0 3px rgba(27, 109, 193, 0.2);
}

.chatbot__send {
  border-radius: 12px;
  border: none;
  padding: 0.7rem 1.1rem;
  background: linear-gradient(140deg, var(--color-crimson), var(--color-crimson-light));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot__send:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(193, 18, 31, 0.28);
}

.chatbot__trigger[aria-expanded="true"] .chatbot__pulse {
  animation-play-state: paused;
}

.chatbot__trigger[aria-expanded="true"] .chatbot__trigger-label {
  display: none;
}

.chatbot__panel[hidden] {
  display: none;
}

.chatbot--loading .chatbot__send {
  cursor: wait;
  opacity: 0.7;
}

.chatbot--loading .chatbot__send::after {
  content: "...";
  margin-left: 0.3rem;
}

.chatbot--loading .chatbot__input {
  opacity: 0.7;
  pointer-events: none;
}

.chatbot--loading .chatbot__send {
  pointer-events: none;
}

.chatbot__log::-webkit-scrollbar {
  width: 6px;
}

.chatbot__log::-webkit-scrollbar-thumb {
  background: rgba(27, 109, 193, 0.35);
  border-radius: 999px;
}

@keyframes chatbotPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  70% {
    transform: scale(1.3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

@keyframes chatbotPanelIn {
  0% {
    transform: translateY(10px) scale(0.95);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
.action-inline-form {
  display: inline;
}

.site-footer {
  margin-top: auto;
  padding: 2.5rem 4vw;
  background: rgba(13, 39, 68, 0.95);
  color: #e8edf6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.site-footer__mark {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(193, 18, 31, 0.95), rgba(27, 109, 193, 0.85));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
}

.site-footer__logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.site-footer__brand strong {
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
}

.site-footer__extras {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.site-footer__link {
  color: #fff;
  font-weight: 600;
}

.viewer-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.viewer-modal.is-open {
  display: flex;
}

.viewer-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 39, 68, 0.65);
}

.viewer-modal__dialog {
  position: relative;
  width: min(1400px, 96vw);
  height: min(92vh, 960px);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 48px rgba(13, 39, 68, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

.viewer-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(13, 59, 102, 0.12);
}

.viewer-modal__title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.1rem;
  color: var(--color-royal);
}

.viewer-modal__close {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: none;
  background: rgba(27, 109, 193, 0.1);
  color: var(--color-royal);
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.viewer-modal__close:hover {
  background: rgba(27, 109, 193, 0.2);
  transform: rotate(90deg);
}

.viewer-modal__body {
  flex: 1;
  min-height: 0;
  display: flex;
  background: var(--color-sky);
}

.viewer-modal__body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.viewer-modal-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1rem;
  }

  .site-nav {
    order: 3;
    justify-content: center;
  }

  .site-actions {
    order: 2;
    justify-content: flex-end;
  }

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

@media (max-width: 860px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-highlight {
    order: -1;
  }

  .document-card,
  .document-card--compact,
  .history-card {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .document-card__actions,
  .history-card__actions {
    justify-content: flex-start;
  }

  .module__header {
    align-items: flex-start;
  }
}

@media (max-width: 680px) {
  .site-header {
    padding: 1rem 1.5rem;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .content-surface {
    padding: 2rem 1.5rem;
  }

  .hero,
  .page-hero {
    padding-inline: 1.5rem;
  }

  .hero__badge {
    margin-inline: auto;
  }

  .hero__content > p {
    margin-top: 0.8rem;
  }

  .hero-card {
    padding: 1.8rem;
  }

  .site-footer {
    padding-inline: 1.5rem;
    text-align: center;
    justify-content: center;
  }

  .chatbot {
    right: 1rem;
    bottom: 1.2rem;
  }

  .chatbot__trigger-label {
    display: none;
  }
}

@media (max-width: 520px) {
  .site-actions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .button--ghost,
  .button--outline,
  .button--primary {
    width: 100%;
    justify-content: center;
  }

  .form-grid {
    gap: 1rem;
  }

  .admin-card {
    padding: 1.8rem;
  }

  .pillar {
    padding: 1.2rem;
  }

  .category-chip {
    grid-template-columns: 1fr;
    text-align: left;
    align-items: flex-start;
  }

  .category-chip__handle {
    display: none;
  }

  .category-chip__badge {
    width: 42px;
    height: 42px;
  }

  .chatbot__panel {
    width: min(92vw, 320px);
  }
}

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

.admin-card__header--split {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.reorder-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-end;
}

.reorder-toolbar__actions {
  display: flex;
  gap: 0.5rem;
}

.reorder-toolbar__status {
  font-size: 0.85rem;
  color: var(--color-muted);
  min-height: 1.2rem;
}

.reorder-toolbar__status[data-state="success"] {
  color: #1f8a6a;
}

.reorder-toolbar__status[data-state="error"] {
  color: var(--color-crimson);
}

.reorder-surface {
  border: 1px solid rgba(13, 59, 102, 0.08);
  border-radius: var(--radius-md);
  padding: 0.2rem;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reorder-hint {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

[data-reorder-state="active"] .category-chip {
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

[data-reorder-state="active"] .category-chip.is-dragging {
  box-shadow: var(--shadow-sm);
  transform: scale(0.995);
  opacity: 0.88;
}

[data-reorder-state="active"] .category-chip__controls {
  pointer-events: none;
  opacity: 0.35;
}

.organizer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 1.5rem;
  align-items: flex-start;
}

.organizer-grid__controls {
  border: 1px solid rgba(13, 59, 102, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.organizer-list {
  border: 1px dashed rgba(27, 109, 193, 0.28);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.85);
  min-height: 220px;
  position: relative;
}

.organizer-list .reorder-toolbar {
  align-items: stretch;
}

.organizer-list__meta {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.organizer-list__loader {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.organizer-list__empty {
  font-size: 0.95rem;
  color: var(--color-muted);
  padding: 0.5rem 0;
}

.organizer-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.organizer-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(13, 59, 102, 0.12);
  background: rgba(244, 247, 251, 0.8);
  transition: box-shadow 0.15s ease;
}

.organizer-item__body {
  min-width: 0;
}

.organizer-item__title {
  margin: 0 0 0.2rem;
  font-weight: 600;
  color: var(--color-royal);
}

.organizer-item__meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.organizer-item__badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.organizer-item__handle {
  width: 18px;
  height: 38px;
  border-radius: 999px;
  background-image: radial-gradient(
      circle at 4px 4px,
      rgba(13, 59, 102, 0.35) 20%,
      transparent 20%
    ),
    radial-gradient(
      circle at 4px 14px,
      rgba(13, 59, 102, 0.35) 20%,
      transparent 20%
    ),
    radial-gradient(
      circle at 4px 24px,
      rgba(13, 59, 102, 0.35) 20%,
      transparent 20%
    );
  background-size: 8px 10px;
  background-repeat: repeat-y;
  background-position: center;
  opacity: 0.7;
}

[data-reorder-state="active"] .organizer-item {
  cursor: grab;
}

[data-reorder-state="active"] .organizer-item.is-dragging {
  opacity: 0.9;
  box-shadow: var(--shadow-sm);
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(27, 109, 193, 0.2);
  border-top-color: var(--color-azure);
  animation: spinner 0.85s linear infinite;
}

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

.library-stage__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.library-stage__toolbar-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.library-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.library-toolbar-group--sort {
  align-items: flex-start;
  flex-direction: column;
}

.library-view-toggle {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(13, 59, 102, 0.08);
  gap: 0.2rem;
}

.view-toggle-button {
  border: none;
  background: transparent;
  color: var(--color-royal);
  font-weight: 600;
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.view-toggle-button.is-active {
  background: #fff;
  color: var(--color-azure);
  box-shadow: 0 6px 18px rgba(13, 59, 102, 0.1);
}

.library-sort-select {
  border-radius: 999px;
  border: 1px solid rgba(13, 59, 102, 0.2);
  padding: 0.35rem 1.25rem;
  font-weight: 600;
  background: #fff;
  color: var(--color-royal);
  min-width: 210px;
  box-shadow: inset 0 1px 1px rgba(13, 59, 102, 0.05);
}

.library-sorter__hint {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.library-stage[data-view="grid"] .library-document-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.library-stage[data-view="grid"] .library-document-list .document-card {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.library-stage[data-view="grid"] .library-document-list .document-card__body {
  width: 100%;
}

.library-stage[data-view="grid"] .library-document-list .document-card__actions {
  width: 100%;
  justify-content: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .organizer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .library-toolbar-group {
    width: 100%;
  }
  .library-toolbar-group--sort {
    align-items: stretch;
  }
  .library-sort-select {
    width: 100%;
  }
}
