:root {
  color-scheme: light;
  --ink: #102033;
  --muted: #637083;
  --line: #d8e0ea;
  --panel: #ffffff;
  --page: #f4f7fb;
  --accent: #2078c9;
  --accent-strong: #115a9b;
  --accent-soft: #e6f1fb;
  --green: #16835c;
  --amber: #b7791f;
  --shadow: 0 12px 35px rgba(20, 44, 70, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.login-screen[hidden],
.admin-shell[hidden],
.modal-backdrop[hidden] {
  display: none !important;
}

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

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px 16px 108px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 2px 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: #0d2744;
  font-size: 32px;
  line-height: 1.15;
}

.subhead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.quote-status {
  min-width: 190px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.draft-status {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.panel {
  margin: 0 0 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title h2 {
  font-size: 20px;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
}

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

.send-option {
  align-content: end;
}

label {
  display: grid;
  gap: 7px;
}

label span,
.spend-field span {
  color: #304257;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdd8e5;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input {
  height: 42px;
  padding: 0 11px;
}

select {
  min-height: 42px;
  padding: 8px 11px;
}

select[multiple] {
  min-height: 148px;
  padding: 7px;
}

textarea {
  min-height: 100px;
  resize: vertical;
  padding: 11px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(32, 120, 201, 0.14);
}

.checkbox-line {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid #cdd8e5;
  border-radius: 6px;
  color: #304257;
  font-size: 14px;
  font-weight: 400;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.quote-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  min-height: 70px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.mode-option input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.mode-option strong,
.mode-option small {
  display: block;
}

.mode-option strong {
  color: #173552;
  font-size: 14px;
}

.mode-option small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.mode-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.platform-quote-fields {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.platform-items-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 10px;
}

.platform-items-heading strong,
.platform-items-heading span {
  display: block;
}

.platform-items-heading strong {
  color: #173552;
  font-size: 14px;
}

.platform-items-heading span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.platform-items {
  display: grid;
  gap: 10px;
}

.platform-item {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.platform-item-main {
  display: grid;
  flex: 1;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 1.3fr;
  gap: 9px;
}

.platform-item-main label {
  min-width: 0;
}

.platform-item-main input {
  min-width: 0;
}

.platform-item-note {
  min-width: 0;
}

.remove-platform-item {
  flex: 0 0 auto;
  color: #a33a3a;
  border-color: #e6bcbc;
}

.channel-pricing-rows {
  display: grid;
  gap: 14px;
}

.channel-pricing-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.channel-pricing-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.channel-pricing-heading strong,
.channel-pricing-heading span {
  display: block;
}

.channel-pricing-heading strong {
  color: #173552;
  font-size: 15px;
}

.channel-pricing-heading div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.channel-current-discount {
  padding: 7px 9px;
  border: 1px solid #b7cfe6;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.channel-pricing-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.vip-tier-group {
  display: grid;
  grid-column: span 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 11px;
  border: 1px solid #cdd8e5;
  border-radius: 6px;
  background: #fff;
}

.vip-tier-group:first-of-type {
  grid-column: 1 / span 2;
}

.vip-tier-title {
  grid-column: 1 / -1;
  color: #173552;
  font-size: 14px;
}

.channel-pricing-row {
  overflow: hidden;
}

.channel-pricing-row .channel-pricing-heading {
  margin-bottom: 14px;
}

.channel-pricing-row .channel-pricing-heading > div {
  min-width: 0;
}

.remove-channel-pricing {
  flex: 0 0 auto;
  color: #a33a3a;
  border-color: #e6bcbc;
}

.custom-channel-label[hidden],
#customChannelPlatformWrap[hidden] {
  display: none;
}

.channel-model-field {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.channel-model-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.channel-model-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.channel-model-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.channel-model-action {
  min-height: 30px;
  padding: 4px 9px;
  border-color: #c7d7e7;
  background: #fff;
  color: #2b5375;
  font-size: 12px;
}

.channel-model-picker {
  width: 100%;
  max-height: 430px;
  overflow: auto;
  border: 1px solid #cdd8e5;
  border-radius: 6px;
  background: #fff;
  padding: 9px;
}

.channel-model-group {
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid #e2eaf2;
  border-radius: 6px;
  background: #fbfdff;
}

.channel-model-group + .channel-model-group {
  margin-top: 8px;
}

.channel-model-group legend {
  padding: 0 5px;
  color: #294c6c;
  font-size: 12px;
  font-weight: 900;
}

.channel-model-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.channel-model-option {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: flex-start;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
}

.channel-model-option:hover {
  border-color: #c8d9e9;
  background: #f3f8fc;
}

.channel-model-option:has(input:checked) {
  border-color: #94bddd;
  background: #edf6fd;
}

.channel-model-option input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.channel-model-option span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.channel-model-option strong,
.channel-model-option small {
  overflow-wrap: anywhere;
}

.channel-model-option strong {
  color: #233f59;
  font-size: 12px;
  line-height: 1.3;
}

.channel-model-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.quote-customer-demand {
  margin-top: 10px;
}

.quote-customer-demand-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d8e3ef;
  border-radius: 6px;
  background: #f7fbff;
  color: #35516b;
  font-size: 12px;
  line-height: 1.4;
}

.quote-customer-demand-summary strong {
  flex: 0 0 auto;
  color: #12314d;
  font-size: 12px;
  font-weight: 900;
}

.quote-customer-demand-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-demand-section {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  background: #f8fbff;
}

.customer-demand-section .channel-model-heading {
  margin-bottom: 10px;
  color: #173552;
}

.customer-demand-section .channel-model-heading > span:first-child {
  font-size: 13px;
}

.customer-provider-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 8px;
}

.customer-provider-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #cbd8e6;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.customer-provider-option:has(input:checked) {
  border-color: #78aee0;
  background: #edf6ff;
  box-shadow: inset 0 0 0 1px rgba(43, 124, 190, 0.12);
}

.customer-provider-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent);
}

.customer-provider-option span {
  overflow: hidden;
  color: #294b68;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-demand-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #d5e2ef;
  border-radius: 6px;
  background: #fff;
}

.customer-demand-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.customer-demand-table th,
.customer-demand-table td {
  padding: 9px 10px;
  border-right: 1px solid #dbe6f1;
  border-bottom: 1px solid #dbe6f1;
  vertical-align: top;
}

.customer-demand-table th {
  background: #edf3f9;
  color: #173552;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

.customer-demand-table th:first-child,
.customer-demand-table td:first-child {
  width: 160px;
}

.customer-demand-table th:last-child,
.customer-demand-table td:last-child {
  border-right: 0;
}

.customer-demand-table tr:last-child td {
  border-bottom: 0;
}

.customer-demand-provider-cell {
  background: #f8fbff;
  vertical-align: middle !important;
}

.customer-demand-provider-cell strong,
.customer-demand-provider-cell small {
  display: block;
}

.customer-demand-provider-cell strong {
  color: #173552;
  font-size: 13px;
}

.customer-demand-provider-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.customer-demand-row-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-bottom: 8px;
}

.customer-model-row-summary {
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.customer-demand-model-picker {
  max-height: min(30vh, 260px);
  padding: 0;
  border: 0;
  background: transparent;
}

.customer-demand-model-picker .channel-model-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.customer-demand-model-picker .channel-model-group {
  padding: 7px;
  background: #fff;
}

.customer-demand-model-picker .channel-model-option {
  padding: 6px 7px;
  background: #fbfdff;
}

.quote-terms {
  display: grid;
  gap: 9px;
}

.quote-term-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 38px;
  gap: 9px;
  align-items: stretch;
}

.quote-term-index {
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #edf3f9;
  color: #294661;
  font-size: 13px;
  font-weight: 900;
}

.quote-term-row textarea {
  min-height: 58px;
}

.remove-quote-term {
  min-width: 38px;
  padding: 0;
  color: #a33a3a;
  border-color: #e6bcbc;
  font-size: 22px;
  font-weight: 400;
}

.add-term-button {
  margin-top: 10px;
}

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

button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #bfd0e2;
  border-radius: 6px;
  background: #fff;
  color: #12314d;
  font-weight: 800;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

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

.model-tabs {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.model-filter-section {
  display: grid;
  gap: 8px;
}

.model-filter-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.model-filter-heading strong {
  color: #173552;
  font-size: 14px;
}

.model-filter-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.model-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.model-filter-chip {
  display: grid;
  grid-template-columns: minmax(68px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 152px;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid #cdd8e5;
  border-radius: 7px;
  background: #f8fbfe;
  text-align: left;
}

.model-filter-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.model-filter-chip strong {
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-filter-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.model-filter-chip.active span {
  color: var(--accent-strong);
}

.preview-panel {
  margin: 0 0 14px;
  padding: 22px;
  border: 1px solid #b7cfe6;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--accent);
}

.preview-heading h2 {
  color: #0d2744;
  font-size: 25px;
}

.preview-meta,
.preview-channel-pricing,
.preview-discounts,
.preview-platform,
.preview-models,
.preview-terms {
  margin-top: 18px;
}

.preview-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.preview-field {
  display: grid;
  grid-template-columns: 116px 1fr;
  min-height: 40px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.preview-field:nth-child(2n) {
  border-right: 0;
}

.preview-field:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.preview-field strong {
  padding: 11px;
  background: #edf3f9;
  color: #294661;
  font-size: 13px;
}

.preview-field span {
  padding: 11px;
  color: #283849;
  font-size: 13px;
  line-height: 1.4;
}

.preview-caption {
  margin: 0 0 9px;
  color: #1e5f9d;
  font-size: 16px;
  font-weight: 900;
}

.preview-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

.preview-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  font-size: 12px;
}

.preview-table th,
.preview-table td {
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.48;
  text-align: left;
}

.preview-table th {
  background: #e8eef6;
  color: #173552;
  font-size: 12px;
}

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

.preview-table th:last-child,
.preview-table td:last-child {
  border-right: 0;
}

.preview-table .price {
  color: #0e5c9d;
  font-weight: 800;
  white-space: pre-line;
}

.preview-table .discount-cell {
  white-space: nowrap;
  word-break: keep-all;
}

.preview-table .note {
  color: var(--amber);
}

.platform-preview-table {
  min-width: 720px;
}

.channel-pricing-preview-table {
  min-width: 1080px;
}

.channel-pricing-preview-table th,
.channel-pricing-preview-table td {
  text-align: center;
  vertical-align: middle;
}

.channel-pricing-preview-table th:last-child,
.channel-pricing-preview-table td:last-child {
  text-align: left;
  vertical-align: top;
}

.channel-pricing-preview-table .available-models-cell {
  white-space: normal;
  line-height: 1.7;
}

.channel-pricing-preview-table .vip-tier-cell {
  line-height: 1.7;
  white-space: nowrap;
}

.channel-pricing-preview-table .region-cell,
.channel-pricing-preview-table th:first-child,
.channel-pricing-preview-table .channel-pricing-nowrap {
  min-width: 104px;
  white-space: nowrap;
  word-break: keep-all;
  text-align: center;
}

.channel-pricing-preview-table .channel-pricing-nowrap {
  min-width: 116px;
}

.channel-pricing-preview-table .region-cell {
  vertical-align: middle;
  color: #294661;
  font-weight: 900;
}

.model-detail-preview-table {
  min-width: 1160px;
}

.model-detail-preview-table th:nth-child(3),
.model-detail-preview-table td:nth-child(3),
.model-detail-preview-table th:nth-child(4),
.model-detail-preview-table td:nth-child(4),
.model-detail-preview-table th:nth-child(5),
.model-detail-preview-table td:nth-child(5),
.model-detail-preview-table th:nth-child(7),
.model-detail-preview-table td:nth-child(7) {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  word-break: keep-all;
}

.model-detail-nowrap {
  white-space: nowrap;
  word-break: keep-all;
}

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

.preview-terms ol {
  margin: 8px 0 0 20px;
  padding: 0;
}

.preview-terms li {
  margin: 7px 0;
  color: #394b5f;
  font-size: 13px;
  line-height: 1.5;
}

.image-preview-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.image-preview-frame {
  max-height: 78vh;
  overflow: auto;
  border: 1px solid #d4dfeb;
  border-radius: 7px;
  background: #eef3f8;
  padding: 12px;
}

.image-preview-frame img {
  display: block;
  width: min(100%, 960px);
  height: auto;
  margin: 0 auto;
  border: 1px solid #d8e0ea;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(16, 32, 51, 0.12);
}

.models {
  display: grid;
  gap: 14px;
}

.model-region-group {
  display: grid;
  gap: 9px;
}

.model-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 11px;
  border-left: 4px solid var(--accent);
  background: #edf5fc;
  color: #173552;
}

.model-group-heading strong {
  font-size: 14px;
}

.model-group-heading span {
  color: #58708a;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

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

.model-card {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.model-card.selected {
  border-color: #8abbe8;
  background: #f7fbff;
  box-shadow: inset 0 0 0 1px rgba(43, 124, 190, 0.08);
}

.model-check-line {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  cursor: pointer;
}

.model-check-line input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.model-check-line strong,
.model-check-line small {
  display: block;
}

.model-check-line strong {
  color: #173552;
  font-size: 14px;
  line-height: 1.35;
}

.model-name {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 800;
}

.model-id,
.model-unit,
.model-price {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.model-detail-controls label {
  gap: 5px;
}

.model-detail-controls label span {
  font-size: 12px;
}

.model-detail-controls select {
  min-height: 36px;
  padding: 6px 9px;
}

.model-detail-extra {
  border-top: 1px solid #e1e8ef;
  padding-top: 6px;
}

.model-detail-extra summary {
  cursor: pointer;
  color: #58708a;
  font-size: 12px;
  font-weight: 800;
  list-style-position: inside;
}

.model-detail-extra-content {
  display: grid;
  gap: 5px;
  padding-top: 8px;
}

.tag {
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #41546a;
  font-size: 11px;
  font-weight: 800;
}

.tag.hot {
  background: #e9f8f1;
  color: var(--green);
}

.tag.note {
  background: #fff6e6;
  color: var(--amber);
}

.tag.region-tag {
  background: #e6f1fb;
  color: var(--accent-strong);
}

.tag.capability,
.capability-tag {
  background: #edf3f9;
  color: #244f72;
}

.capability-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 120px;
}

.capability-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.action-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(244, 247, 251, 0.94);
  backdrop-filter: blur(10px);
}

.action-note {
  align-self: center;
  max-width: 380px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.action-note.sent {
  color: var(--green);
}

.action-note.warning {
  color: var(--amber);
}

.primary,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 900;
}

.pdf-button {
  border-color: #c98b42;
  background: #fff8ed;
  color: #9a5d16;
}

.pdf-button[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.image-button {
  border-color: #2f9f83;
  background: #eefaf6;
  color: #126b54;
}

.watermark-settings-button {
  border-color: #8ca8c1;
  background: #f3f7fb;
  color: #244d6c;
}

.copy-image-button {
  border-color: #9eb7d2;
  background: #f5f9fd;
  color: #27506f;
}

.image-button[disabled],
.copy-image-button[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.pdf-download-link {
  border-color: #c8a6d8;
  background: #f7effb;
  color: #70428b;
}

.image-download-link {
  border-color: #9acdbc;
  background: #effaf6;
  color: #136d55;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.download-link {
  border: 1px solid #97c4aa;
  background: #e9f8f1;
  color: var(--green);
}

.primary[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(32, 120, 201, 0.08), transparent 46%),
    var(--page);
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(20, 44, 70, 0.14);
}

.login-card h1 {
  font-size: 27px;
}

.login-card > p:not(.eyebrow):not(.login-error) {
  margin: -6px 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.account-button {
  border-color: #b8d0e6;
  background: #edf6fd;
  color: #1d5c94;
}

.editor-check-field .checkbox-line {
  min-height: 42px;
}

.editor-choice-group {
  display: grid;
  gap: 8px;
}

.editor-choice-group > span {
  color: #304257;
  font-size: 13px;
  font-weight: 800;
}

.editor-choice-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 8px;
}

.editor-choice-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cdd8e5;
  border-radius: 6px;
  background: #fff;
  color: #294661;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.editor-choice-option:has(input:checked) {
  border-color: #78aee0;
  background: #edf6ff;
  box-shadow: inset 0 0 0 1px rgba(43, 124, 190, 0.12);
}

.editor-choice-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent);
}

.editor-model-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.supplier-offers-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.supplier-offers-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.supplier-offers-title strong {
  color: #173552;
  font-size: 15px;
}

.supplier-offers-table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 260px;
  border: 1px solid var(--line);
}

.supplier-offers-table {
  width: 100%;
  min-width: 1540px;
  border-collapse: collapse;
  font-size: 12px;
}

.supplier-offers-table th,
.supplier-offers-table td {
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: left;
}

.supplier-offers-table th {
  background: #e8eef6;
  color: #173552;
  font-size: 12px;
  white-space: nowrap;
}

.supplier-offers-table th:last-child,
.supplier-offers-table td:last-child {
  border-right: 0;
}

.supplier-offers-table tr:last-child td {
  border-bottom: 0;
}

.supplier-offers-table select,
.supplier-offers-table input {
  height: 34px;
  min-height: 34px;
  padding: 0 8px;
  font-size: 12px;
}

.supplier-offers-table textarea {
  min-height: 34px;
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.35;
}

.supplier-offers-table input[type="number"] {
  min-width: 86px;
}

.supplier-offer-model-cell {
  position: relative;
  width: 86px;
  min-width: 86px;
  text-align: center;
  white-space: nowrap;
}

.supplier-offer-channel-cell {
  position: relative;
  width: 150px;
  min-width: 150px;
  text-align: center;
  white-space: normal;
}

.supplier-offer-channel-cell .small-button {
  width: 54px;
  min-height: 28px;
  padding: 0;
}

.supplier-channel-source-summary {
  display: block;
  max-width: 150px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-offer-channel-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  width: min(330px, 72vw);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(13, 39, 68, 0.18);
  text-align: left;
}

.supplier-channel-source-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  max-height: 230px;
  margin-top: 9px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #cdd8e5;
  border-radius: 6px;
  background: #fbfdff;
}

