:root {
  --ink: #182126;
  --muted: #65727a;
  --line: #dce4e8;
  --border: var(--line);
  --soft: #f5f7f8;
  --panel: #ffffff;
  --panel-muted: #f8fbfe;
  --brand-blue: #002f6c;
  --brand-green: #509e2f;
  --brand-blue-soft: #eaf1fb;
  --brand-green-soft: #edf7e8;
  --accent: var(--brand-green);
  --accent-ink: #285d17;
  --danger: #b42318;
  --warn: #b35c00;
  --quoted: #1f5fbf;
  --quoted-soft: #eaf2ff;
  --good: #16723b;
  --sidebar: #002f6c;
  --sidebar-soft: #073f86;
  --shadow: 0 18px 48px rgba(0, 47, 108, 0.12);
}

/* Inquiry, customer follow-up and contract-driven order workbenches */
.workbench-intro {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.workbench-intro h2 {
  max-width: 880px;
  margin: 4px 0 8px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.2;
}

.workbench-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.workbench-mode-tab {
  min-height: 92px;
  padding: 16px 18px;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.workbench-mode-tab strong,
.workbench-mode-tab span {
  display: block;
}

.workbench-mode-tab strong {
  margin-bottom: 7px;
  font-size: 16px;
}

.workbench-mode-tab span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.workbench-mode-tab.active {
  box-shadow: inset 0 4px 0 var(--brand-green);
  background: color-mix(in srgb, var(--brand-green) 8%, var(--panel));
}

.workflow-step-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 18px 0 24px;
  border-block: 1px solid var(--line);
}

.workflow-step-strip span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 10px 14px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
}

.workflow-step-strip span:last-child {
  border-right: 0;
}

.workflow-step-strip b {
  color: var(--brand-green);
  font-variant-numeric: tabular-nums;
}

.contract-upload-band {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 0.8fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
}

.contract-upload-band h3,
.contract-upload-band p {
  margin: 0;
}

.contract-upload-band p {
  margin-top: 5px;
  color: var(--muted);
}

.contract-upload-band .message {
  grid-column: 1 / -1;
}

.contract-draft-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.contract-draft-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.contract-draft-card.completed {
  border-left: 4px solid var(--good);
}

.contract-draft-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.contract-draft-head h3,
.contract-draft-head p {
  margin: 0;
}

.contract-draft-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.contract-draft-summary dt {
  color: var(--muted);
  font-size: 12px;
}

.contract-draft-summary dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.confirmation-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.material-demand-details summary {
  margin: 6px 0;
  color: var(--brand-blue);
  cursor: pointer;
}

