/* Shared workbench: locally hosted, server-rendered, progressively enhanced. */
:root {
  --ink: #202b3d; --muted: #59687c; --line: #dce2eb; --accent: #1765c1;
  --surface: #fff; --canvas: #f5f7fb; --header: #17283f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--canvas); color: var(--ink); font-size: 14px;
}
body { line-height: 1.5; }
.app-header { position: sticky; top: 0; z-index: 20; min-height: 64px; padding: .6rem 1.5rem; background: var(--header); color: #fff; border: 0; }
.app-identity { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
.app-header .brand { color: #fff; font-size: 1.4rem; letter-spacing: -.04em; }
.app-divider { color: #74849b; font-size: 1.5rem; font-weight: 300; }
.app-context { color: #dbe5f1; overflow-wrap: anywhere; }
.app-header nav { gap: 1.4rem; font-size: .85rem; }
.app-header nav > a { color: #e0e8f4; text-decoration: none; padding: .4rem 0; }
.app-header nav > a:hover { color: #fff; text-decoration: underline; }
.app-header button { background: #ffffff0d; border: 1px solid #ffffff30; font-size: .8rem; }
.user-identity { display: inline-flex; align-items: center; gap: .6rem; color: #e0e8f4; }
.user-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: #3a5679; font-size: .8rem; }
main { max-width: 1600px; padding: 2.5rem; }
.workspace-page > main { max-width: none; padding: 0; }
.workspace { grid-template-columns: 238px minmax(0, 1fr); gap: 0; min-height: calc(100vh - 64px); }
.workspace-sidebar { position: sticky; top: 64px; align-self: start; max-height: calc(100dvh - 64px); overflow-y: auto; background: #fff; padding: 1.6rem 1rem; border-right: 1px solid var(--line); }
.workspace-sidebar > .eyebrow { margin: 0 .65rem 1rem; color: var(--muted); font-size: .65rem; }
.site-sidebar-identity { padding: 0 .5rem; }
.site-sidebar-identity h2 { font-size: 1rem; }
.site-sidebar-identity .site-icon { width: 34px; height: 34px; border-radius: 7px; }
.site-switch { display: inline-flex; align-items: center; gap: .4rem; margin: .6rem .65rem 1.3rem; font-size: .75rem; text-decoration: none; }
.site-switch .ui-icon { width: 1rem; height: 1rem; }
.module-search { margin: 0 .3rem; }
.module-search input { font-size: .8rem; padding: .65rem; border: 1px solid var(--line); background: #f8fafc !important; }
.sidebar-nav { margin: 1rem 0 2rem; gap: .2rem; }
.sidebar-nav a, .sidebar-group summary { padding: .65rem .75rem; border-radius: 5px; font-size: .88rem; font-weight: 500; }
.sidebar-nav a[aria-current=page] { background: #eaf2fe; color: #1259b0; box-shadow: inset 3px 0 #1765c1; font-weight: 650; }
.sidebar-label { font-size: .64rem; margin: 1.2rem .75rem .4rem; letter-spacing: .1em; }
.sidebar-subnav { margin-left: 1.35rem; }
.sidebar-subnav a { font-size: .8rem; }
.sidebar-note { margin: 0 .65rem; font-size: .75rem; }
.sidebar-note p { margin-bottom: 0; }
.workspace-content { padding: 1.7rem 2.2rem 2.5rem; }
.breadcrumb { margin-bottom: 1.8rem; font-size: .78rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
h1 { font-size: clamp(1.6rem, 2.3vw, 2rem); font-weight: 650; letter-spacing: -.035em; }
h2 { font-weight: 650; }
.eyebrow { color: var(--muted); font-size: .7rem; letter-spacing: .08em; }
.page-heading { margin-bottom: 1.8rem; }
.page-heading h1 { margin: .3rem 0 .5rem; }
.panel { border-radius: 7px; box-shadow: 0 1px 2px #17283f03; }
button, .button-link, .secondary-button { border-radius: 5px; font-size: .85rem; }
.secondary-button { border-color: #c8d1dd; display: inline-flex; align-items: center; justify-content: center; }
button:hover:not(:disabled), .button-link:hover { filter: brightness(.96); }
.secondary-button:hover { background: #f3f6fb; }
input, select, textarea { border-color: #aebccc; border-radius: 5px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.form-field > label { font-size: .85rem; }
.table-scroll { border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.table-scroll th { font-weight: 600; padding: .9rem 1rem; background: #f8fafc; color: #526176; }
.table-scroll td { padding: .85rem 1rem; }
.table-scroll tbody tr:last-child td { border-bottom: 0; }
.table-scroll tbody tr:hover { background: #f7faff; }
.icon-action { border-color: #dce2eb; font-size: .78rem; }
.overview-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 0 0 2rem; }
.overview-summary:empty { display: none; }
.overview-summary a { display: grid; gap: .5rem; background: white; border: 1px solid var(--line); border-radius: 7px; padding: 1.25rem 1.5rem; text-decoration: none; color: var(--ink); }
.overview-summary a:hover { border-color: #87aede; }
.overview-summary span { font-size: .85rem; color: var(--muted); }
.overview-summary strong { font-size: 2rem; font-weight: 650; letter-spacing: -.05em; }
.overview-summary small { font-size: .75rem; color: var(--accent); }
.overview-modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
.workspace-module-group { margin: 0; }
.workspace-module-group h2 { font-size: .85rem; color: var(--ink); }
.workspace-tiles { margin-top: .65rem; grid-template-columns: 1fr; }
.module-tile { border-radius: 6px; padding: 1.2rem; }
.module-tile-meta { font-size: .8rem; }
.flow-navigation { border-radius: 6px 6px 0 0; }
.record-flow, .record-flow > *, .flow-panel, .flow-panel > * { min-width: 0; }
.flow-tab { flex: 0 0 auto; font-size: .8rem; padding: 1rem .8rem; }
.flow-progress { font-size: .75rem; }
.record-flow .form-panel { padding: 1.6rem; }
.record-footer { padding: 1rem; }
.app-messages { padding: 1rem 2rem 0; }
.app-message { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #edf8f2; color: #196344; border: 1px solid #b8ddc9; border-left-width: 4px; border-radius: 5px; padding: .7rem 1rem; margin-bottom: .5rem; }
.app-message.error { color: #a32d38; background: #fff3f4; border-color: #edc0c4; }
.app-message.warning { color: #845200; background: #fff8e8; border-color: #e8d096; }
.app-message.info { color: #18528c; background: #eef6ff; border-color: #bad4ed; }
.message-dismiss { padding: 0; color: inherit; background: transparent; font-size: 1.3rem; }
.skip-link { z-index: 100; }
.workspace-menu { margin: 1rem; justify-self: start; }
@media (min-width: 901px) { .workspace-menu { display: none; } }
@media (max-width: 1200px) { .app-header nav { gap: .8rem; } .app-context { max-width: 200px; } .workspace-content { padding: 1.5rem; } }
@media (max-width: 900px) {
  .app-header { padding: .75rem 1rem; } .app-header nav { flex: 1 1 100%; }
  .workspace { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .workspace-sidebar { position: static; max-height: none; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .workspace-menu-ready .workspace-sidebar { display: none; }
  .workspace-menu-ready.is-navigation-open .workspace-sidebar { display: block; }
  .sidebar-nav, .sidebar-section { display: grid; }
  .workspace-content { padding: 1rem; }
  .sidebar-note { display: none; }
}
@media (max-width: 600px) {
  main { padding: 1.25rem; } .overview-modules { grid-template-columns: 1fr; }
  .app-context { max-width: none; font-size: .8rem; } .user-identity { margin-left: auto; }
  .user-avatar { display: none; } .app-header nav { font-size: .75rem; }
  .app-header nav form { margin-left: auto; } .overview-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .overview-summary a { padding: 1rem; } .app-messages { padding: 1rem; }
  .record-flow .form-panel { padding: 1rem; } .record-footer { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media print { .app-header, .workspace-sidebar, .workspace-menu, .app-messages { display: none !important; } .workspace { display: block; } .workspace-content { padding: 0; } }