.supplier-channel-source-option {
  display: flex;
  min-width: 0;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #294c6c;
  cursor: pointer;
  font-size: 11px;
}

.supplier-channel-source-option:hover,
.supplier-channel-source-option:has(input:checked) {
  border-color: #94bddd;
  background: #edf6fd;
}

.supplier-channel-source-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  min-height: 16px;
  padding: 0;
}

.supplier-channel-source-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.supplier-channel-source-custom {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  color: #526276;
  font-size: 11px;
  font-weight: 800;
}

.supplier-channel-source-custom input {
  width: 100%;
}

.supplier-offer-model-cell .small-button {
  width: 54px;
  min-height: 28px;
  padding: 0;
}

.supplier-offer-model-cell .channel-model-summary,
.supplier-offer-model-popover .channel-model-summary {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.supplier-offer-model-cell .channel-model-summary {
  display: block;
  margin-top: 5px;
}

.supplier-offer-model-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  width: min(360px, 72vw);
  max-height: 420px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(13, 39, 68, 0.18);
  white-space: normal;
  text-align: left;
}

.supplier-offer-actions {
  white-space: nowrap;
}

.table-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.table-check input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.compact-empty {
  padding: 18px 12px;
}

.admin-channel-model-picker {
  max-height: min(46vh, 440px);
}

