:root {
  --paper: #f8f5ee;
  --paper-line: #d7d0c1;
  --paper-deep: #ede7d8;
  --ink: #202122;
  --muted: #54595d;
  --accent: #3056a3;
  --accent-soft: #e9effb;
  --panel: #ffffff;
  --shadow: 0 24px 70px rgba(47, 46, 43, 0.14);
  --ui-font: "Aptos", "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --display-font: "Aptos Display", "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
  --mono-font: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(48, 86, 163, 0.08), transparent 26%),
    linear-gradient(180deg, #f2eee4 0%, var(--paper) 100%);
  font-family: var(--ui-font);
}

body {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

select,
textarea {
  font: inherit;
}

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

.login-body {
  display: grid;
  place-items: center;
  padding: 36px;
}

.login-layout {
  width: min(1240px, 100%);
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.login-panel,
.preview-window,
.wiki-sidebar,
.wiki-content,
.wiki-header {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(116, 106, 82, 0.18);
  box-shadow: var(--shadow);
}

.login-panel {
  border-radius: 24px;
  padding: 18px;
  font-family: var(--ui-font);
}

.login-panel-inner {
  display: grid;
  gap: 24px;
  padding: 18px;
}

.login-hero {
  display: grid;
  gap: 10px;
}

.kicker,
.article-kicker {
  margin: 0 0 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--ui-font);
  font-size: 0.75rem;
  color: var(--muted);
}

.login-panel h1,
.wiki-content h1,
.preview-article h2 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  line-height: 0.98;
  font-family: var(--display-font);
}

.login-panel h1 {
  letter-spacing: -0.06em;
}

.lede {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.62;
  font-size: 1rem;
}

.article-box,
.wiki-card {
  border: 1px solid var(--paper-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(241, 236, 225, 0.76));
  border-radius: 16px;
  padding: 16px 18px;
}

.form-shell {
  border: 1px solid rgba(116, 106, 82, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 239, 229, 0.82));
  border-radius: 20px;
  padding: 22px;
  display: grid;
  gap: 18px;
}

.form-shell-header {
  display: grid;
  gap: 6px;
}

.form-shell-header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #14213d;
}

.form-shell-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.login-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.9rem;
}

.field input,
.field textarea,
.field select,
.wiki-search input,
.inline-search input {
  width: 100%;
  border: 1px solid #b9b0a0;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 12px;
  padding: 14px 15px;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.04);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

