:root {
  --ink: #172433;
  --ink-soft: #526274;
  --ink-faint: #77869a;
  --navy: #163a5f;
  --navy-deep: #0d2944;
  --blue: #1f68a6;
  --blue-soft: #e9f3fb;
  --teal: #087d79;
  --teal-soft: #e4f5f2;
  --green: #197348;
  --green-soft: #e6f5ec;
  --amber: #9c5d09;
  --amber-soft: #fff3d7;
  --red: #b13a38;
  --red-soft: #fdeceb;
  --slate-soft: #eef2f6;
  --surface: #ffffff;
  --page: #f4f7fa;
  --line: #dbe3eb;
  --line-strong: #c7d1dc;
  --shadow: 0 8px 24px rgba(22, 58, 95, 0.08);
  --shadow-raised: 0 16px 46px rgba(13, 41, 68, 0.14);
  --radius: 14px;
  --radius-small: 9px;
  --content: 1180px;
  --focus: 0 0 0 3px rgba(31, 104, 166, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p,
dl,
dd {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.25;
}

h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.75rem, 5vw, 2.55rem);
  letter-spacing: -0.025em;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.08rem;
}

p {
  margin-bottom: 0.85rem;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.6rem 0.8rem;
  transform: translateY(-160%);
  border-radius: 6px;
  background: var(--navy-deep);
  color: #fff;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--navy-deep);
  color: #fff;
  box-shadow: 0 5px 18px rgba(13, 41, 68, 0.16);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: min(100% - 1.25rem, var(--content));
  min-height: 64px;
  margin: 0 auto;
  gap: 0.65rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: #fff;
  gap: 0.65rem;
}

.brand:hover,
.brand:focus {
  color: #fff;
}

