:root {
  color-scheme: light;
  --teal: #1668b8;
  --teal-dark: #0f4f96;
  --ink: #293d69;
  --muted: #78869f;
  --soft: #f4f7fb;
  --line: #e2e8f0;
  --paper: #ffffff;
  --paper-soft: #f9fbfd;
  --danger: #bb3b3b;
  --shadow: 0 18px 50px rgba(32, 56, 91, 0.11);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--soft);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

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

.is-locked .top-shell,
.is-locked .admin-drawer {
  display: none;
}

.is-locked .view-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: clamp(24px, 6vw, 56px);
  background: var(--teal);
}

.login-panel {
  display: grid;
  gap: 22px;
  width: min(100%, 420px);
  padding: clamp(28px, 5vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 26px 80px rgba(4, 35, 67, 0.22);
}

.login-panel img {
  display: block;
  width: 148px;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--teal);
}

.login-panel h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  line-height: 1.1;
}

.login-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.login-field input {
  font-size: 1.08rem;
}

.login-error {
  margin: -6px 0 0;
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 800;
}

.login-button {
  width: 100%;
  min-height: 48px;
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.top-shell {
  min-height: 138px;
  padding: 14px clamp(20px, 3vw, 34px) 18px;
  background: var(--teal);
  color: #fff;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-mark,
.menu-button,
.icon-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-mark {
  width: clamp(118px, 11vw, 138px);
  height: 28px;
  padding: 0;
  justify-items: start;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 28px;
  object-fit: contain;
  object-position: left center;
}

.menu-button {
  width: 38px;
  height: 38px;
  gap: 4px;
  padding: 7px;
}

.menu-button span {
  display: block;
  width: 30px;
  height: 3px;
  background: #fff;
}

.hero-copy {
  max-width: 980px;
  margin-top: 14px;
  display: inline-block;
  width: fit-content;
}

.hero-copy .eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.72;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.35vw, 1.7rem);
  line-height: 1.13;
  letter-spacing: 0;
  width: fit-content;
  display: inline-block;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(100%, 910px);
  min-height: 46px;
  margin-top: 14px;
  padding: 0 24px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(41, 61, 105, 0.08);
  overflow: hidden;
}

@media (min-width: 901px) {
  .top-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .top-shell .top-bar {
    grid-column: 1 / -1;
  }

  .hero-copy h1 {
    white-space: nowrap;
  }

  .search-wrap {
    width: fit-content;
    display: inline-flex;
    border-radius: 13px;
    margin-top: 14px;
    justify-self: end;
  }

  .search-wrap input::placeholder {
    font-size: calc(clamp(1rem, 1.8vw, 1.25rem) - 4px);
  }
}

.search-wrap svg {
  width: 26px;
  min-width: 26px;
  height: 26px;
  fill: none;
  stroke: #8d9bb6;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.search-wrap input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 500;
}

.search-wrap input::-webkit-search-decoration,
.search-wrap input::-webkit-search-cancel-button,
.search-wrap input::-webkit-search-results-button,
.search-wrap input::-webkit-search-results-decoration {
  display: none;
}

.search-wrap input::selection {
  background: rgba(22, 104, 184, 0.16);
}

.search-wrap input::placeholder {
  color: #a5a7ab;
}

.view-shell {
  width: min(100%, 1210px);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 38px) clamp(16px, 4vw, 36px) 72px;
  outline: none;
}

.surface {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.home-head,
.area-head,
.empty-state,
.search-results,
.article-shell {
  animation: rise-in 0.32s ease both;
}

.home-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 22px;
}

.home-head h2,
.area-title h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
}

