
:root {
  --bg: #eef3f8;
  --panel: #fff;
  --line: #d7e0ea;
  --line-strong: #b8c8d9;
  --ink: #0d1b2f;
  --muted: #607089;
  --blue: #1f63d7;
  --blue-soft: #e8f0ff;
  --green: #0f9f6e;
  --amber: #ad6a00;
  --red: #be2f2f;
  --dark: #0f1c2f;
  --dark-panel: #182a42;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 276px 1fr; }
.sidebar { background: #f8fbff; border-right: 1px solid var(--line); padding: 18px 16px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { display: flex; justify-content: space-between; gap: 10px; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 14px; }
.brand strong { display: block; font-size: 20px; }
.brand small, .nav-group-title, .muted { color: var(--muted); }
.env-pill { border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: white; color: #24415f; white-space: nowrap; }
.nav-group { margin: 14px 0 18px; }
.nav-group-title { font-size: 12px; margin: 0 0 6px; }
.nav-item { display: flex; justify-content: space-between; gap: 8px; align-items: center; min-height: 36px; padding: 8px 10px; border: 1px solid transparent; border-radius: 7px; margin: 4px 0; color: #20344f; }
.nav-item:hover, .nav-item.active { border-color: #9ec0f8; background: var(--blue-soft); color: #123f94; }
.nav-item small { color: #7c8ba1; font-size: 11px; }
.main { min-width: 0; max-width: 100%; overflow-x: clip; }
.topbar { height: 54px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; position: sticky; top: 0; z-index: 10; }
.topbar-title { display: flex; gap: 12px; align-items: center; font-weight: 700; }
.topbar-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; min-width: 0; }
.account-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 9px; border: 1px solid #d9e4f2; border-radius: 7px; background: #f8fbff; color: #334e68; font-size: 12px; white-space: nowrap; }
.account-chip strong { font-size: 13px; color: #11243d; }
.env-root { font-size: 12px; color: #65758b; padding: 6px 9px; border: 1px dashed #cdd9e8; border-radius: 7px; background: #fbfdff; white-space: nowrap; }
.workspace-tabs { background: #f7faff; border-bottom: 1px solid var(--line); padding: 8px 20px; display: flex; gap: 6px; align-items: center; overflow-x: auto; position: sticky; top: 54px; z-index: 9; }
.workspace-tabs .label { font-size: 12px; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.ws-tab { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 1px solid var(--line); border-radius: 7px 7px 0 0; background: white; color: #23405d; white-space: nowrap; overflow: hidden; }
.ws-tab.active { color: var(--blue); border-color: #8fb5f4; background: #fff; font-weight: 700; }
.ws-tab a { display: inline-flex; align-items: center; min-height: 32px; padding: 7px 4px 7px 10px; }
.tab-close { width: 24px; height: 32px; border: 0; border-left: 1px solid #edf2f7; background: transparent; color: #8aa0b9; cursor: pointer; }
.tab-close:hover { background: #eef4ff; color: #1f63d7; }
.tab-close-all { margin-left: auto; min-height: 32px; border: 1px solid #c6d6e8; border-radius: 6px; background: #fff; color: #33516f; padding: 0 10px; cursor: pointer; white-space: nowrap; }
.tab-close-all:hover { border-color: #8fb5f4; background: #eef4ff; color: #1f63d7; }
.content { padding: 18px 22px 56px; max-width: 1680px; min-width: 0; width: 100%; }
.page-head { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: 0; }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.page-head h1:focus,
.panel-title h2:focus,
.panel-title h3:focus {
  outline: none;
}
.head-actions, .toolbar, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { border: 1px solid var(--line-strong); background: #fff; border-radius: 6px; padding: 8px 12px; color: #16314d; cursor: pointer; min-height: 34px; }
.btn.primary { border-color: var(--blue); background: var(--blue); color: white; }
.btn.green { border-color: var(--green); background: var(--green); color: white; }
.btn.warn { border-color: #d79b3b; background: #fff8e8; color: #744400; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.panel h2, .panel h3 { margin: 0 0 10px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(360px, .6fr); gap: 14px; }
.three-col { display: grid; grid-template-columns: 290px minmax(0, 1fr) 330px; gap: 14px; align-items: stretch; }
.stat, .quick-card, .state-card { border: 1px solid var(--line); background: #fbfdff; border-radius: 8px; padding: 14px; min-height: 92px; }
.stat .num { font-size: 28px; font-weight: 800; margin-top: 8px; }
.stat.active { border-color: var(--blue); background: #f2f7ff; box-shadow: inset 0 0 0 1px rgba(43, 110, 246, .18); }
.quick-card strong { font-size: 18px; }
.quick-card p, .state-card p { color: var(--muted); margin: 8px 0 12px; line-height: 1.45; }
.filters { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.filter { border: 1px solid var(--line); border-radius: 7px; background: #fbfdff; padding: 8px; }
.filter label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.filter select, .filter input { width: 100%; border: 0; background: transparent; font-weight: 700; color: #132947; outline: none; }
.list-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 12px; }
.list-toolbar .filters { margin-bottom: 0; }
.list-toolbar[data-formula-row-filters] {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .9fr) minmax(0, 1.55fr) minmax(0, .8fr) minmax(0, .8fr) auto;
  gap: 8px;
  align-items: stretch;
}
.list-toolbar[data-formula-row-filters] > .filter {
  min-width: 0;
  padding: 6px 8px;
}
.list-toolbar[data-formula-row-filters] > .filter > label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-toolbar[data-formula-row-filters] :is(select, input) { min-width: 0; }
.list-toolbar[data-formula-row-filters] > .row-actions {
  align-self: end;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.formula-filter-help {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}
.template-search-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
}
.template-search-toolbar > .btn {
  min-width: 84px;
  align-self: stretch;
}
.template-asset-group {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  overflow: hidden;
}
.template-asset-group:first-child { margin-top: 0; }
.template-group-static,
.template-group-toggle {
  width: 100%;
  margin: 0;
  padding: 12px;
  border: 0;
  background: #f4f8fd;
}
.template-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.template-group-toggle:hover { background: #eaf3ff; }
.template-group-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.template-group-toggle > span:first-child,
.template-group-static > div { min-width: 0; }
.template-group-toggle strong { display: block; font-size: 15px; }
.template-group-toggle small,
.template-group-static small { display: block; margin-top: 3px; color: var(--muted); }
.template-group-state { color: #31506f; font-size: 12px; white-space: nowrap; }
.template-group-content { padding: 12px; }
.template-group-content[hidden] { display: none; }
.template-secondary-shortcuts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed #a9bfd7;
  border-radius: 8px;
  background: #f8fbff;
}
.template-secondary-shortcuts > p {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: #31506f;
  font-size: 12px;
}
.template-secondary-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.template-secondary-shortcut:hover { border-color: #7da7d0; background: #eef6ff; }
.template-secondary-shortcut:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.template-secondary-shortcut strong,
.template-secondary-shortcut small { display: block; }
.template-secondary-shortcut small,
.template-secondary-shortcut > span:last-child { color: var(--muted); font-size: 11px; }
.template-business-identity > strong { display: block; color: #24415f; }
.template-identity-details { margin-top: 5px; }
.template-identity-details > summary { font-size: 11px; }
.template-identity-details code { display: block; margin-top: 5px; font-size: 11px; }
.template-selected-detail { scroll-margin-top: 14px; }
.row-semantic-overview { display: grid; grid-template-columns: repeat(7, minmax(118px, 1fr)); gap: 8px; margin-bottom: 10px; }
.row-semantic-overview > div { display: grid; gap: 3px; min-width: 0; border: 1px solid #c9d8e6; border-radius: 8px; background: #f7fafc; padding: 9px 10px; }
.row-semantic-overview > div[data-tone="error"] { border-color: #d92d20; background: #fff1ef; color: #8f1f17; }
.row-semantic-overview span { color: #526a82; font-size: 11px; }
.row-semantic-overview strong { color: #17324d; font-size: 18px; }
.modal [data-derive-preview] .row-semantic-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.modal [data-derive-preview] pre { max-width: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.template-row-semantics-table { min-width: 1640px; }
.template-row-semantics-table td { vertical-align: top; }
.template-row-semantics-table td strong, .template-row-semantics-table td small { display: block; }
.template-row-semantics-table .row-source-details { min-width: 170px; }
.semantic-note { margin-top: 3px; color: #526a82; font-size: 11px; }
.semantic-neutral { color: #607890; }
.semantic-alert { color: #9a5b00; font-weight: 700; }
.semantic-error { color: #b42318; font-weight: 700; }
.bulk-preview-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bulk-excel-authoring-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  margin: 10px 0 12px;
  border: 1px solid #9CBFD1;
  border-radius: 8px;
  background: #F1F8FC;
  padding: 10px 12px;
}
.bulk-excel-authoring-flow strong,
.bulk-excel-authoring-flow span { display: block; }
.bulk-excel-authoring-flow div > span { margin-top: 3px; color: #405874; font-size: 12px; }
.bulk-excel-authoring-flow > [data-bulk-workbook-status] { grid-column: 1 / -1; color: #31506F; font-size: 12px; }
.bulk-tsv-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.bulk-tsv-label label { margin: 0; }
.bulk-preview-title h3,
.bulk-preview-title p { margin: 0; }
.bulk-preview-title p { margin-top: 4px; color: var(--muted); }
.bulk-preview-write-state {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid #80b89b;
  border-radius: 999px;
  background: #eef9f3;
  padding: 5px 9px;
  color: #17663f;
  font-size: 12px;
  font-weight: 800;
}
.bulk-preview-guidance {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border-left: 4px solid #2f8b62;
  border-radius: 6px;
  background: #f1faf5;
  padding: 10px 12px;
  color: #24415f;
}
.bulk-preview-guidance[data-tone="error"] { border-left-color: #b42318; background: #fff4f2; }
.bulk-preview-target-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.bulk-preview-target-grid > div {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
}
.bulk-preview-target-grid span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.bulk-preview-target-grid strong { display: block; color: #24415f; font-size: 12px; overflow-wrap: anywhere; }
.bulk-preview-checks { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 6px; color: #31506f; }
.bulk-preview-checks span { color: var(--muted); font-size: 12px; }
.bulk-preview-sequence-note { margin: 0 0 7px; color: #405874; font-size: 12px; line-height: 1.5; }
.bulk-preview-table-wrap { max-height: 320px; overflow: auto; }
.bulk-preview-table-wrap table { min-width: 620px; }
.bulk-preview-table-wrap th,
.bulk-preview-table-wrap td { padding: 7px 8px; font-size: 12px; }
.bulk-preview-table-wrap thead th { position: sticky; top: 0; z-index: 1; background: #edf3f8; }
.bulk-preview-row-status { display: inline-flex; border-radius: 999px; padding: 3px 7px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.bulk-preview-row-status[data-tone="pass"] { background: #eaf7f0; color: #17663f; }
.bulk-preview-row-status[data-tone="review"] { background: #fff2df; color: #8a4b08; }
.full-maintenance-flow { display: grid; gap: 12px; }
.full-maintenance-flow > section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
}
.full-maintenance-flow > section > h3,
.full-maintenance-flow > section > p { margin: 0; }
.full-maintenance-flow > section > p { margin: 4px 0 9px; color: #405874; line-height: 1.5; }
.full-maintenance-flow input[type="file"] { display: block; width: 100%; margin: 7px 0; border: 1px dashed #9cbfd1; border-radius: 7px; background: #f8fbff; padding: 10px; }
.full-maintenance-flow [data-full-maintenance-file-state] { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.full-maintenance-no-write { display: grid; gap: 4px; border-left: 4px solid #2f8b62; border-radius: 6px; background: #f1faf5; padding: 10px 12px; }
.full-maintenance-no-write[data-tone="error"] { border-left-color: #b42318; background: #fff4f2; }
.full-maintenance-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.full-maintenance-preview-grid > div { border: 1px solid var(--line); border-radius: 7px; background: #f8fbff; padding: 8px 10px; }
.full-maintenance-preview-grid span { display: block; color: var(--muted); font-size: 11px; }
.full-maintenance-preview-grid strong { display: block; margin-top: 3px; color: #24415f; font-size: 17px; }
.full-maintenance-issues { display: grid; gap: 6px; margin: 8px 0; padding: 0; list-style: none; }
.full-maintenance-issues li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; border-radius: 6px; padding: 7px 9px; }
.full-maintenance-issues li[data-tone="error"] { background: #fff0ed; color: #9f261c; }
.full-maintenance-issues li[data-tone="warning"] { background: #fff7e8; color: #7a4a00; }
.full-maintenance-diff-table { max-height: 330px; overflow: auto; }
.full-maintenance-diff-table table { min-width: 900px; }
.full-maintenance-diff-table thead th { position: sticky; top: 0; z-index: 1; }
.modal.focused-rule-package-modal { width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
[data-focused-rule-package] { display: grid; gap: 14px; color: #17324d; }
.focused-step-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.focused-step-nav li { border: 1px solid #c9d8e6; border-radius: 8px; background: #f7fafc; padding: 9px 12px; color: #526a82; font-weight: 700; }
.focused-step-nav li[aria-current="step"] { border-color: #0f766e; background: #e6f7f3; color: #0f5d56; }
.focused-no-write { display: grid; gap: 3px; border-left: 4px solid #0f766e; border-radius: 7px; background: #eefaf6; padding: 10px 12px; }
.focused-no-write span { color: #405874; font-size: 12px; }
.focused-range-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .8fr) minmax(240px, .7fr); gap: 12px; align-items: start; }
.focused-range-grid > section, .focused-export-contract { border: 1px solid #c9d8e6; border-radius: 9px; background: #fff; padding: 12px; }
.focused-range-grid h3, .focused-export-contract h3 { margin: 0 0 5px; }
.focused-range-grid p, .focused-export-contract p { margin: 4px 0 10px; color: #526a82; line-height: 1.45; }
.focused-check { display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.focused-source-list { display: grid; gap: 6px; max-height: 220px; overflow: auto; }
.focused-source-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; align-items: start; border-radius: 6px; background: #f7fafc; padding: 7px 8px; }
.focused-range-grid fieldset { display: grid; gap: 6px; margin: 10px 0 0; border: 1px solid #d7e1eb; border-radius: 7px; }
.focused-range-grid fieldset label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; align-items: center; }
.focused-range-grid select, .focused-range-grid input, .focused-rule-card select, .focused-rule-card input { width: 100%; margin-top: 4px; }
.focused-rule-card-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.focused-rule-card { display: grid; gap: 9px; border: 1px solid #bdd0e1; border-radius: 10px; background: #fff; padding: 12px; box-shadow: 0 2px 8px rgba(24, 58, 88, .05); }
.focused-rule-card header { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; border-radius: 7px; background: #eaf3fb; padding: 8px; }
.focused-rule-card header span { border-radius: 999px; background: #0b4f6c; color: #fff; padding: 3px 8px; font-size: 11px; }
.focused-rule-card dl { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 5px 8px; margin: 0; }
.focused-rule-card dt { color: #526a82; font-size: 12px; }
.focused-rule-card dd { margin: 0; }
.focused-recommendations { border-left: 3px solid #4f8ec8; border-radius: 6px; background: #f4f8fc; padding: 8px 10px; }
.focused-recommendations ol { margin: 6px 0 0 18px; padding: 0; }
.focused-recommendations li { margin-bottom: 6px; }
.focused-recommendations span, .focused-recommendations small { display: block; }
.focused-recommendations small { color: #526a82; }
.focused-local-check { border-radius: 6px; background: #e9f8ef; color: #17623d; padding: 7px 9px; font-weight: 700; }
.focused-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.focused-summary-grid > div { border: 1px solid #c9d8e6; border-radius: 8px; background: #f7fafc; padding: 10px; }
.focused-summary-grid span, .focused-summary-grid strong { display: block; }
.focused-summary-grid span { color: #526a82; font-size: 11px; }
.focused-summary-grid strong { margin-top: 4px; font-size: 17px; }
.focused-blocked { border-radius: 6px; background: #fff1ef; color: #9f261c !important; padding: 8px; }
.focused-footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; border-top: 1px solid #d7e1eb; padding-top: 10px; }
.focused-footer > span { margin-right: auto; color: #526a82; }

/* M50-C6-R2: customer-focused row + formula maintenance full chain. */
body.focused-r2-modal-open { overflow: hidden; }
.modal.focused-maintenance-r2-modal { width: min(92vw, 1720px); height: min(90vh, 1080px); max-height: 90vh; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.modal.focused-maintenance-r2-modal.is-fullscreen { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0; }
.focused-maintenance-r2-modal [data-global-template-modal-body] { min-height: 0; overflow: hidden; padding-bottom: 0; }
[data-focused-maintenance-r2] { height: 100%; min-height: 0; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: 10px; color: #17324d; }
[data-focused-maintenance-r2][data-r2-step="2"], [data-focused-maintenance-r2][data-r2-step="3"] { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.focused-r2-step3-scroll { min-height: 0; display: grid; align-content: start; gap: 10px; overflow: auto; padding-right: 2px; }
.focused-r2-topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.focused-r2-operation-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.focused-r2-operation-tabs button { border: 1px solid #c9d8e6; border-radius: 8px; background: #f7fafc; color: #405874; padding: 9px 12px; font-weight: 700; text-align: left; cursor: pointer; }
.focused-r2-operation-tabs button[aria-selected="true"] { border-color: #0f766e; background: #e6f7f3; color: #0f5d56; box-shadow: inset 0 0 0 1px #0f766e; }
.focused-r2-workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px); gap: 12px; overflow: hidden; }
.focused-r2-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 9px; overflow: hidden; }
.focused-r2-basket { align-self: stretch; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 9px; border: 1px solid #9fb7ca; border-radius: 10px; background: #f4f8fc; padding: 11px; overflow: hidden; }
.focused-r2-basket header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.focused-r2-basket header span { border-radius: 999px; background: #0b4f6c; color: #fff; padding: 3px 8px; font-size: 11px; }
.focused-r2-basket dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; margin: 0; font-size: 12px; }
.focused-r2-basket dt { color: #526a82; }
.focused-r2-basket dd { margin: 0; font-weight: 700; text-align: right; }
.focused-r2-basket-list { min-height: 0; display: grid; align-content: start; gap: 5px; overflow: auto; }
.focused-r2-basket-list span { border-radius: 6px; background: #fff; padding: 6px 7px; font-size: 11px; line-height: 1.35; }
.focused-r2-filters { display: grid; grid-template-columns: minmax(260px, 1.5fr) minmax(170px, .8fr) minmax(180px, .8fr) auto; gap: 8px; align-items: end; }
.focused-r2-filters label, .focused-r2-parent-layout label, .focused-r2-card-fields label { display: grid; gap: 4px; color: #405874; font-size: 12px; font-weight: 700; }
.focused-r2-filters input, .focused-r2-filters select, .focused-r2-parent-layout input, .focused-r2-card-fields input, .focused-r2-card-fields select { width: 100%; }
.focused-r2-inline-check { display: inline-flex !important; grid-template-columns: auto minmax(0, 1fr); gap: 6px !important; align-items: center; white-space: nowrap; }
.focused-r2-inline-check input { width: auto; }
.focused-r2-table-scroll { min-height: 0; overflow: auto; border: 1px solid #c9d8e6; border-radius: 8px; background: #fff; }
.focused-r2-row-table { margin: 0; min-width: 980px; }
.focused-r2-row-table thead { position: sticky; top: 0; z-index: 2; }
.focused-r2-row-table th { background: #eaf3fb; color: #23415f; }
.focused-r2-row-table td, .focused-r2-row-table th { padding: 7px 8px; vertical-align: top; }
.focused-r2-row-table td strong, .focused-r2-row-table td small { display: block; }
.focused-r2-row-table td small { margin-top: 3px; color: #607890; }
.focused-r2-target-cell { display: grid; justify-items: center; gap: 3px; color: #405874; font-size: 11px; }
.focused-r2-target-cell input { width: auto; }
.focused-r2-field-detail-table { min-width: 1120px; table-layout: fixed; }
.focused-r2-field-detail-table th:nth-child(1) { width: 20%; }
.focused-r2-field-detail-table th:nth-child(2) { width: 24%; }
.focused-r2-field-detail-table th:nth-child(3) { width: 56%; }
.focused-r2-field-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 7px; }
.focused-r2-field-card { grid-template-columns: auto minmax(0, 1fr); justify-items: stretch; align-items: start; padding: 7px 8px; border: 1px solid #cad8e5; border-radius: 7px; background: #f8fbfd; text-align: left; }
.focused-r2-field-card:has(input:checked) { border-color: #2e6f9e; background: #eaf4fb; box-shadow: inset 0 0 0 1px #2e6f9e; }
.focused-r2-field-card:has(input:disabled) { background: #f2f3f4; color: #6d7680; }
.focused-r2-field-card span, .focused-r2-field-card strong, .focused-r2-field-card small, .focused-r2-field-card em { display: block; min-width: 0; }
.focused-r2-field-card small { margin-top: 2px; line-height: 1.35; overflow-wrap: anywhere; }
.focused-r2-field-card em { margin-top: 4px; color: #9a5b00; font-style: normal; }
@media (max-width: 1366px) {
  .focused-r2-field-grid { grid-template-columns: 1fr; }
  .focused-r2-field-detail-table { min-width: 980px; }
}
.focused-r2-pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; color: #526a82; font-size: 12px; }
.focused-r2-pagination > span { margin-right: auto; }
.focused-r2-parent-layout { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .55fr); gap: 12px; overflow: hidden; }
.focused-r2-parent-layout > section { min-height: 0; border: 1px solid #c9d8e6; border-radius: 9px; background: #fff; padding: 11px; }
.focused-r2-parent-list { min-height: 0; max-height: calc(90vh - 360px); display: grid; align-content: start; gap: 5px; margin-top: 8px; overflow: auto; }
.focused-r2-parent-list label { grid-template-columns: auto minmax(0, 1fr); align-items: start; border-radius: 7px; background: #f7fafc; padding: 7px; cursor: pointer; }
.focused-r2-parent-list small, .focused-r2-parent-list strong { display: block; }
.focused-r2-parent-list small { color: #607890; font-weight: 400; }
.focused-r2-parent-config { align-content: start; display: grid; gap: 12px; }
.focused-r2-parent-config h3, .focused-r2-parent-config p { margin: 0; }
.focused-r2-parent-config p { color: #526a82; }
.focused-r2-parent-config div { display: grid; gap: 4px; border-radius: 8px; background: #eef7fb; padding: 10px; }
.focused-r2-footer { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; border-top: 1px solid #c9d8e6; background: #fff; padding: 9px 0 10px; }
.focused-r2-footer > span { margin-right: auto; color: #526a82; font-size: 12px; }
.focused-r2-card-workspace { min-height: 0; display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: 12px; overflow: hidden; }
.focused-r2-card-list { min-height: 0; display: grid; align-content: start; gap: 6px; overflow: auto; padding-right: 2px; }
.focused-r2-card-list button { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 8px; align-items: center; border: 1px solid #c9d8e6; border-radius: 8px; background: #fff; color: #17324d; padding: 8px; text-align: left; cursor: pointer; }
.focused-r2-card-list button[aria-current="true"] { border-color: #0f766e; background: #e6f7f3; box-shadow: inset 3px 0 #0f766e; }
.focused-r2-card-list button span { grid-row: 1 / span 2; border-radius: 999px; background: #0b4f6c; color: #fff; padding: 3px 7px; font-size: 10px; }
.focused-r2-card-list button small { color: #607890; }
.focused-r2-active-card { min-height: 0; display: grid; align-content: start; gap: 10px; border: 1px solid #9fb7ca; border-radius: 10px; background: #fff; padding: 12px; overflow: auto; }
.focused-r2-active-card header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; border-radius: 8px; background: #eaf3fb; padding: 9px; }
.focused-r2-active-card header > span { border-radius: 999px; background: #0b4f6c; color: #fff; padding: 4px 8px; font-size: 11px; }
.focused-r2-active-card h3 { margin: 0; font-size: 16px; }
.focused-r2-active-card dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 5px 9px; margin: 0; }
.focused-r2-active-card dt { color: #526a82; font-size: 12px; }
.focused-r2-active-card dd { margin: 0; }
.focused-r2-card-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.focused-r2-card-preview { border-left: 4px solid #0f766e; border-radius: 7px; background: #eefaf6; padding: 9px 11px; }
.focused-r2-card-preview p { margin: 4px 0 0; color: #405874; }
.focused-r2-active-card .focused-recommendations > div { display: grid; gap: 6px; margin-top: 6px; }
.focused-r2-active-card .focused-recommendations > summary { cursor: pointer; font-weight: 700; color: #27445f; }
.focused-r2-active-card .focused-recommendations button { border: 1px solid #bdd0e1; border-radius: 7px; background: #fff; padding: 7px 9px; color: #17324d; text-align: left; cursor: pointer; }
.focused-r2-active-card .focused-recommendations button:hover { border-color: #0f766e; background: #f2fbf8; }
.focused-r2-active-card .focused-recommendations span, .focused-r2-active-card .focused-recommendations small { display: block; }
.focused-r2-active-card .focused-recommendations small { margin-top: 3px; color: #526a82; }
.focused-r2-export-upload { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.focused-r2-export-upload section { display: grid; align-content: start; gap: 8px; border: 1px solid #c9d8e6; border-radius: 9px; background: #fff; padding: 11px; }
.focused-r2-export-upload h3, .focused-r2-export-upload p { margin: 0; }
.focused-r2-export-upload p { color: #526a82; }
.focused-r2-preview-panel { height: clamp(240px, 36vh, 420px); min-height: 240px; overflow: auto; }
.focused-r2-not-written, .focused-r2-readback, .focused-r2-blocker { display: grid; gap: 4px; border-left: 4px solid #0f766e; border-radius: 8px; background: #eefaf6; padding: 10px 12px; }
.focused-r2-readback[data-tone="neutral"] { border-left-color: #526a82; background: #f3f6fa; }
.focused-r2-file-summary, .focused-r2-fresh-rules { display: grid; gap: 3px; border: 1px solid #c9d8e6; border-radius: 8px; background: #f8fbfe; padding: 9px 11px; }
.focused-r2-file-summary small { color: #526a82; }
.focused-r2-fresh-rules span { color: #27445f; }
.focused-r2-terminal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.focused-r2-history { display: grid; gap: 8px; margin-bottom: 10px; border: 1px solid #c9d8e6; border-radius: 9px; background: #f8fbfe; padding: 10px 12px; }
.focused-r2-history header, .focused-r2-history li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.focused-r2-history header div, .focused-r2-history li div { display: grid; gap: 3px; min-width: 0; }
.focused-r2-history header span, .focused-r2-history li span, .focused-r2-history li small { color: #526a82; }
.focused-r2-history ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.focused-r2-history li { border-top: 1px solid #dce6ef; padding-top: 7px; }
.focused-r2-history li[data-status="undone"] { opacity: .76; }
.focused-r2-history li .btn { flex: 0 0 auto; }
.focused-r2-history-confirm { display: flex; flex: 0 0 auto; gap: 6px; }
.focused-r2-not-written[data-tone="error"], .focused-r2-blocker { border-left-color: #b42318; background: #fff1ef; color: #8f1f17; }
.focused-r2-preview-list { display: grid; gap: 6px; margin: 9px 0; }
.focused-r2-preview-list label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: start; border: 1px solid #c9d8e6; border-radius: 7px; background: #fff; padding: 8px; }
.focused-r2-preview-list span strong, .focused-r2-preview-list span small { display: block; }
.focused-r2-preview-list span small { margin-top: 3px; color: #526a82; }
.focused-r2-preview-list em { border-radius: 999px; background: #eef2f6; padding: 3px 7px; font-size: 10px; font-style: normal; }
.focused-r2-issues { display: grid; gap: 5px; margin: 8px 0; padding: 0; list-style: none; }
.focused-r2-issues li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; border-radius: 7px; background: #fff1ef; color: #8f1f17; padding: 7px 9px; }
.focused-r2-loading, .focused-r2-empty { display: grid; place-content: center; gap: 6px; min-height: 320px; color: #405874; text-align: center; }

@media (max-width: 1600px) {
  .modal.focused-maintenance-r2-modal { width: 92vw; height: 92vh; max-height: 92vh; }
  .focused-r2-workspace { grid-template-columns: minmax(0, 1fr) 250px; }
  .focused-r2-card-workspace { grid-template-columns: 270px minmax(0, 1fr); }
  .focused-r2-card-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .modal.focused-maintenance-r2-modal { width: 96vw; height: 94vh; max-height: 94vh; }
  .focused-r2-workspace { grid-template-columns: minmax(0, 1fr); }
  .focused-r2-basket { max-height: 170px; grid-template-columns: minmax(210px, .5fr) minmax(250px, .8fr) minmax(0, 1fr); grid-template-rows: auto; }
  .focused-r2-card-workspace { grid-template-columns: 230px minmax(0, 1fr); }
  .focused-r2-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .modal.focused-maintenance-r2-modal { width: 100vw; height: 100vh; max-height: none; border-radius: 0; }
  .focused-r2-operation-tabs, .focused-r2-export-upload, .focused-r2-card-fields { grid-template-columns: 1fr; }
  .focused-r2-card-workspace, .focused-r2-parent-layout { grid-template-columns: 1fr; overflow: auto; }
  .focused-r2-card-list { max-height: 180px; }
  .focused-r2-active-card { overflow: visible; }
  .focused-r2-basket { max-height: 200px; display: grid; grid-template-columns: 1fr; }
  .focused-step-nav li { padding: 7px; font-size: 11px; }
}
.selected-template-identities {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 5px 8px;
  align-items: center;
  margin-top: 7px;
}
.selected-template-identities > span:not(.long-identity) { color: var(--muted); font-size: 11px; }
.identity-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; }
.long-identity {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  color: #1d3349;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  user-select: text;
}
.long-identity:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.long-identity.is-missing,
.payload-fallback { color: var(--muted); font-size: 12px; }
.identity-copy { padding: 4px 8px; font-size: 11px; }
.formula-business-contract { margin-bottom: 12px; }
.formula-business-contract > p { margin: 7px 0; }
.formula-safety-notice {
  padding: 8px 10px;
  border-left: 3px solid #c27216;
  background: #fff8e7;
  color: #6f430d;
}
.technical-details { max-width: 100%; }
.technical-details > summary {
  color: #1f5f9d;
  font-weight: 700;
  cursor: pointer;
}
.technical-details[open] > summary { margin-bottom: 8px; }
.technical-details dl { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 6px 10px; margin: 8px 0 0; }
.technical-details dt { color: var(--muted); }
.technical-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.technical-details code { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1320px) {
  .list-toolbar[data-formula-row-filters] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .list-toolbar[data-formula-row-filters] > .row-actions { flex-wrap: wrap; justify-content: flex-start; }
}
@media (max-width: 720px) {
  .template-search-toolbar { grid-template-columns: 1fr; }
  .template-group-toggle { align-items: flex-start; flex-direction: column; }
  .template-group-state { white-space: normal; }
  .template-secondary-shortcuts { grid-template-columns: 1fr; }
  .template-secondary-shortcuts > p { display: block; }
  .template-secondary-shortcuts > p span { display: block; margin-top: 3px; }
  .selected-template-identities { grid-template-columns: 1fr; }
  .bulk-preview-target-grid { grid-template-columns: 1fr; }
  .bulk-preview-checks { align-items: flex-start; flex-direction: column; }
  .full-maintenance-preview-grid { grid-template-columns: 1fr; }
  .full-maintenance-issues li { grid-template-columns: 1fr; }
  .bulk-excel-authoring-flow { grid-template-columns: 1fr; }
  .bulk-excel-authoring-flow > [data-bulk-workbook-status] { grid-column: 1; }
  .focused-range-grid, .focused-rule-card-list, .focused-summary-grid { grid-template-columns: 1fr; }
  .bulk-tsv-label { align-items: flex-start; flex-direction: column; }
  .technical-details dl { grid-template-columns: 1fr; }
}
.list-summary { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--muted); white-space: nowrap; }
.page-size { border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 7px 9px; color: #1b3654; }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px 0; color: var(--muted); }
.footer-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.page-size-control { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: #33516f; }
.page-size-control .page-size { min-width: 76px; }
.pager { display: flex; align-items: center; gap: 6px; }
.page-btn { min-width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #24415f; }
.page-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.page-btn:disabled { cursor: default; color: #8ea0b4; background: #f4f7fb; }
.table-wrap { overflow-x: auto; overflow-y: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
th, td { border-bottom: 1px solid #e7edf4; padding: 10px 12px; text-align: left; vertical-align: top; }
th { background: #f2f6fb; color: #3a4f68; font-size: 12px; font-weight: 700; }
tr:hover td { background: #fbfdff; }
tr.selected td { background: #eef5ff; box-shadow: inset 0 1px 0 #d7e7ff, inset 0 -1px 0 #d7e7ff; }
.badge { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; font-size: 12px; color: #29435f; background: white; white-space: nowrap; }
.badge.ok { border-color: #a6dbc5; background: #eaf8f2; color: #0b6b4d; }
.badge.wait { border-color: #f0c480; background: #fff7e6; color: #855200; }
.badge.err { border-color: #f1aaa7; background: #fff0ef; color: #9a2926; }
.badge.info { border-color: #a9c4f7; background: #edf4ff; color: #174d9e; }
.anno { display: inline-flex; margin-left: 6px; font-size: 10px; font-weight: 700; color: #55708d; background: #eef4fb; border: 1px solid #d2dfec; border-radius: 4px; padding: 1px 4px; vertical-align: middle; }
.runtime-pill { display: inline-flex; margin-left: 8px; font-size: 11px; color: #5e3c00; background: #fff8df; border: 1px solid #e7c462; padding: 2px 6px; border-radius: 5px; }
.stage-grid { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 10px; }
.stage { position: relative; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); background: #fff; border-radius: 8px; padding: 12px; min-height: 132px; cursor: pointer; }
.stage.done { border-left-color: var(--green); }
.stage.active { border-color: #2b6ef6; border-left-color: var(--blue); background: #edf5ff; box-shadow: 0 0 0 2px rgba(43, 110, 246, .24) inset; }
.stage .no { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; background: #e8f0ff; color: var(--blue); font-weight: 800; margin-bottom: 8px; }
.stage strong { display: block; font-size: 17px; }
.stage small { color: var(--muted); display: block; margin: 8px 0; min-height: 34px; }
.detail-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.detail-tab { padding: 9px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 7px 7px 0 0; color: #29435f; cursor: pointer; white-space: nowrap; background: transparent; }
.detail-tab.active { border-color: var(--line); background: #fff; color: var(--blue); font-weight: 700; }
.page07-secondary-tabs { border-bottom-style: dashed; margin-top: -4px; }
.page07-secondary-tabs .detail-tab { font-size: 13px; color: #4d6178; }
.page07-context .state-card p,
.page07-export-log td { word-break: break-word; }
.page07-counts .stat .num { min-height: 34px; }
.page07-filters { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.page07-actions { align-self: stretch; align-items: end; }
.page07-applied {
  display: flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid #d4e2f1;
  background: #f8fbff;
  color: #314a66;
  border-radius: 7px;
  padding: 7px 10px;
  margin: -4px 0 10px;
}
.page07-state {
  border: 1px solid #bdd2ef;
  background: #f3f8ff;
  color: #23405d;
  border-radius: 7px;
  padding: 9px 11px;
  margin-bottom: 10px;
}
.page07-state.is-error { border-color: #e9a7a4; background: #fff4f3; color: #8b2522; }
.page07-export-log { margin-top: 12px; }
.page07-export-progress {
  border: 1px solid #d4e2f1;
  border-radius: 7px;
  padding: 8px 10px;
  color: #314a66;
  background: #f8fbff;
}
.page07-universal-panel {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px 12px;
}
.page07-purchase-status-help {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fffaf0;
  color: #5f4a1c;
}
.page07-purchase-status-help[hidden] {
  display: none !important;
}
.page07-purchase-status-help > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.page07-purchase-status-help p {
  margin: 0;
  line-height: 1.55;
}
.page07-universal-filter {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 2fr) auto;
  gap: 12px;
  align-items: center;
}
.page07-universal-filter strong,
.page07-universal-filter span {
  display: block;
}
.page07-universal-filter > div:first-child span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}
.page07-status-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.page07-status-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #24364d;
  font-weight: 700;
}
.page07-status-options input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}
.template-selection-strip,
.template-rule-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #b9cef0;
  background: #f5f9ff;
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0 12px;
}
.template-selection-strip span,
.template-rule-head span,
.template-selection-strip small,
.template-rule-head small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.template-selection-strip strong,
.template-rule-head strong {
  display: block;
  color: #123f94;
  font-size: 18px;
}
.tree-node { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 8px 6px; border-bottom: 1px solid #e8eef6; }
.tree-node .plus { width: 20px; height: 20px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; text-align: center; line-height: 18px; font-weight: 800; }
.tree-node.l2 { padding-left: 26px; }
.tree-node.l3 { padding-left: 52px; }
.dark-detail { background: var(--dark); color: white; border-color: #243c5c; }
.dark-detail .box { border: 1px solid #2d4768; background: var(--dark-panel); border-radius: 7px; padding: 12px; margin: 8px 0; }
.dark-detail small { color: #a7bad0; }
.rule-detail {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #fbfdff;
  margin: 8px 0;
}
.rule-detail summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
}
.rule-detail p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}
.drawer-mask, .modal-mask { position: fixed; inset: 0; background: rgba(12, 22, 36, .32); z-index: 80; display: none; }
.drawer { position: fixed; right: -620px; top: 0; width: min(620px, 96vw); height: 100vh; background: #fff; border-left: 1px solid var(--line); z-index: 90; padding: 20px; overflow: auto; transition: right .18s ease; }
.drawer.open { right: 0; }
.drawer-mask.open, .modal-mask.open { display: block; }
.drawer[data-force-open="1"] { right: 0 !important; }
.drawer-mask[data-force-open="1"],
.modal-mask[data-force-open="1"] { display: block !important; }
.modal[data-force-open="1"] { display: block !important; }
.m27-bizchain-v2 .drawer:has([data-drawer-body] > .m27-action-card) { right: 0 !important; }
.m27-bizchain-v2 .drawer-mask:has(+ .drawer [data-drawer-body] > .m27-action-card) { display: block !important; }
.m27-bizchain-v2 .modal:has([data-modal-body] > .m27-action-card) { display: block !important; }
.m27-bizchain-v2 .modal-mask:has(+ .modal [data-modal-body] > .m27-action-card) { display: block !important; }
.drawer-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, 92vw); max-height: 86vh; overflow: auto; z-index: 95; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: none; box-shadow: 0 18px 48px rgba(14, 31, 51, .25); }
.modal.wide-modal { width: min(80vw, 1400px); max-height: 88vh; }
.m27-bizchain-v2 .modal:has(.bom-tree-preview) {
  width: 80vw !important;
  max-height: 88vh;
}
.m27-bizchain-v2 .modal.embedded-page-modal {
  width: min(92vw, 1680px) !important;
  max-height: 90vh;
}
.m27-bizchain-v2 .modal.embedded-page-modal [data-modal-body] {
  height: min(78vh, 980px);
}
.modal.open { display: block; }
.modal.focused-maintenance-r2-modal.open { display: grid; }
.modal.focused-maintenance-r2-modal.open > [data-global-template-modal-body] { min-height: 0; height: 100%; overflow: hidden; }
@media (max-width: 680px) {
  .modal {
    width: calc(100vw - 20px);
    padding: 16px;
  }
  .modal .drawer-head {
    align-items: center;
  }
  .modal .drawer-head h2 {
    font-size: 21px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .modal .drawer-head [data-close] {
    flex: 0 0 auto;
    min-width: 58px;
  }
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-field { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: #fbfdff; }
.form-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 0; outline: none; background: transparent; min-height: 26px; }
.timeline { border-left: 2px solid var(--line); margin-left: 10px; padding-left: 16px; }
.timeline .item { position: relative; padding: 0 0 14px; }
.timeline .item::before { content: ""; position: absolute; left: -23px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.empty { border: 1px dashed var(--line-strong); background: #fbfdff; color: var(--muted); padding: 18px; border-radius: 8px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #10203a; color: white; padding: 10px 14px; border-radius: 999px; display: none; z-index: 120; }
.toast.open { display: block; }
.page08-return-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #c7d6e8;
  border-radius: 8px;
  background: #f8fbff;
}
.page08-related-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.page08-related-links > span {
  color: var(--muted);
  font-size: 12px;
}
.page08-read-state {
  border-color: #efb5b5;
  background: #fff2f2;
  color: #8a1f1f;
}
.page08-read-state strong {
  display: block;
  margin-bottom: 10px;
}
body[data-page="BOMOVERALL"] .page02-truth-strip,
body[data-page="LIST"] .page07-context,
body[data-page="MAT"] .page09-context,
body[data-page="TEMPLATE"] .template-selection-strip {
  min-width: 0;
}
body[data-page="BOMOVERALL"] .page02-truth-strip > *,
body[data-page="LIST"] .page07-context *,
body[data-page="MAT"] .page09-context *,
body[data-page="TEMPLATE"] .template-selection-strip * {
  min-width: 0;
  overflow-wrap: anywhere;
}
body[data-page="BOMOVERALL"] .page02-table-panel,
body[data-page="BOMOVERALL"] .page02-controls,
body[data-page="BOMOVERALL"] .page02-truth-panel {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
body[data-page="BOMOVERALL"] .page02-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}
body[data-page="BOMOVERALL"] .page02-bom-table {
  width: max-content;
  min-width: 1180px;
  max-width: none;
}
body[data-page="BOMOVERALL"] .page02-head,
body[data-page="BOMOVERALL"] .panel-title {
  min-width: 0;
  flex-wrap: wrap;
}
body[data-page="BOMOVERALL"] .page02-filter-grid {
  min-width: 0;
}
.m27-closure-rail,
.m27-page-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #c7d6e8;
  background: #f8fbff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.m27-page-controls {
  align-items: flex-start;
}
.m27-closure-rail strong,
.m27-controls-title {
  color: #10294a;
  margin-right: 8px;
}
.m27-closure-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.m27-action-card {
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 8px;
  padding: 14px;
}

.template-row-edit-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 16px -2px -2px;
  padding: 12px 2px 2px;
  border-top: 1px solid #d7e1eb;
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), #fff 28%);
}
.m27-action-card h3 {
  margin: 0 0 8px;
}
.readonly-disabled {
  border-color: #e3b767 !important;
  background: #fff8e8 !important;
  color: #7b4b00 !important;
}
.tree-node.selected {
  background: #eaf2ff;
  border-left: 3px solid var(--blue);
}
[data-filter-changed="1"] {
  box-shadow: 0 0 0 2px #d9e8ff inset;
}
[data-closure-last-action][data-tone="error"] {
  border-color: #f1aaa7;
  background: #fff0ef;
  color: #9a2926;
}
.bizchain-runtime-panel {
  border-left: 4px solid var(--blue);
}
.bizchain-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.bizchain-context-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.bizchain-task-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
  margin: 12px 0;
}
.bizchain-task-list-head,
.bizchain-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bizchain-task-list-head {
  color: var(--muted);
  margin-bottom: 8px;
}
.bizchain-task-list-head strong {
  color: var(--ink);
}
.bizchain-task-item {
  width: 100%;
  border: 1px solid #bcd0ef;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
}
.bizchain-task-item.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px #e6f0ff inset;
}
.bizchain-task-item span,
.bizchain-task-item small {
  display: block;
}
.bizchain-task-item small,
.bizchain-task-list-head span,
.bizchain-task-item em {
  color: var(--muted);
  font-style: normal;
}
.bizchain-task-item b {
  color: var(--blue);
}
.bizchain-task-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: #fff;
}
.bizchain-task-board {
  padding: 14px;
  background: #fff;
}
.bizchain-task-count {
  color: var(--blue);
  white-space: nowrap;
}
.bizchain-task-board-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 12px;
  align-items: stretch;
}
.bizchain-task-card {
  width: 100%;
  border: 1px solid #9ebcf2;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}
.bizchain-task-card.selected {
  box-shadow: 0 0 0 2px #e5efff inset;
}
.bizchain-task-card-top,
.bizchain-task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bizchain-task-card-top strong {
  font-size: 16px;
}
.bizchain-task-card-top em {
  border: 1px solid #9ed4c3;
  border-radius: 999px;
  background: #ecfff7;
  color: #137a58;
  font-style: normal;
  padding: 3px 8px;
  white-space: nowrap;
}
.bizchain-task-card small {
  display: block;
  margin: 8px 0 10px;
  color: var(--muted);
}
.bizchain-task-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4edf8;
  margin-bottom: 10px;
}
.bizchain-task-progress span {
  display: block;
  height: 100%;
  background: var(--blue);
}
.bizchain-task-meta {
  color: #26425f;
}
.bizchain-task-meta b {
  color: var(--blue);
  white-space: nowrap;
}
.bizchain-task-next-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}
.bizchain-task-next-list strong {
  display: block;
  margin-bottom: 8px;
}
.bizchain-task-next-list ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bizchain-task-next-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e3ebf5;
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
}
.bizchain-task-next-list li.active {
  border-color: #7eafff;
  background: #eef5ff;
  box-shadow: inset 3px 0 0 var(--blue);
}
.bizchain-task-next-list li.active span,
.bizchain-task-next-list li.active em {
  color: #124eb8;
  font-weight: 700;
}
.bizchain-task-next-list em {
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
}
.bizchain-context-grid > div {
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: 8px;
  padding: 10px;
}
.bizchain-context-grid span,
.bizchain-proof-log span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.bizchain-context-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  word-break: break-word;
}
.bizchain-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.m27-bizchain-v2 .page-head .head-actions,
.m27-bizchain-v2 .m27-closure-rail,
.m27-bizchain-v2 .m27-page-controls {
  display: none !important;
}
.m27-bizchain-v2 .process-flow-panel .toolbar {
  display: none !important;
}
.m27-bizchain-v2 .process-flow-panel .panel-title {
  margin-bottom: 14px;
}
.m27-bizchain-v2 .stage-grid {
  grid-template-columns: repeat(7, minmax(132px, 1fr));
}
.m27-bizchain-v2 .stage {
  cursor: default;
  pointer-events: none;
}
.m27-bizchain-v2 .stage:hover {
  background: #fff;
}
.m27-bizchain-v2 .stage::after {
  content: "流程展示";
  position: absolute;
  right: 10px;
  top: 10px;
  color: #6b7d92;
  font-size: 11px;
}
.m27-bizchain-v2 .stage.active::after {
  content: "当前步骤";
  color: #0f55d6;
  font-weight: 800;
}
.m27-bizchain-v2 .bizchain-action-bar {
  padding-top: 2px;
}
.bizchain-modal-footer {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.bizchain-step-guidance {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  background: #f7fbff;
}
.bizchain-step-guidance strong {
  color: var(--ink);
}
.bizchain-step-guidance span {
  color: var(--muted);
  line-height: 1.5;
}
.m27-bizchain-v2 .bizchain-action-bar .disabled-action,
.m27-bizchain-v2 .bizchain-action-bar button:disabled {
  border-color: #cfd9e6;
  background: #eef3f8;
  color: #7a8797;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
  filter: grayscale(.2);
}
.m27-bizchain-v2 .bizchain-action-bar .done-action {
  background: #f3f7fb;
  color: #6b7b8f;
}
.m27-bizchain-v2 .bizchain-action-bar .current-action {
  border-color: #1f5fdb;
  background: #1f5fdb;
  color: #fff;
  box-shadow: 0 4px 10px rgba(31, 95, 219, .22);
}
.m27-bizchain-v2 .shell {
  grid-template-columns: 172px minmax(0, 1fr);
}
.m27-bizchain-v2 .sidebar {
  padding: 16px 12px;
}
.m27-bizchain-v2 .brand {
  margin-bottom: 10px;
}
.m27-bizchain-v2 .brand small,
.m27-bizchain-v2 .env-pill,
.m27-bizchain-v2 .sidebar > .muted,
.m27-bizchain-v2 .nav-group-title,
.m27-bizchain-v2 .nav-item small,
.m27-bizchain-v2 .topbar-actions,
.m27-bizchain-v2 .workspace-tabs,
.m27-bizchain-v2 .runtime-pill,
.m27-bizchain-v2 .anno,
.m27-bizchain-v2 .m28-context-strip,
.m27-bizchain-v2 [data-m28-context-strip],
.m27-bizchain-v2 .process-flow-panel,
.m27-bizchain-v2 .two-col {
  display: none !important;
}
.m27-bizchain-v2 .nav-group {
  margin: 0;
}
.m27-bizchain-v2 .nav-group:not(:has(.nav-item[href*="bom-business.html"]:not([href*="new=1"]):not([href*="#params"]))) {
  display: none !important;
}
.m27-bizchain-v2 nav[data-m30-core-nav="1"] .nav-group {
  display: block !important;
}
.m27-bizchain-v2 .nav-item {
  display: none !important;
}
.m27-bizchain-v2 .nav-item[data-customer-nav-key] {
  display: flex !important;
}
.m27-bizchain-v2 .nav-item[href*="bom-business.html"]:not([href*="new=1"]):not([href*="#params"]) {
  display: flex !important;
}
.m27-bizchain-v2[data-biz-has-current-order="0"] .nav-item[href*="bom-business.html?new=1"] {
  display: flex !important;
}
.m27-bizchain-v2 .nav-item.active {
  justify-content: center;
  min-height: 40px;
  font-weight: 800;
}
.m27-bizchain-v2 .topbar {
  height: 48px;
}
.m27-bizchain-v2 .content {
  max-width: 1460px;
  padding-top: 14px;
}
.m27-bizchain-v2 .page-head {
  margin-bottom: 12px;
  padding: 14px 16px;
}
.m27-bizchain-v2 .page-head h1 {
  font-size: 24px;
}
.m27-bizchain-v2 .bizchain-runtime-panel {
  border-left: 0;
  padding: 16px;
}
.m27-bizchain-v2 .bizchain-panel-head {
  margin-bottom: 10px;
}
.m27-bizchain-v2 .bizchain-panel-head h2 {
  font-size: 20px;
  margin-bottom: 4px;
}
.m27-bizchain-v2 .bizchain-task-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin: 10px 0;
}
.m27-bizchain-v2 .bizchain-current-order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 320px) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #bcd0ef;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
  margin-bottom: 12px;
}
.m27-bizchain-v2 .bizchain-current-order-card span,
.m27-bizchain-v2 .bizchain-current-order-card small {
  display: block;
  color: var(--muted);
}
.m27-bizchain-v2 .bizchain-current-order-card strong {
  display: block;
  margin: 2px 0 4px;
  font-size: 18px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.m27-bizchain-v2 .bizchain-current-order-card b {
  color: var(--blue);
  font-size: 18px;
}
.m27-bizchain-v2 .bizchain-step-board-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}
.m27-bizchain-v2 .bizchain-step-card {
  display: grid;
  grid-template-rows: auto minmax(54px, 1fr) auto;
  gap: 10px;
  min-height: 178px;
  border: 1px solid var(--line);
  border-left: 4px solid #b8c8d9;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.m27-bizchain-v2 .bizchain-step-card.complete {
  border-left-color: var(--green);
  background: #f7fcfa;
}
.m27-bizchain-v2 .bizchain-step-card.current {
  border-color: #8eb8ff;
  border-left-color: var(--blue);
  background: #f3f8ff;
  box-shadow: 0 0 0 2px #e6f0ff inset;
}
.m27-bizchain-v2 .bizchain-step-card.disabled {
  background: #fbfcfe;
}
.m27-bizchain-v2 .bizchain-step-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.m27-bizchain-v2 .bizchain-step-card-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e8f0ff;
  color: var(--blue);
  font-weight: 800;
}
.m27-bizchain-v2 .bizchain-step-card-head strong {
  font-size: 15px;
  line-height: 1.25;
}
.m27-bizchain-v2 .bizchain-step-card p {
  margin: 0;
  color: #405874;
  line-height: 1.45;
}
.m27-bizchain-v2 .bizchain-step-card .btn {
  width: 100%;
  min-height: 36px;
  white-space: normal;
}
.m27-bizchain-v2 .bizchain-current-step-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #bcd0ef;
  border-radius: 8px;
  background: #f7fbff;
  padding: 12px;
  margin: 12px 0;
}
.m27-bizchain-v2 .bizchain-current-step-panel span {
  color: var(--muted);
  font-size: 12px;
}
.m27-bizchain-v2 .bizchain-current-step-panel h3 {
  margin: 2px 0 4px;
  font-size: 18px;
}
.m27-bizchain-v2 .bizchain-current-step-panel p {
  margin: 0;
  color: #405874;
}
.m27-bizchain-v2 .bizchain-current-step-panel .bizchain-action-bar {
  margin: 0;
  justify-content: flex-end;
}
.m27-bizchain-v2 .bizchain-context-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.bizchain-modal-context {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.bizchain-modal-context span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 9px 10px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.bizchain-modal-context strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}
.bom-tree-modal .m27-action-card {
  min-height: 58vh;
}
.bom-tree-modal.embedded-page-modal .m27-action-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 100%;
  height: 100%;
  padding: 12px;
}
.bizchain-embed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.bizchain-embed-head p {
  margin: 4px 0 0;
  color: var(--muted);
}
.bom-tree-embed-frame {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.bom-tree-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  margin: 12px 0;
  max-height: 58vh;
  overflow: auto;
}
.bom-tree-preview .tree-node:last-child {
  border-bottom: 0;
}
.m27-bomtree-embedded {
  background: #f3f7fb;
}
.m27-bomtree-embedded .shell {
  display: block;
  min-height: auto;
}
.m27-bomtree-embedded .sidebar,
.m27-bomtree-embedded .topbar,
.m27-bomtree-embedded .workspace-tabs,
.m27-bomtree-embedded .page-head .head-actions,
.m27-bomtree-embedded[data-context-locked="1"] .content > .panel:has(.filters) {
  display: none !important;
}
.m27-bomtree-embedded .main {
  margin: 0;
  width: 100%;
}
.m27-bomtree-embedded .content {
  padding: 12px;
}
.m27-bomtree-embedded .page-head {
  margin-bottom: 10px;
}
.m27-bomtree-embedded .page-head h1 {
  font-size: 22px;
}
.m27-bomtree-embedded .three-col {
  grid-template-columns: minmax(220px, .85fr) minmax(460px, 1.55fr) minmax(260px, .9fr);
}
body[data-page="BOMTREE"] .three-col {
  grid-template-columns: minmax(0, 2.65fr) minmax(300px, .75fr);
  align-items: start;
}
body[data-page="BOMTREE"] .three-col:not(.bomtree-customer-workspace) > article:first-child {
  display: none;
}
body[data-page="BOMTREE"] .bomtree-main-table {
  min-height: 590px;
}
body[data-page="BOMTREE"] .bomtree-main-table .table-wrap {
  max-height: 62vh;
  overflow: auto;
}
body[data-page="BOMTREE"] .content > .grid-5 {
  display: none;
}
body[data-page="BOMTREE"] .dark-detail {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
body[data-page="BOMTREE"] .dark-detail .box {
  border-color: var(--line);
  background: #fbfdff;
}
body[data-page="BOMTREE"] .dark-detail small {
  color: var(--muted);
}
body[data-page="BOMTREE"] .dark-detail h2 {
  color: var(--ink);
  font-size: 18px;
}
.bomtree-customer-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: stretch;
}
.bomtree-customer-workspace > article:first-child {
  display: block;
}
section.bomtree-customer-workspace + section.grid-5 {
  display: none !important;
}
.bomtree-customer-table {
  min-height: 680px;
}
.bomtree-customer-table .panel-title {
  align-items: flex-start;
  gap: 16px;
}
.bomtree-customer-table .panel-title h3 {
  margin-bottom: 4px;
}
.bomtree-table-tools {
  display: grid;
  grid-template-columns: 140px 140px minmax(220px, 1fr);
  gap: 10px;
  margin: 12px 0;
  align-items: end;
}
.bomtree-table-tools label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}
.bomtree-table-tools select,
.bomtree-table-tools input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink);
}
.bomtree-table-scroll {
  max-height: 64vh;
  min-height: 520px;
  overflow: auto;
}
.customer-bomtree-table {
  min-width: 1080px;
}
.customer-bomtree-table th,
.customer-bomtree-table td {
  white-space: nowrap;
}
.customer-bomtree-table th:nth-child(1),
.customer-bomtree-table td:nth-child(1) {
  width: 150px;
}
.customer-bomtree-table th:nth-child(2),
.customer-bomtree-table td:nth-child(2) {
  min-width: 180px;
}
.customer-bomtree-table th:nth-child(3),
.customer-bomtree-table td:nth-child(3) {
  min-width: 150px;
}
.seq-cell span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seq-cell strong {
  font-weight: 700;
  color: var(--ink);
}
.customer-bomtree-table .tree-toggle {
  width: 18px;
  height: 18px;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #9fb7d7;
  border-radius: 5px;
  background: #fff;
  color: #1d4f91;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(13, 27, 47, .04);
}
.customer-bomtree-table .tree-toggle:hover {
  border-color: var(--blue);
  background: #edf4ff;
  color: var(--blue);
}
.customer-bomtree-table .tree-toggle:focus-visible {
  outline: 2px solid rgba(31, 99, 215, .25);
  outline-offset: 2px;
}
.bomtree-indent-dot {
  width: 18px;
  height: 18px;
  display: inline-block;
}
.code-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.bomtree-customer-detail {
  align-self: stretch;
  background: #fff;
}
.bomtree-customer-detail .box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
  margin: 10px 0;
}
.bomtree-customer-detail .box small {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}
.bomtree-customer-detail .box h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 20px;
}
.bomtree-customer-detail .box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.bomtree-context-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.bomtree-context-strip div {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
  padding: 8px 10px;
}
.bomtree-context-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.bomtree-context-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  word-break: break-word;
}
.bizchain-action-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f7fbff;
  margin-top: 10px;
}
.bizchain-proof-log {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.bizchain-proof-log div,
.bizchain-readback,
.bizchain-preconditions,
.bizchain-disabled-area,
.bizchain-upload-area,
.bizchain-upload-status {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
}
.bizchain-upload-area {
  margin: 12px 0;
}
.bizchain-upload-form-grid {
  grid-template-columns: minmax(0, 1fr);
}
[data-param-upload-file] {
  padding: 5px;
  border: 1px solid #8bb9cf;
  border-radius: 8px;
  background: #f4fbff;
  color: var(--ink);
}
[data-param-upload-file]::file-selector-button {
  margin-right: 10px;
  padding: 9px 16px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #087f8c, #0b67c2);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.bizchain-parse-preview-btn {
  min-width: 132px;
  box-shadow: 0 5px 14px rgba(11, 103, 194, .2);
}
.bizchain-parse-preview-btn.is-ready {
  background: linear-gradient(135deg, #e45816, #f59e0b);
  border-color: #d84c10;
  box-shadow: 0 7px 18px rgba(228, 88, 22, .3);
}
.bizchain-upload-status {
  margin-top: 10px;
  color: var(--muted);
}
.bizchain-step-work {
  min-height: 48vh;
}
.bizchain-step-checklist {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
.bizchain-step-checklist > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}
.material-workbench {
  min-height: 68vh;
}
.material-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.material-hero p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}
.material-phase-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.material-phase {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  row-gap: 3px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid #b8c8d9;
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px 12px;
}
.material-phase b {
  grid-row: span 2;
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f0ff;
  color: var(--blue);
}
.material-phase span {
  font-weight: 800;
  color: var(--ink);
}
.material-phase small {
  color: var(--muted);
}
.material-phase.active {
  border-color: #7eafff;
  border-left-color: var(--blue);
  box-shadow: 0 0 0 2px #e5f0ff inset;
}
.material-phase.done {
  border-left-color: var(--green);
}
.material-auto-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  background: #f7fbff;
  padding: 16px;
  margin: 12px 0;
}
.material-auto-panel h4 {
  margin: 0 0 6px;
}
.material-auto-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.material-progress-box,
.material-code-copy {
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  background: #f7fbff;
  padding: 12px;
  margin: 12px 0;
}
.material-progress-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, .45fr);
  gap: 10px;
  align-items: start;
  border: 2px solid #38a3a5;
  background: linear-gradient(135deg, #dff7f4 0%, #eaf3ff 100%);
  box-shadow: 0 8px 22px rgba(15, 118, 110, .12);
}
.material-progress-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.material-progress-box strong {
  color: #075985;
  font-size: 18px;
}
.material-progress-box p {
  grid-column: 1 / -1;
  margin: 0;
  color: #315f35;
}
.bom-version-confirmation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 14px;
  align-items: center;
  margin: 14px 0;
  padding: 14px 16px;
  border: 2px solid #f59e0b;
  border-radius: 10px;
  background: #fff8e7;
}
.bom-version-confirmation span { color: #7c4a03; font-weight: 700; }
.bom-version-confirmation strong { color: #9a3412; font-size: 24px; }
.bom-version-confirmation small { grid-column: 1 / -1; color: var(--muted); word-break: break-all; }
body.m43-c5-customer-full-chain [data-ui-business-context] {
  display: none !important;
}
.material-code-copy strong {
  display: block;
  margin-bottom: 4px;
}
.material-code-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.material-context-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.material-context-strip span,
.material-summary-item,
.material-side-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px 12px;
}
.material-context-strip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}
.material-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.material-summary-item span,
.material-summary-item small {
  display: block;
  color: var(--muted);
}
.material-summary-item strong {
  display: block;
  margin: 5px 0 3px;
  font-size: 24px;
  line-height: 1.15;
}
.material-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px;
}
.btn.mini {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 12px;
}
.material-filter-row .active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.material-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 12px;
  align-items: start;
}
.material-table-wrap {
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.material-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}
.material-table th,
.material-table td {
  padding: 10px;
  border-bottom: 1px solid #e6edf5;
  text-align: left;
  vertical-align: top;
}
.material-table th {
  position: sticky;
  top: 0;
  background: #f7faff;
  color: #36536f;
  z-index: 1;
}
.material-table tr.is-reviewed {
  background: #f3fbf7;
}
.material-action-cell {
  white-space: nowrap;
}
.material-side-grid {
  display: grid;
  gap: 10px;
}
.material-side-panel h4 {
  margin: 0 0 8px;
  font-size: 15px;
}
.material-condition-list {
  margin: 0;
  padding-left: 18px;
  color: #24415f;
  line-height: 1.7;
}
.material-detail-list {
  display: grid;
  gap: 9px;
  margin: 0 0 12px;
}
.material-detail-list div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}
.material-detail-list dt {
  color: var(--muted);
}
.material-detail-list dd {
  margin: 0;
  color: var(--ink);
  word-break: break-word;
}
.material-technical-details summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}
.material-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}
.page09-context em {
  display: block;
  color: var(--ink);
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page09-stats .stat small {
  color: var(--muted);
}
.page09-stats .num.small {
  font-size: 16px;
  line-height: 1.25;
}
.page09-workspace {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .65fr);
}
.detail-tabs button.detail-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #51657c;
  cursor: pointer;
  font: inherit;
}
.detail-tabs button.detail-tab:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.page09-state {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  background: #f7fbff;
  color: #24415f;
}
.page09-state.is-ok {
  border-color: #a6dbc5;
  background: #eaf8f2;
  color: #0b6b4d;
}
.page09-state.is-empty,
.page09-state.is-loading {
  border-color: #d5e0ec;
  background: #f7faff;
  color: #31506f;
}
.page09-state.is-error {
  border-color: #f1aaa7;
  background: #fff0ef;
  color: #9a2926;
}
.page09-filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin: 12px 0;
}
.page09-filter-bar .filter {
  min-width: 0;
}
.page09-filter-bar .filter.wide {
  grid-column: span 2;
}
.page09-filter-bar label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.page09-filter-bar input,
.page09-filter-bar select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 7px 9px;
}
.page09-filter-bar input::placeholder {
  color: #8b9aae;
}
.page09-filter-bar .filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.page09-applied-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  margin: 6px 0 10px;
}
.page09-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid #cfe0f5;
  border-radius: 999px;
  background: #f7fbff;
  color: #24415f;
  padding: 3px 9px;
  font-size: 12px;
}
.page09-chip.muted-chip {
  color: var(--muted);
}
.page09-count-line {
  margin: 6px 0 10px;
  color: #31506f;
}
.page09-table-wrap {
  max-height: 520px;
}
.page09-table,
.page09-record-table {
  min-width: 1180px;
}
.page09-table tr.is-selected {
  background: #f2f7ff;
}
.page09-detail-panel {
  position: sticky;
  top: 70px;
  align-self: start;
}
.page09-detail-panel > h2,
.page09-detail-head h2 {
  margin-top: 0;
}
.page09-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.page09-detail-head p {
  margin: 4px 0 0;
  color: var(--muted);
}
.page09-detail-list div {
  grid-template-columns: 82px minmax(0, 1fr);
}
.page09-more-details {
  margin-top: 12px;
}
.page09-export-panel,
.page09-records-panel {
  margin-top: 14px;
}
.page09-export-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.page09-export-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
  min-width: 0;
}
.page09-export-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}
.page09-export-grid strong {
  display: block;
  overflow-wrap: anywhere;
}
.page09-footer .page-btn:disabled {
  color: #9aaabd;
  background: #f2f5f8;
  cursor: default;
}
body[data-material-mode="archive"] [data-material-match],
body[data-material-mode="archive"] [data-material-identity],
body[data-material-mode="match"] [data-material-archive],
body[data-material-mode="match"] [data-material-identity],
body[data-material-mode="identity"] [data-material-archive],
body[data-material-mode="identity"] [data-material-match] {
  display: none !important;
}
.material-match-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, .75fr);
  gap: 14px;
  align-items: start;
}
.material-match-main,
.material-match-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}
.material-match-side h3 {
  margin-top: 0;
}
.material-match-side .box {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
  margin: 8px 0;
}
.material-match-side .box small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}
.formula-proof-stats {
  margin: 12px 0;
}
.m27-proof-note {
  border: 1px solid #b9cbe5;
  background: #f8fbff;
  border-radius: 8px;
  padding: 10px;
  color: #1b3654;
  line-height: 1.55;
  word-break: break-word;
}
.bizchain-readback strong {
  word-break: break-word;
}
.param-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 8px;
  color: var(--muted);
}
.param-preview-toolbar strong {
  color: var(--ink);
}
.param-preview-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}
@media (max-width: 980px) {
  .param-preview-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .param-preview-list { grid-template-columns: 1fr; }
}
.param-preview-card,
.param-preview-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.param-preview-card .param-preview-line {
  display: flex;
  justify-content: flex-start;
  gap: 4px;
  align-items: baseline;
}
.param-preview-card strong,
.param-preview-card span,
.param-preview-card p,
.param-preview-card small {
  display: block;
  overflow-wrap: anywhere;
}
.param-preview-card span,
.param-preview-card small,
.param-preview-empty {
  color: var(--muted);
  font-size: 12px;
}
.param-preview-card .param-preview-value {
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}
.param-preview-card p {
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 14px;
}

body[data-page="HOME"] [data-ui-business-context],
body[data-page="HOME"] [data-m43-c5-context] {
  display: none !important;
}
.bizchain-choice-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.template-choice-scroll {
  max-height: min(52vh, 620px);
  overflow: auto;
  padding-right: 4px;
  align-content: start;
}
.bizchain-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  background: #fff;
}
.bizchain-choice:hover {
  border-color: #91b9f6;
  background: #f7fbff;
}
.bizchain-choice input {
  margin-top: 3px;
}
.bizchain-choice small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.template-filter-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbff;
  padding: 10px;
  margin: 12px 0;
}
.template-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.template-filter-summary small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.template-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(120px, .85fr) minmax(120px, .85fr);
  gap: 8px;
}
.template-filter-field {
  display: grid;
  gap: 4px;
}
.template-filter-field span {
  color: var(--muted);
  font-size: 12px;
}
.template-filter-field input,
.template-filter-field select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink);
}
.template-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}
.template-choice-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.template-choice-group + .template-choice-group {
  margin-top: 8px;
}
.template-choice-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
  background: #f8fafc;
}
.template-choice-group > summary small {
  color: var(--muted);
  font-weight: 500;
}
.template-choice-group > summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}
.template-choice-group > .template-choice-section {
  padding: 10px;
}
.material-readback-boundary {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}
.material-readback-boundary h4,
.material-readback-boundary p {
  margin: 0;
}
.material-readback-boundary p {
  margin-top: 6px;
  color: var(--muted);
}
@media (max-width: 680px) {
  .template-filter-summary,
  .template-choice-group > summary,
  .material-readback-boundary,
  .page07-purchase-status-help > div {
    align-items: flex-start;
    flex-direction: column;
  }
  .template-filter-summary small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
  .material-readback-boundary .btn {
    width: 100%;
    justify-content: center;
  }
}
.template-workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, .8fr);
  gap: 14px;
  align-items: start;
}
.template-structure-panel,
.template-rule-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}
.template-tree-table {
  max-height: 58vh;
  overflow: auto;
}
.template-tree-table tr.selected {
  background: #eef5ff;
  box-shadow: inset 3px 0 0 var(--blue);
}
.template-rule-panel h3 {
  margin-top: 0;
}
.template-rule-panel .box {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
  margin: 8px 0;
}
.template-rule-panel .box small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}
.template-rule-panel .box strong {
  color: var(--ink);
}
.template-workbench-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: -4px 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7fbff;
}
.template-workbench-status small {
  color: var(--muted);
}
.template-tree-live-table table {
  min-width: 1060px;
}
.template-tree-live-table th,
.template-tree-live-table td {
  vertical-align: middle;
}
.template-seq-cell {
  padding-left: calc(10px + var(--level, 0) * 18px) !important;
  white-space: nowrap;
}
.template-seq-cell strong {
  color: var(--ink);
}
.template-expand-btn,
.template-expand-spacer {
  display: inline-flex;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  align-items: center;
  justify-content: center;
  border: 1px solid #b9c7d8;
  border-radius: 4px;
  background: #f8fbff;
  color: #27415f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.template-expand-btn {
  cursor: default;
}
.template-expand-spacer {
  border-color: transparent;
  background: transparent;
}
.template-rule-live-panel {
  position: sticky;
  top: 72px;
}
.template-rule-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.template-rule-form .wide {
  grid-column: 1 / -1;
}
.template-rule-form textarea {
  min-height: 54px;
  resize: vertical;
}
.template-impact-panel {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #fff;
}
.template-impact-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}
.template-impact-panel p strong {
  color: var(--ink);
}
.template-impact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.template-impact-grid div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #fbfdff;
}
.template-impact-grid small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}
.template-operation-log {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.template-operation-log > div {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.template-operation-log small {
  color: var(--muted);
}
.template-operation-log ol {
  margin: 8px 0 0;
  padding-left: 20px;
}
.template-operation-log li {
  margin: 4px 0;
  color: var(--ink);
}
.template-operation-log li span {
  color: var(--muted);
  margin-right: 8px;
}
.bizchain-disabled-area {
  border-style: dashed;
  background: #fff8ee;
  margin: 12px 0;
}
.bizchain-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eef8;
  margin-top: 12px;
}
.bizchain-progress span {
  display: block;
  width: 42%;
  height: 100%;
  background: var(--blue);
  animation: bizchain-progress 1.1s ease-in-out infinite alternate;
}
.bizchain-progress[data-progress-action="generate_bom"] {
  position: relative;
  background: #dbeafe;
}
.bizchain-progress[data-progress-action="generate_bom"] span {
  width: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #60a5fa 35%, #2563eb 70%);
  background-size: 220% 100%;
  animation: bizchain-generate-flow 0.9s linear infinite;
}
.list-generation-progress-card {
  display: grid;
  gap: 12px;
}
.list-generation-live {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  background: #f7fbff;
  padding: 10px 12px;
}
.list-generation-live strong {
  color: var(--ink);
}
.list-generation-live span {
  color: var(--muted);
}
.list-generation-stages {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.list-generation-stage {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.list-generation-stage > span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid #ccd8e6;
  color: #66758a;
  font-weight: 700;
  line-height: 1;
}
.list-generation-stage strong,
.list-generation-stage small {
  display: block;
}
.list-generation-stage small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}
.list-generation-stage.active {
  border-color: #8eb6ee;
  background: #f5f9ff;
}
.list-generation-stage.active > span {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.list-generation-stage.done {
  border-color: #b7dcc7;
  background: #f7fcf9;
}
.list-generation-stage.done > span {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.list-generation-timeout {
  border: 1px solid #f0c36d;
  border-radius: 8px;
  background: #fff8e8;
  color: #744400;
  padding: 10px 12px;
  line-height: 1.5;
}
.list-generation-progress-card.failed .bizchain-readback {
  margin-top: 0;
}
.m27-capability-panel {
  border-color: #bfd3ea;
  background: #f8fbff;
}
.m27-capability-panel .panel-title {
  margin-bottom: 8px;
}
.m27-capability-lead {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}
.m27-boundary-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #32465d;
}
.m27-formula-proof {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.m27-formula-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.m27-formula-head h3 {
  margin: 0 0 4px;
}
.m27-formula-head p {
  margin: 0;
  color: var(--muted);
}
.m27-capability-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}
.m27-capability-stats div,
.m27-side-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
}
.m27-capability-stats span,
.m27-side-editor label,
.m27-side-editor small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.m27-capability-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
}
.m27-capability-grid,
.m27-code-proof {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 12px;
  align-items: start;
}
.m27-side-editor {
  display: grid;
  gap: 8px;
}
.m27-side-editor input,
.m27-side-editor select,
.m27-side-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  color: var(--ink);
  background: #fff;
}
.m27-side-editor p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.m27-material-proof-table {
  margin-top: 12px;
}
@keyframes bizchain-progress {
  from { transform: translateX(0); }
  to { transform: translateX(140%); }
}
@keyframes bizchain-generate-flow {
  from { background-position: 220% 0; }
  to { background-position: 0 0; }
}
body[data-page="HOME"] {
  overflow-x: hidden;
  background: #edf2f7;
}
body[data-page="HOME"] .page00-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}
body[data-page="HOME"] .page00-main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
body[data-page="HOME"] .page00-sidebar {
  grid-column: 1;
  grid-row: 1;
  width: 236px;
  padding: 16px 14px;
}
body[data-page="HOME"] .page00-sidebar .nav-group {
  margin: 12px 0 16px;
}
body[data-page="HOME"] .page00-sidebar .nav-item {
  min-height: 34px;
}
body[data-page="HOME"] .page00-sidebar .muted {
  line-height: 1.5;
}
body[data-page="HOME"] .page00-topbar {
  min-height: 58px;
  height: auto;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 20px;
}
body[data-page="HOME"] .page00-account-strip {
  justify-content: flex-end;
  min-width: 0;
}
body[data-page="HOME"] .account-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  min-width: 0;
  white-space: nowrap;
}
body[data-page="HOME"] .account-chip strong {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: normal;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-page="HOME"] .page00-env-chip {
  background: #fff7e8;
  border-color: #edc46f;
  color: #6e4b00;
}
body[data-page="HOME"] .page00-content {
  max-width: 1320px;
  padding: 18px 20px 52px;
}
body[data-page="HOME"] .page00-head {
  align-items: center;
  border-color: #cfdbe8;
}
body[data-page="HOME"] .page00-heading {
  min-width: 0;
}
body[data-page="HOME"] .page00-kicker {
  color: #5e7188;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}
body[data-page="HOME"] .page00-primary-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
}
body[data-page="HOME"] .topbar-title {
  flex-wrap: wrap;
  min-width: 0;
}
body[data-page="HOME"] .page00-status {
  border: 1px solid #bfd1e5;
  background: #f7fbff;
  border-radius: 8px;
  color: #24415f;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 14px;
  padding: 10px 12px;
}
body[data-page="HOME"] .page00-status[data-page00-state="ok"] {
  border-color: #9bd5bf;
  background: #edf8f3;
  color: #0f6048;
}
body[data-page="HOME"] .page00-status[data-page00-state="failure"],
body[data-page="HOME"] .page00-status[data-page00-state="denied"] {
  border-color: #efb5b5;
  background: #fff2f2;
  color: #8a1f1f;
}
body[data-page="HOME"] .page00-current-business {
  padding: 16px;
}
body[data-page="HOME"] .page00-current-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
body[data-page="HOME"] .page00-current-main h2 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 6px;
}
body[data-page="HOME"] .page00-current-main p {
  color: #607089;
  margin: 0;
}
body[data-page="HOME"] .page00-business-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
body[data-page="HOME"] .page00-business-cell {
  border: 1px solid #d8e3ee;
  background: #fbfdff;
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}
body[data-page="HOME"] .page00-business-cell span,
body[data-page="HOME"] .page00-business-cell small,
body[data-page="HOME"] .page00-section-title span {
  color: #607089;
}
body[data-page="HOME"] .page00-business-cell strong {
  display: block;
  font-size: 17px;
  line-height: 1.3;
  margin: 5px 0;
  overflow-wrap: anywhere;
}
body[data-page="HOME"] .page00-progress {
  background: #e6edf5;
  border-radius: 999px;
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
}
body[data-page="HOME"] .page00-progress span {
  background: linear-gradient(90deg, #1f63d7, #0f9f6e);
  display: block;
  height: 100%;
  transition: width .2s ease;
}
body[data-page="HOME"] .page00-section-title {
  margin: 0 0 10px;
}
body[data-page="HOME"] .page00-entry-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
body[data-page="HOME"] .page00-entry-group {
  background: #fff;
  min-height: 0;
}
body[data-page="HOME"] .page00-entry-group h3 {
  font-size: 16px;
  margin: 0 0 10px;
}
body[data-page="HOME"] .page00-entry-link {
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  display: block;
  margin-top: 8px;
  min-height: 78px;
  padding: 11px;
}
body[data-page="HOME"] .page00-entry-link:hover {
  border-color: #9ec0f8;
  background: #f4f8ff;
}
body[data-page="HOME"] .page00-entry-link strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  margin-bottom: 5px;
}
body[data-page="HOME"] .page00-entry-link span {
  color: #607089;
  display: block;
  line-height: 1.45;
}
body[data-page="HOME"] .page00-support summary {
  color: #20344f;
  cursor: pointer;
  font-weight: 700;
}
body[data-page="HOME"] .page00-support-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
body[data-page="HOME"] .btn:focus-visible,
body[data-page="HOME"] .nav-item:focus-visible,
body[data-page="HOME"] .page00-entry-link:focus-visible,
body[data-page="HOME"] .page00-support summary:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 3px;
}
@media (max-width: 1280px) {
  .row-semantic-overview { grid-template-columns: repeat(4, minmax(118px, 1fr)); }
  .shell { grid-template-columns: 230px 1fr; }
  .stage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .three-col { grid-template-columns: 230px minmax(0,1fr); }
  .three-col .dark-detail { grid-column: 1 / -1; }
  .template-filter-grid { grid-template-columns: 1fr; }
  .m27-closure-rail,
  .m27-page-controls {
    display: block;
  }
  .m27-closure-status {
    justify-content: flex-start;
    margin-top: 8px;
  }
  .bizchain-context-grid,
  .bizchain-proof-log {
    grid-template-columns: 1fr;
  }
  .material-context-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .material-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .material-work-grid {
    grid-template-columns: 1fr;
  }
  .material-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .bizchain-task-board-grid {
    grid-template-columns: 1fr;
  }
  .m27-capability-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .m27-capability-grid,
  .m27-code-proof {
    grid-template-columns: 1fr;
  }
  body[data-page="HOME"] .page00-shell {
    grid-template-columns: 212px minmax(0, 1fr);
  }
  body[data-page="HOME"] .page00-sidebar {
    width: 212px;
  }
  body[data-page="HOME"] .page00-business-grid,
  body[data-page="HOME"] .page00-entry-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1280px) {
  .m27-bizchain-v2 .shell {
    grid-template-columns: 148px minmax(0, 1fr);
  }
  .m27-bizchain-v2 .bizchain-step-board-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .m27-bizchain-v2 .bizchain-current-order-card,
  .m27-bizchain-v2 .bizchain-current-step-panel,
  .bizchain-modal-context {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .row-semantic-overview { grid-template-columns: repeat(2, minmax(118px, 1fr)); }
  body[data-page="HOME"] .page00-shell {
    grid-template-columns: 1fr;
  }
  body[data-page="HOME"] .page00-main,
  body[data-page="HOME"] .page00-sidebar {
    grid-column: 1;
    grid-row: auto;
  }
  body[data-page="HOME"] .page00-sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    height: auto;
    overflow: visible;
    position: static;
    width: auto;
  }
  body[data-page="HOME"] .page00-sidebar nav {
    display: grid;
    grid-template-columns: 1fr;
  }
  body[data-page="HOME"] .page00-topbar,
  body[data-page="HOME"] .page00-head,
  body[data-page="HOME"] .page00-current-main {
    align-items: stretch;
    flex-direction: column;
  }
  body[data-page="HOME"] .page00-account-strip,
  body[data-page="HOME"] .page00-primary-actions {
    justify-content: flex-start;
    width: 100%;
  }
  body[data-page="HOME"] .page00-account-strip {
    display: grid;
    grid-template-columns: 1fr;
  }
  body[data-page="HOME"] .page00-account-strip .account-chip,
  body[data-page="HOME"] .page00-primary-actions .btn {
    width: 100%;
  }
  body[data-page="HOME"] .page00-content {
    padding: 14px 12px 36px;
  }
  body[data-page="HOME"] .page00-business-grid,
  body[data-page="HOME"] .page00-entry-groups {
    grid-template-columns: 1fr;
  }
  .m27-bizchain-v2 .shell {
    grid-template-columns: 1fr;
  }
  .m27-bizchain-v2 .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .m27-bizchain-v2 .brand {
    display: none;
  }
  .m27-bizchain-v2 .bizchain-step-board-grid,
  .m27-bizchain-v2 .bizchain-context-grid {
    grid-template-columns: 1fr;
  }
  .m27-bizchain-v2 .bizchain-current-step-panel .bizchain-action-bar {
    justify-content: stretch;
  }
  .m27-bizchain-v2 .bizchain-current-step-panel .btn {
    width: 100%;
  }
}
