.workspace-shell {
  --rail: 218px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--rail) minmax(0,1fr);
}
.workspace-content { min-width: 0; }
.pilot-brief-layout { max-width: 64rem; }
.hosted-workflow { min-width: 0; overflow-wrap: anywhere; }
.hosted-workflow section { margin-block-start: 1rem; }
.hosted-workflow #confirmed-brief { white-space: pre-wrap; }
.hosted-workflow [hidden] { display: none; }
.hosted-workflow form > label { display: block; margin-block: 1.15rem .4rem; }
.hosted-workflow input[type=password] { display: block; width: min(100%, 30rem); }
.hosted-workflow #brief-hint { margin-bottom: .65rem; }
.hosted-workflow .privacy-note { margin-block: 1rem; }
#lesson-panel { margin-top: 1.25rem; }
#lesson-panel summary { min-height: 44px; padding-block: .65rem; }
#lesson-fields, #lesson-examples fieldset { min-width: 0; padding: .75rem 0; border: 0; }
#lesson-fields > label, #lesson-fields select, #lesson-examples input { display: block; }
#lesson-fields > label { margin-block: .7rem .35rem; }
#lesson-fields select, #lesson-examples input { width: 100%; min-width: 0; max-width: 30rem; }
#lesson-examples { margin-top: 1rem; }
#lesson-examples fieldset > div { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(5rem,100%),1fr)); gap: .45rem; margin-top: .5rem; }
#lesson-examples fieldset > div > p { grid-column: 1/-1; }
#lesson-examples label { min-width: 0; font-size: .9rem; }
#lesson-fields .lesson-confirm { display: flex; gap: .5rem; align-items: center; min-height: 44px; }
#active-checks button { display: block; max-width: 100%; margin-top: .4rem; overflow-wrap: anywhere; }
.workspace-content main { max-width: 1320px; padding-inline: clamp(1.1rem,3.4vw,3.5rem); }
.icon { width: 20px; height: 20px; flex: none; }
.sidebar {
  position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh;
  overflow-y: auto; padding: 0 .8rem 1.1rem; background: #141618; border-right: 1px solid #373b3e;
}
.workspace-brand {
  display: flex; align-items: center; gap: .4rem; min-height: 78px; margin-bottom: 1.1rem; padding-inline: .3rem;
  text-decoration: none; color: var(--ink); font: 500 1.16rem "Space Grotesk", Inter, sans-serif;
}
.workspace-brand img { width: 39px; height: 39px; object-fit: contain; }
.side-links { display: grid; gap: .3rem; }
.side-links a {
  display: flex; align-items: center; gap: .8rem; min-height: 46px; padding: .64rem .9rem;
  border-radius: 6px; color: #c0c5c8; text-decoration: none; font-size: .91rem; font-weight: 500;
}
.side-links a:hover { background: #2b2e31; color: var(--ink); }
.side-links a[aria-current] { color: var(--primary); background: #373128; }
.profile-nav { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.workspace-bar {
  height: 64px; padding-inline: clamp(1.1rem,3.4vw,3.5rem); display: flex; align-items: center; gap: .7rem;
  border-bottom: 1px solid #383b3f; background: #1c1e21;
}
.route-name { font-size: .87rem; font-weight: 550; }
.route-name span { color: var(--muted); font-weight: 400; }
.route-name span + span { margin-inline: .4rem; color: #8e9599; }
.search-trigger { display: flex; align-items: center; gap: .55rem; margin-left: auto; color: var(--muted); background: transparent; border: 0; font-weight: 400; font-size: .85rem; }
.search-trigger .icon { width: 17px; height: 17px; }
kbd { font: 500 .7rem Inter,sans-serif; color: var(--muted); border: 1px solid var(--line); padding: .15rem .28rem; border-radius: 4px; }
.icon-button { display: inline-grid; place-content: center; width: 44px; height: 44px; padding: 0; }
.mobile-menu-button { display: none; }
dialog { color: var(--ink); background: var(--paper); border: 1px solid #5c6266; border-radius: 12px; max-height: 85dvh; width: min(31rem,calc(100% - 2rem)); padding: 1.1rem; }
dialog::backdrop { background: rgba(0,0,0,.65); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .75rem; }
.drawer-brand { display: flex; align-items: center; gap: .5rem; }
.dialog-head h2 { font-size: 1.32rem; }
.dialog-close { background: transparent; border: 0; }
.search-field { display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.search-field input { flex: 1; }
#command-results { margin-top: .75rem; }
#commands-empty { padding: 1rem .25rem; }
.nav-drawer { margin: 0; width: min(300px,88vw); height: 100dvh; max-height: 100dvh; border-radius: 0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,1fr); gap: 1.25rem; align-items: start; }
.launch-pane, .dashboard-library { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; }
.launch-pane { padding: 1.35rem clamp(1rem,2vw,2rem) .9rem; }
.launch-pane > h2 { margin-bottom: .8rem; }
.launch-row { display: flex; align-items: center; gap: 1rem; padding: 1.2rem .25rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.launch-row:hover strong, .dashboard-library a:hover { color: #ffe2a8; }
.launch-row:hover .launch-symbol { border-color: var(--primary); }
.launch-symbol, .library-symbol { display: grid; place-items: center; width: 48px; height: 53px; flex: none; border-radius: 6px; border: 1px solid #635840; background: #302d26; color: var(--primary); }
.launch-symbol .icon { width: 26px; height: 26px; }
.launch-row strong { display: block; font: 500 1.34rem/1.2 "Space Grotesk",Inter,sans-serif; color: var(--primary); }
.launch-row strong + span, .dashboard-library p { display: block; color: var(--muted); font-size: .91rem; line-height: 1.55; margin-top: .35rem; }
.related-tool { padding-top: .65rem; }
.related-tool a, .dashboard-library a { display: inline-flex; align-items: center; min-height: 44px; font-size: .89rem; }
.dashboard-library { display: flex; align-items: start; gap: 1rem; padding: 1.35rem; }
.dashboard-library h2 { font-size: 1.22rem; }
.library-symbol { width: 42px; height: 44px; color: var(--muted); border-color: var(--line); background: var(--well); }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; color: var(--ink); border: 1px solid #777c80; font-weight: 550; border-radius: 5px; padding: .55rem .9rem; background: var(--raised); }
.button-link:hover { background: #404449; }
.tool-tabs { display: flex; gap: 1.25rem; margin: -.5rem 0 1.3rem; border-bottom: 1px solid var(--line); }
.tool-tabs a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--muted); font-size: .91rem; border-bottom: 2px solid transparent; }
.tool-tabs a[aria-current] { border-color: var(--primary); color: var(--primary); }
.profile-settings { max-width: 45rem; }
.profile-settings form { display: grid; gap: .6rem; margin-top: 1rem; }
.profile-settings .actions { margin-top: .5rem; }
.account-section { max-width: 45rem; margin-top: 1.8rem; }
.account-section p { color: var(--muted); margin: .5rem 0 1rem; }
.tmp-layout { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 1.25rem; align-items: start; }
.tmp-layout .field-grid { grid-template-columns: 1fr; }
.tmp-document { overflow-wrap: anywhere; }
.tmp-document section { margin-block: 1rem; }
.tmp-document h3, .tmp-document h4 { margin-block: .8rem .35rem; }
.tmp-entry { white-space: pre-wrap; overflow-wrap: anywhere; }
.library-heading, .resource-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.library-search { display: block; margin-block: 1rem; }
.library-editor, .library-section { margin-block: 1.25rem; }
.library-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.library-editor label, .library-editor input, .library-editor select { display: block; max-width: 100%; }
.library-editor :is(input:not([type=radio]), select) { width: 100%; }
.library-file-note, .resource-meta { color: var(--muted); font-size: .87rem; }
.resource-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.resource-row { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.resource-info { min-width: 0; overflow-wrap: anywhere; }
.resource-info p { color: var(--muted); }
.resource-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
@media (max-width: 1050px) {
  .workspace-shell { --rail: 185px; }
  .workspace-brand { font-size: 1.02rem; }
  .workspace-brand img { width: 34px; height: 34px; }
  .workspace-content .job-layout, .tmp-layout { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .workspace-shell { display: block; }
  .sidebar { display: none; }
  .mobile-menu-button { display: grid; background: transparent; border: 0; }
  .workspace-bar { height: 58px; padding-inline: .7rem; }
  .search-trigger kbd { display: none; }
}
@media (max-width: 680px) {
  .dashboard-grid, .library-form-grid { grid-template-columns: 1fr; }
  .launch-row { align-items: start; gap: .75rem; }
  .launch-symbol { width: 38px; height: 43px; }
  .launch-row strong { font-size: 1.16rem; }
  .library-heading, .resource-row { flex-wrap: wrap; }
  .search-trigger > span, .route-name span { display: none; }
  .search-trigger { width: 44px; height: 44px; justify-content: center; padding: 0; }
  .tool-tabs { margin-top: 0; }
}
@media print {
  .sidebar, .workspace-bar, .tool-tabs, dialog, .skip-link { display: none !important; }
  .workspace-shell { display: block; }
}

.tmp-print-title { display: none; }
.tmp-preview h2 + p { margin-top: .6rem; }
.tmp-preview .actions { margin-top: 1rem; }
.library-search { display: grid; gap: .4rem; max-width: 36rem; }
.library-form-grid { margin: 1rem 0; }
.library-editor .actions { margin-top: 1rem; }
.library-section > h2 + p { margin-top: .7rem; }
.resource-actions > a { display: inline-flex; min-height: 44px; align-items: center; }
@media print {
  body:has(#tmp-document:not([hidden])) {
    color-scheme: light; background: white; color: #111; font: 10.5pt/1.45 Arial,sans-serif;
  }
  .tool-page:has(#tmp-document:not([hidden])) { max-width: none; padding: 0; margin: 0; }
  .tool-page:has(#tmp-document:not([hidden])) > .page-title,
  .tmp-layout:has(#tmp-document:not([hidden])) #tmp-form,
  .tmp-preview #preview-title, .tmp-preview #tmp-status, .tmp-preview #tmp-downloads { display: none; }
  .tmp-layout { display: block; }
  .tmp-preview { background: white; color: #111; border: 0; padding: 0; }
  .tmp-print-title { display: block; font: 600 21pt/1.14 Arial,sans-serif; margin: 0 0 .4cm; }
  .tmp-document #tmp-heading { font-size: 15pt; }
  .tmp-document h4 { break-after: avoid; }
  .tmp-document p, .tmp-document li { orphans: 3; widows: 3; }
  .tmp-entry { white-space: pre-wrap; }
}
