:root {
  --sg-ink: #0f172a;
  --sg-ink-soft: #334155;
  --sg-muted: #64748b;
  --sg-line: rgba(15, 23, 42, 0.1);
  --sg-bg: #eef3f7;
  --sg-bg-2: #f7fafc;
  --sg-surface: #ffffff;
  --sg-accent: #0e7490;
  --sg-accent-deep: #0f4c5c;
  --sg-accent-soft: rgba(14, 116, 144, 0.12);
  --sg-warn: #b45309;
  --sg-warn-bg: #fff7ed;
  --sg-tip: #047857;
  --sg-tip-bg: #ecfdf5;
  --sg-info: #0369a1;
  --sg-info-bg: #e0f2fe;
  --sg-code-bg: #0b1220;
  --sg-code-fg: #e2e8f0;
  --sg-radius: 8px;
  --sg-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --sg-font-display: "IBM Plex Sans", "Segoe UI", sans-serif;
  --sg-font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --sg-font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --sg-container: 1280px;
  --sg-prose: none;
  --sg-header-h: 78px;
  --sg-aside: 280px;
  --sg-thumb: 120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--sg-ink);
  font-family: var(--sg-font-body);
  font-size: 1rem;
  line-height: 1.6;
  background: var(--sg-bg-2);
  min-height: 100vh;
  overflow-x: clip;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--sg-accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--sg-accent);
}

.screen-reader-text,
.sg-skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.sg-skip:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  padding: 0.75rem 1rem;
  background: var(--sg-ink);
  color: #fff;
  border-radius: 8px;
}

.sg-container {
  width: min(100% - 2rem, var(--sg-container));
  margin-inline: auto;
}

/* Header */
.sg-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: #f8fafc;
  background:
    linear-gradient(120deg, #0f4c5c 0%, #0e7490 48%, #0369a1 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  will-change: transform;
}

.sg-header.is-scrolled {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
}

.sg-header.is-hidden {
  transform: translateY(-110%);
}

.sg-header__inner {
  position: relative;
  min-height: var(--sg-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sg-header__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(90deg, #000 0%, transparent 70%);
}

.sg-brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: inherit;
  text-decoration: none;
  line-height: 1.15;
}

.sg-brand__name {
  font-family: var(--sg-font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.sg-brand__tag {
  font-family: var(--sg-font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.78);
}

.sg-brand:hover .sg-brand__name {
  color: #fff;
  opacity: 0.92;
}

.sg-nav__list,
.sg-mobile-nav__list,
.sg-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.25rem;
}

.sg-nav {
  position: relative;
  z-index: 1;
}

.sg-nav__list a,
.sg-mobile-nav__list a,
.sg-footer__list a {
  text-decoration: none;
  color: var(--sg-ink-soft);
  font-weight: 650;
  font-size: 0.98rem;
}

.sg-header .sg-nav__list a {
  color: rgba(248, 250, 252, 0.92);
}

.sg-header .sg-nav__list a:hover,
.sg-mobile-nav__list a:hover,
.sg-footer__list a:hover {
  color: var(--sg-accent-deep);
}

.sg-header .sg-nav__list a:hover {
  color: #fff;
}

.sg-nav-toggle {
  position: relative;
  z-index: 1;
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.sg-header .sg-nav-toggle__bars,
.sg-header .sg-nav-toggle__bars::before,
.sg-header .sg-nav-toggle__bars::after {
  background: #fff;
}

.sg-nav-toggle__bars,
.sg-nav-toggle__bars::before,
.sg-nav-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--sg-ink);
  content: "";
  position: relative;
}

.sg-nav-toggle__bars::before {
  top: -6px;
  position: absolute;
  left: 0;
}

.sg-nav-toggle__bars::after {
  top: 6px;
  position: absolute;
  left: 0;
}

.sg-mobile-nav {
  display: none;
  border-top: 1px solid var(--sg-line);
  background: #fff;
  padding: 1rem 1.25rem 1.25rem;
  color: var(--sg-ink);
}

.sg-mobile-nav:not([hidden]) {
  display: block;
}

.sg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}

