:root {
  --sidebar: #0f1f36;
  --sidebar-2: #0a1628;
  --sidebar-line: #1e3150;
  --canvas: #eef2f7;
  --paper: #ffffff;
  --paper-2: #f5f8fc;
  --ink: #14202e;
  --muted: #5e6b7a;
  --line: #e1e7ef;
  --line-strong: #cfd8e3;
  --accent: #1d5fd0;
  --accent-dark: #164aa3;
  --accent-soft: #e6efff;
  --blue: #315f78;
  --blue-soft: #e4edf1;
  --green: #4d765d;
  --green-soft: #e8f0e9;
  --amber: #9a6b23;
  --amber-soft: #f7eedc;
  --shadow: 0 1px 2px rgba(16, 32, 54, 0.05), 0 12px 32px rgba(16, 32, 54, 0.07);
  /* Shared aliases used by module stylesheets; keep them theme-aware. */
  --surface: #edf2f8;
  --soft: var(--surface);
  --paper-soft: var(--surface);
  --surface-alt: var(--surface);
  --surface-soft: var(--surface);
  --border: var(--line-strong);
  --danger: #b42f35;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  min-width: 320px;
  background: var(--canvas);
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 65%);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: auto;
  color: #e7e6df;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  border-right: 1px solid #111719;
}
.brand {
  min-height: 91px;
  padding: 19px 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--sidebar-line);
}
.brand img {
  display: block;
  width: 146px;
  height: auto;
  filter: saturate(0.8) brightness(1.35);
}
.project-switcher {
  padding: 20px;
  border-bottom: 1px solid var(--sidebar-line);
}
.project-switcher label,
.sidebar-heading > span,
.sidebar-footer > p {
  display: block;
  margin: 0 0 9px;
  color: #8e999d;
  font:
    700 9px/1.2 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  letter-spacing: 0.14em;
}
.project-switcher select {
  width: 100%;
  min-height: 39px;
  padding: 0 31px 0 10px;
  border: 1px solid #2b4266;
  border-radius: 4px;
  color: #f1f1ed;
  background: #0c1a2e;
}
.text-button {
  margin-top: 10px;
  padding: 0;
  border: 0;
  color: #d0d4d4;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}
.text-button:hover {
  color: white;
}
.sidebar-section {
  padding: 20px;
}
.recent-section {
  min-height: 0;
  flex: 1;
}
.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-heading > span {
  margin: 0;
}
.sidebar-heading button {
  padding: 0;
  border: 0;
  color: #778286;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}
.sidebar-heading button:hover {
  color: #d6dada;
}
.recent-list {
  margin-top: 12px;
  display: grid;
  gap: 5px;
}
.recent-entry {
  position: relative;
  min-width: 0;
}
.recent-item {
  width: 100%;
  padding: 10px 30px 10px 10px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #d8dada;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.recent-item > span:last-child {
  min-width: 0;
  overflow: hidden;
}
.recent-item:hover,
.recent-item.active {
  border-color: #2b4266;
  background: rgba(255, 255, 255, 0.045);
}
.recent-delete {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 23px;
  height: 23px;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 3px;
  color: #747d80;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
}
.recent-entry:hover .recent-delete,
.recent-delete:focus-visible {
  opacity: 1;
}
.recent-delete:hover {
  color: #b9cff5;
  background: rgba(29, 95, 208, 0.22);
}
.recent-code {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border: 1px solid #2f4870;
  border-radius: 3px;
  color: #b9cff5;
  font:
    700 10px/1 ui-monospace,
    monospace;
}
.recent-item strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #eef0ee;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.recent-item small {
  display: block;
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  color: #899397;
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.empty-recent {
  padding: 17px 4px;
  color: #7f8a8e;
  font-size: 11px;
  line-height: 1.5;
}
.sidebar-footer {
  padding: 18px 20px 20px;
  border-top: 1px solid var(--sidebar-line);
}
.session-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  color: #eef4ff;
  background: var(--accent);
  font:
    700 11px/1 ui-monospace,
    monospace;
}
.session-row strong {
  display: block;
  font-size: 12px;
}
.session-row small {
  display: block;
  margin-top: 3px;
  color: #8e999d;
  font-size: 9px;
}
.sidebar-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.sidebar-actions a,
.sidebar-actions button {
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  border: 0;
  color: #929da1;
  background: none;
  font-size: 10px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.sidebar-actions form {
  height: 28px;
  margin: 0;
  display: flex;
  align-items: center;
}
.sidebar-actions [hidden] {
  display: none;
}
.sidebar-actions a:hover,
.sidebar-actions button:hover {
  color: #fff;
}

.work-area {
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--paper), transparent 4%);
  backdrop-filter: blur(12px);
}
.topbar nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.topbar nav button {
  min-height: 37px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  color: #4e5659;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.topbar nav button:hover,
.topbar nav button.active {
  color: var(--ink);
  background: #e8eef7;
}
.topbar nav button.primary-nav {
  color: #fff;
  background: var(--accent);
}
.topbar nav button.primary-nav:hover {
  background: var(--accent-dark);
}
.topbar nav button span {
  margin-right: 4px;
}
.topbar nav button .mobile-label {
  display: none;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon-button {
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  background: var(--paper);
  font-size: 11px;
  cursor: pointer;
}
.mobile-menu {
  display: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 20px;
}

.page-frame {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 27px 28px 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 238px;
  gap: 22px;
  align-items: start;
}
.page-frame.context-hidden {
  width: min(1220px, 100%);
  grid-template-columns: minmax(0, 1fr);
}
#main-content {
  min-width: 0;
}
#main-content:focus {
  outline: none;
}
.paper {
  min-height: calc(100vh - 152px);
  padding: 42px 48px 55px;
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  box-shadow: var(--shadow);
}
.paper::before {
  content: "";
  position: absolute;
  inset: 14px 14px auto;
  height: 1px;
  background: #e6ecf3;
}
.document-header {
  padding-bottom: 26px;
  display: flex;
  gap: 28px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.kicker,
.eyebrow {
  display: block;
  margin: 0 0 11px;
  color: var(--accent);
  font:
    700 10px/1.25 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  letter-spacing: 0.13em;
}
.document-header h1,
.hero h1 {
  max-width: 760px;
  margin: 0;
  color: #272b2d;
  font:
    500 clamp(29px, 4vw, 44px) / 1.08 Georgia,
    "Times New Roman",
    serif;
  letter-spacing: -0.02em;
}
.document-header p,
.hero p {
  max-width: 680px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.doc-stamp {
  flex: 0 0 118px;
  align-self: flex-start;
  padding: 10px;
  border: 1px solid var(--line-strong);
  text-align: center;
}
.doc-stamp span {
  display: block;
  color: var(--muted);
  font:
    700 8px/1.3 ui-monospace,
    monospace;
  letter-spacing: 0.12em;
}
.doc-stamp strong {
  display: block;
  margin-top: 5px;
  font:
    600 17px/1 Georgia,
    serif;
}
.doc-stamp small {
  display: block;
  margin-top: 7px;
  color: var(--accent);
  font-size: 9px;
}
.hero {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 25px;
}
.hero-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}
.dashboard-head {
  padding-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.dashboard-head h1 {
  margin: 0;
  font:
    500 clamp(27px, 3.5vw, 38px) / 1.1 Georgia,
    "Times New Roman",
    serif;
}
.dashboard-head p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.dashboard-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.button {
  min-height: 38px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.button.primary {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}
.button.primary:hover {
  background: var(--accent-dark);
}
.button.secondary {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--paper);
}
.button.secondary:hover {
  background: var(--paper-2);
}
.button.ghost {
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
}
.status-strip {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
}
.status-cell {
  min-height: 75px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}
.status-cell:last-child {
  border-right: 0;
}
.status-cell span {
  display: block;
  color: var(--muted);
  font:
    700 8px/1.2 ui-monospace,
    monospace;
  letter-spacing: 0.11em;
}
.status-cell strong {
  display: block;
  margin-top: 8px;
  font:
    600 15px/1.2 Georgia,
    serif;
}
.status-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.section {
  padding: 30px 0 0;
}
.section + .section {
  margin-top: 31px;
  border-top: 1px solid var(--line);
}
.section-title {
  margin-bottom: 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}
.section-title h2 {
  margin: 0;
  font:
    500 22px/1.2 Georgia,
    serif;
}
.section[aria-labelledby="quick-actions-title"] {
  padding-top: 0;
}
#quick-actions-title {
  margin: 0;
  font:
    500 clamp(27px, 3.5vw, 38px) / 1.1 Georgia,
    "Times New Roman",
    serif;
}
.section-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.section-title > span {
  color: var(--muted);
  font:
    700 9px/1.2 ui-monospace,
    monospace;
}
.workflow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.workflow-card {
  padding: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
}
.workflow-card span {
  color: var(--accent);
  font:
    700 10px/1 ui-monospace,
    monospace;
}
.workflow-card strong {
  display: block;
  margin-top: 14px;
  font:
    600 14px/1.2 Georgia,
    serif;
}
.workflow-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}
.panel {
  padding: 20px;
  border: 1px solid var(--line);
  background: #ffffff;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.panel-head h3 {
  margin: 0;
  font:
    600 16px/1.2 Georgia,
    serif;
}
.panel-head button {
  padding: 0;
  border: 0;
  color: var(--accent);
  background: none;
  font-size: 10px;
  cursor: pointer;
}
.quick-list {
  margin-top: 15px;
  display: grid;
  gap: 8px;
}
.quick-item {
  width: 100%;
  padding: 12px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
}
.quick-item:hover {
  border-color: #9dbcf0;
  background: #f5f9ff;
}
.quick-item .code {
  color: var(--accent);
  font:
    700 11px/1 ui-monospace,
    monospace;
}
.quick-item strong {
  display: block;
  font-size: 11px;
}
.quick-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}
.quick-item .arrow {
  color: var(--accent);
}
.project-card {
  min-height: 100%;
  padding: 22px;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #ffffff;
}
.project-card .kicker {
  color: var(--accent);
}
.project-card h3 {
  margin: 0;
  font:
    500 24px/1.16 Georgia,
    serif;
}
.project-card > p {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 11px;
}
.project-progress {
  margin-top: auto;
}
.project-progress div {
  height: 5px;
  overflow: hidden;
  background: #4a555a;
}
.project-progress span {
  display: block;
  width: 35%;
  height: 100%;
  background: var(--accent);
}
.project-progress p {
  margin: 8px 0 0;
  color: #9eaaad;
  font-size: 9px;
}
.work-table {
  border-top: 1px solid var(--line);
}
.work-row {
  min-height: 65px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}
