/* Application presentation only. Record, storage and form contracts live in app.js. */
:root {
  --bg: #f4f6f5;
  --surface: #fff;
  --surface-strong: #fff;
  --panel: #fff;
  --ink: #20332e;
  --muted: #64756e;
  --muted-copy: #64756e;
  --line: #e2e9e5;
  --line-strong: #bccdc4;
  --accent: #16755c;
  --accent-dark: #105a47;
  --warm: #65786e;
  --shadow: 0 2px 8px #20332e05;
  --shadow-soft: 0 2px 8px #20332e04;
  --radius: 14px;
  --radius-small: 9px;
  --sidebar-width: 232px;
}
html, body {
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #299478;
  outline-offset: 3px;
}
.app-shell {
  display: block;
  max-width: none;
  min-height: 100vh;
  margin: 0 0 0 var(--sidebar-width);
  padding: 0;
}
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  padding: 30px 16px 20px;
  background: #153b30;
  color: #ecf5ee;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 32px;
  color: #fff;
  text-decoration: none;
}
.sidebar-brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid #ffffff30;
  border-radius: 11px;
  background: #ffffff0b;
  font-size: 20px;
}
.sidebar-brand-copy { display: grid; gap: 1px; }
.sidebar-brand strong { display: block; font-size: 16px; font-weight: 650; letter-spacing: -.3px; }
.sidebar-brand small, .sidebar-brand p { margin: 0; color: #bfd2c8; font-size: 11px; }
.sidebar-caption { margin: 0 12px 9px; font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: #aec6b9; }
.app-sidebar .main-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.app-sidebar .nav-pill {
  width: 100%;
  min-height: 46px;
  gap: 12px;
  justify-content: flex-start;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #d2e0d8;
  text-align: left;
  font-weight: 500;
  transform: none;
}
.app-sidebar .nav-pill:hover { color: #fff; background: #ffffff0c; }
.app-sidebar .nav-pill.is-active { color: #fff; background: #ffffff17; border-color: #ffffff12; box-shadow: inset 3px 0 #9cd6b5; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; flex: 0 0 21px; font-size: 18px; }
.nav-icon svg, .sidebar-brand-mark svg { width: 21px; height: 21px; }
.sidebar-footer { margin-top: auto; padding: 28px 10px 0; color: #bfd2c8; font-size: 12px; }
.sidebar-footer p { margin: 4px 0; }
.sidebar-footer strong { color: #e5f0e9; font-weight: 550; }
.sidebar-footer .button { color: #ecf5ee; border-color: #ffffff30; background: transparent; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 30px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fffffff5;
  box-shadow: none;
  backdrop-filter: blur(12px);
}
.page-heading { min-width: 0; }
.page-heading .eyebrow { margin: 0 0 3px; font-size: 10px; color: var(--muted); letter-spacing: .13em; }
.page-heading h1 { margin: 0; font-size: 25px; font-weight: 650; letter-spacing: -.7px; line-height: 1.25; }
.page-heading > p:last-child { margin: 5px 0 0; max-width: 64ch; color: var(--muted); font-size: 12px; }
.app-header .header-actions { display: flex; width: auto; align-self: center; gap: 8px; padding: 0; border: 0; justify-content: flex-end; }
.app-header .header-actions > * { flex: 0 1 auto; }
.header-session { gap: 9px; width: auto; padding: 0 0 0 12px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: none; }
.header-session-copy strong { font-size: 12px; }
.header-session-copy span { font-size: 10px; max-width: 160px; }
.header-session .button { padding: 7px 9px; min-height: 34px; font-size: 11px; }
.mobile-menu-button, .sidebar-backdrop { display: none; }
.app-main { padding: 28px 30px 44px; max-width: 1700px; margin: auto; }
.view-panel, .record-main, .record-sidebar, .workspace-grid > *, .dashboard-grid > * { min-width: 0; }
.view-panel { animation-duration: 120ms; }
.panel, .summary-panel, .inset-panel { padding: 22px; background: #fff; border-color: var(--line); border-radius: 14px; box-shadow: var(--shadow-soft); }
.section-heading { justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2, .detail-header h2, .empty-state h2, .service-editor h2, .panel h3 { font-family: inherit; font-weight: 650; letter-spacing: -.35px; line-height: 1.3; }
.section-heading h2 { font-size: 17px; }
.section-heading h3, .panel h3 { font-size: 15px; }
.detail-header h2 { font-size: 25px; }
.eyebrow, .section-label { color: var(--muted); font-size: 10px; letter-spacing: .11em; margin-bottom: 5px; font-weight: 650; }
.detail-subtitle { margin: 7px 0 0; font-size: 13px; }
.helper-text, .table-note { font-size: 12px; line-height: 1.6; }
.button, .inline-button, .link-chip { border-radius: 8px; background: #fff; border-color: #d7e1db; padding: 9px 13px; min-height: 38px; font-size: 12px; font-weight: 600; box-shadow: none; }
.button:hover, .inline-button:hover, .link-chip:hover { background: #f5f8f6; border-color: #a8c1b3; transform: none; box-shadow: none; }
.button-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: none; }
.button-primary:hover, .button-primary:focus-visible { background: var(--accent-dark); border-color: var(--accent-dark); }
.action-row { gap: 8px; }
.field { min-width: 0; gap: 6px; }
.field span { color: #4a5f54; font-size: 12px; font-weight: 550; }
.field input, .field select, .field textarea { border-radius: 8px; padding: 10px 11px; min-height: 40px; background: #fff; border-color: #d4dfd8; font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #16755c14; }
.field textarea { resize: vertical; }
.field input[readonly] { background: #f5f7f6; }
.field-grid, .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }
.field-group-heading { background: #f3f7f4; padding: 12px 14px; border: 0; border-radius: 8px; }
.form-panel { gap: 24px; }
.form-panel > .action-row { padding-top: 18px; border-top: 1px solid var(--line); }
/* Overview: clear hierarchy with a calm, compact metric strip. */
.dashboard-grid { grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; align-items: start; }
.dashboard-grid > .stack-column { grid-column: 2; grid-row: 1; }
.dashboard-main-stack { grid-column: 1; grid-row: 1; gap: 22px; }
.dashboard-main-stack > .dashboard-snapshot-panel { order: -1; }
.dashboard-snapshot-panel { background: #fff; box-shadow: var(--shadow-soft); }
#dashboardMetrics.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric-card, .dashboard-card, .reminder-card, .directory-entry, .document-card, .service-card, .spare-card, .timeline-entry, .empty-card { border-radius: 10px; background: #fff; border-color: var(--line); }
.metric-link-card { padding: 14px; min-height: 128px; gap: 10px; background: #f8faf8; }
.metric-link-card p:first-of-type { font-size: 11px; color: var(--muted); line-height: 1.4; }
.metric-link-card strong { font-size: clamp(18px, 1.8vw, 25px); letter-spacing: -.6px; overflow-wrap: anywhere; }
.metric-link-card .entry-link-note { font-size: 10px; font-weight: 500; }
.dashboard-board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dashboard-card { padding: 18px; min-height: 180px; gap: 9px; }
.dashboard-card-head strong { font-size: 14px; line-height: 1.4; }
.dashboard-card p, .reminder-card p, .directory-entry p { font-size: 12px; }
.reminder-card { min-height: auto; padding: 14px; gap: 9px; }
.dashboard-grid > .stack-column > .panel { padding: 18px; }
.dashboard-grid > .stack-column h2 { font-size: 16px; }
.entry-link-note, .report-link-note { align-self: end; justify-self: start; border: 0; background: none; padding: 0; margin-top: 12px; border-radius: 0; color: var(--accent-dark); font-size: 11px; }
.entry-link-note::after, .report-link-note::after, .metric-link-card .entry-link-note::after { content: "→"; }
.badge, .status-chip { padding: 4px 8px; font-size: 10px; line-height: 1.5; max-width: 100%; }
.tone-good { background: #e8f4ec; color: #236042; }
.tone-warning { background: #fff2d9; color: #805c1e; }
.tone-danger { background: #fcebe7; color: #973e33; }
.tone-muted { background: #eef2ef; color: #607268; }
/* Directories and record pages retain all existing controls and relationships. */
.workspace-header-panel { margin-bottom: 20px; background: #fff; }
.workspace-header-panel h2, .workspace-section-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.4px; }
.workspace-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.directory-panel, .detail-panel, .workspace-grid.page-list .directory-panel, .workspace-grid.page-detail .detail-panel { position: static; min-height: 0; max-height: none; overflow: visible; }
.workspace-grid.page-list, .workspace-grid.page-detail { grid-template-columns: minmax(0, 1fr); }
#assetDirectoryPanel .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 18px; background: #f7f9f7; border-radius: 10px; margin-bottom: 4px; }
#assetDirectoryPanel .filter-grid .field:first-child { grid-column: 1 / -1; }
#assetList, #vendorList { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.directory-entry { padding: 19px; }
.directory-entry-meta { align-items: flex-start; }
.directory-entry strong { font-size: 15px; }
.directory-entry:hover, .dashboard-link-card:hover, .reminder-link-card:hover, .metric-link-card:hover { transform: none; border-color: #91b5a1; box-shadow: 0 3px 10px #173e3008; }
.detail-toolbar { margin-bottom: 20px; padding-bottom: 16px; }
.detail-header { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.record-page-nav { border: 0; border-radius: 0; background: none; padding: 0; margin: 0 0 22px; gap: 0; }
.record-page-nav > .section-label { margin-bottom: 7px; }
.tab-bar { margin: 0; padding: 0; gap: 3px; border-bottom: 1px solid var(--line); }
.tab-pill { min-height: 42px; padding: 10px 14px; border: 0; border-radius: 7px 7px 0 0; background: transparent; color: #63766a; font-size: 12px; font-weight: 550; }
.tab-pill:hover { transform: none; background: #f3f7f4; }
.tab-pill.is-active { background: #edf5ef; color: var(--accent-dark); box-shadow: inset 0 -2px var(--accent); }
.record-detail-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; }
.record-main { grid-column: 1; grid-row: 1; gap: 22px; }
.record-sidebar { grid-column: 2; grid-row: 1; position: static; gap: 16px; }
.record-links-panel { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9f7; gap: 14px; }
.record-links-panel .section-heading { margin: 0; }
.record-links-panel .section-heading h2 { font-size: 14px; }
.record-link-card, .related-records-vertical .record-link-card { border-radius: 8px; padding: 12px; border: 1px solid var(--line); background: #fff; box-shadow: none; gap: 8px; }
.record-link-card p, .related-records-vertical .record-link-card p { font-size: 11px; }
.record-link-card strong, .related-records-vertical .record-link-card strong { font-size: 12px; overflow-wrap: anywhere; }
.record-link-card .section-label { font-size: 9px; }
.record-highlights-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.record-highlight-card { padding: 14px; border-radius: 9px; background: #f8faf8; box-shadow: none; gap: 8px; }
.record-highlight-card.is-current { background: #edf5ef; }
.record-highlight-card strong { font-size: 16px; }
.record-highlight-card p { font-size: 11px; }
.record-highlights-panel { padding: 0; background: none; border: 0; box-shadow: none; }
.asset-tab-panel { margin-top: 0; }
.tab-grid { grid-template-columns: minmax(0, 1fr); }
.tab-grid .summary-panel { position: static; }
.subpanel, .context-links, .summary-panel, .inset-panel { background: #f8faf8; border-radius: 10px; }
.service-editor-heading > div:first-child { flex: 1 1 260px; }
.service-layout.detail-mode .service-editor, .documents-layout.detail-mode .document-editor { max-width: none; }
#serviceLinkedAsset { padding: 10px 12px; background: #edf5ef; border-color: #d5e8da; border-radius: 8px; font-size: 12px; }
.table-wrap { border: 1px solid var(--line); border-radius: 10px; max-width: 100%; }
th, td { padding: 14px; font-size: 12px; }
th { background: #f4f7f4; font-size: 10px; letter-spacing: .06em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.report-tab-bar { margin: 18px 0 0; }
.report-section.is-focused { box-shadow: var(--shadow-soft); border-color: var(--line); }
.document-card, .timeline-entry { scroll-margin-top: 150px; }
.empty-state { min-height: 280px; padding: 30px 10px; }
.empty-state h2 { font-size: 22px; }
.empty-state .action-row { justify-content: flex-start; }
.empty-card { background: #f8faf8; border-style: dashed; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.settings-card { display: grid; gap: 18px; align-content: start; }
.settings-card .section-heading { margin: 0; }
.settings-card .action-row { justify-content: flex-start; }
.settings-card .compact-field { width: min(100%, 260px); }
.settings-card .persistence-badge { justify-self: start; white-space: normal; border-radius: 8px; font-size: 12px; padding: 9px 12px; }
.auth-shell { background: #edf3ee; padding: 40px 20px; }
.auth-card { max-width: 520px; border-radius: 16px; box-shadow: 0 15px 50px #163b300c; padding: 36px; border-color: #dfe9e1; }
.auth-card h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.8px; margin: 8px 0 14px; }
.auth-copy { font-size: 13px; line-height: 1.65; }
.auth-card .field-grid { grid-template-columns: minmax(0, 1fr); }
.auth-card .span-2 { grid-column: auto; }
.auth-form + .auth-form { padding-top: 24px; border-top: 1px solid var(--line); margin-top: 24px; }
.auth-form .action-row { justify-content: flex-start; }
.auth-form .action-row > button[type="submit"] { min-height: 42px; }
.auth-note, .auth-message { border-radius: 8px; font-size: 12px; }
.remember-browser { font-size: 12px; }
@media (min-width: 1600px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .dashboard-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1320px) {
  .app-header { padding: 20px 24px; }
  .app-main { padding: 24px; }
  .header-session { flex-basis: 100%; justify-content: flex-end; border: 0; padding: 0; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-main-stack { grid-column: 1; grid-row: 1; }
  .dashboard-grid > .stack-column { grid-column: 1; grid-row: 2; }
  #dashboardReminders { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .record-detail-layout { grid-template-columns: minmax(0, 1fr); }
  .record-sidebar { grid-column: 1; grid-row: 2; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
  .record-main { grid-column: 1; grid-row: 1; }
}
@media (max-width: 1000px) {
  #dashboardMetrics.metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-header { flex-wrap: wrap; gap: 14px; }
  .app-header .header-actions { justify-content: flex-start; }
  .header-session { flex-basis: auto; justify-content: flex-start; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  #assetDirectoryPanel .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app-shell { margin-left: 0; padding: 0; }
  .app-sidebar { transform: translateX(-100%); transition: transform 180ms ease; width: 260px; }
  body.nav-open { overflow: hidden; }
  body.nav-open .app-sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 40; padding: 0; border: 0; border-radius: 0; background: #132f2466; }
  body.nav-open .sidebar-backdrop { display: block; }
  .mobile-menu-button { display: inline-flex; justify-content: center; align-items: center; width: 40px; min-height: 40px; padding: 8px; flex: 0 0 40px; }
  .app-header { padding: 15px 18px; gap: 10px 12px; }
  .page-heading { flex: 1; }
  .page-heading h1 { font-size: 22px; }
  .page-heading > p:last-child { font-size: 11px; }
  .app-header .header-actions { width: 100%; gap: 8px; }
  .app-header .header-actions > .button { width: auto; flex: 0 1 auto; }
  .header-session { margin-left: auto; width: auto; }
  .app-main { padding: 18px 14px 32px; }
  .panel, .summary-panel, .inset-panel { padding: 18px; }
  .record-highlights-panel { padding: 0; }
  .dashboard-grid, .dashboard-main-stack { gap: 18px; }
  .dashboard-card { min-height: 160px; padding: 14px; }
  .detail-header { flex-wrap: wrap; }
  .detail-header h2 { font-size: 23px; }
  .detail-header .badge-row { justify-content: flex-start; }
  .record-sidebar { grid-template-columns: minmax(0, 1fr); }
  .tab-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  #assetTabBar { overflow-x: visible; flex-wrap: wrap; }
  .tab-pill { flex: 0 0 auto; }
  .report-tab-bar { flex-wrap: wrap; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .auth-card { padding: 25px; }
}
@media (max-width: 480px) {
  .app-header .header-actions { flex-wrap: wrap; }
  .header-session { margin-left: 0; flex-basis: 100%; padding-top: 5px; justify-content: space-between; }
  .header-session-copy span { max-width: none; }
  .dashboard-board, .form-grid, .field-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .dashboard-card { min-height: auto; }
  #dashboardMetrics.metric-grid { gap: 8px; }
  .metric-link-card { min-height: 122px; padding: 12px; }
  .metric-link-card strong { font-size: 20px; }
  .record-highlights-grid { grid-template-columns: minmax(0, 1fr); }
  #assetList, #vendorList { grid-template-columns: minmax(0, 1fr); }
  .directory-entry-meta, .service-entry-head, .document-head, .timeline-entry-head { flex-wrap: wrap; }
  .workspace-section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading { flex-wrap: wrap; }
  .service-editor-actions { margin-left: 0; flex-wrap: wrap; }
  .service-editor-heading > div:first-child { flex-basis: 100%; }
  .subpanel { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .app-sidebar, .app-header, .sidebar-backdrop { display: none !important; }
  .app-shell { margin: 0; }
  .app-main { padding: 0; }
  .panel { box-shadow: none; break-inside: avoid; }
}
/* Shell-specific finishing rules; the sidebar also owns the signed-in identity. */
.skip-link { position: fixed; left: 16px; top: -70px; z-index: 100; padding: 12px 18px; border-radius: 8px; color: #fff; background: var(--accent-dark); }
.skip-link:focus { top: 12px; }
.sidebar-brand-copy > span { color: #bfd2c8; font-size: 10px; }
.sidebar-section-label { display: block; margin: 0 12px 10px; color: #adc8b9; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-footer .sidebar-section-label { margin: 0 0 10px; }
.sidebar-footer .header-session { display: flex; flex-wrap: wrap; width: 100%; margin: 22px 0 0; padding: 18px 0 0; border: 0; border-top: 1px solid #ffffff24; gap: 12px; }
.sidebar-footer .header-session-copy { flex: 1 1 100%; }
.sidebar-footer .header-session-copy strong { color: #fff; font-size: 12px; }
.sidebar-footer .header-session-copy span { color: #bed2c5; max-width: 100%; font-size: 11px; }
.sidebar-footer .header-session .button { width: 100%; padding: 8px; background: #ffffff09; border-color: #ffffff24; font-size: 11px; }
.sidebar-footer .header-session .button:hover { background: #ffffff15; }
.workspace-header-panel .workspace-heading > div:first-child { display: none; }
.workspace-header-panel { padding: 12px 18px; }
.workspace-header-panel .workspace-heading { justify-content: flex-end; }
.record-detail-layout.focused-record { grid-template-columns: minmax(0, 1fr); }
.settings-card > h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.3px; }
.settings-card > p { margin: 0; color: var(--muted); font-size: 13px; }
.settings-card > .section-label { font-size: 10px; }

/* Keep record editing and optional shortcuts visually separate. */
#assetDetailContent > .detail-header > div:first-child { display: none; }
#assetDetailContent > .detail-header { margin: 0 0 14px; }
#assetDetailContent > .detail-header .badge-row { justify-content: flex-start; }
.asset-status-details { border: 1px solid var(--line); border-radius: 9px; margin: 0 0 16px; background: #fafcfb; }
.asset-status-details > summary { padding: 12px 15px; cursor: pointer; font-weight: 600; color: var(--accent-dark); min-height: 44px; }
summary:focus-visible { outline: 3px solid #299478; outline-offset: 2px; }
.asset-status-details #assetHighlightsPanel { padding: 0 14px 14px; }
.asset-status-details { margin: 0; }
#assetDetailContent .detail-toolbar { margin-bottom: 12px; padding-bottom: 12px; }
#assetPageNavSection > .section-label { display: none; }
#overviewForm > .section-heading { margin-bottom: 20px; }

@media (max-width: 760px) {
  .service-editor-actions, .action-row.service-editor-actions { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .service-editor-actions .button { flex: 1 1 150px; white-space: normal; }
  .service-editor-heading, .service-editor-heading > * { min-width: 0; max-width: 100%; }
}
/* Do not reserve an empty toolbar on directory and administration pages. */
#assetsView > .workspace-header-panel:not(:has(.workspace-actions button:not([hidden]))),
#vendorsView > .workspace-header-panel:not(:has(.workspace-actions button:not([hidden]))),
#usersView > .workspace-header-panel { display: none; }

/* Maintenance stays within the existing asset workspace. */
.workflow-panel { margin: 0 0 24px; padding: 24px; background: var(--surface, #fff); border: 1px solid #dce3e8; border-radius: 16px; }
.workflow-panel h2 { margin-top: 0; }
.workflow-heading, .workflow-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.workflow-row { padding: 14px 0; border-top: 1px solid #e5e9ed; }
.workflow-row p { margin: 5px 0 0; font-size: .9rem; color: #52616f; }
.workflow-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.workflow-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.workflow-panel label, #workflowServiceLink { display: grid; gap: 7px; margin-bottom: 14px; }
.workflow-panel input, .workflow-panel select, #workflowServiceLink select { width: 100%; padding: 10px; border: 1px solid #b9c6cf; border-radius: 7px; font: inherit; }
.workflow-panel small, #workflowServiceLink small { font-weight: 400; color: #52616f; }
#workflowSaveFailure { position: sticky; top: 8px; z-index: 100; border: 2px solid #a94326; background: #fff7ef; }
.workflow-task-form { border-top: 1px solid #dce3e8; margin-top: 18px; padding-top: 18px; }
@media (max-width: 640px) { .workflow-panel { padding: 16px; } .workflow-row, .workflow-heading { align-items: flex-start; flex-direction: column; } .workflow-fields { grid-template-columns: 1fr; } }

.dashboard-grid.has-workflow-queue { grid-template-columns: minmax(0, 1fr); }

/* Coverage documents stay alongside the contract being edited. */
.coverage-documents { padding: 16px; border: 1px solid var(--border, #dbe4df); border-radius: 12px; min-width: 0; }
.coverage-document-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; }
.coverage-document-row > span { flex: 1 1 180px; overflow-wrap: anywhere; }
.coverage-documents input[type="file"] { max-width: 100%; }

.record-attachment-dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto; box-sizing: border-box; border: 1px solid var(--line); border-radius: 14px; padding: 24px; color: var(--ink); background: white; }
.record-attachment-dialog::backdrop { background: #0c241c88; }
.record-attachment-dialog h2 { margin: 0 0 18px; }
.record-attachment-dialog .action-row { margin-top: 20px; justify-content: flex-end; }

/* Keep related record and file-search actions compact and usable on phones. */
.record-related-links { display: flex; gap: .65rem; flex-wrap: wrap; padding: 1rem 0; }
.document-search-row { display: flex; align-items: end; gap: .75rem; margin: 1rem 0 .5rem; }
.document-search-row .field { flex: 1; min-width: 0; }
@media (max-width: 600px) { .document-search-row { align-items: stretch; flex-direction: column; } }
