:root {
  --zds-bg: #f3f6fb;
  --zds-text: #0f172a;
  --zds-muted: #475569;
  --zds-line: #dbe3ef;
  --zds-panel: #ffffff;
  --zds-dark: #111827;
  --zds-dark-hover: #1f2937;
  --zds-blue: #2563eb;
  --zds-green: #0c8f7a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--zds-text);
  background: var(--zds-bg);
}

a {
  color: inherit;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--zds-blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

button svg,
.button-link svg,
.nav svg,
.menu-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  color: var(--zds-text);
  background: #fff;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
}

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

.content {
  min-height: 100vh;
  padding: 28px 32px;
}

.top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--zds-muted);
  font-weight: 600;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 6px;
  background: var(--zds-dark);
  color: #fff;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  background: transparent;
  color: #334155;
  text-decoration: none;
  font-weight: 600;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--zds-line);
  margin-bottom: 20px;
}

h1 {
  margin: 0 0 12px;
  font-size: 30px;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.panel {
  background: var(--zds-panel);
  border: 1px solid var(--zds-line);
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .06);
  padding: 18px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, .42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 300px;
  padding: 18px;
  overflow: auto;
  background: var(--zds-dark);
  color: #fff;
  box-shadow: 18px 0 42px rgba(15, 23, 42, .22);
  transform: translateX(-100%);
  transition: transform .18s ease;
}

body.menu-open .sidebar {
  transform: translateX(0);
}

body.menu-open .menu-overlay {
  opacity: 1;
  pointer-events: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: #0c8f7a;
  font-weight: 800;
}

.brand span {
  display: block;
  color: #cbd5e1;
  font-size: 13px;
}

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

.nav-bottom {
  margin-top: auto;
}

.nav-item,
.tree-module summary {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 11px 12px;
  border-radius: 6px;
  color: #e5e7eb;
  background: transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.nav-item svg,
.tree-module summary svg {
  color: #93c5fd;
}

.nav-item:hover,
.tree-module summary:hover {
  background: var(--zds-dark-hover);
}

.tree-module {
  margin: 0;
}

.tree-module summary {
  list-style: none;
}

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

.tree-module summary small {
  margin-left: auto;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  text-align: center;
  font-size: 12px;
}

.tree-article {
  margin: 6px 0 10px 18px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, .14);
}

.tree-link {
  display: block;
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #dce7f1;
  text-decoration: none;
  font-size: 13px;
}

.tree-link {
  font-weight: 700;
}

.tree-link:hover {
  background: rgba(255, 255, 255, .1);
}

.tree-link.active {
  color: #111827;
  background: #fff;
}

.menu-data {
  margin-top: 8px;
  border-top: 1px solid #334155;
  padding-top: 16px;
  display: grid;
  gap: 5px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.35;
}

.menu-data strong {
  color: #fff;
  font-size: 13px;
}

.breadcrumbs {
  margin-bottom: 4px;
  color: var(--zds-green);
  font-size: 13px;
  font-weight: 700;
}

.article {
  max-width: 1080px;
}

.lead {
  margin-top: 0;
  color: #506070;
  font-size: 17px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 24px;
}

.tags span {
  padding: 6px 10px;
  border: 1px solid #cae1dd;
  border-radius: 999px;
  background: #eef6f5;
  color: #0a6c5f;
  font-size: 13px;
  font-weight: 700;
}

.help-section {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.help-section:target,
.help-section.anchor-active {
  border-color: var(--zds-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.section-body {
  line-height: 1.65;
}

.media-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  background: #eef2f7;
}

.image-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.image-list img {
  width: 100%;
  border: 1px solid var(--zds-line);
  border-radius: 6px;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.hero {
  padding: 28px;
  border: 1px solid var(--zds-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .06);
}

.hero h1 {
  margin: 6px 0 10px;
  font-size: 30px;
}

.eyebrow,
.section-heading span {
  margin: 0;
  color: var(--zds-green);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 10px;
}

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

.product-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--zds-line);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .04);
}

.product-card:hover {
  border-color: var(--zds-blue);
}

.product-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: var(--zds-blue);
  color: #fff;
  font-weight: 800;
}

.product-card span {
  color: var(--zds-green);
  font-size: 12px;
  text-transform: uppercase;
}

.product-card strong {
  font-size: 21px;
}

.product-card small {
  color: var(--zds-muted);
}

.product-card em {
  color: var(--zds-blue);
  font-style: normal;
  font-weight: 700;
}

.admin-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--zds-bg);
}

.admin-side {
  padding: 18px;
  background: var(--zds-dark);
  color: #fff;
}

.admin-user {
  display: grid;
  gap: 5px;
  margin: 18px 0;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

.admin-user small {
  color: #93c5fd;
  text-transform: uppercase;
}

.admin-user em {
  color: #cbd5e1;
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.admin-products {
  display: grid;
  gap: 8px;
}

.admin-products button {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 2px 10px;
  width: 100%;
  justify-content: flex-start;
  min-height: auto;
  padding: 11px 12px;
  border-radius: 6px;
  background: transparent;
  color: #e5e7eb;
  text-align: left;
}

.admin-products button:hover,
.admin-products button.active {
  background: #fff;
  color: #111827;
}

.admin-products span {
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(37, 99, 235, .15);
  font-weight: 800;
  text-transform: uppercase;
}

.admin-products small {
  color: #94a3b8;
}

.admin-main {
  padding: 28px 32px;
}

.admin-header,
.editor-panel,
.editor-empty {
  padding: 18px;
  border: 1px solid var(--zds-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .06);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-actions button {
  min-height: 38px;
  border: 1px solid #94a3b8;
  background: #fff;
  color: #12324a;
}

.admin-actions button.primary {
  border-color: var(--zds-blue);
  background: var(--zds-blue);
  color: #fff;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 16px;
}

.editor-panel details {
  margin-bottom: 10px;
}

.editor-panel summary {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-radius: 6px;
  background: #eef2f7;
  color: #0f172a;
  cursor: pointer;
  font-weight: 800;
}

.article-row {
  display: grid;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #dce8ee;
  border-radius: 6px;
  background: #fff;
  color: var(--zds-text);
  text-align: left;
}

.article-row.active,
.article-row:hover {
  border-color: var(--zds-blue);
  background: #f8fbff;
}

.article-row small {
  margin-top: 3px;
  color: var(--zds-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.tag-editor {
  margin: 16px 0;
}

.tag-editor div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag-editor span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef6f5;
  color: #0b6f63;
  font-size: 13px;
  font-weight: 700;
}

.section-editor-list {
  display: grid;
  gap: 12px;
}

.section-editor-list article {
  border: 1px solid #dce8ee;
  border-radius: 8px;
  overflow: hidden;
}

.section-editor-list header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f3f7fa;
}

.section-preview {
  padding: 12px;
  color: #314658;
}

code {
  padding: 2px 5px;
  background: #edf2f7;
  border-radius: 4px;
}

@media (min-width: 980px) {
  .portal-shell .sidebar {
    transform: none;
  }

  .portal-shell .content {
    margin-left: 300px;
  }

  .portal-shell .menu-toggle {
    display: none;
  }
}

@media (max-width: 920px) {
  .content,
  .admin-main {
    padding: 18px;
  }

  .grid,
  .editor-grid,
  .form-grid,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-side {
    position: static;
  }
}