button {
  border: 1px solid #24458b;
  background: linear-gradient(180deg, #3f68c2, #24458b);
  color: white;
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.status-text {
  margin: 0;
  min-height: 1.5em;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.92rem;
}

.wiki-preview {
  min-width: 0;
  width: 100%;
  align-self: stretch;
}

.preview-window {
  width: 100%;
  min-height: 680px;
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.preview-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--paper-line);
  background: var(--paper-deep);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot-red {
  background: #f1605a;
}

.dot-amber {
  background: #efb149;
}

.dot-green {
  background: #55c271;
}

.preview-url {
  margin-left: 8px;
  min-width: 120px;
  flex: 1 1 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono-font);
  color: var(--muted);
  font-size: 0.82rem;
}

.system-status {
  margin-left: auto;
  min-width: 0;
  flex: 0 1 260px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(35, 38, 44, 0.1);
  background: rgba(21, 24, 29, 0.96);
  color: #f7f8fb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.system-status-led {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
  background: #9ca3af;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

.system-status-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-family: var(--mono-font);
}

.system-status-copy strong,
.system-status-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-status-copy strong {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.system-status-copy span {
  color: rgba(247, 248, 251, 0.7);
  font-size: 0.72rem;
}

.system-status.is-online .system-status-led {
  background: #55c271;
  box-shadow:
    0 0 0 4px rgba(85, 194, 113, 0.14),
    0 0 16px rgba(85, 194, 113, 0.55);
}

.system-status.is-alert .system-status-led {
  background: #f1605a;
  box-shadow:
    0 0 0 4px rgba(241, 96, 90, 0.14),
    0 0 16px rgba(241, 96, 90, 0.45);
}

.preview-grid,
.wiki-shell {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
}

.preview-sidebar,
.wiki-sidebar {
  border-right: 1px solid var(--paper-line);
  background: rgba(245, 241, 231, 0.78);
  min-width: 0;
}

.preview-sidebar,
.preview-article,
.wiki-sidebar,
.wiki-content {
  padding: 24px;
}

.preview-article {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  font-family: var(--ui-font);
}

.preview-sidebar h2,
.wiki-sidebar h2,
.wiki-card h2,
.wiki-article h2 {
  margin: 0 0 14px;
  font-size: 1rem;
  font-family: var(--ui-font);
}

.preview-sidebar a,
.wiki-sidebar a {
  display: block;
  padding: 8px 0;
  color: var(--accent);
  font-family: var(--ui-font);
}

.preview-article p,
.preview-article li,
.wiki-content p,
.wiki-content li {
  line-height: 1.7;
  color: #2d2f31;
}

.preview-article p,
.preview-article ul,
.preview-article h3 {
  margin: 0;
}

.preview-article h3 {
  font-size: 1rem;
  font-family: var(--ui-font);
}

.article-box ul,
.wiki-card ul {
  margin: 10px 0 0 18px;
  padding: 0;
}

.hub-body {
  padding: 22px;
}

.wiki-header {
  display: grid;
  grid-template-columns: 280px minmax(280px, 1fr) 300px;
  align-items: center;
  gap: 18px;
  border-radius: 22px;
  padding: 18px 20px;
  margin-bottom: 22px;
}

.wiki-brand,
.wiki-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wiki-brand p,
.wiki-user p {
  margin: 2px 0 0;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.9rem;
}

.wiki-mark {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.5rem;
  background: linear-gradient(180deg, #f2ede1, #ddd3be);
  border: 1px solid #c6baa1;
}

.wiki-shell {
  gap: 22px;
  grid-template-columns: 260px minmax(0, 1fr);
}

.wiki-sidebar,
.wiki-content {
  border-radius: 22px;
}

.wiki-sidebar section + section {
  margin-top: 26px;
}

.wiki-sidebar a.active {
  font-weight: 700;
  color: #17387a;
}

.sidebar-links {
  display: grid;
  gap: 10px;
}

.sidebar-empty {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.nav-link {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(116, 106, 82, 0.12);
}

.nav-link-title {
  color: #17387a;
  font-weight: 600;
}

.nav-link-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.wiki-content-header {
  border-bottom: 1px solid var(--paper-line);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

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

.wiki-toolbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-search {
  flex: 1 1 auto;
  display: flex;
  gap: 12px;
}

.inline-search input {
  flex: 1 1 auto;
}

.primary-link-button,
.secondary-link-button,
.text-link {
  text-decoration: none;
}

.primary-link-button,
.secondary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 600;
}

.primary-link-button {
  background: linear-gradient(180deg, #3f68c2, #24458b);
  color: white;
}

.secondary-link-button {
  border: 1px solid rgba(36, 69, 139, 0.24);
  color: #24458b;
  background: rgba(255, 255, 255, 0.72);
}

.secondary-action-button,
.danger-action-button {
  border-radius: 12px;
  padding: 14px 18px;
}

.secondary-action-button {
  border: 1px solid rgba(36, 69, 139, 0.24);
  background: rgba(255, 255, 255, 0.78);
  color: #24458b;
}

.danger-action-button {
  border: 1px solid rgba(161, 43, 32, 0.24);
  background: linear-gradient(180deg, #d9665c, #b7473d);
  color: white;
}

.text-link {
  color: #24458b;
  font-weight: 600;
}

.wiki-columns-hero,
.wiki-columns-detail {
  margin-bottom: 24px;
}

.category-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(36, 69, 139, 0.14);
  color: #24458b;
  font-weight: 600;
}

.category-chip span {
  color: var(--muted);
  font-size: 0.82rem;
}

.category-chip-active {
  background: #24458b;
  color: white;
}

.category-chip-active span {
  color: rgba(255, 255, 255, 0.76);
}

.wiki-list-section {
  display: grid;
  gap: 18px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-head h2 {
  margin: 0;
}

.section-head span {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.article-card {
  display: grid;
  gap: 14px;
}

.article-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.article-card h3 {
  margin: 0;
  font-size: 1.18rem;
}

.article-card h3 a {
  color: var(--ink);
}

.article-card p {
  margin: 0;
}

.article-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e9effb;
  color: #24458b;
  font-size: 0.82rem;
  font-weight: 600;
}

.article-updated {
  color: var(--muted);
  font-size: 0.82rem;
}

.article-card-actions {
  display: flex;
  gap: 16px;
}

.wiki-card-feature {
  background:
    radial-gradient(circle at top right, rgba(36, 69, 139, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 236, 225, 0.82));
}

.wiki-card-feature p {
  margin-bottom: 16px;
}

.article-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.revision-list {
  margin: 0;
  padding-left: 18px;
}

.attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.attachment-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(116, 106, 82, 0.12);
}

.attachment-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.attachment-delete-button {
  flex-shrink: 0;
}

.checkbox-field {
  align-content: start;
}

.checkbox-field input {
  width: auto;
  min-width: 20px;
  min-height: 20px;
}

.wiki-editor {
  display: grid;
  gap: 18px;
}

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

.wiki-editor-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wiki-editor-preview {
  display: grid;
  gap: 16px;
}

.category-card {
  display: grid;
  gap: 14px;
}

.wiki-prose > :first-child {
  margin-top: 0;
}

.wiki-prose h1,
.wiki-prose h2,
.wiki-prose h3 {
  line-height: 1.12;
  color: #14213d;
}

.wiki-prose p,
.wiki-prose ul,
.wiki-prose ol,
.wiki-prose blockquote,
.wiki-prose pre {
  line-height: 1.8;
}

.wiki-prose blockquote {
  margin: 0;
  padding: 12px 16px;
  border-left: 4px solid rgba(36, 69, 139, 0.4);
  background: rgba(233, 239, 251, 0.46);
}

.wiki-prose pre {
  overflow: auto;
  padding: 16px;
  border-radius: 14px;
  background: rgba(21, 24, 29, 0.96);
  color: #f7f8fb;
}

.wiki-prose code {
  font-family: var(--mono-font);
}

.audit-pre {
  margin: 0;
  overflow: auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(21, 24, 29, 0.96);
  color: #f7f8fb;
  font-family: var(--mono-font);
  font-size: 0.82rem;
}

.wiki-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 22px;
}

.wiki-article {
  border: 1px solid var(--paper-line);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 18px;
  padding: 22px;
}

code {
  font-family: "SFMono-Regular", Consolas, monospace;
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 6px;
}

@media (max-width: 980px) {
  .login-layout,
  .wiki-shell,
  .wiki-columns,
  .wiki-header,
  .wiki-article-grid,
  .wiki-editor-grid {
    grid-template-columns: 1fr;
  }

  .login-layout {
    gap: 24px;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .preview-topbar {
    flex-wrap: wrap;
  }

  .preview-url {
    order: 2;
    width: 100%;
    margin-left: 0;
  }

  .system-status {
    order: 3;
    margin-left: 0;
    width: 100%;
    flex-basis: 100%;
  }

  .preview-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--paper-line);
  }

  .wiki-search {
    order: 3;
  }

  .wiki-toolbar,
  .inline-search,
  .wiki-editor-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .login-body {
    padding: 18px;
  }

  .login-panel {
    padding: 12px;
  }

  .login-panel-inner {
    padding: 10px;
  }

  .form-shell {
    padding: 18px;
  }

  .preview-window {
    min-height: auto;
  }
}

/* Stitch hub theme: only for the logged-in wiki, login stays unchanged */
.hub-body {
  margin: 0;
  min-height: 100vh;
  background: #f7f9fb;
  color: #191c1e;
  font-family: "Inter", var(--ui-font);
  --hub-bg: #f7f9fb;
  --hub-surface: #ffffff;
  --hub-surface-soft: #f2f4f6;
  --hub-surface-mid: #eceef0;
  --hub-border: #c6c6cd;
  --hub-text: #191c1e;
  --hub-text-muted: #45464d;
  --hub-accent: #006a61;
  --hub-accent-contrast: #ffffff;
  --hub-strong: #131b2e;
  --hub-code-bg: #131b2e;
  --hub-code-text: #eff1f3;
  --hub-sidebar-bg: #ffffff;
  --hub-main-bg: #f7f9fb;
  --hub-topbar-bg: #f7f9fb;
}

html.hub-theme-light,
body.hub-theme-light {
  background: #f7f9fb !important;
}

.hub-body .material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  line-height: 1;
  vertical-align: middle;
}

.hub-body.hub-theme-dark {
  --hub-bg: #191c1e;
  --hub-surface: #2a2f33;
  --hub-surface-soft: #31363b;
  --hub-surface-mid: #3a4045;
  --hub-border: #45464d;
  --hub-text: #eff1f3;
  --hub-text-muted: #c6c6cd;
  --hub-accent: #89f5e7;
  --hub-accent-contrast: #00201d;
  --hub-strong: #0b1c30;
  --hub-code-bg: #0f1418;
  --hub-code-text: #eff1f3;
  --hub-sidebar-bg: #000000;
  --hub-main-bg: #1f2326;
  --hub-topbar-bg: #1f2326;
}

html.hub-theme-dark,
body.hub-theme-dark {
  background: #1f2326 !important;
}

.stitch-app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--hub-bg);
}