.material-demand-details div {
  display: grid;
  gap: 2px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.material-demand-details span {
  color: var(--muted);
}

.stacked-actions {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

@media (max-width: 960px) {
  .contract-draft-grid {
    grid-template-columns: 1fr;
  }

  .contract-upload-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .workbench-mode-tabs,
  .workflow-step-strip,
  .contract-draft-summary {
    grid-template-columns: 1fr;
  }

  .workbench-mode-tab {
    min-height: 0;
  }

  .workflow-step-strip span {
    min-height: 48px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workflow-step-strip span:last-child {
    border-bottom: 0;
  }

  .contract-draft-card {
    padding: 14px;
  }

  .contract-draft-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.sidebar-release {
  margin: auto 16px 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  text-align: center;
}

.material-operations-workbench,
.material-run-list {
  display: grid;
  gap: 20px;
}

.release-chip {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.approval-strip span {
  padding: 12px;
  border: 1px solid var(--line);
  background: #f7f9fb;
}

.approval-strip small,
.approval-strip strong,
.approval-strip em {
  display: block;
}

.approval-strip em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.inventory-init-row-form {
  min-width: 1180px;
  display: grid;
  grid-template-columns: 1.15fr 1.3fr 1.2fr 1.2fr 0.9fr 1.3fr 0.8fr auto;
  gap: 8px;
  align-items: start;
}

.inventory-init-row-form > div {
  display: grid;
  gap: 6px;
}

.inventory-init-row-form input,
.material-run-card input,
.material-run-card select {
  min-width: 0;
  width: 100%;
}

.inventory-workflow-actions {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.inventory-workflow-actions form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.material-run-card table {
  min-width: 1180px;
}

.material-run-card .compact-inline-form,
.material-operations-workbench .compact-inline-form {
  grid-template-columns: repeat(2, minmax(110px, 1fr));
}

@media (max-width: 760px) {
  .approval-strip {
    grid-template-columns: 1fr;
  }

  .inventory-workflow-actions,
  .inventory-workflow-actions form {
    align-items: stretch;
    flex-direction: column;
  }

  .material-run-card .compact-inline-form,
  .material-operations-workbench .compact-inline-form {
    grid-template-columns: 1fr;
  }
}

.release-control-band {
  border-top: 3px solid #16815f;
}

.release-approval-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.release-approval-item {
  display: grid;
  align-content: start;
  gap: 14px;
}

.release-approval-item .primary-btn {
  width: fit-content;
}

.compact-list {
  margin: 8px 0 12px;
  padding-left: 20px;
  color: var(--muted);
}

.compact-list li + li {
  margin-top: 4px;
}

.subpanel {
  margin: 16px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.subpanel legend {
  padding: 0 6px;
  font-weight: 700;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
}

@media (max-width: 980px) {
  .release-approval-list {
    grid-template-columns: 1fr;
  }
}

.regulatory-legal-notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 18px;
  padding: 14px 16px;
  border: 1px solid #d6a34a;
  border-left: 4px solid #b87814;
  background: #fff9eb;
  color: #593f16;
  font-size: 13px;
}

.regulatory-legal-notice span:last-child {
  grid-column: 2;
  color: #725729;
}

.regulatory-assessment-list {
  display: grid;
  gap: 12px;
}

.regulatory-assessment {
  border: 1px solid var(--line, #dbe2ea);
  background: #fff;
}

.regulatory-assessment > summary {
  min-height: 68px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.regulatory-assessment > summary::-webkit-details-marker {
  display: none;
}

.regulatory-assessment > summary > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.regulatory-assessment > summary span {
  overflow-wrap: anywhere;
}

.regulatory-form,
.regulatory-result {
  padding: 16px;
  border-top: 1px solid var(--line, #dbe2ea);
}

.regulatory-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.regulatory-meta span {
  padding: 9px 10px;
  background: #f4f7fa;
  color: #475569;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.regulatory-input-grid textarea {
  min-height: 92px;
}

.regulatory-input-grid input:disabled,
.regulatory-input-grid textarea:disabled,
.regulatory-input-grid select:disabled {
  background: #f4f6f8;
  color: #64748b;
  opacity: 1;
}

.regulatory-findings {
  display: grid;
  gap: 8px;
}

.regulatory-finding {
  padding: 12px 14px;
  border-left: 3px solid #c99330;
  background: #fffbf2;
}

.regulatory-finding.is-blocker {
  border-left-color: #b42318;
  background: #fff5f4;
}

.regulatory-finding > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.regulatory-finding p {
  margin: 7px 0;
  color: #475569;
}

.regulatory-finding small {
  color: #334155;
}

.regulatory-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #dbe2ea);
}

.regulatory-source-table code {
  font-size: 11px;
  white-space: nowrap;
}

.costing-compliance-strip {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 10px 14px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--line, #dbe2ea);
  background: #f7faf8;
}

.costing-compliance-strip > div {
  display: grid;
  gap: 2px;
}

.costing-compliance-strip > div span,
.costing-compliance-strip > span {
  color: #52606d;
  font-size: 12px;
}

@media (max-width: 900px) {
  .regulatory-legal-notice,
  .regulatory-meta {
    grid-template-columns: 1fr;
  }

  .regulatory-legal-notice span:last-child {
    grid-column: 1;
  }

  .regulatory-assessment > summary,
  .regulatory-assessment > summary > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .costing-compliance-strip {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f2f6fb;
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

small {
  font-size: 12px;
  line-height: 1.45;
}

button {
  border: 0;
  cursor: pointer;
  line-height: 1.2;
}

.hidden {
  display: none !important;
}

.password-change-panel {
  width: min(680px, 100%);
  margin: 32px auto;
}

.password-change-panel h2 {
  margin: 4px 0 10px;
  font-size: 22px;
}

.account-security-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(420px, 1.28fr);
  gap: 18px;
  align-items: start;
}

.account-security-layout .password-change-panel {
  width: 100%;
  margin: 0;
}

.account-password-panel {
  grid-column: 1 / -1;
}

.account-personal-panel h2 {
  margin: 4px 0 16px;
  font-size: 20px;
}

.verification-status-row,
.verification-request-row,
.inline-verification-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.verification-status-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.inline-verification-form {
  margin-top: 12px;
}

.inline-verification-form input {
  width: min(220px, 100%);
}

.compact-btn {
  min-height: 36px;
  padding: 8px 12px;
}

.account-profile-panel h2 {
  margin: 4px 0 22px;
  font-size: 24px;
}

.account-profile-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.account-profile-list div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.account-profile-list dt {
  color: var(--muted);
}

.account-profile-list dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.account-security-note {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .account-security-layout {
    grid-template-columns: 1fr;
  }
}

.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(520px, 0.92fr) minmax(600px, 1.08fr);
  background: #f6f8f9;
}

.login-panel {
  padding: clamp(36px, 5vw, 76px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
  border-right: 1px solid #e2e8eb;
}

.login-brand {
  position: relative;
  width: min(300px, 100%);
  height: 108px;
  margin: 0 0 34px;
  overflow: hidden;
}

.login-brand .brand-logo-source {
  position: absolute;
  top: -105px;
  left: -8px;
  width: 320px;
  height: 320px;
  display: block;
  max-width: none;
}

.login-heading {
  max-width: 520px;
}

.brand-logo {
  display: block;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-green);
  font-size: 13px;
  font-weight: 800;
}

.login-panel h1,
.login-aside h2,
.topbar h1 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-panel h1 {
  max-width: 100%;
  font-size: clamp(36px, 3.1vw, 48px);
  font-weight: 800;
  white-space: nowrap;
  text-wrap: balance;
}

.login-copy {
  max-width: 480px;
  margin: 16px 0 30px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 16px;
  text-wrap: pretty;
}

.login-form {
  display: grid;
  gap: 16px;
  max-width: 480px;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.remember-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand-blue);
}

.account-entry {
  max-width: 480px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding: 16px 0 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.account-entry strong {
  color: var(--ink);
}

label {
  display: grid;
  gap: 8px;
  color: #334046;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  resize: vertical;
  min-height: 82px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 47, 108, 0.12);
}

.login-form button,
.primary-btn,
.topbar-actions button,
.inline-btn,
.secondary-btn {
  min-height: 44px;
  border-radius: 6px;
  background: var(--brand-blue);
  color: #fff;
  font-weight: 800;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow-wrap: anywhere;
}

.login-form button {
  margin-top: 4px;
  min-height: 50px;
  font-size: 16px;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.login-form button:hover {
  background: #073f86;
  box-shadow: 0 10px 24px rgba(0, 47, 108, 0.18);
  transform: translateY(-1px);
}

.login-form button:active {
  transform: translateY(1px);
}

.login-form button:focus-visible {
  outline: 3px solid rgba(80, 158, 47, 0.4);
  outline-offset: 3px;
}

.login-form .login-link-button {
  min-height: 36px;
  margin-top: -6px;
  padding: 0;
  justify-content: flex-start;
  background: transparent;
  color: var(--brand-blue);
  font-size: 13px;
  box-shadow: none;
}

.login-form .login-link-button:hover {
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  transform: none;
}

.login-security-panel {
  width: min(480px, 100%);
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.login-security-panel h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.login-security-panel > p:not(.eyebrow) {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.compact-login-form {
  gap: 12px;
}

.admin-account-section {
  grid-column: 1 / -1;
}

.account-admin-list {
  display: grid;
  gap: 10px;
}

.account-admin-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.account-admin-item > summary {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.1fr) minmax(120px, 0.7fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.account-admin-item > summary::-webkit-details-marker {
  display: none;
}

.account-admin-item > summary::after {
  content: "+";
  color: var(--brand-blue);
  font-size: 22px;
  line-height: 1;
}

.account-admin-item[open] > summary::after {
  content: "−";
}

.account-admin-item > summary span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.account-admin-item > summary strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.account-admin-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.account-admin-actions form {
  display: grid;
  align-content: start;
  gap: 10px;
  padding-top: 14px;
}

.account-admin-actions .admin-profile-form {
  grid-column: span 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-admin-actions .admin-profile-form h4,
.account-admin-actions .admin-profile-form .message,
.account-admin-actions .admin-profile-form button {
  grid-column: 1 / -1;
}

.account-admin-actions h4 {
  margin: 0;
  font-size: 14px;
}

@media (max-width: 900px) {
  .account-admin-item > summary {
    grid-template-columns: 1fr auto;
  }

  .account-admin-item > summary span:nth-of-type(2),
  .account-admin-item > summary span:nth-of-type(3) {
    display: none;
  }

  .account-admin-actions {
    grid-template-columns: 1fr;
  }

  .account-admin-actions .admin-profile-form {
    grid-column: auto;
    grid-template-columns: 1fr;
  }
}

.inline-btn.secondary,
.secondary-btn,
.topbar-actions button {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.login-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(34px, 5vh, 58px);
  padding: clamp(42px, 5.2vw, 78px);
  overflow: hidden;
  background: #073a78;
  color: #fff;
}

.login-aside::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 24%;
  height: 24%;
  background: #245f4a;
  opacity: 0.7;
  pointer-events: none;
}

.login-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 54px 54px;
  pointer-events: none;
}

.login-aside .eyebrow {
  color: #d7f7cb;
}

.aside-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.login-aside h2 {
  position: relative;
  max-width: 700px;
  font-size: clamp(38px, 3.7vw, 56px);
  font-weight: 800;
  z-index: 1;
  text-wrap: balance;
}

.login-aside h2 span {
  display: block;
}

.aside-copy p:not(.eyebrow) {
  max-width: 580px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 16px;
  line-height: 1.8;
  text-wrap: pretty;
}

.login-flow {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.login-flow-item {
  display: grid;
  gap: 9px;
  align-content: start;
  min-height: 136px;
  padding: 22px 18px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.login-flow-item:last-child {
  border-right: 0;
}

.login-flow-item span {
  display: block;
  color: #d7f7cb;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.login-flow-item strong {
  color: #fff;
  font-size: 16px;
}

.login-flow-item small {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.65;
  text-wrap: pretty;
}

.login-proof {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.7;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
}

.login-proof span {
  white-space: nowrap;
}

.login-proof span:not(:last-child)::after {
  content: "/";
  padding: 0 9px;
  color: rgba(255, 255, 255, 0.38);
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.flow-step {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.flow-step span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--brand-blue);
  font-weight: 800;
  font-size: 12px;
}

.flow-step strong {
  margin-top: 10px;
  font-size: 15px;
}

.flow-step small {
  color: var(--muted);
  font-weight: 700;
}

.flow-step.good {
  border-color: rgba(22, 114, 59, 0.24);
  background: var(--brand-green-soft);
}

.flow-step.warn {
  border-color: rgba(179, 92, 0, 0.24);
  background: #fff8ee;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mini-metrics span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
}

.mini-metrics strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 18px;
}

.detail-line {
  margin: 9px 0;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  background: #fff;
}

.empty-state.compact {
  padding: 14px;
  font-size: 13px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: var(--sidebar);
  color: #dbe8e9;
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: grid;
  gap: 10px;
  align-items: start;
  padding: 0 6px 14px;
}

.sidebar-logo {
  position: relative;
  width: 174px;
  height: 62px;
  overflow: hidden;
  background: #fff;
  border-radius: 6px;
}

.sidebar-logo-source {
  position: absolute;
  top: -54px;
  left: 1px;
  width: 164px;
  height: 164px;
  max-width: none;
}

.sidebar-brand-copy {
  min-width: 0;
}

.sidebar-brand-copy strong,
.sidebar-brand-copy span {
  display: block;
  letter-spacing: 0;
}

.sidebar-menu-toggle {
  display: none;
}

.sidebar-product-name {
  color: #a9d994;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-brand-copy strong {
  margin-top: 3px;
  color: #fff;
  font-size: 19px;
  line-height: 1.3;
}

.sidebar-brand-copy #userRole {
  margin-top: 5px;
  color: #b8cbd5;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sidebar-focus {
  flex: 0 0 auto;
  margin: 0 4px 12px;
  padding: 11px 12px 12px;
  border-left: 3px solid var(--brand-green);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-focus span,
.sidebar-focus strong {
  display: block;
  letter-spacing: 0;
}

.sidebar-focus span {
  color: #a9d994;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-focus strong {
  margin-top: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0 4px 12px;
}

.nav-section {
  display: grid;
  gap: 4px;
}

.nav-section-label {
  margin: 0;
  padding: 0 8px 3px;
  color: #8faab6;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}

.nav-section:first-child .nav-section-label {
  color: #a9d994;
}

.nav-section-items {
  display: grid;
  gap: 3px;
}

.nav button,
.logout {
  width: 100%;
  min-height: 50px;
  border-radius: 6px;
  padding: 7px 9px;
  text-align: left;
  background: transparent;
  color: #bfd0d3;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.nav button:hover,
.nav button.active {
  background: var(--sidebar-soft);
  color: #fff;
}

.nav button.active {
  box-shadow: inset 3px 0 0 var(--brand-green);
}

.nav button:active,
.logout:active {
  transform: translateY(1px);
}

.nav button:focus-visible,
.logout:focus-visible,
.sidebar-menu-toggle:focus-visible {
  outline: 2px solid #a9d994;
  outline-offset: 2px;
}

.nav-marker {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a9d994;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.nav button.active .nav-marker {
  border-color: rgba(169, 217, 148, 0.56);
  background: rgba(80, 158, 47, 0.2);
  color: #fff;
}

.nav-copy,
.nav-copy strong,
.nav-copy small {
  display: block;
  min-width: 0;
}

.nav-copy strong {
  color: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0;
}

.nav-copy small {
  margin-top: 2px;
  color: #91acb9;
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.nav button:hover .nav-copy small,
.nav button.active .nav-copy small {
  color: #c4d7df;
}

.sidebar-footer {
  flex: 0 0 auto;
  padding: 10px 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-footer .sidebar-release {
  margin: 0 0 4px;
}

.logout {
  min-height: 38px;
  margin-top: 4px;
  display: flex;
  justify-content: center;
  padding: 6px 10px;
  color: #9db4b8;
  text-align: center;
}

.workspace {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: #f7f9fc;
}

.topbar {
  height: 86px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 249, 252, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 {
  font-size: 28px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}

.content {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 28px 32px 42px;
}

.content > * {
  min-width: 0;
  max-width: 100%;
}

.section {
  margin-bottom: 28px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

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

.section-head.compact-head {
  align-items: center;
  padding: 12px 12px 0;
}

.section-head.compact-head h2 {
  font-size: 16px;
}

.summary-pair {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-pair span {
  min-width: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-pair strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 22px;
}

.followup-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 16px;
}

.followup-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.followup-column.urgent {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fffafa;
}

.followup-column.quoted {
  border-color: rgba(31, 95, 191, 0.24);
  background: #f8fbff;
}

.followup-column.won {
  border-color: rgba(22, 114, 59, 0.24);
  background: #fbfffb;
}

.followup-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.followup-head h3 {
  margin: 0;
  font-size: 15px;
}

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

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

.followup-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 0.62fr) minmax(42px, auto);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 11px 12px;
}

.followup-item.danger {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff5f3;
  box-shadow: inset 3px 0 0 var(--danger);
}

.followup-item.quoted {
  border-color: rgba(31, 95, 191, 0.22);
  background: #f5f9ff;
  box-shadow: inset 3px 0 0 var(--quoted);
}

.followup-item.good {
  border-color: rgba(22, 114, 59, 0.22);
  background: #f5fff7;
  box-shadow: inset 3px 0 0 var(--good);
}

.month-picker {
  min-width: 190px;
}

.inquiry-kpis {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.source-kpis {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.source-period,
.quality-grade {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.source-table-wrap { border-top: 0; }
.source-table th, .source-table td { min-width: 96px; }
.source-table th:first-child, .source-table td:first-child,
.source-table th:last-child, .source-table td:last-child { min-width: 180px; }
.quality-grade { margin-top: 5px; min-height: 22px; padding: 2px 6px; }
.quality-grade.grade-a, .quality-grade.grade-b { border-color: rgba(22, 114, 59, 0.28); background: #f5fff7; color: var(--good); }
.quality-grade.grade-c { border-color: rgba(179, 92, 0, 0.26); background: #fff8ee; color: var(--warn); }
.quality-grade.grade-d { border-color: rgba(180, 35, 24, 0.24); background: #fff5f3; color: var(--danger); }

.review-notes {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.push-list {
  display: grid;
  gap: 10px;
}

.push-item {
  display: grid;
  grid-template-columns: minmax(112px, 0.45fr) minmax(180px, 0.8fr) minmax(260px, 1fr) minmax(170px, auto);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
}

.push-audience,
.push-title,
.push-timing {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.push-item span,
.location-chip {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.location-chip {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(31, 95, 191, 0.2);
  border-radius: 999px;
  background: #f6f9ff;
  color: var(--brand-blue);
  padding: 3px 8px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.push-item strong {
  color: var(--ink);
}

.push-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.push-item small {
  color: var(--muted);
  font-weight: 800;
}

.push-timing {
  justify-items: end;
}

.push-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.push-actions .inline-btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.push-item.danger {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff8f7;
  box-shadow: inset 3px 0 0 var(--danger);
}

.push-item.warn {
  border-color: rgba(179, 92, 0, 0.22);
  background: #fffaf2;
  box-shadow: inset 3px 0 0 var(--warn);
}

.push-item.good {
  border-color: rgba(22, 114, 59, 0.22);
  background: #f7fff8;
  box-shadow: inset 3px 0 0 var(--good);
}

.followup-item strong,
.followup-item span,
.followup-item small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.followup-item span,
.followup-item small,
.followup-meta {
  color: var(--muted);
  font-size: 12px;
}

.followup-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  font-weight: 800;
}

.inquiry-create-head {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}

.inquiry-create-head h2,
.customer-check-strip h3 {
  margin: 0;
}

.inquiry-create-head p,
.customer-check-strip p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.customer-check-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.quote-upload-strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 1fr) minmax(220px, 0.8fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.quote-upload-strip h3 {
  margin: 0;
}

.quote-upload-strip p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.customer-search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
}

.quote-upload-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
}

.duplicate-results {
  min-height: 24px;
  font-size: 13px;
}

.duplicate-ok,
.duplicate-warning {
  display: grid;
  gap: 6px;
  line-height: 1.5;
}

.duplicate-ok strong {
  color: var(--good);
}

.duplicate-warning strong {
  color: var(--danger);
}

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

.duplicate-item {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(130px, 0.8fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(180, 35, 24, 0.18);
  border-radius: 7px;
  background: #fff8f7;
  padding: 9px 10px;
}

.duplicate-item span,
.duplicate-item small {
  color: var(--muted);
  font-size: 12px;
}

.procurement-contract-desk {
  display: grid;
  gap: 16px;
}

.procurement-tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.procurement-tool-grid > * {
  min-width: 0;
}

.procurement-tool-grid .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.procurement-tool-grid h3,
.procurement-attachments h4,
.compact-head h3 {
  margin: 0 0 12px;
}

.compact-head {
  margin-top: 6px;
}

.procurement-packet-list {
  display: grid;
  gap: 10px;
}

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

.procurement-packet > summary {
  min-height: 72px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.procurement-packet > summary::-webkit-details-marker {
  display: none;
}

.procurement-packet > summary > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.procurement-packet > summary > div:last-child {
  justify-items: end;
  text-align: right;
}

.procurement-packet > summary span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.procurement-packet-body {
  padding: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
}

.procurement-packet-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.procurement-packet-meta span {
  min-width: 0;
  padding: 10px 12px;
  background: #f4f7fa;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.procurement-contract-grid textarea {
  min-height: 260px;
  line-height: 1.65;
}

.procurement-attachments {
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.procurement-file-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.procurement-file-list li {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.procurement-file-list li:last-child {
  border-bottom: 0;
}

.procurement-file-list a {
  color: var(--quoted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.procurement-file-list span,
.procurement-file-list code {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.procurement-approval-actions {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.procurement-audit {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.procurement-audit summary {
  cursor: pointer;
  color: var(--quoted);
  font-weight: 800;
}

.procurement-audit ol {
  margin: 12px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.procurement-audit li {
  padding-left: 4px;
}

.procurement-audit li span,
.procurement-audit li small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .procurement-tool-grid,
  .procurement-packet-meta,
  .procurement-file-list li {
    grid-template-columns: 1fr;
  }

  .procurement-packet > summary,
  .procurement-packet > summary > div:last-child {
    align-items: flex-start;
    justify-items: start;
    text-align: left;
  }

  .procurement-packet > summary {
    flex-direction: column;
  }
}

.preflight-warning {
  color: var(--warn);
  font-size: 13px;
  font-weight: 800;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 10px;
}

.kpi {
  min-width: 0;
  background: var(--panel);
  padding: 18px;
  min-height: 116px;
  border: 1px solid #d7e2ec;
  border-radius: 8px;
}

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

.kpi strong {
  display: block;
  margin-top: 16px;
  font-size: clamp(24px, 2.1vw, 30px);
  line-height: 1.08;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.kpi small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.dashboard-head {
  align-items: center;
}

.dashboard-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-controls input {
  min-width: 160px;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(3, 42px);
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--line);
}

.segmented-control button {
  min-height: 42px;
  background: #fff;
  color: var(--brand-blue);
  font-weight: 900;
}

.segmented-control button.active {
  background: var(--brand-blue);
  color: #fff;
}

.daily-kpis {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.auto-source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.auto-source-grid span {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #f8fbfe;
  min-width: 0;
}

.auto-source-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.auto-source-grid strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.quality-auto-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.erp-template-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.erp-template-grid > button {
  flex: 1 1 170px;
  min-width: 0;
}

.erp-import-form {
  grid-template-columns: 1fr;
  min-width: 0;
}

.erp-import-form label.wide {
  grid-column: auto;
}

.erp-import-form textarea {
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
}

.erp-table table {
  min-width: 760px;
}

.erp-table th,
.erp-table td {
  vertical-align: top;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.leaderboard-panel {
  min-width: 0;
  overflow: hidden;
}

.mini-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.mini-panel-head h3 {
  margin: 0;
  font-size: 15px;
}

.compact-table {
  font-size: 13px;
  min-width: 0;
  table-layout: fixed;
}

.compact-table th,
.compact-table td {
  padding: 10px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-table th:nth-child(1),
.compact-table td:nth-child(1) {
  width: 46px;
}

.compact-table th:nth-child(2),
.compact-table td:nth-child(2) {
  width: 108px;
}

.rank-cell {
  width: 42px;
  color: var(--brand-blue);
  font-weight: 900;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.45fr);
  gap: 22px;
}

.split .kpi-grid,
.compact-kpis {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.operation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.loss-panel {
  align-self: stretch;
}

.loss-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.loss-metrics span {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.loss-metrics strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}

.amount-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.amount-detail-panel {
  overflow: hidden;
}

.amount-detail-panel.wide {
  grid-column: 1 / -1;
}

.amount-detail-table th:nth-child(1),
.amount-detail-table td:nth-child(1) {
  width: 145px;
}

.amount-detail-table th:nth-child(2),
.amount-detail-table td:nth-child(2) {
  width: 150px;
}

.amount-detail-table th,
.amount-detail-table td {
  white-space: normal;
}

.shipment-batch-table {
  table-layout: auto;
  min-width: 860px;
}

.shipment-batch-table th:nth-child(1),
.shipment-batch-table td:nth-child(1) {
  min-width: 90px;
}

.shipment-batch-table th:nth-child(2),
.shipment-batch-table td:nth-child(2) {
  min-width: 120px;
}

.shipment-batch-table th:nth-child(3),
.shipment-batch-table td:nth-child(3),
.shipment-batch-table th:nth-child(4),
.shipment-batch-table td:nth-child(4) {
  min-width: 150px;
}

.shipment-batch-table th:nth-child(5),
.shipment-batch-table td:nth-child(5) {
  min-width: 160px;
}

.split > *,
.operation-grid > *,
.leaderboard-grid > *,
.table-wrap {
  min-width: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.panel.pad {
  padding: 20px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 180px 180px auto;
  gap: 10px;
  margin-bottom: 14px;
}

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

.form-grid label.wide {
  grid-column: span 2;
}

.form-grid label.full,
.form-grid .full {
  grid-column: 1 / -1;
}

.form-grid.erp-import-form {
  grid-template-columns: 1fr;
  min-width: 0;
}

.form-grid.erp-import-form label.wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.line-items {
  margin-top: 18px;
}

.line-items-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 10px;
}

.line-items-head h3 {
  margin: 0;
  font-size: 16px;
}

.line-items-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.line-table {
  min-width: 1960px;
}

.line-table th,
.line-table td {
  padding: 8px;
}

.line-table input,
.line-table select {
  min-width: 110px;
  padding: 8px 9px;
  font-size: 12px;
}

.line-table td:first-child input {
  min-width: 230px;
}

.line-table td:nth-child(6) input,
.line-table td:nth-child(7) input,
.line-table td:nth-child(8) input,
.line-table td:nth-child(9) input,
.line-table td:nth-child(13) input {
  min-width: 180px;
}

.line-table .sku-code-output {
  min-width: 135px;
  color: var(--brand-blue);
  font-weight: 800;
  background: var(--brand-blue-soft);
}

.sku-picker {
  position: relative;
  min-width: 260px;
}

.sku-picker.compact {
  min-width: 220px;
}

.product-name-picker {
  min-width: 260px;
}

.quote-rounds {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.quote-rounds-head,
.quote-round-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.quote-rounds-head {
  justify-content: space-between;
}

.quote-rounds-head strong {
  display: block;
  margin-bottom: 3px;
}

.quote-rounds-head span {
  color: var(--muted);
  font-size: 13px;
}

.quote-round-list {
  display: grid;
  gap: 10px;
}

.quote-round-item label {
  flex: 1;
}

.sku-picker-input {
  width: 100%;
}

.sku-picker-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  display: none;
  border: 1px solid var(--brand-blue);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(0, 47, 108, 0.18);
}

.sku-picker.open .sku-picker-menu {
  display: grid;
}

.sku-picker-option {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.sku-picker-option:last-child {
  border-bottom: 0;
}

.sku-picker-option:hover,
.sku-picker-option.active {
  background: var(--brand-blue-soft);
}

.sku-picker-option strong {
  color: var(--brand-blue);
  font-size: 13px;
}

.sku-picker-option span {
  color: var(--ink);
  font-weight: 800;
}

.sku-picker-option small,
.sku-picker-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sku-picker-empty {
  padding: 12px;
  background: #fff;
}

.material-usage-wrap {
  padding-bottom: 12px;
}

.material-usage-table {
  min-width: 1650px;
}

.material-usage-table th,
.material-usage-table td {
  padding: 8px;
}

.material-usage-table input {
  width: 100%;
  min-width: 86px;
  padding: 8px 9px;
  font-size: 12px;
}

.material-usage-table td:first-child input,
.material-usage-table td:nth-child(11) input,
.material-usage-table td:nth-child(12) input {
  min-width: 140px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #edf2f7;
  color: var(--brand-blue);
  font-size: 18px;
  font-weight: 900;
}

.icon-btn:hover {
  background: #ffe8e6;
  color: var(--danger);
}

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

.item-line {
  display: grid;
  gap: 3px;
}

.item-line span {
  color: var(--muted);
}

.contact-lines,
.quote-cycle {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.quote-cycle {
  max-width: 260px;
  color: var(--muted);
  line-height: 1.45;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.5;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--brand-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

tr:last-child td {
  border-bottom: 0;
}

tr.row-danger td {
  background: #fff8f7;
}

tr.row-warn td {
  background: #fffaf2;
}

tr.row-quoted td {
  background: #f7fbff;
}

tr.row-good td {
  background: #f7fff8;
}

.status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.good {
  background: var(--brand-green-soft);
  color: #2d6b19;
}

.status.quoted {
  background: var(--quoted-soft);
  color: var(--quoted);
}

.status.warn {
  background: #fff2df;
  color: var(--warn);
}

.status.danger {
  background: #ffebe8;
  color: var(--danger);
}

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

.number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.payment-summary {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.payment-summary span:not(.status) {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.notice-table {
  min-width: 980px;
}

.quality-table {
  min-width: 1120px;
}

.coa-table {
  min-width: 1480px;
}

.quality-matrix-summary {
  display: grid;
  grid-template-columns: 1.4fr 1fr .7fr;
  gap: 12px;
  margin-bottom: 14px;
}

.quality-matrix-summary > div {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-muted);
}

.quality-matrix-summary small {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.quality-matrix-summary strong {
  min-width: 0;
  max-width: 100%;
  display: block;
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.quality-period-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quality-period-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.quality-period-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.quality-period-head h3,
.quality-period-card h4 {
  margin: 0;
}

.quality-period-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.quality-period-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.quality-period-metrics span {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-muted);
}

.quality-period-metrics small,
.quality-period-list small,
.quality-audience-note span,
.quality-period-latest p,
.quality-period-history {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.quality-period-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  color: var(--ink);
}

.quality-period-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.quality-period-summary p,
.quality-period-latest p {
  margin: 0;
}

.quality-period-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.quality-period-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.quality-period-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.quality-period-list li span {
  overflow-wrap: anywhere;
}

.quality-period-list strong,
.push-item strong {
  overflow-wrap: anywhere;
}

.quality-period-list li small {
  grid-column: 1 / -1;
}

.quality-audience-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.quality-audience-note {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-muted);
}

.quality-period-latest {
  display: grid;
  gap: 6px;
}

.quality-period-history {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-muted);
}

.quality-matrix-table {
  min-width: 1680px;
}

.quality-matrix-table th,
.quality-matrix-table td {
  text-align: center;
}

.quality-matrix-table th:first-child,
.quality-matrix-table td:first-child,
.quality-matrix-table th:last-child,
.quality-matrix-table td:last-child {
  text-align: left;
}

.matrix-hit {
  color: var(--danger);
  font-weight: 700;
}

.shipment-batch-table {
  min-width: 1420px;
}

.notice-table td {
  vertical-align: top;
}

.line-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.line-list li {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) minmax(70px, .7fr) minmax(120px, 1fr) minmax(110px, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.line-list li.line-danger {
  border-left: 3px solid var(--danger);
  background: #fff8f7;
  padding: 6px 8px;
  border-radius: 6px;
}

.line-list strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.big-number {
  display: block;
  margin: 18px 0 12px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.danger-text {
  color: var(--danger);
}

.warn-text {
  color: #b36b00;
}

.paper-analysis {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.cost-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.message {
  color: var(--accent-ink);
  font-size: 13px;
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-panel {
    border-right: 0;
    min-height: 100dvh;
  }

  .login-aside {
    min-height: auto;
  }

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

  .login-flow-item:nth-child(2) {
    border-right: 0;
  }

  .login-flow-item:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    padding: 14px 16px;
  }

  .sidebar-brand {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0;
  }

  .sidebar-logo {
    grid-column: 1;
    width: 154px;
    height: 55px;
  }

  .sidebar-logo-source {
    top: -48px;
    width: 146px;
    height: 146px;
  }

  .sidebar-brand-copy {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .sidebar-menu-toggle {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 6px;
    background: transparent;
    color: #fff;
  }

  .sidebar.nav-collapsed .nav,
  .sidebar.nav-collapsed .logout {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding-right: 0;
    margin-top: 12px;
  }

  .topbar {
    position: static;
    height: auto;
    padding: 20px;
    gap: 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .content {
    padding: 20px;
  }

  .section-head:not(.compact-head) {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head:not(.compact-head) > * {
    min-width: 0;
  }

  .section-head:not(.compact-head) input,
  .section-head:not(.compact-head) select,
  .section-head:not(.compact-head) .month-picker {
    width: 100%;
    min-width: 0;
  }

  .nav button,
  .logout {
    min-height: 38px;
    font-size: 15px;
  }

  .kpi-grid,
	  .daily-kpis,
	  .auto-source-grid,
	  .split,
  .operation-grid,
  .leaderboard-grid,
  .amount-detail-grid,
  .loss-metrics,
  .flow-steps,
  .mini-metrics,
  .form-grid,
  .compact-grid,
  .toolbar,
  .cost-grid,
  .followup-board,
  .followup-item,
  .inquiry-create-head,
  .customer-search-row,
  .quote-upload-strip,
	  .quote-upload-row,
	  .duplicate-item,
	  .push-item,
  .quality-period-grid,
  .quality-period-metrics,
  .quality-period-columns,
  .quality-audience-grid,
  .quality-matrix-summary,
  .line-list li {
	    grid-template-columns: 1fr;
	  }

  .form-grid label.wide {
    grid-column: auto;
  }

  .summary-pair {
    width: 100%;
  }

  .dashboard-head,
  .dashboard-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented-control {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-pair span {
    flex: 1;
  }

  .followup-meta {
    justify-items: start;
  }

  .push-item small {
    justify-self: start;
  }

  .push-timing {
    justify-items: start;
  }

  .push-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .login-panel,
  .login-aside {
    padding: 30px 22px 34px;
  }

  .login-brand {
    width: 258px;
    height: 92px;
    margin-bottom: 28px;
  }

  .login-brand .brand-logo-source {
    top: -92px;
    left: -7px;
    width: 280px;
    height: 280px;
  }

  .login-panel h1 {
    font-size: 34px;
    white-space: normal;
  }

  .login-copy,
  .aside-copy p:not(.eyebrow) {
    font-size: 14px;
  }

  .login-flow-item {
    min-height: auto;
    padding: 18px 4px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }

  .login-flow {
    grid-template-columns: 1fr;
  }

  .login-flow-item:nth-child(2) {
    border-right: 0;
  }

  .login-flow-item:last-child {
    border-bottom: 0;
  }

  .login-aside h2 {
    font-size: 36px;
  }

  .login-aside::before {
    width: 24%;
    height: 10%;
  }
}

.enhancement-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.feature-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 7px;
  min-height: 156px;
}

.feature-card span {
  color: var(--brand-green);
  font-size: 12px;
  font-weight: 900;
}

.feature-card strong {
  font-size: 15px;
}

.feature-card p,
.feature-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.enhancement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.enhancement-grid .panel,
.enhancement-records .panel {
  min-width: 0;
}

.enhancement-grid .form-grid,
.enhancement-records .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.enhancement-grid .form-grid label.wide,
.enhancement-records .form-grid label.wide {
  grid-column: 1 / -1;
}

.enhancement-grid .panel h3,
.enhancement-record-panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.result-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfc;
  color: var(--ink);
  min-height: 72px;
  padding: 12px;
  white-space: pre-wrap;
  overflow: auto;
}

.result-box.compact {
  min-height: 48px;
  margin-top: 8px;
  font-size: 12px;
}

.smart-inline-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.smart-inline-panel h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.smart-inline-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.smart-inline-panel textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
}

.ai-input-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ai-input-mode-row span,
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-muted);
  color: var(--brand-blue);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.ai-input-mode-row small {
  color: var(--muted);
  font-weight: 700;
}

.ai-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.ai-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}

.attachment-chip {
  color: var(--ink);
  font-weight: 700;
}

.attachment-chip small {
  color: var(--muted);
  font-weight: 700;
}

.ai-model-config-panel {
  margin-bottom: 16px;
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 10px;
}

.calibration-box {
  display: grid;
  gap: 7px;
  min-width: 180px;
  max-width: 280px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbfc;
}

.calibration-box.good {
  border-color: #cfe8c4;
  background: #f6fff3;
}

.calibration-box.warn {
  border-color: #f2d09d;
  background: #fffaf2;
}

.calibration-box.danger {
  border-color: #efb7b0;
  background: #fff5f3;
}

.calibration-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.calibration-rates span {
  border-radius: 999px;
  background: rgba(0, 47, 108, 0.07);
  color: var(--brand-blue);
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 800;
}

.calibration-box small {
  color: var(--muted);
  line-height: 1.45;
}

.kv-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.kv-list div {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 9px 10px;
  display: grid;
  gap: 4px;
}

.kv-list strong {
  color: var(--muted);
  font-size: 12px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
}

.enhancement-records {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.compact-head {
  margin-bottom: 10px;
}

.compact-table table {
  font-size: 12px;
}

.tiny-btn {
  min-height: 32px;
  padding: 0 8px;
  margin-top: 4px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notice-banner {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fffaf2;
  border: 1px solid #f3d09a;
  color: var(--ink);
}

.notice-banner.warn strong {
  color: #9a5a00;
}

.inline-link {
  color: var(--brand-blue);
  font-weight: 800;
  text-decoration: none;
}

.progress-card-list {
  display: grid;
  gap: 10px;
}

.progress-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.progress-card.risk,
.risk-row {
  background: #fff4f2;
}

.progress-card p,
.progress-card small,
.progress-detail small {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.progress-detail {
  display: grid;
  gap: 12px;
}

.progress-detail h4 {
  margin: 4px 0 0;
  font-size: 14px;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#bomDraftMaterials {
  min-height: 96px;
}

.approval-mini {
  margin-top: 6px;
  max-width: 220px;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.compact-list {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.45;
}

.wide-panel {
  grid-column: 1 / -1;
}

.package-item-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.package-item-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(120px, 0.8fr) minmax(140px, 1fr) minmax(140px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.package-item-row .wide {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .package-item-row {
    grid-template-columns: 1fr;
  }

  .package-item-row .wide {
    grid-column: auto;
  }
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none !important;
}

.collaboration-intro {
  border-top: 3px solid var(--brand-green);
  padding-top: 18px;
}

.quota-meter {
  min-width: 172px;
  border-left: 3px solid var(--brand-green);
  padding: 8px 0 8px 16px;
  display: grid;
  gap: 3px;
  color: var(--muted);
}

.quota-meter.limit-reached {
  border-left-color: var(--danger);
}

.quota-meter span,
.quota-meter b {
  font-size: 12px;
}

.quota-meter strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.quota-meter strong small {
  color: var(--muted);
  font-size: 15px;
}

.collaboration-compose {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfe;
  padding: 18px;
}

.collaboration-compose .message {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.collaboration-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

.section-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.collaboration-list {
  display: grid;
  gap: 12px;
}

.collaboration-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-blue);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.collaboration-item.is-overdue {
  border-left-color: var(--danger);
  background: #fff9f8;
}

.collaboration-item > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.collaboration-item h3 {
  margin: 8px 0 0;
  font-size: 17px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.collaboration-person {
  min-width: 112px;
  text-align: right;
  display: grid;
  gap: 2px;
}

.collaboration-person small,
.collaboration-person span {
  color: var(--muted);
  font-size: 11px;
}

.collaboration-description {
  margin: 14px 0 10px;
  color: #334046;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.collaboration-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.collaboration-thread {
  list-style: none;
  margin: 14px 0 0;
  padding: 0 0 0 14px;
  border-left: 2px solid #d9e4ef;
  display: grid;
  gap: 10px;
}

.collaboration-thread li {
  display: grid;
  gap: 4px;
}

.collaboration-thread li > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.collaboration-thread p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.collaboration-thread time {
  color: var(--muted);
  font-size: 11px;
}

.compact-copy {
  margin: 12px 0 0;
}

.collaboration-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.collaboration-actions textarea {
  min-height: 72px;
}

.collaboration-cancel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.closure-summary {
  margin-top: 14px;
  border-left: 3px solid var(--brand-green);
  background: var(--brand-green-soft);
  padding: 10px 12px;
}

.closure-summary p {
  margin: 5px 0 0;
  line-height: 1.6;
}

.period-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.period-toolbar input,
.period-toolbar select {
  min-width: 154px;
}

.segmented-control.period-four {
  grid-template-columns: repeat(4, 42px);
}

.collaboration-kpis {
  margin-bottom: 18px;
}

.review-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.review-columns > * {
  min-width: 0;
}

.review-columns > .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-columns h2,
.review-columns h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.ranked-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.ranked-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}

.ranked-list li span {
  color: var(--brand-green);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ranked-list li b {
  color: var(--muted);
  font-size: 12px;
}

.collaboration-load-summary {
  border-top: 1px solid var(--line);
}

.collaboration-load-summary > div {
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.collaboration-load-summary span {
  color: var(--muted);
  font-size: 12px;
}

.collaboration-load-summary strong {
  text-align: right;
  font-size: 13px;
}

.score-period-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.score-period {
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 15px;
  text-align: left;
  display: grid;
  gap: 6px;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.score-period:hover {
  border-color: #a9bfd6;
  transform: translateY(-1px);
}

.score-period.active {
  border-color: var(--brand-blue);
  background: var(--brand-blue-soft);
}

.score-period span,
.score-period small {
  color: var(--muted);
  font-size: 12px;
}

.score-period strong {
  font-size: 26px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.score-detail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 22px;
  align-items: stretch;
}

.score-summary {
  border-left: 5px solid var(--brand-green);
  background: #fff;
  padding: 20px;
  display: grid;
  align-content: center;
  gap: 10px;
}

.score-summary > span,
.score-summary p {
  color: var(--muted);
  margin: 0;
}

.score-summary > strong {
  font-size: 54px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.score-summary > strong.no-score {
  font-size: 28px;
}

.score-summary > strong small {
  color: var(--muted);
  font-size: 16px;
}

.score-evidence {
  background: #f8fbfe;
  border: 1px solid var(--line);
  padding: 20px;
}

.score-evidence h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.score-evidence dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.score-evidence dl div {
  background: #fff;
  padding: 14px;
}

.score-evidence dt {
  color: var(--muted);
  font-size: 12px;
}

.score-evidence dd {
  margin: 8px 0 0;
  font-size: 24px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.score-breakdown th:nth-child(5),
.score-breakdown td:nth-child(5) {
  min-width: 260px;
}

.recommendation-list {
  margin: 0;
  padding-left: 20px;
  color: #334046;
  line-height: 1.75;
}

.policy-notice {
  border-left: 4px solid var(--warn);
  background: #fffaf2;
  padding: 12px 14px;
}

.policy-notice p {
  margin: 5px 0 0;
  color: #5b4a32;
  line-height: 1.6;
}

.score-response-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  gap: 22px;
  margin-top: 18px;
}

.score-response-grid h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.score-response-grid p {
  color: var(--muted);
  line-height: 1.6;
}

.appeal-list {
  display: grid;
  gap: 12px;
}

.appeal-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

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

.appeal-item > header div {
  display: grid;
  gap: 3px;
}

.appeal-item > header span {
  color: var(--muted);
  font-size: 12px;
}

.appeal-item > p {
  margin: 12px 0 0;
  line-height: 1.65;
  white-space: pre-wrap;
}

.appeal-item > p b {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.appeal-review-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(150px, 0.5fr) minmax(260px, 1.3fr);
  gap: 12px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.appeal-review-form .wide {
  min-width: 0;
}

.appeal-review-form .form-actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

@media (max-width: 1100px) {
  .collaboration-columns,
  .score-detail-layout,
  .score-response-grid {
    grid-template-columns: 1fr;
  }

  .score-period-grid,
  .score-evidence dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appeal-review-form {
    grid-template-columns: 1fr 1fr;
  }

  .appeal-review-form .wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .collaboration-item > header,
  .collaboration-actions,
  .review-columns,
  .score-period-grid,
  .score-evidence dl,
  .appeal-review-form {
    grid-template-columns: 1fr;
  }

  .collaboration-person {
    text-align: left;
  }

  .period-toolbar {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .segmented-control.period-four {
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
  }

  .quota-meter {
    width: 100%;
  }

  .appeal-review-form .wide,
  .appeal-review-form .form-actions {
    grid-column: auto;
  }
}

/* Mobile operations use the same application and database as desktop. */
.mobile-menu-btn,
.mobile-bottom-nav,
.nav-scrim {
  display: none;
}

#syncStatus {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

#syncStatus::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-green);
  content: "";
}

#syncStatus.offline {
  color: var(--danger);
}

#syncStatus.offline::before {
  background: var(--danger);
}

button:disabled,
[aria-busy="true"] button[type="submit"] {
  cursor: wait;
  opacity: 0.62;
}

@media (max-width: 980px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }

  .workspace {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100svh;
  }

  .content,
  .inventory-workbench,
  .content > .section,
  .content > .panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .content {
    overflow-x: clip;
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }

  .sidebar {
    position: fixed;
    z-index: 120;
    inset: 0 auto 0 0;
    width: min(86vw, 340px);
    height: 100dvh;
    overflow: hidden;
    padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: 18px 0 42px rgba(0, 24, 55, 0.28);
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-brand {
    grid-template-columns: minmax(0, 1fr) auto;
    flex: 0 0 auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    padding-bottom: 14px;
  }

  .sidebar-focus {
    margin: 12px 4px 0;
  }

  .sidebar-logo {
    width: 144px;
    height: 52px;
  }

  .sidebar-logo-source {
    top: -45px;
    width: 137px;
    height: 137px;
  }

  .sidebar-menu-toggle {
    min-width: 52px;
    min-height: 44px;
  }

  .sidebar.nav-collapsed .nav,
  .sidebar.nav-collapsed .logout,
  .sidebar .nav,
  .sidebar .logout {
    display: flex;
  }

  .sidebar .nav {
    flex: 1 1 auto;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar .nav button,
  .sidebar .logout {
    flex: 0 0 auto;
    min-height: 52px;
  }

  .sidebar .nav-section,
  .sidebar .nav-section-items {
    flex: 0 0 auto;
  }

  .sidebar .nav-copy strong {
    font-size: 15px;
  }

  .sidebar .nav-copy small {
    font-size: 11px;
  }

  .sidebar-footer {
    padding-top: 8px;
  }

  .nav-scrim {
    position: fixed;
    z-index: 110;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 24, 55, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.mobile-nav-open .nav-scrim {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    min-height: calc(64px + env(safe-area-inset-top));
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    background: rgba(247, 249, 252, 0.97);
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 76px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--brand-blue);
    font-weight: 800;
  }

  .topbar-title {
    min-width: 0;
  }

  .topbar-title .eyebrow {
    display: none;
  }

  .topbar h1 {
    overflow: visible;
    font-size: 18px;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .topbar-actions {
    display: grid;
    justify-items: end;
    gap: 2px;
    font-size: 11px;
  }

  .topbar-actions button {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  #syncStatus {
    min-height: 18px;
  }

  .content {
    padding: 18px 16px 32px;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 100;
    right: 0;
    bottom: 0;
    left: 0;
    height: calc(62px + env(safe-area-inset-bottom));
    padding: 6px 8px env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -8px 24px rgba(0, 47, 108, 0.1);
    pointer-events: auto;
    isolation: isolate;
    transform: translateZ(0);
  }

  .mobile-bottom-nav button {
    min-width: 0;
    min-height: 50px;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0;
  }

  .mobile-nav-marker {
    color: inherit;
    font-size: 15px;
    line-height: 1;
  }

  .mobile-bottom-nav button.active {
    background: var(--brand-blue-soft);
    color: var(--brand-blue);
  }

  .mobile-bottom-nav button:last-child {
    color: var(--brand-blue);
  }
}

@media (max-width: 700px) {
  .login-panel {
    min-height: 100svh;
    padding-top: calc(28px + env(safe-area-inset-top));
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }

  .login-aside {
    display: none;
  }

  .login-brand {
    margin-bottom: 18px;
  }

  .login-panel h1 {
    font-size: 31px;
  }

  .login-copy {
    margin: 12px 0 22px;
  }

  input,
  textarea,
  select {
    min-height: 46px;
    font-size: 16px;
  }

  textarea {
    min-height: 104px;
  }

  .panel.pad {
    padding: 15px;
  }

  .section {
    margin-bottom: 22px;
  }

  .section-head h2 {
    font-size: 18px;
  }

  .form-actions,
  .line-items-head {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions > button,
  .form-actions > .primary-btn,
  .form-actions > .secondary-btn {
    width: 100%;
    min-height: 48px;
  }

  .inline-btn {
    min-height: 44px;
    margin: 2px 2px 2px 0;
  }

  .file-drop {
    min-height: 142px;
    padding: 18px 12px;
  }

  .file-drop input[type="file"] {
    min-height: 48px;
    padding: 9px;
  }

  .table-wrap.is-mobile-card {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .mobile-card-table,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .mobile-card-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .mobile-card-table tbody {
    display: grid;
    gap: 12px;
  }

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

  .mobile-card-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }

  .mobile-card-table td:last-child {
    border-bottom: 0;
  }

  .mobile-card-table td::before {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 800;
  }

  .table-wrap.is-mobile-scroll {
    position: relative;
    padding-top: 34px;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap.is-mobile-scroll::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 34px;
    padding: 8px 12px;
    background: var(--brand-blue-soft);
    color: var(--brand-blue);
    content: attr(data-mobile-hint);
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-scroll-table th,
  .mobile-scroll-table td {
    scroll-snap-align: start;
  }

  .account-profile-list div {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .nav-scrim {
    transition: none;
  }
}

.followup-assignment-list,
.followup-exception-list {
  display: grid;
  gap: 16px;
}

.inventory-workbench {
  display: grid;
  gap: 22px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.inventory-workbench > .section,
.inventory-workbench > .panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 0;
}

.inventory-workbench .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.inventory-governance-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--brand-green);
  background: #f3f8f2;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.inventory-alert-table table,
.inventory-material-table table {
  min-width: 1120px;
}

.inventory-alert-table th:nth-child(3),
.inventory-alert-table td:nth-child(3),
.inventory-alert-table th:nth-child(4),
.inventory-alert-table td:nth-child(4) {
  min-width: 230px;
}

.inventory-alert-table th:last-child,
.inventory-alert-table td:last-child {
  min-width: 280px;
}

.inventory-alert-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 8px;
}

.inventory-alert-form textarea,
.inventory-alert-form .message {
  grid-column: 1 / -1;
}

.inventory-alert-form textarea {
  min-height: 78px;
}

.inventory-alert-form button {
  justify-self: start;
}

.inventory-material-table td {
  vertical-align: top;
  line-height: 1.65;
}

@media (max-width: 760px) {
  .inventory-alert-form,
  .inventory-operation-panel .form-grid,
  .inventory-policy-panel .form-grid {
    grid-template-columns: 1fr;
  }

  .inventory-alert-form textarea,
  .inventory-alert-form .message,
  .inventory-operation-panel .form-grid label.wide,
  .inventory-policy-panel .form-grid label.wide {
    grid-column: auto;
  }
}

.followup-assignment {
  border: 1px solid var(--line);
  background: var(--surface, #fff);
}

.followup-assignment > summary {
  min-height: 76px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
}

.followup-assignment > summary > div:first-child,
.followup-summary-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.followup-assignment > summary > div:first-child {
  align-items: flex-start;
  flex-direction: column;
}

.followup-assignment > summary span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.followup-assignment-body {
  padding: 0 18px 20px;
  border-top: 1px solid var(--line);
}

.followup-facts,
.followup-exception dl {
  margin: 0;
  padding: 16px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.followup-facts dt,
.followup-exception dt {
  color: var(--muted);
  font-size: 12px;
}

.followup-facts dd,
.followup-exception dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.followup-milestone-grid {
  margin: 18px 0 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.followup-milestone {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid #8a9aaa;
  background: #fff;
}

.followup-milestone.done {
  border-left-color: #3b8d64;
}

.followup-milestone.blocked,
.followup-exception.open {
  border-left-color: #b84c45;
}

.followup-milestone-head,
.followup-exception-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.followup-milestone-head > div,
.followup-exception-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.followup-milestone-head small,
.followup-exception-head span {
  color: var(--muted);
}

.milestone-sequence {
  flex: 0 0 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.followup-milestone-form {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.followup-milestone-form .wide,
.followup-milestone-form .form-actions {
  grid-column: 1 / -1;
}

.followup-milestone-form textarea,
.compact-inline-form textarea,
.followup-close-form textarea {
  min-height: 78px;
}

.followup-upload-form {
  margin-top: 12px;
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.followup-evidence-list {
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
  list-style: none;
}

.followup-evidence-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.followup-evidence-list span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.followup-exception-section {
  margin: 24px 0;
}

.followup-exception {
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid #8a9aaa;
}

.followup-exception > p {
  line-height: 1.7;
}

.compact-inline-form,
.followup-close-form {
  margin-top: 14px;
  padding-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  border-top: 1px dashed var(--line);
}

.followup-exception-form,
.followup-assignment-create form {
  margin-top: 16px;
}

.role-boundary-panel {
  border-left: 4px solid var(--brand-blue);
}

@media (max-width: 980px) {
  .followup-milestone-grid,
  .followup-facts,
  .followup-exception dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .followup-assignment > summary,
  .followup-summary-meta,
  .followup-evidence-list li {
    align-items: flex-start;
    flex-direction: column;
  }

  .followup-milestone-grid,
  .followup-milestone-form,
  .followup-facts,
  .followup-exception dl,
  .compact-inline-form,
  .followup-close-form {
    grid-template-columns: 1fr;
  }

  .followup-evidence-list span {
    text-align: left;
  }
}

/* Historical inquiry CRM */
.crm-workbench {
  border-top: 3px solid var(--navy);
}

.crm-readonly-badge {
  padding: 6px 10px;
  border: 1px solid #b7d9c2;
  border-radius: 4px;
  color: #17653a;
  background: #f2faf5;
  font-size: 12px;
  white-space: nowrap;
}

.crm-kpis {
  margin-bottom: 20px;
}

.crm-case-list {
  border-top: 1px solid var(--line);
}

.crm-list-toolbar {
  min-height: 48px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.crm-case {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.crm-case.urgent {
  box-shadow: inset 3px 0 0 #c44536;
}

.crm-case > summary {
  min-height: 78px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.crm-case > summary::-webkit-details-marker {
  display: none;
}

.crm-case > summary:hover {
  background: #f7f9fb;
}

.crm-case-identity,
.crm-case-state,
.crm-activity summary > div {
  min-width: 0;
}

.crm-case-identity strong,
.crm-case-identity span,
.crm-activity summary strong,
.crm-activity summary span {
  display: block;
  overflow-wrap: anywhere;
}

.crm-case-identity strong {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 16px;
}

.crm-case-identity span,
.crm-activity summary span,
.crm-case-evidence,
.crm-evidence-line {
  color: var(--muted);
  font-size: 12px;
}

.crm-case-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  white-space: nowrap;
}

.crm-case-overview {
  padding: 0 18px 18px;
  border-top: 1px solid #edf0f2;
}

.crm-case-overview dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.crm-case-overview dl > div {
  min-width: 0;
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid #edf0f2;
}

.crm-case-overview dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.crm-case-overview dd {
  margin: 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.crm-case-evidence,
.crm-evidence-line {
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.crm-timeline {
  margin: 0;
  padding: 4px 18px 22px 46px;
  list-style: none;
}

.crm-activity {
  position: relative;
  border-left: 1px solid #cfd8df;
}

.crm-activity-marker {
  position: absolute;
  top: 23px;
  left: -5px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #3a7ca5;
  box-shadow: 0 0 0 1px #3a7ca5;
}

.crm-activity.outbound .crm-activity-marker {
  background: #3f8a55;
  box-shadow: 0 0 0 1px #3f8a55;
}

.crm-activity > details {
  margin-left: 18px;
  border-bottom: 1px solid #edf0f2;
}

.crm-activity summary {
  padding: 14px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  cursor: pointer;
}

.crm-activity summary > div:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.crm-mail-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.crm-mail-comparison section {
  min-width: 0;
  padding: 16px;
}

.crm-mail-comparison section + section {
  border-left: 1px solid var(--line);
  background: #f8fafb;
}

.crm-mail-comparison h4,
.crm-mail-subject {
  margin: 0 0 8px;
}

.crm-mail-subject {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.crm-mail-comparison pre {
  max-height: 380px;
  margin: 0;
  overflow: auto;
  color: var(--text);
  font: inherit;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.crm-attachment-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #edf0f2;
}

.crm-attachment-list li {
  padding: 9px 0;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #edf0f2;
}

.crm-attachment-list li span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .crm-case-overview dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-mail-comparison {
    grid-template-columns: 1fr;
  }

  .crm-mail-comparison section + section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 700px) {
  .crm-list-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .crm-case > summary,
  .crm-activity summary,
  .crm-case-overview dl {
    grid-template-columns: 1fr;
  }

  .crm-case-state,
  .crm-activity summary > div:last-child {
    justify-content: flex-start;
    flex-wrap: wrap;
    white-space: normal;
  }

  .crm-timeline {
    padding-left: 25px;
    padding-right: 12px;
  }

  .crm-attachment-list li {
    display: block;
  }

  .crm-attachment-list li span {
    margin-top: 4px;
    display: block;
    text-align: left;
  }
}

.costing-review-list,
.costing-assignment-list {
  border-top: 1px solid var(--line);
}

.costing-review,
.costing-assignment {
  border-bottom: 1px solid var(--line);
}

.costing-review > summary,
.costing-assignment > summary {
  min-height: 72px;
  padding: 14px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
}

.costing-review > summary > div:first-child,
.costing-assignment > summary > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.costing-review > summary span,
.costing-assignment > summary span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.costing-review-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.inquiry-conversion-steps {
  padding: 16px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.inquiry-conversion-steps span {
  min-width: 0;
  min-height: 54px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  background: var(--panel-muted);
  font-size: 13px;
  font-weight: 700;
}

.inquiry-conversion-steps span.done {
  color: #155b3c;
  background: #eef8f2;
}

.inquiry-conversion-steps b,
.inquiry-workflow-stage > header > span {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
}

.inquiry-evidence-flow {
  display: grid;
}

.inquiry-workflow-stage {
  padding: 24px 0 28px;
  border-bottom: 1px solid var(--line);
}

.inquiry-workflow-stage > header {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.inquiry-workflow-stage > header h3,
.inquiry-workflow-stage > header p {
  margin: 0;
}

.inquiry-workflow-stage > header h3 {
  font-size: 18px;
}

.inquiry-workflow-stage > header p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.6;
}

.inquiry-message-evidence,
.inquiry-translation-form {
  padding: 16px 0;
  border-top: 1px dashed var(--line);
}

.inquiry-message-evidence dl {
  margin: 0 0 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 22px;
}

.inquiry-message-evidence dl div {
  min-width: 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
}

.inquiry-message-evidence dt {
  color: var(--muted);
  font-size: 12px;
}

.inquiry-message-evidence dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.inquiry-message-evidence pre {
  max-height: 520px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  background: #f7f9fb;
  font: inherit;
  line-height: 1.75;
}

.translation-message-head {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.translation-message-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.translation-message-head > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.translation-message-head span,
.translation-proof-row {
  color: var(--muted);
  font-size: 12px;
}

.inquiry-translation-form label {
  margin-top: 12px;
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.inquiry-translation-form textarea {
  min-height: 240px;
  resize: vertical;
  line-height: 1.75;
}

.translation-proof-row {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  overflow-wrap: anywhere;
}

.translation-proof-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.translation-error,
.workflow-gate-block {
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  border-left: 3px solid #bd3f32;
  background: #fff5f2;
}

.translation-error span,
.workflow-gate-block span {
  color: var(--muted);
  line-height: 1.6;
}

.workflow-gate-block {
  border-left-color: #b98924;
  background: #fff9ea;
}

.costing-compare-grid,
.costing-assignment-body {
  padding: 18px 0 24px;
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(460px, 1.2fr);
  gap: 24px;
  border-top: 1px dashed var(--line);
}

.costing-source,
.costing-template,
.costing-assignment-body > section,
.costing-assignment-body > form {
  min-width: 0;
}

.costing-source dl,
.costing-facts {
  margin: 14px 0;
  display: grid;
  gap: 10px;
}

.costing-source dl div,
.costing-facts div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
}

.costing-source dt,
.costing-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.costing-source dd,
.costing-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.costing-source pre {
  max-height: 520px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  background: var(--panel-muted);
  font: inherit;
  line-height: 1.7;
}

.costing-template fieldset {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.costing-template legend,
.costing-assignment-body h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-weight: 750;
}

.costing-field-grid,
.costing-response-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.costing-field-grid label,
.costing-response-grid label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.costing-field-grid textarea,
.costing-response-grid textarea {
  min-height: 76px;
  resize: vertical;
}

.costing-response-grid input {
  min-width: 0;
}

.evidence-tag {
  width: fit-content;
  color: #1d6a43;
  font-size: 11px;
  font-weight: 700;
}

.evidence-tag.pending,
.warning-copy {
  color: var(--danger);
}

.costing-missing {
  margin: 12px 0;
  padding: 12px 0;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.costing-assignee-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
}

.success-copy {
  color: #1d6a43;
  font-weight: 700;
}

.pricing-intro {
  padding-bottom: 8px;
}

.pricing-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pricing-case-list {
  border-top: 1px solid var(--line);
}

.pricing-case {
  border-bottom: 1px solid var(--line);
}

.pricing-case > summary {
  min-height: 86px;
  padding: 16px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style-position: outside;
}

.pricing-case > summary > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.pricing-case > summary span,
.pricing-case > summary small {
  color: var(--muted);
}

.pricing-case > summary strong {
  overflow-wrap: anywhere;
}

.pricing-case-body {
  padding: 0 0 30px;
}

.pricing-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.pricing-flow span {
  min-height: 52px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: var(--panel-muted);
  border-right: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.pricing-flow span:last-child {
  border-right: 0;
}

.pricing-flow span.done {
  color: #155b3c;
  background: #eef8f2;
}

.pricing-flow b {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
}

.pricing-scope-note {
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--muted);
  font-size: 12px;
}

.pricing-domain-form,
.pricing-snapshot,
.pricing-decision-form {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}

.pricing-production-assumption {
  margin: 14px 0 8px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  border: 1px solid #d7dfd9;
  border-left: 4px solid #4f825f;
  background: #f6f9f7;
}

.pricing-production-assumption label {
  display: grid;
  gap: 6px;
  color: #34463c;
  font-size: 12px;
  font-weight: 700;
}

.pricing-production-assumption p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.pricing-line {
  padding: 16px 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid var(--line);
}

.pricing-line:first-child {
  border-top: 0;
}

.pricing-line-index {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pricing-line-index b {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eaf1fb;
  color: #0b4d8a;
  font-size: 12px;
}

.pricing-line-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.pricing-line-grid label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pricing-line-grid label.wide {
  grid-column: span 2;
}

.pricing-line-grid label.full {
  grid-column: 1 / -1;
}

.pricing-line-grid .check-label {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-line-grid .check-label input {
  width: 18px;
  height: 18px;
}

.pricing-pending {
  padding: 18px;
  border-left: 3px solid #b98924;
  background: #fff9ea;
  color: #6f5721;
}

.pricing-cost-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pricing-policy-section .panel {
  border-left: 4px solid var(--accent, #2f7a55);
}

.pricing-policy-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.policy-formula-note,
.pricing-policy-trace {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #cbd8d0;
  background: #f4f8f5;
  color: #34463c;
  font-size: 13px;
  line-height: 1.6;
}

.pricing-margin-table .row-danger td {
  background: #fff2f0;
}

@media (max-width: 960px) {
  .pricing-policy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pricing-policy-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pricing-cost-strip span {
  min-width: 0;
  padding: 14px 12px;
  display: grid;
  gap: 5px;
  border-right: 1px solid var(--line);
}

.pricing-cost-strip span:last-child {
  border-right: 0;
}

.pricing-cost-strip small {
  color: var(--muted);
}

.pricing-cost-strip strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.pricing-margin-table {
  margin-top: 16px;
}

.pricing-margin-table .row-selected td {
  background: #eef8f2;
  color: #155b3c;
}

.pricing-risks {
  margin-top: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  border-left: 3px solid #b98924;
  background: #fff9ea;
}

.pricing-risks span {
  color: #6f5721;
}

.pricing-decision-form {
  max-width: 920px;
}

.pricing-approved {
  margin-top: 20px;
  padding: 18px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 240px)) 1fr;
  gap: 24px;
  align-items: end;
  border-top: 1px solid #9ac8ad;
  border-bottom: 1px solid #9ac8ad;
}

.pricing-approved div {
  display: grid;
  gap: 4px;
}

.pricing-approved small,
.pricing-approved p {
  color: var(--muted);
}

.pricing-approved strong {
  color: #155b3c;
  font-size: 22px;
}

.pricing-approved p {
  margin: 0;
}

@media (max-width: 980px) {
  .inquiry-conversion-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .costing-compare-grid,
  .costing-assignment-body {
    grid-template-columns: 1fr;
  }

  .pricing-kpis,
  .pricing-cost-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .pricing-flow span {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 700px) {
  .inquiry-conversion-steps,
  .inquiry-message-evidence dl {
    grid-template-columns: 1fr;
  }

  .translation-message-head,
  .translation-proof-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .translation-message-head > div:last-child {
    justify-content: flex-start;
  }

  .costing-review > summary,
  .costing-assignment > summary,
  .costing-review-summary {
    align-items: flex-start;
    flex-direction: column;
    white-space: normal;
  }

  .costing-field-grid,
  .costing-response-grid {
    grid-template-columns: 1fr;
  }

  .pricing-kpis,
  .pricing-cost-strip,
  .pricing-line-grid,
  .pricing-flow,
  .pricing-approved {
    grid-template-columns: 1fr;
  }

  .pricing-case > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .pricing-production-assumption {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .pricing-line {
    grid-template-columns: 1fr;
  }

  .pricing-line-index {
    flex-direction: row;
    justify-content: space-between;
  }

  .pricing-line-grid label.wide {
    grid-column: auto;
  }

  .pricing-cost-strip span,
  .pricing-flow span {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

.guided-uat-center {
  border-top: 4px solid var(--brand-blue);
}

.guided-uat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.guided-uat-header h2 {
  margin: 5px 0 7px;
}

.guided-uat-header p {
  margin: 0;
  color: var(--muted);
}

.guided-uat-boundaries,
.guided-uat-role-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.guided-uat-boundaries span,
.guided-uat-role-line span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #425466;
  font-size: 12px;
  line-height: 1.4;
}

.guided-uat-empty {
  min-height: 170px;
  display: grid;
  grid-template-columns: 90px minmax(260px, 1fr) auto;
  align-items: center;
  gap: 28px;
}

.guided-uat-empty > div {
  display: grid;
}

.guided-uat-empty strong {
  color: var(--brand-blue);
  font-size: 38px;
  line-height: 1;
}

.guided-uat-empty span,
.guided-uat-empty p {
  color: var(--muted);
}

.guided-uat-progress-block {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 22px 0;
}

.guided-uat-progress-block > div {
  display: grid;
  gap: 4px;
}

.guided-uat-progress-block strong {
  font-size: 25px;
}

.guided-uat-progress-block span {
  color: var(--muted);
}

.guided-uat-progress-block progress {
  width: 100%;
  height: 12px;
  border: 0;
  background: #e8edf2;
}

.guided-uat-progress-block progress::-webkit-progress-bar {
  background: #e8edf2;
}

.guided-uat-progress-block progress::-webkit-progress-value {
  background: #3d8f43;
}

.guided-uat-progress-block progress::-moz-progress-bar {
  background: #3d8f43;
}

.guided-uat-step-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.guided-uat-step {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.guided-uat-step-index {
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  color: #72808e;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.guided-uat-step.is-current .guided-uat-step-index {
  background: #edf5ff;
  color: var(--brand-blue);
}

.guided-uat-step.is-passed .guided-uat-step-index {
  background: #eef8ef;
  color: #2f7134;
}

.guided-uat-step.is-failed .guided-uat-step-index {
  background: #fff1ef;
  color: #b63d32;
}

.guided-uat-step-body {
  min-width: 0;
  padding: 18px 20px 20px;
}

.guided-uat-step-body > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.guided-uat-step-body h3 {
  margin: 7px 0 0;
  font-size: 17px;
}

.guided-uat-step-body > p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.guided-uat-step.is-locked .guided-uat-step-body {
  opacity: 0.62;
}

.guided-uat-status {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.guided-uat-status.is-passed {
  border-color: #a8d3ab;
  background: #eef8ef;
  color: #2f7134;
}

.guided-uat-status.is-current {
  border-color: #9ec2ec;
  background: #edf5ff;
  color: var(--brand-blue);
}

.guided-uat-status.is-failed {
  border-color: #edb7b0;
  background: #fff1ef;
  color: #a52f26;
}

.guided-uat-step-action {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.guided-uat-evidence {
  margin-top: 15px;
  padding: 14px 0 0;
  border-top: 1px dashed var(--line);
}

.guided-uat-evidence > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.guided-uat-evidence > div:first-child span,
.guided-uat-evidence code {
  color: var(--muted);
  font-size: 12px;
}

.guided-uat-evidence code {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.guided-uat-evidence blockquote {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-left: 3px solid #9ec2ec;
  background: #f8fafc;
  color: #425466;
}

.guided-uat-checks {
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  list-style: none;
}

.guided-uat-checks li {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 6px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
}

.guided-uat-checks li.is-passed > span {
  color: #2f7134;
}

.guided-uat-checks li.is-failed > span {
  color: #b63d32;
}

.guided-uat-checks small {
  grid-column: 2;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.guided-uat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
}

.guided-uat-footer > div {
  display: grid;
  gap: 4px;
}

.guided-uat-footer span {
  color: var(--muted);
}

.implementation-case-list {
  border-top: 1px solid var(--line);
}

.implementation-case {
  border-bottom: 1px solid var(--line);
}

.implementation-case > summary {
  min-height: 82px;
  padding: 16px 4px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, auto);
  align-items: center;
  gap: 20px;
  cursor: pointer;
  list-style-position: outside;
}

.implementation-case > summary::marker {
  color: var(--brand-blue);
}

.implementation-case-main,
.implementation-case-meta {
  min-width: 0;
}

.implementation-case-main {
  display: grid;
  gap: 5px;
}

.implementation-case-main strong {
  font-size: 17px;
}

.implementation-case-main span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.implementation-case-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.implementation-progress {
  min-width: 78px;
  text-align: right;
  color: var(--ink);
  font-weight: 700;
}

.implementation-case-facts {
  margin: 0 0 18px;
  padding: 14px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 22px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.implementation-case-facts div {
  min-width: 0;
}

.implementation-case-facts dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.implementation-case-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.implementation-timeline {
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  list-style: none;
  border: 1px solid var(--line);
}

.implementation-stage {
  min-width: 0;
  min-height: 126px;
  padding: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.implementation-stage:nth-child(4n) {
  border-right: 0;
}

.implementation-stage:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.implementation-stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.implementation-stage-head strong {
  line-height: 1.6;
}

.implementation-stage p {
  margin: 10px 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.implementation-stage time {
  color: var(--muted);
  font-size: 12px;
}

.production-photo-form {
  display: grid;
  gap: 18px;
}

.file-drop {
  display: grid;
  min-height: 132px;
  place-items: center;
  gap: 10px;
  padding: 22px;
  border: 1px dashed #6d88ae;
  background: #f6f9fc;
  color: #173b65;
  font-weight: 700;
  text-align: center;
}

.file-drop input[type="file"] {
  width: min(100%, 520px);
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 500;
}

.inline-link {
  color: #0b4b8f;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 1180px) {
  .guided-uat-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .implementation-case > summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .implementation-case-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    white-space: normal;
  }

  .implementation-progress {
    text-align: left;
  }

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

  .implementation-stage:nth-child(4n) {
    border-right: 1px solid var(--line);
  }

  .implementation-stage:nth-child(2n) {
    border-right: 0;
  }

  .implementation-stage:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }

  .implementation-stage:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 700px) {
  .guided-uat-header,
  .guided-uat-footer,
  .guided-uat-evidence > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .guided-uat-empty,
  .guided-uat-progress-block {
    grid-template-columns: 1fr;
  }

  .guided-uat-empty {
    gap: 16px;
    padding: 22px 0;
  }

  .guided-uat-step {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .guided-uat-step-body {
    padding: 15px 13px 17px;
  }

  .guided-uat-step-body > header {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .guided-uat-checks {
    grid-template-columns: 1fr;
  }

  .implementation-case-facts,
  .implementation-timeline {
    grid-template-columns: 1fr;
  }

  .implementation-stage,
  .implementation-stage:nth-child(2n),
  .implementation-stage:nth-child(4n),
  .implementation-stage:nth-last-child(-n + 4) {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .implementation-stage:last-child {
    border-bottom: 0;
  }
}

.delivery-planning-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.delivery-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 8px;
}

.delivery-planning-workbench > .section,
.delivery-planning-workbench .panel,
.delivery-planning-workbench .form-grid {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.delivery-planning-workbench > .section {
  overflow: hidden;
}

.delivery-day {
  min-width: 150px;
  min-height: 180px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 4px solid #7a8793;
  background: #fff;
  border-radius: 6px;
}

.delivery-day.delivery-warn {
  border-top-color: #c98512;
  background: #fffaf0;
}

.delivery-day.delivery-danger {
  border-top-color: #bd3b32;
  background: #fff6f5;
}

.delivery-day > header,
.delivery-day time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.delivery-day time {
  align-items: baseline;
  justify-content: flex-start;
}

.delivery-day time strong {
  font-size: 17px;
}

.delivery-day time span,
.delivery-day-count,
.delivery-day details,
.delivery-day .muted {
  font-size: 12px;
}

.delivery-day-count {
  margin: 10px 0;
  color: var(--muted);
  font-weight: 700;
}

.delivery-day-items {
  display: grid;
  gap: 8px;
}

.delivery-day-items > div {
  display: grid;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.delivery-day-items span,
.delivery-day-items em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.delivery-day details {
  margin-top: 10px;
  color: var(--muted);
}

.delivery-day details p {
  margin: 6px 0 0;
  line-height: 1.5;
}

.delivery-check-table th:nth-child(5),
.delivery-check-table td:nth-child(5) {
  min-width: 260px;
}

.delivery-reason,
.delivery-alternative {
  display: block;
  margin-top: 5px;
  line-height: 1.5;
  color: var(--muted);
}

.delivery-resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.delivery-resource-form {
  min-width: 0;
}

@media (max-width: 1180px) {
  .delivery-calendar {
    grid-template-columns: repeat(7, minmax(170px, 1fr));
  }

  .delivery-resource-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .delivery-calendar {
    display: flex;
    scroll-snap-type: x mandatory;
  }

  .delivery-day {
    flex: 0 0 min(82vw, 300px);
    min-width: 0;
    scroll-snap-align: start;
  }
}