.model-capability-editor {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #d8e3ef;
  border-radius: 8px;
  background: #f8fbff;
}

.model-capability-editor .channel-model-heading {
  margin-bottom: 10px;
}

.model-capability-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.model-capability-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #cbd8e6;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.model-capability-option:has(input:checked) {
  border-color: #78aee0;
  background: #edf6ff;
  box-shadow: inset 0 0 0 1px rgba(43, 124, 190, 0.12);
}

.model-capability-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent);
}

.model-capability-option span {
  color: #294b68;
  font-size: 12px;
  font-weight: 900;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #efb5b5;
  background: #fff4f4;
  color: #a33a3a;
  font-size: 13px;
}

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

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 22px 14px 16px;
  background: #0d2744;
  color: #fff;
}

.sidebar-brand {
  padding: 4px 12px 24px;
}

.sidebar-brand p {
  margin: 0 0 5px;
  color: #8fc3ee;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.sidebar-brand strong {
  font-size: 21px;
}

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

.admin-nav button {
  min-height: 42px;
  border-color: transparent;
  background: transparent;
  color: #c6d5e5;
  text-align: left;
  font-size: 14px;
}

.admin-nav button:hover,
.admin-nav button.active {
  border-color: rgba(143, 195, 238, 0.28);
  background: rgba(143, 195, 238, 0.15);
  color: #fff;
}

