:root {
  color-scheme: dark;
  --ink: #0a1017;
  --panel: #101a25;
  --panel-raised: #152231;
  --paper: #f0eee8;
  --muted: #a8b7c6;
  --signal: #8ed8e4;
  --copper: #e2a677;
  --green: #a1d9bc;
  --danger: #ffb9a9;
  --line: #334353;
  --control-line: #6a849a;
  font: 16px/1.55 Inter, system-ui, sans-serif;
  color: var(--paper);
  background: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
main:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.029em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.9rem); font-weight: 660; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.8rem); }
h3 { font-size: 1.1rem; }
p + p { margin-top: .7rem; }
a { color: var(--signal); text-underline-offset: .23em; }
a:hover { color: var(--paper); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.muted, .lede, .hint { color: var(--muted); }
.lede { max-width: 62ch; margin-top: .58rem; font-size: clamp(1rem, 2.1vw, 1.16rem); }
.wrap { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.section-pad { padding-block: clamp(28px, 6vw, 64px); }

.skip-link {
  position: absolute;
  z-index: 1;
  left: 1rem;
  top: 1rem;
  padding: .5rem 1rem;
  transform: translateY(-200%);
  background: var(--ink);
}
.skip-link:focus { transform: none; }

.site-header, .site-footer { border-color: var(--line); }
.site-header { border-bottom: 1px solid var(--line); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
.masthead, .footer-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  min-height: 66px;
}
.brand, .masthead nav { display: flex; align-items: center; gap: 16px; }
.brand { color: var(--paper); font-size: .75rem; font-weight: 750; letter-spacing: .14em; text-decoration: none; white-space: nowrap; }
.brand img { flex: none; }
.masthead nav { flex-wrap: wrap; column-gap: 24px; row-gap: 0; }
.masthead nav a { min-height: 44px; display: grid; align-items: center; color: var(--muted); text-decoration: none; }
.masthead nav a[aria-current], .masthead nav a:hover { color: var(--signal); text-decoration: underline; text-underline-offset: .44em; }

.button, .compact-link, .back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .48em;
  min-height: 44px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.button {
  padding: .54rem .82rem;
  border: 1px solid var(--control-line);
  border-radius: 5px;
  color: var(--paper);
  background: var(--panel-raised);
}
.button:hover { border-color: var(--signal); color: var(--signal); }
.button.primary { border-color: var(--copper); color: var(--ink); background: var(--copper); }
.button.primary:hover { border-color: #f1bd93; color: var(--ink); background: #f1bd93; }

.workspace-header, .entry-heading, .sidebar-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 18px;
}
.workspace-header { margin-bottom: 24px; }
.identity { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem 1rem; color: var(--muted); }
.identity a { display: inline-flex; align-items: center; min-height: 44px; }
.workspace {
  display: grid;
  grid-template-columns: minmax(235px, 1fr) minmax(0, 2.65fr);
  align-items: start;
  gap: 20px;
}
.entry-sidebar, .panel, .form-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.sidebar-header { align-items: center; padding: .7rem .9rem; }
.sidebar-header h2 { font-size: 1.07rem; }
.panel, .form-panel { padding: clamp(16px, 3vw, 26px); }
.panel h2, .panel h3 { margin-bottom: .55rem; }
.form-panel.narrow { max-width: 540px; margin-inline: auto; }
.form-panel h1 { font-size: clamp(2rem, 5vw, 3rem); }
.form-panel .form-stack + p, .form-panel .lede + .actions { margin-top: 1rem; }
.entry-list, .event-list, .guide-grid { list-style: none; padding: 0; margin: 0; }
.entry-list li { border-top: 1px solid var(--line); }
.entry-list a { display: grid; gap: .24rem; padding: .8rem .9rem; text-decoration: none; color: var(--paper); }
.entry-list a:hover, .entry-list a[aria-current] { background: var(--panel-raised); color: var(--signal); }
.entry-list a[aria-current] { box-shadow: inset 3px 0 var(--signal); }
.entry-list a:focus-visible { outline-offset: -3px; }
.entry-list strong, .entry-heading h2 { overflow-wrap: anywhere; }
.entry-meta { font-size: .79rem; color: var(--muted); }
.status-dot { display: inline-block; width: .5rem; height: .5rem; margin-inline-end: .35rem; border: 1px solid currentColor; border-radius: 100%; vertical-align: .05em; }
.status-dot.approved, .status-dot.published { background: var(--green); border-color: var(--green); }
.sidebar-empty { padding: .4rem .9rem 1rem; color: var(--muted); }
.entry-detail { min-width: 0; overflow-wrap: anywhere; }
.entry-heading { margin-bottom: 17px; }
.entry-heading h2 { margin: .35rem 0; font-size: clamp(1.55rem, 4vw, 2.6rem); }
.heading-actions, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.entry-detail > .panel + .panel, .transition { margin-top: 16px; }
.entry-detail > .transition + .panel { margin-top: 16px; }
.tag, .category {
  display: inline-block;
  color: var(--signal);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 550;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.tag { padding: .125rem .45rem; border: 1px solid currentColor; border-radius: 4px; }
.tag-approved, .tag-published { color: var(--green); }

.workflow {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.workflow li {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem;
  color: var(--muted);
  font-size: .86rem;
}
.workflow li + li { border-left: 1px solid var(--line); }
.workflow span { display: grid; flex: none; place-items: center; width: 1.4rem; height: 1.4rem; border: 1px solid currentColor; border-radius: 100%; font-size: .7rem; }
.workflow .complete { color: var(--green); }
.workflow .current { color: var(--paper); background: var(--panel-raised); font-weight: 750; }
.workflow .current span { color: var(--ink); background: var(--copper); border-color: var(--copper); }

.form-stack { display: grid; gap: 1rem; }
.panel h3 + .form-stack, .form-panel .lede + .form-stack, .form-panel .message + .form-stack { margin-top: 1.15rem; }
.form-stack label { display: grid; gap: .35rem; font-weight: 620; }
.form-stack .checkbox-label { display: flex; align-items: baseline; gap: .65rem; }
.checkbox-label input[type=checkbox] { width: auto; min-height: 0; flex-shrink: 0; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: .56rem .68rem;
  border: 1px solid var(--control-line);
  border-radius: 5px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 400;
}
textarea { resize: vertical; }
.hint { font-size: .82rem; font-weight: 400; }
.message { margin: 0 0 16px; padding: .62rem .78rem; border: 1px solid #689c85; border-radius: 5px; color: var(--green); background: #162821; }
.message.error { color: var(--danger); border-color: #a66d61; background: #321f20; }
.event-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .22rem 1rem; padding: .57rem 0; border-top: 1px solid var(--line); }
.event-list li:first-child { border-top: 0; }
.event-list small { display: block; color: var(--muted); }
.event-list time { align-self: center; font-size: .8rem; color: var(--muted); }
.contact-message { overflow-wrap: anywhere; }
.contact-message-body { white-space: pre-wrap; }
.source-note { overflow-wrap: anywhere; }

.guide-hero {
  background:
    linear-gradient(90deg, #0a1017 3%, #0a1017dc 36%, #0a101737 100%),
    linear-gradient(0deg, #0a1017b5, transparent 65%),
    url('/static/gantry.webp') 62% center / cover no-repeat;
  border-bottom: 1px solid var(--line);
}
.guide-hero-inner { min-height: clamp(245px, 36vw, 400px); padding-block: 45px; display: flex; flex-direction: column; justify-content: center; }
.guide-hero .lede { max-width: 43ch; }
.guide-content h2 { margin-bottom: 17px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.guide-card { position: relative; border: 1px solid var(--line); background: var(--panel); border-radius: 7px; padding: .95rem 1.05rem 1.12rem; overflow-wrap: anywhere; }
.guide-card:hover, .guide-card:focus-within { border-color: var(--signal); }
.guide-card h3 { margin: .3rem 0 .48rem; font-size: 1.2rem; }
.guide-card h3 a { color: var(--paper); text-decoration: none; }
.guide-card h3 a:hover { color: var(--signal); }
.guide-card h3 a::after { position: absolute; inset: 0; content: ""; }
.guide-card h3 span { color: var(--signal); }
.guide-card p:last-child { color: var(--muted); }
.article-wrap { max-width: 840px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 14px; color: var(--muted); }
.breadcrumbs a { display: inline-flex; min-height: 44px; align-items: center; }
.article-header { margin-bottom: 24px; padding-bottom: 23px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.article-header h1 { margin: .25rem 0 .6rem; }
.article-note { color: var(--copper); font-size: .89rem; margin-top: .7rem; }
.article-text { max-width: 70ch; font-size: clamp(1rem, 2vw, 1.12rem); overflow-wrap: anywhere; }
.article-text p + p { margin-top: 1.1rem; }
.back-link { margin-top: 20px; }

.account-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.account-page { max-width: 64rem; }
.account-page .workspace-header { align-items: center; flex-wrap: wrap; }
.account-page h1 { font-size: clamp(2.25rem, 5vw, 3.65rem); }
.account-grid-single { grid-template-columns: minmax(0, 1fr); max-width: 36rem; }
.account-grid + .account-grid, .account-grid + .account-delete-panel { margin-top: clamp(18px, 3vw, 28px); }
.profile-panel h2 { margin-bottom: 1rem; }
.profile-panel p { overflow-wrap: anywhere; }
.profile-panel > .form-stack, .account-delete-panel .form-stack, .public-invitation .form-stack { margin-top: 1.1rem; }
.account-delete-panel { max-width: 44rem; }
.account-delete-panel .actions { margin-top: 0; }
.account-delete-panel .delete-button { color: var(--danger); }
.account-delete-panel .delete-button:hover { border-color: var(--danger); }
.public-invitation { max-width: 38rem; }
.public-invitation .message { margin-top: 1rem; }
.public-invitation .button { justify-self: start; }
.invitation-code-value { font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.demo-account-form { margin-top: 1rem; }
.community-panel { border-top: 3px solid var(--copper); }
.community-panel h2 { margin-top: .28rem; }
.community-panel p:not(.category) { color: var(--muted); max-width: 48ch; }
.community-panel .community-follow { margin: 1.35rem 0 .3rem; }
.community-panel .community-link { display: inline-flex; align-items: center; gap: .28rem; min-height: 44px; }
.invitation-grid p + .form-stack, .invitation-grid .form-stack + .form-stack { margin-top: 1rem; }
.invitation-disclosure {
  border-left: 2px solid var(--copper);
  background: var(--panel-raised);
  padding: .7rem .9rem;
  overflow-wrap: anywhere;
}
.invitation-grid .invitation-confirm {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .7rem;
  min-height: 44px;
}
.invitation-confirm input {
  width: 1.15rem;
  min-height: 0;
  height: 1.15rem;
  padding: 0;
  margin: 0;
  accent-color: var(--copper);
}

@media (max-width: 780px) {
  .wrap { width: min(1160px, calc(100% - 36px)); }
  .workspace, .account-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .masthead { display: grid; align-content: center; padding-block: .7rem .25rem; gap: 0; }
  .masthead nav { column-gap: 15px; font-size: .9rem; }
  .workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow li:nth-child(3) { border-left: 0; }
  .workflow li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-hero { background-position: 0 0, 0 0, 68% center; }
  .heading-actions .button { flex: 1 0 auto; }
}

.entry-filters { margin: 0 .75rem .8rem; padding: .75rem; }
.entry-pager { margin: .7rem .75rem; align-items: center; }

.retention-queue { margin-top: 20px; }
.retention-notices { list-style: none; margin: 0; padding: 0; }
.retention-notices > li { border-top: 1px solid var(--line); padding-block: 1rem; }
.retention-notices h3 { overflow-wrap: anywhere; }
.retention-notices p { margin: .35rem 0 .8rem; }
.retention-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: .7rem 1.25rem; margin-bottom: 0; }
.retention-details dt { color: var(--muted); font-size: .8rem; }
.retention-details dd { margin: 0; }