.brand-mark {
  display: inline-grid;
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 10px;
  background: linear-gradient(145deg, #2b78b6, #0b7776);
  color: #fff;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand strong {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 0.25rem;
  color: #a9c1d6;
  font-size: 0.67rem;
  font-weight: 500;
}

.nav-toggle {
  display: none;
  align-items: center;
  margin-left: auto;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  gap: 0.35rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 0.2rem;
}

.primary-nav a {
  position: relative;
  padding: 0.55rem 0.65rem;
  border-radius: 7px;
  color: #d7e4ee;
  font-size: 0.88rem;
  font-weight: 650;
  white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.primary-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.primary-nav a[aria-current="page"]::after {
  position: absolute;
  right: 0.6rem;
  bottom: 0.2rem;
  left: 0.6rem;
  height: 2px;
  border-radius: 2px;
  background: #68c8c0;
  content: "";
}

.account-area {
  display: flex;
  align-items: center;
  padding-left: 0.65rem;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  gap: 0.6rem;
}

.account-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: right;
  line-height: 1.25;
}

.account-copy strong {
  max-width: 8rem;
  overflow: hidden;
  color: #fff;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy span {
  color: #a9c1d6;
  font-size: 0.7rem;
}

.logout-form {
  margin: 0;
}

.page-shell {
  width: min(100% - 1.25rem, var(--content));
  min-height: calc(100vh - 168px);
  margin: 0 auto;
  padding: 1.45rem 0 3.5rem;
}

.guest-shell {
  min-height: 100vh;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: min(100% - 1.25rem, var(--content));
  margin: 0 auto;
  padding: 1.25rem 0 1.8rem;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.78rem;
  gap: 0.5rem 1.5rem;
}

.app-footer p {
  margin: 0;
}

.footer-separator {
  margin: 0 0.35rem;
}

.environment-flag {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.08rem 0.4rem;
  border: 1px solid #e7b95c;
  border-radius: 999px;
  color: var(--amber);
  font-size: 0.67rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.62rem 1rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.icon-button:focus-visible,
.nav-toggle:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

.button:disabled {
  transform: none;
  cursor: wait;
  opacity: 0.62;
}

.button-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 15px rgba(31, 104, 166, 0.2);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #175a91;
  color: #fff;
}

.button-secondary {
  border-color: #afc7dc;
  background: #f8fbfe;
  color: var(--blue);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: #7fa8ca;
  background: var(--blue-soft);
}

.button-quiet {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
}

.app-header .button-quiet {
  border-color: rgba(255, 255, 255, 0.3);
  color: #d7e4ee;
}

.button-danger {
  border-color: #e4aaa7;
  background: var(--red-soft);
  color: var(--red);
}

.button-small {
  min-height: 34px;
  padding: 0.42rem 0.7rem;
  font-size: 0.8rem;
}

.button-large {
  min-height: 48px;
  padding: 0.8rem 1.25rem;
}

.button-block {
  width: 100%;
}

.icon-button {
  min-height: 34px;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

.icon-button.danger {
  border-color: #efc5c3;
  color: var(--red);
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.4rem;
  gap: 1rem 2rem;
}

.page-heading > div:first-child {
  min-width: 0;
}

.page-heading p {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--ink-soft);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.heading-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.heading-badges {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  gap: 0.4rem;
}

.inline-separator {
  margin: 0 0.5rem;
  color: var(--line-strong);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.18rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--slate-soft);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
}

.status-CALCULATING,
.engine-UNKNOWN {
  border-color: #cdd8e2;
  background: var(--slate-soft);
  color: #566779;
}

.status-BLOCKED,
.status-RETURNED,
.engine-NO_GO,
.badge-warning,
.batch-CONFIRMED {
  border-color: #efd29a;
  background: var(--amber-soft);
  color: var(--amber);
}

.status-PENDING_REVIEW,
.engine-ESTIMATE {
  border-color: #a9cbe5;
  background: var(--blue-soft);
  color: #185b8e;
}

.status-APPROVED,
.engine-READY,
.batch-RELEASED {
  border-color: #add8bf;
  background: var(--green-soft);
  color: var(--green);
}

.status-CANCELLED,
.engine-ERROR,
.engine-INVALID,
.batch-REJECTED {
  border-color: #edbbb8;
  background: var(--red-soft);
  color: var(--red);
}

.badge-live {
  border-color: #a9cbe5;
  background: var(--blue-soft);
  color: #185b8e;
}

.badge-static {
  border-color: #cbd5df;
  background: var(--slate-soft);
  color: var(--ink-soft);
}

.metric-grid {
  display: grid;
  margin-bottom: 2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.metric-card {
  position: relative;
  display: grid;
  min-height: 126px;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(22, 58, 95, 0.04);
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.5rem;
}

.metric-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: #aab8c7;
  content: "";
}

.metric-card:hover {
  border-color: #adc4d8;
  box-shadow: var(--shadow);
}

.metric-card > span {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric-card > strong {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  color: var(--navy);
  font-size: 2rem;
  line-height: 1;
}

.metric-card > small {
  align-self: end;
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.metric-warn::before {
  background: #e09a27;
}

.metric-good::before {
  background: #39a46f;
}

.metric-danger::before {
  background: #d2645f;
}

.content-section,
.summary-card,
.review-panel {
  margin-bottom: 1.15rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(22, 58, 95, 0.035);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.75rem 1.5rem;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.compact-heading {
  margin-bottom: 0.8rem;
}

.text-link {
  flex: 0 0 auto;
  font-size: 0.86rem;
  font-weight: 700;
}

.section-count,
.version-lock {
  display: inline-flex;
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  background: var(--slate-soft);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.quote-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.quote-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.quote-card:hover {
  transform: translateY(-2px);
  border-color: #adc4d8;
  box-shadow: var(--shadow);
}

.quote-card-link {
  display: block;
  height: 100%;
  padding: 0.95rem;
  color: inherit;
}

.quote-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
  gap: 0.75rem;
}

.quote-card-topline > strong {
  color: var(--navy);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.quote-card h3 {
  margin-bottom: 0.25rem;
}

.quote-project {
  min-height: 1.35em;
  margin-bottom: 0.7rem;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-meta {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.75rem;
}

.compact-meta div {
  display: flex;
  justify-content: space-between;
  min-width: 0;
  gap: 0.35rem;
}

.compact-meta dt,
.compact-meta dd {
  margin: 0;
  font-size: 0.72rem;
}

.compact-meta dt {
  color: var(--ink-faint);
}

.compact-meta dd {
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 650;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-tabs {
  display: flex;
  margin: 0 0 1rem;
  padding: 0.25rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  scrollbar-width: thin;
  gap: 0.2rem;
}

.filter-tabs a {
  flex: 0 0 auto;
  padding: 0.52rem 0.72rem;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.filter-tabs a:hover,
.filter-tabs a[aria-current="page"] {
  background: var(--navy);
  color: #fff;
}

.empty-state {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  min-height: 210px;
  padding: 2rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fbfcfd;
  text-align: center;
}

.empty-state.tall {
  min-height: 360px;
}

.empty-state.compact {
  min-height: 150px;
}

.empty-state h2,
.empty-state h3 {
  margin-bottom: 0.35rem;
}

.empty-state p {
  max-width: 560px;
  color: var(--ink-soft);
}

.empty-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 0.8rem;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 1.35rem;
  font-weight: 800;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.table-tall {
  max-height: 640px;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th,
td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f4f7fa;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

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

tbody tr:hover td {
  background: #f9fbfd;
}

.numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.price-cell {
  color: var(--navy);
  font-weight: 800;
}

.notice {
  position: relative;
  margin-bottom: 1rem;
  padding: 0.85rem 0.95rem 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 10px;
  background: var(--surface);
}

.notice strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--ink);
  font-size: 0.9rem;
}

.notice p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.notice-info {
  border-color: #b8d3e7;
  border-left-color: var(--blue);
  background: #f5faff;
}

.notice-warning {
  border-color: #efd39d;
  border-left-color: #d58a18;
  background: #fffaf0;
}

.notice-danger {
  border-color: #edbebb;
  border-left-color: var(--red);
  background: #fff7f7;
}

.notice-success {
  border-color: #b7dcc6;
  border-left-color: var(--green);
  background: #f4fbf7;
}

.compact-notice {
  margin: 0;
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.form-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(22, 58, 95, 0.035);
}

.form-card-heading {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.form-card-heading-action {
  justify-content: space-between;
}

.heading-with-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.form-card-heading h2,
.form-card-heading p {
  margin-bottom: 0;
}

.form-card-heading p {
  margin-top: 0.18rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.step-number {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  gap: 0.35rem;
}

.field > span em {
  margin-left: 0.25rem;
  color: var(--red);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 650;
}

.field small {
  color: var(--ink-faint);
  font-size: 0.7rem;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}

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

input::placeholder,
textarea::placeholder {
  color: #9aa7b4;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #9fb1c2;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
}

input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}

.quote-line-list,
.material-change-list {
  display: grid;
  gap: 0.8rem;
}

.quote-line,
.material-change-row {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f9fbfd;
}

.quote-line-heading,
.material-change-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  gap: 0.75rem;
}

.quote-line-heading h3,
.material-change-heading strong {
  margin: 0;
  color: var(--navy);
  font-size: 0.88rem;
}

.quote-line .field-wide {
  margin-bottom: 0.8rem;
}

.quantity-grid {
  grid-template-columns: minmax(0, 1fr) 92px;
}

.drum-fields {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line-strong);
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.choice-card,
.acknowledgement {
  display: flex;
  align-items: flex-start;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  cursor: pointer;
  gap: 0.7rem;
}

.choice-card:has(input:checked),
.acknowledgement:has(input:checked) {
  border-color: #8ab6d7;
  background: var(--blue-soft);
}

.choice-card input,
.acknowledgement input {
  flex: 0 0 auto;
  margin-top: 0.1rem;
}

.choice-card span,
.acknowledgement span {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
}

.choice-card strong,
.acknowledgement strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.choice-card small,
.acknowledgement small {
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.conditional-panel {
  margin-top: 0.8rem;
  padding: 0.85rem;
  border: 1px dashed #a8c4da;
  border-radius: 10px;
  background: #f7fbff;
}

.sticky-submit {
  position: sticky;
  z-index: 20;
  bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem;
  border: 1px solid #aebfce;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-raised);
  backdrop-filter: blur(8px);
  gap: 0.85rem;
}

.sticky-submit > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.sticky-submit strong {
  font-size: 0.82rem;
}

.sticky-submit span {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.summary-grid {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.summary-grid > div {
  min-width: 0;
  padding: 0.65rem;
  border-radius: 8px;
  background: #f6f8fa;
}

.summary-grid dt,
.summary-grid dd {
  margin: 0;
}

.summary-grid dt {
  color: var(--ink-faint);
  font-size: 0.7rem;
}

.summary-grid dd {
  margin-top: 0.1rem;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  font-weight: 700;
}

.summary-note {
  margin-top: 0.8rem;
  padding: 0.75rem;
  border-left: 3px solid #9bb7cc;
  background: #f8fafc;
}

.summary-note strong {
  font-size: 0.75rem;
}

.summary-note p {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.process-state {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid #c7d8e6;
  border-radius: var(--radius);
  background: #f7fbff;
  gap: 0.9rem;
}

.process-state h2,
.process-state p {
  margin-bottom: 0;
}

.process-state h2 {
  font-size: 1rem;
}

.process-state p {
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.spinner {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 3px solid #c4d6e6;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.result-list {
  display: grid;
  gap: 1rem;
}

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

.result-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.9rem;
  border-bottom: 1px solid var(--line);
  background: #f7f9fb;
  gap: 0.75rem;
}

.result-card-header h3 {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.line-label {
  color: var(--teal);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.product-facts {
  display: grid;
  margin: 0;
  padding: 0.85rem;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.product-facts > div {
  min-width: 0;
}

.product-facts dt,
.product-facts dd {
  margin: 0;
}

.product-facts dt {
  color: var(--ink-faint);
  font-size: 0.68rem;
}

.product-facts dd {
  margin-top: 0.08rem;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  font-weight: 650;
}

.approved-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0.85rem 0.85rem;
  padding: 0.85rem;
  border: 1px solid #aed7bf;
  border-radius: 10px;
  background: var(--green-soft);
  gap: 1rem;
}

.approved-price > span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 750;
}

.approved-price > strong {
  color: #0e6339;
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.approved-price small {
  font-size: 0.7rem;
  font-weight: 650;
}

.result-message {
  margin: 0 0.85rem 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: var(--slate-soft);
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.result-confirmation {
  margin: 0 0.85rem 0.85rem;
}

.assumption-box,
.candidate-box,
.extra-result {
  margin: 0 0.85rem 0.85rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfd;
}

.assumption-box > strong,
.candidate-box h4,
.extra-result h4 {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
}

.assumption-box ul,
.candidate-box ol {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.candidate-box {
  border-color: #eac989;
  background: #fffaf0;
}

.candidate-box p,
.extra-result p {
  margin: 0 0 0.35rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.extra-result {
  border-color: #bdd3e4;
  background: #f5faff;
}

.extra-result p {
  margin-bottom: 0;
}

.cost-panel {
  padding: 0.9rem;
  border-top: 1px solid #b8cee0;
  background: #f5f9fc;
}

.cost-panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  gap: 0.75rem;
}

.cost-panel-heading h4 {
  margin: 0;
  font-size: 1rem;
}

.evidence-role {
  color: var(--ink-faint);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
}

.cost-metrics {
  display: grid;
  margin-bottom: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.cost-metrics > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cost-metrics span {
  color: var(--ink-faint);
  font-size: 0.67rem;
}

.cost-metrics strong {
  margin-top: 0.1rem;
  color: var(--navy);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.cost-metrics small {
  margin-left: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.64rem;
}

.cost-metrics .cost-total {
  border-color: #e2c17d;
  background: var(--amber-soft);
}

.cost-metrics .cost-total strong {
  color: var(--amber);
}

details > summary {
  cursor: pointer;
  font-weight: 750;
}

.cost-details,
.evidence-details,
.version-history {
  margin-top: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.cost-details summary,
.evidence-details summary,
.version-history summary {
  color: var(--navy);
  font-size: 0.8rem;
}

.cost-details .table-scroll,
.version-history .table-scroll {
  margin-top: 0.7rem;
}

.numeric-table {
  min-width: 820px;
}

.reconciliation-grid {
  display: grid;
  margin-top: 0.8rem;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.reconciliation-grid dl {
  margin: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.reconciliation-grid dl > div {
  display: flex;
  justify-content: space-between;
  padding: 0.28rem 0;
  border-bottom: 1px dashed #e4e9ee;
  gap: 0.75rem;
}

.reconciliation-grid dl > div:last-child {
  border-bottom: 0;
}

.reconciliation-grid dt,
.reconciliation-grid dd {
  margin: 0;
  font-size: 0.72rem;
}

.reconciliation-grid dt {
  color: var(--ink-faint);
}

.reconciliation-grid dd {
  color: var(--ink);
  font-weight: 650;
  text-align: right;
}

.evidence-grid {
  display: grid;
  margin: 0.7rem 0 0;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.evidence-grid > div {
  display: flex;
  justify-content: space-between;
  min-width: 0;
  gap: 0.75rem;
}

.evidence-grid dt,
.evidence-grid dd {
  margin: 0;
  font-size: 0.7rem;
}

.evidence-grid dt {
  color: var(--ink-faint);
}

.evidence-grid dd {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.hash {
  color: #3d5368;
  font-size: 0.72rem;
}

.request-only-list {
  display: grid;
  gap: 0.6rem;
}

.request-only-list article {
  display: grid;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f9fbfd;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.75rem;
}

.request-only-list span,
.request-only-list small {
  color: var(--ink-faint);
  font-size: 0.7rem;
}

.request-only-list strong {
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}

.request-only-list small {
  grid-column: 2;
}

.review-panel {
  border-color: #9ebcd4;
  box-shadow: 0 8px 24px rgba(22, 58, 95, 0.08);
}

.review-intro {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.approval-form,
.return-form {
  display: grid;
  gap: 0.85rem;
}

.approval-price-list {
  display: grid;
  gap: 0.6rem;
}

.approval-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f9fbfd;
  gap: 0.85rem;
}

.approval-price-row > span:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.approval-price-row strong {
  color: var(--navy);
  font-size: 0.8rem;
}

.approval-price-row small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-input {
  display: grid;
  align-items: center;
  flex: 0 0 auto;
  grid-template-columns: auto minmax(92px, 130px) auto;
  gap: 0.3rem;
}

.money-input b {
  color: var(--green);
}

.money-input input {
  text-align: right;
}

.money-input em {
  color: var(--ink-faint);
  font-size: 0.68rem;
  font-style: normal;
}

.section-divider {
  display: flex;
  align-items: center;
  margin: 1rem 0;
  color: var(--ink-faint);
  font-size: 0.7rem;
  gap: 0.65rem;
}

.section-divider::before,
.section-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.timeline,
.audit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 0 0 0.8rem 1.25rem;
}

.timeline li::before {
  position: absolute;
  top: 0.85rem;
  bottom: -0.2rem;
  left: 0.35rem;
  width: 1px;
  background: var(--line-strong);
  content: "";
}

.timeline li:last-child::before {
  display: none;
}

.timeline-marker {
  position: absolute;
  z-index: 1;
  top: 0.55rem;
  left: 0;
  width: 0.72rem;
  height: 0.72rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #a4b2c0;
  box-shadow: 0 0 0 1px #a4b2c0;
}

.timeline-marker.success {
  background: #3b9b68;
  box-shadow: 0 0 0 1px #3b9b68;
}

.timeline-marker.warning {
  background: #d28a1c;
  box-shadow: 0 0 0 1px #d28a1c;
}

.timeline-card {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfd;
}

.timeline-card > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.timeline-card strong,
.timeline-card > div span {
  font-size: 0.78rem;
}

.timeline-card > div span,
.timeline-card small {
  color: var(--ink-faint);
}

.timeline-card p {
  margin: 0.4rem 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.timeline-card small {
  font-size: 0.68rem;
}

.version-history {
  margin-top: 0;
}

.source-fingerprint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: var(--slate-soft);
  color: var(--ink-soft);
  font-size: 0.75rem;
  gap: 1rem;
}

.material-change-grid {
  grid-template-columns: 1fr;
}

.selected-material-row {
  border-color: #9ebed7;
  background: #f6fbff;
}

input[readonly] {
  border-color: var(--line);
  background: var(--slate-soft);
  color: var(--ink-soft);
  cursor: default;
}

.material-source-notice,
.import-file-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.material-source-notice > div:first-child,
.import-file-notice > div:first-child {
  min-width: 0;
}

.material-summary {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, auto);
  gap: 0.45rem;
}

.material-summary > span {
  display: flex;
  min-width: 86px;
  flex-direction: column;
  padding: 0.48rem 0.65rem;
  border: 1px solid #c6dbea;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
  font-size: 0.66rem;
  line-height: 1.25;
}

.material-summary > span strong {
  margin: 0 0 0.1rem;
  color: var(--navy);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.material-toolbar {
  display: flex;
  align-items: end;
  min-width: min(100%, 540px);
  justify-content: flex-end;
  gap: 0.55rem;
}

.filter-field {
  display: flex;
  min-width: 176px;
  flex-direction: column;
  color: var(--ink-faint);
  font-size: 0.66rem;
  font-weight: 700;
  gap: 0.18rem;
}

.filter-field select {
  min-height: 40px;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-size: 0.8rem;
}

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

.search-field input {
  min-height: 40px;
  padding-left: 2.15rem;
  background-color: #fff;
  background-image: radial-gradient(circle at 0.95rem 47%, transparent 0.26rem, #728397 0.28rem, #728397 0.34rem, transparent 0.36rem), linear-gradient(45deg, transparent 45%, #728397 46%, #728397 54%, transparent 55%);
  background-position: 0 0, 1.25rem 1.45rem;
  background-repeat: no-repeat;
  background-size: auto, 0.48rem 0.48rem;
  font-size: 0.82rem;
}

.table-result-count {
  margin: -0.35rem 0 0.65rem;
  color: var(--ink-faint);
  font-size: 0.72rem;
}

.table-result-count strong {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

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

.materials-table thead th {
  position: sticky;
  z-index: 2;
  top: 0;
  box-shadow: 0 1px 0 var(--line);
}

.materials-table .material-action-column,
.materials-table .material-action-cell {
  position: sticky;
  right: 0;
  min-width: 112px;
  text-align: center;
}

.materials-table .material-action-column {
  z-index: 3;
  background: #f4f7fa;
}

.materials-table .material-action-cell {
  z-index: 1;
  background: #fff;
  box-shadow: -1px 0 0 var(--line);
}

.materials-table tbody tr:hover .material-action-cell {
  background: #f9fbfd;
}

.readonly-label {
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}

.upload-dropzone {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 180px;
  flex-direction: column;
  justify-content: center;
  padding: 1.4rem;
  border: 2px dashed #9ab8d0;
  border-radius: 12px;
  background: #f7fbff;
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
  gap: 0.28rem;
}

.upload-dropzone:hover,
.upload-dropzone:has(input:focus-visible),
.upload-dropzone.has-file {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.upload-dropzone:has(input:focus-visible) {
  box-shadow: var(--focus);
}

.upload-dropzone > strong {
  color: var(--navy);
  font-size: 0.95rem;
}

.upload-dropzone > span:not(.upload-icon) {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  opacity: 0;
}

.upload-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 0.35rem;
  place-items: center;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.03em;
}

.import-requirements {
  display: grid;
  margin-top: 0.8rem;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.import-requirements > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  gap: 0.12rem;
}

.import-requirements strong {
  color: var(--ink);
  font-size: 0.76rem;
}

.import-requirements span {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.import-file-notice .badge {
  flex: 0 0 auto;
}

.import-preview-table {
  min-width: 760px;
}

.quote-import-card .section-heading {
  align-items: center;
}

.quote-import-card .section-heading p {
  max-width: 720px;
  color: var(--ink-soft);
}

.quote-import-form {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.upload-dropzone-compact {
  display: grid;
  min-height: 92px;
  margin: 0;
  padding: 0.8rem 1rem;
  grid-template-columns: auto 1fr;
  justify-content: start;
  text-align: left;
}

.upload-dropzone-compact .upload-icon {
  grid-row: 1 / 3;
}

.import-inline-help {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  .quote-import-form {
    grid-template-columns: 1fr;
  }

  .quote-import-form > .button {
    width: 100%;
  }
}

.price-delta {
  color: var(--ink-soft);
  font-weight: 700;
}

.filter-empty {
  margin: 0.8rem 0 0;
  padding: 1.2rem;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--ink-soft);
  text-align: center;
}

.audit-list {
  display: grid;
  gap: 0.7rem;
}

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

.audit-card-main {
  display: grid;
  align-items: start;
  padding: 0.8rem;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem 0.7rem;
}

.audit-id {
  display: inline-flex;
  padding: 0.16rem 0.4rem;
  border-radius: 5px;
  background: var(--slate-soft);
  color: var(--ink-faint);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.66rem;
}

.audit-card h3 {
  margin: 0;
  font-size: 0.88rem;
}

.audit-card p {
  margin: 0.18rem 0 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.audit-card time {
  grid-column: 2;
  color: var(--ink-faint);
  font-size: 0.68rem;
}

.audit-card details {
  padding: 0.65rem 0.8rem;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.audit-card summary {
  color: var(--blue);
  font-size: 0.72rem;
}

.audit-card pre {
  max-height: 360px;
  margin: 0.7rem 0 0;
  padding: 0.7rem;
  overflow: auto;
  border-radius: 7px;
  background: #172433;
  color: #d9e5ee;
  font-size: 0.68rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.error-card {
  width: min(100%, 580px);
  margin: clamp(2rem, 12vh, 7rem) auto;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  text-align: center;
}

.error-code {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 0.9rem;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 1.65rem;
  font-weight: 850;
}

.error-card p {
  max-width: 460px;
  margin-right: auto;
  margin-left: auto;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.1rem;
  gap: 0.65rem;
}

.login-body {
  background: var(--navy-deep);
}

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1fr;
}

.login-intro {
  padding: 2rem 1.25rem 3rem;
  background: radial-gradient(circle at 85% 10%, rgba(40, 126, 159, 0.38), transparent 32%), linear-gradient(145deg, #0d2944, #16476c 62%, #116764);
  color: #d9e8f2;
}

.login-intro h1 {
  max-width: 680px;
  margin-top: clamp(3rem, 10vh, 7rem);
  color: #fff;
  font-size: clamp(2rem, 7vw, 3.6rem);
}

.login-intro > p {
  max-width: 680px;
  color: #c6d9e6;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark-large {
  width: 46px;
  height: 46px;
  font-size: 1.15rem;
}

.login-brand > div {
  display: flex;
  flex-direction: column;
}

.login-brand strong {
  color: #fff;
  font-size: 1rem;
}

.login-brand span:last-child {
  color: #a9c3d5;
  font-size: 0.72rem;
}

.feature-list {
  display: grid;
  max-width: 680px;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  gap: 0.75rem;
}

.feature-list li {
  display: flex;
  align-items: center;
  font-size: 0.84rem;
  gap: 0.75rem;
}

.feature-list li span {
  display: inline-grid;
  width: 34px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  color: #74d0c7;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
}

.login-card {
  align-self: center;
  margin: -1.4rem 0.75rem 2rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-raised);
}

.login-card h2 {
  margin-bottom: 0.4rem;
}

.login-card > .muted {
  margin-bottom: 1.1rem;
  font-size: 0.82rem;
}

.security-note,
.dev-warning {
  margin: 0.75rem 0 0;
  color: var(--ink-faint);
  font-size: 0.68rem;
  text-align: center;
}

.dev-user-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.dev-user {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.dev-user:hover {
  border-color: #9bbbd4;
  background: var(--blue-soft);
}

.dev-user strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-user span {
  color: var(--ink-faint);
  font-size: 0.66rem;
}

@media (max-width: 799px) {
  .js .nav-toggle {
    display: inline-flex;
  }

  .header-inner {
    padding: 0.65rem 0;
  }

  .primary-nav {
    order: 4;
    width: 100%;
    margin: 0;
    padding-top: 0.55rem;
    overflow-x: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .js .primary-nav {
    display: none;
  }

  .js .primary-nav.is-open {
    display: flex;
  }

  .account-area {
    order: 3;
    width: 100%;
    justify-content: space-between;
    padding: 0.55rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 0;
  }

  .account-copy {
    text-align: left;
  }

  .page-heading,
  .section-heading.material-heading,
  .form-card-heading-action {
    align-items: stretch;
    flex-direction: column;
  }

  .material-source-notice,
  .import-file-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .material-summary {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .material-summary > span {
    min-width: 0;
  }

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

  .filter-field,
  .material-toolbar .search-field {
    width: 100%;
    min-width: 0;
  }

  .page-heading .heading-actions,
  .page-heading > .button {
    width: 100%;
  }

  .heading-actions .button,
  .page-heading > .button {
    flex: 1;
  }

  .sticky-submit {
    align-items: stretch;
    flex-direction: column;
    bottom: max(0.4rem, env(safe-area-inset-bottom));
  }

  .sticky-submit > div {
    display: none;
  }

  .sticky-submit .button {
    width: 100%;
  }

  .approval-price-row {
    align-items: stretch;
    flex-direction: column;
  }

  .money-input {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .search-field {
    width: 100%;
  }

  .app-footer {
    flex-direction: column;
  }
}

@media (min-width: 560px) {
  .page-shell {
    width: min(100% - 2rem, var(--content));
    padding-top: 2rem;
  }

  .header-inner,
  .app-footer {
    width: min(100% - 2rem, var(--content));
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .two-columns,
  .choice-grid,
  .material-change-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .cost-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .audit-card-main {
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .audit-card time {
    grid-row: 1;
    grid-column: 3;
  }

  .login-card {
    width: min(calc(100% - 2rem), 500px);
    margin: -2rem auto 3rem;
    padding: 1.75rem;
  }
}

@media (min-width: 800px) {
  .header-inner {
    flex-wrap: nowrap;
    min-height: 70px;
  }

  .brand {
    margin-right: 0.7rem;
  }

  .content-section,
  .summary-card,
  .review-panel,
  .form-card {
    padding: 1.25rem;
  }

  .metric-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .quote-grid-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .import-requirements {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reconciliation-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .login-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(420px, 0.65fr);
  }

  .login-intro {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2.5rem, 7vw, 6rem);
  }

  .login-intro h1 {
    margin-top: clamp(3rem, 9vh, 6rem);
  }

  .login-card {
    width: min(calc(100% - 3rem), 460px);
    margin: 2rem auto;
    padding: 2rem;
  }
}

@media (min-width: 1080px) {
  .quote-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quote-grid-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Role-focused compact workflow pages. Audit data remains in the document flow,
   while each role's primary task stays visible without oversized cards. */
.compact-workflow-page .page-shell {
  width: min(100% - 1.25rem, 1480px);
  padding-top: 0.9rem;
}

.compact-page-heading {
  align-items: center;
  margin-bottom: 0.65rem;
}

.compact-page-heading h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
}

.materials-page .material-library-section {
  margin-bottom: 0;
  padding: 0.7rem;
}

.materials-page .material-heading {
  align-items: center;
  margin-bottom: 0.55rem;
}

.material-title-line {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.material-title-line h2 {
  margin: 0;
  font-size: 1.02rem;
}

.material-title-line > span {
  color: var(--ink-faint);
  font-size: 0.7rem;
  white-space: nowrap;
}

.material-title-line > span strong {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.materials-page .material-toolbar {
  min-width: 0;
}

.materials-page .search-field {
  width: min(32vw, 280px);
}

.materials-page .search-field input {
  min-height: 34px;
  padding-top: 0.38rem;
  padding-bottom: 0.38rem;
}

.materials-compact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.28rem 0.45rem;
}

.material-price-item {
  display: flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  gap: 0.55rem;
}

.material-price-item.is-editable:hover,
.material-price-item.is-editable:focus-visible {
  border-color: #77a7ce;
  background: var(--blue-soft);
}

.material-price-item.is-readonly {
  background: #f8fafc;
}

.material-price-name {
  min-width: 0;
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-price-value {
  flex: 0 0 auto;
  color: var(--navy);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

.material-price-value small {
  margin-left: 0.18rem;
  color: var(--ink-faint);
  font-size: 0.56rem;
  font-weight: 600;
}

.material-price-action {
  flex: 0 0 auto;
  padding-left: 0.42rem;
  border-left: 1px solid var(--line);
  color: var(--blue);
  font-size: 0.62rem;
  font-weight: 750;
  white-space: nowrap;
}

.material-maintenance-page .page-heading {
  align-items: center;
  margin-bottom: 0.65rem;
}

.material-maintenance-page .page-heading h1 {
  margin-bottom: 0.18rem;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
}

.material-maintenance-page .page-heading p {
  margin: 0;
  font-size: 0.78rem;
}

.material-maintenance-page .stack-form {
  gap: 0.65rem;
}

.material-maintenance-page .form-card {
  padding: 0.75rem;
  border-radius: 10px;
}

.material-maintenance-page .form-card-heading {
  margin-bottom: 0.65rem;
}

.material-maintenance-page .step-number {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 0.7rem;
}

.material-maintenance-page .form-card-heading h2 {
  font-size: 1.02rem;
}

.material-maintenance-page .source-fingerprint {
  margin-bottom: 0.6rem;
  padding: 0.48rem 0.6rem;
}

.material-maintenance-page .form-card-heading .source-fingerprint {
  margin-bottom: 0;
}

.material-maintenance-page textarea {
  min-height: 62px;
}

.material-maintenance-page .material-change-row {
  padding: 0.7rem;
}

.material-maintenance-page .material-change-heading {
  margin-bottom: 0.55rem;
}

.material-type-notice {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.material-new-grid {
  grid-template-columns: 1fr;
}

.material-maintenance-page .compact-sticky-submit {
  justify-content: space-between;
}

.materials-page .filter-empty {
  margin-top: 0.5rem;
  padding: 0.75rem;
}

.quote-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  gap: 0.55rem 1rem;
}

.quote-tools-main,
.quote-import-form-compact {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.45rem;
}

.quote-tools-main > strong {
  flex: 0 0 auto;
  color: var(--navy);
  font-size: 0.8rem;
}

.quote-tools p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.69rem;
  text-align: right;
}

.quote-file-button {
  position: relative;
  overflow: hidden;
}

.quote-file-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  cursor: pointer;
  opacity: 0;
}

.quote-file-button.has-file {
  border-color: #70a889;
  background: var(--green-soft);
  color: var(--green);
}

.quote-upload-name {
  max-width: 150px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-import-notice {
  display: flex;
  align-items: center;
  margin-bottom: 0.65rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  gap: 0.65rem;
}

.compact-import-notice p {
  margin: 0;
  font-size: 0.74rem;
}

.compact-quote-form {
  gap: 0.65rem;
}

.quote-form-page .compact-form-card {
  padding: 0.65rem;
}

.quote-form-page .field {
  gap: 0.2rem;
}

.quote-form-page .field > span {
  font-size: 0.7rem;
}

.quote-form-page input,
.quote-form-page select,
.quote-form-page textarea {
  min-height: 36px;
  padding: 0.42rem 0.55rem;
  font-size: 0.82rem;
}

.quote-form-page textarea {
  min-height: 58px;
}

.compact-basic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.compact-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.75rem;
}

.compact-section-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.compact-quote-lines {
  gap: 0.38rem;
}

.quote-entry-table-scroll {
  max-height: min(68vh, 720px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-entry-table {
  width: 100%;
  min-width: 780px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.quote-entry-table th,
.quote-entry-table td {
  padding: 0.25rem 0.3rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  vertical-align: middle;
}

.quote-entry-table thead th {
  position: sticky;
  z-index: 3;
  top: 0;
  background: #edf2f7;
  color: var(--ink-soft);
  font-size: 0.68rem;
  text-align: left;
}

.quote-entry-table thead em {
  color: var(--red);
  font-size: 0.62rem;
  font-style: normal;
}

.quote-entry-table th:first-child,
.quote-entry-index {
  width: 38px;
  text-align: center;
}

.quote-entry-table th:nth-child(3),
.quote-entry-table th:nth-child(5),
.quote-entry-number {
  width: 112px;
}

.quote-entry-table th:nth-child(4),
.quote-entry-table th:nth-child(6),
.quote-entry-unit {
  width: 78px;
}

.quote-entry-table th:last-child,
.quote-entry-action {
  width: 58px;
  text-align: center;
}

.quote-entry-table tbody tr:last-child td {
  border-bottom: 0;
}

.quote-entry-table input,
.quote-entry-table select {
  min-height: 30px;
  padding: 0.28rem 0.4rem;
  border-radius: 6px;
  font-size: 0.78rem;
}

.quote-entry-spec input {
  font-weight: 650;
}

.quote-entry-table .quote-line-index {
  width: 24px;
  min-height: 28px;
  margin: 0 auto;
  border-radius: 5px;
  font-size: 0.66rem;
}

.quote-entry-table .quote-line-remove {
  min-height: 28px;
  padding: 0.2rem 0.36rem;
  font-size: 0.68rem;
}

.compact-quote-line {
  display: flex;
  align-items: flex-end;
  padding: 0.45rem;
  border-radius: 8px;
  background: #fbfcfd;
  gap: 0.45rem;
}

.quote-line-index {
  display: grid;
  width: 28px;
  min-height: 36px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 7px;
  background: var(--navy);
  color: #fff;
  font-size: 0.74rem;
}

.quote-spec-field {
  flex: 1 1 420px;
}

.quote-number-fields {
  display: grid;
  width: 210px;
  flex: 0 1 210px;
  grid-template-columns: minmax(86px, 1fr) 76px;
  gap: 0.38rem;
}

.quote-form-page .compact-quote-line .drum-fields {
  margin: 0;
  padding: 0;
  border: 0;
}

.quote-line-remove {
  flex: 0 0 auto;
  min-height: 36px;
}

.quote-options-bar {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.compact-option-row {
  display: flex;
  align-items: flex-end;
  min-width: 0;
  gap: 0.5rem;
}

.compact-check {
  display: flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  gap: 0.35rem;
}

.compact-check:has(input:checked) {
  border-color: #8ab6d7;
  background: var(--blue-soft);
  color: var(--blue);
}

.compact-check input {
  width: 17px;
  min-height: 17px;
}

.compact-destination {
  min-width: 260px;
  flex: 1 1 360px;
}

.quote-note-details {
  flex: 0 1 300px;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quote-note-details summary {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.quote-note-details[open] {
  min-width: 260px;
}

.quote-note-details .field {
  margin-top: 0.4rem;
}

.compact-sticky-submit {
  justify-content: flex-end;
  padding: 0.42rem;
  border-radius: 9px;
}

.quote-title-line,
.result-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.55rem;
}

.quote-title-line h1,
.quote-title-line .heading-badges {
  margin: 0;
}

.quote-detail-heading p {
  margin-top: 0.18rem;
  font-size: 0.78rem;
}

.quote-meta-strip {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 0.65rem;
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.7rem;
  gap: 0.35rem 0.8rem;
}

.quote-meta-strip > span + span::before {
  margin-right: 0.8rem;
  color: var(--line-strong);
  content: "·";
}

.quote-meta-strip details {
  position: relative;
  margin-left: auto;
}

.quote-meta-strip summary {
  color: var(--blue);
  font-size: 0.7rem;
}

.quote-meta-strip details p {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.quote-detail-page .product-results {
  padding: 0.7rem;
}

.quote-detail-page .product-results > .section-heading {
  align-items: center;
  margin-bottom: 0.55rem;
}

.quote-detail-page .product-results > .section-heading .eyebrow {
  display: none;
}

.quote-detail-page .product-results > .section-heading h2 {
  margin: 0;
  font-size: 1.05rem;
}

.compact-result-table-scroll {
  max-height: min(72vh, 760px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-result-table {
  width: 100%;
  min-width: 940px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.compact-result-table th,
.compact-result-table td {
  padding: 0.3rem 0.42rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 0.72rem;
  line-height: 1.35;
  vertical-align: middle;
}

.compact-result-table thead th {
  position: sticky;
  z-index: 3;
  top: 0;
  background: #edf2f7;
  color: var(--ink-soft);
  font-size: 0.66rem;
  text-align: left;
}

.compact-result-table tbody tr:last-child td {
  border-bottom: 0;
}

.compact-result-table th:first-child,
.result-row-number {
  width: 38px;
  color: var(--ink-faint);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.compact-result-table th:nth-child(2) {
  width: 31%;
}

.compact-result-table th:nth-child(3),
.result-row-quantity {
  width: 76px;
  text-align: right;
}

.result-row-spec strong,
.result-row-spec small,
.result-row-status small {
  display: block;
}

.result-row-spec strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-row-spec > strong:hover,
.result-row-spec > strong:focus,
.calibration-spec-cell > strong:hover,
.calibration-spec-cell > strong:focus {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  outline: none;
}

.result-row-spec small,
.result-row-status small,
.result-row-quantity small {
  color: var(--ink-faint);
  font-size: 0.6rem;
}

.result-row-quantity strong,
.result-system-price,
.result-approved-price {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-row-quantity small,
.result-system-price small,
.result-approved-price small {
  margin-left: 0.12rem;
}

.result-approved-price strong {
  font-size: 0.86rem;
}

.result-row-status .badge {
  margin-bottom: 0.12rem;
}

.compact-row-details {
  margin-top: 0.18rem;
}

.compact-row-details > summary {
  color: var(--blue);
  font-size: 0.63rem;
  font-weight: 700;
}

.candidate-row-details ol {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
}

.result-row-extras p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.64rem;
}

.result-row-extras p + p {
  margin-top: 0.2rem;
}

.result-row-extras strong {
  margin-right: 0.25rem;
  color: var(--ink);
}

.result-row-detail {
  width: 150px;
}

.result-row-detail .compact-row-details[open] {
  min-width: 540px;
}

.compact-cost-summary {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.35rem;
  padding: 0.35rem;
  border-radius: 6px;
  background: #f4f7fa;
  color: var(--ink-soft);
  gap: 0.25rem 0.65rem;
}

.compact-cost-summary span {
  white-space: nowrap;
}

.calibration-saved-reason {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.compact-material-table {
  margin-top: 0.35rem;
}

.compact-material-table th,
.compact-material-table td {
  padding: 0.28rem 0.35rem;
  font-size: 0.64rem;
}

.quote-detail-page .result-list {
  gap: 0.55rem;
}

.quote-detail-page .result-card {
  border-radius: 9px;
}

.quote-detail-page .result-card-header {
  align-items: center;
  padding: 0.5rem 0.6rem;
}

.result-identity h3 {
  margin: 0;
  font-size: 0.9rem;
}

.result-line-number {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
}

.result-quantity {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 0.74rem;
  white-space: nowrap;
}

.result-source-spec {
  margin: 0;
  padding: 0.38rem 0.65rem;
  color: var(--ink-faint);
  font-size: 0.7rem;
}

.quote-detail-page .approved-price,
.quote-detail-page .result-message,
.quote-detail-page .result-confirmation,
.quote-detail-page .candidate-box,
.quote-detail-page .extra-result {
  margin: 0.5rem 0.6rem;
  padding: 0.55rem 0.65rem;
}

.assumption-details {
  margin: 0.5rem 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.assumption-details summary {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.assumption-details ul {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.quote-detail-page .cost-panel {
  padding: 0.6rem;
}

.quote-detail-page .cost-panel-heading {
  margin-bottom: 0.45rem;
}

.quote-detail-page .cost-panel-heading h4 {
  font-size: 0.86rem;
}

.quote-detail-page .cost-metrics {
  margin-bottom: 0.45rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.quote-detail-page .cost-metrics > div {
  padding: 0.48rem 0.55rem;
}

.quote-detail-page .cost-metrics strong {
  font-size: 0.92rem;
}

.quote-detail-page .cost-details {
  margin-top: 0.45rem;
  padding: 0.5rem;
}

.quote-detail-page .cost-details th,
.quote-detail-page .cost-details td {
  padding: 0.42rem 0.5rem;
}

.quote-detail-page .cost-details .reconciliation-grid,
.quote-detail-page .cost-details .evidence-grid {
  margin-top: 0.55rem;
}

.compact-review-panel {
  padding: 0.7rem;
}

.compact-review-panel .section-heading h2 {
  margin: 0;
  font-size: 1.05rem;
}

.compact-review-panel .approval-price-list {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0.4rem;
}

.compact-review-panel .approval-price-row {
  padding: 0.5rem 0.6rem;
}

.compact-review-panel .approval-form {
  gap: 0.55rem;
}

.compact-review-panel textarea {
  min-height: 58px;
}

.compact-acknowledgement {
  padding: 0.5rem 0.6rem;
}

.compact-review-panel .approval-form > .button {
  justify-self: end;
}

.calibration-panel {
  margin-bottom: 0.65rem;
  padding: 0.55rem;
}

.calibration-panel .section-heading {
  align-items: center;
  margin-bottom: 0.45rem;
}

.calibration-heading-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.calibration-heading-meta details {
  position: relative;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.calibration-heading-meta details p {
  position: absolute;
  z-index: 8;
  right: 0;
  width: min(360px, 80vw);
  margin: 0.35rem 0 0;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.calibration-form {
  gap: 0.45rem;
}

.calibration-table-scroll {
  max-height: min(72vh, 760px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calibration-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.calibration-table th,
.calibration-table td {
  padding: 0.28rem 0.38rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 0.72rem;
  vertical-align: middle;
}

.calibration-table thead th {
  position: sticky;
  z-index: 4;
  top: 0;
  background: #eaf1f7;
  color: var(--ink-soft);
  font-size: 0.67rem;
  line-height: 1.25;
  text-align: left;
}

.calibration-table thead small {
  color: var(--ink-faint);
  font-size: 0.58rem;
  font-weight: 500;
}

.calibration-table th:first-child {
  width: 240px;
}

.calibration-table th:nth-child(2) {
  width: 72px;
}

.calibration-table th:nth-child(3) {
  width: 300px;
}

.calibration-table th:nth-child(4) {
  width: 98px;
}

.calibration-table th:nth-child(5) {
  width: 165px;
}

.calibration-table th:nth-child(6) {
  width: 120px;
}

.calibration-table th:nth-child(7) {
  width: 210px;
}

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

.calibration-table tbody tr.is-adjusted td {
  background: #fffaf0;
}

.calibration-spec-cell > strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calibration-quantity {
  text-align: right;
  white-space: nowrap;
}

.calibration-quantity strong {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.calibration-quantity small {
  margin-left: 0.12rem;
  color: var(--ink-faint);
  font-size: 0.6rem;
}

.calibration-parameter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
}

.calibration-parameter-grid label {
  display: grid;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.2rem;
}

.calibration-parameter-grid span {
  color: var(--ink-faint);
  font-size: 0.58rem;
  white-space: nowrap;
}

.calibration-table input {
  min-height: 29px;
  padding: 0.25rem 0.36rem;
  border-radius: 6px;
  font-size: 0.75rem;
}

.calibration-parameter-grid input,
.compact-money-input input,
.calibration-material-list input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.calibration-suggested strong {
  color: var(--navy);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.compact-money-input {
  grid-template-columns: auto minmax(78px, 1fr) auto;
  gap: 0.2rem;
}

.compact-money-input input {
  font-weight: 750;
}

.calibration-difference strong {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calibration-difference strong.is-up {
  color: var(--green);
}

.calibration-difference strong.is-down {
  color: var(--red);
}

.calibration-reason-cell input {
  min-width: 0;
}

.calibration-material-details,
.calibration-extra-details {
  margin-top: 0.18rem;
}

.calibration-material-details summary,
.calibration-extra-details summary {
  color: var(--blue);
  font-size: 0.62rem;
  font-weight: 700;
}

.calibration-extra-details p {
  margin: 0.18rem 0 0;
  color: var(--ink-soft);
  font-size: 0.62rem;
  line-height: 1.35;
}

.calibration-material-list {
  display: grid;
  margin-top: 0.25rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  gap: 0.25rem;
}

.calibration-material-list > div {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) 105px;
  gap: 0.35rem;
}

.calibration-material-list span,
.calibration-material-list span small {
  display: block;
  min-width: 0;
}

.calibration-material-list span strong {
  overflow: hidden;
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calibration-material-list span small {
  color: var(--ink-faint);
  font-size: 0.56rem;
}

.calibration-material-list label {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.18rem;
}

.calibration-material-list em {
  color: var(--ink-faint);
  font-size: 0.55rem;
  font-style: normal;
}

.calibration-submit-bar {
  position: sticky;
  z-index: 5;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  padding: 0.55rem 0;
  background: linear-gradient(to top, var(--surface) 70%, rgb(255 255 255 / 0%));
}

.approval-queue-page .page-heading {
  margin-bottom: 0.65rem;
}

.approval-queue-page .page-heading h1 {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
}

.approval-queue-page .page-heading p {
  margin: 0;
  font-size: 0.76rem;
}

.approval-queue-page .quote-grid-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.45rem;
}

.approval-queue-page .quote-card-link {
  padding: 0.65rem;
}

.approval-queue-page .quote-card-topline,
.approval-queue-page .quote-project {
  margin-bottom: 0.4rem;
}

.approval-queue-page .quote-card h3 {
  font-size: 0.95rem;
}

.approval-queue-page .compact-meta {
  gap: 0.22rem 0.55rem;
}

.return-review-details {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.return-review-details > summary {
  color: var(--red);
  font-size: 0.76rem;
}

.return-review-details .return-form {
  margin-top: 0.6rem;
}

.compact-history-section {
  padding: 0.6rem;
}

.decision-history > summary {
  color: var(--navy);
  font-size: 0.8rem;
}

.decision-history .timeline {
  margin-top: 0.65rem;
}

.quote-detail-page .version-history {
  padding: 0.5rem;
}

@media (max-width: 1050px) {
  .materials-compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-tools p {
    text-align: left;
  }

  .compact-quote-line {
    flex-wrap: wrap;
  }

  .quote-spec-field {
    flex-basis: calc(100% - 105px);
  }

  .quote-number-fields {
    width: auto;
    flex: 1 1 220px;
  }
}

@media (min-width: 760px) {
  .material-new-grid {
    grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(150px, 0.7fr);
  }

  .material-new-grid .field-span-2 {
    grid-column: span 2;
  }

  .material-new-grid .field-span-3 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .compact-workflow-page .page-shell {
    width: min(100% - 0.75rem, 1480px);
  }

  .materials-page .material-heading,
  .quote-tools-main,
  .quote-import-form-compact,
  .compact-option-row {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-meta-strip {
    flex-wrap: wrap;
  }

  .materials-page .search-field,
  .quote-upload-name,
  .compact-destination,
  .quote-note-details {
    width: 100%;
    max-width: none;
  }

  .materials-compact-grid,
  .compact-basic-grid,
  .quote-detail-page .cost-metrics {
    grid-template-columns: 1fr;
  }

  .material-price-action {
    margin-left: auto;
  }

  .quote-tools-main > .button,
  .quote-import-form-compact .button {
    width: 100%;
  }

  .compact-quote-line {
    align-items: stretch;
  }

  .quote-spec-field,
  .quote-number-fields {
    width: 100%;
    flex-basis: 100%;
  }

  .quote-line-remove {
    margin-left: auto;
  }

  .compact-check {
    justify-content: center;
  }

  .quote-title-line,
  .result-identity {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .quote-meta-strip > span + span::before {
    display: none;
  }

  .quote-meta-strip details {
    margin-left: 0;
  }

  .compact-review-panel .approval-price-list {
    grid-template-columns: 1fr;
  }
}

/* 保本价明细行：引擎 v0.3.8 起保本价=K口径+运费摊+盘具摊，构成与未计入原因必须
   跟着数字一起出现，避免销售与核价人对着一个无法解释的合计做决定。 */
.breakeven-detail {
  display: block;
  margin-top: 0.35rem;
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: left;
  color: var(--muted, #6b7280);
  white-space: normal;
  word-break: break-word;
}
