:root {
  font-family: Manrope, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 4px; }
input:focus, textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; border-color: transparent; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 2.45vw, 35px); letter-spacing: -1.2px; line-height: 1.23; font-weight: 590; }
h2 { font-size: 17px; line-height: 1.4; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
small { font-size: 12px; }
code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.icon { width: 19px; height: 19px; flex-shrink: 0; }
.skip-link { position: absolute; top: -60px; left: 12px; z-index: 50; padding: 10px 15px; background: var(--paper); }
.skip-link:focus { top: 10px; }
.initial-loading { padding: 80px; color: var(--muted); text-align: center; }
.sidebar { width: 228px; height: 100dvh; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 34px 18px 22px; color: var(--ink); background: var(--sidebar); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; padding: 0 10px; text-decoration: none; color: var(--ink); min-height: 30px; }
.brand-mark { display: block; width: 104px; aspect-ratio: 2868 / 682; position: relative; flex-shrink: 0; }
.brand-mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: left; }
.brand-logo-dark { display: none; }
[data-theme="pharos-dark"] .brand-logo-light { display: none; }
[data-theme="pharos-dark"] .brand-logo-dark { display: block; }
.brand-wordmark { font-size: 14px; font-weight: 500; letter-spacing: -.4px; }
.workspace-label { display: flex; align-items: center; gap: 10px; margin: 37px 10px 35px; font-size: 12px; color: var(--ink); }
.workspace-label small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.workspace-avatar { display: grid; place-items: center; width: 31px; height: 33px; background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: var(--radius-field); color: var(--color-primary); }
.nav-heading { color: var(--subtle); font-size: 9px; letter-spacing: 1.8px; padding: 0 14px 12px; font-weight: 600; }
nav { display: grid; gap: 5px; }
.nav-item { width: 100%; border: 0; display: flex; align-items: center; gap: 12px; background: transparent; color: var(--muted); border-radius: var(--radius-field); padding: 12px 14px; text-align: left; font-size: 12px; }
.nav-item:hover { background: var(--line); color: var(--ink); }
.nav-item.active { background: color-mix(in srgb, var(--color-primary) 13%, transparent); color: var(--color-primary); }
.nav-item .icon { width: 17px; height: 17px; }
.nav-count { margin-left: auto; background: var(--color-primary); color: var(--color-primary-content); border-radius: var(--radius-selector); min-width: 18px; text-align: center; font-size: 10px; }
.sidebar-note { margin: auto 14px 32px; padding-top: 40px; }
.mini-label { font-size: 8px; letter-spacing: 1.7px; color: var(--subtle); }
.sidebar-note p { font-size: 18px; font-weight: 500; letter-spacing: -.4px; line-height: 1.6; margin: 12px 0 19px; color: var(--ink); }
.note-line { width: 26px; height: 2px; background: var(--color-accent); margin-bottom: 15px; }
.sidebar-note small { font-size: 10px; color: var(--muted); }
.local-identity { border-top: 1px solid var(--line); margin: 0 12px; padding-top: 19px; display: flex; align-items: center; gap: 10px; font-size: 11px; }
.local-identity small { display: block; color: var(--muted); font-size: 9px; }
.online-dot { height: 7px; width: 7px; border-radius: 50%; background: var(--color-success); box-shadow: 0 0 0 4px var(--success-soft); }
.main-shell { margin-left: 228px; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { min-height: 72px; border-bottom: 1px solid var(--line); padding: 14px 42px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; background: var(--paper); }
.breadcrumb { display: flex; align-items: center; gap: 15px; font-size: 11px; color: var(--muted); }
.breadcrumb strong { font-weight: 500; color: var(--ink); }
.breadcrumb > span { color: var(--subtle); }
.topbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.theme-select { color: var(--ink); background: var(--input-color); border: 1px solid var(--line); border-radius: var(--radius-field); padding: 7px 8px; font-size: 10px; cursor: pointer; min-height: 34px; }
.topbar-status { color: var(--muted); display: flex; align-items: center; gap: 7px; font-size: 10px; }
.connection-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--color-warning); }
.connection-dot.connected { background: var(--color-success); }
#main { width: 100%; max-width: 1480px; margin: 0 auto; padding: 47px 42px 35px; outline: none; flex: 1; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 31px; }
.eyebrow { color: var(--color-primary); font-size: 9px; letter-spacing: 1.7px; font-weight: 650; margin-bottom: 13px; }
.page-heading p { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; border-radius: var(--radius-field); padding: 11px 17px; font-size: 12px; font-weight: 550; white-space: nowrap; min-height: 42px; }
.button .icon { width: 16px; height: 16px; }
.primary { background: var(--color-primary); color: var(--color-primary-content); border: 1px solid var(--color-primary); box-shadow: var(--shadow); }
.primary:hover { background: var(--primary-hover); }
.secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.secondary:hover { background: var(--surface-hover); }
.text-button { color: var(--color-primary); border: 0; padding: 5px 0; background: none; font-size: 11px; display: inline-flex; align-items: center; gap: 8px; }
.text-button:hover { color: var(--ink); text-decoration: underline; }
.text-button .icon { width: 15px; height: 15px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; margin: 29px 0 39px; }
.stat { border: 1px solid var(--line); padding: 21px 24px; border-radius: var(--radius-box); background: var(--paper); }
.stat > div { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); }
.stat .icon { color: var(--subtle); width: 16px; height: 16px; }
.stat strong { display: block; font-size: 34px; font-weight: 450; line-height: 1; margin: 16px 0 9px; letter-spacing: -1px; }
.stat small { color: var(--subtle); font-size: 10px; }
.stat-accent { background: var(--primary-soft); border-color: var(--primary-border); }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-heading h2 { font-size: 14px; display: flex; align-items: center; gap: 10px; }
.section-heading > span { font-size: 10px; color: var(--subtle); }
.count { font-size: 10px; font-weight: 500; color: var(--color-primary); background: var(--primary-soft); padding: 1px 7px; border-radius: var(--radius-selector); }
.empty-state { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-box); text-align: center; padding: 44px 24px 0; }
.empty-symbol { width: 57px; height: 62px; border: 1px solid var(--primary-border); border-radius: 10px; background: var(--primary-soft); display: grid; place-items: center; margin: 0 auto 22px; transform: rotate(-5deg); }
.empty-symbol .icon { width: 27px; height: 27px; color: var(--color-primary); }
.empty-state .eyebrow { font-size: 8px; margin-bottom: 9px; }
.empty-state h2 { font-weight: 500; font-size: 27px; letter-spacing: -.8px; }
.empty-state p { margin: 12px 0 24px; color: var(--muted); font-size: 12px; line-height: 1.85; }
.empty-state > .text-button { display: flex; margin: 13px auto 28px; }
.empty-steps { border-top: 1px solid var(--line); margin: 0 -24px; padding: 17px 20px; display: flex; justify-content: center; gap: 44px; font-size: 10px; color: var(--muted); }
.empty-steps b { font-size: 12px; margin-right: 8px; color: var(--color-primary); font-weight: 600; }
.empty-state.compact { padding: 60px 24px; }
.context-strip { display: flex; align-items: center; gap: 13px; padding: 23px 0; color: var(--color-primary); }
.context-strip > .icon { width: 20px; height: 20px; }
.context-strip > div { display: flex; flex-direction: column; gap: 3px; }
.context-strip strong { font-size: 11px; color: var(--ink); font-weight: 550; }
.context-strip span { font-size: 10px; color: var(--muted); }
.context-strip .text-button { margin-left: auto; flex-shrink: 0; }
.footer { display: flex; justify-content: space-between; gap: 20px; margin: 0 42px; padding: 17px 0 23px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 9px; }
.footer > span:first-child { letter-spacing: 1.2px; }
.change-list { border: 1px solid var(--line); border-radius: var(--radius-box); overflow: hidden; background: var(--paper); }
.change-row { width: 100%; display: flex; align-items: center; gap: 15px; padding: 22px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: var(--paper); text-align: left; }
.change-row:last-child { border-bottom: 0; }
.change-row:hover { background: var(--surface-hover); }
.change-icon { width: 35px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-field); color: var(--color-primary); display: grid; place-items: center; flex-shrink: 0; }
.change-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.change-info strong { font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.change-info > span { color: var(--muted); font-size: 10px; }
.separator { margin: 0 8px; color: var(--subtle); }
.row-arrow { width: 14px; height: 14px; color: var(--subtle); margin-left: 7px; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-selector); background: var(--canvas); color: var(--muted); padding: 5px 9px; font-size: 10px; white-space: nowrap; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-awaiting_review { background: var(--warning-soft); color: var(--warning-text); }
.badge-approved { background: var(--success-soft); color: var(--success-text); }
.badge-planning { background: var(--info-soft); color: var(--info-text); }
.badge-failed { background: var(--error-soft); color: var(--error-text); }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-box); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 265px; gap: 28px; align-items: start; }
.form-panel { padding: 29px 32px; }
.panel-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 25px; }
.panel-heading h2 { font-size: 16px; }
.panel-heading p { color: var(--muted); font-size: 11px; margin-top: 3px; }
.step-number { border-radius: var(--radius-field); background: var(--primary-soft); color: var(--color-primary); width: 34px; height: 39px; display: grid; place-items: center; font-size: 14px; font-weight: 600; flex-shrink: 0; }
label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 8px; font-size: 12px; font-weight: 550; }
label span { color: var(--subtle); font-size: 10px; font-weight: 400; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-field); background: var(--input-color); padding: 11px 12px; font-size: 12px; color: var(--ink); }
textarea { resize: vertical; line-height: 1.8; min-height: 80px; }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
.form-actions { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 24px; margin-top: 28px; gap: 14px; }
.aside-card { padding: 25px 5px; }
.aside-card p { margin-top: 12px; font-size: 12px; color: var(--muted); }
.next-steps { list-style: none; counter-reset: next; padding: 0; margin: 22px 0 0; }
.next-steps li { position: relative; padding: 0 0 27px 33px; counter-increment: next; }
.next-steps li::before { content: counter(next); position: absolute; left: 0; top: 0; border: 1px solid var(--primary-border); border-radius: 50%; height: 21px; width: 21px; text-align: center; color: var(--color-primary); font-size: 10px; line-height: 20px; }
.next-steps li:not(:last-child)::after { position: absolute; content: ""; left: 10px; top: 29px; bottom: 7px; width: 1px; background: var(--line); }
.next-steps b { font-size: 12px; font-weight: 550; display: block; margin-bottom: 7px; }
.next-steps span { color: var(--muted); font-size: 11px; display: block; line-height: 1.8; }
.sample-note { background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: var(--radius-field); padding: 19px; }
.sample-note strong { font-size: 11px; font-weight: 550; color: var(--color-primary); }
.sample-note p { font-size: 11px; color: var(--muted); line-height: 1.8; margin-top: 6px; }
.route-cards { display: grid; gap: 12px; margin-top: 17px; }
.route-card { padding: 13px; border: 1px solid var(--line); border-radius: var(--radius-field); background: var(--color-surface); min-width: 0; }
.route-card > span { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); }
.route-card .icon { width: 13px; height: 13px; }
.route-card strong { display: block; font-size: 11px; font-weight: 550; color: var(--color-primary); margin-top: 7px; overflow-wrap: anywhere; }
.routing-panel { padding: 28px 34px; max-width: 880px; margin-top: 32px; }
.routing-panel > p { color: var(--muted); font-size: 12px; margin-top: 8px; }
.routing-panel .route-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.captured-routes { padding: 23px; }
.captured-routes .eyebrow { font-size: 8px; }
.agent-review { padding: 22px 0 0; margin-top: 15px; border-top: 1px solid var(--line); }
.agent-review .eyebrow { font-size: 8px; }
.agent-review h3 { font-size: 13px; }
.agent-review > small { color: var(--subtle); font-size: 10px; display: block; margin: 6px 0 15px; overflow-wrap: anywhere; }
.agent-review p { color: var(--muted); font-size: 11px; line-height: 1.8; margin-top: 10px; }
.review-finding { margin-top: 17px; padding: 15px; background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius-field); }
.form-error { margin: 16px 0; padding: 12px 15px; background: var(--error-soft); border: 1px solid var(--error-border); color: var(--error-text); border-radius: var(--radius-field); font-size: 12px; }
.callout { border: 1px solid var(--warning-border); background: var(--warning-soft); color: var(--warning-text); border-radius: var(--radius-field); padding: 15px; font-size: 12px; margin: 15px 0; }
.guideline-panel { max-width: 880px; padding: 31px 35px; }
.guideline-panel .panel-heading { border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.guideline-panel .panel-heading > .icon { width: 26px; height: 26px; color: var(--color-primary); }
.guideline-content h2 { font-size: 19px; margin: 24px 0 18px; }
.guideline-content h3 { margin: 22px 0 9px; color: var(--ink); }
.guideline-content p { font-size: 12px; color: var(--muted); line-height: 1.9; }
.help-text { display: block; font-size: 10px; color: var(--subtle); margin-top: 16px; line-height: 1.8; }
.back-button { margin-bottom: 26px; }
.detail-heading { display: flex; justify-content: space-between; align-items: center; gap: 25px; margin-bottom: 34px; }
.detail-heading h1 { font-size: 29px; overflow-wrap: anywhere; }
.detail-heading p { color: var(--muted); font-size: 11px; margin-top: 12px; }
.detail-heading .badge { flex-shrink: 0; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 26px; align-items: start; }
.detail-main { min-width: 0; }
.detail-aside { display: grid; gap: 20px; padding-top: 43px; min-width: 0; }
.revision-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.revision-bar > span { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--color-primary); }
.revision-bar .icon { width: 14px; height: 14px; }
.revision-bar label { margin: 0; font-size: 10px; color: var(--muted); }
.version-picker { display: flex; align-items: center; gap: 8px; }
.revision-bar select { border: 1px solid var(--line); border-radius: var(--radius-selector); color: var(--ink); background: var(--input-color); font-size: 10px; padding: 4px 8px; }
.plan-panel { padding: 27px; }
.sample-banner { background: var(--warning-soft); border-radius: var(--radius-selector); font-size: 10px; padding: 9px 12px; color: var(--warning-text); margin-bottom: 22px; }
.plan-summary { font-size: 12px; color: var(--muted); line-height: 1.9; overflow-wrap: anywhere; }
.section-label { margin: 28px 0 18px; font-size: 9px; letter-spacing: 1.4px; color: var(--color-primary); }
.plan-steps { list-style: none; padding: 0; counter-reset: plan; margin: 0; }
.plan-steps > li { counter-increment: plan; padding: 0 0 24px 32px; position: relative; }
.plan-steps > li::before { content: counter(plan, decimal-leading-zero); position: absolute; top: 1px; left: 0; color: var(--color-primary); font-size: 11px; font-weight: 600; }
.plan-steps h3 { font-size: 12px; margin-bottom: 9px; }
.plan-steps p { font-size: 11px; color: var(--muted); line-height: 1.9; overflow-wrap: anywhere; }
.verification { display: flex; gap: 9px; background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: var(--radius-field); padding: 12px; margin-top: 13px; color: var(--muted); }
.verification .icon { width: 14px; height: 14px; margin-top: 2px; }
.verification span { font-size: 10px; line-height: 1.8; }
.verification strong { display: block; font-weight: 550; font-size: 9px; margin-bottom: 4px; color: var(--color-primary); }
.plan-notes { border-top: 1px solid var(--line); padding-top: 22px; }
.plan-notes h3 { font-size: 12px; }
.plan-notes ul { margin: 10px 0 20px; padding-left: 18px; font-size: 11px; color: var(--muted); line-height: 1.8; }
.plan-notes li { padding: 3px 0; }
.plan-notes p { font-size: 11px; color: var(--muted); margin: 10px 0; }
.review-panel { padding: 24px; border-color: var(--primary-border); box-shadow: var(--shadow); }
.review-panel .eyebrow { font-size: 8px; color: var(--color-primary); margin-bottom: 11px; }
.review-panel h2 { font-size: 16px; }
.review-panel > p { font-size: 11px; color: var(--muted); line-height: 1.8; margin-top: 9px; }
.review-panel label { font-size: 11px; }
.review-panel label span { font-size: 8px; }
.review-panel .full-width { margin-top: 11px; width: 100%; font-size: 11px; }
.review-panel input, .review-panel textarea { font-size: 11px; }
.approved-card { padding: 25px; background: var(--success-soft); border: 1px solid var(--success-border); border-radius: var(--radius-box); }
.approved-card > .icon { width: 25px; height: 25px; color: var(--success-text); margin-bottom: 10px; }
.approved-card h3 { font-size: 17px; color: var(--success-text); }
.approved-card p { font-size: 12px; color: var(--success-text); margin: 9px 0 12px; }
.approved-card small { font-size: 10px; color: var(--muted); line-height: 1.8; display: block; }
.brief-summary { padding: 24px; }
.brief-summary .eyebrow { font-size: 8px; }
.brief-summary h3 { font-size: 11px; margin: 19px 0 8px; }
.brief-summary p { font-size: 11px; color: var(--muted); line-height: 1.85; overflow-wrap: anywhere; }
.criteria-list { list-style: none; padding: 0; margin: 10px 0; }
.criteria-list li { display: flex; gap: 7px; margin-bottom: 11px; font-size: 11px; color: var(--muted); line-height: 1.8; }
.criteria-list .icon { width: 13px; height: 13px; margin-top: 4px; color: var(--color-primary); }
.baseline-panel { padding: 19px 24px; }
.baseline-panel summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 11px; color: var(--color-primary); }
.baseline-panel summary::after { content: "+"; margin-left: auto; }
.baseline-panel[open] summary::after { content: "−"; }
.baseline-panel summary .icon { width: 15px; height: 15px; }
.baseline-panel > small { display: block; font-size: 9px; margin-top: 16px; color: var(--subtle); }
.baseline-panel .guideline-content h2 { font-size: 13px; }
.baseline-panel .guideline-content h3 { font-size: 11px; }
.baseline-panel .guideline-content p { font-size: 10px; }
.pending-plan { padding: 60px 25px; text-align: center; margin-top: 43px; }
.pending-plan h2 { font-size: 23px; font-weight: 500; margin: 17px 0 12px; }
.pending-plan p { font-size: 12px; color: var(--muted); }
.planning-orbit { margin: 0 auto; width: 55px; height: 55px; background: var(--primary-soft); border-radius: 50%; display: grid; place-items: center; color: var(--color-primary); }
.pulse-label { display: block; font-size: 10px; color: var(--subtle); margin-top: 27px; }
.history-panel { padding: 27px; margin-top: 23px; }
.history-panel h2 { font-size: 14px; margin-bottom: 22px; }
.history-entry { display: flex; gap: 13px; margin-top: 18px; }
.history-marker { width: 27px; height: 27px; border: 1px solid var(--primary-border); border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: var(--color-primary); }
.history-marker .icon { width: 13px; height: 13px; }
.history-entry strong { font-size: 11px; font-weight: 550; }
.history-entry small { display: block; color: var(--subtle); font-size: 9px; margin-top: 3px; }
.history-entry p { color: var(--muted); font-size: 11px; margin-top: 10px; line-height: 1.8; overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 27px; left: calc(50% + 114px); transform: translateX(-50%); z-index: 100; max-width: min(580px, 85vw); padding: 15px 22px; color: var(--color-neutral-content); background: var(--color-neutral); border: 1px solid var(--primary-border); border-radius: var(--radius-field); box-shadow: var(--shadow); font-size: 12px; }