.sidebar-bottom {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 18px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-bottom span {
  color: #a6bdd3;
  font-size: 12px;
}

.logout-button {
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #fff;
  font-size: 12px;
}

.admin-content {
  min-width: 0;
  padding: 28px min(4vw, 48px) 110px;
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-header h1 {
  font-size: 29px;
}

.admin-view {
  min-width: 0;
}

.quote-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.quote-topline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.secondary-button,
.text-button {
  border-color: #bfd0e2;
  background: #fff;
  color: #28567b;
}

.compact-panel {
  min-width: 0;
}

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

.metric-card {
  display: grid;
  min-height: 126px;
  gap: 7px;
  padding: 16px;
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  color: #0d2744;
  font-size: 31px;
}

.metric-card small {
  color: var(--accent);
  font-size: 12px;
}

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
}

.supplier-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #d5e2ef;
  background: #f8fbff;
}

.supplier-view-toolbar > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.supplier-view-toolbar strong {
  color: #173552;
  font-size: 13px;
}

.supplier-view-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.supplier-view-controls {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.supplier-view-switch {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid #c9d7e6;
  background: #fff;
}

.supplier-view-switch button {
  min-height: 32px;
  padding: 5px 13px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #526276;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.supplier-view-switch button.active {
  background: var(--accent);
  color: #fff;
}

.supplier-display-field-picker {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #c9d7e6;
  background: #fff;
}

.supplier-display-field-picker > strong {
  color: #304257;
  font-size: 12px;
}

.supplier-display-field-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
}