.home-head p,
.area-title p,
.empty-state p,
.admin-note {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.home-backup-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.home-backup-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
  border: 1px solid #cdd7e5;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(41, 61, 105, 0.03);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.home-backup-button:hover,
.home-backup-button:focus-visible {
  transform: translateY(-1px);
  border-color: #7fa9d8;
  box-shadow: 0 10px 24px rgba(32, 56, 91, 0.1);
}

.home-backup-button svg {
  width: 22px;
  height: 22px;
  min-width: 22px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-backup-button span {
  display: grid;
  gap: 2px;
}

.home-backup-button strong {
  color: var(--teal-dark);
  font-size: 0.96rem;
  line-height: 1.1;
}

.home-backup-button small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.area-card,
.add-card {
  position: relative;
  min-height: 178px;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(41, 61, 105, 0.03);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.area-card {
  grid-column: span 4;
  padding: 30px 32px;
  border: 1px solid #cdd7e5;
}

.area-card.is-featured {
  grid-column: span 8;
  min-height: 240px;
}

.area-card:hover,
.area-card:focus-visible,
.procedure-row:hover,
.procedure-row:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.area-card:focus-visible,
.procedure-row:focus-visible,
.admin-action:focus-visible,
.nav-action:focus-visible,
.nav-procedure:focus-visible,
.configuration-toggle:focus-visible,
.primary-button:focus-visible,
.ghost-button:focus-visible,
.icon-button:focus-visible,
.menu-button:focus-visible {
  outline: 3px solid rgba(10, 163, 150, 0.28);
  outline-offset: 2px;
}

.area-card::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -72px;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: rgba(10, 163, 150, 0.08);
}

.area-icon,
.procedure-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: #f2fbfa;
  color: var(--teal-dark);
}

.area-icon svg,
.procedure-icon svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.area-card h3 {
  margin: 30px 0 8px;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
  line-height: 1.15;
}

.area-card p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.area-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.area-meta span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--teal);
}

.add-card {
  grid-column: span 4;
  display: grid;
  place-items: center;
  min-height: 178px;
  border: 1px dashed #b6c2d7;
  color: var(--muted);
  font-weight: 800;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 44px;
  color: #8a97b1;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 600;
}

.breadcrumb button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.breadcrumb strong {
  color: #4b5e83;
}

.breadcrumb svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.area-panel,
.article-shell,
.search-results,
.empty-state {
  padding: clamp(26px, 5vw, 66px);
}

.area-head {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 46px;
  border-bottom: 1px solid var(--line);
}

.area-title {
  min-width: 0;
}

.procedure-list {
  display: grid;
  gap: 2px;
  margin-top: 44px;
}

.edit-list-note {
  margin: 22px 0 -20px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.procedure-list.is-editing {
  gap: 8px;
}

.procedure-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-height: 76px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.procedure-row:hover {
  background: var(--paper-soft);
}

.procedure-row-editable {
  grid-template-columns: 34px 32px minmax(0, 1fr) 42px;
  min-height: 82px;
  padding: 0 6px 0 0;
  border: 1px solid transparent;
}

.procedure-row-editable:hover {
  border-color: #d7e0ec;
}

.procedure-row-editable.is-dragging {
  border-color: rgba(22, 104, 184, 0.26);
  background: #f3f8ff;
  box-shadow: var(--shadow);
  opacity: 0.82;
}

.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #7a8aa7;
  cursor: grab;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.procedure-row-content {
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.procedure-row-content:focus-visible,
.drag-handle:focus-visible {
  outline: 3px solid rgba(10, 163, 150, 0.28);
  outline-offset: 2px;
}

.danger-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  color: var(--danger);
}

.danger-icon:hover,
.danger-icon:focus-visible {
  background: rgba(187, 59, 59, 0.08);
}

.doc-mini,
.chevron {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  color: #566887;
}

.chevron {
  justify-self: end;
  color: var(--ink);
}

.procedure-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(1rem, 2vw, 1.22rem);
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.procedure-row span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.procedure-row-content > span {
  margin-top: 0;
}

.article-shell {
  position: relative;
}

.article-tools {
  position: absolute;
  top: clamp(24px, 4vw, 46px);
  right: clamp(22px, 4vw, 48px);
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(610px, calc(100% - 44px));
}

.view-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.view-option {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 132px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #c8d6e9;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.view-option:hover,
.view-option:focus-visible {
  transform: translateY(-1px);
  border-color: #7fa9d8;
  background: #fff;
}

.view-option.is-active {
  border-color: var(--teal);
  background: #eaf4ff;
  color: var(--teal-dark);
}

.view-option.is-locked {
  border-color: #d8dee8;
  background: #f2f4f8;
  color: #8d98aa;
  cursor: not-allowed;
}

.view-option span {
  display: grid;
  gap: 1px;
}

.view-option strong {
  font-size: 0.9rem;
  line-height: 1.05;
}

.view-option small {
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.78;
}

.view-option svg {
  width: 17px;
  height: 17px;
  min-width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.article-head {
  max-width: 890px;
  margin-bottom: 42px;
}

.article-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 5.8vw, 4rem);
  line-height: 1.18;
}

.article-summary {
  margin: 22px 0 0;
  color: #74819a;
  font-size: clamp(1.16rem, 2.4vw, 1.62rem);
  line-height: 1.52;
}

.article-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef6f5;
  color: #067b73;
  font-size: 0.82rem;
  font-weight: 800;
}