.sg-btn--primary {
  background: var(--sg-ink);
  color: #fff;
}

.sg-btn--primary:hover {
  background: var(--sg-accent-deep);
  color: #fff;
}

.sg-btn--ghost {
  background: #fff;
  border-color: var(--sg-line);
  color: var(--sg-ink);
}

.sg-btn--ghost:hover {
  border-color: var(--sg-accent);
  color: var(--sg-accent-deep);
}

/* Sections / lists */
.sg-section {
  padding: 1.75rem 0 2.5rem;
}

.sg-section__head {
  margin-bottom: 1.25rem;
  max-width: 40rem;
}

.sg-section__head h2,
.sg-page-head h1,
.sg-aside__block h2,
.sg-topics h2 {
  margin: 0;
  font-family: var(--sg-font-display);
  letter-spacing: -0.015em;
  line-height: 1.25;
  font-weight: 650;
}

.sg-section__head h2,
.sg-topics h2 {
  font-size: 1.25rem;
}

.sg-section__head p,
.sg-page-head__desc {
  margin: 0.65rem 0 0;
  color: var(--sg-muted);
}

.sg-post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--sg-line);
}

.sg-post-list__item {
  border-bottom: 1px solid var(--sg-line);
}

.sg-post-row {
  display: grid;
  grid-template-columns: var(--sg-thumb) minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: start;
  padding: 1.15rem 0;
}

.sg-post-row__thumb {
  display: block;
  width: var(--sg-thumb);
  height: var(--sg-thumb);
  padding: 7px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--sg-line);
  box-sizing: border-box;
  flex-shrink: 0;
}

.sg-post-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 7px;
  image-rendering: auto;
}

.sg-post-row__thumb-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: var(--sg-font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--sg-accent-deep);
}

.sg-post-row__body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.sg-post-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
  color: var(--sg-muted);
  font-size: 0.82rem;
}

.sg-post-row__title {
  margin: 0;
  font-family: var(--sg-font-display);
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.sg-post-row__title a {
  color: inherit;
  text-decoration: none;
}

.sg-post-row__title a:hover {
  color: var(--sg-accent-deep);
}

.sg-post-row__excerpt {
  margin: 0;
  color: var(--sg-ink-soft);
  max-width: none;
}

.sg-post-row__more {
  width: fit-content;
  font-weight: 700;
  text-decoration: none;
  color: var(--sg-accent-deep);
}

.sg-pagination,
nav.pagination,
.navigation.pagination {
  margin-top: 1.5rem;
}

.sg-pagination .nav-links,
.navigation.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sg-pagination .page-numbers,
.navigation.pagination .page-numbers {
  display: inline-grid;
  place-items: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.55rem;
  border: 1px solid var(--sg-line);
  border-radius: 6px;
  background: #fff;
  color: var(--sg-ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.sg-pagination .page-numbers:hover,
.navigation.pagination .page-numbers:hover {
  color: var(--sg-accent-deep);
  border-color: var(--sg-accent);
}

.sg-pagination .page-numbers.current,
.navigation.pagination .page-numbers.current {
  background: var(--sg-ink);
  border-color: var(--sg-ink);
  color: #fff;
}

.sg-post-row__thumb-fallback {
  display: none;
}

.sg-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--sg-accent-soft);
  color: var(--sg-accent-deep);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  /* Uppercasing is done in PHP with English I/i mapping. */
}

.sg-chip--outline {
  background: transparent;
  border: 1px solid var(--sg-line);
  color: var(--sg-ink-soft);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.88rem;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
}

.sg-chip--outline span {
  color: var(--sg-muted);
  font-family: var(--sg-font-mono);
  font-size: 0.78rem;
}

.sg-topics {
  margin-top: 2rem;
}

.sg-topics h2,
.sg-topics h3 {
  margin: 0 0 0.75rem;
  font-family: var(--sg-font-display);
  font-size: 1.05rem;
}

.sg-topics__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

/* Main / aside */
.sg-main,
.sg-page {
  padding: 1.75rem 0 3rem;
}

.sg-main__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sg-aside);
  gap: 1.25rem;
  column-gap: 1.5rem;
  align-items: start;
}