.supplier-display-field-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #304257;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.supplier-display-field-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

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

.supplier-provider-table {
  min-width: 1160px;
}

.supplier-table td,
.supplier-provider-table td {
  vertical-align: top;
}

.supplier-offer-summary-cell {
  min-width: 390px;
  white-space: normal !important;
}

.supplier-offer-summary {
  display: grid;
  min-width: 360px;
  gap: 8px;
}

.supplier-offer-summary-line {
  display: grid;
  gap: 4px;
  padding: 2px 0 8px;
  border-bottom: 1px solid #e1e9f2;
}

.supplier-offer-summary-line:last-child {
  padding-bottom: 2px;
  border-bottom: 0;
}

.supplier-offer-channel-lines {
  display: grid;
  gap: 5px;
}

.supplier-offer-channel-line {
  display: grid;
  gap: 3px;
  padding: 2px 0 5px 10px;
  border-left: 2px solid #c8d9e9;
}

.supplier-offer-channel-line:last-child {
  padding-bottom: 0;
}

.supplier-offer-channel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.supplier-offer-channel-head strong {
  color: #294c6c;
  font-size: 11px;
}

.supplier-offer-channel-head span {
  color: #526276;
  font-size: 11px;
}

.supplier-offer-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.supplier-offer-summary-head strong {
  color: #173552;
  font-size: 13px;
}

