:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --ink: #18202f;
  --muted: #667085;
  --line: #d6dce8;
  --blue: #1463ff;
  --teal: #0f9f8f;
  --amber: #b7791f;
  --red: #c2410c;
  --green: #16803c;
  --shadow: 0 16px 40px rgba(24, 32, 47, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(15, 23, 42, 0.58), rgba(15, 23, 42, 0.52)),
    url("https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.login-panel {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
  padding: 36px;
  color: #fff;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 8px 0 12px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
}

.login-form {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.login-form button,
.primary-button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.secondary-button,
.ghost-button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.secondary-button.small {
  min-height: 32px;
  padding: 6px 10px;
}

.ghost-button {
  width: 100%;
  margin-top: auto;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.muted {
  color: var(--muted);
}

.login-panel .muted {
  color: rgba(255, 255, 255, 0.72);
}

.eyebrow {
  margin: 0;
  color: #79d0ff;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  font-weight: 900;
}

.error-text {
  margin: 0;
  color: #dc2626;
  font-weight: 800;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  background: #121827;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand span {
  display: block;
  color: #aab4c7;
  font-size: 13px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid !important;
  place-items: center;
  color: #fff !important;
  background: var(--blue);
  border-radius: 6px;
  font-weight: 900;
}

.page-tabs {
  display: grid;
  gap: 8px;
}

.tab-button {
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  color: #cbd5e1;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-weight: 800;
}

.tab-button.active {
  color: #fff;
  background: rgba(20, 99, 255, 0.22);
  border-color: rgba(121, 208, 255, 0.35);
}

.rms-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.rms-subtab {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.rms-subtab.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.rms-tab-panel {
  display: none;
}

.rms-tab-panel.active {
  display: block;
}

.rms-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.rms-overview-grid article {
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.rms-overview-grid strong {
  display: block;
  margin-bottom: 8px;
}

.rms-overview-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.rms-source-grid,
.rms-rule-table {
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  overflow: hidden;
  border-radius: 8px;
}

.rms-source-grid {
  grid-template-columns: 160px minmax(0, 1fr);
}

.rms-rule-table {
  grid-template-columns: 160px minmax(220px, 1fr) minmax(260px, 1.2fr);
}

.rms-source-grid > div,
.rms-rule-table > div {
  min-height: 42px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.rms-source-grid > div:nth-child(odd),
.rule-head {
  background: #f1f5f9;
  font-weight: 900;
}

.rms-parameter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 14px;
}

.rms-parameter-pages {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.rms-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.rms-page-tab {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.rms-page-tab.active {
  color: var(--blue);
  border-color: #b8ccff;
  background: #eaf1ff;
}

.rms-field-section {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.rms-field-section + .rms-field-section {
  margin-top: 14px;
}

.rms-field-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rms-field-section > header span {
  color: var(--muted);
  font-weight: 800;
}

.rms-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.rms-field {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.rms-field.hint-active {
  border-color: #93b4ff;
  box-shadow: 0 0 0 3px rgba(20, 99, 255, 0.1);
}

.rms-field.disabled {
  opacity: 0.58;
  background: #f1f5f9;
}

.rms-field.wide {
  grid-column: span 2;
}

.rms-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 900;
}

.rms-field input,
.rms-field select {
  min-height: 36px;
}

.rms-checkbox-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 900;
}

.rms-checkbox-control input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--blue);
}

.rms-drawing-section {
  background: #fbfbfb;
}

.rms-draw-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.rms-draw-actions span {
  color: var(--muted);
  font-weight: 900;
}

.rms-draw-actions button,
.rms-draw-main {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  background: #f5f5f5;
  color: #111;
  font-weight: 800;
}

.rms-draw-actions button:hover,
.rms-draw-main:hover {
  background: #eaf3ff;
}

.rms-draw-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.rms-draw-checks > span {
  min-width: 46px;
  color: var(--muted);
  font-weight: 900;
}

.rms-draw-checks label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
}

.rms-draw-checks label.disabled {
  color: #94a3b8;
}

.rms-draw-checks input {
  width: 15px;
  min-height: 15px;
  accent-color: var(--blue);
}

.rms-draw-main {
  margin-top: 10px;
}

.rms-picture-hint {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.rms-picture-title {
  font-weight: 900;
}

.rms-picture-box {
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}

.rms-picture-box img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.rms-picture-box.empty {
  padding: 18px;
  color: var(--muted);
  background: #f8fafc;
  text-align: center;
  font-weight: 800;
}

.rms-field small {
  color: var(--muted);
  font-weight: 800;
}

.rms-dot {
  width: 13px;
  height: 13px;
  min-height: 13px;
  flex: 0 0 13px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid transparent;
}

.rms-dot.auto {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(20, 99, 255, 0.14);
}

.rms-dot.overridden {
  background: #64748b;
  border-color: #475569;
}

.rms-dot.missing {
  background: #e2e8f0;
  border-color: #cbd5e1;
  cursor: default;
}

.rms-winform-page {
  display: grid;
  gap: 10px;
  color: #111;
  font-size: 14px;
}

.rms-win-group {
  min-width: 0;
  margin: 0;
  padding: 12px 12px 10px;
  border: 1px solid #d8d8d8;
  border-radius: 0;
  background: #fbfbfb;
}

.rms-win-group legend {
  padding: 0 5px;
  color: #111;
  font-weight: 400;
}

.rms-win-layout-grid {
  display: grid;
  grid-template-columns: 170px 170px 190px 170px 150px;
  gap: 12px 22px;
  align-items: center;
}

.rms-win-layout-grid .wide {
  grid-column: span 3;
}

.rms-win-colon {
  color: #555;
  font-weight: 900;
}

.rms-win-field {
  display: grid;
  grid-template-columns: 84px minmax(96px, 1fr);
  align-items: center;
  gap: 6px;
  margin: 0;
}

.rms-win-field.short {
  grid-template-columns: 42px 120px;
}

.rms-win-field.medium {
  grid-template-columns: 108px 150px;
}

.rms-win-field.wide {
  grid-template-columns: 84px minmax(360px, 1fr);
}

.rms-win-field > span:first-child {
  text-align: right;
  white-space: nowrap;
}

.rms-win-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.rms-win-control input,
.rms-win-control select,
.rms-win-field.missing input {
  width: 100%;
  min-height: 24px;
  height: 24px;
  padding: 1px 4px;
  border: 1px solid #c8c8c8;
  border-radius: 0;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 400;
}

.rms-win-control .rms-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 9px;
  height: 9px;
  min-height: 9px;
  flex-basis: 9px;
  box-shadow: none;
}

.rms-win-field.hint-active .rms-win-control input,
.rms-win-field.hint-active .rms-win-control select,
.rms-win-control.hint-active input,
.rms-win-control.hint-active select {
  outline: 2px solid rgba(20, 99, 255, 0.28);
  outline-offset: 1px;
}

.rms-win-table {
  display: grid;
  grid-template-columns: repeat(var(--rms-win-cols, 1), minmax(68px, max-content));
  gap: 6px 8px;
  align-items: center;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}

.rms-win-table.upright-table {
  grid-template-columns: 44px 82px 82px 92px 82px;
}

.rms-win-table.brace-table {
  grid-template-columns: 92px 62px 76px 76px 64px 74px;
}

.rms-win-table > div {
  text-align: center;
  white-space: nowrap;
}

.rms-win-row-label {
  text-align: left !important;
}

.rms-win-button {
  min-width: 58px;
  height: 29px;
  margin-top: 8px;
  padding: 3px 12px;
  border: 1px solid #bdbdbd;
  border-radius: 0;
  background: #f5f5f5;
  color: #111;
  font-size: 14px;
}

.rms-win-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
}

.rms-win-inline-leading {
  margin-bottom: 10px;
}

.rms-win-draw-grid {
  display: grid;
  grid-template-columns: 220px 220px 44px repeat(4, 76px);
  gap: 8px;
  align-items: center;
}

.rms-win-draw-grid.wide {
  grid-template-columns: repeat(3, minmax(180px, 220px)) 44px repeat(4, 76px);
}

.rms-win-draw-grid button {
  min-width: 64px;
  height: 30px;
  padding: 3px 10px;
  border: 1px solid #bdbdbd;
  border-radius: 0;
  background: #f5f5f5;
  color: #111;
}

.rms-win-draw-label {
  text-align: right;
}

.json-preview {
  width: 100%;
  min-height: 520px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}

.secondary-button.danger {
  color: #b42318;
  border-color: #fecaca;
  background: #fff7f7;
}

.secondary-button.danger:hover {
  background: #fee2e2;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar,
.section-head,
.panel-head,
.button-row,
.status-strip {
  display: flex;
  align-items: center;
}

.topbar,
.section-head {
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

.topbar h2,
.section-head h3,
.panel h4 {
  margin: 0;
}

.section-head {
  margin-bottom: 16px;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.status-strip {
  gap: 8px;
  flex-wrap: wrap;
}

/* P12 design-table version comparison */
.p12-page {
  --p12-before: #c2410c;
  --p12-before-soft: #fff1ed;
  --p12-after: #16803c;
  --p12-after-soft: #edf9f0;
  --p12-modified: #c76a00;
  --p12-modified-soft: #fff9ea;
  --p12-neutral: #667085;
  --p12-neutral-soft: #f5f6f8;
}

.p12-section-head {
  align-items: flex-start;
}

.p12-import-files,
.p12-recompare {
  min-height: 38px;
  padding: 8px 18px;
}

.p12-file-input {
  display: none;
}

.p12-summary-grid {
  display: grid;
  grid-template-columns: minmax(250px, 1.7fr) minmax(250px, 1.7fr) repeat(4, minmax(112px, 0.9fr));
  gap: 12px;
  margin-bottom: 12px;
}

.p12-file-card,
.p12-kpi {
  min-width: 0;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 32, 47, 0.04);
}

.p12-file-card {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 5px;
  padding: 18px;
  border-left-width: 4px;
  color: var(--ink);
  text-align: left;
}

.p12-file-card.is-old {
  color: var(--p12-before);
}

.p12-file-card.is-new {
  color: var(--p12-after);
}

.p12-file-card:hover,
.p12-file-card:focus-visible {
  border-color: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
}

.p12-file-card:disabled {
  cursor: progress;
  opacity: 0.68;
}

.p12-file-card strong,
.p12-file-card small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p12-file-card strong {
  color: var(--ink);
  font-size: 16px;
}

.p12-file-card small {
  color: var(--muted);
  font-size: 12px;
}

.p12-file-role {
  color: currentColor;
  font-size: 12px;
  font-weight: 900;
}

.p12-kpi {
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 14px;
  text-align: center;
}

.p12-kpi strong {
  font-size: 30px;
  line-height: 1;
}

.p12-kpi span {
  color: var(--muted);
  font-weight: 800;
}

.p12-kpi.is-added strong {
  color: var(--p12-after);
}

.p12-kpi.is-removed strong {
  color: var(--p12-before);
}

.p12-kpi.is-modified strong {
  color: var(--p12-modified);
}

.p12-kpi.is-unchanged strong {
  color: #475467;
}

.p12-status-row {
  min-height: 24px;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 750;
}

.p12-warnings {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #f6c66c;
  border-radius: 6px;
  background: #fff8e7;
  color: #8a4b08;
  font-size: 13px;
  font-weight: 750;
}

.p12-metadata {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  padding: 10px 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.p12-metadata.empty {
  color: var(--muted);
}

.p12-metadata-title {
  flex: 0 0 auto;
  padding-right: 14px;
  border-right: 1px solid var(--line);
  font-weight: 900;
}

.p12-metadata-list,
.p12-metadata-change {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.p12-metadata-list {
  gap: 16px;
}

.p12-metadata-field {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.p12-legend {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0 0 10px;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}

.p12-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.p12-legend-swatch {
  width: 14px;
  height: 14px;
  display: inline-block;
  border-radius: 2px;
}

.p12-legend-swatch.is-before {
  background: var(--p12-before);
}

.p12-legend-swatch.is-after {
  background: var(--p12-after);
}

.p12-legend-swatch.is-unchanged {
  background: #8b95a5;
}

.panel.p12-table-panel {
  padding: 0;
  overflow: hidden;
}

.p12-toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.p12-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.p12-filters button {
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-weight: 800;
}

.p12-filters button.active {
  border-color: var(--blue);
  color: var(--blue);
  background: #f4f7ff;
  box-shadow: inset 0 0 0 1px var(--blue);
}

.p12-table-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex: 1 1 auto;
}

.p12-table-hint {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

#p12ResetColumns {
  flex: 0 0 auto;
  white-space: nowrap;
}

.p12-search {
  width: min(320px, 100%);
  min-height: 38px;
}

.p12-comparison-table {
  max-height: calc(100vh - 390px);
  min-height: 260px;
  overflow: auto;
}

.p12-comparison-table.empty {
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--muted);
}

.p12-comparison-table table {
  min-width: 1180px;
  table-layout: auto;
  font-size: 12px;
}

.p12-comparison-table th {
  top: 0;
  z-index: 3;
  padding: 11px 10px;
  background: #f6f8fb;
  color: #344054;
  user-select: none;
}

.p12-comparison-table th.is-dragging {
  opacity: 0.55;
}

.p12-comparison-table th.is-drop-target {
  box-shadow: inset 3px 0 0 var(--blue);
}

.p12-comparison-table th.is-drop-target.is-drop-after {
  box-shadow: inset -3px 0 0 var(--blue);
}

.p12-column-head {
  min-width: max-content;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.p12-sort-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 2px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
}

.p12-sort-button:hover,
.p12-sort-button:focus-visible {
  color: var(--blue);
  background: #eef3ff;
}

.p12-sort-indicator {
  width: 12px;
  color: #7c8798;
  font-size: 11px;
  text-align: center;
}

.p12-column-drag {
  min-width: 18px;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  color: #98a2b3;
  cursor: grab;
  font-size: 13px;
  letter-spacing: -3px;
}

.p12-column-drag:hover,
.p12-column-drag:focus-visible {
  color: var(--blue);
  background: #e7edff;
  outline: 2px solid color-mix(in srgb, var(--blue) 28%, transparent);
  outline-offset: 1px;
}

.p12-column-drag:active {
  cursor: grabbing;
}

.p12-comparison-table td {
  max-width: 300px;
  padding: 9px 10px;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
}

.p12-comparison-table tbody tr:last-child td {
  border-bottom: 0;
}

.p12-comparison-table tr.status-modified td,
.p12-comparison-table tr.p12-row-modified td {
  background: var(--p12-modified-soft);
}

.p12-comparison-table tr.status-renumbered td,
.p12-comparison-table tr.p12-row-renumbered td {
  background: #f5f2ff;
}

.p12-comparison-table tr.status-added td,
.p12-comparison-table tr.p12-row-added td {
  background: var(--p12-after-soft);
}

.p12-comparison-table tr.status-removed td,
.p12-comparison-table tr.p12-row-removed td {
  background: var(--p12-before-soft);
}

.p12-comparison-table tr.status-unchanged td,
.p12-comparison-table tr.p12-row-unchanged td {
  color: var(--p12-neutral);
  background: var(--p12-neutral-soft);
}

.p12-change-badge,
.p12-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-weight: 900;
  white-space: nowrap;
}

.p12-change-badge.status-modified,
.p12-status-badge.status-modified {
  color: var(--p12-modified);
  background: #fffaf0;
}

.p12-change-badge.status-renumbered,
.p12-status-badge.status-renumbered {
  color: #6657c8;
  background: #f7f5ff;
}

.p12-change-badge.status-added,
.p12-status-badge.status-added {
  color: var(--p12-after);
  background: #f3fbf5;
}

.p12-change-badge.status-removed,
.p12-status-badge.status-removed {
  color: var(--p12-before);
  background: #fff7f5;
}

.p12-change-badge.status-unchanged,
.p12-status-badge.status-unchanged {
  color: #5f6b7a;
  background: #eef0f3;
}

.p12-cell-diff,
.p12-value-diff,
.p12-inline-diff {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.p12-cell-diff.is-stacked {
  align-items: flex-start;
  flex-direction: column;
}

.p12-before,
.p12-after {
  display: inline-block;
  max-width: 100%;
  padding: 3px 6px;
  border: 1px solid currentColor;
  border-radius: 4px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.p12-before {
  color: var(--p12-before);
  background: var(--p12-before-soft);
}

.p12-after {
  color: var(--p12-after);
  background: var(--p12-after-soft);
}

.p12-change-arrow {
  flex: 0 0 auto;
  color: #475467;
  font-weight: 900;
}

.p12-cell-diff.is-stacked .p12-change-arrow {
  margin-left: 8px;
  transform: rotate(90deg);
}

.p12-empty-value {
  color: #98a2b3;
}

.p12-source-ref {
  cursor: help;
}

@media (max-width: 1380px) {
  .p12-summary-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .p12-file-card {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .p12-section-head,
  .p12-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .p12-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .p12-file-card {
    grid-column: span 2;
  }

  .p12-search {
    width: 100%;
  }

  .p12-table-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .p12-table-hint {
    width: 100%;
    white-space: normal;
  }

  .p12-metadata {
    align-items: flex-start;
    flex-direction: column;
  }

  .p12-metadata-title {
    width: 100%;
    padding: 0 0 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.topbar-settings-button {
  min-width: 190px;
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 7px 12px;
  text-align: left;
}

.topbar-settings-button small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.status-strip span {
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.upload-grid.p3-controls {
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 0.85fr);
}

.upload-box,
.toggle-box,
.choice-box {
  min-height: 82px;
  padding: 14px;
  border: 1px dashed #9aa7bd;
  border-radius: 8px;
  background: #fff;
}

.upload-box span {
  font-weight: 900;
}

.upload-box small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.upload-box em {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-upload {
  grid-column: 1 / -1;
}

.project-import-assignments {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid #f1b84b;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffaf0 0%, #fff 100%);
}

.project-import-assignments-head,
.project-import-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-import-assignments-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.project-import-candidate-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.project-import-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid #d5ddea;
  border-radius: 9px;
  background: #fff;
  cursor: grab;
  box-shadow: 0 8px 20px rgba(42, 58, 89, 0.08);
}

.project-import-card:active {
  cursor: grabbing;
}

.project-import-card:focus-visible {
  outline: 3px solid rgba(20, 99, 255, 0.26);
  outline-offset: 2px;
}

.project-import-card.is-dragging {
  opacity: 0.48;
}

.project-import-preview {
  position: relative;
  min-height: 142px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  pointer-events: none;
}

.project-import-preview::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30px;
  background: linear-gradient(transparent, #f8fafc);
}

.project-import-preview table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 7px;
  line-height: 1.25;
}

.project-import-preview td {
  height: 22px;
  overflow: hidden;
  padding: 3px;
  border-right: 1px solid #dbe3ef;
  border-bottom: 1px solid #dbe3ef;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recognition-upload-box {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
}

.recognition-upload-trigger {
  min-width: 0;
  cursor: pointer;
}

.recognition-file-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 9px;
  border-top: 1px solid #e2e8f0;
}

.recognition-file-actions small {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #475569;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-evidence-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.metric-evidence-item {
  display: grid;
  grid-template-columns: minmax(110px, 0.28fr) minmax(0, 1fr);
  gap: 10px;
  padding: 7px 9px;
  border-left: 3px solid #60a5fa;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
}

.metric-evidence-item strong {
  color: #1e3a5f;
}

.project-import-card-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
}

.project-import-card-title strong,
.project-import-card-body > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-import-card-body > span,
.project-import-card-body > small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.project-import-suggestion {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  color: #075985 !important;
  background: #e0f2fe;
  font-size: 10px !important;
  font-weight: 900 !important;
}

.project-import-suggestion.neutral {
  color: #92400e !important;
  background: #fef3c7;
}

.project-import-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.project-import-card-actions .secondary-button {
  min-height: 28px;
  padding: 4px 7px;
  font-size: 10px;
}

.project-import-card-actions .recommended {
  color: #0b4dd8;
  border-color: #93b4ff;
  background: #e8efff;
}

.project-import-dismiss {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #64748b;
  background: #f1f5f9;
  font-size: 16px;
  line-height: 1;
}

.project-import-dropzone {
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.project-import-dropzone.is-drag-target {
  border-color: var(--blue);
  background: #edf4ff;
  box-shadow: 0 0 0 4px rgba(20, 99, 255, 0.14);
  transform: translateY(-2px);
}

.toggle-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.toggle-box input,
.choice-box input,
.manual-ratio-switch input {
  width: 18px;
  min-height: 18px;
}

.choice-box {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 900;
}

.choice-box > span {
  margin-right: auto;
  font-weight: 900;
}

.choice-box label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-grid article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(24, 32, 47, 0.04);
}

.kpi-grid article {
  padding: 16px;
}

.kpi-grid span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.kpi-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.content-grid {
  display: grid;
  gap: 16px;
}

.content-grid.two-col {
  grid-template-columns: 0.85fr 1.15fr;
}

.page#p9 .content-grid + .content-grid {
  margin-top: 16px;
}

.bom-check-file-picker {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.bom-check-file-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.bom-check-file-head > span {
  min-width: 0;
  margin-right: auto;
  color: var(--muted);
  font-weight: 800;
}

.bom-check-file-input {
  display: none;
}

.bom-check-select-all {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}

.bom-check-select-all input,
.bom-check-file-name input {
  width: 18px;
  min-width: 18px;
  height: 18px;
}

.bom-check-file-list {
  display: grid;
  max-height: 196px;
  overflow-y: auto;
  border: 1px solid var(--line);
}

.bom-check-file-list.empty {
  display: block;
  padding: 12px;
  color: var(--muted);
  font-weight: 700;
}

.bom-check-file-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 6px 4px 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.bom-check-file-item:last-child {
  border-bottom: 0;
}

.bom-check-file-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bom-check-file-name span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bom-check-file-item small {
  color: var(--muted);
  font-weight: 700;
}

.bom-check-file-remove,
.bom-check-custom-remove {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.bom-check-file-remove:hover,
.bom-check-file-remove:focus-visible,
.bom-check-custom-remove:hover,
.bom-check-custom-remove:focus-visible {
  background: #fff1f2;
  color: var(--red);
  outline: 1px solid #fecdd3;
}

.trash-icon {
  position: relative;
  width: 12px;
  height: 13px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 2px 2px;
}

.trash-icon::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -3px;
  width: 14px;
  border-top: 2px solid currentColor;
}

.trash-icon::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 2px;
  width: 4px;
  height: 3px;
  border: 2px solid currentColor;
  border-bottom: 0;
}

#p9 .panel,
#bomCheckMergedTable,
#bomCheckPairTable,
#bomCheckSummaryTable {
  resize: both;
  overflow: auto;
}

#p9 .panel {
  min-width: 320px;
  min-height: 260px;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

#bomCheckMergedTable,
#bomCheckPairTable,
#bomCheckSummaryTable {
  min-height: 180px;
  max-height: 68vh;
}

.bom-check-summary-row.ok td {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.bom-check-summary-row.extra td {
  background: #fffbeb;
  border-color: #fde68a;
}

.bom-check-summary-row.missing td {
  background: #fef2f2;
  border-color: #fecaca;
}

.bom-check-summary-row.ok td:first-child {
  box-shadow: inset 4px 0 #16a34a;
}

.bom-check-summary-row.extra td:first-child {
  box-shadow: inset 4px 0 #eab308;
}

.bom-check-summary-row.missing td:first-child {
  box-shadow: inset 4px 0 #dc2626;
}

.bom-check-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 62px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-weight: 900;
}

.bom-check-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.bom-check-status.ok {
  color: #15803d;
  background: #dcfce7;
}

.bom-check-status.extra {
  color: #a16207;
  background: #fef3c7;
}

.bom-check-status.missing {
  color: #b91c1c;
  background: #fee2e2;
}

.warn-row {
  background: #fff7ed;
}

.warn-row td {
  border-color: #fed7aa;
}

.bom-check-pair-head {
  align-items: flex-start;
  flex-wrap: wrap;
}

.bom-check-pair-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px 12px;
}

.bom-check-pair-title .muted {
  font-size: 13px;
  font-weight: 600;
}

.bom-check-review-toolbar,
.bom-check-review-filters {
  display: flex;
  align-items: center;
}

.bom-check-review-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.bom-check-review-filters {
  overflow: hidden;
  border: 1px solid #d6dce8;
  border-radius: 6px;
  background: #fff;
}

.bom-check-review-filters button {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-right: 1px solid #d6dce8;
  border-radius: 0;
  background: #fff;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.bom-check-review-filters button:last-child {
  border-right: 0;
}

.bom-check-review-filters button:hover,
.bom-check-review-filters button:focus-visible {
  background: #f4f6fa;
  color: #174ea6;
}

.bom-check-review-filters button.active {
  background: #eef5ff;
  color: #174ea6;
}

.bom-check-review-toolbar .secondary-button {
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.bom-check-review-toolbar button:disabled {
  cursor: default;
  opacity: 0.5;
}

.bom-check-pair-table table {
  min-width: 1260px;
  font-size: 13px;
}

.bom-check-pair-table th {
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.bom-check-main-row td {
  padding-top: 11px;
  padding-bottom: 11px;
  border-top: 2px solid #9db7e8;
  background: #eef5ff;
  color: #18202f;
  font-weight: 600;
}

.bom-check-main-row td:first-child {
  box-shadow: inset 4px 0 #2f6fed;
}

.bom-check-main-row .bom-check-main-summary {
  white-space: normal;
}

.bom-check-main-row .bom-check-main-summary .small {
  margin-left: 0;
}

.bom-check-main-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  vertical-align: middle;
}

.bom-check-main-actions .secondary-button {
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.bom-check-custom-mode.active {
  border-color: #1463ff;
  background: #1463ff;
  color: #fff;
}

.bom-check-main-row.no-accessory-main td {
  border-color: #cbd0d8;
  background: #eef0f3;
  color: #667085;
}

.bom-check-main-row.no-accessory-main td:first-child {
  box-shadow: inset 4px 0 #98a2b3;
}

.bom-check-main-row.reviewed td {
  border-color: #86e0a3;
  background: #ecfdf3;
  color: #18202f;
}

.bom-check-main-row.reviewed td:first-child {
  box-shadow: inset 4px 0 #16a34a;
}

.bom-check-no-accessory-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #cbd0d8;
  border-radius: 4px;
  background: #fff;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.bom-check-family-row td {
  padding: 8px 14px;
  background: #f8fbff;
  border-color: #d6e2f5;
}

.bom-check-family-members {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  color: #475467;
  font-size: 12px;
}

.bom-check-family-members.shared-rule-members {
  flex-wrap: wrap;
  min-width: 0;
  white-space: normal;
}

.bom-check-family-members.shared-rule-members > strong {
  flex: 0 0 100%;
}

.bom-check-family-members.shared-rule-members .bom-check-family-member {
  max-width: min(100%, 620px);
}

.bom-check-family-members.shared-rule-members .bom-check-family-member > span {
  overflow-wrap: anywhere;
}

.bom-check-family-member {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 5px 4px 9px;
  border: 1px solid #cbd8ec;
  border-radius: 4px;
  background: #fff;
  color: #253858;
  font-weight: 600;
}

.bom-check-family-member .small {
  min-height: 26px;
  padding: 3px 8px;
}

.bom-check-child-row td {
  background: #fff;
  color: #253858;
  font-weight: 400;
  line-height: 20px;
}

.bom-check-child-row:hover td {
  background: #f8fafc;
}

.bom-check-child-row.warn-row td {
  border-color: #e7b64a;
  background: #fff7e6;
  color: #6b4700;
}

.bom-check-child-row.warn-row:hover td {
  background: #fff3d6;
}

.bom-check-child-row.warn-row td:first-child {
  box-shadow: inset 4px 0 #d89b12;
}

.bom-check-child-row.warn-row .bom-check-child-label {
  border-color: #d89b12;
  background: #ffd978;
  color: #694100;
}

.bom-check-child-row.excluded-requirement td {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #98a2b3;
}

.bom-check-child-row.excluded-requirement:hover td {
  background: #eaecf0;
}

.bom-check-child-row.excluded-requirement td:not(:first-child),
.bom-check-child-row.excluded-requirement td:first-child > :not(.bom-check-branch) {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.bom-check-child-row.excluded-requirement input {
  border-color: #d0d5dd;
  background: #eaecf0;
  color: #98a2b3;
}

.bom-check-custom-row td {
  background: #f8fafc;
}

.bom-check-accessory-name {
  color: #253858;
  font-size: 13px;
  font-weight: 600 !important;
  line-height: 20px;
}

.bom-check-accessory-spec,
.bom-check-note-cell {
  max-width: 260px;
  color: #667085;
  font-size: 12px;
  font-weight: 400 !important;
  line-height: 18px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.bom-check-number-cell,
.bom-check-number-heading,
.bom-check-main-quantity {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bom-check-number-cell,
.bom-check-main-quantity {
  font-size: 13px;
  font-weight: 700 !important;
  line-height: 20px;
}

.bom-check-custom-row > td > input,
.bom-check-custom-row .bom-check-filter-select {
  width: 100%;
  min-width: 130px;
}

.bom-check-row-publish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 154px;
}

.bom-check-custom-actions {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 32px;
  align-items: center;
  gap: 6px;
}

.bom-check-quantity-editor {
  display: inline-grid;
  grid-template-columns: 25px minmax(54px, 76px) 25px;
  align-items: stretch;
  min-height: 29px;
  overflow: hidden;
  border: 1px solid #cfd6e2;
  border-radius: 5px;
  background: #fff;
  vertical-align: middle;
}

.bom-check-quantity-editor input {
  width: 100%;
  min-width: 0;
  min-height: 27px;
  padding: 3px 5px;
  border: 0;
  border-right: 1px solid #d9dee8;
  border-left: 1px solid #d9dee8;
  border-radius: 0;
  text-align: center;
  font-size: 12px;
}

.bom-check-quantity-editor button {
  width: 25px;
  min-height: 27px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f8fafc;
  color: #344054;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.bom-check-quantity-editor button:hover:not(:disabled),
.bom-check-quantity-editor button:focus-visible:not(:disabled) {
  background: #eaf2ff;
  color: #174ea6;
}

.bom-check-quantity-editor button:disabled,
.bom-check-quantity-editor input:disabled {
  cursor: default;
  background: #eef0f3;
  color: #98a2b3;
}

.bom-check-filter-select {
  position: relative;
}

.bom-check-filter-select input {
  width: 100%;
  min-height: 30px;
  padding-right: 25px;
  font-size: 12px;
}

.bom-check-filter-select > span {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #667085;
  border-bottom: 1.5px solid #667085;
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.bom-check-filter-menu {
  position: fixed;
  z-index: 3000;
  max-height: 300px;
  overflow: auto;
  padding: 5px;
  border: 1px solid #b9c2d0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.18);
  font-size: 11px;
}

.bom-check-filter-group {
  position: sticky;
  top: -5px;
  z-index: 1;
  padding: 6px 7px 4px;
  background: #f2f4f7;
  color: #667085;
  font-size: 10px;
  font-weight: 700;
}

.bom-check-filter-menu button {
  display: block;
  width: 100%;
  min-height: 27px;
  padding: 4px 7px;
  border: 0;
  border-radius: 3px;
  background: #fff;
  color: #1d2939;
  cursor: pointer;
  text-align: left;
  font-size: 11px;
}

.bom-check-filter-menu button:hover,
.bom-check-filter-menu button:focus-visible,
.bom-check-filter-menu button.active {
  background: #eaf2ff;
  color: #174ea6;
}

.bom-check-filter-empty {
  padding: 9px;
  color: #667085;
  font-size: 11px;
}

.bom-check-child-indent {
  position: relative;
  min-width: 170px;
  padding-left: 34px;
  color: var(--muted);
  font-weight: 600;
}

.bom-check-child-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid #d6dce8;
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

button.bom-check-child-label {
  cursor: pointer;
  font-family: inherit;
}

.bom-check-requirement-toggle:hover,
.bom-check-requirement-toggle:focus-visible {
  border-color: #98a2b3;
  background: #eef2f6;
}

.excluded-requirement .bom-check-requirement-toggle {
  border-color: #98a2b3;
  background: #e4e7ec;
  color: #667085;
  text-decoration: line-through;
}

.bom-check-user-label {
  display: inline-flex;
  align-items: stretch;
  min-height: 24px;
  border-radius: 999px;
}

.bom-check-user-label.actions-open {
  box-shadow: 0 0 0 2px rgba(20, 99, 255, 0.1);
}

.bom-check-user-label.actions-open .bom-check-child-label {
  border-radius: 999px 0 0 999px;
}

.bom-check-inline-actions {
  display: inline-flex;
  align-items: stretch;
}

.bom-check-inline-action {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid #98a2b3;
  border-left: 0;
  border-radius: 0;
  background: #fff;
  color: #344054;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.bom-check-inline-action:hover,
.bom-check-inline-action:focus-visible,
.bom-check-inline-action.copied {
  border-color: #1463ff;
  background: #eaf2ff;
  color: #174ea6;
}

.bom-check-inline-action.delete {
  border-color: #f04438;
  border-radius: 0 999px 999px 0;
  background: #fff1f0;
  color: #d92d20;
}

.bom-check-inline-action.delete:hover,
.bom-check-inline-action.delete:focus-visible {
  background: #d92d20;
  color: #fff;
}

.bom-check-paste-custom {
  border-color: #7aa2e8;
  background: #eef5ff;
  color: #174ea6;
}

.bom-check-paste-custom:disabled {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #98a2b3;
  cursor: not-allowed;
  opacity: 1;
}

.bom-check-branch {
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 50%;
  width: 16px;
  border-left: 2px solid #8aa4d6;
  border-bottom: 2px solid #8aa4d6;
  border-bottom-left-radius: 6px;
}

.bom-check-main-identity {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 210px;
  white-space: normal;
}

.bom-check-collapse-button {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #475467;
}

.bom-check-collapse-button:hover,
.bom-check-collapse-button:focus-visible {
  border-color: #9db7e8;
  background: #fff;
  color: #174ea6;
}

.bom-check-collapse-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.14s ease;
}

.bom-check-main-row.collapsed .bom-check-collapse-button svg {
  transform: rotate(-90deg);
}

.bom-check-main-label {
  flex: 0 0 auto;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: #2f6fed;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.bom-check-main-row.no-accessory-main .bom-check-main-label {
  background: #98a2b3;
}

.bom-check-main-row.reviewed .bom-check-main-label {
  background: #16a34a;
}

.bom-check-main-name {
  color: #18202f;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.bom-check-main-spec {
  max-width: 330px;
  color: #475467;
  font-size: 12px;
  font-weight: 600 !important;
  line-height: 18px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.bom-check-main-drawing {
  color: #475467;
  font-size: 12px;
  font-weight: 600 !important;
  line-height: 18px;
  white-space: nowrap;
}

.bom-check-collapsed-summary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 6px;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: normal;
}

.bom-check-collapsed-summary .bom-check-collapsed-state {
  font-weight: 700;
}

.bom-check-collapsed-summary.reviewed .bom-check-collapsed-state {
  color: #16803c;
}

.bom-check-collapsed-separator {
  color: #98a2b3;
  font-weight: 700;
}

.bom-check-collapsed-brief {
  color: #475467;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.bom-check-no-accessory-toggle {
  color: #667085;
}

.bom-check-review-heading,
.bom-check-review-cell {
  position: sticky;
  right: 0;
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  padding-right: 9px;
  padding-left: 9px;
  border-left: 1px solid #d6dce8;
  text-align: center;
}

.bom-check-review-heading {
  z-index: 4;
  background: #f4f6fa;
}

.bom-check-main-row .bom-check-review-cell {
  z-index: 3;
  background: #eef5ff;
}

.bom-check-main-row.no-accessory-main .bom-check-review-cell {
  background: #eef0f3;
}

.bom-check-main-row.reviewed .bom-check-review-cell {
  background: #ecfdf3;
}

.bom-check-family-row .bom-check-review-cell {
  z-index: 2;
  background: #f8fbff;
}

.bom-check-child-row .bom-check-review-cell {
  z-index: 2;
  background: #fff;
}

.bom-check-child-row:hover .bom-check-review-cell,
.bom-check-custom-row .bom-check-review-cell {
  background: #f8fafc;
}

.bom-check-child-row.warn-row .bom-check-review-cell {
  background: #fff7e6;
}

.bom-check-child-row.excluded-requirement .bom-check-review-cell {
  background: #f2f4f7;
}

.bom-check-review-button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid #98a2b3;
  border-radius: 50%;
  background: #fff;
  color: transparent;
}

.bom-check-review-button:hover,
.bom-check-review-button:focus-visible {
  border-color: #16a34a;
  color: #86e0a3;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.bom-check-review-button.reviewed {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

.bom-check-review-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bom-check-filter-empty-row td {
  height: 110px;
  color: #667085;
  text-align: center;
  white-space: normal;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.identified-rack-panel,
.manual-rack-panel {
  border-width: 2px;
}

.identified-rack-panel {
  border-color: #9db7e8;
  background: #f8fbff;
}

.manual-rack-panel {
  margin-top: 18px;
  border-color: #a8d8ce;
  background: #f8fffd;
}

.panel-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.key-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) repeat(3, 120px);
  gap: 12px;
  align-items: end;
}

.status-line {
  margin: 12px 0 0;
}

.ai-recommendation-status {
  margin: -4px 0 16px;
  padding: 10px 12px;
  border: 1px solid #cbd9f4;
  border-radius: 8px;
  color: var(--muted);
  background: #f7faff;
  font-size: 13px;
  font-weight: 750;
}

.confirm-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.confirm-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.confirm-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 900;
}

.confirm-card p {
  margin: 6px 0;
  color: var(--muted);
}

.confirm-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.confirm-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.confirm-fields label {
  gap: 5px;
  font-size: 13px;
}

.confirm-fields select,
.confirm-fields input {
  min-height: 32px;
  padding: 6px 8px;
}

.field-note {
  align-self: end;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.consumable-fields {
  grid-template-columns: repeat(3, max-content) minmax(160px, 1fr);
  align-items: center;
}

.consumable-fields label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.consumable-fields input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.confidence {
  color: var(--muted);
  font-size: 12px;
}

.param-grid,
.chem-ratio-box {
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: minmax(230px, 0.8fr) minmax(340px, 1.2fr);
  gap: 14px;
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.engineering-rule-panel,
.bom-check-config-panel {
  margin-bottom: 16px;
}

.bom-check-config-panel .panel-head,
.bom-check-config-panel .button-row {
  flex-wrap: wrap;
}

.bom-check-config-panel.is-collapsed .panel-head {
  margin-bottom: 0;
}

#p9 .bom-check-config-panel.is-collapsed {
  height: auto !important;
  min-height: 0;
  resize: none;
  overflow: hidden;
}

.bom-check-config-body[hidden] {
  display: none;
}

.bom-check-config-actions {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.engineering-config {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.engineering-config-group {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.engineering-config-group legend {
  padding: 0 6px;
  font-weight: 900;
}

.engineering-config-group label {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(110px, 1fr) minmax(74px, 0.55fr);
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  font-weight: 800;
}

.engineering-config-group label > input:only-of-type {
  grid-column: span 2;
}

.engineering-config-group input {
  width: 100%;
  min-height: 34px;
}

.engineering-config-group em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.engineering-config-group small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
}

.engineering-config-group .config-ok {
  color: var(--green);
}

.engineering-config-group .config-error {
  color: var(--red);
}

.hanging-classification-table {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: auto;
}

.hanging-classification-table > strong {
  display: block;
  margin-bottom: 8px;
}

.hanging-classification-table table {
  width: 100%;
}

.hanging-classification-table select {
  min-height: 32px;
}

.pending-rule-head {
  margin-top: 14px;
}

.bom-check-rule-table {
  max-height: 360px;
}

.bom-check-rule-table input {
  min-width: 110px;
  width: 100%;
}

.bom-check-rule-table input[type="checkbox"] {
  min-width: 18px;
  width: 18px;
}

.bom-check-rule-table .bom-check-quantity-editor input {
  width: 76px;
  min-width: 0;
  min-height: 27px;
}

.bom-check-rule-table select,
.accessory-rule-table select {
  min-width: 104px;
  min-height: 32px;
  width: 100%;
}

.rule-publish-actions {
  display: flex;
  gap: 6px;
  min-width: 170px;
  white-space: nowrap;
}

.rule-lifecycle-hint {
  margin: 8px 0 12px;
  line-height: 1.65;
}

.rule-source-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.rule-source-badge.local {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.rule-source-badge.cloud {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}

.rule-layer-note,
.rule-validation-error {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}

.rule-layer-note {
  color: var(--muted);
}

.rule-validation-error {
  color: #b42318;
  font-weight: 700;
}

.accessory-rule-table tr.invalid-rule td {
  background: #fff7ed;
}

.shared-accessory-migration {
  display: grid;
  gap: 10px;
  margin: 10px 0 14px;
}

.shared-accessory-migration[hidden] {
  display: none;
}

.shared-migration-conflict {
  padding: 12px;
  border: 1px solid #f5c451;
  border-radius: 8px;
  background: #fffbeb;
}

.shared-migration-conflict > strong {
  color: #92400e;
}

.shared-migration-conflict p {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  margin: 7px 0;
  color: #475467;
}

.shared-migration-conflict p span {
  font-weight: 800;
  color: #7c2d12;
}

.accessory-rule-table tr.cloud-rule td {
  background: #f7fcf8;
}

.no-accessory-rule td {
  background: #eef0f3;
  color: #667085;
}

.no-accessory-rule input:disabled {
  background: #e4e7ec;
  color: #667085;
  opacity: 1;
}

.hanging-beam-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin: 0 8px;
  padding: 5px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.hanging-beam-result-separator {
  color: #93a4bd;
}

.hanging-beam-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 9px;
  border: 1px solid #e8b83f;
  border-radius: 999px;
  background: #fff1b8;
  color: #8a5900;
  box-shadow: 0 1px 0 rgb(138 89 0 / 8%);
  line-height: 1;
  white-space: nowrap;
}

.hanging-override-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.hanging-override-label select {
  min-height: 30px;
  padding: 4px 8px;
}

.brace-endpoint-label {
  display: inline-grid;
  grid-template-columns: auto 96px;
  align-items: center;
  gap: 4px 7px;
  margin: 0 8px;
  padding: 6px 8px;
  border: 1px solid #f5c26b;
  border-radius: 6px;
  background: #fff8e7;
  color: #7c4a03;
  font-size: 12px;
  font-weight: 900;
  white-space: normal;
}

.brace-endpoint-label input {
  width: 96px;
  min-height: 30px;
}

.brace-endpoint-label small {
  grid-column: 1 / -1;
  color: #8a5a13;
  font-size: 11px;
  font-weight: 800;
}

.brace-endpoint-control {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  width: max-content;
  min-height: 32px;
  margin: 0;
  padding: 3px 5px;
  border: 1px solid #f5c26b;
  border-radius: 6px;
  background: #fff8e7;
  color: #7c4a03;
  vertical-align: middle;
  white-space: nowrap;
}

.brace-endpoint-title {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
}

.brace-endpoint-modes {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #d6a34d;
  border-radius: 6px;
  background: #fff;
}

.brace-endpoint-modes button {
  min-height: 26px;
  padding: 3px 7px;
  border: 0;
  border-right: 1px solid #d6a34d;
  border-radius: 0;
  background: #fff;
  color: #7c4a03;
  font-size: 11px;
  font-weight: 900;
}

.brace-endpoint-modes button:last-child {
  border-right: 0;
}

.brace-endpoint-modes button.active {
  background: #7c4a03;
  color: #fff;
}

.brace-endpoint-entry {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.brace-endpoint-entry input {
  width: 62px;
  min-height: 26px;
  padding: 3px 6px;
  font-size: 11px;
}

.brace-endpoint-entry.binding {
  border-color: transparent;
  background: transparent;
}

.brace-endpoint-entry.binding.drag-over {
  border-color: #1463ff;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(20, 99, 255, 0.14);
}

.brace-endpoint-entry input[readonly] {
  background: #fff;
  color: #172033;
  font-weight: 900;
}

.brace-binding-picker {
  position: relative;
  flex: 0 0 auto;
}

.brace-binding-picker summary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 72px;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid #d6a34d;
  border-radius: 6px;
  background: #fff;
  color: #7c4a03;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  list-style: none;
}

.brace-binding-picker summary::-webkit-details-marker {
  display: none;
}

.brace-binding-caret {
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
}

.brace-binding-picker[open] .brace-binding-caret {
  transform: translateY(1px) rotate(225deg);
}

.brace-length-options {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 90;
  display: grid;
  gap: 4px;
  width: max-content;
  min-width: 190px;
  max-width: 260px;
  max-height: 220px;
  padding: 5px;
  overflow-y: auto;
  border: 1px solid #d6a34d;
  border-radius: 6px;
  background: #fffdf5;
  box-shadow: 0 8px 22px rgba(61, 42, 8, 0.18);
}

.brace-length-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 25px;
  padding: 2px 5px;
  border: 1px solid #d6a34d;
  border-radius: 6px;
  background: #fff;
  color: #7c4a03;
  cursor: grab;
  font-size: 11px;
  font-weight: 800;
}

.brace-length-chip:active {
  cursor: grabbing;
}

.brace-length-chip.active {
  border-color: #1463ff;
  background: #eff6ff;
  color: #174ea6;
}

.brace-length-grip {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 4px 0 currentColor, 0 4px currentColor, 4px 4px currentColor, 0 8px currentColor, 4px 8px currentColor;
  opacity: 0.65;
}

.brace-length-chip strong {
  margin-left: 5px;
}

.brace-length-selected {
  margin-left: auto;
  color: #174ea6;
  font-size: 10px;
}

.brace-info {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.brace-info-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 1px solid #bf8a25;
  border-radius: 50%;
  background: #fff;
  color: #8a5a13;
  cursor: help;
  font-family: inherit;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.brace-info-button:hover,
.brace-info-button:focus-visible {
  border-color: #7c4a03;
  background: #7c4a03;
  color: #fff;
}

.brace-info-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  z-index: 80;
  width: 310px;
  padding: 8px 10px;
  border: 1px solid #d6a34d;
  border-radius: 5px;
  background: #fffdf5;
  box-shadow: 0 8px 22px rgba(61, 42, 8, 0.18);
  color: #5f3b00;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  white-space: normal;
}

.brace-info:hover .brace-info-tooltip,
.brace-info:focus-within .brace-info-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.split-frame-info-tooltip {
  right: auto;
  left: 0;
  bottom: auto;
  top: calc(100% + 7px);
  width: 268px;
}

.bom-check-direct-quantity {
  color: #7c4a03;
  font-size: 12px;
  font-weight: 900;
}

.rack-summary-grid {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.rack-summary-grid input[readonly] {
  background: #f4f6fa;
  color: #172033;
  font-weight: 900;
}

.identified-rack-panel.refresh-target {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16), 0 8px 24px rgba(24, 32, 47, 0.04);
}

.identified-rack-panel.refresh-target .rack-summary-grid {
  border-color: #2563eb;
  background: #eef5ff;
}

.identified-rack-panel.refresh-target .rack-summary-grid input[readonly] {
  background: #dbeafe;
}

.basis-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 900;
  color: #172033;
}

.basis-choice input {
  width: 16px;
  min-height: 16px;
}

.basis-status {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rack-diagram-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.rack-diagram-panel,
.rack-deduction-panel {
  min-height: 0;
}

.rack-view-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.rack-view-controls label {
  min-width: 104px;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.rack-view-controls select,
.rack-view-controls input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.rack-view-controls select {
  min-width: 170px;
}

.rack-part-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.rack-part-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.rack-part-button span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--part-color);
}

.rack-part-button.active {
  border-color: var(--part-color);
  background: #f8fbff;
  box-shadow: 0 0 0 3px rgba(20, 99, 255, 0.08);
}

.rack-diagram-canvas {
  min-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.rack-diagram-canvas.empty {
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-weight: 900;
}

.rack-diagram-canvas svg {
  display: block;
  min-width: 760px;
  width: 100%;
  height: auto;
}

.rack-svg-bg {
  fill: #ffffff;
  stroke: #d6dce8;
}

.rack-axis-label {
  fill: #344054;
  font-size: 13px;
  font-weight: 900;
}

.rack-cell-label {
  pointer-events: none;
  fill: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-anchor: middle;
}

.rack-component {
  transition: opacity 0.12s ease, stroke-width 0.12s ease, fill 0.12s ease;
}

.rack-component.selectable {
  cursor: pointer;
}

.rack-component.muted {
  opacity: 0.32;
}

.rack-component.selectable:hover {
  opacity: 1;
  stroke-width: 5;
}

.rack-bay {
  fill: #eff6ff;
  stroke: #2563eb;
  stroke-width: 1.4;
}

.rack-upright {
  stroke: #0f766e;
  stroke-width: 4;
  stroke-linecap: round;
}

.rack-beam {
  stroke: #d97706;
  stroke-width: 3;
  stroke-linecap: round;
}

.rack-base {
  fill: #ede9fe;
  stroke: #7c3aed;
  stroke-width: 1.5;
}

.rack-topConnector {
  fill: #f1f5f9;
  stroke: #64748b;
  stroke-width: 2;
}

.rack-backBrace {
  stroke: #dc2626;
  stroke-width: 2.2;
  stroke-dasharray: 7 5;
  stroke-linecap: round;
}

.rack-component.removed {
  opacity: 0.12;
  stroke: #94a3b8;
  fill: #e2e8f0;
}

.rack-component.removed.selectable {
  opacity: 0.32;
}

.rack-deduction-panel {
  position: sticky;
  top: 16px;
}

.rack-deduction-panel .table-wrap {
  max-height: none;
}

.rack-stat-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 999px;
  vertical-align: middle;
}

.rack-deduction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.aisle-type-list {
  display: grid;
  gap: 14px;
}

.aisle-type-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.aisle-type-card header {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(220px, 280px) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
}

.aisle-type-card header strong {
  align-self: center;
  font-size: 16px;
}

.aisle-type-grid {
  margin: 0;
  border: 0;
  border-radius: 0;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.aisle-type-grid output {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f4f6fa;
  color: var(--muted);
  font-weight: 900;
}

.aisle-type-grid .checkbox-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.aisle-type-grid .double-upright-field {
  justify-content: space-between;
  gap: 10px;
}

.double-upright-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.double-upright-field label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 13px;
  font-weight: 900;
}

.aisle-type-grid .checkbox-field input {
  width: 18px;
  min-height: 18px;
}

.manual-ratio-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 112px;
  padding: 12px;
  border: 1px dashed #9aa7bd;
  border-radius: 6px;
  font-weight: 900;
}

.manual-ratio-switch span {
  line-height: 1.35;
}

.ratio-lines {
  display: grid;
  gap: 8px;
}

.ratio-lines label {
  display: grid;
  grid-template-columns: 64px minmax(72px, 110px) minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 32px;
  font-weight: 800;
}

.ratio-lines input {
  min-height: 32px;
}

.ratio-lines output {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f4f6fa;
  color: var(--muted);
  font-weight: 800;
}

.count-panel {
  margin-bottom: 16px;
}

.count-sheets {
  display: grid;
  gap: 14px;
}

.count-sheet {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  border-top-width: 4px;
}

.count-sheet-upright {
  border-top-color: #2563eb;
}

.count-sheet-beam {
  border-top-color: #059669;
}

.count-sheet-backBrace {
  border-top-color: #d97706;
}

.count-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  font-weight: 900;
}

.count-sheet header div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.count-sheet-toggle {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.count-sheet-toggle:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.count-table {
  max-height: 360px;
  border: 0;
  border-radius: 0 0 8px 8px;
}

.count-table th {
  vertical-align: bottom;
}

.count-table th.identity-zone,
.count-table td.identity-zone {
  background: #eff6ff;
}

.count-table th.unit-zone,
.count-table td.unit-zone {
  background: #ecfdf5;
}

.count-table th.bay-zone,
.count-table td.bay-zone {
  background: #e0f2fe;
}

.count-table th.post-zone,
.count-table td.post-zone {
  background: #ecfdf5;
}

.count-table th.beam-zone,
.count-table td.beam-zone {
  background: #e0f2fe;
}

.count-table th.backbrace-regular-zone,
.count-table td.backbrace-regular-zone {
  background: #dcfce7;
}

.count-table th.backbrace-strong-zone,
.count-table td.backbrace-strong-zone {
  background: #fef3c7;
}

.count-table th.upright-regular-zone,
.count-table td.upright-regular-zone {
  background: #e0f2fe;
}

.count-table th.upright-strong-zone,
.count-table td.upright-strong-zone {
  background: #fef3c7;
}

.count-table th.calc-zone,
.count-table td.calc-cell {
  background: #fff7ed;
}

.count-table th.bolt-zone,
.count-table td.bolt-zone {
  background: #fef2f2;
}

.count-table tbody tr:hover td {
  filter: brightness(0.98);
}

.count-table th input {
  display: block;
  width: 86px;
  min-height: 30px;
  margin-top: 6px;
}

.unit-group-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.split-head {
  display: grid;
  gap: 6px;
  min-width: 128px;
}

.split-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.split-parent-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.split-parent {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.split-head input {
  width: 100% !important;
  margin-top: 0 !important;
}

.split-qty-line {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.split-qty-line input[readonly] {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-weight: 900;
}

.split-qty-actions {
  display: grid;
  grid-template-columns: 44px 52px;
  gap: 6px;
}

.split-add,
.split-increment {
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.split-increment {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.split-increment:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.split-remove {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff7f7;
  color: #b42318;
  font-size: 16px;
  font-weight: 900;
}

.split-remove:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.split-auto-choice {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.split-auto-choice input {
  width: 14px !important;
  min-height: 14px !important;
  margin: 0 !important;
}

.split-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.count-table td input {
  width: 78px;
  min-height: 30px;
  padding: 5px 7px;
}

.calc-cell {
  font-weight: 900;
  color: var(--blue);
}

.count-sheet .count-table {
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
}

.count-sheet.is-collapsed .count-table {
  display: none;
}

.table-wrap {
  max-height: 440px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f6fa;
  font-weight: 900;
}

.split-frame-header {
  z-index: 10;
}

td input {
  min-height: 30px;
  padding: 5px 7px;
}

.unit-input {
  width: 86px;
}

.result-list {
  display: grid;
  gap: 8px;
}

.result-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  background: #fff;
}

.result-item.warn {
  border-left-color: var(--amber);
}

.result-item.error {
  border-left-color: var(--red);
}

.result-item.ok {
  border-left-color: var(--green);
}

.dimension-head {
  margin-top: 14px;
}

.dimension-check {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.dimension-check.empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
}

.dimension-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 6px;
  background: #fff;
}

.dimension-item.warn {
  border-left-color: var(--amber);
}

.dimension-item.error {
  border-left-color: var(--red);
}

.dimension-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}

.dimension-item p {
  margin: 0 0 6px;
  font-weight: 800;
}

.dimension-item small {
  display: block;
  color: var(--muted);
  white-space: normal;
}

.accessory-rule-panel {
  margin-top: 14px;
}

.accessory-rule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: stretch;
}

.accessory-rule-table {
  max-height: 390px;
  overflow: auto;
}

.accessory-rule-table input {
  width: 150px;
  min-height: 30px;
  padding: 5px 7px;
}

.accessory-rule-table input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue);
}

.accessory-rule-table .rule-number {
  width: 76px;
}

.accessory-rule-table .rule-code {
  width: 110px;
}

.drawing-mini-preview {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 390px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
}

.drawing-mini-preview header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.drawing-mini-preview iframe {
  width: 100%;
  height: 100%;
  min-height: 340px;
  border: 0;
  background: #2f2f2f;
}

.drawing-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 178px);
}

.drawing-contribution-panel {
  margin-top: 18px;
}

.drawing-contribution-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(140px, 0.7fr) minmax(180px, 1fr) minmax(240px, 1.5fr) auto;
  gap: 12px;
  align-items: end;
}

.drawing-contribution-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.drawing-contribution-form label > span {
  color: var(--ink);
  font-weight: 800;
}

.drawing-contribution-form input {
  width: 100%;
}

.drawing-list-panel,
.drawing-view-panel {
  min-height: 0;
}

.drawing-view-panel > .panel-head {
  margin-bottom: 6px;
}

.search-input {
  width: 100%;
  margin-bottom: 10px;
}

.drawing-directory {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 306px);
  overflow: auto;
}

