/* Application shell and reusable business components. Document pages are styled in styles.css. */

/* Shell and navigation */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; align-self: flex-start; display: flex; flex: 0 0 224px; flex-direction: column; width: 224px; height: 100vh; height: 100dvh; min-height: 0; padding: 24px 16px 16px; background: var(--sidebar); color: var(--sidebar-text); border-right: 1px solid var(--line); overflow: hidden; }
.brand { border: 0; background: transparent; text-align: left; display: flex; align-items: center; gap: 11px; flex-shrink: 0; padding: 0 8px 28px; color: var(--ink); font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: .015em; }
.ui-icon { display: inline-block; flex-shrink: 0; width: 18px; height: 18px; vertical-align: middle; }
.brand-symbol { color: var(--brand); display: block; flex: 0 0 40px; width: 40px; height: 40px; object-fit: contain; }
.brand > span { min-width: 0; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 400; letter-spacing: .06em; line-height: 1.5; white-space: nowrap; }
.sidebar-brand-row { display: flex; align-items: center; flex-shrink: 0; gap: 8px; padding: 0 6px 20px; }
.sidebar-brand-row .brand { padding: 0; gap: 9px; }
.sidebar-close-button { display: none; }
.mark { display: inline-grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 8px; background: var(--brand-action); color: var(--brand-on); font-size: 16px; font-weight: 600; line-height: 1; }
.workspace { display: flex; flex-direction: column; align-items: stretch; gap: 4px; flex-shrink: 0; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--surface); font-size: 12px; line-height: 1.4; }
.workspace > span { min-width: 0; color: var(--muted); font-size: 12px; }
.workspace > b { display: block; min-width: 0; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: #63c5a1; }
.side-nav { display: flex; flex: 1; flex-direction: column; gap: 2px; min-height: 0; margin: 14px -2px 0 0; padding-right: 2px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.nav { display: flex; align-items: center; gap: 12px; flex-shrink: 0; width: 100%; min-height: 40px; padding: 9px 12px; border: 0; border-radius: var(--control-radius); background: transparent; color: var(--sidebar-text); text-align: left; font-size: var(--font-body); line-height: 1.5; }
.nav:hover { background: #e9eff4; color: var(--ink); }
.nav.active { background: var(--sidebar-active); color: var(--brand-on); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.nav-icon { flex: 0 0 18px; width: 18px; height: 18px; }
.nav-label { flex-shrink: 0; padding: 10px 12px 4px; color: var(--muted); font-size: 12px; letter-spacing: .05em; }
.nav-settings { flex-shrink: 0; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.nav-settings summary { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 9px 12px; border-radius: var(--control-radius); color: var(--sidebar-text); font-size: var(--font-body); cursor: pointer; list-style: none; }
.nav-settings summary::-webkit-details-marker { display: none; }
.nav-settings summary::after { content: ""; width: 6px; height: 6px; margin-left: auto; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(-45deg); }
.nav-settings[open] summary::after { transform: rotate(45deg); }
.nav-settings summary:hover, .nav-settings summary.contains-active { color: var(--ink); background: #e9eff4; }
.nav-settings-items { display: grid; gap: 4px; margin-top: 4px; }
.nav-settings-items .nav { padding-left: 24px; font-size: 13px; }
.nav-settings-items .nav-icon { width: 16px; height: 16px; flex-basis: 16px; }
.sidebar-footnote { flex-shrink: 0; margin-top: 0; padding: 12px 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.7; }
.sidebar-footnote span, .sidebar-footnote small { display: block; }
.side-bottom { flex-shrink: 0; margin-top: 12px; }
.user { display: flex; align-items: center; gap: 10px; padding: 16px 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; background: var(--sidebar-active); color: var(--brand-on); border-radius: 50%; }
.main { flex: 1; min-width: 0; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; padding: 12px 32px; border-bottom: 1px solid var(--line); background: #fff; }
.top-start { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crumb { min-width: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.crumb-divider { margin: 0 10px; color: #a7b3c4; }
.crumb b { color: var(--ink); font-weight: 500; }
.top-actions, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.top-actions { flex-wrap: nowrap; gap: 16px; }
.top-actions > .secondary { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.mobile-menu-button { display: none; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px; padding: 9px; border: 1px solid var(--line); border-radius: var(--control-radius); background: #fff; color: var(--ink); }
.mobile-menu-button svg { width: 20px; height: 20px; }
.sidebar-backdrop { display: none; }
.save-indicator, .draft-indicator { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.save-indicator::before { content: ""; flex: 0 0 6px; width: 6px; height: 6px; background: #8eaaa1; border-radius: 50%; }
.draft-error, .save-indicator.error { color: var(--danger); }
.save-indicator.draft-error::before, .save-indicator.error::before { background: var(--danger); }
.system-notice { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 32px; border-bottom: 1px solid #f0d1d1; background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.system-notice .link { color: inherit; text-decoration: underline; }
.system-notice:empty { display: none; }
.content { width: 100%; max-width: 1680px; min-width: 0; margin: 0 auto; padding: 32px 32px 48px; }
.view { display: none; min-width: 0; }
.view.show { display: block; }

/* Page hierarchy and controls */
.heading, .page-header, .split-heading, .section-head, .editor-head, .panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.heading > div:first-child, .page-header > div:first-child, .split-heading > div:first-child { min-width: 0; }
.heading p, .page-description, .split-heading p { margin-top: 7px; max-width: 740px; font-size: 13px; line-height: 1.7; }
.page-title { font-size: var(--font-page-title); font-weight: 600; line-height: 1.4; }
.heading .actions, .page-header .actions, .split-heading .actions { flex-shrink: 0; padding-top: 2px; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.eyebrow { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.section { margin-top: 28px; }
.section-head { align-items: center; margin-bottom: 16px; }
.section-head p { margin-top: 4px; font-size: 12px; }
.primary, .secondary, .link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: var(--control-radius); font-size: var(--font-body); font-weight: 500; line-height: 1.55; text-decoration: none; }
.primary, .secondary { min-height: 40px; padding: 8px 15px; border: 1px solid transparent; white-space: nowrap; }
.primary { border-color: var(--brand-action); background: var(--brand-action); color: var(--brand-on); }
.primary:hover:not(:disabled) { border-color: var(--brand-hover); background: var(--brand-hover); color: #fff; }
.secondary { border-color: var(--line-strong); background: #fff; color: #334155; }
.secondary:hover:not(:disabled) { background: var(--surface-subtle); border-color: #9eafc2; }
.link { min-height: 32px; padding: 4px 0; border: 0; background: transparent; color: var(--brand-ink); text-align: left; }
.link:hover:not(:disabled) { color: var(--brand-hover); text-decoration: underline; }
.primary svg, .secondary svg, .link svg { flex-shrink: 0; width: 16px; height: 16px; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
.source { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.save { color: var(--muted); font-size: 12px; }

/* Operational overview */
.overview-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 28px 0; }
.overview-stat { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: start; gap: 6px 14px; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); text-align: left; }
.overview-stat:hover { border-color: var(--brand-line); }
.stat-icon { display: grid; grid-column: 2; grid-row: 1 / 3; place-items: center; width: 38px; height: 38px; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand-ink); }
.stat-icon svg { width: 20px; height: 20px; }
.stat-label { grid-column: 1; grid-row: 1; color: var(--muted); font-size: 13px; }
.stat-number { grid-column: 1; grid-row: 2; font-size: var(--font-metric); font-weight: 600; line-height: 1.35; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-meta { grid-column: 1 / -1; grid-row: 3; margin-top: 3px; color: var(--muted); font-size: 12px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 24px; align-items: start; }
.overview-main, .overview-aside { display: grid; min-width: 0; gap: 24px; }
.surface-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.surface-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; min-height: 65px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.surface-header h2 { font-size: var(--font-section); }
.surface-header p { margin-top: 3px; font-size: 12px; }
.surface-header > .link { min-height: 26px; font-size: 12px; }
.surface-body { padding: 20px 24px; }
.surface-card > .work-list, .surface-card > .quick-links, .surface-card > .recent-list, .surface-card > .readiness-list { padding: 20px 24px; }
.overview-section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.overview-section-header h2 { font-size: var(--font-section); }
.overview-section-header p { margin-top: 3px; font-size: 12px; }
.work-list { display: grid; }
.work-row { display: flex; align-items: center; gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.work-row:first-child { padding-top: 2px; }
.work-row:last-child { padding-bottom: 2px; border-bottom: 0; }
.work-icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 44px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-subtle); color: #5c7393; }
.work-icon svg { width: 21px; height: 21px; }
.work-main { flex: 1; min-width: 0; }
.work-main b, .work-main h3 { display: block; color: var(--ink); font-size: var(--font-body); font-weight: 600; overflow-wrap: anywhere; }
.work-main > .work-meta { display: block; margin: 0 0 3px; }
.work-main > small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.work-amount { max-width: 180px; margin-top: 0; text-align: right; font-variant-numeric: tabular-nums; }
.work-main p, .work-meta { margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.work-status { flex-shrink: 0; }
.work-action { flex-shrink: 0; font-size: 13px; }
.overview-empty, .empty-state, .ref-empty { display: grid; justify-items: center; gap: 10px; padding: 40px 24px; text-align: center; }
.overview-empty { min-height: 258px; align-content: center; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-subtle); color: #7d91ad; }
.empty-icon svg { width: 24px; height: 24px; }
.overview-empty-compact { min-height: 150px; padding: 28px 24px; }
.overview-empty h3, .empty-state h3, .ref-empty h3 { color: var(--ink); font-size: var(--font-section); font-weight: 600; }
.overview-empty p, .empty-state p, .ref-empty p { max-width: 430px; font-size: 13px; line-height: 1.8; }
.overview-empty .actions, .ref-empty .actions { justify-content: center; margin-top: 8px; }
.quick-links { display: grid; }
.quick-link { display: flex; align-items: center; gap: 13px; width: 100%; min-width: 0; min-height: 76px; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.quick-link:first-child { padding-top: 2px; }
.quick-link:last-child { padding-bottom: 2px; border-bottom: 0; }
.quick-link:hover b { color: var(--brand-ink); }
.quick-link > svg:first-child { flex: 0 0 20px; width: 20px; height: 20px; color: #6f829c; }
.quick-link > span { flex: 1; min-width: 0; }
.quick-link b { display: block; font-size: var(--font-body); font-weight: 500; }
.quick-link small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.quick-link > svg:last-child { flex: 0 0 16px; width: 16px; height: 16px; color: #94a3b8; }
.readiness-list { display: grid; gap: 18px; }
.readiness-item { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.readiness-dot { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: #edf2f7; color: #8b9db4; }
.readiness-dot svg { width: 12px; height: 12px; }
.readiness-dot.ready, .readiness-item.complete .readiness-dot, .readiness-item.ready .readiness-dot { background: #e4f3eb; color: var(--success); }
.readiness-dot.pending, .readiness-item.pending .readiness-dot { background: #c9993f; }
.readiness-copy { flex: 1; min-width: 0; }
.readiness-copy b, .readiness-copy strong { display: block; font-size: 13px; font-weight: 500; }
.readiness-copy p, .readiness-copy small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.readiness-item > .link { min-height: 24px; padding: 0; font-size: 12px; white-space: nowrap; }
.recent-list { display: grid; }
.recent-row { width: 100%; border: 0; background: transparent; text-align: left; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.recent-row:hover .recent-copy b { color: var(--brand-ink); }
.recent-row > .ui-icon { width: 15px; height: 15px; color: #94a3b8; }
.recent-copy b > span { margin-left: 5px; color: var(--muted); font-size: 12px; font-weight: 400; }
.recent-row:first-child { padding-top: 0; }
.recent-row:last-child { padding-bottom: 0; border-bottom: 0; }
.recent-icon { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 36px; border-radius: 6px; background: var(--surface-subtle); color: #7890ac; }
.recent-icon svg { width: 17px; height: 17px; }
.recent-copy { flex: 1; min-width: 0; }
.recent-copy b { display: block; color: var(--ink); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.recent-copy p, .recent-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.recent-date { flex-shrink: 0; color: var(--muted); font-size: 12px; }

/* Panels, business navigation and forms */
.workspace-layout { display: grid; grid-template-columns: minmax(0, 1fr) 272px; align-items: start; gap: 24px; margin-top: 24px; }
.workspace-main { display: grid; min-width: 0; gap: 24px; }
.context-panel { position: sticky; top: 92px; display: grid; align-self: start; min-width: 0; gap: 16px; }
.workspace-card, .panel, .table-box { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.table-box { overflow-x: auto; }
.card-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; min-height: 65px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.card-title h2, .card-title h3 { font-size: var(--font-section); font-weight: 600; }
.card-title p { margin-top: 4px; font-size: 12px; }
.card-body { min-width: 0; padding: 24px; }
.context-panel .workspace-card { margin: 0; }
.subnav { display: flex; gap: 4px; max-width: 100%; margin: 24px 0; padding: 5px; border: 1px solid var(--line); border-radius: var(--radius); background: #eaf0f6; overflow-x: auto; scrollbar-width: thin; }
.subnav button { flex: 0 0 auto; min-height: 38px; padding: 7px 16px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #596b83; font-size: 13px; white-space: nowrap; }
.subnav button.active, .subnav button.is-active, .subnav button[aria-selected="true"], .subnav button[aria-current="page"] { border-color: #dce4ef; background: #fff; color: var(--brand-ink); font-weight: 500; box-shadow: 0 1px 2px #0f172a05; }
.subnav button:hover:not(:disabled) { color: var(--brand-ink); }
.tabs { display: flex; gap: 24px; margin-top: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { flex-shrink: 0; min-height: 42px; padding: 0 2px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; white-space: nowrap; }
.tab.active { border-bottom-color: var(--brand-ink); color: var(--brand-ink); font-weight: 500; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 256px; gap: 24px; margin-top: 24px; }
.editor-panel { padding: 24px; }
.panel-head { align-items: center; margin-bottom: 24px; }
.panel-head p { margin-top: 4px; font-size: 12px; }
.form-row, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
.form-field, .form-grid label, .drawer-form label { display: flex; flex-direction: column; gap: 7px; min-width: 0; color: #526178; font-size: var(--font-caption); line-height: 1.6; }
.form-field input:not([type="checkbox"]):not([type="radio"]), .form-field select, .form-field textarea,
.form-grid input:not([type="checkbox"]):not([type="radio"]), .form-grid select, .form-grid textarea,
.drawer-form input:not([type="checkbox"]):not([type="radio"]), .drawer-form select, .drawer-form textarea,
.search input, .table-input, .allocation-row input, .package-rows input,
.data-table input:not([type="checkbox"]):not([type="radio"]), .data-table select {
  width: 100%; min-width: 0; max-width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); outline: none; background: #fff; color: var(--ink); font-size: var(--font-body); line-height: 1.55;
}
.form-field textarea, .form-grid textarea, .drawer-form textarea { min-height: 94px; resize: vertical; }
:is(.form-field, .form-grid, .drawer-form, .search, .allocation-row, .package-rows, .data-table) :is(input, select, textarea):focus { border-color: var(--brand); box-shadow: var(--focus-ring); }
:is(.form-field, .form-grid, .drawer-form, .data-table) :is(input, select, textarea):disabled, .form-field input[readonly], .form-grid input[readonly] { background: #f4f6f9; color: #75839a; }
:is(.form-field, .form-grid, .drawer-form) :is(input, select, textarea)[aria-invalid="true"], .form-field .is-invalid, .data-table .row-error input { border-color: var(--danger); }
.form-field.inline { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.form-field.inline input { width: auto; }
.span-2 { grid-column: 1 / -1; }
.field-note, .subtle-text, .form-grid label small { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.7; }
.field-note { margin-top: 2px; }
.field-error { color: var(--danger); font-size: 12px; }
.form-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-section summary { color: #334155; font-size: 14px; font-weight: 500; cursor: pointer; }
.form-section .form-grid { margin-top: 20px; }
.check-label { display: flex; flex-direction: row !important; align-items: center; gap: 9px !important; margin-top: 15px; color: var(--muted); font-size: 13px; }
.check-label input { width: 16px; height: 16px; flex-shrink: 0; margin: 0; }
.field-groups { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.field-group { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--muted); font-size: 12px; }
.field-group.active { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand-ink); }
.settings-content, .reference-content { margin-top: 24px; }
.subnav + .settings-content { margin-top: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.setting-card { padding: 24px; }
.setting-card p { margin-top: 8px; font-size: 13px; }
.setting-card ul { margin-bottom: 20px; padding-left: 18px; color: var(--muted); font-size: 13px; }

/* Application tables */
.table-scroll, .wide-table { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.data-table, .table-box > table, .wide-table > table { width: 100%; border-collapse: collapse; color: var(--ink); text-align: left; font-size: var(--font-body); }
.data-table th, .table-box > table th, .wide-table > table th { padding: 12px 16px; background: #f7f9fc; color: #5d6e85; font-size: var(--font-caption); font-weight: 500; white-space: nowrap; }
.data-table td, .table-box > table td, .wide-table > table td { padding: 16px; border-top: 1px solid var(--line); vertical-align: middle; line-height: 1.7; }
.data-table tbody tr:hover > td, .table-box > table tbody tr:hover > td { background: #fafbfd; }
.data-table td small, .table-box > table td small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.data-table td b { font-weight: 500; }
.data-table input:not([type="checkbox"]):not([type="radio"]) { min-width: 76px; }
.data-table input[type="checkbox"], .permission-table input[type="checkbox"] { width: 16px; height: 16px; margin: 0; }
.number { font-variant-numeric: tabular-nums; }
.data-table td.number, .data-table th.number { text-align: right; }
.data-table .row-error td { background: var(--danger-soft); }
.data-table .row-error td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.data-table .row-selected td { background: var(--brand-soft); }
.data-table .total-row td { background: var(--surface-subtle); font-weight: 600; }
.table-caption { padding: 12px 16px; border-top: 1px solid var(--line); background: #fbfcfe; color: var(--muted); font-size: 12px; }
.wide-table table { min-width: 660px; }
.wide-table th, .wide-table td { padding: 12px; }
.wide-table .sticky { position: sticky; left: 0; z-index: 1; background: #fff; }
.wide-table th.sticky { background: #f7f9fc; }
.permission-table { min-width: 620px; }
.permission-table td, .permission-table th { text-align: center; }
.permission-table td:first-child, .permission-table th:first-child { min-width: 165px; text-align: left; }
.permission-table td input { display: inline-block; width: 16px; height: 16px; }

/* States and checks */
.status, .tag, .status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid transparent; border-radius: 4px; font-size: 12px; font-weight: 400; line-height: 1.5; white-space: nowrap; }
.status-pill.success, .ok { border-color: #d1eadf; background: var(--success-soft); color: #176848; }
.status-pill.warning, .warn, .tag { border-color: #f1e2bc; background: var(--warning-soft); color: var(--warning); }
.status-pill.neutral, .gray { border-color: #e3e8ef; background: #f1f4f8; color: #65758b; }
.status-pill.error { border-color: #f0d1d1; background: var(--danger-soft); color: var(--danger); }
.danger { color: var(--danger); }
.count-badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 5px; background: #edf2f8; color: #607590; font-size: 12px; font-weight: 500; }
.notice, .info, .design-callout { margin-top: 16px; padding: 13px 16px; border: 1px solid transparent; border-radius: var(--control-radius); font-size: 12px; line-height: 1.8; }
.notice, .design-callout.warning { border-color: #f1e2bc; background: var(--warning-soft); color: var(--warning); }
.notice.notice-info, .info, .design-callout { border-color: #e2eaf7; background: #f3f7fc; color: #526985; }
.design-callout.error { border-color: #f0d1d1; background: var(--danger-soft); color: var(--danger); }
.design-callout.success { border-color: #d1eadf; background: var(--success-soft); color: #176848; }
.design-callout strong { color: inherit; font-weight: 600; }
.design-callout p { color: inherit; font-size: inherit; }
.info p + p { margin-top: 6px; }
.issues { display: flex; flex-direction: column; gap: 16px; }
.issue { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.issue h3 { font-size: 14px; }
.issue > p { margin-top: 8px; font-size: 12px; }
.issue-list { max-height: 340px; margin-top: 8px; overflow-y: auto; }
.issue button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 12px; text-align: left; }
.issue button::before { content: ""; flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; background: #c9993f; }
.issue button span { flex: 1; }
.issue button small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.issue button.link { color: var(--brand-ink); }
.review-list { display: grid; min-width: 0; margin-top: 8px; }
.review-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; min-width: 0; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.review-row:last-child { border-bottom: 0; }
.review-row > span:first-child, .review-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.review-row > b, .review-row > strong { font-weight: 500; text-align: right; }
.review-row > div > small, .review-row > span > small, .timeline-item .split-heading small, .package-header small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.review-row > label { display: flex; align-items: flex-start; gap: 8px; }
.review-row input[type="checkbox"] { margin-top: 4px; }
button.review-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
button.review-row.selected { padding-right: 10px; padding-left: 10px; border-radius: var(--control-radius); background: var(--brand-soft); }
.selection-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 16px; border: 1px solid var(--brand-line); border-radius: var(--control-radius); background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; }
.selection-summary strong { font-weight: 600; }
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.metric-strip:has(> .stat-cell:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-cell { min-width: 0; padding: 18px 20px; border-right: 1px solid var(--line); }
.stat-cell:last-child { border-right: 0; }
.stat-cell > span, .stat-cell > small { display: block; color: var(--muted); font-size: 12px; }
.stat-cell > strong, .stat-cell > b { display: block; margin-top: 7px; color: var(--ink); font-size: 23px; font-weight: 600; line-height: 1.4; font-variant-numeric: tabular-nums; }
.stat-cell strong small, .stat-cell b small { font-size: 12px; font-weight: 400; }
.stat-cell.warning > strong, .stat-cell.warning > b { color: var(--warning); }
.stat-cell.success > strong, .stat-cell.success > b { color: var(--success); }
.steps { display: flex; gap: 0; margin: 4px 0 16px; padding: 18px 0; overflow-x: auto; }
.step { position: relative; display: flex; flex: 1 0 112px; align-items: center; gap: 10px; padding: 0 16px 0 0; border: 0; background: transparent; color: var(--muted); text-align: left; font-size: 13px; line-height: 1.6; }
.step:not(:first-child) { padding-left: 16px; }
.step:not(:last-child)::after { content: ""; flex: 1; min-width: 12px; height: 1px; margin-left: 4px; background: var(--line-strong); }
.step-index { display: inline-grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; font-size: 12px; }
.step.active { color: var(--ink); font-weight: 500; }
.step.active .step-index { border-color: var(--brand-action); background: var(--brand-action); color: var(--brand-on); }
.step.done, .step.done .step-index { color: var(--success); }
.step.done .step-index { border-color: #c3e3d4; background: var(--success-soft); }
.step small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }

/* Orders, packing and history */
.batch-card, .package-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.batch-card + .batch-card, .package-card + .package-card { margin-top: 16px; }
.batch-card.selected, .batch-card.active, .package-card.selected { border-color: var(--brand-line); }
.batch-header, .package-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); }
.batch-header h3, .package-header h3, .batch-header b, .package-header b { font-size: 14px; font-weight: 500; }
.batch-header p, .package-header p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.batch-card.active .batch-header, .batch-card.selected .batch-header { background: var(--brand-soft); }
.allocation-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) repeat(3, minmax(65px, 1fr)); align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 13px; }
.allocation-row:last-child { border-bottom: 0; }
.allocation-row > div { min-width: 0; }
.allocation-row label, .allocation-row small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.package-rows { min-width: 0; padding: 0 20px 20px; }
.package-rows .review-row { padding-right: 0; padding-left: 0; }
.package-rows .form-row { margin-top: 16px; }
.package-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcfe; color: var(--muted); font-size: 12px; }
.package-summary b { padding-left: 4px; color: var(--ink); font-weight: 500; }
.packing { margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.packing-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.packing-metrics { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.packing-metrics b { color: var(--ink); }
.packing-lines { margin-top: 16px; color: var(--muted); font-size: 13px; }
.hs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.hs-row small { display: block; color: var(--muted); font-size: 12px; }
.timeline { min-width: 0; padding-left: 4px; }
.timeline-item { position: relative; min-width: 0; margin-left: 7px; padding: 1px 0 26px 24px; border-left: 1px solid var(--line-strong); }
.timeline-item:last-child { padding-bottom: 1px; border-color: transparent; }
.timeline-item::before { content: ""; position: absolute; top: 5px; left: -5px; width: 9px; height: 9px; border: 2px solid #a4b4c7; border-radius: 50%; background: #fff; }
.timeline-item.current::before, .timeline-item.active::before { border-color: var(--brand); background: var(--brand); }
.timeline-item h3 { font-size: 14px; font-weight: 500; }
.timeline-item p { margin-top: 5px; font-size: 12px; }
.timeline-item .actions { margin-top: 12px; }
.version-detail { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-subtle); font-size: 13px; }
.version-detail h3 { font-size: 14px; }
.version-detail p { margin-top: 6px; font-size: 12px; }
.definition { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; margin-top: 20px; font-size: 13px; }
.definition dt { color: var(--muted); }
.definition dd { margin: 0; overflow-wrap: anywhere; }
.revision { margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.revision small { display: block; margin-top: 6px; color: var(--muted); }

/* Files, imports and delivery */
.attachment-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.attachment-row:last-child { border-bottom: 0; }
.attachment-icon { display: grid; place-items: center; width: 34px; height: 40px; border: 1px solid #dae3ef; border-radius: 5px; background: #f2f6fc; color: #607c9e; font-size: 12px; font-weight: 500; }
.attachment-row b { display: block; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.attachment-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.attachment-row select { max-width: 150px; min-height: 36px; padding: 7px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: #fff; color: var(--ink); font-size: 12px; }
.file-badge { display: inline-flex; align-items: center; padding: 3px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 12px; }
.file-picker { position: relative; display: inline-flex; overflow: hidden; white-space: nowrap; cursor: pointer; }
.file-picker input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.file-picker:has(input:disabled) { cursor: not-allowed; opacity: .48; }
.upload-zone { display: grid; justify-items: center; gap: 8px; margin-top: 24px; padding: 32px 24px; border: 1px dashed #b6c5d8; border-radius: var(--radius); background: #fafcff; color: var(--muted); text-align: center; font-size: 13px; }
.upload-zone strong { color: var(--ink); font-size: 14px; font-weight: 500; }
.upload-zone input { max-width: 100%; font-size: 12px; }
.upload-zone input::file-selector-button { margin-right: 10px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--control-radius); background: #fff; color: #334155; font: inherit; cursor: pointer; }
.import-preview { min-width: 0; margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.import-preview .data-table { min-width: 540px; }
.import-preview caption { padding: 12px 16px; background: var(--surface-subtle); color: var(--muted); font-size: 12px; text-align: left; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0 16px; font-size: 13px; }
.scope-strip { display: flex; flex-wrap: wrap; gap: 24px; margin: 24px 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-size: 13px; }
.scope-strip small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.scope-strip b { font-weight: 500; }
.paper-scroll { max-width: 100%; padding: 28px; border: 1px solid #d9e1eb; border-radius: var(--radius); background: #e9eef4; overflow: auto; }
.output-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; margin-top: 24px; padding: 24px; }
.output-layout p { margin-top: 8px; font-size: 12px; }
.file-list { display: grid; gap: 10px; margin-top: 16px; }
.file-list label { display: flex; align-items: center; gap: 9px; min-height: 28px; font-size: 13px; }
.file-list label b { margin-left: auto; color: var(--brand-ink); font-size: 12px; font-weight: 500; }
.format-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.format-list span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; }
.search > .ui-icon { position: absolute; top: 50%; left: 12px; width: 18px; height: 18px; color: #8a9ab0; transform: translateY(-50%); pointer-events: none; }
.search:has(> svg) input { padding-left: 38px; }
.search { position: relative; display: flex; flex: 1; align-items: center; gap: 8px; max-width: 420px; min-width: 0; }
.product-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 24px 0 16px; }
.product-icon { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; }
.product-name { display: flex; align-items: center; gap: 10px; }
.product-tabs { margin-top: 20px; }
.empty { padding: 48px 24px; color: var(--muted); text-align: center; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.sticky-actions { position: sticky; z-index: 5; bottom: 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 24px; padding: 16px 20px; border: 1px solid #d7e0eb; border-radius: var(--radius); background: #fff; box-shadow: 0 4px 18px #0f172a08; }
.sticky-actions > span, .sticky-actions > p { color: var(--muted); font-size: 12px; }
.sticky-actions .actions { margin-left: auto; }
.stack-actions { display: grid; gap: 10px; margin-top: 16px; }
.workspace-divider { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
.workspace-card details > summary { color: var(--ink); font-size: 13px; cursor: pointer; }
.workspace-card details[open] > summary { margin-bottom: 16px; }

/* Dialogs and feedback */
dialog { width: min(570px, calc(100% - 40px)); max-height: calc(100dvh - 64px); padding: 28px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px #0f172a2e; }
dialog::backdrop { background: #0f172a66; }
dialog h2 { padding-right: 28px; font-size: var(--font-dialog-title); }
dialog p { margin-top: 8px; font-size: 13px; line-height: 1.8; }
dialog.wide-dialog { width: min(1240px, calc(100% - 40px)); }
.close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--control-radius); background: transparent; color: var(--muted); font-size: 25px; line-height: 1; }
.close:hover { background: var(--surface-subtle); color: var(--ink); }
.choices { display: grid; gap: 12px; margin-top: 24px; }
.choices button { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); text-align: left; }
.choices button:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.choices small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.drawer-dialog { width: min(520px, 100%); height: 100%; max-height: 100dvh; margin: 0 0 0 auto; padding: 28px; border: 0; border-radius: 0; }
.drawer-form { display: flex; flex-direction: column; gap: 20px; margin-top: 24px; }
.drawer-form .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.drawer-form input[type="checkbox"] { width: 16px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 120; max-width: calc(100% - 48px); padding: 13px 18px; border-radius: var(--radius); background: #24364d; color: #fff; box-shadow: var(--shadow-menu); font-size: 13px; }

/* Responsive layout. Closed navigation never reserves space on a small screen. */
@media (max-width: 1280px) {
  .top { padding-inline: 24px; }
  .content { padding: 28px 24px 40px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
  .overview-main, .overview-aside { gap: 20px; }
  .overview-stat { padding: 18px; }
  .overview-stats { gap: 12px; }
  .workspace-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 20px; }
  .card-title, .surface-header { padding-inline: 20px; }
  .card-body, .surface-body { padding: 20px; }
  .surface-card > .work-list, .surface-card > .quick-links, .surface-card > .recent-list, .surface-card > .readiness-list { padding: 20px; }
  .work-row { flex-wrap: wrap; }
  .work-status { margin-left: 0; }
  .work-amount { max-width: none; margin-left: 54px; margin-right: auto; text-align: left; }
  .work-action { margin-left: auto; }
  .work-main { flex-basis: calc(100% - 54px); }
}
@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .overview-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .workspace-layout, .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .context-panel { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .context-panel > .design-callout { margin-top: 0; }
  .top-actions { gap: 12px; }
  .save-indicator, .draft-indicator { max-width: 128px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 900px) {
  .side { position: fixed; inset: 0 auto 0 0; z-index: 70; width: 224px; height: 100dvh; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .sidebar-brand-row { padding-right: 0; padding-left: 0; }
  .sidebar-brand-row .brand { gap: 7px; font-size: 16px; }
  .sidebar-brand-row .brand-symbol { width: 34px; height: 34px; flex-basis: 34px; }
  .sidebar-brand-row .brand small { font-size: 8px; }
  .sidebar-close-button { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 32px; margin-left: auto; padding: 4px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); }
  .sidebar-close-button:hover { background: var(--brand-soft); color: var(--brand-ink); }
  .app.navigation-open .side { transform: translateX(0); visibility: visible; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; border: 0; background: #0f172a66; }
  .app.navigation-open .sidebar-backdrop { display: block; }
  .main { width: 100%; }
  .top { min-height: 64px; padding: 10px 20px; gap: 16px; }
  .mobile-menu-button { display: inline-flex; }
  .top-actions { gap: 10px; }
  .content { padding: 28px 20px 40px; }
  .save-indicator, .draft-indicator { display: none; }
  .system-notice { padding-inline: 20px; }
  .overview-stats { margin-top: 24px; }
}
@media (max-width: 680px) {
  .top { padding-inline: 14px; }
  .top-start { gap: 10px; }
  .crumb { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .crumb > span { display: none; }
  .content { padding: 24px 16px 32px; }
  .system-notice { padding-inline: 16px; }
  .heading, .page-header, .split-heading, .editor-head { flex-wrap: wrap; gap: 16px; }
  .heading .actions, .page-header .actions, .split-heading .actions, .heading-actions { justify-content: flex-start; padding-top: 0; }
  .heading p, .page-description, .split-heading p { font-size: 13px; }
  .primary, .secondary { min-height: 42px; }
  .top-actions > .secondary { min-height: 38px; padding: 6px 10px; }
  .overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
  .overview-stat { gap: 6px 8px; padding: 16px; }
  .stat-icon { width: 32px; height: 32px; justify-self: end; }
  .stat-icon svg { width: 18px; height: 18px; }
  .stat-label { font-size: 12px; }
  .stat-meta { font-size: 12px; line-height: 1.6; }
  .overview-grid, .overview-main, .overview-aside { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .surface-header, .card-title { min-height: 60px; padding: 16px; }
  .surface-body, .card-body { padding: 16px; }
  .surface-card > .work-list, .surface-card > .quick-links, .surface-card > .recent-list, .surface-card > .readiness-list { padding: 16px; }
  .work-row { gap: 10px 12px; padding-block: 18px; }
  .work-icon { flex-basis: 36px; width: 36px; height: 40px; }
  .work-main { flex-basis: calc(100% - 48px); }
  .work-status { margin-left: 48px; }
  .work-amount { width: calc(100% - 48px); margin-left: 48px; margin-right: 0; }
  .work-action { min-height: 34px; }
  .overview-empty { min-height: 240px; padding: 28px 8px; }
  .recent-row { flex-wrap: wrap; gap: 8px 12px; }
  .recent-date { margin-left: 44px; }
  .form-row, .form-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .form-field input, .form-field select, .form-grid input, .form-grid select, .drawer-form input, .drawer-form select, .search input { min-height: 44px; }
  .context-panel { grid-template-columns: minmax(0, 1fr); }
  .subnav { margin: 20px 0; }
  .subnav button { min-height: 40px; padding-inline: 12px; font-size: 13px; }
  .metric-strip, .metric-strip:has(> .stat-cell:nth-child(3):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-cell { padding: 16px; }
  .stat-cell:nth-child(2n) { border-right: 0; }
  .stat-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
  .steps { padding: 16px 0; }
  .step { flex-basis: 120px; gap: 8px; padding-right: 8px; }
  .step:not(:first-child) { padding-left: 8px; }
  .step-index { width: 26px; height: 26px; flex-basis: 26px; }
  .step:not(:last-child)::after { min-width: 6px; }
  .allocation-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; }
  .allocation-row > :first-child { grid-column: 1 / -1; }
  .batch-header, .package-header { padding: 16px; }
  .package-rows { padding: 0 16px 16px; }
  .package-summary { gap: 14px; padding: 14px 16px; }
  .attachment-row { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  .attachment-row > .actions, .attachment-row > button { grid-column: 2; justify-self: start; justify-content: flex-start; }
  .sticky-actions { bottom: 8px; padding: 16px; }
  .sticky-actions .actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  .editor-panel, .setting-card { padding: 20px 16px; }
  .issues { display: flex; }
  .table-box > table { min-width: 600px; }
  .output-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 20px 16px; }
  .paper-scroll { padding: 16px; }
  .preview-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .preview-toolbar .actions { width: 100%; }
  .footer { align-items: flex-start; flex-wrap: wrap; }
  .scope-strip { gap: 16px; padding: 16px; }
  .tabs { gap: 20px; }
  .definition { grid-template-columns: 90px minmax(0, 1fr); gap: 12px; }
  .review-row { gap: 12px; }
  .review-row .actions { justify-content: flex-end; }
  dialog, dialog.wide-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 32px); padding: 24px 20px; }
  .drawer-dialog { width: 100%; max-height: 100dvh; padding: 24px 20px; }
  .toast { right: 16px; bottom: 16px; max-width: calc(100% - 32px); }
}
@media (max-width: 420px) {
  .content { padding-inline: 14px; }
  .overview-stat { padding: 14px 12px; }
  .stat-icon { width: 28px; height: 28px; }
  .overview-stats { gap: 10px; }
  .top-actions { gap: 8px; }
  .top-actions > .secondary { padding-inline: 8px; font-size: 12px; }
  .drawer-form .two { grid-template-columns: minmax(0, 1fr); }
  .surface-header { gap: 8px; }
}