.supplier-offer-summary-head span,
.supplier-offer-tier-line span {
  color: #526276;
  font-size: 11px;
}

.supplier-offer-tier-line {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: baseline;
  gap: 3px 6px;
  white-space: normal;
}

.supplier-offer-tier-line strong {
  grid-column: 1;
  grid-row: 1 / span 2;
  color: var(--accent-strong);
  font-size: 11px;
}

.supplier-offer-tier-line span:first-of-type {
  grid-column: 2;
  grid-row: 1;
}

.supplier-offer-tier-line span:last-of-type {
  grid-column: 2;
  grid-row: 2;
}

.supplier-tier-cell {
  min-width: 190px;
  white-space: normal !important;
}

.supplier-supported-models {
  display: grid;
  gap: 3px;
  min-width: 150px;
  white-space: normal;
}

.supplier-supported-models strong {
  color: #173552;
  font-size: 12px;
}

.supplier-supported-models span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-channel-source-list {
  min-width: 145px;
  max-width: 220px;
  color: #526276;
  font-size: 11px;
  line-height: 1.45;
  white-space: normal !important;
}

.supplier-channel-value-list {
  display: grid;
  min-width: 150px;
  gap: 4px;
  white-space: normal;
}

.supplier-channel-value-list span {
  color: #526276;
  font-size: 11px;
  line-height: 1.35;
}

.supplier-channel-value-list strong {
  color: #294c6c;
  font-size: 11px;
}

.supplier-data-link {
  display: inline-block;
  max-width: 170px;
  overflow: hidden;
  color: var(--accent-strong);
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.supplier-data-link:hover {
  text-decoration: underline;
}

.supplier-provider-group-row td {
  padding-top: 8px;
  padding-bottom: 8px;
  background: #edf5fc !important;
  color: #526276;
  white-space: normal !important;
}

.supplier-provider-group-row strong {
  margin-right: 10px;
  color: #173552;
  font-size: 13px;
}

.supplier-provider-group-row span {
  font-size: 11px;
}

.admin-provider-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.admin-provider-tabs button {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 38px;
  border-color: #c9d7e6;
  background: #fff;
  color: #254b6d;
}

.admin-provider-tabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.admin-provider-tabs strong {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #edf3f9;
  color: #2c587d;
  font-size: 11px;
  text-align: center;
}

.admin-provider-tabs button.active strong {
  background: #fff;
  color: var(--accent-strong);
}

.admin-model-provider-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.admin-model-provider-summary strong {
  color: #173552;
  font-size: 15px;
}

.admin-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 13px;
}

.model-admin-table {
  min-width: 860px;
}

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: left;
  white-space: nowrap;
}

.admin-table th {
  background: #e8eef6;
  color: #173552;
  font-size: 12px;
}

.admin-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.admin-table th:last-child,
.admin-table td:last-child {
  border-right: 0;
}

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

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.small-button,
.small-link {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid #c5d4e3;
  border-radius: 5px;
  background: #fff;
  color: #28567b;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.small-button.danger {
  border-color: #e6bcbc;
  color: #a33a3a;
}

.status-tag {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #526276;
  font-size: 11px;
  font-weight: 800;
}

.status-tag.generated {
  background: #e9f8f1;
  color: var(--green);
}

.status-tag.archived {
  background: #fff0f0;
  color: #a33a3a;
}

.empty-state {
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(13, 39, 68, 0.42);
}

.editor-modal {
  width: min(980px, 100%);
  max-height: min(860px, 92vh);
  overflow: auto;
  padding: 22px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(13, 39, 68, 0.24);
}

