@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --ink: #f4f0e8;
  --muted: #8292a0;
  --muted-2: #5c6d79;
  --deep: #07121c;
  --panel: #0b1a26;
  --panel-2: #102333;
  --panel-3: #132b3b;
  --line: rgba(130, 171, 187, .18);
  --gold: #c8a25d;
  --gold-bright: #e1bd74;
  --cyan: #65d7d1;
  --shadow: 0 20px 60px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--deep); }
body { margin: 0; color: var(--ink); background: var(--deep); font-family: 'DM Sans', system-ui, sans-serif; font-size: 16px; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.site-shell { min-height: 100vh; display: grid; grid-template-columns: 292px minmax(0, 1fr); background: radial-gradient(circle at 74% 12%, rgba(37, 105, 122, .14), transparent 29rem), var(--deep); }
.sidebar { min-height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; padding: 28px 18px 18px; background: linear-gradient(180deg, #081824 0%, #07121c 78%); border-right: 1px solid var(--line); overflow: hidden; }
.sidebar::after { content: ''; position: absolute; inset: auto -15% 11% -25%; height: 260px; opacity: .08; background: repeating-linear-gradient(60deg, transparent 0 20px, #7cb7c0 21px 22px, transparent 23px 41px); transform: rotate(-5deg); pointer-events: none; }
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 2px 10px 25px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(200, 162, 93, .15)); }
.brand-copy { min-width: 0; display: grid; gap: 2px; }
.brand-wordmark { width: 112px; height: auto; max-height: 52px; object-fit: contain; object-position: left center; }
.brand-copy span { color: var(--gold); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
.sidebar-actions { padding: 22px 4px 16px; }
.gold-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 44px; padding: 9px 16px; color: #111b21; background: linear-gradient(135deg, var(--gold-bright), var(--gold)); border: 1px solid rgba(255, 236, 178, .55); border-radius: 2px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 9px 24px rgba(0,0,0,.24); transition: transform .2s ease, filter .2s ease; }
.gold-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.gold-button span { font-size: 20px; font-weight: 400; line-height: 1; }
.search-box { height: 42px; display: flex; align-items: center; gap: 9px; margin: 0 4px 24px; padding: 0 11px; background: rgba(255,255,255,.035); border: 1px solid var(--line); color: var(--muted); }
.search-box:focus-within { border-color: rgba(101, 215, 209, .65); box-shadow: 0 0 0 3px rgba(101, 215, 209, .09); }
.search-icon { font-size: 24px; line-height: 1; transform: rotate(-20deg); color: var(--cyan); }
.search-box input { min-width: 0; flex: 1; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 14px; }
.search-box input::placeholder { color: var(--muted-2); }
kbd { color: var(--muted-2); font-size: 10px; border: 1px solid var(--line); padding: 2px 5px; border-radius: 2px; }
.nav-heading { display: flex; justify-content: space-between; padding: 0 10px 10px; color: var(--muted-2); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.nav-count { color: var(--gold); }
.wiki-nav { min-height: 0; flex: 1; overflow: auto; padding: 0 2px 18px; scrollbar-width: thin; scrollbar-color: rgba(200,162,93,.3) transparent; }
.nav-group { margin: 3px 0; }
.nav-group > .nav-row { color: #c8d3d6; }
.nav-row { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px; color: var(--muted); background: transparent; border: 0; border-radius: 2px; text-align: left; font-size: 13px; transition: color .18s ease, background .18s ease; }
.nav-row:hover, .nav-row.active { color: var(--ink); background: rgba(101, 215, 209, .08); }
.nav-row.active { box-shadow: inset 2px 0 0 var(--gold); }
.nav-row .nav-icon { width: 19px; flex: 0 0 19px; font-size: 15px; text-align: center; filter: saturate(.8); }
.nav-row .nav-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-row .chevron { margin-left: auto; color: var(--muted-2); font-size: 12px; transition: transform .2s ease; }
.nav-group.collapsed .chevron { transform: rotate(-90deg); }
.nav-children { margin: 1px 0 5px 18px; padding-left: 10px; border-left: 1px solid rgba(130,171,187,.13); }
.nav-group.collapsed .nav-children { display: none; }
.sidebar-footer { position: relative; z-index: 1; display: grid; gap: 8px; padding: 15px 8px 2px; border-top: 1px solid var(--line); }
.save-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.text-button { width: fit-content; padding: 0; color: var(--muted-2); background: transparent; border: 0; font-size: 12px; text-align: left; }
.text-button:hover { color: var(--gold-bright); }

.app-main { min-width: 0; min-height: 100vh; }
.topbar { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(22px, 4vw, 62px); border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: var(--muted-2); font-size: 12px; }
.breadcrumbs span:first-child { color: var(--gold); }
.breadcrumbs b { color: rgba(200,162,93,.45); font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.local-note { color: var(--muted-2); font-size: 12px; }
.mode-button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; color: var(--muted); background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 2px; font-size: 12px; transition: border-color .2s ease, color .2s ease; }
.mode-button:hover, .mode-button.editing { color: var(--ink); border-color: rgba(200,162,93,.65); }
.mode-orb { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--cyan); }
.mode-button.editing .mode-orb { background: var(--gold-bright); box-shadow: 0 0 10px rgba(225,189,116,.75); }
.session-button { padding: 7px 10px; color: var(--gold-bright); background: transparent; border: 1px solid rgba(200,162,93,.32); border-radius: 2px; font-size: 11px; }
.session-button:hover { color: var(--ink); border-color: rgba(200,162,93,.75); }
.content-frame { max-width: 1520px; padding: 42px clamp(22px, 4vw, 62px) 70px; }

.hero-panel { position: relative; min-height: 240px; display: flex; align-items: stretch; overflow: hidden; background: linear-gradient(108deg, #122e3b 0%, #0b202e 42%, #0b1824 100%); border: 1px solid rgba(101,215,209,.22); box-shadow: var(--shadow); }
.hero-panel::before, .hero-panel::after { content: ''; position: absolute; pointer-events: none; }
.hero-panel::before { inset: 0; background: radial-gradient(circle at 11% 54%, rgba(101,215,209,.16), transparent 24%), linear-gradient(90deg, rgba(101,215,209,.1), transparent 48%); }
.hero-panel::after { width: 220px; height: 220px; right: -45px; top: -54px; border: 1px solid rgba(200,162,93,.24); transform: rotate(45deg); box-shadow: 0 0 0 17px rgba(200,162,93,.035), 0 0 0 34px rgba(200,162,93,.025); }
.hero-grid { position: absolute; inset: 0; opacity: .2; background-image: linear-gradient(rgba(126,196,199,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(126,196,199,.09) 1px, transparent 1px); background-size: 34px 34px; mask-image: linear-gradient(90deg, black, transparent 82%); }
.hero-content { position: relative; z-index: 1; max-width: 740px; padding: 37px 44px 32px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--gold); font-size: 10px; letter-spacing: .18em; font-weight: 700; text-transform: uppercase; }
.eyebrow-line { width: 29px; height: 1px; background: var(--gold); }
h1, h2, h3 { margin: 0; font-family: 'Cinzel', Georgia, serif; font-weight: 600; letter-spacing: .015em; }
.hero-content h1 { margin-top: 12px; font-size: clamp(31px, 4vw, 50px); line-height: 1.1; letter-spacing: .03em; }
.hero-content p { max-width: 620px; margin: 14px 0 17px; color: #b9c8ca; font-size: 17px; line-height: 1.65; }
.hero-meta { display: flex; gap: 10px; color: var(--muted); font-size: 12px; }
.meta-separator { color: var(--gold); }
.hero-mark-wrap { position: relative; z-index: 1; display: flex; align-items: center; margin-left: auto; margin-right: clamp(28px, 8vw, 110px); }
.hero-mark { width: 140px; height: 140px; object-fit: contain; opacity: .78; filter: drop-shadow(0 0 25px rgba(200,162,93,.24)); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 275px; gap: 45px; padding-top: 46px; }
.article-column { min-width: 0; max-width: 835px; }
.article-tools { display: flex; gap: 9px; align-items: center; margin: 2px 0 25px; }
.subtle-button, .outline-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 35px; padding: 6px 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 2px; font-size: 12px; }
.subtle-button:hover, .outline-button:hover { color: var(--ink); border-color: rgba(101,215,209,.55); }
.subtle-button.primary { color: var(--gold-bright); border-color: rgba(200,162,93,.5); }
.article-body { color: #b8c5c8; }
.article-body h2 { margin: 34px 0 13px; color: var(--ink); font-size: 22px; }
.article-body h3 { margin: 27px 0 9px; color: var(--gold-bright); font-size: 16px; }
.article-body p { max-width: 760px; margin: 0 0 16px; }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body blockquote { margin: 26px 0; padding: 15px 19px; color: #d8d2be; background: rgba(200,162,93,.07); border-left: 2px solid var(--gold); }
.article-body ul { margin: 12px 0 20px; padding-left: 20px; }
.article-body li { margin: 7px 0; }
.article-body li::marker { color: var(--gold); }
.article-body ol { margin: 12px 0 20px; padding-left: 24px; }
.article-body a { color: var(--cyan); text-decoration: underline; text-decoration-color: rgba(0, 229, 255, .45); text-underline-offset: 3px; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4, .article-body h5, .article-body h6 { color: var(--ink); line-height: 1.25; }
.article-body h1 { margin: 38px 0 16px; font-size: 28px; }
.article-body h4, .article-body h5, .article-body h6 { margin: 22px 0 8px; color: var(--gold-bright); }
.article-body pre, .article-body code { font-family: "Spectral", Georgia, serif; }
.article-body pre { max-width: 100%; overflow-x: auto; padding: 14px 16px; color: #e9e5d7; background: rgba(3, 10, 17, .72); border: 1px solid var(--line); }
.article-body table { width: 100%; margin: 22px 0 28px; border-collapse: collapse; color: #cbd5d5; font-size: .94em; }
.article-body th, .article-body td { padding: 9px 10px; border: 1px solid rgba(200, 162, 93, .3); vertical-align: top; text-align: left; }
.article-body th { color: var(--gold-bright); background: rgba(200, 162, 93, .1); font-weight: 600; }
.article-body img { display: block; max-width: 100%; height: auto; margin: 20px auto; border: 1px solid rgba(200, 162, 93, .28); }
.article-body .docs-hero { width: 100%; max-width: 100%; margin: 0 auto 28px; border: 0; }
.article-body .docs-card-grid { display: grid; align-items: start; width: 100%; max-width: 820px; margin: 26px auto 8px; gap: 12px; }
.article-body .docs-card-grid-bottom { margin-top: 48px; }
.article-body .docs-card-grid img { width: 100%; max-width: none; margin: 0; border: 0; }
.article-body .docs-card-link { display: block; width: 100%; padding: 0; color: inherit; background: transparent; border: 0; border-radius: 3px; cursor: pointer; line-height: 0; transition: transform .2s ease, filter .2s ease; }
.article-body .docs-card-link:hover { transform: translateY(-3px); filter: brightness(1.08); }
.article-body .docs-card-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.article-body .docs-card-link img { pointer-events: none; }
.article-body .docs-card-grid.docs-card-grid-species { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.article-body .docs-card-grid.docs-card-grid-classes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.article-body .docs-card-spacer { visibility: hidden; }
.article-body .docs-image-group { width: 100%; max-width: 820px; margin: 22px auto; }
.article-body .docs-image-group-hero { max-width: 100%; margin-top: 0; }
.article-body .docs-image-group-hero img,
.article-body .docs-image-group-large img { width: 100%; max-width: 100%; margin: 0 auto; border: 0; }
.article-body .docs-image-group-cards,
.article-body .docs-image-group-icons { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 10px; }
.article-body .docs-image-group-cards img { width: auto; max-width: 100%; margin: 0; border: 0; }
.article-body .docs-image-group-icons {
  display: inline;
  width: auto;
  max-width: none;
  margin: 0 !important;
  white-space: nowrap;
}
.article-body img.docs-inline-icon,
.article-body img.docs-inline-heading-icon {
  display: inline-block;
  width: 13px !important;
  height: 13px !important;
  max-width: none;
  object-fit: contain;
  margin: 0 4px 0 0 !important;
  border: 0;
  vertical-align: -2px;
}
.article-body img.docs-inline-heading-icon {
  width: 15px !important;
  height: 15px !important;
  vertical-align: -2px;
}
.article-body p.docs-title-art-source {
  position: relative;
  width: 100%;
  max-width: 718px;
  height: clamp(112px, 21.3vw, 153px);
  margin: 0 auto 22px !important;
  text-align: center !important;
  isolation: isolate;
}
.article-body p.docs-title-art-source > span:first-child {
  position: relative;
  z-index: 2;
  display: block;
  padding-top: 3px;
}
.article-body p.docs-title-art-source > img {
  position: absolute;
  z-index: 1;
  top: -24px;
  left: 50%;
  width: 100%;
  max-width: 718px;
  height: 100%;
  object-fit: contain;
  margin: 0 !important;
  border: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
@media (max-width: 680px) {
  .article-body .docs-card-grid.docs-card-grid-species,
  .article-body .docs-card-grid.docs-card-grid-classes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .article-body .docs-card-grid-species .docs-card-spacer { display: none; }
}
.entry-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.entry-heading h2 { font-size: 26px; line-height: 1.25; }
.entry-kicker { margin-bottom: 11px; color: var(--gold); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.entry-lead { max-width: 760px; margin: 0 0 29px; color: #d2dbda; font-size: 18px; line-height: 1.62; }
.entry-divider { height: 1px; margin: 27px 0 30px; background: linear-gradient(90deg, rgba(200,162,93,.55), var(--line), transparent); }
.category-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.category-card { display: block; padding: 17px 17px 16px; color: inherit; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 2px; text-decoration: none; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.category-card:hover { background: rgba(101,215,209,.06); border-color: rgba(101,215,209,.45); transform: translateY(-2px); }
.category-card .card-icon { color: var(--gold-bright); font-size: 18px; }
.category-card strong { display: block; margin-top: 7px; color: var(--ink); font-family: 'Cinzel', Georgia, serif; font-size: 14px; }
.category-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.empty-entry { padding: 20px 22px; color: var(--muted); background: rgba(255,255,255,.025); border: 1px dashed rgba(130,171,187,.26); }
.empty-entry strong { color: var(--gold-bright); }

.editor-panel { margin-top: 30px; padding: 23px; background: rgba(12, 31, 43, .78); border: 1px solid rgba(200,162,93,.42); box-shadow: var(--shadow); }
.editor-panel label, .modal label { display: grid; gap: 7px; margin-bottom: 17px; color: var(--gold); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.editor-panel input, .editor-panel textarea, .modal input, .modal textarea, .modal select { width: 100%; padding: 10px 12px; color: var(--ink); background: rgba(4, 13, 21, .7); border: 1px solid var(--line); border-radius: 2px; outline: 0; font-size: 15px; letter-spacing: 0; text-transform: none; }
.editor-panel textarea, .modal textarea { min-height: 170px; resize: vertical; line-height: 1.6; }
.editor-panel .rich-editor { min-height: 420px; max-height: 720px; overflow: auto; padding: 16px; color: #cbd5d5; background: rgba(4, 13, 21, .7); border: 1px solid var(--line); border-radius: 2px; outline: 0; line-height: 1.65; }
.editor-panel .rich-editor:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(200, 162, 93, .12); }
.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; padding: 9px; background: rgba(2, 10, 17, .72); border: 1px solid var(--line); }
.editor-toolbar select, .editor-inline-control input { min-height: 29px; padding: 4px 7px; color: var(--muted); background: #091722; border: 1px solid var(--line); border-radius: 2px; font-size: 11px; }
.editor-toolbar input[type="color"] { width: 30px; height: 29px; padding: 2px; cursor: pointer; }
.editor-tool-button { min-height: 29px; padding: 4px 8px; color: var(--ink); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 2px; font-size: 12px; cursor: pointer; }
.editor-tool-button:hover { color: var(--cyan); border-color: rgba(101,215,209,.55); }
.editor-tool-separator { width: 1px; height: 23px; margin: 0 3px; background: var(--line); }
.editor-inline-control { display: inline-flex !important; align-items: center; gap: 3px !important; margin: 0 !important; color: var(--muted) !important; font-size: 11px !important; letter-spacing: 0 !important; text-transform: none !important; }
.editor-inline-control input { width: 48px; }
.editor-help { display: block; margin-top: 8px; color: var(--muted-2); font-size: 11px; letter-spacing: 0; text-transform: none; }
.editor-panel .rich-editor img { cursor: pointer; transition: outline .15s ease, opacity .15s ease; }
.editor-panel .rich-editor img.editor-image-selected { outline: 2px solid var(--cyan); outline-offset: 3px; }
.editor-panel .rich-editor img.editor-image-float-left { float: left; width: 48% !important; margin: 8px 18px 10px 0; }
.editor-panel .rich-editor img.editor-image-float-right { float: right; width: 48% !important; margin: 8px 0 10px 18px; }
.editor-panel .rich-editor img.editor-image-layer-above { position: relative; z-index: 4; box-shadow: 0 0 0 1px rgba(101,215,209,.45), 0 10px 24px rgba(0,0,0,.38); }
.editor-panel .rich-editor img.editor-image-layer-below { position: relative; z-index: 0; opacity: .78; }
.auth-error { min-height: 18px; margin: -5px 0 10px; color: #ff9d9d; font-size: 12px; }
.editor-panel .rich-editor h1, .editor-panel .rich-editor h2, .editor-panel .rich-editor h3, .editor-panel .rich-editor h4 { color: var(--ink); }
.editor-panel .rich-editor table { width: 100%; border-collapse: collapse; }
.editor-panel .rich-editor th, .editor-panel .rich-editor td { padding: 7px 9px; border: 1px solid rgba(200, 162, 93, .3); vertical-align: top; }
.editor-panel .rich-editor img { max-width: 100%; height: auto; }
.editor-actions { display: flex; justify-content: flex-end; gap: 9px; }
.editor-actions .gold-button { width: auto; min-width: 150px; }

.right-rail { min-width: 0; }
.rail-card { padding: 18px; margin-bottom: 14px; background: rgba(11, 26, 38, .55); border: 1px solid var(--line); }
.rail-label { color: var(--gold); font-size: 10px; letter-spacing: .18em; font-weight: 700; }
.toc-list { display: grid; gap: 9px; margin-top: 15px; }
.toc-link { padding-left: 11px; color: var(--muted); border-left: 1px solid rgba(130,171,187,.25); font-size: 12px; line-height: 1.35; }
.toc-link:hover { color: var(--cyan); border-left-color: var(--cyan); }
.master-card p, .legend-card p { margin: 10px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.outline-button { width: 100%; color: var(--gold-bright); border-color: rgba(200,162,93,.38); }
.outline-button span { font-size: 15px; }
.legend-card { display: flex; gap: 11px; align-items: flex-start; border-color: rgba(101,215,209,.18); }
.legend-card p { margin-bottom: 0; }
.legend-card strong { color: var(--ink); font-size: 13px; }
.legend-icon { color: var(--cyan); font-size: 22px; line-height: 1; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 22px; background: rgba(1, 7, 12, .78); backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(520px, 100%); max-height: 92vh; overflow: auto; padding: 30px; background: linear-gradient(145deg, #132b3b, #091722); border: 1px solid rgba(200,162,93,.5); box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.modal h2 { margin-top: 13px; font-size: 25px; }
.modal-copy { margin: 9px 0 23px; color: var(--muted); font-size: 14px; }
.modal-close { position: absolute; top: 10px; right: 14px; width: 30px; height: 30px; color: var(--muted); background: transparent; border: 0; font-size: 25px; }
.modal-close:hover { color: var(--ink); }

@media (max-width: 1080px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 220px; gap: 26px; }
  .hero-mark-wrap { margin-right: 25px; }
  .local-note { display: none; }
}
@media (max-width: 820px) {
  .site-shell { display: block; }
  .sidebar { min-height: auto; position: relative; padding: 15px 15px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-lockup { padding-bottom: 13px; }
  .brand-mark { width: 35px; height: 35px; }
  .sidebar-actions { display: none; }
  .search-box { margin: 14px 0; }
  .wiki-nav { max-height: 290px; }
  .sidebar-footer { display: flex; flex-wrap: wrap; align-items: center; border-top: 0; padding: 10px 2px 0; }
  .sidebar::after { display: none; }
  .topbar { min-height: 60px; padding: 0 18px; }
  .content-frame { padding: 22px 18px 48px; }
  .hero-panel { min-height: auto; }
  .hero-content { padding: 28px 24px; }
  .hero-content p { font-size: 15px; }
  .hero-mark-wrap { display: none; }
  .workspace-grid { display: block; padding-top: 30px; }
  .right-rail { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 32px; }
  .rail-card { margin-bottom: 0; }
  .legend-card { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .topbar-actions { gap: 0; }
  .breadcrumbs { font-size: 11px; }
  .mode-button { padding: 7px 9px; }
  .hero-content h1 { font-size: 30px; }
  .hero-meta { flex-wrap: wrap; }
  .category-cards, .right-rail { grid-template-columns: 1fr; }
  .legend-card { grid-column: auto; }
  .entry-heading { display: block; }
  .article-tools { margin-top: 14px; }
}