.drawing-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.drawing-item strong {
  display: grid;
  gap: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawing-item small,
.relation-link small {
  display: block;
  max-width: 220px;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.78;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawing-item small.drawing-spec-line,
.relation-link small + small {
  opacity: 0.62;
}

.drawing-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.drawing-item.active {
  border-color: rgba(20, 99, 255, 0.42);
  background: #eef5ff;
}

.drawing-relations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.drawing-spec {
  margin: 0 0 4px;
  min-height: 16px;
  font-weight: 800;
}

.drawing-spec:empty {
  display: none;
}

.drawing-relations > div {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.drawing-relations strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.relation-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drawing-relations .relation-links.empty {
  min-height: 24px;
  align-items: center;
  justify-content: center;
}

.relation-link {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.relation-link.child {
  color: #0847b8;
  border: 1px solid #93c5fd;
  background: #dbeafe;
}

.relation-link.parent {
  color: #b91c1c;
  border: 1px solid #fca5a5;
  background: #fee2e2;
}

.relation-link.missing {
  display: inline-flex;
  align-items: center;
  color: #475569;
  border: 1px dashed #94a3b8;
  background: #f8fafc;
}

.drawing-frame {
  width: 100%;
  height: calc(100vh - 372px);
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #2f2f2f;
}

.category-sections {
  display: grid;
  gap: 16px;
}

.category-section {
  min-width: 0;
}

.category-section header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-left: 5px solid var(--blue);
  background: #f4f6fa;
  border-radius: 6px;
}

.category-section header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.parts-table {
  max-height: 360px;
}

.parts-table table {
  min-width: 1050px;
  table-layout: fixed;
}

.parts-table .part-grade {
  width: 72px;
}

.parts-table .part-name {
  width: 220px;
}

.parts-table .part-spec {
  width: 310px;
}

.parts-table .part-material {
  width: 120px;
}

.parts-table .part-length,
.parts-table .part-qty {
  width: 86px;
}

.parts-table .part-drawing {
  width: 120px;
}

.parts-table .part-remark {
  width: 250px;
}

.parts-table .material-cell {
  height: 100%;
  padding: 4px 6px;
  position: relative;
  text-align: center;
  vertical-align: middle;
}

.material-pill {
  display: flex;
  position: absolute;
  inset: 4px 6px;
  min-width: 0;
  max-width: none;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid rgba(24, 32, 47, 0.1);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
  white-space: normal;
}

.grade-badge {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(24, 32, 47, 0.12);
}

.grade-badge.main {
  color: #fff;
  background: #dc2626;
}

.grade-badge.accessory {
  color: #fff;
  background: #1463ff;
}

.grade-badge.sub {
  color: #5b21b6;
  background: #fde047;
}

.grade-badge.virtual-sub {
  color: #7c2d12;
  background: #fff7ed;
  border: 2px dashed #f97316;
  box-shadow: none;
}

.pdf-link {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #93b4ff;
  border-radius: 6px;
  background: #e8efff;
  color: #0b4dd8;
  font-size: 12px;
  font-weight: 900;
}

/* P11 standalone BOM revision review */
.p11-page {
  --p11-purple: #6657c8;
  --p11-purple-soft: #f1efff;
}

.p11-step-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.p11-step-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.p11-step-heading > div {
  flex: 1;
}

.p11-step-heading h4,
.p11-step-heading p {
  margin: 0;
}

.p11-step-heading p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.55;
}

.p11-step-number {
  display: inline-grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--p11-purple);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.p11-upload-row,
.p11-review-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.p11-primary-action {
  min-width: 172px;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.p11-primary-action.is-ready-to-check {
  border-color: #c2410c;
  background: linear-gradient(135deg, #f97316, #7c3aed);
  box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.34);
  animation: p11-ready-pulse 0.9s ease-in-out 3;
}

.p11-primary-action.is-running {
  border-color: #5b4bc4;
  background: #6657c8;
}

.p11-primary-action.is-complete {
  border-color: #15803d;
  background: #16803c;
}

.p11-primary-action.has-problems {
  border-color: #c2410c;
  background: #ea580c;
}

.p11-review-actions > #p11CheckSummary {
  margin-left: auto;
}

@keyframes p11-ready-pulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.32);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 7px rgba(124, 58, 237, 0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .p11-primary-action.is-ready-to-check {
    animation: none;
  }
}

.p11-file-input {
  display: none;
}

.p11-file-routing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.p11-file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
}