.watermark-modal {
  width: min(1040px, 100%);
}

.watermark-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 20px;
  align-items: start;
}

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

.watermark-controls .wide-field {
  grid-column: 1 / -1;
}

.watermark-controls textarea {
  min-height: 82px;
}

.watermark-enabled-field {
  grid-column: 1 / -1;
  justify-content: flex-start;
  background: #f4f8fc;
}

.watermark-enabled-field span {
  font-size: 14px;
}

.watermark-mode-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.watermark-mode-field legend,
.watermark-security > strong {
  margin-bottom: 7px;
  color: #304257;
  font-size: 13px;
  font-weight: 800;
}

.watermark-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.watermark-mode-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #cdd8e5;
  border-radius: 6px;
  background: #fff;
  color: #40556b;
  cursor: pointer;
}

.watermark-mode-option.active {
  border-color: #5c90bb;
  background: #eaf3fb;
  color: #174e77;
}

.watermark-mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.watermark-mode-option span {
  font-size: 13px;
}

.watermark-range-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  align-items: center;
  gap: 9px;
  min-height: 42px;
}

.watermark-range-field input[type="range"] {
  height: 6px;
  padding: 0;
  border: 0;
  accent-color: var(--accent);
}

.watermark-range-field output {
  color: #294661;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

#watermarkColor {
  height: 42px;
  padding: 4px;
}

.watermark-security {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.watermark-security > strong {
  grid-column: 1 / -1;
}

.watermark-security .checkbox-line {
  padding: 0 9px;
  font-size: 12px;
}

.watermark-preview {
  position: sticky;
  top: 0;
  padding: 14px;
  border: 1px solid #cdd8e5;
  border-radius: 7px;
  background: #eef3f8;
}

.watermark-preview-document {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  padding: 28px 24px;
  border: 1px solid #d5dfE9;
  border-radius: 5px;
  background: #fff;
}

.watermark-preview-document > strong,
.watermark-preview-document > span {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
}

.watermark-preview-document > strong {
  color: #2f7dc1;
  font-size: 17px;
}

.watermark-preview-document > span {
  margin: 12px 0 30px;
  color: #173552;
  font-size: 20px;
  font-weight: 900;
}

.watermark-preview-document > i {
  position: relative;
  z-index: 1;
  display: block;
  height: 44px;
  margin-top: 9px;
  border: 1px solid #dce4ed;
  background: #f8fafc;
}

#watermarkPreviewOverlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  overflow: hidden;
  pointer-events: none;
}

#watermarkPreviewOverlay.tile {
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  place-content: center;
  place-items: center;
}

#watermarkPreviewOverlay.single {
  display: flex;
  padding: 30px;
}

#watermarkPreviewOverlay.single[data-position="center"] {
  align-items: center;
  justify-content: center;
}

#watermarkPreviewOverlay.single[data-position="top-left"] {
  align-items: flex-start;
  justify-content: flex-start;
}

#watermarkPreviewOverlay.single[data-position="top-right"] {
  align-items: flex-start;
  justify-content: flex-end;
}

#watermarkPreviewOverlay.single[data-position="bottom-left"] {
  align-items: flex-end;
  justify-content: flex-start;
}

#watermarkPreviewOverlay.single[data-position="bottom-right"] {
  align-items: flex-end;
  justify-content: flex-end;
}

#watermarkPreviewOverlay > span {
  max-width: 210px;
  color: #33506f;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  white-space: pre-line;
}

#watermarkPreviewOverlay.disabled {
  display: none;
}

.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-heading h2 {
  color: #0d2744;
  font-size: 21px;
}

.icon-close {
  min-width: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #65778a;
  font-size: 25px;
}

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

.editor-grid .wide-field {
  grid-column: 1 / -1;
}

.editor-grid textarea {
  min-height: 82px;
}

.price-editor-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d8e3ed;
  background: #f7fafc;
}

.price-editor-summary {
  display: grid;
  gap: 3px;
}

.price-editor-summary strong {
  color: #173552;
  font-size: 13px;
}

.price-editor-summary span,
.price-editor-hint {
  color: #58708a;
  font-size: 12px;
  line-height: 1.45;
}

.price-editor-hint {
  margin: 0;
}

.price-editor-panel .wide-field {
  margin: 0;
}

.price-editor-panel textarea {
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
}

.model-price-summary {
  min-width: 190px;
  color: #294661;
  font-size: 12px;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.terms-admin {
  display: grid;
  gap: 9px;
}

.admin-term-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 64px;
  gap: 9px;
  align-items: stretch;
}