.stitch-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 24px;
  background: var(--hub-sidebar-bg);
  border-right: 1px solid var(--hub-border);
}

.stitch-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stitch-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
}

.stitch-brand-copy {
  display: grid;
  gap: 2px;
}

.stitch-brand-copy strong {
  font-family: "Source Serif 4", serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hub-text);
}

.stitch-brand-copy span {
  color: var(--hub-text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stitch-nav {
  display: grid;
  gap: 4px;
}

.stitch-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 16px;
  border-left: 2px solid transparent;
  color: var(--hub-text-muted);
  font-size: 0.96rem;
  font-weight: 500;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.stitch-nav a:hover {
  background: var(--hub-surface-mid);
  color: var(--hub-text);
}

.stitch-nav a.active {
  color: var(--hub-accent);
  border-left-color: var(--hub-accent);
  background: var(--hub-surface-soft);
  font-weight: 700;
}

.stitch-nav a .material-symbols-outlined {
  font-size: 1.15rem;
}

.stitch-sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--hub-border);
}

.stitch-user-mini {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stitch-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--hub-strong);
  color: var(--hub-accent-contrast);
  font-weight: 700;
}

.stitch-user-mini strong,
.stitch-user-mini span {
  display: block;
}

.stitch-user-mini strong {
  font-size: 0.92rem;
}