.p11-file-card.role-revision {
  border-left-color: var(--p11-purple);
  background: #fbfaff;
}

.p11-file-card.role-latest {
  border-left-color: var(--green);
  background: #f7fcf8;
}

.p11-file-card.role-old {
  border-left-color: var(--amber);
  background: #fffaf2;
}

.p11-file-card > div,
.p11-file-card strong,
.p11-file-card small {
  min-width: 0;
}

.p11-file-card strong,
.p11-file-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p11-file-card small {
  margin-top: 5px;
  color: var(--muted);
}

.p11-file-card label {
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.p11-file-card select {
  min-height: 34px;
}

.p11-opinion-list,
.p11-check-results {
  display: grid;
  gap: 12px;
}

.p11-review-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  min-width: 0;
}

.p11-opinion-pane,
.p11-workbook-pane,
.p11-review-excel-stack {
  min-width: 0;
}

.p11-opinion-pane {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #cfd7e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 32, 47, 0.06);
}

.p11-segment-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #d6dce8;
  background: #f8fafc;
}

.p11-segment-head strong,
.p11-segment-head span {
  display: block;
}

.p11-segment-head strong {
  font-size: 13px;
}

.p11-segment-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.p11-workspace-mode-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.p11-workspace-mode-tabs button {
  padding: 6px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.p11-workspace-mode-tabs button.active {
  background: #6657c8;
  color: #fff;
}

.p11-review-excel-stack {
  position: static;
  display: grid;
  align-self: start;
  gap: 16px;
}

.p11-review-excel-stack > .p11-workbook-pane {
  position: static;
}

.p11-review-excel-stack .p11-workbook-preview {
  height: 420px;
}

.p11-opinion-list:not(.empty) {
  max-height: 460px;
  align-content: start;
  overflow: auto;
  padding: 10px;
  scrollbar-gutter: stable;
}

.p11-opinion-pane > .p11-opinion-list.empty,
.p11-opinion-pane > .p11-check-results.empty {
  min-height: 110px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
}

.p11-opinion-pane > .p11-review-actions {
  padding: 10px 12px;
  border-top: 1px solid #e3e7ef;
  background: #fcfcfd;
}

.p11-opinion-pane > .p11-result-filters {
  margin: 10px 10px 0;
}

.p11-opinion-pane > .p11-check-results {
  max-height: 680px;
  overflow: auto;
  padding: 10px;
  scrollbar-gutter: stable;
}

.p11-opinion-pane > .p11-other-changes {
  margin: 0 10px 10px;
}

.p11-workbook-pane {
  position: sticky;
  top: 14px;
  overflow: hidden;
  border: 1px solid #cfd7e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 32, 47, 0.07);
}

.p11-workbook-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #d6dce8;
  background: #f8fafc;
}