.sg-page-head {
  margin-bottom: 1.25rem;
}

.sg-page-head__eyebrow {
  margin: 0 0 0.35rem;
  font-family: var(--sg-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sg-muted);
}

.sg-page-head h1,
.sg-page-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.sg-page-head__desc {
  margin: 0.5rem 0 0;
  max-width: 40rem;
  color: var(--sg-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.sg-page-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
  margin-bottom: 0.65rem;
  color: var(--sg-muted);
  font-size: 0.82rem;
}

.sg-notices {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1.35rem;
}

.sg-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--sg-notice-border, var(--sg-accent)) 35%, transparent);
  border-left: 3px solid var(--sg-notice-border, var(--sg-accent));
  border-radius: 8px;
  background: var(--sg-notice-bg, #f0f9fb);
  color: var(--sg-notice-text, var(--sg-ink));
  text-decoration: none;
}

.sg-notice:hover {
  filter: brightness(0.99);
  color: var(--sg-notice-text, var(--sg-ink));
}

.sg-notice__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  background: var(--sg-notice-badge-bg, #ffdd00);
  color: var(--sg-notice-badge-text, #0f172a);
  font-family: var(--sg-font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sg-notice__body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.sg-notice__body strong {
  font-size: 0.95rem;
  color: inherit;
}

.sg-notice__body span {
  color: inherit;
  opacity: 0.82;
  font-size: 0.9rem;
  line-height: 1.4;
}

.sg-notice__go {
  color: inherit;
  font-weight: 700;
}

.sg-notices--pulse .sg-notice {
  animation: sg-notice-pulse 2.4s ease-in-out infinite;
}

.sg-notices--glow .sg-notice {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sg-notice-border, var(--sg-accent)) 35%, transparent),
    0 0 18px color-mix(in srgb, var(--sg-notice-border, var(--sg-accent)) 28%, transparent);
}

.sg-notices--slide .sg-notice {
  animation: sg-notice-slide 0.55s ease-out both;
}

@keyframes sg-notice-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.01); }
}

@keyframes sg-notice-slide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.sg-stream__label {
  margin: 0 0 0.35rem;
  font-family: var(--sg-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sg-muted);
  font-weight: 600;
}

/* Sidebar — open stack, no inner scroll */
.sg-aside {
  position: sticky;
  top: calc(var(--sg-header-h) + 0.75rem);
  display: grid;
  gap: 1.1rem;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
}

.sg-aside__block {
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--sg-line);
}

.sg-aside__block:first-child,
.sg-aside__block--profile {
  padding-top: 0;
  border-top: 0;
}

.sg-profile {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.sg-profile__photo {
  width: 104px;
  height: 104px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--sg-line);
  background: var(--sg-accent-soft);
}

.sg-profile__body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.sg-profile__name {
  font-family: var(--sg-font-display);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--sg-ink);
}

.sg-profile__title {
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--sg-accent-deep);
}

.sg-profile__company {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sg-ink-soft);
}

.sg-profile__bio {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--sg-ink-soft);
}

.sg-aside__block h2 {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-family: var(--sg-font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sg-muted);
  font-weight: 600;
}

.sg-aside__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  max-height: none;
}

.sg-aside__list li + li {
  margin-top: 0.15rem;
}

.sg-aside__list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.5rem;
  column-gap: 0.5rem;
  align-items: center;
  padding: 0.28rem 0;
  text-decoration: none;
  color: var(--sg-ink-soft);
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.35;
  border: 0;
}

