:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5f6b7a;
  --accent: #0b6e8c;
  --accent-hover: #095a73;
  --accent-soft: #e8f4f8;
  --warm: #b87333;
  --warm-soft: #fdf4eb;
  --heading: #0f3444;
  --border: #dde3ea;
  --border-strong: #c5ced8;
  --shadow-sm: 0 1px 2px rgba(15, 52, 68, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 52, 68, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 52, 68, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --max-width: 1080px;
  --header-height: auto;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition: 0.18s ease;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* ── Top bar ── */

.site-topbar {
  background: linear-gradient(90deg, #0f3444 0%, #164d63 100%);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.site-topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 7px 20px;
}

.site-tagline {
  opacity: 0.95;
}

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 10px;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.site-userbar {
  font-size: 0.875rem;
  color: var(--muted);
  text-align: right;
}

.site-userbar a {
  color: var(--accent);
  font-weight: 500;
}

.site-user-logout {
  font: inherit;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-user-logout:hover {
  color: var(--accent);
}

.site-logo {
  display: inline-flex;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
}

.site-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  color: var(--heading);
}

.site-nav-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.site-nav-toggle-icon {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
  border-radius: 1px;
}

.site-nav-toggle-icon::before,
.site-nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--transition), top var(--transition);
}

.site-nav-toggle-icon::before { top: -6px; }
.site-nav-toggle-icon::after { top: 6px; }

.site-nav-toggle[aria-expanded="true"] .site-nav-toggle-icon {
  background: transparent;
}

.site-nav-toggle[aria-expanded="true"] .site-nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.site-nav-toggle[aria-expanded="true"] .site-nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.hidden {
  display: none !important;
}

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

/* ── Main navigation ── */

.site-menu {
  border-top: 1px solid var(--border);
}

.site-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.site-nav > li {
  position: relative;
}

.site-nav > li > a,
.site-nav > li > .nav-parent {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.site-nav > li > .nav-parent {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

.site-nav > li > a:hover,
.site-nav > li > .nav-parent:hover,
.site-nav > li.active > a,
.site-nav > li.active > .nav-parent {
  color: var(--accent);
  background: var(--accent-soft);
}

.site-nav .has-children > a::after,
.site-nav .has-children > .nav-parent::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.55;
  transition: transform var(--transition);
}

.site-nav .nav-child {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  min-width: 260px;
  max-width: 320px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.site-nav .has-children:hover > .nav-child,
.site-nav .has-children:focus-within > .nav-child,
.site-nav .has-children.open > .nav-child {
  display: block;
}

.site-nav .nav-child a {
  display: block;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--text);
  text-decoration: none;
  line-height: 1.35;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.site-nav .nav-child a:hover,
.site-nav .nav-child a:focus,
.site-nav .nav-child .active a {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── Sub navigation: contents + breadcrumbs ── */

.site-subnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-subnav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-contents {
  position: relative;
  flex: 0 0 auto;
}

.site-contents-empty {
  display: none;
}

.site-contents-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.site-contents-toggle::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.55;
  transition: transform var(--transition);
}

.site-contents.is-open .site-contents-toggle {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.site-contents.is-open .site-contents-toggle::after {
  transform: rotate(180deg);
}

.site-contents-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 120;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 40px));
  max-height: min(420px, calc(100vh - 120px));
  overflow: auto;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.site-contents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.site-contents-list a {
  display: block;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 450;
  text-decoration: none;
  line-height: 1.35;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.site-contents-list a:hover,
.site-contents-list a:focus {
  color: var(--accent);
  background: var(--accent-soft);
}

.site-contents-list .active a {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 550;
}

.site-breadcrumbs {
  flex: 1 1 auto;
  min-width: 0;
}

.site-breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.site-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: var(--muted);
}

.site-breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin: 0 8px;
  color: var(--border);
}

.site-breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}

.site-breadcrumbs a:hover {
  color: var(--accent);
}

.site-breadcrumbs li[aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

.site-breadcrumb-label {
  color: var(--muted);
}

/* Admin inline editor */

.site-admin-editor-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: rgba(24, 28, 34, 0.96);
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
}

.site-admin-editor-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.site-admin-editor-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.site-admin-editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.site-admin-editor-btn,
.site-admin-editor-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.site-admin-editor-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}

.site-admin-editor-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.site-admin-editor-btn.is-primary {
  background: var(--accent);
  border-color: var(--accent);
}

.site-admin-editor-btn.is-primary:hover {
  filter: brightness(1.05);
}

.site-admin-editor-link {
  color: #fff;
  border: 1px solid transparent;
}

.site-admin-editor-link:hover {
  color: #fff;
  text-decoration: underline;
}

.site-admin-editor-status {
  margin-left: auto;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.72);
}

