:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #203248;
  background: #f3f6f9;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; }
.topbar { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 10px clamp(20px, 5vw, 72px); color: #203248; background: #fff; border-bottom: 1px solid #dce4eb; box-shadow: 0 2px 12px #0b21330d; }
.brand { display: inline-flex; align-items: center; width: fit-content; color: inherit; text-decoration: none; }
.brand-logo { display: block; width: min(260px, 62vw); height: auto; max-height: 78px; object-fit: contain; background: #fff; }
.brand:focus-visible { outline: 3px solid #5ca7d8; outline-offset: 4px; }
.user-bar { display: flex; align-items: center; gap: 16px; color: #30475b; font-size: 14px; }
.page-shell { width: min(100% - 32px, 1100px); flex: 1; margin: 42px auto; }
.panel { border: 1px solid #dce4eb; border-radius: 14px; background: #fff; box-shadow: 0 12px 32px #1635520d; }
.login-panel { width: min(100%, 460px); margin: 36px auto; padding: clamp(24px, 5vw, 40px); }
.eyebrow { margin: 0 0 9px; color: #47718e; font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
h1 { margin: 0; color: #17324d; font-size: clamp(28px, 4vw, 36px); letter-spacing: -.025em; }
.muted { margin: 10px 0 0; color: #627487; line-height: 1.55; }
.form-stack { display: grid; gap: 10px; margin-top: 28px; }
.form-stack label { margin-top: 5px; color: #30475b; font-size: 14px; font-weight: 650; }
.form-stack input { width: 100%; min-height: 46px; border: 1px solid #b8c7d4; border-radius: 7px; padding: 10px 12px; color: #203248; background: #fff; }
.form-stack input:focus { border-color: #2673a7; outline: 3px solid #2673a733; }
.button { min-height: 42px; border: 1px solid transparent; border-radius: 7px; padding: 9px 15px; cursor: pointer; font-weight: 700; transition: background .15s ease, border-color .15s ease; }
.button:focus-visible { outline: 3px solid #5ca7d8; outline-offset: 2px; }
.button-primary { margin-top: 10px; color: #fff; background: #176b9a; }
.button-primary:hover { background: #10577e; }
.button-secondary { border-color: #b8c9d7; color: #23465f; background: #fff; }
.button-secondary:hover, .button-quiet:hover { background: #eaf1f6; }
.button-quiet { border-color: #8ea9bf; color: #fff; background: transparent; }
.message { min-height: 20px; margin: 14px 0 0; color: #9a3028; font-size: 14px; line-height: 1.45; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 30px 32px 24px; border-bottom: 1px solid #e4ebf0; }
.cases-panel .message { margin: 0; padding: 0 32px; }
.empty-state { margin: 24px 32px; border: 1px dashed #c9d6e0; border-radius: 10px; padding: 26px; background: #f8fafb; }
.empty-state h2 { margin: 0; color: #28445b; font-size: 18px; }
.empty-state p { margin: 8px 0 0; color: #65788a; line-height: 1.5; }
.table-wrap { overflow-x: auto; padding: 12px 32px 24px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px 24px; }
.page-summary { color: #65788a; font-size: 13px; }
.page-buttons { display: flex; gap: 8px; }
.button:disabled { cursor: not-allowed; opacity: .5; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 13px 12px; color: #597083; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
td { padding: 15px 12px; border-top: 1px solid #e7edf2; color: #253d51; font-size: 14px; }
td:first-child { color: #176b9a; font-weight: 750; white-space: nowrap; }
.scope-note { margin: 0 32px 26px; border-left: 3px solid #91b6cf; padding: 2px 0 2px 12px; color: #687c8e; font-size: 13px; line-height: 1.5; }
.preview-warning { margin: 22px 32px 0; border: 1px solid #e2c783; border-radius: 8px; padding: 13px 16px; color: #654e16; background: #fff9e8; font-size: 14px; line-height: 1.5; }
.intake-stepper { display: flex; gap: 8px; overflow-x: auto; padding: 20px 32px 12px; }
.step-marker { flex: 0 0 auto; border-radius: 999px; padding: 7px 11px; color: #617486; background: #eef2f5; font-size: 12px; white-space: nowrap; }
.step-marker.current { color: #fff; background: #176b9a; font-weight: 750; }
.step-marker.complete { color: #244d68; background: #dcecf5; }
.intake-content { min-height: 280px; padding: 20px 32px; }
.intake-subtitle { margin: 0 0 16px; color: #233f56; font-size: 20px; }
.selection-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.selection-card { display: grid; gap: 10px; min-height: 100px; border: 1px solid #c4d2dc; border-radius: 10px; padding: 17px; color: #263e53; background: #fff; text-align: left; cursor: pointer; }
.selection-card:hover { border-color: #4c8eb3; background: #f8fbfd; }
.selection-card:focus-visible { outline: 3px solid #5ca7d8; outline-offset: 2px; }
.selection-card.is-selected { border-color: #176b9a; box-shadow: inset 0 0 0 2px #176b9a; background: #f1f8fc; }
.catalog-product-image { display: block; width: 100%; height: 132px; border-radius: 6px; object-fit: contain; background: #fff; }
.selection-note { color: #6b7e8f; font-size: 12px; }
 .package-feature-heading {
  margin-top: 4px;
  color: #25384d;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}
.selection-features {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: #405a6e;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}
.selection-features li { padding-left: 2px; }
.timing-card { width: min(100%, 560px); min-height: 56px; margin: 0 0 10px; }
.intake-hint { margin-top: 16px; }
.quantity-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; border: 1px solid #d7e1e8; border-radius: 8px; padding: 10px 12px; }
.quantity-row > span:first-child { flex: 1; }
.quantity-count { min-width: 28px; text-align: center; }
.quantity-button { min-width: 40px; padding-right: 10px; padding-left: 10px; }
.field-map-card { margin: 0 0 10px; border: 1px solid #d7e1e8; border-radius: 8px; padding: 13px 16px; background: #fbfcfd; }
.field-map-card h3 { margin: 0; color: #304c62; font-size: 15px; }
.field-map-card p { margin: 7px 0 0; color: #63788a; font-size: 14px; line-height: 1.5; }
.order-details-panel { margin-top: 24px; border: 1px solid #d7e1e8; border-radius: 10px; padding: 18px; background: #fff; }
.order-details-panel .intake-subtitle { margin-bottom: 4px; }
.preview-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 20px; }
.preview-field { display: grid; gap: 6px; color: #30475b; font-size: 13px; font-weight: 650; }
.preview-field input { width: 100%; min-height: 42px; border: 1px solid #b8c7d4; border-radius: 7px; padding: 9px 11px; color: #203248; background: #fff; font: inherit; font-weight: 400; }
.preview-field input:focus { border-color: #2673a7; outline: 3px solid #2673a733; }
.review-row { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e1e8ed; padding: 13px 4px; }
.review-row span { text-align: right; }
.review-warning { margin: 20px 0 0; }
.po-draft-panel { margin-top: 24px; border: 1px solid #c8d9e5; border-radius: 10px; padding: 18px; background: #f8fbfd; }
.po-draft-panel .intake-subtitle { margin-bottom: 8px; }
.po-draft-panel h3 { margin: 18px 0 8px; color: #304c62; font-size: 15px; }
.po-line-list { margin: 12px 0; padding-left: 22px; color: #405a6e; line-height: 1.6; }
.po-placeholder-address { margin: 14px 0; border-left: 3px solid #91b6cf; padding-left: 11px; color: #536c7e; font-size: 14px; }
.po-template-header { display: grid; gap: 5px; margin: 18px 0 12px; border-bottom: 2px solid #6a31bc; padding: 0 0 12px; color: #263f55; }
.po-template-header strong { color: #5d22ad; font-size: 17px; letter-spacing: .04em; }
.po-template-header span { color: #5b7081; font-size: 13px; }
.po-template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.po-template-field { display: grid; gap: 3px; border: 1px solid #d7e1e8; border-radius: 6px; padding: 9px; background: #fff; font-size: 13px; }
.po-template-field strong { color: #425b6e; }
.po-template-field span { color: #253d51; }
.po-template-table { overflow-x: auto; margin: 14px 0; border: 1px solid #b8c7d4; }
.po-template-row { display: grid; grid-template-columns: 60px minmax(90px, .8fr) minmax(140px, 1.5fr) minmax(140px, 1.2fr); gap: 8px; border-bottom: 1px solid #d1dce4; padding: 9px; color: #354e62; font-size: 12px; }
.po-template-row:last-child { border-bottom: 0; }
.po-template-table-header { color: #253f55; background: #edf3f7; }
.email-draft { overflow-x: auto; border: 1px solid #d7e1e8; border-radius: 8px; padding: 14px; color: #314a5f; background: #fff; font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.intake-field-markdown { overflow: auto; max-height: 70vh; margin: 0 32px 32px; border: 1px solid #d7e1e8; border-radius: 8px; padding: 16px; color: #314a5f; background: #fbfcfd; font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.intake-draft-flow-buttons { padding: 18px 32px 0; }
.intake-draft-progress { margin: 14px 32px 0; }
.intake-draft-panel > .message, .intake-draft-validation { margin: 10px 32px 0; }
.intake-draft-panel > .intake-draft-status { color: #536c7e; }
.intake-draft-fields { display: grid; gap: 18px; padding: 18px 32px 28px; }
.intake-draft-fields h2 { margin: 4px 0 0; color: #304c62; font-size: 17px; }
.intake-draft-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.intake-draft-field { display: grid; align-content: start; gap: 6px; color: #30475b; font-size: 14px; font-weight: 650; }
.intake-draft-field > input, .intake-draft-field > select, .intake-draft-field > textarea { width: 100%; min-height: 42px; border: 1px solid #b8c7d4; border-radius: 7px; padding: 9px 11px; color: #203248; background: #fff; font: inherit; font-weight: 400; }
.intake-draft-field > input:focus, .intake-draft-field > select:focus, .intake-draft-field > textarea:focus { border-color: #2673a7; outline: 3px solid #2673a733; }
.intake-draft-field-grid > fieldset.intake-draft-field { border: 1px solid #b8c7d4; border-radius: 7px; padding: 12px; }
.intake-draft-choice-list { display: grid; gap: 9px; }
.intake-draft-field legend { padding: 0 5px; }
.intake-draft-option { display: flex; align-items: flex-start; gap: 9px; color: #40586c; font-weight: 400; }
.intake-draft-option input { margin-top: 4px; }
.intake-draft-field output { min-height: 42px; border: 1px solid #d7e1e8; border-radius: 7px; padding: 9px 11px; color: #536c7e; background: #f8fafb; font-weight: 400; }
.intake-draft-hint { margin: 0; color: #687c8e; font-size: 12px; font-weight: 400; line-height: 1.45; }
.intake-draft-error { margin: 0; color: #9a3028; font-size: 13px; font-weight: 650; }
.intake-draft-review { margin: 0 32px 22px; border-left: 3px solid #91b6cf; padding: 4px 0 4px 12px; color: #536c7e; }
.intake-draft-review h2 { margin: 0; color: #304c62; font-size: 15px; }
.intake-draft-review ul { margin: 8px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.55; }
.intake-draft-actions { justify-content: flex-start; }
.intake-draft-actions .button-primary { margin: 0 0 0 auto; }
.validation-message { color: #9a3028; font-weight: 700; }
.success-message { border-radius: 8px; padding: 12px 14px; color: #22553c; background: #e9f6ee; font-weight: 700; }
.intake-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid #e4ebf0; padding: 18px 32px 26px; }
.intake-actions .button-primary { margin: 0; }
.vendor-layout { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(0, 2fr); gap: 22px; padding: 24px 32px 32px; }
.vendor-list { display: grid; align-content: start; gap: 8px; }
.vendor-list button { min-height: 48px; border: 1px solid #c9d6df; border-radius: 8px; padding: 10px 12px; color: #2d465b; background: #fff; text-align: left; cursor: pointer; }
.vendor-list button[aria-current="true"] { border-color: #176b9a; background: #eef7fb; font-weight: 750; }
.vendor-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid label, .vendor-instructions-label { display: grid; gap: 6px; color: #30475b; font-size: 13px; font-weight: 650; }
.form-grid input, .form-grid select, .vendor-instructions-label textarea { width: 100%; min-height: 42px; border: 1px solid #b8c7d4; border-radius: 7px; padding: 9px 11px; color: #203248; background: #fff; }
.form-grid input:focus, .form-grid select:focus, .vendor-instructions-label textarea:focus { border-color: #2673a7; outline: 3px solid #2673a733; }
.vendor-toggles { display: flex; flex-wrap: wrap; gap: 20px; color: #40586c; font-size: 14px; }
.vendor-toggles label { display: flex; align-items: center; gap: 8px; }
.vendor-form .message { margin: 0; padding: 0; }
.vendor-form .button-primary { justify-self: start; margin: 0; }
.footer { display: flex; justify-content: space-between; gap: 16px; padding: 18px clamp(20px, 5vw, 72px); color: #718396; font-size: 12px; }
[hidden] { display: none !important; }

@media (max-width: 640px) {
  .topbar { align-items: center; gap: 10px; padding: 10px 16px; }
  .brand-logo { width: min(220px, 58vw); max-height: 68px; }
  .user-bar { width: auto; justify-content: flex-end; }
  .page-shell { margin: 22px auto; }
  .section-heading { align-items: flex-start; flex-direction: column; padding: 24px 20px 20px; }
  .cases-panel .message { padding: 0 20px; }
  .empty-state { margin: 20px; }
  .table-wrap { padding: 8px 12px 20px; }
  .pagination { align-items: flex-start; flex-direction: column; padding: 0 20px 22px; }
  .scope-note { margin: 0 20px 22px; }
  .intake-field-markdown { margin-right: 20px; margin-left: 20px; }
  .intake-draft-flow-buttons { padding-right: 20px; padding-left: 20px; }
  .intake-draft-progress { margin-right: 20px; margin-left: 20px; }
  .intake-draft-panel > .message, .intake-draft-validation { margin-right: 20px; margin-left: 20px; }
  .intake-draft-fields { padding: 18px 20px 24px; }
  .intake-draft-review { margin-right: 20px; margin-left: 20px; }
  .intake-draft-actions { flex-wrap: wrap; }
  .test-drafts-list { padding: 16px 20px 24px; }
  .test-draft-heading { align-items: flex-start; flex-direction: column; }
  .vendor-layout { grid-template-columns: 1fr; padding: 20px; }
  .catalog-layout { grid-template-columns: 1fr; padding: 20px; }
  .catalog-panel .message { padding: 0 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .preview-warning { margin-right: 20px; margin-left: 20px; }
  .intake-stepper { padding-right: 20px; padding-left: 20px; }
  .intake-content { padding: 18px 20px; }
  .intake-actions { padding-right: 20px; padding-left: 20px; }
  .review-row { align-items: flex-start; flex-direction: column; gap: 5px; }
  .review-row span { text-align: left; }
  .po-template-row { grid-template-columns: 44px minmax(68px, .7fr) minmax(110px, 1.3fr) minmax(110px, 1fr); gap: 5px; padding: 7px 5px; font-size: 11px; }
  th, td { padding-right: 9px; padding-left: 9px; }
}
.synthetic-save-panel {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid #c9d7e4;
  border-radius: 0.75rem;
  background: #f6f9fc;
}

.synthetic-save-panel h3 {
  margin: 1rem 0 0.5rem;
}

.synthetic-draft-lines {
  margin: 0;
  padding-left: 1.25rem;
}
.test-drafts-list { display: grid; gap: 14px; padding: 18px 32px 30px; }
.test-draft-card { border: 1px solid #c9d7e4; border-radius: 10px; padding: 16px 18px; background: #fbfcfd; }
.test-draft-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.test-draft-heading h2 { margin: 0; color: #17324d; font-size: 17px; }
.test-draft-status { border-radius: 999px; padding: 5px 9px; color: #654e16; background: #fff1c7; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.test-draft-card > p { margin: 9px 0 14px; color: #627487; font-size: 14px; }
.test-draft-card details { border-top: 1px solid #e1e8ed; padding-top: 12px; }
.test-draft-card summary { color: #176b9a; font-weight: 700; cursor: pointer; }
.test-draft-details { margin-top: 12px; color: #40586c; font-size: 14px; line-height: 1.55; }
.test-draft-details p { margin: 6px 0; overflow-wrap: anywhere; }
.test-draft-details h3 { margin: 16px 0 6px; color: #304c62; font-size: 14px; }
.test-draft-details ul { margin: 6px 0; padding-left: 22px; }
.test-drafts-panel .preview-warning { margin-bottom: 18px; }
.test-drafts-panel .message { color: #536c7e; }
.internal-orders-section { border-top: 1px solid #d7e1e8; padding-top: 20px; }
.internal-orders-section > h2 { margin: 0 32px; color: #17324d; font-size: 18px; }
.internal-orders-section > .muted { margin: 6px 32px; }
.fulfillment-sheet-download { display: inline-flex; width: fit-content; margin-top: 8px; text-decoration: none; }
.fulfillment-sheet-unavailable { display: inline-block; margin-top: 8px; color: #755116; font-size: 13px; font-weight: 700; }
.catalog-layout { display: grid; grid-template-columns: minmax(240px, 1.1fr) minmax(280px, 1fr); gap: 22px; padding: 24px 32px 32px; }
.catalog-list { display: grid; align-content: start; gap: 7px; max-height: 620px; overflow-y: auto; }
.catalog-list button { min-height: 42px; border: 1px solid #c9d6df; border-radius: 8px; padding: 8px 10px; color: #2d465b; background: #fff; text-align: left; cursor: pointer; }
.catalog-list button[aria-current="true"] { border-color: #176b9a; background: #eef7fb; font-weight: 750; }
.catalog-form { display: grid; align-content: start; gap: 14px; }
.catalog-form label { display: grid; gap: 6px; color: #30475b; font-size: 13px; font-weight: 650; }
.catalog-form input, .catalog-form textarea { width: 100%; min-height: 42px; border: 1px solid #b8c7d4; border-radius: 7px; padding: 9px 11px; color: #203248; background: #fff; font: inherit; font-weight: 400; }
.catalog-form input:focus, .catalog-form textarea:focus { border-color: #2673a7; outline: 3px solid #2673a733; }
.catalog-form .button-primary { justify-self: start; margin: 0; }
.catalog-edit-heading { display: flex; align-items: center; gap: 15px; margin-bottom: 4px; }
.catalog-edit-heading h2 { margin: 0; color: #17324d; font-size: 19px; }
.catalog-edit-heading img { width: 94px; height: 94px; border: 1px solid #d7e1e8; border-radius: 8px; object-fit: contain; background: #fff; }
.catalog-edit-heading .muted { margin-top: 5px; font-size: 12px; }
.catalog-panel .message { padding: 0 32px; color: #536c7e; }


/* Keep the staff recovery action readable against the sign-in panel. */
#forgot-password-open { color: #174f72; }

/* Keep recovery navigation controls readable. */
#forgot-password-open, #recovery-cancel { color: #174f72; }
/* Keep the sign-out control readable in the light staff header. */
#logout-button {
  color: #17324d;
  border: 1px solid #b9c8d6;
  background: #fff;
}

#logout-button:hover,
#logout-button:focus-visible {
  color: #10283d;
  border-color: #8ba3b7;
  background: #eef4f8;
}