.stitch-user-mini span {
  color: var(--hub-text-muted);
  font-size: 0.8rem;
}

.stitch-main {
  flex: 1 1 auto;
  margin-left: 280px;
  min-width: 0;
  min-height: 100vh;
  background: var(--hub-main-bg);
}

.stitch-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
  background: var(--hub-topbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hub-border);
}

.hub-body.hub-theme-dark .stitch-topbar {
  backdrop-filter: none;
}

.stitch-search {
  flex: 1 1 auto;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}

.stitch-search .material-symbols-outlined {
  position: absolute;
  left: 14px;
  color: var(--hub-text-muted);
}

.stitch-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--hub-border);
  border-radius: 999px;
  background: var(--hub-surface-soft);
  color: var(--hub-text);
  box-shadow: none;
}

.stitch-search input:focus {
  outline: none;
  border-color: var(--hub-accent);
  background: var(--hub-surface);
}

.stitch-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stitch-icon-button,
.stitch-theme-toggle,
.stitch-logout-button {
  min-height: 42px;
  border: 1px solid var(--hub-border);
  background: var(--hub-surface);
  color: var(--hub-text-muted);
  border-radius: 999px;
}

.stitch-icon-button,
.stitch-theme-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stitch-logout-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.stitch-theme-toggle .material-symbols-outlined,
.stitch-icon-button .material-symbols-outlined {
  display: block;
  font-size: 20px;
  line-height: 1;
}

.stitch-content-canvas {
  padding: 32px 24px 48px;
  background: var(--hub-main-bg);
}

.stitch-reading-track {
  max-width: 1160px;
  margin: 0 auto;
  background: transparent;
}

.stitch-reading-track .wiki-content-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hub-border);
}