.sg-aside__list a:hover {
  color: var(--sg-accent-deep);
}

.sg-aside__cat-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sg-aside__cat-count {
  color: var(--sg-muted);
  font-family: var(--sg-font-mono);
  font-size: 0.75rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sg-aside__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.sg-aside__links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border: 0;
  border-radius: 0;
  text-decoration: none;
  color: var(--sg-ink);
  font-weight: 600;
  font-size: 0.9rem;
  background: transparent;
}

.sg-aside__links a:hover {
  color: var(--sg-accent-deep);
}

.sg-aside__link-icon {
  display: grid;
  place-items: center;
  width: 1.25rem;
  color: var(--sg-ink-soft);
}

.sg-bmc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 40px;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  background: #ffdd00;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.sg-bmc:hover {
  color: #0f172a;
  filter: brightness(0.97);
}

.sg-bmc__icon {
  display: grid;
  place-items: center;
}

.sg-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
}

.sg-search input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--sg-line);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
}

.sg-search button {
  border: 0;
  border-radius: 6px;
  background: var(--sg-ink);
  color: #fff;
  font-weight: 650;
  font-size: 0.85rem;
  padding: 0 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.sg-article__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--sg-line);
}

.sg-article__tags a {
  display: inline-block;
  margin: 0.2rem 0.35rem 0.2rem 0;
  text-decoration: none;
  color: var(--sg-muted);
  font-size: 0.9rem;
}

.sg-share {
  margin-top: 1.5rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--sg-line);
  display: grid;
  gap: 0.65rem;
}

.sg-share__label {
  font-size: 0.72rem;
  font-family: var(--sg-font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sg-muted);
  font-weight: 600;
}

.sg-share__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sg-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 34px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--sg-line);
  border-radius: 6px;
  background: #fff;
  color: var(--sg-ink-soft);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.sg-share__btn:hover {
  color: var(--sg-accent-deep);
  border-color: var(--sg-accent);
}

.sg-share__icon {
  display: grid;
  place-items: center;
}

.sg-comments {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--sg-line);
}

.sg-comments__title {
  margin: 0 0 1rem;
  font-family: var(--sg-font-display);
  font-size: 1.2rem;
}

.sg-comments__list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.sg-comments__list .comment {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--sg-line);
}

.sg-comments__list .children {
  list-style: none;
  margin: 0.75rem 0 0 1rem;
  padding: 0;
}

.sg-comments__list .comment-author {
  font-weight: 700;
}

.sg-comments__list .comment-meta {
  color: var(--sg-muted);
  font-size: 0.82rem;
  margin: 0.2rem 0 0.55rem;
}

.sg-comments__list .avatar {
  border-radius: 6px;
  margin-right: 0.55rem;
}

.sg-comment-form {
  display: grid;
  gap: 0.75rem;
}

.sg-comment-form p {
  margin: 0;
}

.sg-comment-form label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sg-ink-soft);
}

.sg-comment-form input[type="text"],
.sg-comment-form input[type="email"],
.sg-comment-form input[type="url"],
.sg-comment-form textarea {
  width: 100%;
  border: 1px solid var(--sg-line);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fff;
}

.sg-comment-form textarea {
  min-height: 140px;
  resize: vertical;
}

.sg-comment-form .form-submit {
  margin-top: 0.25rem;
}

.sg-comments__closed {
  color: var(--sg-muted);
}

/* Prose / Confluence */
.sg-stream,
.sg-prose {
  min-width: 0;
  max-width: 100%;
}

