:root {
  color-scheme: light;
  --ink: #20221f;
  --muted: #6d726a;
  --paper: #f4f0e7;
  --panel: #fffdf8;
  --panel-raised: #fffefa;
  --line: #d9d3c7;
  --accent: #d35f3e;
  --accent-dark: #97432d;
  --green: #567362;
  --blue: #506f89;
  --yellow: #a47c36;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 1.2rem; font-size: clamp(2.7rem, 7vw, 6.2rem); letter-spacing: -.075em; line-height: .98; }
h2 { letter-spacing: -.045em; line-height: 1.05; }

.site-header, .site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 1180px; margin: 0 auto; padding: 1.2rem 2rem; }
.site-header { border-bottom: 1px solid var(--line); }
.site-header nav, .hero-actions { display: flex; align-items: center; gap: 1.1rem; }
.brand { font-weight: 800; letter-spacing: -.04em; font-size: 1.15rem; }
.site-header nav a:not(.button), .text-link { color: var(--muted); }
.site-header nav a:not(.button):hover, .text-link:hover { color: var(--ink); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1px solid var(--accent-dark); border-radius: .55rem; background: var(--accent); color: #fffaf2; padding: .8rem 1.05rem; font-weight: 700; box-shadow: 0 2px 0 var(--accent-dark); }
.button:hover { transform: translateY(-1px); }
.button-small { padding: .45rem .7rem; font-size: .88rem; }
.text-link { font-weight: 700; }
.eyebrow { margin: 0 0 .55rem; color: var(--accent-dark); font-size: .73rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--muted); }