.stitch-reading-track .article-kicker {
  margin-bottom: 10px;
  color: var(--hub-text-muted);
  font-family: "Inter", var(--ui-font);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.stitch-reading-track h1,
.stitch-reading-track .wiki-content-header h1 {
  margin: 0 0 14px;
  color: var(--hub-text);
  font-family: "Source Serif 4", serif;
  font-size: 2.4rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.stitch-reading-track h2,
.stitch-reading-track .wiki-card h2,
.stitch-reading-track .section-head h2 {
  font-family: "Source Serif 4", serif;
  font-size: 1.55rem;
  line-height: 1.2;
  margin: 0;
  color: var(--hub-text);
}

.stitch-reading-track h3,
.stitch-reading-track .article-card h3 {
  font-family: "Source Serif 4", serif;
  font-size: 1.2rem;
  line-height: 1.28;
  margin: 0;
}

.stitch-reading-track p,
.stitch-reading-track li,
.stitch-reading-track label span,
.stitch-reading-track .section-head span,
.stitch-reading-track .article-updated,
.stitch-reading-track .nav-link-meta {
  color: var(--hub-text-muted);
}

.stitch-reading-track .wiki-card,
.stitch-reading-track .wiki-article,
.stitch-reading-track .form-shell,
.stitch-reading-track .article-box {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  box-shadow: none;
}

.stitch-reading-track .wiki-card,
.stitch-reading-track .wiki-article {
  padding: 24px;
}

.stitch-reading-track .wiki-columns,
.stitch-reading-track .wiki-article-grid {
  gap: 16px;
}

.stitch-reading-track .wiki-article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stitch-reading-track .wiki-card-feature {
  background: var(--hub-surface);
}

.stitch-reading-track .wiki-toolbar {
  margin-bottom: 24px;
}

.stitch-reading-track .inline-search input,
.stitch-reading-track .field input,
.stitch-reading-track .field textarea,
.stitch-reading-track .field select {
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  background: var(--hub-surface);
  color: var(--hub-text);
  box-shadow: none;
}

.stitch-reading-track .inline-search input:focus,
.stitch-reading-track .field input:focus,
.stitch-reading-track .field textarea:focus,
.stitch-reading-track .field select:focus {
  outline: none;
  border-color: var(--hub-accent);
}

.stitch-reading-track .field textarea {
  min-height: 150px;
}

.stitch-reading-track button,
.stitch-reading-track .primary-link-button,
.stitch-reading-track .secondary-link-button,
.stitch-reading-track .secondary-action-button,
.stitch-reading-track .danger-action-button {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 600;
}

.stitch-reading-track .primary-link-button,
.stitch-reading-track button {
  background: var(--hub-accent);
  border: 1px solid var(--hub-accent);
  color: var(--hub-accent-contrast);
}

.stitch-reading-track .secondary-link-button,
.stitch-reading-track .secondary-action-button {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  color: var(--hub-text);
}

.stitch-reading-track .danger-action-button {
  background: #ba1a1a;
  border: 1px solid #ba1a1a;
  color: #ffffff;
}

.stitch-reading-track .article-chip,
.stitch-reading-track .category-chip {
  background: var(--hub-surface-mid);
  color: var(--hub-text-muted);
  border: 0;
  border-radius: 999px;
}

.stitch-reading-track .category-chip-active {
  background: var(--hub-accent);
  color: var(--hub-accent-contrast);
}

.stitch-reading-track .category-chip-active span {
  color: color-mix(in srgb, var(--hub-accent-contrast) 72%, transparent);
}

.stitch-reading-track .text-link,
.stitch-reading-track a {
  color: var(--hub-accent);
}

.stitch-reading-track .text-link:hover,
.stitch-reading-track a:hover {
  text-decoration: underline;
}

.stitch-reading-track .wiki-prose {
  max-width: 800px;
}

.stitch-reading-track .wiki-prose h1,
.stitch-reading-track .wiki-prose h2,
.stitch-reading-track .wiki-prose h3 {
  font-family: "Source Serif 4", serif;
  color: var(--hub-text);
}

.stitch-reading-track .wiki-prose p,
.stitch-reading-track .wiki-prose li,
.stitch-reading-track .wiki-prose blockquote {
  font-family: "Source Serif 4", serif;
  font-size: 1.06rem;
  line-height: 1.8;
  color: var(--hub-text);
}

.stitch-reading-track .wiki-prose blockquote {
  border-left: 3px solid var(--hub-accent);
  background: var(--hub-surface-soft);
}

.stitch-reading-track .wiki-prose pre {
  background: var(--hub-code-bg);
  color: var(--hub-code-text);
}

.stitch-reading-track .nav-link,
.stitch-reading-track .sidebar-empty {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: 8px;
}

.stitch-reading-track .attachment-list li {
  background: var(--hub-surface-soft);
}

.stitch-reading-track .audit-pre {
  background: var(--hub-code-bg);
  color: var(--hub-code-text);
}

@media (max-width: 1100px) {
  .stitch-sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--hub-border);
  }

  .stitch-main {
    margin-left: 0;
  }

  .stitch-app-shell {
    display: block;
  }
}

@media (max-width: 860px) {
  .stitch-topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .stitch-search {
    max-width: none;
  }

  .stitch-topbar-actions {
    justify-content: flex-end;
  }

  .stitch-reading-track .wiki-article-grid,
  .stitch-reading-track .wiki-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .stitch-content-canvas {
    padding: 20px 16px 32px;
  }

  .stitch-sidebar {
    padding: 24px 16px;
  }

  .stitch-reading-track h1,
  .stitch-reading-track .wiki-content-header h1 {
    font-size: 1.9rem;
  }
}