@media (min-width: 1450px) {
  #main { padding-left: 65px; padding-right: 65px; }
  .topbar { padding-left: 65px; padding-right: 65px; }
  .footer { margin-left: 65px; margin-right: 65px; }
}

@media (max-width: 1150px) {
  .sidebar { width: 200px; padding-left: 12px; padding-right: 12px; }
  .main-shell { margin-left: 200px; }
  #main { padding: 33px 28px; }
  .topbar { padding: 14px 28px; }
  .footer { margin: 0 28px; }
  .detail-layout, .editor-layout { grid-template-columns: minmax(0, 1fr) 255px; gap: 18px; }
  .plan-panel, .form-panel { padding: 23px; }
  .stat { padding: 20px; }
  .review-panel { padding: 19px; }
  .toast { left: calc(50% + 100px); }
}

@media (max-width: 900px) {
  .sidebar { width: 180px; }
  .main-shell { margin-left: 180px; }
  .brand { padding: 0 6px; gap: 6px; }
  .brand-mark { width: 90px; }
  .brand-wordmark { font-size: 12px; }
  .nav-item { padding-left: 9px; gap: 9px; font-size: 11px; }
  .workspace-label { margin-left: 7px; gap: 7px; font-size: 10px; }
  .workspace-label small { font-size: 8px; }
  .detail-layout, .editor-layout { grid-template-columns: 1fr; }
  .detail-aside { padding-top: 0; }
  .editor-aside { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 25px; }
  .topbar-status { font-size: 9px; }
  .page-heading { align-items: start; }
  .stats { gap: 10px; }
  .stat { padding: 17px 14px; }
  .stat small { font-size: 9px; }
  .empty-steps { gap: 20px; }
  .context-strip { flex-wrap: wrap; }
  .context-strip .text-button { margin-left: 33px; }
  .footer { font-size: 8px; }
  .toast { left: calc(50% + 90px); }
}