.article-body {
  max-width: 920px;
  color: var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.article-body h3 {
  margin: 54px 0 16px;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.22;
}

.article-body p {
  margin: 0 0 22px;
}

.article-body ul {
  display: grid;
  gap: 14px;
  margin: 0 0 26px 0;
  padding-left: 1.4em;
}

.article-body li {
  padding-left: 0.2em;
}

.procedure-table-wrap {
  width: 100%;
  margin: 30px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.procedure-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.4;
}

.procedure-table td,
.procedure-table th {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.procedure-table tr:last-child td {
  border-bottom: 0;
}

.procedure-table tr:first-child td {
  background: #f3f8fb;
  color: var(--ink);
  font-weight: 900;
}

.doc-image {
  margin: 32px 0;
}

.doc-image img {
  display: block;
  width: min(100%, 760px);
  max-height: 720px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: contain;
  background: #fff;
}

.doc-image figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.9rem;
}

.image-gallery {
  display: grid;
  gap: 22px;
  max-width: 900px;
}

.gallery-image {
  margin: 0;
}

.gallery-image img {
  display: block;
  width: 100%;
  max-height: 780px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: contain;
  background: #fff;
}

.gallery-image figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.9rem;
}

.view-empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  max-width: 680px;
  padding: 24px;
  border: 1px dashed #c4ccda;
  border-radius: var(--radius);
  background: #f7f9fc;
  color: #7b879a;
}

.view-empty-center {
  place-items: center;
  min-height: 260px;
  max-width: 900px;
  text-align: center;
}

.view-empty-center h3 {
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.view-empty span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: #edf1f6;
}

.view-empty svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.view-empty h3,
.view-empty p {
  margin: 0;
}

.video-frame {
  max-width: 900px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f172a;
}

.video-frame iframe,
.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.raw-file {
  max-width: 920px;
  margin-top: 58px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfd;
}

.raw-file h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.raw-file p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.ghost-button,
.danger-button,
.admin-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  border-radius: var(--radius);
  border: 0;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
}

.primary-button {
  padding: 0 16px;
  background: var(--teal);
  color: #fff;
}

.ghost-button {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.danger-button {
  padding: 0 14px;
  background: #fff3f3;
  color: var(--danger);
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  color: #8390aa;
}

.icon-button svg,
.primary-button svg,
.ghost-button svg,
.danger-button svg,
.admin-action svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(420px, 92vw);
  height: 100vh;
  padding: 28px;
  background: #fff;
  box-shadow: -22px 0 60px rgba(21, 36, 64, 0.16);
  transform: translateX(105%);
  transition: transform 0.22s ease;
  overflow: hidden;
}

.admin-drawer.is-open {
  transform: translateX(0);
}