.sg-prose {
  width: 100%;
  color: var(--sg-ink);
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

.sg-prose img,
.sg-prose video,
.sg-prose iframe,
.sg-prose figure {
  max-width: 100%;
  height: auto;
}

.sg-prose > *:first-child {
  margin-top: 0;
}

.sg-prose h2,
.sg-prose h3,
.sg-prose h4 {
  font-family: var(--sg-font-display);
  letter-spacing: -0.01em;
  line-height: 1.3;
  font-weight: 650;
  scroll-margin-top: calc(var(--sg-header-h) + 1rem);
}

.sg-prose h2 {
  margin: 1.6rem 0 0.55rem;
  font-size: 1.2rem;
}

.sg-prose h3 {
  margin: 1.25rem 0 0.45rem;
  font-size: 1.05rem;
}

.sg-prose p,
.sg-prose ul,
.sg-prose ol {
  margin: 0 0 1rem;
}

.sg-prose li + li {
  margin-top: 0.35rem;
}

.sg-prose a {
  font-weight: 600;
}

.sg-prose code,
.sg-prose kbd {
  font-family: var(--sg-font-mono);
  font-size: 0.9em;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 5px;
  padding: 0.12em 0.35em;
}

.sg-code-wrap {
  position: relative;
  margin: 1.25rem 0;
}

.sg-prose pre,
.sg-prose .sg-code,
.sg-prose .wp-block-code,
.sg-prose .wp-block-preformatted,
.sg-prose .EnlighterJSRAW,
.sg-prose .code-block-pro-editor,
.sg-prose .wp-block-kevinbatdorf-code-block-pro,
.sg-prose [class*="code-block-pro"] {
  margin: 1rem 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  background: var(--sg-code-bg);
  color: var(--sg-code-fg);
  padding: 1.1rem 1.15rem;
  font-family: var(--sg-font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sg-prose .wp-block-kevinbatdorf-code-block-pro,
.sg-prose [class*="code-block-pro"] {
  padding: 0;
  background: transparent;
  border: 0;
}

.sg-prose .wp-block-kevinbatdorf-code-block-pro pre,
.sg-prose [class*="code-block-pro"] pre {
  margin: 0;
}

.sg-prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.sg-code-copy {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.sg-code-copy:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Code Block Pro already ships its own copy control. */
.wp-block-kevinbatdorf-code-block-pro .sg-code-copy,
[class*="code-block-pro"] .sg-code-copy,
.wp-block-kevinbatdorf-code-block-pro .sg-code-wrap > .sg-code-copy {
  display: none !important;
}

.sg-table-wrap,
.sg-prose .table-wrap,
.sg-prose figure.wp-block-table {
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--sg-line);
  border-radius: 12px;
  background: #fff;
}

.sg-prose table,
.sg-prose .sg-table,
.sg-prose table.confluenceTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.sg-prose th,
.sg-prose td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--sg-line);
  text-align: left;
  vertical-align: top;
}

.sg-prose th,
.sg-prose .confluenceTh {
  background: #f1f5f9;
  font-weight: 700;
}

.sg-prose tr:last-child td {
  border-bottom: 0;
}

.sg-callout,
.sg-prose .confluence-information-macro,
.sg-prose .panel {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--sg-line);
  background: #f8fafc;
}

.sg-callout--info,
.sg-prose .confluence-information-macro-information {
  background: var(--sg-info-bg);
  border-color: rgba(3, 105, 161, 0.25);
}

.sg-callout--tip,
.sg-prose .confluence-information-macro-tip {
  background: var(--sg-tip-bg);
  border-color: rgba(4, 120, 87, 0.25);
}

.sg-callout--warn,
.sg-prose .confluence-information-macro-warning {
  background: var(--sg-warn-bg);
  border-color: rgba(180, 83, 9, 0.28);
}

.sg-callout--note,
.sg-prose .confluence-information-macro-note {
  background: #f1f5f9;
}

.sg-prose blockquote {
  margin: 1.25rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--sg-accent);
  color: var(--sg-ink-soft);
}

.sg-prose hr {
  border: 0;
  border-top: 1px solid var(--sg-line);
  margin: 2rem 0;
}

/* Footer */
.sg-footer {
  border-top: 1px solid var(--sg-line);
  padding: 2rem 0 2.5rem;
  background: rgba(255, 255, 255, 0.55);
}

