:root {
  --font-sans: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  --font-display: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  --background: #eef5f1;
  --background-start: #f8fbf9;
  --surface: #ffffff;
  --surface-muted: #f7faf8;
  --text: #16231d;
  --muted: #637083;
  --muted-soft: #8a96a8;
  --line: #dce7e1;
  --line-strong: #c7d7d0;
  --brand: #1f7a4d;
  --brand-strong: #15593a;
  --brand-soft: #e8f4ee;
  --brand-tint: #f4faf6;
  --accent: #f28a20;
  --accent-strong: #b7791f;
  --support: #2f6f9f;
  --support-soft: #edf7fd;
  --mark: #fff2a8;
  --danger: #b42318;
  --radius: 8px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-sm: 0 6px 18px rgba(18, 39, 29, 0.05);
  --shadow: 0 16px 38px rgba(18, 39, 29, 0.08);
  --focus-ring: 0 0 0 0.2rem rgba(31, 122, 77, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--text);
  background: var(--background);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100%;
}

body {
  background: linear-gradient(180deg, var(--background-start) 0, var(--background) 18rem);
  color: var(--text);
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  margin: 0;
  min-height: 100vh;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--support);
  text-underline-offset: 0.18em;
}

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

::selection {
  background: rgba(31, 122, 77, 0.18);
}