.p11-workbook-head > div {
  min-width: 0;
}

.p11-workbook-head strong,
.p11-workbook-head span {
  display: block;
}

.p11-workbook-head strong {
  font-size: 13px;
}

.p11-workbook-head span {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p11-workbook-head label {
  flex: 0 0 150px;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.p11-workbook-head select {
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.p11-workbook-preview {
  height: 618px;
  overflow: auto;
  background: #fff;
  scrollbar-gutter: stable;
}

.p11-workbook-preview.empty {
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.p11-workbook-sheet {
  position: relative;
  width: calc(var(--p11-status-width, 0px) + 42px + var(--p11-sheet-columns) * 128px);
  min-width: 100%;
}

.p11-sheet-image {
  position: absolute;
  z-index: 2;
  left: var(--p11-image-left);
  top: var(--p11-image-top);
  width: var(--p11-image-width);
  height: var(--p11-image-height);
  display: block;
  overflow: hidden;
  padding: 3px;
  border: 1px solid #9aa4b2;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.16);
  color: #344054;
  cursor: zoom-in;
}

.p11-sheet-image:hover,
.p11-sheet-image:focus-visible {
  z-index: 6;
  border-color: #6657c8;
  box-shadow: 0 0 0 3px rgba(102, 87, 200, 0.2), 0 8px 22px rgba(15, 23, 42, 0.2);
}

.p11-sheet-image.is-active {
  z-index: 3;
  border: 3px solid #6657c8;
  box-shadow: 0 0 0 4px rgba(102, 87, 200, 0.2), 0 8px 22px rgba(15, 23, 42, 0.16);
}

.p11-sheet-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #fff;
}

.p11-sheet-image span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.76);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p11-sheet-image.is-expanded {
  position: fixed;
  z-index: 40;
  inset: 7vh 7vw;
  width: 86vw;
  height: 86vh;
  padding: 12px;
  border: 2px solid #6657c8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.4);
  cursor: zoom-out;
}

.p11-workbook-preview table {
  width: calc(var(--p11-status-width, 0px) + 42px + var(--p11-sheet-columns) * 128px);
  min-width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  border-collapse: separate;
  font-size: 11px;
  line-height: 1.35;
}

.p11-workbook-preview th,
.p11-workbook-preview td {
  box-sizing: border-box;
  height: 31px;
  padding: 5px 7px;
  border-right: 1px solid #e3e7ef;
  border-bottom: 1px solid #e3e7ef;
  background-clip: padding-box;
  text-align: left;
  vertical-align: middle;
}

.p11-workbook-preview thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  width: 128px;
  min-width: 128px;
  background: #edf1f6;
  color: #475467;
  text-align: center;
  font-weight: 800;
}

.p11-workbook-preview tbody th,
.p11-workbook-preview .p11-sheet-corner {
  position: sticky;
  left: var(--p11-status-width, 0px);
  z-index: 3;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  background: #edf1f6;
  color: #667085;
  text-align: center;
  font-weight: 700;
}

.p11-workbook-preview .p11-sheet-corner {
  z-index: 5;
}

.p11-workbook-preview .p11-status-col,
.p11-workbook-preview .p11-status-corner,
.p11-workbook-preview .p11-row-status-cell {
  width: 54px;
  min-width: 54px;
  max-width: 54px;
}

.p11-workbook-preview .p11-status-corner,
.p11-workbook-preview .p11-row-status-cell {
  position: sticky;
  left: 0;
  z-index: 5;
  padding: 4px;
  background: #edf1f6;
  text-align: center;
}

.p11-workbook-preview .p11-status-corner {
  z-index: 6;
  color: #667085;
  font-size: 10px;
}

.p11-row-status-cell span {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.p11-row-status-cell.status-pending span {
  color: #667085;
}

.p11-row-status-cell.status-applied span {
  border-color: #16803c;
  background: #16803c;
  color: #fff;
}

.p11-row-status-cell.status-warning span {
  width: 25px;
  height: 23px;
  padding-top: 5px;
  border: 0;
  border-radius: 0;
  background: #d97706;
  color: #fff;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  font-size: 11px;
}

.p11-row-status-cell.status-error span {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

.p11-row-status-cell.is-active {
  background: #ede9fe;
  box-shadow: inset 3px 0 #6657c8;
}

.p11-workbook-preview td {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
  overflow: hidden;
  color: #344054;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p11-workbook-preview .p11-row-number-col {
  width: 42px;
}

.p11-workbook-preview .p11-data-col {
  width: 128px;
}

.p11-workbook-preview td.is-formal-cell {
  background: var(--p11-cell-fill, #e9d5ff);
  background: color-mix(in srgb, var(--p11-cell-fill, #e9d5ff) 58%, white);
  font-weight: 700;
}

.p11-workbook-preview tr.is-active-row > th {
  color: #4f46a5;
  background: #ede9fe;
}

.p11-workbook-preview tr.is-active-row td {
  border-top-color: #c4b5fd;
  border-bottom-color: #c4b5fd;
}

.p11-final-preview-table tr.is-active-row td:not(.has-revision-comparison):not(.p11-row-status-cell) {
  border-top-color: #e3e7ef;
  border-bottom-color: #e3e7ef;
}

.p11-workbook-preview td.is-opinion-cell {
  position: relative;
  z-index: 1;
  overflow: visible;
  outline: 3px solid #5b4bc4;
  outline-offset: -3px;
  background: var(--p11-cell-fill, #ddd6fe);
  background: color-mix(in srgb, var(--p11-cell-fill, #ddd6fe) 82%, white);
  color: #201b49;
  font-weight: 900;
  box-shadow: 0 0 0 3px rgba(91, 75, 196, 0.14);
}

.p11-workbook-preview td.has-revision-comparison {
  height: auto;
  min-height: 58px;
  overflow: visible;
  padding: 0;
  white-space: normal;
  vertical-align: top;
}

.p11-cell-comparison {
  min-width: 0;
  border-left: 3px solid #94a3b8;
}

.p11-cell-comparison + .p11-cell-comparison {
  border-top: 1px solid #cbd5e1;
}

.p11-cell-comparison > span {
  min-height: 29px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  overflow-wrap: anywhere;
}

.p11-cell-comparison small {
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.p11-cell-before {
  background: #fff1f2;
  color: #b4232b;
}

.p11-cell-before del {
  font-weight: 800;
  text-decoration-color: #dc2626;
  text-decoration-thickness: 2px;
}

.p11-cell-after {
  border-top: 1px dashed rgba(22, 128, 60, 0.28);
  background: #ecfdf3;
  color: #16803c;
}

.p11-cell-after strong {
  font-weight: 900;
}

.p11-workbook-preview td.has-revision-comparison.status-applied .p11-cell-comparison {
  border-left-color: #16803c;
}

.p11-workbook-preview td.has-revision-comparison.status-warning .p11-cell-comparison {
  border-left-color: #d97706;
}

.p11-workbook-preview td.has-revision-comparison.status-error .p11-cell-comparison {
  border-left-color: #dc2626;
}

.p11-workbook-preview td.has-revision-comparison.status-pending .p11-cell-comparison {
  border-left-color: #667085;
}

.p11-workbook-preview td.has-revision-comparison.is-opinion-cell {
  z-index: 2;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(91, 75, 196, 0.18);
}

.p11-opinion-card,
.p11-result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.p11-opinion-card.is-excluded {
  opacity: 0.62;
}

.p11-opinion-card {
  transition: border-color 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.p11-opinion-card.is-active {
  border-color: #8f82df;
  box-shadow: 0 0 0 2px rgba(102, 87, 200, 0.11);
}

.p11-opinion-card > header,
.p11-result-card > header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.p11-opinion-card > header {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 26px;
  gap: 8px;
  padding: 8px 9px;
}

.p11-opinion-card.is-active > header {
  background: #f6f4ff;
}

.p11-opinion-check,
.p11-opinion-collapse {
  width: 26px;
  height: 26px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding: 0;
  background: #fff;
}

.p11-opinion-check {
  border: 1.5px solid #98a2b3;
  border-radius: 50%;
  color: transparent;
}

.p11-opinion-check:hover,
.p11-opinion-check:focus-visible {
  border-color: #16a34a;
  color: #86e0a3;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.p11-opinion-check.is-checked {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

.p11-opinion-check svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.p11-opinion-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.p11-opinion-number {
  color: #7064bc;
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.p11-opinion-main > span:last-child,
.p11-opinion-main strong,
.p11-opinion-main small {
  min-width: 0;
  display: block;
}

.p11-opinion-main strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p11-opinion-main small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p11-opinion-collapse {
  border: 1px solid transparent;
  border-radius: 5px;
  color: #667085;
  background: transparent;
}

.p11-opinion-collapse:hover,
.p11-opinion-collapse:focus-visible {
  border-color: #c4b5fd;
  background: #fff;
  color: #4f46a5;
}

.p11-opinion-collapse svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.14s ease;
}

.p11-opinion-card.is-collapsed .p11-opinion-collapse svg {
  transform: rotate(-90deg);
}

.p11-opinion-details {
  padding-bottom: 2px;
}

.p11-opinion-card > header > span:nth-child(2) {
  flex: 1;
  color: var(--muted);
  font-size: 12px;
}

.p11-opinion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
}

.p11-color-list {
  display: inline-flex;
  gap: 4px;
}

.p11-color-list i {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 4px;
  background: var(--p11-mark);
}

.p11-opinion-context {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 12px 0;
  line-height: 1.55;
}

.p11-opinion-context strong {
  color: var(--muted);
  font-size: 12px;
}

.p11-quantity-context {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 12px 0;
  padding: 8px 10px;
  border: 1px dashed #d8b4fe;
  border-radius: 6px;
  background: var(--p11-purple-soft);
  color: #5546a6;
  font-size: 12px;
  font-weight: 800;
}

.p11-quantity-context small {
  margin-left: auto;
  color: var(--muted);
  font-weight: 600;
}

.p11-opinion-editor {
  gap: 6px;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.p11-opinion-editor textarea {
  width: 100%;
  resize: vertical;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
}

.p11-result-filters {
  display: inline-flex;
  width: max-content;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.p11-check-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  min-width: 0;
}

.p11-check-main {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cfd7e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 32, 47, 0.06);
}

.p11-compare-pane-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #d6dce8;
  background: #f8fafc;
}

.p11-compare-pane-head strong,
.p11-compare-pane-head span {
  display: block;
}

.p11-compare-pane-head strong {
  font-size: 13px;
}

.p11-compare-pane-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.p11-check-main .p11-result-filters {
  margin: 10px 10px 0;
}

.p11-check-main .p11-check-results {
  max-height: 650px;
  overflow: auto;
  padding: 10px;
  scrollbar-gutter: stable;
}

.p11-result-workbook-pane {
  top: 14px;
}

.p11-result-excel-stack .p11-workbook-preview {
  height: 315px;
}

.p11-result-filters button {
  padding: 7px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.p11-result-filters button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 4px rgba(24, 32, 47, 0.12);
}

.p11-result-card {
  border-left: 5px solid #94a3b8;
}

.p11-result-card.is-active {
  border-color: #6657c8;
  box-shadow: 0 0 0 2px rgba(102, 87, 200, 0.12);
}

.p11-result-card.conclusion-applied {
  border-left-color: var(--green);
}

.p11-result-card.conclusion-partial,
.p11-result-card.conclusion-ambiguous,
.p11-result-card.conclusion-not_bom_verifiable {
  border-left-color: var(--amber);
}

.p11-result-card.conclusion-not_applied,
.p11-result-card.conclusion-not_found {
  border-left-color: var(--red);
}

.p11-result-card > header {
  justify-content: space-between;
}

.p11-result-card > header > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.p11-result-index {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #e2e8f0;
  font-size: 12px;
  font-weight: 900;
}

.p11-conclusion-badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 900;
}

.p11-redline-list {
  display: grid;
  gap: 1px;
  padding: 9px 12px;
  background: #fff;
}

.p11-redline-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding: 7px 0;
  border-bottom: 1px dashed #e3e7ef;
}

.p11-redline-row:last-child {
  border-bottom: 0;
}

.p11-redline-field {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
}

.p11-redline-value,
.p11-redline-row > del,
.p11-redline-row > ins {
  min-width: 0;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.p11-redline-row del,
.p11-redline-value del {
  margin: 0 4px;
  padding: 1px 3px;
  border-radius: 3px;
  background: #fff1f2;
  color: #c0262d;
  text-decoration-color: #dc2626;
  text-decoration-thickness: 2px;
}

.p11-redline-row ins,
.p11-redline-value ins {
  margin: 0 4px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #ecfdf3;
  color: #16803c;
  text-decoration: none;
}

.p11-redline-row ins b,
.p11-redline-value ins b {
  margin-right: 2px;
  font-weight: 900;
}

.p11-redline-empty {
  margin: 10px 12px;
  padding: 10px 11px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  line-height: 1.55;
}

.p11-redline-empty.warn {
  border-color: #f0c36d;
  background: #fff8e8;
  color: #8a5b13;
}

.p11-agent-evidence {
  border-top: 1px solid #e3e7ef;
  background: #fcfcfd;
}

.p11-agent-evidence summary {
  padding: 9px 12px;
  color: #667085;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.p11-agent-evidence-grid {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.p11-agent-evidence-grid > div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
}

.p11-agent-evidence-grid small {
  color: #667085;
  font-weight: 800;
}

.p11-agent-evidence-grid span {
  color: #344054;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.p11-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.p11-result-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border-radius: 6px;
  background: #f8fafc;
}

.p11-result-grid small {
  color: var(--muted);
  font-weight: 800;
}

.p11-result-grid span {
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.p11-result-reason {
  margin: 0;
  padding: 0 12px 12px;
  line-height: 1.6;
}

.p11-result-reason small {
  margin-left: 6px;
  color: var(--muted);
}

.p11-human-review {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fcfcfd;
}

.p11-human-review label {
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.p11-human-review select,
.p11-human-review input {
  min-height: 36px;
}

.p11-other-changes {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.p11-other-changes summary {
  padding: 12px;
  cursor: pointer;
  font-weight: 900;
}

.p11-other-changes > div {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

@media (max-width: 1180px) {
  .p11-review-workspace,
  .p11-check-workspace {
    grid-template-columns: 1fr;
  }

  .p11-workbook-pane {
    position: static;
  }

  .p11-review-excel-stack {
    position: static;
  }

  .p11-opinion-list:not(.empty) {
    max-height: 520px;
  }

  .p11-workbook-preview {
    height: 520px;
  }

  .p11-result-excel-stack .p11-workbook-preview,
  .p11-check-main .p11-check-results {
    height: auto;
    max-height: 520px;
  }
}

@media (max-width: 760px) {
  .p11-file-card,
  .p11-result-grid,
  .p11-human-review {
    grid-template-columns: 1fr;
  }

  .p11-step-heading,
  .p11-result-card > header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .p11-workbook-head {
    align-items: stretch;
    flex-direction: column;
  }

  .p11-workbook-head label {
    flex-basis: auto;
    width: 100%;
  }

  .p11-workbook-preview {
    height: 430px;
  }

  .p11-redline-row {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 7px;
  }

  .p11-opinion-card > header {
    grid-template-columns: 26px minmax(0, 1fr) 26px;
  }

  .p11-color-list {
    display: none;
  }

  .p11-quantity-context {
    align-items: flex-start;
    flex-direction: column;
  }

  .p11-quantity-context small {
    margin-left: 0;
  }
}

.drawing-code-missing {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 8px;
  background: rgba(15, 23, 42, 0.62);
}

.pdf-panel {
  width: min(96vw, 1280px);
  height: min(98vh, calc(min(96vw, 1280px) / 1.414 + 100px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pdf-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.pdf-panel header div {
  display: flex;
  gap: 8px;
}

.pdf-panel iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--muted);
  font-weight: 800;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge.blue {
  color: #0b4dd8;
  background: #e8efff;
}

.badge.orange {
  color: #a24506;
  background: #fff2df;
}

.badge.green {
  color: #166534;
  background: #dcfce7;
}

.global-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.64);
  backdrop-filter: blur(4px);
}

.global-settings-panel {
  width: min(680px, 96vw);
  max-height: min(820px, 94vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.34);
}

.global-settings-header,
.global-settings-footer,
.global-settings-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.global-settings-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.global-settings-header h3,
.global-settings-section h4,
.global-settings-section-title p {
  margin: 0;
}

.global-settings-header h3 {
  margin-top: 4px;
  font-size: 22px;
}

.global-settings-body {
  overflow: auto;
  padding: 20px;
}

.global-settings-section {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.global-settings-section-title p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.global-settings-section select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.llm-provider-meta {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(260px, 1.3fr);
  gap: 10px;
}

.llm-provider-meta span {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid #dbe4f1;
  border-radius: 8px;
  background: #f8fafc;
}

.llm-provider-meta small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.llm-provider-meta strong {
  overflow: hidden;
  color: #24416f;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-settings-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.global-settings-footer > div {
  display: flex;
  gap: 10px;
}

.settings-save-button {
  min-width: 112px;
  padding: 8px 16px;
}

.welding-summary-row td {
  vertical-align: middle;
}

.welding-summary-value {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 118px;
  white-space: nowrap;
}

.welding-summary-value strong {
  color: #0f766e;
  font-size: 13px;
}

.bom-check-summary-row.missing .welding-summary-value strong {
  color: #b42318;
}

.welding-summary-value small {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
}

.bom-check-family-member.welding-family-member {
  flex-wrap: wrap;
  max-width: 520px;
  padding: 7px 8px;
}

.welding-member-control,
.welding-rail-control,
.welding-family-status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 6px 8px;
  border: 1px solid #67c6b8;
  border-radius: 7px;
  background: #ecfdf8;
  color: #075e54;
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
}

.welding-family-status {
  max-width: 420px;
}

.welding-family-status strong,
.welding-rail-control > strong {
  color: #064e46;
}

.welding-family-status small {
  flex-basis: 100%;
  color: #397a72;
  font-weight: 700;
}

.welding-model-choices {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.welding-model-choices label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid #9bd8cf;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.welding-model-choices label:has(input:checked) {
  border-color: #0f8b7b;
  background: #d9f8f1;
  box-shadow: inset 0 0 0 1px #0f8b7b;
}

.welding-model-choices input {
  margin: 0;
  accent-color: #0f8b7b;
}

.welding-model-choices small {
  color: #397a72;
  font-weight: 700;
}

.welding-joint-label,
.welding-rail-control label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.welding-joint-label input,
.welding-rail-control input {
  width: 92px;
  min-height: 29px;
  padding: 4px 7px;
}

.welding-rail-control select {
  min-height: 29px;
  max-width: 250px;
  padding: 4px 7px;
}

.welding-joint-label small,
.welding-rail-control label small {
  color: #397a72;
  font-weight: 700;
}

.pdf-import-capability {
  display: block;
  margin-top: 4px;
  color: #0f766e;
}

.pdf-import-capability.unavailable {
  color: #b42318;
}

.pdf-import-review-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.72);
}

.pdf-import-review-panel {
  width: min(96vw, 1540px);
  height: min(94vh, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.35);
}

.pdf-import-review-header,
.pdf-import-review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-color: var(--line);
  background: #fff;
}

.pdf-import-review-header {
  border-bottom: 1px solid var(--line);
}

.pdf-import-review-header > div,
.pdf-import-review-footer > div,
.pdf-import-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pdf-import-review-header strong {
  font-size: 16px;
}

.pdf-import-review-footer {
  border-top: 1px solid var(--line);
}

.pdf-import-review-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 0.88fr) minmax(560px, 1.12fr);
  background: #e2e8f0;
}

.pdf-import-source-pane,
.pdf-import-data-pane {
  min-width: 0;
  min-height: 0;
}

.pdf-import-source-pane {
  position: relative;
  padding: 10px;
  border-right: 1px solid #94a3b8;
}

.pdf-import-source-pane iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.recognition-source-view {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #f8fafc;
}

.recognition-pdf-source {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
}

.recognition-source-canvas {
  position: relative;
  min-height: 0;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #dbe2ea;
}

.recognition-source-canvas img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
  background: #fff;
  object-fit: contain;
}

.recognition-source-highlight {
  position: absolute;
  z-index: 2;
  border: 2px solid #16a34a;
  border-radius: 3px;
  background: rgba(34, 197, 94, 0.14);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.84), 0 0 0 4px rgba(22, 163, 74, 0.22);
  pointer-events: none;
}

.recognition-source-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.recognition-workbook-source {
  height: 100%;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
}

.recognition-source-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.recognition-source-table th,
.recognition-source-table td {
  max-width: 260px;
  padding: 7px 8px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.recognition-source-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f1f5f9;
}

.recognition-source-table td:first-child,
.recognition-source-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 48px;
  background: #f8fafc;
  text-align: center;
}

.recognition-source-table td.is-selected {
  outline: 2px solid #16a34a;
  outline-offset: -2px;
  background: #ecfdf3;
}

.recognition-source-empty {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #64748b;
  text-align: center;
}

.pdf-import-data-pane {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 12px;
  background: #f8fafc;
}

.pdf-import-loading {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  min-height: 240px;
  color: #334155;
  text-align: center;
}

.pdf-import-loading.is-error strong {
  color: #b42318;
}

.pdf-import-loading.is-error small {
  max-width: 520px;
  color: #7f1d1d;
  font-weight: 750;
}

.pdf-import-loading.is-error .pdf-import-spinner {
  border: 0;
  color: #b42318;
  animation: none;
}

.pdf-import-loading.is-error .pdf-import-spinner::before {
  content: "!";
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 3px solid currentColor;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 900;
}

.pdf-import-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #bfdbfe;
  border-top-color: #1463ff;
  border-radius: 50%;
  animation: pdf-import-spin 0.9s linear infinite;
}

@keyframes pdf-import-spin {
  to { transform: rotate(360deg); }
}

#pdfImportReviewContent {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
}

.recognition-review-content {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
}

.recognition-review-toolbar {
  display: grid;
  gap: 8px;
}

.recognition-review-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.recognition-summary-chip {
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.recognition-review-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recognition-review-filters .active {
  border-color: #1463ff;
  color: #fff;
  background: #1463ff;
}

.recognition-item-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 3px;
}

.recognition-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.recognition-item:hover,
.recognition-item.is-selected {
  border-color: #7aa7ef;
  box-shadow: 0 0 0 2px rgba(20, 99, 255, 0.1);
}

.recognition-status-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 950;
}

.recognition-item.status-recognized .recognition-status-icon { color: #15803d; background: #ecfdf3; }
.recognition-item.status-excluded .recognition-status-icon { color: #64748b; background: #f1f5f9; }
.recognition-item.status-needs_review .recognition-status-icon { color: #b45309; background: #fff7ed; }
.recognition-item.status-unrecognized .recognition-status-icon { color: #b42318; background: #fef2f2; }

.recognition-item-copy {
  min-width: 0;
}

.recognition-item-copy strong,
.recognition-item-copy small {
  display: block;
}

.recognition-item-copy strong {
  color: #1e293b;
}

.recognition-item-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: #64748b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recognition-status-label {
  color: #475569;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.recognition-info {
  position: relative;
}

.recognition-info-button {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #94a3b8;
  border-radius: 50%;
  background: #fff;
  color: #475569;
  cursor: help;
  font-size: 13px;
  font-weight: 900;
}

.recognition-info-button:hover,
.recognition-info-button:focus-visible,
.recognition-info.is-pinned .recognition-info-button {
  border-color: #1463ff;
  color: #fff;
  background: #1463ff;
}

.recognition-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 90;
  width: min(360px, 72vw);
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
  color: #334155;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.recognition-info:hover .recognition-popover,
.recognition-info:focus-within .recognition-popover,
.recognition-info.is-pinned .recognition-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.recognition-popover dl {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 5px 8px;
  margin: 0;
}

.recognition-popover dt { color: #64748b; font-weight: 750; }
.recognition-popover dd { margin: 0; overflow-wrap: anywhere; }

.recognition-popover label {
  display: grid;
  gap: 4px;
  font-weight: 800;
}

.recognition-popover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recognition-popover-actions button.is-selected {
  border-color: #1463ff;
  color: #fff;
  background: #1463ff;
}

.pdf-import-cell-struck .pdf-import-cell-input {
  color: #64748b;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.pdf-import-cell-uncertain {
  background: #fff7df !important;
  box-shadow: inset 0 0 0 2px #f59e0b;
}

.pdf-import-page-selection {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow: auto;
  padding: 18px;
}

.pdf-import-page-selection h4 {
  margin: 3px 0 6px;
  font-size: 20px;
}

.pdf-import-page-selection p {
  margin: 0;
}

.pdf-import-toolbar,
.pdf-import-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pdf-import-toolbar label {
  min-width: min(100%, 420px);
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.pdf-import-toolbar select {
  min-width: 0;
}

.pdf-import-page-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.pdf-import-page-controls > strong,
.pdf-import-page-controls > small {
  flex: 0 0 auto;
}

.pdf-import-page-selector {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  gap: 6px;
  overflow-x: auto;
  padding: 2px;
}

.pdf-import-page-button {
  min-width: 34px;
  min-height: 30px;
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #475569;
  background: #f8fafc;
  font-weight: 850;
  cursor: pointer;
}

.pdf-import-page-button[aria-pressed="true"] {
  border-color: #1463ff;
  color: #fff;
  background: #1463ff;
}

.pdf-import-page-button:focus-visible {
  outline: 3px solid rgba(20, 99, 255, 0.28);
  outline-offset: 1px;
}

.pdf-import-warnings {
  padding: 9px 11px;
  border: 1px solid #f4c063;
  border-radius: 8px;
  color: #92400e;
  background: #fff7e6;
  font-size: 12px;
  font-weight: 700;
}

.pdf-import-warnings div + div {
  margin-top: 4px;
}

.pdf-import-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.pdf-import-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.pdf-import-table th,
.pdf-import-table td {
  min-width: 132px;
  padding: 0;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.pdf-import-table th:first-child,
.pdf-import-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 48px;
  width: 48px;
  padding: 7px;
  color: #64748b;
  background: #f8fafc;
  text-align: center;
}

.pdf-import-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 7px;
  color: #475569;
  background: #f1f5f9;
  text-align: center;
}

.pdf-import-table thead th:first-child {
  z-index: 4;
}

.pdf-import-cell-input {
  width: 100%;
  min-width: 132px;
  min-height: 38px;
  padding: 7px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
}

.pdf-import-cell-input:focus {
  position: relative;
  z-index: 1;
  outline: 2px solid #1463ff;
  outline-offset: -2px;
  background: #fff;
}

.pdf-import-cell-low {
  background: #fff7df !important;
}

.pdf-import-cell-mark {
  background: #fee2e2 !important;
}

.pdf-import-cell-mark .pdf-import-cell-input::placeholder {
  color: #b42318;
  font-weight: 800;
  opacity: 1;
}

.pdf-import-pagination {
  justify-content: center;
}

@media (min-width: 981px) {
  .app-shell:has(section.page#p4.active) .workspace {
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-shell:has(section.page#p4.active) #p4.active {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-shell:has(section.page#p4.active) #p4.active > .panel {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .app-shell:has(section.page#p4.active) #p4.active > .panel > .category-sections {
    min-height: 0;
    overflow: auto;
  }

  .app-shell:has(section.page#p4.active) #p4.active .category-sections > .category-section:only-child {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-shell:has(section.page#p4.active) #p4.active .category-sections > .category-section:only-child .parts-table {
    height: 100%;
    max-height: none;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .page-tabs {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }

  .tab-button {
    text-align: center;
  }

  .content-grid.two-col,
  .drawing-shell,
  .drawing-relations,
  .rack-diagram-shell,
  .upload-grid,
  .upload-grid.p3-controls,
  .kpi-grid,
  .key-grid,
  .confirm-fields,
  .consumable-fields,
  .param-grid,
  .chem-ratio-box,
  .engineering-config,
  .accessory-rule-layout,
  .login-panel {
    grid-template-columns: 1fr;
  }

  .drawing-contribution-form {
    grid-template-columns: 1fr;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-settings-button {
    width: 100%;
  }

  .pdf-import-review-modal {
    padding: 6px;
  }

  .pdf-import-review-panel {
    width: 99vw;
    height: 98vh;
  }

  .pdf-import-review-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 0.8fr) minmax(360px, 1.2fr);
  }

  .pdf-import-source-pane {
    border-right: 0;
    border-bottom: 1px solid #94a3b8;
  }

  .pdf-import-toolbar,
  .pdf-import-page-controls,
  .pdf-import-review-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .pdf-import-page-selector {
    width: 100%;
    flex: 0 0 auto;
  }

  .pdf-import-review-footer > div {
    justify-content: flex-end;
  }

  .rack-summary-grid,
  .rms-parameter-layout,
  .rms-overview-grid,
  .rms-rule-table,
  .rms-field-grid,
  .aisle-type-grid,
  .aisle-type-card header {
    grid-template-columns: 1fr;
  }

  .rms-field.wide {
    grid-column: span 1;
  }

  .rms-source-grid {
    grid-template-columns: 120px minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .global-settings-modal {
    padding: 6px;
  }

  .global-settings-panel {
    width: 100%;
    max-height: 98vh;
  }

  .global-settings-header,
  .global-settings-footer,
  .global-settings-section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .global-settings-footer > div,
  .global-settings-footer button {
    width: 100%;
  }

  .llm-provider-meta {
    grid-template-columns: 1fr;
  }

  .project-import-candidate-list {
    grid-template-columns: 1fr;
  }

  .project-import-card {
    grid-template-columns: 1fr;
  }

  .project-import-preview {
    min-height: 112px;
  }

  .recognition-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .recognition-status-label {
    display: none;
  }

  .recognition-popover {
    position: fixed;
    right: 8px;
    bottom: 8px;
    top: auto;
    left: 8px;
    width: auto;
    max-height: 58vh;
    overflow: auto;
  }

  .recognition-file-actions,
  .metric-evidence-item {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .recognition-file-actions {
    flex-direction: column;
  }
}