.site-admin-editor-status.is-success {
  color: #9ae6b4;
}

.site-admin-editor-status.is-error {
  color: #feb2b2;
}

body.site-admin-editing {
  padding-bottom: 72px;
}

/* Full-screen admin editor (Joomla-style) */

body.site-admin-edit-open {
  overflow: hidden;
}

body.site-admin-edit-open .site-admin-editor-bar {
  display: none;
}

.site-admin-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.site-admin-edit-top {
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.site-admin-edit-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  max-width: none;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

.site-admin-edit-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-admin-edit-kicker {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.site-admin-edit-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.site-admin-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.site-admin-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.site-admin-edit-btn:hover {
  background: var(--bg);
}

.site-admin-edit-btn.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.site-admin-edit-btn.is-primary:hover {
  filter: brightness(1.05);
}

.site-admin-edit-status {
  width: 100%;
  font-size: 0.8125rem;
  color: var(--muted);
}

.site-admin-edit-status.is-success {
  color: #276749;
}

.site-admin-edit-status.is-error {
  color: var(--danger);
}

.site-admin-edit-editor-host {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 12px 20px 16px;
}

.site-admin-edit-canvas {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
}

.site-admin-edit-canvas .tox-tinymce {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.site-admin-edit-canvas .tox-editor-header {
  flex: 0 0 auto;
}

.site-admin-edit-content {
  font-size: 1rem;
  line-height: 1.65;
  padding: 16px 20px;
}

.hidden {
  display: none !important;
}

/* ── Main content ── */

.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.site-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px 36px;
}

.page-title {
  margin: 0 0 24px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 650;
  color: var(--heading);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.article-body {
  font-size: 1rem;
  line-height: 1.7;
}

.article-body h1 {
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  color: var(--heading);
  margin: 0 0 0.75em;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.article-body h2 {
  font-size: 1.25rem;
  color: var(--heading);
  margin: 1.5em 0 0.6em;
  font-weight: 600;
  padding-bottom: 0.35em;
  border-bottom: 2px solid var(--warm-soft);
}

.article-body h3,
.article-body h4 {
  margin: 1.25em 0 0.5em;
  font-weight: 600;
  color: var(--text);
}

.site-doc-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.site-doc-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.site-doc-nav-link:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
}

.site-doc-nav-next {
  margin-left: auto;
}

.article-body h4 {
  font-size: 1.0625rem;
  color: var(--warm);
}

.article-body h5,
.article-body h6 {
  margin: 0.9em 0 0.4em;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--muted);
}

.article-body .red,
.article-body .star {
  color: #c0392b;
}

.article-body .text {
  text-align: left;
}

.article-body p {
  margin: 0 0 1em;
}

.article-body ul,
.article-body ol {
  padding-left: 1.4em;
  margin: 0 0 1em;
}

.article-body li {
  margin-bottom: 0.35em;
}

.article-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover {
  text-decoration: none;
}

.article-body table,
.article-body .content-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25em;
  font-size: 0.9375rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.article-body td,
.article-body th {
  padding: 10px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.article-body tr:last-child td,
.article-body tr:last-child th {
  border-bottom: 0;
}

.article-body td:last-child,
.article-body th:last-child {
  border-right: 0;
}

.article-body th {
  background: var(--accent-soft);
  font-weight: 600;
  text-align: left;
}

/* Home page */

.home-welcome {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  text-align: center;
}

.home-welcome h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  color: var(--heading);
}

.home-welcome p {
  margin: 0 auto;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.home-section {
  margin-bottom: 28px;
}

.home-section:last-child {
  margin-bottom: 0;
}

.home-section-title {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 650;
  color: var(--heading);
}

.site-article-home .home-table {
  margin-top: 0;
}

.site-article-home .home-table-services tr {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.site-article-home .home-table-programs tr {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.site-article-home .home-table td h3 {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 1.125rem;
  color: var(--heading);
}

.site-article-home .home-table td h3 img {
  width: 32px;
  height: auto;
}

.site-article-home .home-card-subtitle {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.site-article-home .home-card-empty {
  min-height: 160px;
  background: var(--surface);
  border-style: dashed;
  box-shadow: none;
}

.site-article-home .home-card-empty:hover {
  border-color: var(--border);
  box-shadow: none;
}

/* Home page product cards */

.site-article-home .content-table {
  display: block;
  background: none;
  border: 0;
  border-radius: 0;
  overflow: visible;
  margin-top: 1.5rem;
}

.site-article-home .content-table tbody {
  display: block;
}

.site-article-home .content-table tr {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.site-article-home .content-table tr:last-child {
  margin-bottom: 0;
}

.site-article-home .content-table td {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.site-article-home .content-table td:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.site-article-home .content-table td h2 {
  margin-top: 0;
  border-bottom: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-article-home .content-table td h2 img {
  width: 32px;
  height: auto;
}

@media (max-width: 900px) {
  .site-article-home .home-table-programs tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-article-home .home-table-services tr,
  .site-article-home .home-table-programs tr {
    grid-template-columns: 1fr;
  }

  .home-welcome {
    padding: 22px 20px;
  }
}

/* Section link lists */

.section-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.section-links li {
  margin: 0;
}

.section-links a {
  display: block;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.section-links a:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateX(3px);
}

.section-links-docs li {
  margin-bottom: 0;
}

/* Cutting embed */

.cutting-embed iframe {
  display: block;
  width: 100%;
  min-height: 920px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

/* ── Comments ── */

.comments-block {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.site-doc-nav + .comments-block {
  margin-top: 1.75rem;
  padding-top: 0;
  border-top: 0;
}

.comments-title {
  font-size: 1.25rem;
  color: var(--heading);
  margin: 0 0 20px;
  font-weight: 650;
}

.comment-item {
  margin-bottom: 12px;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.comment-children {
  margin-top: 12px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 3px solid var(--accent-soft);
}

.comment-children .comment-item {
  background: var(--surface);
}

.comment-actions {
  margin-top: 10px;
}

.comment-reply-btn {
  padding: 6px 12px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.comment-reply-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.comments-reply-hint {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9375rem;
}

.comments-reply-hint.hidden {
  display: none;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.comment-meta strong {
  color: var(--heading);
  font-weight: 600;
}

.comments-note,
.contact-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.comments-form {
  display: grid;
  gap: 16px;
  max-width: 640px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.comments-form-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 650;
  color: var(--heading);
}

.comments-form label {
  display: grid;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.comments-form .hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.comments-form input,
.comments-form textarea {
  font: inherit;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.comments-form input:focus,
.comments-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 110, 140, 0.15);
}

.comments-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.comments-form button {
  padding: 10px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--radius-sm);
  border: 0;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.comments-form button[type="submit"] {
  background: var(--accent);
  color: #fff;
}

.comments-form button[type="submit"]:hover {
  background: var(--accent-hover);
}

.comments-form button[type="button"] {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border-strong);
}

.comments-form button[type="button"]:hover {
  background: var(--bg);
  color: var(--text);
}

.comments-form button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.comments-status {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.875rem;
}

.comments-status.success { color: #059669; }
.comments-status.error { color: #dc2626; }

/* ── Forms (auth, contact) ── */

.auth-form,
.contact-form {
  display: grid;
  gap: 18px;
  max-width: 480px;
}

.auth-form label,
.contact-form label {
  display: grid;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
}

.auth-form input,
.contact-form input,
.contact-form textarea {
  font: inherit;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.auth-form input:focus,
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 110, 140, 0.15);
}

.auth-form button,
.contact-form button {
  justify-self: start;
  padding: 11px 24px;
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition);
}

.auth-form button:hover,
.contact-form button:hover {
  background: var(--accent-hover);
}

.auth-form button:disabled,
.contact-form button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth-links {
  margin-top: 8px;
  font-size: 0.9375rem;
}

.auth-status,
.contact-status {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.875rem;
}

.auth-status.success,
.contact-status.success { color: #059669; }

.auth-status.error,
.contact-status.error { color: #dc2626; }

/* ── Footer ── */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 40px;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.site-footer a {
  font-weight: 500;
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .site-nav-toggle {
    display: inline-flex;
  }

  .site-menu {
    display: none;
    padding-bottom: 12px;
  }

  .site-menu.is-open {
    display: block;
  }

  .site-nav {
    flex-direction: column;
    gap: 2px;
  }

  .site-nav > li > a {
    width: 100%;
    padding: 12px 14px;
  }

  .site-nav .nav-child {
    position: static;
    display: none;
    min-width: 0;
    max-width: none;
    margin: 4px 0 8px 12px;
    padding: 4px;
    box-shadow: none;
    border: 0;
    background: var(--bg);
    border-radius: var(--radius-sm);
  }

  .site-nav .has-children.open > .nav-child {
    display: block;
  }

  .site-nav .has-children:hover > .nav-child {
    display: none;
  }

  .site-nav .has-children.open:hover > .nav-child {
    display: block;
  }

  .site-nav .nav-child a {
    padding: 10px 12px;
    font-size: 0.875rem;
  }

  .site-article {
    padding: 20px 18px 28px;
  }
}

@media (max-width: 640px) {
  body { font-size: 15px; }

  .site-header-top {
    padding: 12px 0 8px;
  }

  .site-userbar {
    font-size: 0.8125rem;
    max-width: 140px;
    line-height: 1.35;
  }

  .site-main {
    padding: 20px 14px 40px;
  }

  .site-subnav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .site-breadcrumbs ol {
    justify-content: flex-start;
  }
}