@media (max-width: 640px) {
  .sidebar { position: static; height: auto; width: 100%; padding: 15px 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; gap: 8px; }
  .brand-mark { width: 104px; }
  .brand-wordmark { font-size: 14px; }
  .workspace-label, .nav-heading, .sidebar-note, .local-identity { display: none; }
  nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 15px; }
  .nav-item { justify-content: center; padding: 9px 3px; font-size: 9px; gap: 5px; }
  .nav-item .icon { width: 13px; height: 13px; }
  .nav-count { display: none; }
  .main-shell { margin-left: 0; min-height: calc(100dvh - 112px); }
  .topbar { min-height: 49px; padding: 12px 20px; gap: 10px; }
  .topbar-actions { width: 100%; justify-content: space-between; gap: 12px; }
  .breadcrumb { font-size: 9px; gap: 8px; }
  .topbar-status { font-size: 8px; }
  #main { padding: 29px 19px; }
  .page-heading { gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
  .page-heading p { font-size: 11px; }
  h1 { font-size: 27px; }
  .eyebrow { font-size: 8px; margin-bottom: 11px; }
  .stats { margin: 23px 0 29px; gap: 8px; }
  .stat { padding: 13px 10px; }
  .stat > div { font-size: 9px; }
  .stat .icon { display: none; }
  .stat strong { font-size: 29px; margin-top: 13px; }
  .stat small { font-size: 8px; line-height: 1.5; display: block; }
  .section-heading h2 { font-size: 13px; }
  .section-heading > span { font-size: 8px; }
  .empty-state { padding-top: 32px; }
  .empty-state p { font-size: 11px; }
  .empty-state p br { display: none; }
  .empty-steps { gap: 12px; padding-left: 12px; padding-right: 12px; font-size: 8px; }
  .empty-steps b { font-size: 11px; margin-right: 4px; }
  .context-strip strong { font-size: 10px; }
  .context-strip span { font-size: 9px; }
  .footer { margin: 0 19px; flex-direction: column; gap: 5px; padding-bottom: 17px; }
  .editor-aside { grid-template-columns: 1fr; gap: 0; }
  .form-panel { padding: 22px; }
  .change-row { padding: 15px 12px; gap: 10px; flex-wrap: wrap; }
  .change-icon { width: 28px; height: 34px; }
  .change-info strong { font-size: 12px; }
  .change-info > span { font-size: 9px; }
  .change-row .badge { font-size: 8px; padding: 4px 7px; }
  .change-row .row-arrow { display: none; }
  .detail-heading { align-items: start; flex-direction: column; gap: 15px; }
  .detail-heading h1 { font-size: 26px; }
  .plan-panel { padding: 21px; }
  .plan-steps > li { padding-left: 26px; }
  .guideline-panel { padding: 23px; }
  .toast { left: 50%; bottom: 18px; min-width: 260px; max-width: 90vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