mark {
  background: var(--mark);
  border-radius: 4px;
  padding: 0 0.15em;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(18, 39, 29, 0.045);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__inner {
  display: grid;
  gap: 0.85rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.8rem 1rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  gap: 0.75rem;
  min-width: 0;
  text-decoration: none;
}

.brand-link__logo {
  display: block;
  flex: 0 0 auto;
  height: auto;
  width: 4.25rem;
}

.brand-link__text {
  min-width: 0;
}

.brand-link strong,
.brand-link small {
  display: block;
}

.brand-link strong {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-link small {
  color: var(--muted);
  font-size: 0.8rem;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.header-search,
.hero-search {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.header-search {
  gap: 0.5rem;
}

.header-search__input,
.hero-search__input {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  font: inherit;
  min-height: 2.65rem;
  min-width: 0;
  padding: 0.72rem 0.85rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
  width: 100%;
}

.header-search__input:focus,
.hero-search__input:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
  outline: none;
}

.header-search__button,
.hero-search__button {
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 0.55rem 1.1rem rgba(31, 122, 77, 0.1);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 2.65rem;
  padding: 0.72rem 0.95rem;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.header-search__button:hover,
.hero-search__button:hover {
  box-shadow: 0 0.65rem 1.25rem rgba(31, 122, 77, 0.14);
  transform: translateY(-0.5px);
}

.page-shell {
  flex: 1 0 auto;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem;
  width: 100%;
}

.document-heading,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 1.1rem;
}

.hero-panel {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1.35rem;
  min-height: 24rem;
  overflow: hidden;
  padding: 1.05rem 0 1.4rem;
  position: relative;
}

.hero-panel__content {
  max-width: 48rem;
  position: relative;
  z-index: 1;
}

.hero-panel__brand {
  align-content: center;
  display: grid;
  justify-items: center;
  min-height: 13rem;
  position: relative;
}

.hero-panel__logo {
  display: block;
  height: auto;
  max-width: 17rem;
  width: min(72vw, 17rem);
  filter: drop-shadow(0 1rem 1.65rem rgba(18, 39, 29, 0.08));
}

.hero-panel h1,
.document-heading h1,
.section-heading h2 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-panel h1 {
  color: #0f1f18;
  font-size: 2.35rem;
  font-weight: 820;
  max-width: 22ch;
}

.hero-panel p,
.document-heading p,
.empty-state p {
  color: var(--muted);
  margin: 0.8rem 0 0;
}

.document-heading h1 {
  color: #101828;
  font-weight: 820;
}

.eyebrow {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

.hero-search {
  margin-top: 1.15rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.document-actions,
.document-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.document-actions {
  margin-top: 1rem;
}

.document-footer-actions {
  border-top: 1px solid var(--line);
  margin-top: 1.2rem;
  padding-top: 1rem;
}

.secondary-action {
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  color: #344054;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.secondary-action:hover {
  background: #f9fcfa;
  border-color: var(--line-strong);
  color: var(--brand-strong);
  transform: translateY(-0.5px);
}

.primary-action {
  align-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  border: 1px solid rgba(31, 122, 77, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 0.55rem 1.1rem rgba(31, 122, 77, 0.1);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.primary-action:hover {
  box-shadow: 0 0.65rem 1.25rem rgba(31, 122, 77, 0.14);
  color: #fff;
  transform: translateY(-0.5px);
}

.content-section,
.document-flow,
.result-list {
  margin-top: 1.2rem;
}

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

.chapter-list,
.result-list,
.document-flow {
  display: grid;
  gap: 0.85rem;
}

.chapter-list {
  align-items: start;
}

.chapter-card,
.result-card,
.rule-card,
.document-section {
  border: 1px solid rgba(202, 217, 209, 0.88);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
}

.chapter-card,
.result-card {
  box-shadow: var(--shadow-sm);
}

.chapter-card {
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.chapter-card:hover {
  border-color: rgba(31, 122, 77, 0.34);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.result-card {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.result-card:hover {
  border-color: rgba(47, 111, 159, 0.32);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.chapter-card__main,
.result-card__link {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  text-decoration: none;
}

.chapter-card__main {
  background: linear-gradient(180deg, #fff, #fbfdfc);
}

.chapter-card__main span,
.result-card__link span,
.document-section__header span,
.rule-card__number {
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chapter-card__main strong,
.result-card__link strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.25;
}

.chapter-card__main small {
  color: var(--muted);
}

.chapter-card__sections {
  display: grid;
  border-top: 1px solid var(--line);
}

.chapter-card__sections a,
.section-jump a {
  display: grid;
  gap: 0.12rem;
  padding: 0.78rem 1rem;
  color: var(--text);
  text-decoration: none;
}

.chapter-card__sections a + a {
  border-top: 1px solid var(--line);
}

.chapter-card__sections a:hover {
  background: var(--brand-tint);
  color: var(--brand-strong);
}

.chapter-card__sections span,
.section-jump span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chapter-card__footer {
  align-items: center;
  background: var(--surface-muted);
  border-top: 1px solid var(--line);
  color: var(--brand-strong);
  display: flex;
  font-size: 0.92rem;
  font-weight: 900;
  min-height: 3rem;
  padding: 0.78rem 1rem;
  text-decoration: none;
}

.chapter-card__footer:hover {
  background: var(--brand-tint);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: none;
}

.chapter-index {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(199, 215, 208, 0.86);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  margin: 1rem 0;
  padding: 1rem;
}

.chapter-index__heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
}

.chapter-index__heading h2 {
  font-size: 1.25rem;
  line-height: 1.15;
  margin: 0;
}

.chapter-index__heading p:last-child {
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.section-jump {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}

.document-section {
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.document-section__header a {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.2rem;
  padding: 1rem;
  background: linear-gradient(180deg, var(--brand-soft), var(--brand-tint));
  text-decoration: none;
}

.document-section__header a:hover {
  background: var(--brand-soft);
}

.document-section__header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.rule-card {
  margin: 0;
  padding: 1.05rem;
}

.document-section .rule-card {
  border-width: 1px 0 0;
  border-radius: 0;
}

.rule-card__header {
  margin-bottom: 0.55rem;
}

.rule-card__number {
  text-decoration: none;
}

.rule-card__content,
.paragraph-block__content {
  color: var(--text);
}

.rule-card__content p,
.paragraph-block__content p {
  margin: 0 0 0.75rem;
}

.rule-card__content h1,
.rule-card__content h2,
.rule-card__content h3,
.paragraph-block__content h1,
.paragraph-block__content h2,
.paragraph-block__content h3,
.rich-text-editor h1,
.rich-text-editor h2,
.rich-text-editor h3 {
  color: #101828;
  font-family: var(--font-display);
  line-height: 1.16;
  margin: 0 0 0.75rem;
}

.rule-card__content h1,
.paragraph-block__content h1,
.rich-text-editor h1 {
  font-size: 1.55rem;
}

.rule-card__content h2,
.paragraph-block__content h2,
.rich-text-editor h2 {
  font-size: 1.3rem;
}

.rule-card__content h3,
.paragraph-block__content h3,
.rich-text-editor h3 {
  font-size: 1.12rem;
}

.rule-card__content ul,
.rule-card__content ol,
.paragraph-block__content ul,
.paragraph-block__content ol,
.rich-text-editor ul,
.rich-text-editor ol {
  margin: 0 0 0.8rem;
  padding-left: 1.4rem;
}

.rule-card__content li,
.paragraph-block__content li,
.rich-text-editor li {
  margin: 0.22rem 0;
}

.rule-card__content blockquote,
.paragraph-block__content blockquote,
.rich-text-editor blockquote {
  border-left: 3px solid var(--line-strong);
  margin: 0 0 0.8rem 1.1rem;
  padding-left: 0.8rem;
}

.rule-card__content ol:not(.list-alpha),
.paragraph-block__content ol:not(.list-alpha),
.rich-text-editor ol:not(.list-alpha) {
  counter-reset: ordered-list;
  list-style: none;
  padding-left: 1.8rem;
}

.rule-card__content ol:not(.list-alpha) > li,
.paragraph-block__content ol:not(.list-alpha) > li,
.rich-text-editor ol:not(.list-alpha) > li {
  counter-increment: ordered-list;
  position: relative;
}

.rule-card__content ol:not(.list-alpha) > li::before,
.paragraph-block__content ol:not(.list-alpha) > li::before,
.rich-text-editor ol:not(.list-alpha) > li::before {
  color: var(--brand-strong);
  content: counters(ordered-list, ".") ")";
  font-weight: 800;
  left: -1.65rem;
  position: absolute;
}

.rule-card__content ol.list-alpha,
.paragraph-block__content ol.list-alpha,
.rich-text-editor ol.list-alpha {
  counter-reset: alpha-list;
  list-style: none;
  padding-left: 1.65rem;
}

.rule-card__content ol.list-alpha > li,
.paragraph-block__content ol.list-alpha > li,
.rich-text-editor ol.list-alpha > li {
  counter-increment: alpha-list;
  position: relative;
}

.rule-card__content ol.list-alpha > li::before,
.paragraph-block__content ol.list-alpha > li::before,
.rich-text-editor ol.list-alpha > li::before {
  color: var(--brand-strong);
  content: counter(alpha-list, lower-alpha) ")";
  font-weight: 800;
  left: -1.45rem;
  position: absolute;
}

.text-size-small {
  font-size: 0.9em;
}

.text-size-normal {
  font-size: 1em;
}

.text-size-large {
  font-size: 1.12em;
}

.text-size-larger {
  font-size: 1.26em;
}

.paragraph-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.paragraph-block {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(220, 231, 225, 0.86);
  border-left: 3px solid rgba(31, 122, 77, 0.46);
  border-radius: var(--radius);
  padding: 0.85rem;
}

.paragraph-block h4 {
  color: #156241;
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
}

.penalty {
  border: 1px solid transparent;
  border-radius: var(--radius);
  margin-top: 0.85rem;
  padding: 0.75rem;
}

.penalty strong {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.penalty p {
  margin: 0.2rem 0 0;
}

.penalty--light {
  background: #fff5c7;
  border-color: #f4df8b;
  color: #6a4a00;
}

.penalty--medium {
  background: #ffe2b8;
  border-color: #efbf7c;
  color: #6f3f00;
}

.penalty--serious {
  background: #ffd0c5;
  border-color: #f0a896;
  color: #7c2d12;
}

.penalty--critical {
  background: #f7c3c3;
  border-color: #e98b8b;
  color: var(--danger);
}

.penalty--neutral {
  background: var(--surface-muted);
  border-color: var(--line);
  color: var(--text);
}

.result-card p {
  color: var(--muted);
  margin: 0;
  padding: 0 1rem 1rem;
}

.site-footer {
  background: linear-gradient(180deg, #e4f0ea 0%, #cfe3d7 100%);
  border-top: 1px solid #bfd8c9;
  color: #17231d;
  margin-top: auto;
}

.site-footer__inner {
  display: grid;
  gap: 1.4rem;
  margin: 0 auto;
  max-width: 1120px;
  padding: 1.4rem 1rem;
}

.site-footer__brand {
  display: grid;
  gap: 1rem;
}

.site-footer__logo {
  display: block;
  height: auto;
  width: 8.5rem;
}

.site-footer__brand h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0;
  line-height: 1.12;
  margin: 0;
}

.site-footer__brand p,
.site-footer__links p {
  color: #315342;
  margin: 0.25rem 0 0;
}

.site-footer__eyebrow {
  color: var(--accent-strong) !important;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 0.45rem !important;
  text-transform: uppercase;
}

.site-footer__links {
  align-content: start;
  display: grid;
  gap: 0.6rem;
}

.site-footer__social {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 122, 77, 0.18);
  border-radius: var(--radius);
  color: var(--brand-strong);
  display: inline-flex;
  font-weight: 900;
  gap: 0.6rem;
  justify-self: start;
  min-height: 2.8rem;
  padding: 0.65rem 0.8rem;
  text-decoration: none;
}

.site-footer__social:hover {
  background: var(--surface);
  border-color: rgba(31, 122, 77, 0.34);
}

.site-footer__social img {
  height: 1.25rem;
  width: 1.25rem;
}

.site-footer__credit {
  background: #005f4f;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  text-align: right;
}

.site-footer__credit a {
  color: #fff;
  font-weight: 900;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  text-underline-offset: 0.18em;
}

@media (min-width: 720px) {
  .site-header__inner {
    grid-template-columns: minmax(240px, 1fr) minmax(320px, 460px);
    align-items: center;
  }

  .page-shell {
    padding: 1.4rem;
  }

  .hero-panel,
  .document-heading,
  .empty-state {
    padding: 1.6rem;
  }

  .hero-panel {
    align-items: center;
    border-bottom: 1px solid var(--line);
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
    padding-left: 0;
    padding-right: 0;
  }

  .hero-panel__brand {
    justify-items: center;
  }

  .hero-panel h1 {
    font-size: 3rem;
  }

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

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

  .site-footer__inner {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 1.8rem 1.4rem;
  }

  .site-footer__brand {
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr);
  }

}

@media (min-width: 1040px) {
  .hero-panel h1 {
    font-size: 3.6rem;
  }

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

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

.admin-body {
  background: linear-gradient(180deg, var(--background-start) 0, var(--background) 18rem);
  min-height: 100vh;
}

.admin-header {
  background:
    linear-gradient(90deg, #1c5d3f 0%, #1e7049 46%, #218255 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 30px rgba(18, 39, 29, 0.12);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.admin-header__inner {
  align-items: center;
  display: grid;
  gap: 0.85rem;
  margin: 0 auto;
  max-width: 1180px;
  padding: 0.7rem 1rem;
}

.admin-brand {
  align-items: center;
  color: #fff;
  display: inline-flex;
  gap: 0.8rem;
  min-width: 0;
  text-decoration: none;
}

.admin-brand__logo {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius);
  box-shadow: 0 0.55rem 1.4rem rgba(18, 39, 29, 0.13);
  display: block;
  height: auto;
  padding: 0.22rem;
  width: 4rem;
}

.admin-brand strong {
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.15;
}

.admin-brand strong,
.admin-brand small {
  display: block;
}

.admin-brand small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-nav form {
  display: inline-flex;
  margin: 0;
}

.admin-nav a,
.admin-nav__button {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  min-height: 2.35rem;
  padding: 0.52rem 0.7rem;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.admin-nav a:hover,
.admin-nav__button:hover {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.96);
  color: var(--brand-strong);
  box-shadow: 0 0.45rem 1.1rem rgba(18, 39, 29, 0.12);
  transform: translateY(-0.5px);
}

.admin-nav__button {
  color: #ffd9d5;
}

.admin-shell {
  flex: 1 0 auto;
  margin: 0 auto;
  max-width: 1180px;
  padding: 1.2rem 1rem 1.6rem;
  width: 100%;
}

.flash-message {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1rem;
  padding: 0.8rem 0.9rem;
}

.flash-message--notice {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.flash-message--alert {
  background: #fff1ed;
  color: var(--danger);
}

.admin-auth {
  display: grid;
  gap: 1rem;
  margin: 1.6rem auto;
  max-width: 34rem;
}

.admin-auth__brand img {
  display: block;
  height: auto;
  max-width: 14rem;
  width: 62vw;
}

.admin-page-heading {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-dashboard-hero {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 247, 0.92));
  border: 1px solid rgba(199, 215, 208, 0.86);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 1.1rem;
  position: relative;
}

.admin-dashboard-hero__copy {
  max-width: 46rem;
}

.admin-page-heading h1,
.admin-panel h1,
.admin-panel h2 {
  font-family: var(--font-display);
  font-weight: 820;
  line-height: 1.12;
  margin: 0;
}

.admin-page-heading h1 {
  font-size: 2rem;
}

.admin-page-heading p,
.admin-muted {
  color: var(--muted);
  margin: 0.45rem 0 0;
}

.admin-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(202, 217, 209, 0.88);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.admin-panel--narrow {
  max-width: 34rem;
}

.admin-panel--wide {
  max-width: 54rem;
}

.admin-panel__heading {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.admin-panel__heading a {
  color: var(--brand-strong);
  font-weight: 800;
  text-decoration: none;
}

.admin-metrics {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.admin-metrics article {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(199, 215, 208, 0.86);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-height: 6.4rem;
  overflow: hidden;
  padding: 0.9rem;
  position: relative;
}

.admin-metrics article::before {
  background: linear-gradient(90deg, var(--brand), var(--support));
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.admin-metrics span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-metrics strong {
  color: #101828;
  display: block;
  font-size: 2rem;
  line-height: 1;
  margin-top: 0.35rem;
}

.admin-metrics small {
  color: var(--muted);
  display: block;
  font-size: 0.84rem;
  margin-top: 0.35rem;
}

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

.admin-action-list,
.audit-list,
.admin-table {
  display: grid;
  gap: 0.6rem;
}

.admin-action-list a,
.audit-row,
.admin-table__row {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(220, 231, 225, 0.96);
  border-radius: var(--radius);
  color: var(--text);
  display: grid;
  gap: 0.18rem;
  padding: 0.8rem;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.admin-action-list a {
  gap: 0.25rem;
  padding: 0.9rem;
}

.admin-action-list a:hover,
.audit-row:hover {
  background: #fbfdfc;
  border-color: rgba(31, 122, 77, 0.34);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.admin-action-list strong {
  color: var(--brand-strong);
  font-weight: 900;
}

.admin-action-list span {
  color: var(--muted);
  font-size: 0.9rem;
}

.audit-row strong,
.admin-table__row strong {
  line-height: 1.2;
}

.audit-row span,
.admin-table__row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.audit-row__label {
  color: var(--brand-strong) !important;
  font-size: 0.78rem !important;
  font-weight: 900;
  text-transform: uppercase;
}

.audit-list--full {
  gap: 0.75rem;
}

.admin-table__row {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
}

.status-pill {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.25rem 0.55rem;
  text-transform: uppercase;
}

.status-pill--active {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.status-pill--inactive {
  background: #f3e5e3;
  color: var(--danger);
}

.admin-form {
  display: grid;
  gap: 0.9rem;
}

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

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

.form-field label,
.check-field {
  color: #344054;
  font-size: 0.9rem;
  font-weight: 800;
}

.form-field input,
.form-field select,
.form-field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  font: inherit;
  min-height: 2.65rem;
  padding: 0.72rem 0.8rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
  width: 100%;
}

.form-field textarea {
  min-height: 14rem;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
  outline: none;
}

.form-field small {
  color: var(--muted);
}

.check-field {
  align-items: center;
  display: inline-flex;
  gap: 0.5rem;
}

.check-field input {
  height: 1.1rem;
  width: 1.1rem;
}

.form-errors {
  background: #fff1ed;
  border: 1px solid #f2c7bd;
  border-radius: var(--radius);
  color: var(--danger);
  margin-bottom: 1rem;
  padding: 0.8rem;
}

.form-errors ul {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
}

.admin-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.regulation-editor {
  display: grid;
  gap: 1rem;
}

.regulation-editor__header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 249, 0.94));
  border: 1px solid rgba(199, 215, 208, 0.86);
  border-radius: var(--radius);
  box-shadow: 0 14px 32px rgba(18, 39, 29, 0.06);
  display: grid;
  gap: 1.15rem;
  overflow: hidden;
  padding: 1.15rem;
  position: relative;
}

.regulation-editor__heading {
  min-width: 0;
}

.regulation-editor__heading h1,
.regulation-editor__card h2 {
  color: #101828;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

.regulation-editor__heading h1 {
  font-size: 1.85rem;
  max-width: 22ch;
}

.regulation-editor__heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.98rem;
  margin: 0.65rem 0 0;
  max-width: 64rem;
}

.regulation-editor__header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.regulation-editor__header-actions .secondary-action {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(199, 215, 208, 0.9);
  box-shadow: var(--shadow-xs);
  color: var(--brand-strong);
  min-height: 2.45rem;
  padding: 0.6rem 0.82rem;
}

.regulation-editor__summary {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.regulation-editor__summary article {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 4.9rem;
  padding: 0.78rem 0.85rem;
}

.regulation-editor__summary-label {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.regulation-editor__summary strong {
  color: #101828;
  display: block;
  font-size: 1.1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.regulation-editor__card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(202, 217, 209, 0.88);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.regulation-editor__card-header {
  align-items: start;
  background: linear-gradient(180deg, #fff, #fbfdfc);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 1rem;
}

.regulation-editor__card h2 {
  font-size: 1.35rem;
}

.regulation-editor__form,
.regulation-editor .form-errors {
  margin: 1rem;
}

.regulation-editor__content-field textarea {
  line-height: 1.55;
  min-height: 19rem;
}

.regulation-editor__field-label-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
}

.formatting-toolbar {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0.45rem 0.5rem;
  width: 100%;
}

.formatting-toolbar__group {
  align-items: center;
  border-right: 1px solid #d8e4de;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.08rem;
  margin-right: 0.35rem;
  padding-right: 0.35rem;
}

.formatting-toolbar__group:last-child {
  border-right: 0;
  margin-right: 0;
  padding-right: 0;
}

.formatting-toolbar__button {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: none;
  color: #344054;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 900;
  flex: 0 0 auto;
  height: 1.85rem;
  justify-content: center;
  min-width: 1.85rem;
  padding: 0 0.45rem;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.formatting-toolbar__button:hover {
  background: #f3f7f5;
  border-color: #d8e4de;
  color: var(--brand-strong);
}

.form-field .formatting-toolbar__select {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: none;
  color: #344054;
  flex: 0 1 8.5rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  height: 1.85rem;
  min-width: 7rem;
  padding: 0 0.45rem;
  width: 8.5rem;
}

.form-field .formatting-toolbar__select:hover {
  background: #f3f7f5;
}

.form-field .formatting-toolbar__select:focus {
  border-color: var(--brand);
  outline: none;
}

.formatting-toolbar__button--italic {
  font-style: italic;
}

.formatting-toolbar__button--underline {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.rich-text-editor {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-xs);
  color: var(--text);
  line-height: 1.55;
  min-height: 19rem;
  overflow: auto;
  padding: 0.9rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.rich-text-editor:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
  outline: none;
}

.rich-text-editor p,
.rich-text-editor div {
  margin: 0 0 0.75rem;
}

.rich-text-editor__source {
  display: none;
}

.regulation-editor__penalty-grid {
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem;
}

.regulation-editor__actions {
  border-top: 1px solid var(--line);
  margin-left: -1rem;
  margin-right: -1rem;
  margin-top: 0.2rem;
  padding: 1rem 1rem 0;
}

.admin-tree-list {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(202, 217, 209, 0.88);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 0;
  overflow: hidden;
}

.admin-tree-node {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.admin-tree-node summary {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1.8rem minmax(0, 1fr);
  list-style: none;
  min-height: 4.2rem;
  padding: 0.75rem 0.85rem;
}

.admin-tree-node summary::-webkit-details-marker {
  display: none;
}

.admin-tree-node summary:hover {
  background: #fbfdfc;
}

.admin-tree-node__toggle {
  align-items: center;
  background: var(--brand-soft);
  border: 1px solid rgba(31, 122, 77, 0.2);
  border-radius: 999px;
  color: var(--brand-strong);
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 900;
  height: 1.55rem;
  justify-content: center;
  width: 1.55rem;
}

.admin-tree-node__toggle::before {
  content: "+";
}

.admin-tree-node[open] > summary .admin-tree-node__toggle::before {
  content: "-";
}

.admin-tree-node--leaf > summary .admin-tree-node__toggle {
  background: #f7faf7;
  border-color: var(--line);
  color: var(--muted);
}

.admin-tree-node--leaf > summary .admin-tree-node__toggle::before {
  content: "";
}

.admin-tree-node__summary {
  align-items: start;
  display: grid;
  gap: 0.7rem;
}

.admin-tree-node__copy {
  min-width: 0;
}

.admin-tree-node__copy strong,
.admin-tree-node__copy small {
  display: block;
}

.admin-tree-node__copy strong {
  color: var(--brand);
  font-size: 0.86rem;
  line-height: 1.25;
}

.admin-tree-node__copy small {
  color: var(--text);
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-tree-node__children {
  background: #f8fbf9;
  display: grid;
  gap: 0;
  padding: 0;
}

.admin-tree-node__children .admin-tree-node summary {
  border-bottom: 1px solid var(--line);
}

.admin-tree-node--level-1 summary {
  padding-left: 1.4rem;
}

.admin-tree-node--level-2 summary {
  padding-left: 2rem;
}

.admin-tree-node--level-3 summary {
  padding-left: 2.6rem;
}

.admin-tree-node--level-1 summary,
.admin-tree-node--level-2 summary,
.admin-tree-node--level-3 summary {
  background: rgba(255, 255, 255, 0.72);
}

.admin-inline-action {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(31, 122, 77, 0.24);
  border-radius: var(--radius);
  color: var(--brand-strong);
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 900;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0.45rem 0.65rem;
  text-decoration: none;
}

.admin-inline-action:hover {
  background: var(--brand-tint);
  border-color: rgba(31, 122, 77, 0.36);
}

.audit-json {
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  margin: 0;
  overflow: auto;
  padding: 0.85rem;
  white-space: pre-wrap;
}

@media (min-width: 760px) {
  .admin-header__inner {
    align-items: center;
    grid-template-columns: minmax(220px, 1fr) auto;
  }

  .admin-page-heading {
    align-items: end;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-page-heading h1 {
    font-size: 2.55rem;
  }

  .admin-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

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

  .form-grid {
    grid-template-columns: minmax(12rem, 0.8fr) minmax(0, 1.2fr);
  }

  .regulation-editor__header {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 1.35rem 1.45rem;
  }

  .regulation-editor__heading h1 {
    font-size: 2.65rem;
  }

  .formatting-toolbar {
    overflow-x: visible;
  }

  .regulation-editor__summary {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .regulation-editor__header-actions {
    justify-content: end;
  }

  .regulation-editor__card-header,
  .regulation-editor__form,
  .regulation-editor .form-errors {
    margin-left: 0;
    margin-right: 0;
  }

  .regulation-editor__card-header {
    padding: 1.25rem 1.35rem;
  }

  .regulation-editor__form,
  .regulation-editor .form-errors {
    margin: 1.35rem;
  }

  .regulation-editor__actions {
    margin-left: -1.35rem;
    margin-right: -1.35rem;
    padding: 1.1rem 1.35rem 0;
  }

  .admin-tree-node__summary {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-tree-node--level-1 summary {
    padding-left: 2rem;
  }

  .admin-tree-node--level-2 summary {
    padding-left: 3rem;
  }

  .admin-tree-node--level-3 summary {
    padding-left: 4rem;
  }
}
