:root {
  --ink: #1c2430;
  --blue: #3a6ea5;
  --navy: #1e3354;
  --paper: #fbf8f2;
  --max: 1400px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}
a { color: var(--navy); }
a:focus, button:focus, input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
.site-header, .site-footer {
  width: 100%;
  background: #eef3f8;
}
.site-header { border-bottom: 1px solid #d5deea; }
.site-footer { border-top: 1px solid #d5deea; margin-top: 3rem; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.7rem 0;
}
.brand { display: flex; align-items: center; gap: 1.25rem; text-decoration: none; color: inherit; }
.brand img { height: 200px; width: auto; display: block; }
.header-menus {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  min-width: 0;
}
.nav-line {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 1.1rem;
}
.menu-rule {
  width: 100%;
  margin: 0.1rem 0;
  border: 0;
  border-top: 1px solid #c5d0de;
}
.admin-subnav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.brand-text { display: flex; flex-direction: column; }
.brand-title {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 650;
  color: var(--navy);
}
.brand-sub {
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--blue);
  font-size: 1.05rem;
}
.desktop-nav ul {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.desktop-nav a { font-family: "Segoe UI", Arial, sans-serif; text-decoration: none; font-weight: 600; white-space: nowrap; }
.lang-switch { margin: 0; }
.lang-switch select {
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 600;
  color: var(--navy);
  background: #fff;
  border: 1px solid #c5d0de;
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  min-height: 36px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.site-main { padding: 2rem 0 5rem; }
.card {
  border-radius: 18px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 0 rgba(30, 51, 84, 0.06);
}
.grid .card { margin-bottom: 0; }
a.card-link, a.row-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
a.row-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
a.card-link.tint-cream:hover, a.row-link.tint-cream:hover { background: #ead9b8; }
a.card-link.tint-sand:hover, a.row-link.tint-sand:hover { background: #e6d6be; }
a.row-link.tint-paper:hover { background: #e4e0d6; }
.form-card {
  width: min(36rem, 100%);
  margin-inline: auto;
}
@media (min-width: 901px) {
  .form-card { width: min(36rem, 100%); }
}
.tint-blue { background: #e8f0f8; }
.tint-bluewhite { background: #f2f6fb; }
.tint-cream { background: #f7f1e3; }
.tint-beige { background: #efe6d6; }
.tint-sand { background: #f3eadc; }
.tint-blush { background: #f7ecec; }
.tint-paper { background: #f6f4ef; }
.grid { display: grid; gap: 1.25rem; margin-bottom: 1.25rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.lead { font-size: 1.2rem; }
.btn, button.btn {
  display: inline-block;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  min-height: 44px;
  cursor: pointer;
}
.btn-quiet { background: #6b7c93; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.stack-form { display: grid; gap: 0.9rem; width: 100%; max-width: 36rem; margin-inline: auto; }
.stack-form label, .search-row label { display: grid; gap: 0.3rem; font-weight: 600; }
.stack-form input:not([type="checkbox"]), .stack-form textarea, .stack-form select, .search-row input {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid #c5cdd8;
  border-radius: 10px;
  background: #fff;
}
.stack-form label.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}
.stack-form input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  flex: none;
  accent-color: var(--navy);
}
.search-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  width: 50%;
  max-width: 50%;
  margin-bottom: 1rem;
}
.search-row label { flex: 1; min-width: 0; }
.search-row input { width: 100%; }
.search-row .btn { flex: 0 0 auto; }
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(28, 36, 48, 0.45);
}
.modal-layer[hidden] { display: none; }
.modal-card {
  width: min(28rem, 92%);
  background: #fff;
  border-radius: 16px;
  padding: 1.4rem 1.5rem;
  box-shadow: 0 12px 32px rgba(30, 51, 84, 0.18);
}
.modal-card h2 { margin-top: 0; }
.modal-card label { display: grid; gap: 0.3rem; font-weight: 600; margin: 0.8rem 0 1rem; }
.modal-card input {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid #c5cdd8;
  border-radius: 10px;
}
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-error, .banner-err { color: #7a1f1f; }
.banner { padding: 0.7rem 1rem; border-radius: 12px; }
.banner-ok { background: #e5f0e4; }
.banner-err { background: #f6e4e4; }
.chapter-list { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.chapter-list li { display: block; margin: 0; }
.book-column {
  width: min(900px, 100%);
  margin-inline: auto;
}
.chapter-body {
  line-height: 1.7;
}
.chapter-body h1 { font-size: 1.4rem; }
.chapter-title { font-size: 1.5rem; font-weight: 700; }
.chapter-jump ol { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; }
.chapter-jump a, .chapter-jump span {
  display: inline-flex; min-width: 2rem; min-height: 2rem; align-items: center; justify-content: center;
}
.chapter-pager { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; }
.click-table { width: 100%; border-collapse: collapse; }
.click-table th, .click-table td { text-align: left; padding: 0.7rem 0.5rem; border-bottom: 1px solid #ddd4c6; }
.click-table tbody tr { cursor: pointer; }
.click-table tbody tr:hover, .click-table tbody tr:focus { background: #efe7d8; }
.hint { font-size: 0.95rem; color: #3d4a5c; }
.check { display: flex; align-items: center; gap: 0.5rem; }
.footer-inner { padding: 1.5rem 0; font-family: "Segoe UI", Arial, sans-serif; }
.float-top, .float-menu {
  position: fixed;
  z-index: 40;
  min-width: 48px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
  bottom: calc(1rem + env(safe-area-inset-bottom));
}
.float-top { left: calc(1rem + env(safe-area-inset-left)); }
.float-menu { right: calc(1rem + env(safe-area-inset-right)); display: none; }
.mobile-drawer {
  position: fixed;
  inset: auto 1rem calc(5rem + env(safe-area-inset-bottom)) auto;
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1.2rem;
  box-shadow: 0 8px 24px rgba(30, 51, 84, 0.15);
  z-index: 39;
}
.mobile-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.mobile-nav a { font-family: "Segoe UI", Arial, sans-serif; font-size: 1.1rem; min-height: 44px; display: flex; align-items: center; }
.mobile-drawer .menu-rule { margin: 0.85rem 0 0.75rem; }
.mobile-drawer .lang-switch { margin: 0; }
.mobile-drawer .lang-switch select { width: 100%; }
img.ei-reveal:not(.ei-in) {
  opacity: 0;
  transform: translateX(100px);
}
.site img {
  transition: opacity 1.5s ease, transform 1.5s ease;
}
img.ei-in {
  opacity: 1;
  transform: translateX(0);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  img.ei-reveal, .site img, img.ei-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
@media (max-width: 900px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .brand { flex-direction: column; align-items: flex-start; }
  .brand img { height: 90px; }
  .desktop-nav, .header-lang, .nav-line { display: none; }
  .float-menu { display: inline-flex; align-items: center; justify-content: center; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .search-row { width: 50%; max-width: 50%; }
  .modal-card { width: calc(100vw - 1.5rem); }
}