.admin-term-row > span {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #edf3f9;
  color: #294661;
  font-weight: 900;
}

.admin-term-row textarea {
  min-height: 58px;
}

.backup-tools {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.backup-tool-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.backup-tool-row:last-of-type {
  border-bottom: 0;
}

.backup-tool-row > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.backup-tool-row strong {
  color: #173552;
  font-size: 15px;
}

.backup-tool-row p,
.backup-tool-row small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.backup-import-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
}

.backup-file-name {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-status {
  min-height: 20px;
  margin: 0;
  padding: 10px 18px;
  color: var(--muted);
  font-size: 12px;
}

.backup-status.success {
  color: var(--green);
}

.backup-status.error {
  color: #a33a3a;
}

@media (max-width: 760px) {
  .admin-shell {
    display: block;
  }

  .admin-sidebar {
    position: static;
    min-height: auto;
    padding: 12px;
  }

  .sidebar-brand {
    padding: 4px 8px 12px;
  }

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

  .admin-nav button {
    min-height: 36px;
    padding: 4px 6px;
    font-size: 11px;
    text-align: center;
  }

  .sidebar-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px 0;
  }

  .admin-content {
    padding: 18px 12px 104px;
  }

  .admin-header {
    align-items: start;
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
  }

  .admin-header h1 {
    font-size: 25px;
  }

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

  .metric-card {
    min-height: 108px;
  }

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

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

  .editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-grid .wide-field {
    grid-column: auto;
  }

  .login-card {
    padding: 24px;
  }

  .admin-term-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .admin-term-row .small-button {
    grid-column: 2;
  }

  .app-shell {
    padding: 14px 12px 104px;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  h1 {
    font-size: 26px;
  }

  .quote-status {
    width: 100%;
    text-align: left;
  }

  .draft-status {
    text-align: left;
  }

  .panel {
    padding: 14px;
  }

  .panel-title {
    display: grid;
    gap: 4px;
  }

  .backup-tool-row {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .backup-import-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-file-name {
    max-width: none;
  }

  .supplier-view-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .supplier-view-switch {
    width: 100%;
  }

  .supplier-view-switch button {
    flex: 1 1 0;
  }

  .supplier-view-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .supplier-display-field-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .models,
  .preview-meta {
    grid-template-columns: 1fr;
  }

  .channel-pricing-fields {
    grid-template-columns: 1fr;
  }

  .vip-tier-group,
  .vip-tier-group:first-of-type {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .vip-tier-title {
    grid-column: auto;
  }

  .channel-pricing-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .channel-model-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .channel-model-actions {
    width: 100%;
  }

  .channel-model-action {
    flex: 1 1 0;
  }

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

  .customer-provider-picker {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .customer-demand-table {
    min-width: 620px;
  }

  .customer-demand-model-picker .channel-model-options {
    grid-template-columns: 1fr;
  }

  .channel-current-discount {
    white-space: normal;
  }

  .remove-channel-pricing {
    width: 100%;
  }

  .quote-mode-switch {
    grid-template-columns: 1fr;
  }

  .watermark-layout,
  .watermark-controls,
  .watermark-security {
    grid-template-columns: 1fr;
  }

  .watermark-preview {
    position: static;
    order: -1;
  }

  .watermark-preview-document {
    min-height: 300px;
  }

  .watermark-controls .wide-field,
  .watermark-enabled-field,
  .watermark-security > strong {
    grid-column: auto;
  }

  .platform-items-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .platform-item {
    align-items: stretch;
    flex-direction: column;
  }

  .platform-item-main {
    grid-template-columns: 1fr;
  }

  .quote-term-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .remove-quote-term {
    grid-column: 2;
    min-height: 36px;
  }

  .remove-platform-item {
    width: 100%;
  }

  .model-tabs {
    grid-template-columns: 1fr;
  }

  .model-detail-grid {
    grid-template-columns: 1fr;
  }

  .model-filter-heading {
    display: grid;
    gap: 3px;
  }

  .model-filter-chip {
    min-width: 142px;
  }

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

  .action-bar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .primary,
  .download-link {
    flex: 1;
    padding: 0 10px;
  }

  .action-note {
    flex-basis: 100%;
    max-width: none;
    text-align: center;
  }

  .preview-panel {
    padding: 15px;
  }

  .image-preview-panel {
    padding: 12px;
  }

  .image-preview-frame {
    max-height: 72vh;
    padding: 8px;
  }

  .image-preview-frame img {
    width: 100%;
  }

  .preview-field,
  .preview-field:nth-child(2n),
  .preview-field:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-field:last-child {
    border-bottom: 0;
  }
}