.marketing-shell { max-width: 1180px; margin: 0 auto; padding: 5rem 2rem 4rem; }
.hero { max-width: 800px; padding: 3rem 0 6rem; }
.hero-copy { max-width: 650px; color: var(--muted); font-size: 1.2rem; }
.hero-actions { margin-top: 2rem; }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.principles article { min-height: 210px; padding: 1.5rem; background: var(--panel); }
.principle-number { color: var(--accent); font-weight: 800; }
.principles p, .callout p { color: var(--muted); }
.callout { max-width: 760px; margin-top: 5rem; padding: 2rem; border-left: 5px solid var(--accent); background: #e9e1d3; }
.callout h2 { max-width: 560px; font-size: 2rem; }
.site-footer { max-width: 1180px; color: var(--muted); font-size: .85rem; }
.narrow-shell { max-width: 760px; margin: 0 auto; padding: 7rem 2rem; }

.app-page {
  --ink: #eef2f6;
  --muted: #99a4b0;
  --paper: #11161c;
  --panel: #1a2129;
  --panel-raised: #222b35;
  --line: #303b47;
  --accent: #e49a55;
  --accent-dark: #b96731;
  --green: #78a68a;
  --blue: #80aaca;
  --yellow: #d4ae68;
  color-scheme: dark;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

.app-page .site-header { display: block; max-width: none; padding: 0 .75rem; background: #151b22; }
.site-header-inner { display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 4.2rem; margin: 0; }
.app-nav-menu { position: relative; z-index: 20; flex: 0 0 auto; }
.app-nav-menu > summary { list-style: none; }
.app-nav-menu > summary::-webkit-details-marker { display: none; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border: 1px solid var(--line); border-radius: .45rem; background: transparent; color: var(--ink); cursor: pointer; }
.icon-button:hover { border-color: var(--accent); background: var(--panel-raised); }
.header-menu-toggle { width: 2.4rem; height: 2.4rem; }
.menu-icon { display: grid; gap: .22rem; width: 1.1rem; }
.menu-icon span { display: block; height: 2px; border-radius: 99px; background: currentColor; }
.app-nav-panel { display: none; position: absolute; top: calc(100% + .6rem); left: 0; width: min(18rem, calc(100vw - 1.5rem)); padding: .65rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--panel-raised); box-shadow: 0 16px 40px rgb(0 0 0 / .35); }
.app-nav-menu[open] .app-nav-panel { display: grid; gap: .15rem; }
.app-nav-link { display: block; padding: .65rem .55rem; border-radius: .4rem; color: var(--ink); font-size: .86rem; font-weight: 700; }
.app-nav-link:hover { background: #2b3540; color: var(--ink); }
.app-page .brand { color: var(--ink); }
.domain-menu { position: relative; z-index: 12; min-width: 0; }
.domain-menu > summary { list-style: none; }
.domain-menu > summary::-webkit-details-marker { display: none; }
.domain-menu-summary { display: flex; align-items: center; gap: .35rem; min-width: 0; padding: .35rem .45rem; border: 1px solid transparent; border-radius: .4rem; color: var(--ink); cursor: pointer; }
.domain-menu-summary:hover, .domain-menu[open] > .domain-menu-summary { border-color: var(--line); background: var(--panel-raised); }
.domain-menu-label { margin: 0; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.domain-menu-current { max-width: min(15rem, 20vw); overflow: hidden; font-size: .86rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.domain-menu-chevron { color: var(--muted); font-size: 1rem; line-height: .8; }
.domain-menu-dropdown { display: none; position: absolute; top: calc(100% + .55rem); left: 0; width: min(24rem, calc(100vw - 1.5rem)); padding: .7rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--panel-raised); box-shadow: 0 16px 40px rgb(0 0 0 / .35); }
.domain-menu[open] .domain-menu-dropdown { display: block; }
.domain-menu-list { display: grid; gap: .2rem; margin: 0; padding: 0; list-style: none; }
.domain-menu-link { display: grid; gap: .15rem; padding: .65rem .55rem; border-radius: .45rem; color: var(--ink); }
.domain-menu-link:hover, .domain-menu-link.is-active { background: #2b3540; }
.domain-menu-domain { color: var(--muted); font-size: .72rem; }
.workspace-menu { display: flex; align-items: center; min-width: 0; position: relative; z-index: 10; }
.workspace-menu-current { display: flex; align-items: center; min-width: 0; }
.workspace-menu-current > a, .workspace-menu-current > span { max-width: min(24rem, 35vw); overflow: hidden; color: var(--ink); font-size: .9rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.workspace-menu-current > a:hover { color: var(--accent); }
.workspace-menu-disclosure { position: relative; flex: 0 0 auto; }
.workspace-menu-disclosure > summary { list-style: none; }
.workspace-menu-disclosure > summary::-webkit-details-marker { display: none; }
.workspace-menu-toggle { width: 1.8rem; height: 1.8rem; border: 0; border-radius: .35rem; }
.workspace-menu-chevron { color: var(--muted); font-size: 1rem; line-height: .8; }
.workspace-menu-dropdown { display: none; position: absolute; top: calc(100% + .55rem); left: 0; width: min(22rem, calc(100vw - 1.5rem)); padding: .7rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--panel-raised); box-shadow: 0 16px 40px rgb(0 0 0 / .35); }
.workspace-menu-disclosure[open] .workspace-menu-dropdown { display: block; }
.workspace-menu-label { margin: .15rem .55rem .45rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.workspace-menu-list { display: grid; gap: .2rem; margin: 0; padding: 0; list-style: none; }
.workspace-menu-link { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .65rem .55rem; border-radius: .45rem; color: var(--ink); }
.workspace-menu-link:hover, .workspace-menu-link.is-active { background: #2b3540; }
.workspace-menu-kind { color: var(--muted); font-size: .72rem; }
.workspace-menu-create { display: block; margin-top: .55rem; padding: .65rem .55rem .35rem; border-top: 1px solid var(--line); color: var(--accent); font-weight: 750; }
.workspace-menu-create:hover { color: var(--ink); }
.site-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: .9rem; min-width: 0; }
.site-header-actions { margin-left: auto; }
.header-user { max-width: 12rem; overflow: hidden; color: var(--muted); font-size: .8rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.header-signout { font-size: .78rem; white-space: nowrap; }
.app-content { width: 100%; margin: 0; padding: clamp(1.5rem, 4vw, 2.75rem) 0 4rem; }
.app-layout { --layout-max: 980px; width: min(calc(100% - 2rem), var(--layout-max)); margin: 0 auto; }
.app-layout-readable { --layout-max: 980px; }
.app-layout-wide, .app-layout-three-column { --layout-max: 1440px; }
.app-layout-board, .app-layout-table { --layout-max: 100%; }
.layout-stack { display: grid; gap: 1.35rem; min-width: 0; }
.layout-columns { display: grid; gap: 1.35rem; min-width: 0; }
.layout-column { min-width: 0; }
.layout-panel { min-width: 0; padding: 1rem; border: 1px solid var(--line); background: var(--panel); }
.layout-panel-raised { background: var(--panel-raised); }
.layout-nav, .layout-content, .layout-aside { min-width: 0; }
.layout-columns-three { grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr) minmax(14rem, 18rem); align-items: start; }
.layout-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; min-width: 0; }
.layout-action-group { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.layout-drawer { min-width: 0; }
.layout-empty { display: grid; gap: .45rem; place-items: start; padding: 1.2rem; border: 1px dashed var(--line); background: var(--panel); }
.layout-empty > :last-child { margin-bottom: 0; }
.page-stack { display: grid; gap: 1.35rem; }
.narrow-page { width: min(100%, 620px); margin: 0 auto; }
.workspace-header { padding: 0 0 .9rem; border-bottom: 1px solid var(--line); }
.workspace-kind, .breadcrumb { margin: 0 0 .35rem; color: var(--muted); font-size: .78rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.workspace-header h1, .detail-header h1 { margin: 0; font-size: clamp(1.85rem, 5vw, 3.2rem); letter-spacing: -.055em; line-height: 1.05; }
.workspace-description { max-width: 680px; margin: .55rem 0 0; color: var(--muted); }
.detail-header { display: grid; gap: .7rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.breadcrumb a { color: var(--blue); }
.breadcrumb a:hover { color: var(--ink); }
.detail-title-row { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.detail-title-row h1 { min-width: 0; overflow-wrap: anywhere; }
.detail-title-row .status-pill { flex: 0 0 auto; }
.spec-fact { margin: -.55rem 0 0; color: var(--muted); font-size: .9rem; }
.spec-fact strong { color: var(--ink); }
.metadata-list, .metadata-warning-list { display: grid; gap: .25rem; margin: .35rem 0 0; padding-left: 1.25rem; }
.metadata-warning-list { gap: .15rem; }
.notice { padding: .75rem .9rem; border: 1px solid #7d4d43; background: #382321; color: #f1c0b1; }
.auth-page { max-width: 32rem; }
.auth-form .button { justify-self: start; }
.header-account { color: var(--blue); font-size: .8rem; font-weight: 750; }
.header-account:hover { color: var(--ink); }

.account-page { max-width: 860px; margin: 0 auto; }
.account-context { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: 1rem; border: 1px solid var(--line); background: var(--panel); }
.account-context h2 { margin: 0; font-size: 1.25rem; }
.account-label, .account-form-label { margin: 0 0 .3rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.endpoint-value { margin: 0; overflow-wrap: anywhere; }
.account-meta { margin: .3rem 0 0; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.account-meta strong { color: var(--ink); }
.account-intro { margin: -.3rem 0 .15rem; color: var(--muted); font-size: .88rem; }
.account-list, .key-list { display: grid; gap: 1rem; }
.account-card { display: grid; gap: 1rem; padding: 1rem; border: 1px solid var(--line); background: var(--panel); }
.account-card-header, .key-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; min-width: 0; }
.account-card h3, .key-row h3 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.account-card-actions { display: flex; justify-content: flex-end; margin-top: -.55rem; }
.agent-settings { display: grid; gap: .8rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.agent-endpoint { margin: .2rem 0 0; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.account-form { display: grid; gap: .8rem; padding: 1rem; border: 1px solid var(--line); background: #171e26; }
.account-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.account-form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .9rem; }
.scope-fieldset { min-width: 0; margin: 0; padding: .7rem; border: 1px solid var(--line); }
.scope-fieldset legend { padding: 0 .35rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.scope-options { display: flex; flex-wrap: wrap; gap: .55rem 1rem; }
.scope-option { display: inline-flex; grid-template-columns: auto 1fr; align-items: center; gap: .4rem; color: var(--ink); font-size: .82rem; }
.scope-option input { width: auto; accent-color: var(--accent); }
.account-key-disclosure { padding-top: .1rem; }
.key-row { align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.key-row:last-child { border-bottom: 0; }
.key-copy { min-width: 0; }
.lifecycle-pill { display: inline-block; flex: 0 0 auto; border: 1px solid transparent; border-radius: 99px; padding: .12rem .48rem; font-size: .68rem; font-weight: 800; line-height: 1.35; }
.lifecycle-active { border-color: #456954; background: #20392b; color: #a7d0b1; }
.lifecycle-disabled { border-color: #7d4d4a; background: #3c2627; color: #eab0ad; }
.secret-panel { display: grid; gap: .65rem; padding: 1rem; border: 1px solid var(--accent-dark); background: #30251e; }
.secret-panel h2 { margin: 0; font-size: 1.2rem; }
.secret-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; user-select: all; }
.notice-success { border-color: #456954; background: #20392b; color: #a7d0b1; }
.empty-state { padding: 1rem; border: 1px dashed var(--line); background: var(--panel); }
.empty-state h2 { margin: 0 0 .35rem; font-size: 1rem; }
.empty-state p { margin: 0; color: var(--muted); }
.team-page { max-width: 860px; }
.team-section { gap: .8rem; }
.member-list, .invitation-list { display: grid; gap: 0; }
.member-row, .invitation-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; min-width: 0; padding: .95rem 0; border-bottom: 1px solid var(--line); }
.member-row:last-child, .invitation-row:last-child { border-bottom: 0; }
.member-copy, .invitation-copy { min-width: 0; }
.member-row h3, .invitation-row h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.member-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .7rem; flex: 0 0 auto; }
.inline-form { display: inline-flex; align-items: center; gap: .45rem; }
.inline-form select { width: auto; min-width: 7.25rem; padding: .4rem .5rem; font-size: .78rem; }
.invitation-row .member-actions form { display: inline-flex; }

.disclosure { display: grid; gap: .8rem; }
.disclosure > summary { width: max-content; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure[open] > summary { background: var(--panel-raised); color: var(--ink); box-shadow: none; }
.create-form, .workspace-form { display: grid; gap: .8rem; padding: 1rem; border: 1px solid var(--line); background: var(--panel); }
.create-form { grid-template-columns: minmax(0, 1fr) 150px auto; align-items: end; }
.workspace-form { width: 100%; }
label { display: grid; gap: .3rem; color: var(--muted); font-size: .78rem; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: .4rem; padding: .58rem .65rem; background: #141a21; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #697582; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { resize: vertical; }

.content-section, .related-section { display: grid; gap: .8rem; min-width: 0; }
.tag-chip-list, .tag-suggestion-list { display: flex; flex-wrap: wrap; gap: .45rem; min-width: 0; }
.tag-chip-list-compact { margin-top: .55rem; gap: .35rem; }
.tag-chip { display: inline-flex; align-items: center; max-width: 100%; overflow-wrap: anywhere; border: 1px solid #45627a; border-radius: 99px; padding: .2rem .55rem; background: #203443; color: #b7d5e8; font-size: .78rem; font-weight: 750; }
.tag-chip:hover { border-color: var(--accent); background: #2b3540; color: var(--ink); }
.tag-chip-unrecognized { border-style: dashed; border-color: #78643e; background: #30291e; color: #e0c486; }
.unrecognized-tags { display: grid; gap: .55rem; margin-top: .25rem; padding: .75rem; border: 1px dashed #78643e; background: #211d18; }
.unrecognized-tags h3 { margin: 0; font-size: .86rem; }
.tag-suggestion-list { display: grid; gap: .45rem; }
.tag-suggestion-row { display: flex; align-items: center; justify-content: space-between; gap: .7rem; min-width: 0; }
.tag-suggestion-row > .tag-chip { min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .55rem; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: 1rem; letter-spacing: -.02em; }
.section-count { min-width: 1.6rem; color: var(--muted); font-size: .78rem; text-align: right; }
.empty-inline { margin: 0; color: var(--muted); }
.node-list, .milestone-list, .step-list { display: grid; gap: 0; min-width: 0; }
.node-row, .milestone-row, .step-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: start; min-width: 0; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.node-row:last-child, .milestone-row:last-child, .step-row:last-child { border-bottom: 0; }
.node-row { grid-template-columns: 2.2rem minmax(0, 1fr); }
.node-spec { border-left: 3px solid var(--blue); padding-left: .8rem; }
.node-milestone { border-left: 3px solid var(--accent); padding-left: .8rem; }
.node-step { border-left: 3px solid var(--green); padding-left: .8rem; }
.node-index { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.node-reference { margin: .25rem 0 0; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.node-copy, .milestone-row-content { min-width: 0; }
.row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .3rem; }
.workspace-context { color: var(--blue); font-size: .76rem; font-weight: 750; }
.workspace-context:hover { color: var(--ink); }
.kind-label { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.title-link { color: var(--ink); font-weight: 750; overflow-wrap: anywhere; }
.title-link:hover { color: var(--accent); }
.node-row h3, .milestone-row h3, .step-row h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.linked-specs { display: flex; flex-wrap: wrap; gap: .25rem .7rem; margin: .55rem 0 0; padding: 0; list-style: none; }
.linked-specs li { display: grid; gap: .2rem; min-width: 0; }
.linked-specs li + li::before { content: "·"; margin-right: .7rem; color: var(--muted); }
.linked-specs a { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.linked-specs a:hover { color: var(--accent); }
.linked-spec-copy, .linked-spec-meta { min-width: 0; }
.linked-spec-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.milestone-position, .milestone-version { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.milestone-release { color: var(--muted); font-size: .76rem; }

.row-editor { position: relative; min-width: 3rem; text-align: right; }
.row-editor > summary { list-style: none; }
.row-editor > summary::-webkit-details-marker { display: none; }
.row-editor .compact-form { display: grid; gap: .7rem; margin-top: .7rem; padding: .8rem; border: 1px solid var(--line); background: var(--panel); text-align: left; }
.compact-form .button { justify-self: start; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--accent); font-weight: 750; }
.text-button:hover { color: var(--ink); text-decoration: underline; }

.status-pill { display: inline-block; border: 1px solid transparent; border-radius: 99px; padding: .12rem .48rem; font-size: .68rem; font-weight: 800; line-height: 1.35; }
.status-draft { border-color: #46515d; background: #252d36; color: var(--muted); }
.status-ready { border-color: #45627a; background: #203443; color: #a4c6df; }
.status-in_progress { border-color: #456954; background: #20392b; color: #a7d0b1; }
.status-blocked { border-color: #815044; background: #3b2523; color: #efb2a1; }
.status-review { border-color: #78643e; background: #3a3020; color: #e0c486; }
.status-changes_requested { border-color: #7d4d4a; background: #3c2627; color: #eab0ad; }
.status-accepted, .status-delivered { border-color: #456954; background: #20392b; color: #a7d0b1; }
.status-planned { border-color: #46515d; background: #252d36; color: var(--muted); }
.status-on_hold { border-color: #815044; background: #3b2523; color: #efb2a1; }
.status-open { border-color: #45627a; background: #203443; color: #a4c6df; }
.status-answered, .status-resolved { border-color: #456954; background: #20392b; color: #a7d0b1; }
.status-dismissed { border-color: #7d4d4a; background: #3c2627; color: #eab0ad; }
.status-blocked-overlay { border-color: #d08a55; box-shadow: 0 0 0 1px #d08a55; }

.roadmap-links { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.roadmap-links li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; min-width: 0; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.roadmap-links li:last-child { border-bottom: 0; }
.roadmap-link-copy { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; min-width: 0; }
.roadmap-link-copy > span { color: var(--muted); }
.relationship-form { display: flex; align-items: center; gap: .6rem; padding-top: .25rem; }
.relationship-form select { min-width: 0; flex: 1 1 auto; }

.dependency-section { gap: 1rem; padding-top: .15rem; }
.dependency-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; min-width: 0; }
.dependency-group { display: grid; gap: .55rem; min-width: 0; }
.dependency-blocker-group { padding: .75rem; border: 1px solid #815044; background: #211a1b; }
.dependency-group-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.dependency-group-heading h3 { margin: 0; color: var(--ink); font-size: .86rem; }
.dependency-list { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.dependency-row { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; min-width: 0; padding: .7rem; border: 1px solid var(--line); background: var(--panel); }
.dependency-copy { min-width: 0; }
.dependency-row-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-bottom: .25rem; }
.dependency-title { display: block; color: var(--ink); font-size: .92rem; font-weight: 750; line-height: 1.3; overflow-wrap: anywhere; }
a.dependency-title:hover { color: var(--accent); }
.dependency-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin: .35rem 0 0; color: var(--muted); font-size: .74rem; overflow-wrap: anywhere; }
.dependency-meta a { color: var(--blue); font-weight: 700; }
.dependency-meta a:hover { color: var(--ink); }
.dependency-meta .status-pill { margin-left: .1rem; }
.dependency-reason { margin: .45rem 0 0; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.dependency-state { display: inline-block; border: 1px solid transparent; border-radius: 99px; padding: .1rem .4rem; font-size: .64rem; font-weight: 800; line-height: 1.35; }
.dependency-state-open { border-color: #815044; background: #3b2523; color: #efb2a1; }
.dependency-state-resolved { border-color: #456954; background: #20392b; color: #a7d0b1; }
.dependency-state-informational { border-color: #46515d; background: #252d36; color: var(--muted); }
.dependency-remove-form { flex: 0 0 auto; padding-top: .05rem; }
.dependency-form { display: grid; gap: .8rem; padding: 1rem; border: 1px solid var(--line); background: var(--panel); }
.dependency-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, .65fr); gap: .8rem; align-items: end; }
.checkbox-option { display: flex; align-items: center; gap: .45rem; min-height: 2.35rem; color: var(--ink); }
.checkbox-option input { width: auto; accent-color: var(--accent); }
.dependency-disclosure > summary { width: max-content; }

.step-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .65rem; }
.step-row-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; min-width: 0; }
.step-title { display: flex; align-items: baseline; gap: .7rem; min-width: 0; }
.step-title h3 { min-width: 0; }
.step-number { flex: 0 0 auto; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.step-detail { margin: 0; color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.step-detail code { overflow-wrap: anywhere; }
.review-hint { margin: 0; color: var(--accent); font-size: .78rem; font-weight: 750; }
.step-review-panel { display: grid; gap: .75rem; margin-top: .15rem; padding: .8rem; border: 1px solid #78643e; background: #29251d; }
.step-review-heading { display: grid; gap: .15rem; }
.step-review-heading h4 { margin: 0; font-size: .86rem; }
.step-review-heading .muted { font-size: .78rem; }
.step-review-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .8rem; }
.review-form { display: grid; gap: .6rem; }
.review-request-disclosure { display: grid; gap: .6rem; }
.review-request-disclosure > summary { width: max-content; }
.review-request-form { min-width: min(100%, 24rem); padding-top: .15rem; }
.review-feedback { margin: 0; color: var(--green); font-size: .78rem; font-weight: 750; }
.review-feedback-error { color: #efb2a1; }
.implementation-review-section { gap: .9rem; }
.implementation-attempt { display: grid; gap: .55rem; padding: .85rem; border: 1px solid var(--line); background: var(--panel); }
.implementation-attempt-current { border-color: #78643e; background: #29251d; }
.implementation-attempt-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.implementation-attempt-heading h3 { margin: 0; font-size: .9rem; }
.implementation-attempt-history { display: grid; gap: .7rem; margin-top: .7rem; }
.implementation-review-note { padding-top: .45rem; border-top: 1px solid var(--line); color: var(--ink); }
.implementation-review-next-action { color: var(--muted); font-size: .8rem; }
button:disabled { cursor: wait; opacity: .6; }
.transition-form { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.transition-form select { width: auto; min-width: 130px; }
.field-wide { grid-column: 1 / -1; }
.markdown-editor { display: grid; gap: .8rem; padding: 1rem; border: 1px solid var(--line); background: var(--panel); }
.spec-detail-layout { display: grid; grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr) minmax(15rem, 19rem); gap: clamp(1rem, 3vw, 2rem); align-items: start; }
.spec-detail-main, .spec-detail-aside { display: grid; gap: 1.35rem; min-width: 0; }
.spec-detail-aside { align-content: start; }
.spec-details-section, #spec-roadmaps, #spec-steps, #step-details, #comments, .step-summary-row { scroll-margin-top: 5.5rem; }
.step-summary-list { display: grid; gap: .7rem; }
.step-summary-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border: 1px solid var(--line); background: var(--panel); }
.step-summary-row:hover { border-color: #536474; background: var(--panel-raised); }
.step-summary-copy { min-width: 0; }
.step-summary-row .step-title { align-items: flex-start; }
.step-summary-row .step-title h3 { margin: 0 0 .2rem; font-size: 1rem; }
.step-summary-row .node-reference { margin: 0; }
.status-panel { display: grid; gap: .9rem; }
.status-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; }
.status-panel-heading h2 { margin: 0; font-size: 1rem; }
.status-facts { display: grid; gap: .65rem; margin: 0; }
.status-facts div { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: .6rem; align-items: baseline; }
.status-facts dt { color: var(--muted); font-size: .75rem; font-weight: 750; }
.status-facts dd { margin: 0; color: var(--ink); font-size: .82rem; text-align: right; overflow-wrap: anywhere; }
.status-reason dd { text-align: left; }
.status-panel-actions { display: grid; gap: .65rem; align-items: stretch; }
.status-panel-actions > label:not(.checkbox-option) { display: grid; gap: .3rem; color: var(--muted); font-size: .75rem; font-weight: 750; }
.status-panel-actions > label:not(.checkbox-option) select,
.status-panel-actions > label:not(.checkbox-option) textarea { margin-top: 0; }
.status-panel-actions select { width: 100%; }
.status-panel-actions textarea { min-height: 4.5rem; resize: vertical; }
.form-label-hint { color: var(--muted); font-size: .7rem; font-weight: 500; }
.status-action-help { margin: -.15rem 0 0; color: var(--muted); font-size: .74rem; line-height: 1.45; }
.discussion-filters { display: grid; gap: .8rem; padding: 1rem; border: 1px solid var(--line); background: var(--panel); }
.discussion-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; }
.discussion-filter-actions { display: flex; align-items: end; flex-wrap: wrap; gap: .7rem; }
.discussion-filter-actions > label:not(.checkbox-option) { min-width: min(12rem, 100%); flex: 1 1 12rem; }
.discussion-filter-actions .checkbox-option { margin-right: .3rem; }
.collaboration-section { gap: .9rem; }
.collaboration-summary { display: grid; gap: .35rem; padding: .8rem; border: 1px solid var(--line); background: var(--panel); }
.collaboration-summary p { margin: 0; }
.spec-navigation { min-width: 0; }
.spec-navigation-panel { padding: .7rem; border: 1px solid var(--line); background: var(--panel); }
.spec-navigation-label { margin: .15rem .45rem .55rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.spec-navigation-links { display: grid; gap: .15rem; }
.spec-navigation-link { display: grid; grid-template-columns: 1.2rem minmax(0, 1fr) auto; align-items: center; gap: .45rem; min-width: 0; padding: .45rem; border-radius: .35rem; color: var(--ink); font-size: .82rem; line-height: 1.3; }
.spec-navigation-link:hover, .spec-navigation-link.is-active { background: #2b3540; }
.spec-navigation-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; font-weight: 800; }
.spec-navigation-roadmap-link .spec-navigation-icon { color: var(--accent); }
.spec-navigation-step-number { font-variant-numeric: tabular-nums; }
.spec-navigation-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-navigation-status { display: inline-flex; align-items: center; justify-content: center; width: 1rem; height: 1rem; border: 1px solid currentColor; border-radius: 999px; font-size: .65rem; line-height: 1; }
.spec-navigation-section { display: grid; gap: .15rem; margin-top: .55rem; padding-top: .55rem; border-top: 1px solid var(--line); }
.spec-navigation-section-heading { display: flex; justify-content: space-between; gap: .6rem; margin: 0 .45rem .2rem; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.spec-navigation-summary { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.spec-navigation-drawer { display: none; }
.markdown-content { min-width: 0; color: #d7dee5; line-height: 1.72; overflow-wrap: anywhere; }
.markdown-content > :first-child { margin-top: 0; }
.markdown-content > :last-child { margin-bottom: 0; }
.markdown-content h1 { margin: 1.8rem 0 .7rem; font-size: clamp(1.55rem, 3vw, 2.1rem); letter-spacing: -.045em; line-height: 1.1; }
.markdown-content h2 { margin: 1.65rem 0 .6rem; font-size: 1.35rem; }
.markdown-content h3 { margin: 1.35rem 0 .45rem; font-size: 1.1rem; }
.markdown-content h4, .markdown-content h5, .markdown-content h6 { margin: 1rem 0 .35rem; font-size: 1rem; }
.markdown-content p, .markdown-content ul, .markdown-content ol, .markdown-content blockquote, .markdown-content pre, .markdown-content table { margin: 0 0 1rem; }
.markdown-content ul, .markdown-content ol { padding-left: 1.35rem; }
.markdown-content li + li { margin-top: .3rem; }
.markdown-content a { color: var(--blue); text-decoration: underline; text-decoration-color: #50718b; text-underline-offset: .14em; }
.markdown-content a:hover { color: var(--ink); }
.markdown-content blockquote { margin-left: 0; padding: .15rem 1rem; border-left: 3px solid var(--accent); color: var(--muted); }
.markdown-content hr { margin: 1.5rem 0; border: 0; border-top: 1px solid var(--line); }
.markdown-content pre { max-width: 100%; overflow-x: auto; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .45rem; background: #141a21; }
.markdown-content pre code { padding: 0; background: transparent; }
.markdown-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.markdown-content th, .markdown-content td { padding: .45rem .65rem; border: 1px solid var(--line); text-align: left; }
.markdown-content th { background: var(--panel-raised); color: var(--ink); }
.markdown-content img { max-width: 100%; height: auto; }
.activity-link-row { margin: .65rem 0 0; }
.activity-link { color: var(--blue); font-size: .78rem; font-weight: 750; }
.activity-link:hover { color: var(--ink); }
.activity-filters { display: grid; gap: .8rem; padding: 1rem; border: 1px solid var(--line); background: var(--panel); }
.activity-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; }
.activity-filter-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .9rem; }
.activity-section { gap: .8rem; }
.activity-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.activity-item { display: grid; gap: .35rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-event-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.activity-event-heading strong { color: var(--ink); font-size: 1rem; }
.activity-event-heading time { color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.activity-event-meta { margin: 0; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.activity-details { margin-top: .2rem; }
.activity-details summary { width: max-content; color: var(--blue); cursor: pointer; font-size: .78rem; font-weight: 700; }
.activity-details pre { max-width: 100%; margin: .45rem 0 0; padding: .7rem .8rem; overflow-x: auto; border: 1px solid var(--line); background: #141a21; color: var(--muted); font-size: .75rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.activity-details pre code { padding: 0; background: transparent; }
.activity-pagination { display: flex; justify-content: center; padding-top: .35rem; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
code { border-radius: .25rem; background: #222b35; padding: .1rem .3rem; color: #d6e0e8; }

@media (max-width: 700px) {
  .site-header, .site-footer { padding-left: 1rem; padding-right: 1rem; }
  .marketing-shell { padding: 3rem 1rem; }
  .hero { padding: 1.5rem 0 3rem; }
  .principles { grid-template-columns: 1fr; }
  .app-layout { width: min(calc(100% - 2rem), var(--layout-max)); }
  .site-header-inner { min-height: 3.8rem; }
  .site-header-actions { gap: .55rem; }
  .header-account { display: none; }
  .header-user { max-width: 7rem; }
  .create-form { grid-template-columns: 1fr; align-items: stretch; }
  .relationship-form { align-items: stretch; }
  .relationship-form .button { flex: 0 0 auto; }
  .dependency-grid, .dependency-form-grid { grid-template-columns: 1fr; }
  .discussion-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dependency-row { gap: .55rem; }
  .account-context, .account-form-grid { grid-template-columns: 1fr; }
  .member-row, .invitation-row { display: grid; }
  .member-actions { justify-content: flex-start; }
  .inline-form { flex-wrap: wrap; justify-content: flex-start; }
}

@media (max-width: 900px) {
  .spec-detail-layout { grid-template-columns: 1fr; }
  .tag-suggestion-row { align-items: flex-start; flex-direction: column; }
  .spec-navigation-desktop { display: none; }
  .spec-navigation-drawer { display: block; order: -2; border: 1px solid var(--line); background: var(--panel); }
  .spec-navigation-drawer > summary { display: flex; align-items: center; justify-content: space-between; gap: .8rem; list-style: none; padding: .75rem .85rem; color: var(--ink); cursor: pointer; font-size: .82rem; font-weight: 800; }
  .spec-navigation-drawer > summary::-webkit-details-marker { display: none; }
  .spec-navigation-drawer > summary::after { content: "+"; color: var(--accent); font-size: 1.15rem; line-height: 1; }
  .spec-navigation-drawer[open] > summary { border-bottom: 1px solid var(--line); }
  .spec-navigation-drawer[open] > summary::after { content: "−"; }
  .spec-navigation-drawer-panel { max-height: min(55vh, 28rem); overflow-y: auto; padding: .55rem; }
  .spec-detail-aside { order: -1; }
  .spec-detail-aside > .dependency-section { margin-top: -.35rem; }
}

@media (max-width: 480px) {
  .app-content { padding-top: 1.2rem; }
  .app-layout { width: calc(100% - 1.5rem); }
  .site-header-inner { gap: .6rem; }
  .brand { font-size: 1rem; }
  .header-user { display: none; }
  .workspace-menu-current > a, .workspace-menu-current > span { max-width: 44vw; font-size: .85rem; }
  .domain-menu-current { max-width: 28vw; }
  .domain-menu-dropdown { left: auto; right: -.25rem; width: min(24rem, calc(100vw - 1.5rem)); }
  .workspace-menu-dropdown { left: auto; right: -.25rem; width: min(22rem, calc(100vw - 1.5rem)); }
  .node-row, .milestone-row { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
  .node-row { grid-template-columns: 1.8rem minmax(0, 1fr); }
  .milestone-row .row-editor { justify-self: start; text-align: left; }
  .row-editor .compact-form { width: min(100%, 24rem); }
  .roadmap-links li { align-items: flex-start; }
  .key-row { align-items: flex-start; }
  .step-row-header { display: grid; gap: .5rem; }
  .step-summary-row { display: grid; gap: .55rem; }
  .transition-form { align-items: stretch; }
  .transition-form select { width: 100%; }
  .activity-filter-grid { grid-template-columns: 1fr; }
  .discussion-filter-grid { grid-template-columns: 1fr; }
  .activity-event-heading { display: grid; gap: .2rem; }
}