.admin-drawer h2 {
  margin: 0;
  font-size: 1.45rem;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-head .admin-note {
  margin: 5px 0 0;
}

.drawer-scroll {
  height: calc(100vh - 108px);
  margin: 0 -10px;
  padding: 22px 10px 46px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer-label,
.section-kicker {
  margin: 0 0 8px;
  color: #8a97ac;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.system-navigation {
  display: grid;
  gap: 6px;
}

.nav-action,
.configuration-toggle {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 7px 11px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-weight: 800;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-action:hover,
.configuration-toggle:hover {
  background: #f2f6fb;
}

.nav-action.is-active {
  background: #eaf3fc;
  color: var(--teal-dark);
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: #72839f;
}

.nav-action.is-active .nav-icon {
  background: #fff;
  color: var(--teal);
}

.nav-icon svg,
.configuration-toggle > svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-area .nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-area-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.nav-area-meta small {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: #7b889d;
  font-size: 0.7rem;
  font-weight: 900;
}

.nav-area-meta > .chevron {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #7b889d;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s ease;
}

.nav-area-group.is-open .nav-area-meta > .chevron {
  transform: rotate(90deg);
}

.nav-procedure-list {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0 0 0 44px;
  opacity: 0;
  transition: grid-template-rows 0.2s ease, opacity 0.16s ease, margin 0.2s ease;
}

.nav-area-group.is-open .nav-procedure-list {
  grid-template-rows: 1fr;
  margin-bottom: 8px;
  opacity: 1;
}

.nav-procedure-list-inner {
  display: grid;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
  padding-left: 10px;
  border-left: 1px solid #dfe6ef;
}

.nav-procedure {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #66758d;
  text-align: left;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
}

.nav-procedure:hover,
.nav-procedure.is-active {
  background: #f0f5fa;
  color: var(--teal-dark);
}

.nav-area-overview {
  color: #52637e;
  font-weight: 850;
}

.nav-procedure span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-procedure svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drawer-empty {
  margin: 8px 10px 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.configuration-group {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.configuration-toggle {
  font-size: 0.98rem;
}

.configuration-toggle > .chevron {
  transition: transform 0.18s ease;
}

.configuration-group.is-open .configuration-toggle > .chevron {
  transform: rotate(90deg);
}

.configuration-content {
  display: none;
  gap: 8px;
  padding: 12px 0 0 44px;
}

.configuration-group.is-open .configuration-content {
  display: grid;
  animation: rise-in 0.18s ease both;
}

.configuration-content .drawer-label {
  margin-top: 14px;
}

.configuration-content .drawer-label:first-child {
  margin-top: 2px;
}

.configuration-content .admin-action {
  min-height: 42px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.configuration-content .admin-note {
  line-height: 1.45;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.admin-action {
  width: 100%;
  justify-content: flex-start;
  padding: 14px;
  background: #f6f9fc;
  color: var(--ink);
}

.admin-action:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.admin-action.is-active {
  background: #eaf3fc;
  color: var(--teal-dark);
}

.users-panel {
  padding: clamp(26px, 4vw, 52px);
}

.users-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.users-head h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
}

.users-head p:not(.section-kicker) {
  max-width: 650px;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.user-list {
  display: grid;
}

.user-row {
  display: grid;
  grid-template-columns: 46px minmax(150px, 1fr) minmax(190px, 1.35fr) auto auto auto;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.user-row.is-inactive {
  opacity: 0.6;
}

.user-avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #eaf3fc;
  color: var(--teal-dark);
  font-weight: 900;
}

.user-identity,
.user-access-summary {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.user-identity strong,
.user-access-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-identity small,
.user-access-summary small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill,
.owner-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: #68768e;
  font-size: 0.75rem;
  font-weight: 900;
}

.status-pill.is-active {
  background: #e9f7ef;
  color: #28774e;
}

.owner-pill {
  background: #edf4fc;
  color: var(--teal-dark);
}

.user-modal {
  width: min(880px, 100%);
}

.user-modal .modal-head {
  align-items: flex-start;
}

.user-modal .modal-head .section-kicker {
  margin-bottom: 5px;
}

.user-form-grid {
  gap: 24px;
}

.two-column-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.permission-group {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.permission-group legend {
  padding: 0 8px;
  color: var(--ink);
  font-weight: 900;
}

.permission-group > p {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.area-permission-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 230px;
  padding-right: 4px;
  overflow-y: auto;
}

.permission-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius);
  background: #f6f9fc;
  cursor: pointer;
}

.permission-option:has(input:checked) {
  background: #eaf3fc;
}

.permission-option input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.permission-option span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.permission-option strong {
  font-size: 0.88rem;
}

.permission-option small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.permission-master {
  background: #edf4fc;
}

.account-status {
  max-width: 330px;
}

.owner-note {
  margin: -10px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--teal);
  background: #f6f9fc;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.admin-divider {
  display: block;
  height: 1px;
  margin: 8px 0;
  background: var(--line);
}

.backup-note {
  margin: 2px 0 8px;
  font-size: 0.86rem;
}

.backup-card {
  width: min(520px, 100%);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 29, 52, 0.34);
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(92vh, 900px);
  overflow-y: auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 30px 90px rgba(18, 29, 52, 0.28);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.form-grid {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #cfd8e6;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field input,
.field select {
  min-height: 44px;
  padding: 0 12px;
}

.field textarea {
  min-height: 118px;
  padding: 12px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(10, 163, 150, 0.14);
}

.upload-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px dashed #aebbd0;
  border-radius: var(--radius);
  background: #f8fbfd;
}

.upload-box small,
.field small {
  color: var(--muted);
  line-height: 1.45;
}

.edit-panel {
  display: grid;
  gap: 18px;
}

.edit-panel[hidden] {
  display: none;
}

.image-editor-empty {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px dashed #c4ccda;
  border-radius: var(--radius);
  background: #f7f9fc;
  color: var(--muted);
}

.image-editor-empty strong {
  color: var(--ink);
}

.image-editor-list {
  display: grid;
  gap: 14px;
}

.image-editor-item {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfd;
}

.image-editor-item img {
  width: 116px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: contain;
  background: #fff;
}

.image-editor-fields {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 800;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 36px));
}

.toast {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #12213d;
  color: #fff;
  box-shadow: 0 16px 50px rgba(18, 33, 61, 0.2);
  animation: toast-in 0.22s ease both;
}

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

.empty-state .area-icon {
  margin-bottom: 18px;
}

.search-results {
  display: grid;
  gap: 22px;
}

.result-group h2 {
  margin: 0 0 12px;
}

.loading {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--muted);
  font-weight: 800;
}

.admin-only {
  display: none !important;
}

.is-admin .admin-only {
  display: inline-flex !important;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 901px) {
  .article-summary {
    font-size: clamp(0.95rem, 1.7vw, 1.12rem);
  }

  .article-body {
    font-size: clamp(0.9rem, 1.35vw, 0.95rem);
  }

  .article-body h3 {
    margin: 42px 0 12px;
    font-size: clamp(1.05rem, 2vw, 1.7rem);
  }

  .procedure-table {
    font-size: 0.82rem;
  }
}

@media (max-width: 900px) {
  .top-shell {
    min-height: 242px;
  }

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

  .area-card,
  .area-card.is-featured,
  .add-card {
    grid-column: span 6;
  }

  .article-tools {
    position: static;
    margin-bottom: 20px;
    max-width: none;
    justify-content: flex-start;
  }

  .user-row {
    grid-template-columns: 46px minmax(0, 1fr) auto;
  }

  .user-access-summary {
    grid-column: 2 / -1;
  }

  .status-pill,
  .owner-pill {
    display: none;
  }

  .permission-grid,
  .area-permission-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .top-shell {
    min-height: 250px;
    padding: 24px 20px 28px;
  }

  .hero-copy {
    margin-top: 28px;
  }

  .search-wrap {
    min-height: 62px;
    margin-top: 24px;
    padding: 0 20px;
    gap: 12px;
  }

  .search-wrap svg {
    width: 26px;
    min-width: 26px;
    height: 26px;
  }

  .search-wrap input {
    font-size: 1.08rem;
    line-height: 1.2;
  }

  .view-shell {
    padding: 20px 12px 50px;
  }

  .home-head,
  .area-head,
  .users-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .users-head .primary-button {
    width: 100%;
  }

  .user-row {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 18px 0;
  }

  .user-row > .ghost-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .user-access-summary {
    grid-column: 1 / -1;
  }

  .two-column-fields {
    grid-template-columns: 1fr;
  }

  .area-card {
    min-height: 160px;
    padding: 26px;
  }

  .area-card.is-featured {
    min-height: 190px;
  }

  .area-card h3 {
    margin-top: 24px;
  }

  .area-panel,
  .article-shell,
  .search-results,
  .empty-state {
    padding: 26px;
  }

  .breadcrumb {
    margin-bottom: 30px;
  }

  .procedure-row {
    grid-template-columns: 26px minmax(0, 1fr) 22px;
    gap: 12px;
  }

  .procedure-row strong,
  .procedure-row span {
    white-space: normal;
  }

  .view-switcher {
    width: 100%;
  }

  .view-option {
    flex: 1 1 calc(50% - 8px);
    min-width: min(150px, 100%);
  }

  .procedure-table-wrap {
    overflow: visible;
  }

  .procedure-table {
    display: block;
    min-width: 0;
    border-collapse: separate;
    font-size: 0.9rem;
  }

  .procedure-table tbody {
    display: grid;
  }

  .procedure-table tr {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(132px, 100%), 1fr));
    border-bottom: 1px solid var(--line);
  }

  .procedure-table tr:last-child {
    border-bottom: 0;
  }

  .procedure-table td,
  .procedure-table th {
    display: block;
    min-width: 0;
    padding: 12px 14px;
    border-bottom: 0;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
  }

  .modal-backdrop {
    padding: 0;
    place-items: end center;
  }

  .modal-card {
    max-height: 94vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .image-editor-item {
    grid-template-columns: 1fr;
  }

  .image-editor-item img {
    width: 100%;
    max-height: 220px;
  }
}