.sg-footer__inner {
  display: grid;
  gap: 1rem;
}

.sg-footer__brand {
  display: grid;
  gap: 0.2rem;
}

.sg-footer__brand strong {
  font-family: var(--sg-font-display);
  font-size: 1.1rem;
}

.sg-footer__brand span,
.sg-footer__copy {
  color: var(--sg-muted);
  font-size: 0.92rem;
}

.sg-footer__copy {
  margin: 0;
}

.sg-empty {
  padding: 2rem 0;
}

/* Motion */
[data-sg-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease var(--sg-delay, 0ms), transform 0.55s ease var(--sg-delay, 0ms);
}

[data-sg-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.pagination,
.nav-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination .page-numbers,
.nav-links a {
  display: inline-flex;
  min-width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--sg-line);
  text-decoration: none;
  color: var(--sg-ink-soft);
  background: #fff;
}

.pagination .current {
  background: var(--sg-ink);
  color: #fff;
  border-color: var(--sg-ink);
}


/* Responsive */
@media (max-width: 900px) {
  .sg-container {
    width: min(100% - 1.25rem, var(--sg-container));
  }

  .sg-nav {
    display: none;
  }

  .sg-nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .sg-mobile-nav__list {
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1rem;
  }

  .sg-main,
  .sg-page {
    padding: 1rem 0 2.5rem;
  }

  .sg-main__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .sg-aside {
    position: static;
  }

  .sg-notice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .sg-notice__go {
    display: none;
  }

  .sg-page-head h1 {
    font-size: 1.35rem;
    line-height: 1.3;
  }

  .sg-page-head__meta {
    gap: 0.4rem 0.65rem;
  }

  .sg-prose {
    font-size: 0.98rem;
  }

  .sg-prose h2 {
    font-size: 1.1rem;
  }

  .sg-prose h3 {
    font-size: 1rem;
  }

  .sg-prose pre,
  .sg-prose .sg-code,
  .sg-prose .wp-block-code,
  .sg-prose .wp-block-preformatted,
  .sg-prose .EnlighterJSRAW,
  .sg-prose .code-block-pro-editor,
  .sg-prose .wp-block-kevinbatdorf-code-block-pro pre,
  .sg-prose [class*="code-block-pro"] pre {
    font-size: 0.78rem;
    padding: 0.85rem;
    border-radius: 8px;
  }

  .sg-prose .sg-table-wrap,
  .sg-prose .table-wrap,
  .sg-prose figure.wp-block-table,
  .sg-prose table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sg-article__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  :root {
    --sg-thumb: 88px;
  }

  .sg-post-row {
    grid-template-columns: var(--sg-thumb) minmax(0, 1fr);
    gap: 0.85rem;
  }

  .sg-profile {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .sg-profile__photo {
    width: 88px;
    height: 88px;
  }
}

.sg-contact {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--sg-line);
}

.sg-contact__notice {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: var(--sg-tip-bg);
  color: var(--sg-tip);
  font-weight: 600;
}

.sg-contact__form {
  display: grid;
  gap: 0.85rem;
  max-width: 36rem;
}

.sg-contact__field {
  margin: 0;
}

.sg-contact__field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sg-ink-soft);
}

.sg-contact__field input,
.sg-contact__field textarea {
  width: 100%;
  border: 1px solid var(--sg-line);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fff;
}

.sg-contact__hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.sg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--sg-ink);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.sg-btn:hover {
  background: var(--sg-accent-deep);
  color: #fff;
}

.sg-btn--ghost {
  background: transparent;
  color: var(--sg-accent-deep);
  border: 1px solid var(--sg-line);
}

.sg-comment-form__note {
  color: var(--sg-muted);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sg-header {
    transition: none;
  }
  [data-sg-reveal] {
    animation: none !important;
    transition: none !important;
    opacity: 1;
    transform: none;
  }
}