.work-open {
  width: 100%;
  padding: 12px 8px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 120px 90px 24px;
  gap: 12px;
  align-items: center;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.work-open:hover,
.work-row:has(.work-delete:hover) {
  background: #f3f7fc;
}
.work-row .code {
  color: var(--accent);
  font:
    700 10px/1 ui-monospace,
    monospace;
}
.work-row strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.work-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}
.work-row time {
  color: var(--muted);
  font-size: 9px;
}
.work-row .state {
  width: fit-content;
  padding: 5px 7px;
  color: var(--amber);
  background: var(--amber-soft);
  font:
    700 8px/1 ui-monospace,
    monospace;
}
.work-row .arrow {
  color: var(--accent);
}
.work-delete {
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid transparent;
  color: #9aa8b8;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
}
.work-delete:hover {
  color: var(--accent);
  border-left-color: var(--line);
  background: var(--accent-soft);
}
.project-facts {
  margin: 16px 0 0;
  display: grid;
  gap: 11px;
}
.project-facts div {
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.project-facts dt {
  color: var(--muted);
  font-size: 9px;
}
.project-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 10px;
  text-align: right;
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.action-card {
  min-height: 112px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}
.action-card:hover {
  border-color: #9dbcf0;
  background: #f5f9ff;
}
.action-card span {
  color: var(--accent);
  font:
    700 9px/1 ui-monospace,
    monospace;
}
.action-card strong {
  margin-top: 15px;
  font:
    600 14px/1.2 Georgia,
    serif;
}
.action-card small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.filter-row {
  margin: 24px 0 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  flex: 1 1 250px;
}
.search-box input {
  width: 100%;
  min-height: 40px;
  padding: 0 13px 0 35px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
}
.search-box::before {
  content: "⌕";
  position: absolute;
  left: 12px;
  top: 8px;
  color: var(--muted);
  font-size: 18px;
}
.filter-chip {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: var(--paper);
  font-size: 10px;
  cursor: pointer;
}
.filter-chip.active {
  color: var(--accent-dark);
  border-color: #9dbcf0;
  background: var(--accent-soft);
}
.catalog-list {
  border-top: 1px solid var(--line);
}
.catalog-item {
  width: 100%;
  padding: 17px 8px;
  display: grid;
  grid-template-columns: 62px 1fr 126px 26px;
  gap: 12px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.catalog-item:hover {
  background: #f3f7fc;
}
.catalog-code {
  color: var(--accent);
  font:
    700 11px/1 ui-monospace,
    monospace;
}
.catalog-copy strong {
  display: block;
  font:
    600 15px/1.25 Georgia,
    serif;
}
.catalog-copy small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}
.status {
  width: fit-content;
  padding: 5px 7px;
  border-radius: 3px;
  font:
    700 8px/1 ui-monospace,
    monospace;
  letter-spacing: 0.05em;
}
.status.prototype {
  color: var(--blue);
  background: var(--blue-soft);
}
.status.planned {
  color: var(--amber);
  background: var(--amber-soft);
}
.status.legacy {
  color: var(--green);
  background: var(--green-soft);
}
.status.verified {
  color: var(--green);
  background: var(--green-soft);
}
.status.unverified {
  color: var(--amber);
  background: var(--amber-soft);
}
.catalog-arrow {
  color: #9aa8b8;
  font-size: 16px;
}

.form-section {
  margin-top: 28px;
}
.form-section + .form-section {
  padding-top: 29px;
  border-top: 1px solid var(--line);
}
.form-section-head {
  margin-bottom: 17px;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: start;
}
.section-number {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border: 1px solid #a9c4f2;
  border-radius: 50%;
  color: var(--accent);
  font:
    700 10px/1 ui-monospace,
    monospace;
}
.form-section-head h2 {
  margin: 1px 0 0;
  font:
    500 20px/1.2 Georgia,
    serif;
}
.form-section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.field {
  display: grid;
  gap: 7px;
}
.field.full {
  grid-column: 1 / -1;
}
.field > span,
.field > label {
  color: #50575a;
  font-size: 10px;
  font-weight: 750;
}
.input-unit {
  display: grid;
  grid-template-columns: 1fr auto;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--ink);
  background: #fff;
}
.field textarea {
  min-height: 72px;
  resize: vertical;
}
.input-unit input {
  border-radius: 3px 0 0 3px;
}
.input-unit em {
  min-width: 58px;
  padding: 0 10px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 3px 3px 0;
  color: var(--muted);
  background: var(--paper-2);
  font-size: 9px;
  font-style: normal;
}
.field small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.info-banner {
  margin: 17px 0;
  padding: 13px 15px;
  display: flex;
  gap: 10px;
  border-left: 3px solid var(--blue);
  color: #40545e;
  background: var(--blue-soft);
  font-size: 10px;
  line-height: 1.55;
}
.warning-banner {
  margin: 17px 0;
  padding: 13px 15px;
  border-left: 3px solid var(--amber);
  color: #6e542a;
  background: var(--amber-soft);
  font-size: 10px;
  line-height: 1.55;
}
.calculation-actions {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.calculation-actions .saved-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
}
.formula-block {
  margin-top: 17px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #f5f8fc;
}
.formula-block span {
  color: var(--muted);
  font:
    700 8px/1.2 ui-monospace,
    monospace;
  letter-spacing: 0.1em;
}
.formula-block code {
  display: block;
  margin-top: 9px;
  color: #3e484d;
  font:
    600 14px/1.5 "SFMono-Regular",
    Consolas,
    monospace;
}
.result-grid {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
}
.result {
  min-height: 100px;
  padding: 17px;
  border-right: 1px solid var(--line);
}
.result:last-child {
  border-right: 0;
}
.result span {
  color: var(--muted);
  font:
    700 8px/1.2 ui-monospace,
    monospace;
  letter-spacing: 0.08em;
}
.result strong {
  display: block;
  margin-top: 9px;
  font:
    500 25px/1 Georgia,
    serif;
}
.result small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}
.result.pass strong {
  color: var(--green);
}
.result.pending strong {
  color: var(--amber);
  font-size: 17px;
}
.reference-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.reference-list li {
  padding: 12px 0;
  display: grid;
  grid-template-columns: 75px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.5;
}
.reference-list code {
  color: var(--accent);
  font:
    700 9px/1.5 ui-monospace,
    monospace;
}
.route-trace {
  margin-top: 18px;
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.route-step {
  flex: 1;
  padding: 13px;
  border: 1px solid var(--line);
  background: #ffffff;
}
.route-step span {
  color: var(--accent);
  font:
    700 8px/1 ui-monospace,
    monospace;
}
.route-step strong {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.45;
}
.route-arrow {
  display: grid;
  place-items: center;
  color: #9aa8b8;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.data-card {
  min-height: 150px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
  text-align: left;
}
button.data-card {
  width: 100%;
  cursor: pointer;
}
button.data-card:hover {
  border-color: #9dbcf0;
  background: #f5f9ff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(29, 95, 208, 0.1);
}
.data-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.data-card .code {
  color: var(--accent);
  font:
    700 9px/1 ui-monospace,
    monospace;
}
.data-card h3 {
  margin: 14px 0 0;
  font:
    600 16px/1.2 Georgia,
    serif;
}
.data-card p {
  margin: 7px 0 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.data-card footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
}
.data-records {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.data-record {
  padding: 14px 0;
  display: grid;
  grid-template-columns: 150px 1fr 110px;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.data-record code {
  color: var(--accent);
  font:
    700 9px/1.4 ui-monospace,
    monospace;
}
.data-record strong {
  display: block;
  font-size: 11px;
}
.data-record small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.data-record span {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}
.lock-note {
  margin-bottom: 22px;
  padding: 15px 17px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid #cfd8dc;
  background: var(--blue-soft);
}
.lock-note strong {
  display: block;
  color: #365b6e;
  font-size: 11px;
}
.lock-note p {
  margin: 4px 0 0;
  color: #5c747f;
  font-size: 10px;
  line-height: 1.5;
}

.project-list {
  margin-top: 23px;
  display: grid;
  gap: 11px;
}
.project-row {
  padding: 17px;
  display: grid;
  grid-template-columns: 46px 1fr 120px auto;
  gap: 15px;
  align-items: center;
  border: 1px solid var(--line);
  background: #ffffff;
}
.project-initials {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #164aa3;
  background: var(--accent-soft);
  font:
    700 11px/1 ui-monospace,
    monospace;
}
.project-row strong {
  display: block;
  font:
    600 15px/1.2 Georgia,
    serif;
}
.project-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}
.project-meta span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}
.project-meta strong {
  margin-top: 4px;
  font:
    650 10px/1.2 ui-sans-serif,
    sans-serif;
}
.project-tabs {
  margin: 24px 0 0;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}
.project-tabs button {
  min-height: 39px;
  padding: 0 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.project-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.fluid-list {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.fluid-row {
  min-height: 76px;
  padding: 13px 8px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 130px 95px auto;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.fluid-code {
  color: var(--accent);
  font:
    700 10px/1 ui-monospace,
    monospace;
}
.fluid-row strong {
  display: block;
  font:
    600 13px/1.3 Georgia,
    serif;
}
.fluid-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.fluid-source {
  color: var(--blue);
  font:
    700 8px/1 ui-monospace,
    monospace;
  text-transform: uppercase;
}
.fluid-property {
  color: var(--muted);
  font-size: 9px;
}
.row-actions {
  display: flex;
  gap: 5px;
}
.row-actions button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}
.row-actions button:hover {
  color: var(--ink);
  background: var(--paper-2);
}
.row-actions button.danger-link:hover {
  color: var(--accent);
  border-color: #9dbcf0;
  background: var(--accent-soft);
}
.empty-state {
  padding: 36px 20px;
  border: 1px dashed var(--line-strong);
  text-align: center;
}
.empty-state strong {
  display: block;
  font:
    600 16px/1.2 Georgia,
    serif;
}
.empty-state p {
  margin: 8px auto 16px;
  max-width: 480px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.context-panel {
  position: sticky;
  top: 91px;
  display: grid;
  gap: 12px;
}
.context-card {
  padding: 16px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--paper), transparent 10%);
}
.context-card h3 {
  margin: 0 0 13px;
  color: #555d60;
  font:
    700 9px/1.2 ui-monospace,
    monospace;
  letter-spacing: 0.12em;
}
.outline-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.outline-list li {
  padding: 7px 0;
  display: flex;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.outline-list li:last-child {
  border-bottom: 0;
}
.outline-list span {
  color: var(--accent);
  font:
    700 8px/1.5 ui-monospace,
    monospace;
}

.modal {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(20, 25, 27, 0.3);
}
.modal.fluid-modal {
  width: min(760px, calc(100% - 32px));
}
.modal::backdrop {
  background: rgba(23, 29, 31, 0.64);
  backdrop-filter: blur(3px);
}
.modal form {
  padding: 28px;
}
.modal-head {
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.modal h2 {
  margin: 0;
  font:
    500 24px/1.2 Georgia,
    serif;
}
.close-button {
  width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}
.modal label {
  margin-top: 14px;
  display: grid;
  gap: 7px;
  color: #535a5d;
  font-size: 10px;
  font-weight: 750;
}
.modal input {
  width: 100%;
  min-height: 41px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #fff;
}
.form-note {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 9px;
}
.modal-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.button.danger {
  color: #fff;
  border-color: #9f3d31;
  background: #9f3d31;
}
.button.danger:hover {
  background: #7e2e26;
}
.confirm-name {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper-2);
  font:
    600 14px/1.4 Georgia,
    serif;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: 360px;
  padding: 12px 15px;
  border-radius: 4px;
  color: white;
  background: #2e373b;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.25);
  font-size: 11px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

html[data-theme="dark"] {
  --canvas: #0f1722;
  --paper: #18222f;
  --paper-2: #1e2a39;
  --ink: #e7e7e2;
  --muted: #9aa3a5;
  --line: #2a3748;
  --line-strong: #364659;
  --accent-soft: #1d2f4f;
  --accent: #4d8af0;
  --accent-dark: #3a73d6;
  --blue-soft: #283b44;
  --green-soft: #273b2f;
  --amber-soft: #403625;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
  --surface: #1e2a39;
  --danger: #f07a7a;
  --green: #7cc49a;
  --amber: #e3b15e;
  --blue: #8cc0db;
  color-scheme: dark;
}
html[data-theme="dark"] .document-header h1,
html[data-theme="dark"] .hero h1 {
  color: #efeee8;
}
html[data-theme="dark"] .topbar {
  background: rgba(24, 34, 47, 0.95);
}
html[data-theme="dark"] .topbar nav button:hover,
html[data-theme="dark"] .topbar nav button.active {
  background: #263447;
}
html[data-theme="dark"] .paper::before {
  background: #263447;
}
html[data-theme="dark"] .workflow-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .quick-item,
html[data-theme="dark"] .route-step,
html[data-theme="dark"] .data-card,
html[data-theme="dark"] .project-row {
  background: #1b2635;
}
html[data-theme="dark"] .quick-item:hover,
html[data-theme="dark"] .catalog-item:hover {
  background: #223044;
}
html[data-theme="dark"] button.data-card:hover {
  background: #223044;
}
html[data-theme="dark"] .work-open:hover,
html[data-theme="dark"] .work-row:has(.work-delete:hover),
html[data-theme="dark"] .action-card:hover {
  background: #223044;
}
html[data-theme="dark"] .action-card {
  background: #1b2635;
}
html[data-theme="dark"] .project-card {
  background: #1b2635;
}
html[data-theme="dark"] .project-card {
  background: linear-gradient(155deg, #223044, #121b27);
}
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .search-box input,
html[data-theme="dark"] .modal input {
  color: var(--ink);
  background: #111a26;
}
html[data-theme="dark"] .formula-block {
  background: #141e2a;
}
html[data-theme="dark"] .formula-block code {
  color: #d2d7d6;
}
html[data-theme="dark"] .context-card {
  background: #18222f;
}

@media (max-width: 1120px) {
  .page-frame {
    grid-template-columns: minmax(0, 1fr);
  }
  .context-panel {
    position: static;
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    width: 264px;
    transition: transform 0.2s ease;
    box-shadow: 18px 0 50px rgba(0, 0, 0, 0.28);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .mobile-menu {
    display: block;
    margin-right: 8px;
  }
  .paper {
    padding: 34px 30px 45px;
  }
  .workflow,
  .status-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .status-cell:nth-child(2) {
    border-right: 0;
  }
  .status-cell:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .action-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .topbar {
    padding: 0 14px;
  }
  .topbar nav button {
    padding: 0 9px;
  }
  .topbar nav button .desktop-label {
    display: none;
  }
  .topbar nav button .mobile-label {
    display: inline;
    margin: 0;
  }
  [data-theme-label] {
    display: none;
  }
  .page-frame {
    padding: 16px 12px 38px;
  }
  .paper {
    min-height: 0;
    padding: 29px 20px 38px;
  }
  .document-header,
  .hero-row {
    display: block;
  }
  .dashboard-head {
    display: block;
  }
  .dashboard-actions {
    margin-top: 18px;
  }
  .doc-stamp {
    width: 118px;
    margin-top: 18px;
  }
  .hero-actions {
    margin-top: 18px;
  }
  .workflow,
  .data-grid,
  .field-grid,
  .field-grid.three,
  .context-panel {
    grid-template-columns: 1fr;
  }
  .status-strip,
  .result-grid {
    grid-template-columns: 1fr;
  }
  .status-cell,
  .status-cell:nth-child(2),
  .result {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .status-cell:last-child,
  .result:last-child {
    border-bottom: 0;
  }
  .catalog-item {
    grid-template-columns: 48px 1fr 22px;
  }
  .catalog-item .status {
    grid-column: 2;
    grid-row: 2;
  }
  .catalog-arrow {
    grid-column: 3;
    grid-row: 1;
  }
  .project-row {
    grid-template-columns: 42px 1fr auto;
  }
  .project-meta {
    display: none;
  }
  .project-tabs {
    overflow-x: auto;
  }
  .project-tabs button {
    flex: 0 0 auto;
  }
  .fluid-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }
  .fluid-source,
  .fluid-property {
    display: none;
  }
  .work-open {
    grid-template-columns: 46px minmax(0, 1fr) 24px;
  }
  .work-row time,
  .work-row .state {
    display: none;
  }
  .route-trace {
    flex-direction: column;
  }
  .route-arrow {
    transform: rotate(90deg);
  }
  .data-record {
    grid-template-columns: 90px 1fr;
  }
  .data-record span {
    grid-column: 2;
    text-align: left;
  }
}

/* Visual refresh: brand-blue palette with card catalogue and accented document header. */
.brand img {
  filter: none;
}
.paper {
  border-color: var(--line);
  border-radius: 10px;
}
.paper::before {
  display: none;
}
.topbar nav button.primary-nav,
.topbar nav button.primary-nav.active {
  color: #fff;
  background: var(--accent);
}
.document-header {
  position: relative;
  padding-left: 18px;
}
.document-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 28px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(var(--accent), #5fa8ff);
}
.doc-stamp {
  border-color: transparent;
  border-radius: 8px;
  background: var(--accent-soft);
}
.doc-stamp strong {
  color: var(--accent);
}
.section-title h2,
.form-section-head h2 {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 650;
  font-size: 19px;
}
.catalog-list {
  border-top: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.catalog-item {
  min-height: 150px;
  padding: 16px;
  grid-template-columns: 1fr auto;
  grid-template-areas: "code status" "copy copy";
  align-content: start;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--paper);
  transition:
    box-shadow 0.15s,
    transform 0.15s;
}
.catalog-item:hover {
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.catalog-code {
  grid-area: code;
  width: fit-content;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
}
.catalog-item .status {
  grid-area: status;
}
.catalog-copy {
  grid-area: copy;
}
.catalog-copy strong {
  font-size: 17px;
}
.catalog-copy small {
  font-size: 11px;
  line-height: 1.5;
}
.catalog-arrow {
  display: none;
}
.context-card {
  border-color: var(--line);
  border-radius: 8px;
}
.button,
.icon-button,
.filter-chip,
.field input,
.field select,
.field textarea,
.search-box input {
  border-radius: 6px;
}
.topbar nav button {
  border-radius: 6px;
}
.field > span,
.field > label {
  font-size: 12px;
}
.field small,
.kicker,
.eyebrow,
.catalog-copy small {
  font-size: 11px;
}
.status {
  border-radius: 999px;
  padding: 5px 9px;
}
html[data-theme="dark"] .topbar {
  background: rgba(24, 34, 47, 0.95);
}
html[data-theme="dark"] .topbar nav button:hover,
html[data-theme="dark"] .topbar nav button.active:not(.primary-nav) {
  background: #263447;
}
html[data-theme="dark"] .catalog-item,
html[data-theme="dark"] .context-card {
  background: var(--paper);
}
html[data-theme="dark"] .catalog-item:hover {
  background: var(--paper-2);
}
#main-content .workspace-strip {
  border-radius: 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
html[data-theme="dark"] .info-banner {
  color: #bccbe0;
}
html[data-theme="dark"] .field > span,
html[data-theme="dark"] .field > label,
html[data-theme="dark"] .modal label {
  color: #b4c0ce;
}
html[data-theme="dark"] .topbar nav button:not(.primary-nav) {
  color: #c3cfdd;
}
html[data-theme="dark"] .topbar nav button.primary-nav {
  color: #fff;
  background: var(--accent);
}
html[data-theme="dark"] .context-card h3 {
  color: #9fb0c4;
}
@media (max-width: 1120px) {
  .catalog-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .catalog-list {
    grid-template-columns: 1fr;
  }
  .catalog-item {
    min-height: 0;
    grid-template-columns: 1fr auto;
  }
  .catalog-item .status {
    grid-column: auto;
    grid-row: auto;
  }
}
#main-content .hi-form input,
#main-content .hi-form select {
  background: var(--paper);
}
html[data-theme="dark"] #main-content .hi-form input,
html[data-theme="dark"] #main-content .hi-form select {
  background: #111a26;
}
html[data-theme="dark"] .filter-chip.active,
html[data-theme="dark"] .project-initials,
html[data-theme="dark"] #main-content .uc-output-label,
html[data-theme="dark"] #main-content .uc-direction legend {
  color: #8db6ff;
}
html[data-theme="dark"] .lock-note {
  border-color: var(--line);
}
html[data-theme="dark"] .lock-note strong {
  color: #d3e3ec;
}
html[data-theme="dark"] .lock-note p {
  color: #a9bcc8;
}
