:root {
  --ink: #17202b;
  --muted: #687383;
  --line: #dce3ea;
  --line-soft: #e9eef3;
  --soft: #e7faf4;
  --mint: #10c9a7;
  --teal: #087f70;
  --pink: #f45ab5;
  --pink-dark: #e13f9f;
  --card: #ffffff;
  --bg: #f7fbfa;
  --shadow: 0 16px 38px rgba(23, 32, 43, 0.06);
  --prototype-surface: rgba(255, 255, 255, 0.94);
  --prototype-mint-line: #c9f2eb;
  --prototype-pink-soft: #fff3fa;
}

@media (max-width: 840px) {
  .material-conversion-preview {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .material-conversion-preview em {
    margin-top: 2px;
  }

  .material-identity-preview {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .material-identity-preview > span {
    grid-row: auto;
  }

  .raw-material-purchase-modal .modal-section {
    padding-inline: 12px;
  }

  .raw-material-purchase-modal .material-form {
    padding: 12px;
  }
}

/* E-commerce: one clear workspace, secondary detail on demand. */
.ecommerce-command-bar,
.ecommerce-command-actions,
.ecommerce-overview-heading,
.ecommerce-channel-row,
.ecommerce-channel-name,
.ecommerce-workspace-tabs {
  display: flex;
  align-items: center;
}

.ecommerce-command-bar {
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 16px;
  padding: 22px 26px;
  border-radius: 14px;
  color: #f5fffc;
  background: #0b7569;
  box-shadow: 0 14px 32px rgba(8, 127, 112, 0.14);
}

.ecommerce-command-bar h3,
.ecommerce-command-bar p,
.ecommerce-overview h3,
.ecommerce-overview-heading span,
.ecommerce-channel-row dl,
.ecommerce-channel-row dt,
.ecommerce-channel-row dd {
  margin: 0;
}

.ecommerce-command-bar h3 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.ecommerce-command-bar p {
  margin-top: 6px;
  color: #d5f7ef;
  font-size: 14px;
}

.ecommerce-command-actions {
  flex: 0 0 auto;
  gap: 10px;
}

.ecommerce-command-bar .ghost {
  border-color: rgba(255, 255, 255, 0.52);
  color: #fff;
  background: transparent;
}

.ecommerce-command-bar .ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.ecommerce-safety {
  display: block;
  padding-right: 14px;
  text-align: right;
}

.ecommerce-safety strong,
.ecommerce-safety small {
  display: block;
}

.ecommerce-safety small {
  margin-top: 2px;
  color: #d5f7ef;
}

.ecommerce-overview {
  margin-bottom: 16px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.ecommerce-overview-heading {
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.ecommerce-overview-heading h3 {
  font-size: 16px;
}

.ecommerce-overview-heading span {
  color: var(--muted);
  font-size: 12px;
}

.ecommerce-channel-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(560px, 2.4fr) auto;
  gap: 22px;
  min-height: 100px;
  padding: 17px 20px;
}

.ecommerce-channel-row + .ecommerce-channel-row {
  border-top: 1px solid var(--line-soft);
}

.ecommerce-channel-name {
  align-items: flex-start;
  flex-direction: column;
}

.ecommerce-channel-name strong {
  font-size: 19px;
}

.ecommerce-channel-name span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.ecommerce-channel-row dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.ecommerce-channel-row dt,
.ecommerce-channel-row small {
  color: var(--muted);
  font-size: 12px;
}

.ecommerce-channel-row dd {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 900;
}

.ecommerce-channel-row small {
  display: block;
  margin-top: 4px;
  white-space: nowrap;
}

.ecommerce-calculation-note {
  position: relative;
  align-self: center;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.ecommerce-calculation-note summary {
  cursor: pointer;
  white-space: nowrap;
}

.ecommerce-calculation-popover {
  position: absolute;
  z-index: 10;
  top: calc(100% + 10px);
  right: 0;
  width: min(430px, 80vw);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 16px 34px rgba(23, 32, 43, 0.14);
  font-weight: 500;
}

.ecommerce-calculation-popover p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.55;
}

.ecommerce-calculation-popover > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 0;
}

.ecommerce-workspace {
  padding: 0;
  overflow: hidden;
}

.ecommerce-workspace-tabs {
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #f7faf9;
}

.ecommerce-workspace-tabs button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.ecommerce-workspace-tabs button:hover {
  color: var(--ink);
  background: #edf4f2;
}

.ecommerce-workspace-tabs button.active {
  color: var(--teal);
  background: #fff;
  box-shadow: 0 2px 8px rgba(23, 32, 43, 0.08);
}

.ecommerce-workspace-tabs button span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 5px;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--teal);
  background: var(--soft);
  font-size: 12px;
}

.ecommerce-workspace-panel {
  min-height: 320px;
  padding: 24px;
}

.ecommerce-workspace-panel[hidden] {
  display: none;
}

.ecommerce-panel-loading {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--muted);
  text-align: center;
}

.ecommerce-panel-loading strong,
.ecommerce-panel-loading span {
  display: block;
}

.ecommerce-panel-loading strong {
  color: var(--ink);
  font-size: 17px;
}

.ecommerce-panel-loading span {
  margin-top: 7px;
  font-size: 13px;
}

.ecommerce-subsection {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.ecommerce-dropzone {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 26px;
  border: 1px dashed #75cdbd;
  border-radius: 14px;
  color: var(--teal);
  background: #f2fcf9;
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.ecommerce-dropzone:hover,
.ecommerce-dropzone:focus-within {
  border-color: var(--teal);
  background: #e9faf5;
  box-shadow: 0 10px 24px rgba(8, 127, 112, 0.08);
}

.ecommerce-dropzone.is-dragging {
  border-color: var(--teal, #0f9f8c);
  background: rgba(15, 159, 140, 0.1);
  box-shadow: inset 0 0 0 2px rgba(15, 159, 140, 0.12);
  transform: translateY(-1px);
}

.ecommerce-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.ecommerce-dropzone strong {
  font-size: 18px;
}

.ecommerce-dropzone span {
  margin-top: 7px;
  color: #52736d;
  font-size: 13px;
}

.ecommerce-upload-results {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.ecommerce-component-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.ecommerce-component-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 42px;
  gap: 10px;
  align-items: center;
}

.ecommerce-preview-total {
  text-align: right;
}

.ecommerce-preview-total span,
.ecommerce-preview-total strong {
  display: block;
}

.ecommerce-preview-total span {
  color: var(--muted);
  font-size: 13px;
}

.ecommerce-preview-total strong {
  margin-top: 4px;
  font-size: 24px;
}

.ecommerce-preview-warning {
  margin: 14px 0 0;
  color: var(--danger, #b14a62);
}

.ecommerce-inventory-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.ecommerce-inventory-stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
}

.ecommerce-inventory-stat span,
.ecommerce-inventory-stat strong,
.ecommerce-inventory-stat small {
  display: block;
}

.ecommerce-inventory-stat span,
.ecommerce-inventory-stat small {
  color: var(--muted);
}

.ecommerce-inventory-stat span {
  font-size: 12px;
  font-weight: 800;
}

.ecommerce-inventory-stat strong {
  margin-top: 6px;
  font-size: 22px;
}

.ecommerce-inventory-stat small {
  margin-top: 5px;
  line-height: 1.45;
}

.ecommerce-inventory-stat.emphasis {
  border-color: #99ded2;
  background: #effbf8;
}

.ecommerce-inventory-stat.emphasis strong {
  color: var(--teal);
}

.ecommerce-inventory-messages:empty {
  display: none;
}

.ecommerce-inventory-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
}

.ecommerce-inventory-action strong,
.ecommerce-inventory-action span {
  display: block;
}

.ecommerce-inventory-action span {
  max-width: 760px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ecommerce-inventory-action button {
  flex: 0 0 auto;
}

.ecommerce-inventory-action button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.ecommerce-confirm-notice strong,
.ecommerce-confirm-notice span {
  display: block;
}

.ecommerce-confirm-notice span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.55;
}

.ecommerce-posting-history {
  margin-top: 24px;
}

.ecommerce-workspace td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.ecommerce-upload-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.ecommerce-upload-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.ecommerce-upload-actions small {
  max-width: 360px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .ecommerce-upload-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

.ecommerce-upload-line > span,
.ecommerce-upload-line small {
  display: block;
}

.ecommerce-upload-line small {
  margin-top: 3px;
  color: var(--muted);
}

.ecommerce-upload-line.ready {
  border-color: #9ddfd2;
  background: #f1fbf8;
}

.ecommerce-upload-line.needs-attention {
  border-color: #edcf91;
  background: #fffaf0;
}

.ecommerce-upload-line.failed {
  border-color: #efb2b2;
  color: #8d2828;
  background: #fff5f5;
}

.ecommerce-file-name {
  max-width: 300px;
  overflow-wrap: anywhere;
}

.ecommerce-batches-table {
  min-width: 1180px;
}

.ecommerce-report-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 24px;
  align-items: end;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.ecommerce-report-head > div {
  min-width: 0;
}

.ecommerce-report-title {
  margin-bottom: 14px;
}

.ecommerce-report-title h3 {
  font-size: 24px;
  letter-spacing: -0.025em;
}

.ecommerce-report-title p {
  max-width: 74ch;
  line-height: 1.55;
}

.ecommerce-month-rail {
  display: flex;
  gap: 8px;
  max-width: 100%;
  padding: 2px 0 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.ecommerce-month-rail button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.ecommerce-month-rail button:hover,
.ecommerce-month-rail button:focus-visible {
  border-color: #8fd7ca;
  color: var(--teal);
  outline: none;
}

.ecommerce-month-rail button.active {
  border-color: #79cdbd;
  color: #086f63;
  background: #eaf9f5;
}

.ecommerce-month-rail .ecommerce-year-option {
  border-color: #addfd5;
  color: #08796c;
  background: #f1fbf8;
}

.ecommerce-month-picker {
  display: grid;
  gap: 6px;
}

.ecommerce-month-picker span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ecommerce-report-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(440px, 1.8fr) minmax(220px, 0.85fr);
  align-items: stretch;
  margin: 22px 0 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(23, 32, 43, 0.05);
}

.ecommerce-report-primary,
.ecommerce-report-result {
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding: 22px;
}

.ecommerce-report-primary {
  color: #f3fffc;
  background: #0b7569;
}

.ecommerce-report-result {
  background: #f0faf7;
}

.ecommerce-report-primary span,
.ecommerce-report-result span {
  font-size: 13px;
  font-weight: 800;
}

.ecommerce-report-primary small,
.ecommerce-report-result small {
  margin-top: 7px;
  line-height: 1.45;
}

.ecommerce-report-primary small {
  color: #d5f7ef;
}

.ecommerce-report-result span,
.ecommerce-report-result small {
  color: #4e7069;
}

.ecommerce-report-primary strong,
.ecommerce-report-result strong {
  margin-top: 6px;
  font-size: clamp(24px, 2vw, 34px);
  letter-spacing: -0.025em;
}

.ecommerce-report-result strong {
  color: var(--teal);
}

.ecommerce-report-summary dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 8px 12px;
}

.ecommerce-report-summary dl div {
  display: flex;
  justify-content: center;
  flex-direction: column;
  min-height: 72px;
  padding: 10px 14px;
}

.ecommerce-report-summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ecommerce-report-summary dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.ecommerce-shadow-merge,
.ecommerce-report-detail {
  margin-top: 30px;
}

.ecommerce-shadow-grid {
  display: grid;
  grid-template-columns: minmax(112px, 0.6fr) repeat(3, minmax(170px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.ecommerce-shadow-labels,
.ecommerce-shadow-grid article {
  display: grid;
  grid-template-rows: repeat(6, minmax(44px, auto));
}

.ecommerce-shadow-labels {
  color: var(--muted);
  background: #f7faf9;
  font-size: 12px;
  font-weight: 800;
}

.ecommerce-shadow-labels span,
.ecommerce-shadow-grid article > * {
  display: flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.ecommerce-shadow-labels span:last-child,
.ecommerce-shadow-grid article > *:last-child {
  border-bottom: 0;
}

.ecommerce-shadow-grid article {
  border-left: 1px solid var(--line);
  background: #fff;
}

.ecommerce-shadow-grid article h4 {
  font-size: 14px;
}

.ecommerce-shadow-grid article strong,
.ecommerce-shadow-grid article b {
  font-size: 17px;
}

.ecommerce-shadow-grid article span {
  color: #40505f;
}

.ecommerce-shadow-grid article.increment {
  background: #fbfcfd;
}

.ecommerce-shadow-grid article.combined {
  color: #075f55;
  background: #effaf7;
}

.ecommerce-shadow-grid article.combined span {
  color: #315f59;
}

.ecommerce-report-channel-table {
  min-width: 1120px;
}

.ecommerce-report-footnote {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid #ecd7a7;
  border-radius: 10px;
  color: #6f5520;
  background: #fffaf0;
  font-size: 13px;
  line-height: 1.55;
}

.ecommerce-book-report {
  margin-top: 30px;
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.ecommerce-book-report > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 2px;
  color: var(--teal);
  cursor: pointer;
  font-weight: 800;
}

.ecommerce-book-report > summary span:first-child strong,
.ecommerce-book-report > summary span:first-child small {
  display: block;
}

.ecommerce-book-report > summary span:first-child strong {
  color: var(--ink);
  font-size: 17px;
}

.ecommerce-book-report > summary span:first-child small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.ecommerce-book-report table {
  min-width: 920px;
}

@media (max-width: 1100px) {
  .ecommerce-channel-row {
    grid-template-columns: 110px minmax(0, 1fr) auto;
  }

  .ecommerce-report-summary {
    grid-template-columns: 1fr 1.8fr;
  }

  .ecommerce-report-result {
    grid-column: 1 / -1;
    min-height: 110px;
  }
}

@media (max-width: 760px) {
  .ecommerce-command-bar,
  .ecommerce-command-actions,
  .ecommerce-upload-line {
    align-items: stretch;
    flex-direction: column;
  }

  .ecommerce-safety {
    padding: 0;
    text-align: left;
  }

  .ecommerce-overview-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .ecommerce-channel-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ecommerce-channel-row dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ecommerce-calculation-popover {
    right: auto;
    left: 0;
  }

  .ecommerce-workspace-tabs {
    overflow-x: auto;
  }

  .ecommerce-workspace-tabs button {
    flex: 0 0 auto;
  }

  .ecommerce-workspace-panel {
    padding: 18px;
  }

  .ecommerce-report-head,
  .ecommerce-report-summary {
    grid-template-columns: 1fr;
  }

  .ecommerce-report-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .ecommerce-month-picker {
    max-width: 220px;
  }

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

  .ecommerce-report-result {
    grid-column: auto;
  }

  .ecommerce-shadow-grid {
    grid-template-columns: 105px repeat(3, minmax(155px, 1fr));
    overflow-x: auto;
  }

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

  .ecommerce-inventory-action {
    align-items: stretch;
    flex-direction: column;
  }

  .ecommerce-inventory-action button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .ecommerce-inventory-summary {
    grid-template-columns: 1fr;
  }
}

/* Royalty management: summary first, details on demand. */
.royalty-section-tabs {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.royalty-accrual-view > .top-filter-bar {
  position: sticky;
  top: 94px;
  z-index: 12;
}

.royalty-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin: 18px 0;
  align-items: start;
}

.royalty-summary-grid .table-scroll table {
  min-width: 640px;
}

.royalty-detail-card {
  margin-top: 18px;
}

.royalty-detail-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  cursor: pointer;
  list-style: none;
  background: rgba(255, 255, 255, 0.76);
}

.royalty-detail-card > summary::-webkit-details-marker {
  display: none;
}

.royalty-detail-card > summary h3,
.royalty-rules-head h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.royalty-detail-toggle {
  flex: 0 0 auto;
  color: var(--teal);
  font-weight: 900;
}

.royalty-detail-body {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
}

.royalty-detail-toolbar {
  justify-content: flex-start;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 253, 251, 0.82);
}

.royalty-detail-toolbar .input {
  flex: 1 1 280px;
  max-width: 420px;
}

.royalty-detail-toolbar select {
  flex: 0 1 180px;
  max-width: 210px;
}

.royalty-detail-table .table-scroll table {
  min-width: 1040px;
}

.royalty-detail-table th,
.royalty-detail-table td {
  white-space: nowrap;
}

.royalty-detail-table th:nth-child(2),
.royalty-detail-table td:nth-child(2) {
  white-space: normal;
  min-width: 220px;
}

.royalty-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.royalty-pagination > div {
  display: flex;
  gap: 8px;
}

.royalty-rules-view {
  display: grid;
  gap: 18px;
}

.royalty-rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--prototype-surface);
  box-shadow: var(--shadow);
}

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

.badge.neutral {
  color: #536171;
  background: #edf1f5;
}

.royalty-rule-modal {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.royalty-rule-modal .modal-head,
.royalty-rule-modal .modal-foot {
  flex: 0 0 auto;
}

.royalty-rule-modal .modal-section {
  min-height: 0;
  padding-top: 18px;
  overflow-y: auto;
}

.royalty-rule-warning {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #f2d7a7;
  border-radius: 8px;
  color: #694911;
  background: #fff9ec;
}

.royalty-rule-warning span {
  line-height: 1.55;
}

.royalty-dealer-fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-form .royalty-dealer-fieldset.wide {
  grid-column: 1 / -1;
}

.royalty-dealer-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 900;
}

.royalty-dealer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.royalty-dealer-tools .input {
  flex: 1 1 220px;
  max-width: 360px;
}

.royalty-rule-modal .compact-check-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.royalty-rule-modal .inline-check {
  display: inline-flex;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  overflow-wrap: anywhere;
}

.quote-form .royalty-history-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #f2d7a7;
  border-radius: 8px;
  color: #694911;
  background: #fff9ec;
}

.royalty-history-confirm input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--teal);
}

.quote-form .royalty-history-confirm span {
  color: inherit;
  line-height: 1.5;
}

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

  .royalty-rule-modal .compact-check-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .sidebar {
    height: auto;
    max-height: none;
  }

  .royalty-section-tabs,
  .royalty-rule-stats {
    grid-template-columns: 1fr;
  }

  .royalty-accrual-view > .top-filter-bar {
    position: static;
  }

  .royalty-detail-card > summary,
  .royalty-rules-head,
  .royalty-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .royalty-detail-body {
    padding: 14px;
  }

  .royalty-detail-toolbar .input,
  .royalty-detail-toolbar select,
  .royalty-dealer-tools .input {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }

  .royalty-pagination > div button {
    flex: 1 1 0;
  }

  .royalty-rule-modal .modal-head,
  .royalty-rule-modal .modal-foot {
    padding: 16px;
  }

  .royalty-rule-modal .modal-section {
    padding: 14px 16px;
  }

  .royalty-rule-modal .quote-form select,
  .royalty-rule-modal .quote-form input,
  .royalty-rule-modal .quote-form textarea {
    width: 100%;
    min-width: 0;
  }

  .royalty-rule-modal .compact-check-list {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(135deg, rgba(16, 201, 167, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(244, 90, 181, 0.13), transparent 32%),
    var(--bg);
  overflow: hidden;
}

body.login-mode {
  min-width: 0;
  height: auto;
  min-height: 100vh;
  overflow: auto;
}

body.login-mode .sidebar,
body.login-mode .app {
  display: none;
}

body.app-mode .login-screen {
  display: none;
}

.login-screen {
  --login-peek-width: clamp(132px, 10.8vw, 150px);
  --login-peek-space: calc(var(--login-peek-width) * 0.47);
  position: relative;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(420px, 500px);
  gap: clamp(32px, 4vw, 56px);
  align-items: center;
  min-height: 100vh;
  padding: clamp(32px, 4vw, 48px) clamp(28px, 5vw, 72px);
  overflow: hidden;
}

.login-screen::before {
  content: "";
  position: absolute;
  left: -120px;
  bottom: -190px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: rgba(16, 201, 167, 0.13);
}

.login-brand {
  position: absolute;
  top: 48px;
  left: 72px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.login-brand > div {
  display: flex;
  align-items: center;
}

.login-brand > img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 16px 36px rgba(8, 127, 112, 0.16);
}

.login-brand p,
.login-muted,
.login-note {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.login-brand p {
  white-space: nowrap;
}

.login-wordmark {
  display: block;
  width: 136px;
  margin-top: 0;
  background: transparent;
}

.login-copy {
  position: relative;
  z-index: 1;
  align-self: center;
}

.login-copy h1 {
  margin: 0;
  font-size: clamp(38px, 4.2vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

.login-copy p {
  margin: 28px 0 0;
  color: #0c8d7d;
  font-size: clamp(18px, 1.7vw, 20px);
  font-weight: 900;
}

.login-card-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(500px, calc(100vw - 56px));
  margin-left: auto;
  padding-top: var(--login-peek-space);
}

.login-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  width: 100%;
  overflow: visible;
  padding: 44px 38px 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(23, 32, 43, 0.12);
}

.login-peek {
  position: absolute;
  top: 0;
  left: 65%;
  z-index: 0;
  width: var(--login-peek-width);
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 14px 24px rgba(8, 127, 112, 0.18));
}

.login-kicker {
  margin: 0;
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.login-card h2 {
  margin: 0;
  font-size: 38px;
  letter-spacing: 0;
}

.login-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.login-remember {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  cursor: pointer;
}

.login-remember input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.login-remember span {
  font-size: 14px;
}

.login-submit {
  min-height: 54px;
  margin-top: 4px;
  font-size: 18px;
}

.login-note {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  line-height: 1.6;
}

.login-compliance {
  position: absolute;
  right: 28px;
  bottom: 18px;
  left: 28px;
  z-index: 1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.login-compliance a {
  color: inherit;
  text-decoration: none;
}

.login-compliance a:hover,
.login-compliance a:focus-visible {
  color: var(--teal);
  text-decoration: underline;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 268px;
  height: 100vh;
  padding: 18px 14px;
  background:
    linear-gradient(180deg, rgba(231, 250, 244, 0.72), rgba(255, 255, 255, 0.92) 28%),
    rgba(255, 255, 255, 0.9);
  border-right: 1px solid rgba(220, 227, 234, 0.78);
  box-shadow: 14px 0 36px rgba(8, 127, 112, 0.04);
  overflow-y: auto;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
  padding: 6px 6px 0;
}

.brand img {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 14px 34px rgba(8, 127, 112, 0.16);
}

.brand > div {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand p,
.topbar p,
.section-subtitle,
.muted {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.brand p {
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.brand h1,
.topbar h2 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.brand-wordmark {
  width: 138px !important;
  height: auto !important;
  display: block;
  margin-top: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  object-fit: contain !important;
}

.role-switcher {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid rgba(201, 242, 235, 0.9);
  border-radius: 8px;
  background: rgba(238, 246, 244, 0.88);
}

.role-btn {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 900;
  box-shadow: none;
}

.role-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--mint), var(--teal));
  box-shadow: 0 8px 22px rgba(8, 127, 112, 0.2);
}

nav {
  display: grid;
  gap: 6px;
}

nav button,
button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  box-shadow: 0 8px 18px rgba(23, 32, 43, 0.035);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

button:hover {
  border-color: #c9d5df;
  box-shadow: 0 12px 24px rgba(23, 32, 43, 0.06);
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  box-shadow: none;
  font-weight: 900;
  text-align: left;
}

.link-button:hover {
  color: var(--pink);
  box-shadow: none;
}

.icon-button {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 8px;
  font-size: 28px;
  line-height: 1;
}

nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding-left: 16px;
  text-align: left;
  border: 0;
  color: #526070;
  background: transparent;
  box-shadow: none;
}

nav button.active,
nav button:hover {
  color: var(--teal);
  background: var(--prototype-surface);
  box-shadow: 0 12px 26px rgba(8, 127, 112, 0.08);
}

nav button.active::before {
  content: "";
  position: absolute;
  left: 8px;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--pink);
}

nav button span {
  width: 22px;
  color: var(--pink);
  text-align: center;
}

.nav-section-label {
  min-height: 30px;
  display: flex;
  align-items: center;
  margin-top: 8px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(231, 250, 244, 0.68);
  color: #8a95a3;
  font-size: 12px;
  font-weight: 900;
}

.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  box-shadow: 0 12px 26px rgba(244, 90, 181, 0.2);
}

.primary:hover {
  border-color: transparent;
  box-shadow: 0 16px 32px rgba(244, 90, 181, 0.28);
}

.danger-button {
  border-color: rgba(244, 90, 181, 0.36);
  color: var(--pink-dark);
  background: var(--prototype-pink-soft);
  box-shadow: none;
}

.danger-button:hover {
  border-color: rgba(244, 90, 181, 0.58);
  box-shadow: 0 12px 24px rgba(244, 90, 181, 0.12);
}

.ghost {
  color: var(--teal);
  background: var(--soft);
  border-color: #c9f2eb;
  box-shadow: none;
}

.top-notifications {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notification-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--pink);
  font-size: 12px;
  line-height: 1;
}

.nav-count {
  flex: none;
  width: auto;
  margin-inline-start: auto;
  color: #fff;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.nav-count[hidden] {
  display: none;
}

a.ghost {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
  background: var(--soft);
}

.app {
  margin-left: 268px;
  min-height: 0;
  height: 100vh;
  overflow: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 94px;
  height: auto;
  padding: 18px 30px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(220, 227, 234, 0.78);
  backdrop-filter: blur(12px);
}

.topbar h2 {
  font-size: 34px;
  line-height: 1.1;
}

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

.content {
  padding: 26px 30px 46px;
  background:
    linear-gradient(120deg, rgba(16, 201, 167, 0.11), transparent 32%),
    linear-gradient(315deg, rgba(244, 90, 181, 0.12), transparent 34%);
}

.page-loader {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 148px;
  padding: 28px 30px;
  overflow: hidden;
  border: 1px solid rgba(201, 242, 235, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(231, 250, 244, 0.74), rgba(255, 243, 250, 0.72)),
    var(--prototype-surface);
  box-shadow: var(--shadow);
}

.page-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 38%;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
  animation: loader-sheen 1.15s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.loader-logo {
  position: relative;
  flex: 0 0 auto;
  width: 88px;
  height: 76px;
  overflow: visible;
  filter: drop-shadow(0 12px 22px rgba(16, 201, 167, 0.14));
}

.loader-monster-stack {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 1;
  width: 70px;
  height: 48px;
  overflow: hidden;
  transform: translateX(-50%) translateY(24px) scale(0.98);
  transform-origin: center bottom;
  animation: loader-monster-rise 2.35s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.loader-monster-open,
.loader-monster-closed {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 70px;
  height: auto;
  transform: translateX(-50%);
}

.loader-monster-closed {
  z-index: 2;
  opacity: 0;
  animation: loader-blink 2.35s ease-in-out infinite;
}

.loader-box {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  width: 88px;
  height: auto;
  transform: translateX(-50%);
}

.page-loader strong,
.page-loader span {
  position: relative;
  z-index: 1;
  display: block;
}

.page-loader strong {
  font-size: 18px;
  color: var(--ink);
}

.page-loader span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.content.view-enter > * {
  animation: view-enter 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes loader-monster-rise {
  0%,
  100% {
    transform: translateX(-50%) translateY(24px) scale(0.98);
  }
  28%,
  68% {
    transform: translateX(-50%) translateY(-9px) scale(1);
  }
}

@keyframes loader-blink {
  0%,
  38%,
  58%,
  100% {
    opacity: 0;
  }
  46%,
  52% {
    opacity: 1;
  }
}

@keyframes loader-sheen {
  to {
    transform: translateX(320%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-loader::after,
  .loader-monster-stack,
  .loader-monster-closed,
  .content.view-enter > * {
    animation: none;
  }

  .loader-monster-stack {
    transform: translateX(-50%) translateY(-4px);
  }
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

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

.two {
  grid-template-columns: 1.25fr 0.75fr;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--prototype-surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.card-head h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.25;
}

.type-setting-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.type-setting-card-head > div {
  min-width: 0;
}

.type-setting-card-head .primary {
  flex: 0 0 auto;
}

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

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

.js-orders-table .table-scroll table,
.js-receivables-table .table-scroll table,
.js-ledger-table .table-scroll table {
  min-width: 980px;
}

.receivable-table .table-scroll table {
  min-width: 1280px;
}

.receivable-table td {
  vertical-align: middle;
}

.receivable-status-tabs {
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.receivable-order-cell {
  display: grid;
  gap: 6px;
}

.receivable-order-cell .link-button {
  width: fit-content;
  padding: 0;
}

.receivable-date-cell {
  min-width: 174px;
  line-height: 1.75;
  white-space: normal;
}

.receivable-date-label {
  display: inline-block;
  width: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.receivable-date-cell .badge,
.receivable-date-cell .muted {
  white-space: nowrap;
}

.receivable-workflow-cell {
  min-width: 148px;
}

.receivable-confirmation-cell {
  min-width: 168px;
}

.receivable-invoice-cell {
  min-width: 210px;
}

.receivable-payment-cell {
  min-width: 170px;
}

.receivable-cell-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
}

.receivable-workflow-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.receivable-invoice-link {
  white-space: nowrap;
}

.receivable-table th:last-child,
.receivable-action-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -10px 0 18px rgba(22, 34, 49, 0.06);
}

.receivable-table th:last-child {
  z-index: 3;
  background: #f8fcfb;
}

.receivable-table tbody tr:hover .receivable-action-cell {
  background: #f5fcf9;
}

.receivable-action-cell {
  min-width: 210px;
  vertical-align: middle;
}

.receivable-list-footer,
.receivable-list-footer > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.receivable-list-footer {
  justify-content: space-between;
  padding: 14px 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.receivable-list-footer select {
  min-height: 38px;
}

.receivable-note-modal {
  width: min(760px, 100%);
}

.receivable-note-detail {
  padding: 24px;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.receivable-statement-equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 24px 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--soft);
}

.receivable-statement-equation span {
  color: var(--muted);
  font-weight: 800;
}

.receivable-statement-equation strong {
  color: var(--teal-dark);
}

.receivable-statement-equation b {
  color: var(--ink);
  font-size: 18px;
}

.receivable-adjustment-note {
  max-width: 440px;
  color: var(--muted);
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
}

.order-compensation-section .order-settlement-equation {
  margin: 0 0 18px;
}

.order-compensation-section .modal-section-title > div {
  display: grid;
  gap: 4px;
}

.order-compensation-section .js-request-order-compensation {
  flex: 0 0 auto;
}

.compact-disclosure {
  max-width: 460px;
  color: var(--muted);
  line-height: 1.6;
}

.compact-disclosure summary {
  width: fit-content;
  color: var(--teal-dark);
  font-weight: 900;
  cursor: pointer;
  list-style-position: inside;
}

.compact-disclosure[open] summary {
  margin-bottom: 8px;
}

.compact-disclosure div {
  max-height: 180px;
  padding: 10px 12px;
  overflow: auto;
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dealer-statement-actions {
  flex-wrap: wrap;
  min-width: 108px;
}

.js-dealer-statement-table th:last-child,
.js-dealer-statement-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -10px 0 18px rgba(22, 34, 49, 0.06);
}

.js-dealer-statement-table th:last-child {
  z-index: 3;
  background: #f8fcfb;
}

.js-dealer-statement-table tbody tr:hover td:last-child {
  background: #f5fcf9;
}

.stat {
  min-height: 108px;
  padding: 18px 20px;
}

.stat-action {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
}

.stat-action.active {
  border-color: rgba(0, 137, 124, 0.35);
  background: linear-gradient(135deg, rgba(0, 188, 171, 0.14), rgba(255, 255, 255, 0.96));
}

.stat span {
  color: var(--muted);
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.stats-five .stat strong {
  font-size: 24px;
  line-height: 1.08;
  overflow-wrap: normal;
  word-break: keep-all;
}

.supplier-payable-stats .stat strong {
  font-size: clamp(24px, 2vw, 28px);
  overflow-wrap: normal;
  word-break: keep-all;
}

.stat em {
  display: block;
  margin-top: 8px;
  color: var(--teal);
  font-style: normal;
  font-weight: 800;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(201, 242, 235, 0.78);
  border-radius: 8px;
  background: rgba(247, 253, 251, 0.82);
  box-shadow: 0 14px 34px rgba(8, 127, 112, 0.045);
}

.board-toolbar-card {
  margin-top: 18px;
  margin-bottom: 18px;
  padding: 16px;
}

.top-filter-bar {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-color: rgba(201, 242, 235, 0.9);
  background:
    linear-gradient(135deg, rgba(231, 250, 244, 0.82), rgba(255, 255, 255, 0.98) 42%),
    var(--prototype-surface);
}

.top-filter-bar .compact-toolbar {
  justify-content: flex-start;
}

.top-filter-bar .section-subtitle {
  margin-top: 10px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.inline-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.inline-check:has(input:checked) {
  border-color: rgba(16, 185, 160, 0.34);
  background: rgba(231, 250, 244, 0.88);
  color: var(--teal-dark);
}

.prototype-workbench {
  border-color: rgba(201, 242, 235, 0.86);
  background:
    linear-gradient(135deg, rgba(231, 250, 244, 0.78), rgba(255, 255, 255, 0.96) 38%),
    var(--prototype-surface);
}

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

.workbench-head h3 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.25;
}

.board-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.status-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.status-tabs button {
  display: grid;
  place-items: center;
  min-height: 68px;
  padding: 10px;
  color: var(--muted);
  background: #fff;
  border-color: var(--line);
  box-shadow: none;
}

.status-tabs button:disabled {
  cursor: default;
  opacity: 0.42;
}

.status-tabs button strong {
  color: inherit;
  font-size: 20px;
  line-height: 1;
}

.status-tabs button span {
  color: inherit;
  font-size: 13px;
  font-weight: 900;
}

.status-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--mint), var(--teal));
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(8, 127, 112, 0.16);
}

.printer-status-tabs {
  grid-template-columns: repeat(6, minmax(92px, 1fr));
}

.warehouse-filter-card {
  display: grid;
  gap: 16px;
}

.warehouse-filter-card .workbench-head {
  margin-bottom: 0;
}

.warehouse-status-tabs {
  grid-template-columns: repeat(4, minmax(96px, 1fr));
}

.logistics-command-card {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 22px;
  overflow: hidden;
  border-color: rgba(184, 239, 230, 0.95);
  background:
    linear-gradient(135deg, rgba(231, 250, 244, 0.96), rgba(255, 255, 255, 0.98) 42%),
    var(--card);
}

.logistics-command-card::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -72px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: rgba(244, 90, 181, 0.08);
  pointer-events: none;
}

.logistics-command-head {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.logistics-command-title {
  max-width: 720px;
}

.logistics-command-title span {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.logistics-command-title h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.22;
}

.logistics-command-title p {
  max-width: 64ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.65;
}

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

.logistics-count-pill {
  display: grid;
  min-width: 92px;
  padding: 11px 14px;
  border: 1px solid rgba(184, 239, 230, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.logistics-count-pill span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.logistics-count-pill strong {
  color: var(--teal-dark);
  font-size: 24px;
  line-height: 1;
}

.logistics-flow {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.logistics-flow div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(201, 242, 235, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.logistics-flow strong,
.logistics-flow span,
.logistics-company-cell strong,
.logistics-company-cell span {
  display: block;
}

.logistics-flow strong {
  color: var(--ink);
  font-size: 14px;
}

.logistics-flow span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.logistics-company-cell {
  display: grid;
  gap: 4px;
}

.logistics-company-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-toolbar {
  justify-content: flex-end;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.quick-date-group {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-date-group .quick-date {
  flex: 0 0 auto;
  width: auto;
}

.compact-toolbar .input,
.compact-toolbar .select-like,
.compact-toolbar select {
  flex: 1 1 190px;
  max-width: 300px;
}

.compact-toolbar .date-range-trigger {
  flex: 1 1 250px;
  max-width: 360px;
}

.compact-toolbar button {
  flex: 0 0 auto;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px 0;
}

.toolbar-title {
  color: var(--ink);
  font-size: 16px;
  white-space: nowrap;
}

.section-toolbar {
  justify-content: space-between;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.section-toolbar > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.raw-material-movement-toolbar {
  justify-content: flex-start;
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 253, 251, 0.82);
}

.raw-material-movement-toolbar .input,
.raw-material-movement-toolbar select {
  flex: 1 1 150px;
  max-width: 220px;
}

.raw-material-movement-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.raw-material-movement-pagination > div {
  display: flex;
  gap: 8px;
}

.raw-material-movement-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 720px) {
  .raw-material-movement-toolbar .input,
  .raw-material-movement-toolbar select,
  .raw-material-movement-toolbar button {
    flex: 1 1 100%;
    max-width: none;
  }

  .raw-material-movement-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .raw-material-movement-pagination > div button {
    flex: 1 1 0;
  }
}

.rules-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.rules-strip div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  background: rgba(240, 253, 249, 0.78);
}

.rules-strip strong,
.rules-strip span {
  display: block;
}

.rules-strip strong {
  color: var(--teal-dark);
  font-size: 14px;
}

.rules-strip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.account-permission-strip label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  background: rgba(240, 253, 249, 0.78);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.account-role-fields {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  background: rgba(240, 253, 249, 0.72);
}

.account-role-fields label {
  display: grid;
  gap: 8px;
  font-weight: 900;
  color: var(--muted);
}

.account-role-fields .muted {
  margin-top: 10px;
  line-height: 1.6;
}

.account-self-panel {
  display: grid;
  gap: 18px;
}

.account-self-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(224, 250, 245, 0.82), #fff 72%);
}

.account-self-summary div {
  display: grid;
  gap: 6px;
}

.account-self-summary span,
.account-self-summary em {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
}

.account-self-summary strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
}

.compact-notice {
  margin: 0;
}

.management-list-card {
  margin-top: 18px;
}

.raw-material-stock-card .table-scroll table {
  min-width: 1280px;
}

.scrap-workspace {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.scrap-workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(24, 67, 61, 0.08);
}

.scrap-workspace-head h3,
.scrap-lines-head h4 {
  margin: 0;
  color: var(--ink);
}

.scrap-workspace-head p,
.scrap-lines-head p {
  max-width: 72ch;
  margin: 7px 0 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.65;
}

.scrap-workspace-actions,
.scrap-lines-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scrap-workspace-actions {
  flex: 0 0 auto;
}

.scrap-summary-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #c8eee8;
  border-radius: 14px;
  background: #f6fcfa;
}

.scrap-summary-strip div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 17px 20px;
}

.scrap-summary-strip div + div {
  border-left: 1px solid #c8eee8;
}

.scrap-summary-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.scrap-summary-strip strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.scrap-policy-note {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 15px 18px;
  border: 1px solid #f1d59c;
  border-radius: 12px;
  background: #fffaf0;
  color: #704f15;
}

.scrap-policy-note strong,
.scrap-policy-note span {
  line-height: 1.55;
}

.scrap-policy-note span {
  font-weight: 700;
}

.scrap-request-modal {
  width: min(1180px, calc(100vw - 40px));
}

.scrap-detail-modal {
  width: min(980px, calc(100vw - 40px));
}

.scrap-lines-head {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.scrap-lines-column-head,
.scrap-line {
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(190px, 1fr) 100px minmax(170px, 1fr) minmax(170px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.scrap-lines-column-head {
  padding: 14px 4px 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.scrap-line {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.scrap-line .input {
  width: 100%;
  min-width: 0;
}

.scrap-accounting-note {
  margin-top: 18px;
}

.scrap-financial-section {
  margin-top: 22px;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
}

.scrap-impact-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #c8eee8;
  border-radius: 12px;
  background: rgba(246, 252, 250, 0.96);
}

.scrap-impact-summary > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px 18px;
}

.scrap-impact-summary > div + div {
  border-left: 1px solid #c8eee8;
}

.scrap-impact-summary span,
.scrap-impact-summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.scrap-impact-summary strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
}

.scrap-analysis-panel {
  margin-top: 18px;
  padding: 20px;
}

.scrap-analysis-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.scrap-analysis-head h3,
.scrap-analysis-grid h4 {
  margin: 0;
}

.scrap-analysis-head p {
  max-width: 70ch;
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.55;
}

.scrap-analysis-head > span {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: #e7faf4;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.scrap-analysis-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.scrap-analysis-metrics > div {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
}

.scrap-analysis-metrics > div + div {
  border-left: 1px solid var(--line-soft);
}

.scrap-analysis-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.scrap-analysis-metrics strong {
  font-size: 19px;
}

.scrap-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 22px;
}

.scrap-analysis-grid > div {
  min-width: 0;
}

.scrap-analysis-grid h4 {
  margin-bottom: 10px;
  font-size: 15px;
}

.scrap-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.year-end-scrap-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(150px, auto);
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.year-end-scrap-tools span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-align: right;
}

.year-end-scrap-list {
  max-height: 430px;
  margin-top: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.year-end-scrap-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 140px;
  gap: 13px;
  align-items: center;
  min-height: 68px;
  padding: 11px 14px;
  cursor: pointer;
  background: #fff;
}

.year-end-scrap-row + .year-end-scrap-row {
  border-top: 1px solid var(--line-soft);
}

.year-end-scrap-row:hover,
.year-end-scrap-row.selected {
  background: #f1fbf8;
}

.year-end-scrap-row > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.year-end-scrap-row strong,
.year-end-scrap-row small {
  overflow-wrap: anywhere;
}

.year-end-scrap-row small {
  color: var(--muted);
  font-weight: 700;
}

.compact-empty {
  padding: 18px;
}

@media (max-width: 900px) {
  .scrap-workspace-head,
  .scrap-lines-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .scrap-summary-strip div:nth-child(4) {
    border-left: 0;
    border-top: 1px solid #c8eee8;
  }

  .scrap-summary-strip div:nth-child(n + 4) {
    border-top: 1px solid #c8eee8;
  }

  .scrap-lines-column-head {
    display: none;
  }

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

  .scrap-analysis-metrics > div:nth-child(3) {
    border-left: 0;
  }

  .scrap-analysis-metrics > div:nth-child(n + 3) {
    border-top: 1px solid var(--line-soft);
  }

  .scrap-line {
    grid-template-columns: 1fr 1fr;
  }

  .scrap-line .js-scrap-book,
  .scrap-line .js-scrap-source-reference,
  .scrap-line .js-scrap-line-note {
    grid-column: 1 / -1;
  }

  .year-end-scrap-tools {
    grid-template-columns: 1fr auto;
  }

  .year-end-scrap-tools span {
    grid-column: 1 / -1;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .scrap-workspace-actions,
  .scrap-line,
  .scrap-detail-actions,
  .year-end-scrap-tools,
  .year-end-scrap-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .scrap-workspace-actions button,
  .scrap-line > * {
    width: 100%;
  }

  .scrap-summary-strip,
  .scrap-policy-note,
  .scrap-impact-summary,
  .scrap-analysis-grid,
  .scrap-analysis-metrics {
    grid-template-columns: 1fr;
  }

  .scrap-impact-summary > div + div,
  .scrap-analysis-metrics > div + div,
  .scrap-analysis-metrics > div:nth-child(3) {
    border-top: 1px solid #c8eee8;
    border-left: 0;
  }

  .scrap-analysis-head {
    flex-direction: column;
  }

  .scrap-summary-strip div + div,
  .scrap-summary-strip div:nth-child(4) {
    border-top: 1px solid #c8eee8;
    border-left: 0;
  }

  .year-end-scrap-row .input,
  .scrap-detail-actions button {
    width: 100%;
  }
}

.notice {
  padding: 14px 18px;
  margin-bottom: 16px;
  border-color: #b8efe6;
  background: #effbf8;
}

.notice.error {
  border-color: #ffd1e8;
  background: #fff3fa;
}

.permission-empty {
  display: grid;
  place-items: center;
  min-height: 360px;
  text-align: center;
}

.permission-empty > div {
  max-width: 520px;
}

.permission-empty h3 {
  margin: 16px 0 10px;
  font-size: 28px;
}

.permission-empty p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.7;
}

.app-toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 3000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: min(460px, calc(100vw - 40px));
  padding: 16px 18px;
  border: 1px solid #b8efe6;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(239, 251, 248, 0.98);
  box-shadow: 0 22px 54px rgba(23, 32, 43, 0.18);
}

.app-toast.error {
  border-color: #ffc2df;
  background: rgba(255, 243, 250, 0.98);
}

.app-toast strong,
.app-toast span {
  display: block;
}

.app-toast strong {
  font-size: 16px;
}

.app-toast span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.app-toast.error strong {
  color: #c72c75;
}

.app-toast .icon-button {
  width: 36px;
  min-height: 36px;
  font-size: 22px;
  box-shadow: none;
}

.form-error {
  min-height: 20px;
  color: #d92d7a;
  font-weight: 800;
}

.form-success {
  min-height: 20px;
  color: var(--teal);
  font-weight: 800;
}


.dealer-sheet-import {
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
}

.dealer-import-head,
.dealer-import-summary,
.dealer-import-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dealer-import-head {
  align-items: flex-start;
}

.dealer-import-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 26px;
  letter-spacing: -0.02em;
}

.dealer-import-head p {
  max-width: 76ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.65;
}

.dealer-import-rule {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
}

.dealer-import-dropzone {
  position: relative;
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px dashed #72cfc0;
  border-radius: 12px;
  background: #f5fffc;
  color: var(--teal-dark);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.dealer-import-dropzone:hover,
.dealer-import-dropzone.is-dragging {
  border-color: var(--teal);
  background: #e9fbf6;
  box-shadow: 0 10px 26px rgba(13, 122, 107, 0.1);
}

.dealer-import-dropzone:focus-within,
.dealer-import-dropzone:focus-visible {
  outline: 3px solid rgba(16, 201, 167, 0.22);
  outline-offset: 3px;
}

.dealer-import-dropzone.is-processing {
  cursor: progress;
  opacity: 0.76;
  pointer-events: none;
}

.dealer-import-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.dealer-import-dropzone strong {
  font-size: 17px;
}

.dealer-import-dropzone span {
  color: #43716a;
  font-size: 13px;
  font-weight: 750;
}

.dealer-import-preview {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.dealer-import-summary > div:first-child {
  display: grid;
  gap: 4px;
}

.dealer-import-summary > div:first-child > strong {
  color: var(--ink);
  font-size: 17px;
}

.dealer-import-summary > div:first-child > span {
  color: var(--muted);
  font-weight: 800;
}

.dealer-import-summary-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dealer-import-table {
  margin-top: 16px;
}

.dealer-import-table table {
  min-width: 1080px;
}

.dealer-import-table th {
  white-space: nowrap;
}

.dealer-import-table td {
  vertical-align: top;
}

.dealer-import-table td > strong,
.dealer-import-table td > small {
  display: block;
}

.dealer-import-table td > small {
  max-width: 48ch;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.dealer-import-table tr.needs-attention td {
  background: #fffaf0;
}

.dealer-import-error {
  color: #c65e19 !important;
}

.dealer-import-unresolved {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  padding: 14px 0 2px;
  border-top: 1px solid #f1d3a9;
  color: #945019;
}

.dealer-import-unresolved span {
  font-weight: 750;
  line-height: 1.5;
}

.dealer-import-foot {
  align-items: flex-end;
  margin-top: 18px;
}

.dealer-import-foot p {
  max-width: 78ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.6;
}

.dealer-import-foot > div {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

@media (max-width: 760px) {
  .dealer-sheet-import {
    padding: 16px;
  }

  .dealer-import-head,
  .dealer-import-summary,
  .dealer-import-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .dealer-import-rule {
    align-self: flex-start;
  }

  .dealer-import-summary-badges {
    justify-content: flex-start;
  }

  .dealer-import-foot > div,
  .dealer-import-foot button {
    width: 100%;
  }

  .dealer-import-foot > div {
    flex-direction: column-reverse;
  }
}

.dealer-sheet-import + .top-filter-bar {
  margin-bottom: 20px;
}

.dealer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}

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

.product-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.product-card h3 {
  margin: 14px 0 6px;
  font-size: 22px;
}

.product-card-main {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.product-card-info {
  min-width: 0;
}

.product-card-info h3 {
  margin-top: 10px;
}

.product-cover {
  width: 112px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(16, 201, 167, 0.18), rgba(244, 90, 181, 0.12));
  box-shadow: 0 12px 28px rgba(23, 32, 43, 0.08);
}

.product-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-placeholder {
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
}

.cover-placeholder span,
.cover-placeholder strong {
  display: block;
}

.cover-placeholder span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.cover-placeholder strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

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

.product-meta div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  background: var(--soft);
}

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

.asset-box {
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  background: rgba(240, 253, 249, 0.75);
}

.asset-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.empty-asset {
  color: var(--muted);
  font-weight: 800;
}

.product-meta strong {
  display: block;
  margin-top: 8px;
  color: var(--teal);
  font-size: 18px;
}

.policy-box {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid #b8efe6;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(16, 201, 167, 0.09), rgba(244, 90, 181, 0.05));
}

.policy-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.policy-line strong {
  color: var(--teal);
  font-size: 14px;
  line-height: 1.4;
}

.policy-line span {
  color: var(--pink);
  font-weight: 900;
  white-space: nowrap;
}

.policy-progress {
  height: 8px;
  margin: 10px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8ef;
}

.policy-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--pink));
}

.quantity-row {
  display: grid;
  grid-template-columns: 72px minmax(90px, 1fr) 72px auto;
  gap: 8px;
}

.qty-input {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 900;
  text-align: center;
}

.cart-panel {
  position: sticky;
  top: 98px;
  max-height: calc(100vh - 124px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.cart-backdrop {
  display: none;
}

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

.cart-panel h3 {
  margin: 0 0 6px;
}

.cart-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.cart-item,
.cart-total,
.empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 36px;
}

.cart-total strong {
  color: var(--pink);
  font-size: 22px;
}

.cart-item strong {
  display: grid;
  gap: 4px;
}

.cart-item small {
  color: var(--pink);
  font-size: 12px;
  font-weight: 900;
}

.full-width {
  width: 100%;
}

.dealer-orders-section {
  display: grid;
  gap: 16px;
}

.dealer-orders-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.dealer-orders-heading h3,
.dealer-orders-heading p {
  margin: 0;
}

.dealer-orders-heading h3 {
  font-size: 22px;
}

.dealer-orders-heading p {
  margin-top: 5px;
  color: var(--muted);
}

.dealer-orders-heading > strong {
  color: var(--muted);
  font-size: 14px;
}

.dealer-orders-list {
  display: grid;
  gap: 16px;
}

.dealer-order-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(23, 32, 43, 0.06);
}

.dealer-order-card-head {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  background: #f7fbfa;
}

.dealer-order-identity {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.dealer-order-no {
  width: max-content;
  max-width: 100%;
  font-size: 18px;
  font-weight: 900;
}

.dealer-order-identity > span,
.dealer-order-total > span,
.dealer-order-shipping > span,
.dealer-order-shipping time {
  color: var(--muted);
  font-size: 13px;
}

.dealer-order-head-status,
.dealer-order-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dealer-order-total {
  display: grid;
  gap: 3px;
  min-width: 120px;
  text-align: right;
}

.dealer-order-total strong {
  font-size: 20px;
}

.dealer-order-shipping {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.dealer-order-shipping > span:first-child {
  padding-right: 2px;
  font-weight: 800;
}

.dealer-order-shipping time {
  margin-left: auto;
}

.dealer-order-items-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dealer-order-items {
  width: 100%;
  min-width: 820px;
  table-layout: fixed;
}

.dealer-order-items th,
.dealer-order-items td {
  padding: 13px 14px;
  vertical-align: middle;
}

.dealer-order-items th:first-child,
.dealer-order-items td:first-child {
  width: 46%;
  text-align: left;
}

.dealer-order-items th:not(:first-child),
.dealer-order-items td:not(:first-child) {
  width: 9%;
  white-space: nowrap;
}

.dealer-order-book {
  display: grid;
  grid-template-columns: minmax(0, max-content) auto;
  align-items: center;
  justify-content: start;
  gap: 5px 8px;
}

.dealer-order-book strong {
  min-width: 0;
  white-space: normal;
}

.dealer-order-book > span:not(.badge) {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.dealer-orders-empty {
  min-height: 180px;
}

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

.warehouse-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

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

.warehouse-card-head h3 {
  margin: 8px 0 0;
  font-size: 22px;
}

.warehouse-lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.warehouse-lines div {
  min-height: 68px;
  padding: 12px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  background: var(--soft);
}

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

.warehouse-lines strong {
  display: block;
  margin-top: 8px;
  color: var(--teal);
  font-size: 18px;
}

.warehouse-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.warehouse-card-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #b8efe6;
  border-radius: 8px;
  background: rgba(231, 250, 244, 0.72);
}

.warehouse-card-hint strong {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 15px;
}

.warehouse-card-hint span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  text-align: right;
}

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

.warehouse-pick-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.warehouse-pick-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.warehouse-pick-card-head strong,
.warehouse-pick-card-head span {
  display: block;
}

.warehouse-pick-card-head strong {
  font-size: 15px;
  line-height: 1.35;
}

.warehouse-pick-card-head span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.warehouse-pick-card-head em {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  color: #9b6b08;
  background: #fff2c8;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.warehouse-pick-section-label,
.warehouse-pick-gift-block p {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.warehouse-pick-book-list {
  display: grid;
  gap: 8px;
}

.warehouse-pick-book-line {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(320px, 1.25fr);
  align-items: center;
  min-height: 40px;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #b8efe6;
  border-radius: 8px;
  background: rgba(231, 250, 244, 0.82);
}

.warehouse-pick-book-line strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.warehouse-pick-book-line small {
  display: block;
  margin-top: 4px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.warehouse-pack-rule {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.warehouse-pack-rule label,
.warehouse-pack-rule div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.warehouse-pack-rule span,
.warehouse-pack-total {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.warehouse-pack-rule .input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}

.warehouse-pack-rule strong,
.warehouse-pack-total strong {
  color: var(--teal);
  font-size: 15px;
  font-weight: 950;
}

.warehouse-pack-rule.compact {
  grid-template-columns: minmax(110px, 1fr) auto auto;
}

.shipping-box small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.warehouse-pick-empty,
.warehouse-pick-no-gift {
  padding: 11px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfefd;
  font-size: 13px;
  font-weight: 850;
}

.warehouse-pick-gift-block {
  margin-top: 12px;
}

.warehouse-pick-gift-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #ffd0e9;
  border-radius: 8px;
  background: rgba(255, 243, 250, 0.82);
}

.warehouse-pick-gift-line strong,
.warehouse-pick-gift-line span,
.warehouse-pick-gift-line small {
  display: block;
}

.warehouse-pick-gift-line span,
.warehouse-pick-gift-line small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.warehouse-pick-gift-line b {
  color: var(--pink-dark);
  font-size: 18px;
}

.warehouse-pick-address {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.55;
}

.warehouse-pick-form-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.warehouse-pick-form-row .input {
  width: 100%;
  min-height: 40px;
}

.warehouse-pick-slip-preview {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed #b8efe6;
  border-radius: 8px;
  background: rgba(251, 254, 253, 0.88);
}

.warehouse-pick-slip-preview strong {
  color: var(--teal);
  font-size: 13px;
}

.warehouse-pick-slip-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
}

.warehouse-sync-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #b8efe6;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(231, 250, 244, 0.92), rgba(255, 255, 255, 0.95));
}

.warehouse-sync-note strong {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 13px;
}

.warehouse-sync-note span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.5;
}

.warehouse-ship-list {
  display: grid;
  gap: 14px;
}

.warehouse-ship-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.warehouse-ship-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.warehouse-ship-head strong,
.warehouse-ship-head span {
  display: block;
}

.warehouse-ship-head strong {
  font-size: 15px;
  line-height: 1.35;
}

.warehouse-ship-head span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.warehouse-ship-head em {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--teal-dark);
  background: var(--soft);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.warehouse-ship-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.warehouse-ship-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(220px, 1.4fr) minmax(220px, 1.4fr) minmax(120px, 0.8fr) auto;
  gap: 8px;
  align-items: center;
}

.warehouse-ship-form .input {
  min-width: 0;
  width: 100%;
  min-height: 40px;
}

.warehouse-ship-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.warehouse-ship-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.warehouse-ship-form > button {
  align-self: end;
  min-height: 40px;
}

.attachment-upload-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.attachment-upload-row label {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.attachment-upload-row .input {
  width: 100%;
}

.attachment-upload-row > button {
  flex: 0 0 auto;
  min-height: 40px;
}

.warehouse-shipped-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.warehouse-shipped-list-card,
.warehouse-shipped-detail-card {
  min-width: 0;
}

.warehouse-shipped-list-card .table-wrap {
  margin-top: 0;
}

.warehouse-shipped-list-card tr.selected-row td {
  background: rgba(231, 250, 244, 0.82);
}

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

.warehouse-shipped-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(170px, 1fr) minmax(160px, 0.9fr);
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.warehouse-shipped-row.selected {
  border-color: rgba(20, 185, 157, 0.34);
  background: rgba(231, 250, 244, 0.82);
}

.warehouse-shipped-row span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.warehouse-shipped-row strong,
.warehouse-shipped-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-shipped-row strong {
  font-weight: 900;
}

.warehouse-shipped-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.warehouse-shipped-kv {
  display: grid;
  grid-template-columns: minmax(90px, 0.5fr) minmax(0, 1fr);
  gap: 10px 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfefd;
}

.warehouse-shipped-kv span {
  color: var(--muted);
  font-weight: 850;
}

.warehouse-shipped-kv strong {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.warehouse-shipped-lines {
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
}

.warehouse-shipped-lines-head,
.warehouse-shipped-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(82px, auto);
  align-items: center;
  gap: 16px;
}

.warehouse-shipped-lines-head {
  padding: 10px 14px;
  background: #f7fbfa;
  color: var(--muted);
  font-size: 13px;
}

.warehouse-shipped-lines-head span,
.warehouse-shipped-line > strong {
  text-align: right;
  white-space: nowrap;
}

.warehouse-shipped-line {
  min-height: 48px;
  padding: 11px 14px;
  border-top: 1px solid var(--line-soft);
}

.warehouse-shipped-line > span,
.warehouse-shipped-gift-line .gift-cell {
  min-width: 0;
  overflow-wrap: anywhere;
}

.warehouse-shipped-line > strong {
  color: var(--teal);
  font-size: 16px;
}

.warehouse-shipped-gift-lines {
  margin-top: 14px;
}

.warehouse-shipped-gift-line .gift-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.warehouse-shipped-lines .compact-empty {
  min-height: 72px;
  border-top: 1px solid var(--line-soft);
}

.printer-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 2px;
}

.printer-card-meta span {
  padding: 7px 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  border-radius: 8px;
  background: var(--soft);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 168px;
}

.table-actions button {
  min-height: 36px;
  padding: 8px 12px;
  white-space: nowrap;
}

.compact-row-actions {
  min-width: 0;
  flex-wrap: nowrap;
  gap: 6px;
}

.compact-row-actions button {
  min-height: 34px;
  padding: 6px 10px;
}

.book-catalog-table .table-scroll table {
  min-width: 1570px;
  table-layout: fixed;
}

.book-catalog-table th,
.book-catalog-table td {
  padding: 11px 12px;
  vertical-align: middle;
}

.book-sort-button {
  width: 100%;
  gap: 7px;
  justify-content: flex-start;
  border-radius: 6px;
  text-align: left;
}

.book-sort-button:hover,
.book-sort-button:focus-visible,
.book-sort-button.is-active {
  color: var(--teal-700);
}

.book-sort-indicator {
  position: relative;
  flex: 0 0 9px;
  width: 9px;
  height: 14px;
  color: #82909e;
  opacity: 0.58;
}

.book-sort-indicator::before,
.book-sort-indicator::after {
  position: absolute;
  left: 1px;
  width: 0;
  height: 0;
  border-right: 3.5px solid transparent;
  border-left: 3.5px solid transparent;
  content: "";
}

.book-sort-indicator::before {
  top: 1px;
  border-bottom: 5px solid currentColor;
}

.book-sort-indicator::after {
  bottom: 1px;
  border-top: 5px solid currentColor;
}

.book-sort-button.is-active .book-sort-indicator {
  color: var(--teal-700);
  opacity: 1;
}

.book-sort-button.is-asc .book-sort-indicator::after,
.book-sort-button.is-desc .book-sort-indicator::before {
  opacity: 0.2;
}

.book-catalog-table th:nth-child(1),
.book-catalog-table td:nth-child(1) {
  width: 175px;
}

.book-catalog-table th:nth-child(2),
.book-catalog-table td:nth-child(2) {
  width: 285px;
}

.book-catalog-table th:nth-child(3),
.book-catalog-table td:nth-child(3) {
  width: 165px;
}

.book-catalog-table th:nth-child(4),
.book-catalog-table td:nth-child(4) {
  width: 76px;
}

.book-catalog-table th:nth-child(5),
.book-catalog-table td:nth-child(5),
.book-catalog-table th:nth-child(6),
.book-catalog-table td:nth-child(6) {
  width: 82px;
}

.book-catalog-table th:nth-child(7),
.book-catalog-table td:nth-child(7) {
  width: 82px;
}

.book-catalog-table th:nth-child(8),
.book-catalog-table td:nth-child(8) {
  width: 90px;
}

.book-catalog-table th:nth-child(9),
.book-catalog-table td:nth-child(9) {
  width: 100px;
}

.book-catalog-table th:nth-last-child(2),
.book-catalog-table td:nth-last-child(2) {
  width: 80px;
}

.book-catalog-table th:nth-last-child(3),
.book-cost-cell {
  width: 90px;
}

.book-catalog-table th:last-child,
.book-catalog-table td:last-child {
  width: 250px;
}

.book-title-cell {
  min-width: 0;
  white-space: normal;
}

.book-sku-cell {
  max-width: 175px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-title-cell strong {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.book-title-cell .muted {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-table-actions {
  min-width: 0;
  flex-wrap: nowrap;
  gap: 6px;
}

.book-table-actions button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.order-band.band-1 td {
  background: #f8fffc;
}

.order-start td {
  border-top: 2px solid #d7f3ec;
}

.inline-status {
  display: inline-flex;
  margin-left: 8px;
  vertical-align: middle;
}

.link-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--teal-dark);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--pink);
  text-decoration: underline;
}

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

.input,
.select-like {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(220, 227, 234, 0.16);
}

.toolbar .input,
.toolbar .select-like {
  min-height: 42px;
  border-color: #d8e3ec;
  font-weight: 900;
}

.input:focus,
.select-like:focus {
  border-color: var(--mint);
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 201, 167, 0.12);
}

.date-input {
  width: 184px;
}

.compact-input {
  max-width: 150px;
}

.quick-date {
  min-height: 38px;
  padding: 0 12px;
  color: var(--teal);
  background: rgba(231, 250, 244, 0.92);
  border-color: #c9f2eb;
  box-shadow: none;
  font-size: 13px;
}

.quick-date:hover {
  border-color: var(--mint);
  background: #dcfaf3;
}

.date-range-trigger {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  max-width: 430px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.96);
}

.date-range-trigger span {
  color: var(--muted);
  font-weight: 900;
}

.date-range-trigger strong {
  overflow: hidden;
  max-width: 300px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-picker-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(5px);
}

.date-picker-panel {
  width: min(980px, calc(100vw - 52px));
  max-height: calc(100vh - 52px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 70px rgba(23, 32, 43, 0.18);
}

.date-picker-head,
.date-picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
}

.date-picker-head {
  border-bottom: 1px solid var(--line-soft);
}

.date-picker-head p,
.date-picker-head h3 {
  margin: 0;
}

.date-picker-head p {
  color: #ff5b73;
  font-weight: 900;
}

.date-picker-head h3 {
  margin-top: 6px;
  font-size: 22px;
}

.date-picker-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 18px 22px 6px;
}

.date-picker-presets button {
  min-width: 76px;
  color: #596778;
  background: #fbfdff;
}

.calendar-nav {
  display: grid;
  grid-template-columns: 48px 48px 1fr 48px 48px;
  gap: 8px;
  align-items: center;
  padding: 8px 22px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.calendar-nav button {
  min-height: 42px;
  padding: 0;
  color: var(--muted);
  font-size: 26px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  padding: 24px 28px 28px;
}

.calendar-month h4 {
  margin: 0 0 18px;
  text-align: center;
  font-size: 24px;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
  display: grid;
  place-items: center;
  height: 34px;
  color: var(--ink);
  font-weight: 900;
}

.calendar-days button {
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  font-size: 18px;
  font-weight: 900;
}

.calendar-days button.outside {
  color: #9aa5b2;
  background: rgba(247, 249, 252, 0.72);
}

.calendar-days button.in-range {
  background: #edf4ff;
}

.calendar-days button.selected {
  color: #fff;
  background: #3f6df6;
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(63, 109, 246, 0.22);
}

.date-picker-foot {
  border-top: 1px solid var(--line-soft);
}

.date-picker-foot strong {
  color: var(--muted);
}

.date-picker-foot > div {
  display: flex;
  gap: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.72);
}

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

th {
  color: var(--muted);
  background: #f8fcfb;
  font-size: 13px;
  font-weight: 900;
}

tbody tr {
  transition: background 0.16s ease;
}

tbody tr:hover {
  background: rgba(231, 250, 244, 0.45);
}

tbody tr.unread-row {
  background: rgba(255, 243, 250, 0.88);
}

tbody tr.unread-row:hover {
  background: rgba(255, 231, 244, 0.92);
}

.money {
  font-weight: 900;
  color: var(--teal);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--soft);
  color: var(--teal);
  font-weight: 800;
}

.badge.warn {
  color: #9a6500;
  background: #fff3ce;
}

.badge.danger {
  color: var(--pink-dark);
  background: var(--prototype-pink-soft);
}

.badge.pink {
  color: var(--pink-dark);
  background: var(--prototype-pink-soft);
}

.gift-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.gift-thumb {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.gift-thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  background: linear-gradient(135deg, #e7faf4, #fff3fa);
  font-weight: 900;
}

.ledger-details {
  min-width: 220px;
}

.ledger-details summary {
  width: fit-content;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--soft);
  color: var(--teal);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.ledger-details summary::-webkit-details-marker {
  display: none;
}

.ledger-detail-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  background: rgba(231, 250, 244, 0.48);
}

.ledger-detail-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) 92px auto;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.ledger-detail-row span:first-child {
  color: var(--ink);
}

.ledger-filter-card {
  position: relative;
  z-index: 8;
  display: grid;
  gap: 14px;
  overflow: visible;
}

.ledger-main-toolbar {
  position: relative;
  z-index: 3;
  gap: 10px;
}

.ledger-main-toolbar .ledger-keyword-input {
  flex: 1 1 240px;
  min-width: 180px;
  max-width: 250px;
}

.ledger-main-toolbar .js-ledger-dealer {
  flex: 0 1 180px;
  min-width: 140px;
  max-width: 170px;
}

.ledger-main-toolbar .date-range-trigger {
  flex: 0 1 290px;
  min-width: 220px;
  max-width: 290px;
}

.ledger-more-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-dark);
  white-space: nowrap;
}

.ledger-more-filter-button span {
  color: var(--muted);
  font-size: 11px;
}

.ledger-more-filter-button.active {
  border-color: rgba(16, 185, 160, 0.38);
  background: rgba(231, 250, 244, 0.92);
}

.ledger-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.ledger-quick-date-group {
  flex-wrap: nowrap;
}

.ledger-entry-menu,
.ledger-type-picker {
  position: relative;
}

.ledger-entry-menu {
  z-index: 20;
}

.ledger-entry-menu > summary,
.ledger-type-picker > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.ledger-entry-menu > summary::-webkit-details-marker,
.ledger-type-picker > summary::-webkit-details-marker {
  display: none;
}

.ledger-entry-menu > summary.primary {
  min-height: 40px;
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
}

.ledger-type-picker > summary > span {
  color: var(--muted);
  font-size: 11px;
}

.ledger-entry-menu > div {
  position: absolute;
  z-index: 18;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 8px;
  width: 290px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(22, 34, 49, 0.14);
}

.ledger-entry-menu > div button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
}

.ledger-entry-menu > div button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.ledger-advanced-filters {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(140px, 0.75fr) minmax(210px, 0.9fr) minmax(170px, 0.9fr) auto;
  gap: 12px;
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid rgba(201, 242, 235, 0.9);
}

.ledger-advanced-filters[hidden] {
  display: none;
}

.ledger-filter-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.ledger-filter-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.ledger-filter-field .input,
.ledger-type-picker > summary {
  width: 100%;
  min-height: 42px;
}

.ledger-direction-segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.ledger-direction-segment button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.ledger-direction-segment button.active {
  color: var(--teal-dark);
  background: var(--soft);
}

.ledger-type-options {
  position: absolute;
  z-index: 16;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  gap: 4px;
  width: max(100%, 250px);
  max-height: 290px;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(22, 34, 49, 0.14);
}

.ledger-type-options label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.ledger-type-options label:hover {
  background: var(--soft);
}

.ledger-type-options input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.ledger-reset-advanced {
  min-height: 42px;
  white-space: nowrap;
}

.ledger-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin: -2px 0 18px;
  padding: 2px;
}

.js-ledger-stats .stat strong {
  font-size: clamp(23px, 2vw, 32px);
  white-space: nowrap;
}

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

.ledger-transfer-stat strong,
.ledger-transfer-amount {
  color: #8a650a;
}

.ledger-filter-result {
  display: grid;
  gap: 2px;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}

.ledger-filter-result strong {
  color: var(--ink);
  font-size: 14px;
}

.ledger-filter-result span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ledger-filter-chips {
  display: flex;
  flex: 1 1 520px;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ledger-filter-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-color: #c9f2eb;
  color: var(--teal-dark);
  background: rgba(231, 250, 244, 0.82);
  box-shadow: none;
  font-size: 12px;
  font-weight: 900;
}

.ledger-filter-chip.fixed {
  cursor: default;
}

.ledger-filter-chip span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.ledger-clear-filters {
  min-height: 32px;
  padding: 0 8px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}

.ledger-shell {
  display: grid;
  gap: 14px;
}

.ledger-shell-head {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  padding: 6px 2px 0;
}

.ledger-shell-head h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.ledger-shell-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.ledger-shell-actions {
  display: flex;
  gap: 8px;
}

.ledger-shell-actions button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.88);
}

.ledger-board {
  display: grid;
  gap: 14px;
}

.ledger-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--prototype-surface);
}

.ledger-book-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--prototype-surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ledger-book-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(520px, 1.4fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  background: linear-gradient(90deg, rgba(231, 250, 244, 0.72), rgba(255, 255, 255, 0.86));
  border-bottom: 1px solid var(--line);
}

.ledger-book-head h3 {
  margin: 0;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.ledger-book-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.ledger-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.ledger-summary-strip span {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.ledger-summary-strip em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.ledger-summary-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.1;
}

.ledger-book-toggle {
  justify-self: end;
  min-width: 96px;
}

.ledger-book-card.collapsed .ledger-book-head {
  border-bottom: 0;
}

.ledger-entry-list {
  display: grid;
}

.ledger-entry-group {
  min-width: 0;
}

.ledger-entry-group + .ledger-entry-group {
  border-top: 10px solid #f1f6f5;
}

.ledger-entry-group-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.ledger-entry-group.expense .ledger-entry-group-head {
  background: rgba(255, 245, 250, 0.78);
}

.ledger-entry-group.income .ledger-entry-group-head {
  background: rgba(231, 250, 244, 0.72);
}

.ledger-entry-group-head h4 {
  margin: 0;
  font-size: 15px;
}

.ledger-entry-group-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ledger-entry-group-body {
  display: grid;
}

.ledger-entry {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 190px;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.ledger-entry:last-child {
  border-bottom: 0;
}

.ledger-entry.income {
  background: rgba(231, 250, 244, 0.42);
}

.ledger-entry.transfer {
  background: rgba(255, 250, 240, 0.62);
}

.ledger-entry-index {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted);
  background: #f1f6f5;
  font-weight: 900;
}

.ledger-entry-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ledger-entry-title strong {
  font-size: 16px;
}

.ledger-entry-title > span:last-child {
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ledger-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ledger-entry-meta span {
  padding: 5px 8px;
  border-radius: 7px;
  color: #596779;
  background: #f4f7f9;
  font-size: 12px;
  font-weight: 850;
}

.ledger-entry-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ledger-entry-amount {
  text-align: right;
}

.ledger-entry-amount span {
  color: var(--muted);
  font-weight: 900;
}

.ledger-entry-amount strong {
  display: block;
  margin-top: 4px;
  color: var(--pink);
  font-size: 22px;
  line-height: 1.1;
}

.ledger-entry.income .ledger-entry-amount strong {
  color: var(--teal);
}

.ledger-entry.transfer .ledger-entry-amount strong {
  color: #8a650a;
}

.ledger-entry-amount em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.chart {
  display: flex;
  align-items: end;
  gap: 18px;
  height: 260px;
  padding: 24px 22px 18px;
}

.bar {
  flex: 1;
  min-width: 28px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--pink), var(--mint));
}

.trend-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 0;
}

.trend-overview div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(248, 252, 251, 0.86);
}

.trend-overview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.trend-overview strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-chart {
  display: flex;
  align-items: end;
  gap: 14px;
  min-height: 260px;
  padding: 28px 16px 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to top, rgba(220, 227, 234, 0.52) 1px, transparent 1px) 0 46px / 100% 58px,
    rgba(255, 255, 255, 0.35);
}

.trend-point {
  flex: 1 0 64px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: end;
  min-width: 64px;
  height: 242px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.trend-value {
  align-self: start;
  display: grid;
  gap: 3px;
  min-height: 42px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
}

.trend-value strong,
.trend-value span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-value span {
  color: var(--muted);
  font-size: 12px;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 16px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

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

.trend-legend i {
  display: inline-block;
  width: 18px;
  height: 8px;
  border-radius: 999px;
  background: #b5c0cd;
}

.trend-legend i.current {
  background: var(--teal);
}

.trend-control-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 16px 8px;
  padding: 12px;
  border: 1px solid rgba(201, 242, 235, 0.9);
  border-radius: 8px;
  background: rgba(231, 250, 244, 0.62);
}

.trend-control-copy {
  display: grid;
  gap: 3px;
  min-width: 180px;
}

.trend-control-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.trend-control-copy strong {
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 950;
}

.trend-control-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.trend-granularity-btn {
  min-height: 36px;
  padding: 0 14px;
  border-color: #c9f2eb;
  background: rgba(255, 255, 255, 0.92);
  color: var(--teal-dark);
  font-size: 13px;
  box-shadow: none;
}

.trend-granularity-btn.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--mint), var(--teal));
  color: #fff;
  box-shadow: 0 12px 24px rgba(16, 185, 160, 0.2);
}

.trend-yoy-check {
  min-height: 36px;
  background: rgba(255, 255, 255, 0.92);
}

.trend-yoy-check.disabled {
  opacity: 0.54;
}

.trend-bar-stack {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.trend-bar {
  position: relative;
  z-index: 2;
  width: 48%;
  min-height: 22px;
  margin: 0 auto;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #17d4bc, #087f70);
  box-shadow: 0 16px 30px rgba(8, 127, 112, 0.16);
}

.trend-compare-bar {
  position: absolute;
  right: 12%;
  bottom: 0;
  z-index: 1;
  width: 48%;
  min-height: 18px;
  border-radius: 8px 8px 0 0;
  background: #c6cfd8;
}

.trend-label {
  padding-top: 8px;
}

.mini-table {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.trend-detail-table .table-scroll {
  max-height: 320px;
}

.table-sort-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.table-sort-button:hover,
.table-sort-button:focus-visible {
  color: var(--teal);
  outline: none;
}

.table-sort-button:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.mini-table th,
.mini-table td {
  padding: 10px 12px;
  font-size: 13px;
}

.explain-list {
  display: grid;
  gap: 12px;
  padding: 4px 2px 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.7;
}

.explain-list p {
  margin: 0;
}

.explain-list strong {
  color: var(--teal);
}

.section-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 0;
  padding: 16px 18px;
  border: 1px solid rgba(201, 242, 235, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(231, 250, 244, 0.92), rgba(255, 243, 250, 0.58)),
    rgba(255, 255, 255, 0.76);
}

.section-divider h3,
.section-divider p {
  margin: 0;
}

.section-divider h3 {
  font-size: 18px;
}

.section-divider p {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.section-divider.compact {
  margin: 16px 0;
  padding: 14px 16px;
}

.section-divider.compact h3 {
  font-size: 16px;
}

.analysis-note-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.analysis-note-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

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

.analysis-note-grid span {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(248, 252, 251, 0.86);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.analysis-note-grid strong {
  color: var(--teal);
}

.analysis-breakdown-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.analysis-breakdown-card-head > div {
  min-width: 0;
}

.analysis-breakdown-card-head .input {
  flex: 0 1 320px;
  width: min(320px, 42vw);
  max-width: 360px;
}

.inline-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 14px;
}

.inline-filter label {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.comparison-list {
  display: grid;
  gap: 16px;
  padding: 4px 2px 14px;
}

.metric-comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 2px 2px 14px;
}

.metric-comparison {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(248, 252, 251, 0.86);
}

.metric-comparison-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.metric-comparison-title strong {
  color: var(--ink);
  font-size: 16px;
}

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

.metric-bar-row {
  display: grid;
  grid-template-columns: minmax(72px, 88px) minmax(90px, 1fr) max-content;
  gap: 12px;
  align-items: center;
  min-height: 34px;
}

.metric-dealer {
  overflow: hidden;
  color: var(--ink);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.metric-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--mint));
}

.metric-bar-row strong {
  color: var(--teal);
  overflow: hidden;
  min-width: 58px;
  text-align: right;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(96px, 130px) minmax(240px, 1fr);
  gap: 18px;
  align-items: center;
}

.comparison-row > strong {
  font-size: 16px;
}

.comparison-lines {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.comparison-main {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.comparison-main span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--pink));
}

.comparison-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.share-meter {
  width: 100%;
  min-width: 120px;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.share-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--mint));
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(22, 34, 49, 0.34);
  backdrop-filter: blur(8px);
}

.modal-panel {
  width: min(1120px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(22, 34, 49, 0.22);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 4px 0 0;
  font-size: 24px;
}

.modal-foot {
  border-top: 1px solid var(--line);
  background: #fbfefd;
}

.inline-foot {
  margin-top: 12px;
  padding: 0;
  border-top: 0;
  background: transparent;
}

.settings-preview {
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(224, 250, 245, 0.75), #fff 58%, rgba(255, 238, 247, 0.76));
}

.settings-form-grid {
  padding-top: 2px;
}

.settings-preview-logo {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(224, 250, 245, 0.86);
  color: var(--teal-dark);
  font-weight: 1000;
}

.settings-preview small,
.settings-preview p,
.settings-preview em {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  line-height: 1.7;
}

.settings-preview span {
  color: var(--text);
  font-size: 28px;
  font-weight: 1000;
}

.settings-preview strong {
  color: var(--teal);
  font-size: 20px;
}

.settings-preview b {
  color: var(--teal-dark);
}

.settings-workbench {
  align-items: start;
}

.js-settings-stats .stat strong {
  font-size: 22px;
  line-height: 1.25;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 24px;
}

.recovery-overview {
  margin-top: 18px;
}

.recovery-disclosure,
.methodology-disclosure,
.financial-disclosure {
  overflow: hidden;
  border: 1px solid rgba(201, 242, 235, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 36px rgba(8, 127, 112, 0.05);
}

.recovery-disclosure > summary,
.methodology-disclosure > summary,
.financial-disclosure > summary {
  display: grid;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 16px 18px;
  list-style: none;
  cursor: pointer;
  background:
    linear-gradient(90deg, rgba(231, 250, 244, 0.78), rgba(255, 243, 250, 0.42)),
    rgba(255, 255, 255, 0.9);
}

.recovery-disclosure > summary {
  grid-template-columns: minmax(280px, 1fr) minmax(190px, auto) minmax(88px, auto) auto;
}

.recovery-disclosure summary::-webkit-details-marker,
.methodology-disclosure summary::-webkit-details-marker,
.financial-disclosure summary::-webkit-details-marker {
  display: none;
}

.recovery-disclosure > summary:focus-visible,
.methodology-disclosure > summary:focus-visible,
.financial-disclosure > summary:focus-visible {
  outline: 3px solid rgba(16, 185, 160, 0.2);
  outline-offset: -3px;
}

.recovery-disclosure h3 {
  margin: 3px 0 0;
  font-size: 18px;
}

.recovery-disclosure summary p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.recovery-eyebrow,
.financial-eyebrow,
.book-cost-kicker {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.recovery-summary-result,
.recovery-summary-rate,
.financial-summary-result,
.financial-summary-rate {
  display: grid;
  gap: 3px;
}

.recovery-summary-result span,
.recovery-summary-rate span,
.financial-summary-result span,
.financial-summary-rate span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recovery-summary-result strong,
.financial-summary-result strong {
  color: var(--teal-dark);
  font-size: 22px;
  line-height: 1.1;
  white-space: nowrap;
}

.recovery-summary-rate strong,
.financial-summary-rate strong {
  font-size: 18px;
  white-space: nowrap;
}

.disclosure-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.disclosure-label::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

details[open] > summary .disclosure-label::after {
  transform: translateY(2px) rotate(225deg);
}

.recovery-disclosure-body,
.financial-disclosure-body {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
}

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

.recovery-detail-grid > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(247, 253, 251, 0.82);
}

.recovery-detail-grid span,
.recovery-detail-grid em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.4;
}

.recovery-detail-grid strong {
  display: block;
  margin: 5px 0;
  font-size: 19px;
}

.recovery-equation {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(231, 250, 244, 0.54);
}

.recovery-equation strong {
  color: var(--teal-dark);
}

.recovery-equation span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.recovery-note {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.project-recovery-section {
  margin-top: 12px;
}

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

.methodology-disclosure {
  margin-top: 18px;
}

.methodology-disclosure > summary {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-block: 13px;
}

.methodology-disclosure summary > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.methodology-disclosure summary strong {
  font-size: 15px;
}

.methodology-disclosure summary span:not(.disclosure-label) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.methodology-disclosure .analysis-note-grid {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}

.book-cost-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 24px;
}

.book-cost-summary-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 253, 251, 0.88);
}

.book-cost-summary-panel.cost-focus {
  border-color: rgba(0, 137, 124, 0.22);
  background: rgba(231, 250, 244, 0.84);
}

.book-cost-summary-panel.profit-focus {
  border-color: rgba(244, 90, 181, 0.16);
  background: rgba(255, 246, 251, 0.84);
}

.book-cost-summary-panel > strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.book-cost-summary-panel > strong small {
  color: var(--muted);
  font-size: 14px;
}

.book-cost-summary-panel > em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.book-cost-summary-panel dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.book-cost-summary-panel dl:has(> div:only-child) {
  grid-template-columns: 1fr;
}

.book-cost-summary-panel dl div {
  min-width: 0;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}

.book-cost-summary-panel dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.book-cost-summary-panel dd {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.modal-financial-disclosure {
  margin: 0 24px 12px;
}

.modal-financial-disclosure > summary {
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  padding: 14px 16px;
}

.modal-financial-disclosure summary > div:first-child {
  display: grid;
  gap: 3px;
}

.modal-financial-disclosure summary > div:first-child > strong {
  font-size: 16px;
}

.modal-financial-disclosure summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.profit-equation {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(247, 253, 251, 0.9);
}

.profit-equation strong {
  color: var(--teal-dark);
  font-size: 17px;
}

.profit-equation span {
  color: var(--muted);
  font-weight: 800;
}

.book-profit-calculation .table-scroll table {
  min-width: 820px;
}

.book-profit-calculation td:nth-child(3) {
  font-weight: 900;
  white-space: nowrap;
}

.profit-income {
  color: var(--teal);
}

.profit-cost {
  color: #b26a16;
}

.book-profit-total-row td {
  border-top: 2px solid var(--line);
  background: rgba(247, 253, 251, 0.82);
}

.detail-box {
  min-height: 86px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.detail-box.wide {
  grid-column: span 2;
}

.detail-box.wide strong {
  font-size: 18px;
  line-height: 1.5;
}

.detail-box span {
  color: var(--muted);
  font-weight: 800;
}

.detail-box strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.detail-box.locked {
  background: #f8fafc;
}

.detail-box.locked strong {
  color: var(--muted);
}

.book-workbench-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.book-workbench-actions button {
  min-height: 106px;
  padding: 18px;
  text-align: left;
  white-space: normal;
}

.book-workbench-actions strong,
.book-workbench-actions span {
  display: block;
}

.book-workbench-actions strong {
  font-size: 18px;
  line-height: 1.35;
}

.book-workbench-actions span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.book-workbench-actions .primary span {
  color: rgba(255, 255, 255, 0.86);
}

.warehouse-modal .modal-head {
  background:
    linear-gradient(90deg, rgba(16, 201, 167, 0.1), transparent 58%),
    #fff;
}

.dealer-modal .modal-head {
  background:
    linear-gradient(90deg, rgba(244, 90, 181, 0.08), transparent 56%),
    #fff;
}

.printer-modal .modal-head {
  background:
    linear-gradient(90deg, rgba(16, 201, 167, 0.1), rgba(244, 90, 181, 0.06) 66%, transparent),
    #fff;
}

.printer-card {
  background:
    linear-gradient(180deg, rgba(16, 201, 167, 0.04), transparent 42%),
    rgba(255, 255, 255, 0.94);
}

.warehouse-step-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid #b8efe6;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(231, 250, 244, 0.92), rgba(255, 255, 255, 0.92));
}

.warehouse-step-panel span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.warehouse-step-panel strong {
  color: var(--teal);
  font-size: 20px;
}

.warehouse-step-panel p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.6;
  text-align: right;
}

.warehouse-step-panel.is-danger {
  border-color: #ffd2e9;
  background: linear-gradient(90deg, rgba(255, 241, 248, 0.92), rgba(255, 255, 255, 0.92));
}

.warehouse-step-panel.is-danger strong {
  color: var(--pink);
}

.shipping-info-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 12px;
}

.shipping-info-grid.dealer-shipping {
  grid-template-columns: 2fr 1fr 1fr;
}

.shipping-box {
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
}

.shipping-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.shipping-box strong {
  font-size: 16px;
}

.shipping-box.editable {
  background: linear-gradient(180deg, rgba(231, 250, 244, 0.72), #fff);
}

.shipping-box .input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
}

.packing-slip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px dashed #b8efe6;
  border-radius: 8px;
  background: rgba(231, 250, 244, 0.64);
}

.packing-slip div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(201, 242, 235, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.packing-slip div.wide {
  grid-column: span 2;
}

.packing-slip span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.packing-slip strong {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exception-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.exception-editor textarea {
  min-height: 86px;
  resize: vertical;
}

.file-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-download-link {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.supplier-payable-attachment {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 128px;
}

.supplier-payable-attachment .muted {
  max-width: 190px;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.file-selection-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid rgba(23, 170, 151, 0.24);
  border-radius: 10px;
  background: rgba(229, 250, 246, 0.72);
  color: var(--text);
  font-size: 13px;
}

.file-selection-feedback button {
  flex: 0 0 auto;
  border-color: rgba(213, 73, 116, 0.24);
  color: #b52f5d;
  background: #fff;
}

.settlement-workspace,
.settlement-history-strip {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(37, 55, 72, 0.07);
  overflow: hidden;
}

.settlement-workspace-head,
.settlement-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
}

.settlement-workspace-head h3,
.settlement-section-heading h3 {
  margin: 3px 0 5px;
  font-size: 24px;
}

.settlement-workspace-head p,
.settlement-section-heading p {
  margin: 0;
  color: var(--muted);
}

.settlement-history-year {
  display: grid;
  gap: 6px;
  min-width: 132px;
}

.settlement-history-year > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settlement-history-year .input {
  min-width: 132px;
}

.settlement-kicker {
  color: var(--mint-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.settlement-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settlement-toolbar .input {
  min-width: 150px;
}

.settlement-focus-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  margin: 0 24px 24px;
  border: 1px solid rgba(21, 171, 148, 0.23);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(237, 252, 248, 0.9), rgba(255, 248, 252, 0.72));
  overflow: hidden;
}

.settlement-focus-main {
  padding: 24px;
}

.settlement-focus-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settlement-focus-title span,
.settlement-focus-amount span,
.settlement-focus-metrics span,
.settlement-next-action > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settlement-focus-title h2 {
  margin: 4px 0 0;
  font-size: clamp(25px, 2.4vw, 34px);
}

.settlement-focus-amount {
  margin: 28px 0 22px;
}

.settlement-focus-amount strong {
  display: block;
  margin: 5px 0 2px;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.settlement-focus-amount em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.settlement-focus-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.settlement-focus-metrics > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(100, 116, 139, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.settlement-focus-metrics strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settlement-next-action {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  border-left: 1px solid rgba(21, 171, 148, 0.18);
  background: rgba(255, 255, 255, 0.68);
}

.settlement-next-action p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.settlement-focus-flow {
  grid-column: 1 / -1;
  padding: 15px 20px;
  border-top: 1px solid rgba(21, 171, 148, 0.16);
  background: rgba(255, 255, 255, 0.82);
}

.settlement-focus-flow .settlement-flow {
  margin: 0;
}

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

.settlement-history-strip {
  padding-bottom: 20px;
}

.settlement-period-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 0 20px;
}

.settlement-period-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 10px;
  min-width: 0;
  padding: 15px;
  text-align: left;
  border-color: var(--line);
  background: #fff;
}

.settlement-period-card:hover,
.settlement-period-card.active {
  border-color: rgba(21, 171, 148, 0.5);
  background: rgba(235, 251, 247, 0.88);
}

.settlement-period-card > span {
  font-weight: 800;
}

.settlement-period-card > strong {
  grid-column: 1 / -1;
  font-size: 20px;
}

.settlement-period-card > em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

@media (max-width: 980px) {
  .settlement-focus-card { grid-template-columns: 1fr; }
  .settlement-next-action { border-top: 1px solid rgba(21, 171, 148, 0.18); border-left: 0; }
  .settlement-focus-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .settlement-workspace-head,
  .settlement-section-heading { align-items: stretch; flex-direction: column; padding: 18px; }
  .settlement-toolbar { align-items: stretch; flex-wrap: wrap; }
  .settlement-toolbar .input { flex: 1 1 170px; }
  .settlement-focus-card { margin: 0 12px 16px; }
  .settlement-focus-main,
  .settlement-next-action { padding: 18px; }
  .settlement-focus-metrics { grid-template-columns: 1fr 1fr; }
  .settlement-period-list { display: flex; overflow-x: auto; padding: 0 14px 4px; }
  .settlement-period-card { flex: 0 0 180px; }
  .settlement-history-year,
  .settlement-history-year .input { width: 100%; }
}

.quote-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  background: var(--soft);
}

.action-drawer-card {
  padding: 0;
  overflow: hidden;
}

.action-drawer-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
}

.action-drawer-card > summary::-webkit-details-marker {
  display: none;
}

.action-drawer-card > summary h3 {
  margin: 0;
  font-size: 18px;
}

.action-drawer-card > summary .section-subtitle {
  margin: 6px 0 0;
}

.drawer-toggle-text {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal-dark);
  font-weight: 900;
  text-align: center;
}

.action-drawer-card[open] .drawer-toggle-text {
  background: var(--soft);
}

.action-drawer-card[open] .drawer-toggle-text::before {
  content: "收起";
}

.action-drawer-card[open] .drawer-toggle-text {
  font-size: 0;
}

.action-drawer-card[open] .drawer-toggle-text::before {
  font-size: 14px;
}

.action-drawer-body {
  padding: 0 24px 24px;
}

.quote-form label,
.quote-form .material-field {
  display: grid;
  gap: 8px;
}

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

.quote-form label span,
.quote-form .material-field > span {
  color: var(--muted);
  font-weight: 900;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.inbound-diff-card {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 78px;
  padding: 12px 14px;
  border: 1px solid #b8efe6;
  border-radius: 8px;
  background: #f6fffc;
}

.inbound-diff-card span {
  color: var(--muted);
  font-weight: 900;
}

.inbound-diff-card strong {
  color: var(--teal-dark);
  font-size: 18px;
}

.inbound-diff-card em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.quote-form textarea.input {
  min-height: 98px;
  resize: vertical;
  line-height: 1.6;
}

.material-form {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

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

.raw-material-purchase-modal .modal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 18px 24px;
  background: #fff;
}

.raw-material-purchase-modal .modal-head h3 {
  margin-top: 0;
}

.raw-material-purchase-modal .modal-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.raw-material-purchase-modal .modal-foot {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 16px 24px;
}

.raw-material-purchase-content {
  padding: 0 28px 8px;
}

.purchase-form-section {
  padding: 20px 0 22px;
  border-bottom: 1px solid var(--line-soft);
}

.purchase-form-section-last {
  border-bottom: 0;
}

.purchase-form-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.purchase-form-heading h4,
.purchase-form-heading p {
  margin: 0;
}

.purchase-form-heading h4 {
  font-size: 17px;
}

.purchase-form-heading p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.material-paper-grid,
.material-purchase-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px 16px;
}

.paper-category-field {
  grid-column: 1 / 4;
  grid-row: 1;
}

.paper-form-field {
  grid-column: 4 / 7;
  grid-row: 1;
}

.paper-brand-field {
  grid-column: 1 / 3;
  grid-row: 2;
}

.paper-spec-field {
  grid-column: 3 / 5;
  grid-row: 2;
}

.paper-grammage-field {
  grid-column: 5 / 7;
  grid-row: 2;
}

.material-paper-grid .material-identity-preview {
  grid-column: 1 / -1;
  grid-row: 3;
}

.purchase-qty-field {
  grid-column: 1 / 3;
  grid-row: 1;
}

.purchase-amount-field {
  grid-column: 3 / 5;
  grid-row: 1;
}

.purchase-date-field {
  grid-column: 5 / 7;
  grid-row: 1;
}

.purchase-conversion {
  grid-column: 1 / -1;
  grid-row: 2;
}

.purchase-supplier-field {
  grid-column: 1 / 4;
  grid-row: 3;
}

.purchase-paid-field {
  grid-column: 4 / 7;
  grid-row: 3;
}

.purchase-location-field {
  grid-column: 1 / 4;
  grid-row: 4;
}

.purchase-alert-field {
  grid-column: 4 / 7;
  grid-row: 4;
}

.purchase-note-field {
  grid-column: 1 / -1;
  grid-row: 5;
}

.material-form > *,
.material-form label,
.material-form .material-field,
.material-form .input,
.material-form .input-with-unit,
.material-form .paper-category-choice {
  min-width: 0;
  max-width: 100%;
}

.material-form .input,
.material-form textarea,
.material-form select {
  width: 100%;
}

.material-form > .wide {
  grid-column: 1 / -1;
}

.material-form label small {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.material-spec-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.material-spec-label > span {
  flex: 0 0 auto;
}

.material-form label .material-spec-label small {
  min-height: 0;
  font-weight: 750;
  white-space: nowrap;
}

.material-form label small.new-record {
  color: var(--teal);
}

.paper-category-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 44px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.paper-category-choice button {
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.paper-category-choice button.active {
  background: var(--teal);
  color: #fff;
}

.paper-category-choice button:focus-visible {
  outline: 3px solid rgba(16, 201, 167, 0.2);
  outline-offset: 1px;
}

.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(220, 227, 234, 0.16);
}

.input-with-unit:focus-within {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(16, 201, 167, 0.12);
}

.input-with-unit .input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.input-with-unit > span,
.input-with-unit > select {
  display: grid;
  place-items: center;
  min-width: 58px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid var(--line);
  background: #f6faf9;
  color: var(--teal);
  font: inherit;
  font-weight: 900;
}

.input-with-unit > select {
  width: auto;
  cursor: pointer;
}

.material-conversion-preview {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--teal);
  background: #f8fbfa;
}

.material-conversion-preview > span {
  color: var(--muted);
  font-weight: 900;
}

.material-conversion-preview strong {
  font-size: 15px;
}

.material-conversion-preview em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.45;
}

.material-conversion-preview.danger,
.material-conversion-preview.danger em {
  color: #a32964;
}

.material-identity-preview {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 5px 18px;
  align-items: center;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f4fbf8;
}

.material-identity-preview > span {
  grid-row: 1 / span 2;
  color: var(--muted);
  font-weight: 900;
}

.material-identity-preview strong {
  color: var(--teal-dark);
  font-size: 15px;
}

.material-identity-preview em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.45;
}

.material-form .js-material-new-brand[hidden],
.material-form .js-material-new-spec[hidden],
.material-form .js-material-new-supplier[hidden] {
  display: none;
}

.raw-material-purchase-modal .purchase-note-field textarea {
  min-height: 72px;
}

@media (max-width: 840px) {
  .raw-material-purchase-content {
    padding-inline: 16px;
  }

  .purchase-form-heading {
    display: grid;
    gap: 5px;
  }

  .material-paper-grid,
  .material-purchase-grid {
    grid-template-columns: 1fr;
  }

  .material-paper-grid > *,
  .material-purchase-grid > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .material-conversion-preview,
  .material-identity-preview {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .material-identity-preview > span {
    grid-row: auto;
  }
}

.raw-material-category-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.material-action-stack {
  display: grid;
  gap: 18px;
  padding: 16px;
}

.material-action-panel {
  display: grid;
  gap: 12px;
}

.internal-order-lines {
  display: grid;
  gap: 10px;
}

.internal-order-line {
  display: grid;
  grid-template-columns: 34px minmax(220px, 1fr) minmax(130px, 0.36fr) minmax(130px, 0.36fr);
  gap: 10px;
  align-items: center;
}

.internal-order-line strong,
.internal-order-line span {
  color: var(--muted);
  font-weight: 900;
}

.internal-order-line-head {
  padding: 0 2px;
}

.internal-order-line-head span {
  font-size: 13px;
}

.internal-order-preview {
  border: 1px solid rgba(16, 201, 167, 0.22);
  border-radius: 8px;
  background: rgba(16, 201, 167, 0.08);
  color: var(--muted);
  font-weight: 800;
  line-height: 1.7;
  padding: 12px 14px;
}

.internal-order-preview strong {
  color: var(--teal-700);
}

.internal-order-preview span {
  color: var(--pink-700);
}

.sales-order-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 18px;
}

.sales-order-empty {
  grid-column: 1 / -1;
}

.sales-order-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cfd9e2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 7px 18px rgba(23, 32, 43, 0.07);
}

.sales-order-card.has-warning {
  border-color: #f5b8d8;
}

.sales-order-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfd;
}

.sales-order-no {
  padding: 0;
  font-size: 13px;
  font-weight: 1000;
}

.sales-order-card h3 {
  margin: 6px 0 4px;
  font-size: 18px;
  line-height: 1.25;
}

.sales-order-card p,
.sales-order-foot > span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.sales-order-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 62px;
  margin-top: auto;
  padding: 12px 16px 12px 18px;
  border-top: 1px solid var(--line);
  background: #f7fafb;
}

.sales-order-foot > span strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.sales-order-badges,
.sales-order-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.sales-order-warning {
  margin: 14px 18px 0;
  padding: 10px 12px;
  border: 1px solid #ffd1e8;
  border-radius: 8px;
  background: #fff3fa;
  color: #c52b79;
  font-size: 13px;
  font-weight: 900;
}

.sales-order-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 18px 18px;
}

.sales-order-metrics div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  background: rgba(240, 253, 249, 0.82);
}

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

.sales-order-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.sales-order-actions button {
  min-height: 38px;
  padding: 8px 13px;
  box-shadow: 0 2px 5px rgba(23, 32, 43, 0.06);
}

@media (max-width: 1180px) {
  .sales-order-board {
    grid-template-columns: 1fr;
  }
}

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

.approval-empty {
  grid-column: 1 / -1;
}

.approval-card {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(16, 201, 167, 0.06), transparent 42%),
    rgba(255, 255, 255, 0.96);
}

.approval-card.warn {
  border-color: #ffe2a8;
  background:
    linear-gradient(135deg, rgba(255, 243, 206, 0.72), transparent 48%),
    rgba(255, 255, 255, 0.96);
}

.approval-card.danger,
.approval-card.pink {
  border-color: #ffd1e8;
  background:
    linear-gradient(135deg, rgba(244, 90, 181, 0.08), transparent 45%),
    rgba(255, 255, 255, 0.96);
}

.approval-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.approval-card-head > div {
  min-width: 0;
}

.approval-card-head h3 {
  margin: 8px 0 4px;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.approval-card-head h3 .link-button {
  padding: 0;
  font-size: inherit;
}

.approval-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.approval-card-head > strong {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--soft);
  color: var(--teal-dark);
  font-size: 13px;
  white-space: nowrap;
}

.approval-summary-card {
  width: 100%;
  border: 1px solid var(--line);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.approval-summary-card:hover,
.approval-summary-card:focus-visible,
.approval-summary-card.active {
  border-color: #9be8dc;
  background:
    linear-gradient(135deg, rgba(16, 201, 167, 0.12), rgba(255, 255, 255, 0.98) 58%),
    #fff;
}

.approval-summary-card:focus-visible {
  outline: 3px solid rgba(16, 201, 167, 0.24);
  outline-offset: 2px;
}

.approval-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.approval-meta div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #c9f2eb;
  border-radius: 8px;
  background: rgba(240, 253, 249, 0.82);
}

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

.approval-meta strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.approval-impact {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.82);
}

.approval-impact strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.55;
}

.approval-impact em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.approval-review-note {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.86);
}

.approval-review-note strong {
  color: var(--teal);
  font-size: 14px;
}

.approval-review-note span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.approval-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.approval-actions button {
  min-height: 34px;
  padding: 8px 10px;
  white-space: nowrap;
}

.compact-title {
  padding: 0;
}

.compact-title h4 {
  margin: 0 0 4px;
}

.spec-editor {
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.spec-row {
  display: grid;
  grid-template-columns: 92px 76px 100px 150px 126px 150px 100px minmax(180px, 1fr) 76px;
  gap: 8px;
  min-width: 1094px;
  align-items: center;
}

.spec-row.spec-head {
  padding: 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.spec-row .input {
  min-width: 0;
  padding: 10px 11px;
}

.quote-line-editor {
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

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

.quote-line {
  display: grid;
  grid-template-columns: 118px 140px minmax(220px, 1.25fr) 92px 110px 105px 120px minmax(200px, 1fr) 42px;
  gap: 8px;
  align-items: center;
  min-width: 1220px;
}

.quote-line-head {
  padding: 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.quote-line .input {
  min-width: 0;
  padding: 10px 11px;
}

.quote-line .quote-input-error,
.quote-form .quote-input-error {
  border-color: #d92d7a;
  box-shadow: 0 0 0 3px rgba(217, 45, 122, 0.14);
}

.quote-line-standard {
  padding: 7px;
  border-radius: 10px;
  background: #f1fbf8;
}

.quote-line-standard .input[readonly],
.quote-line-standard .input:disabled {
  color: var(--ink);
  background: #f8fcfb;
  opacity: 1;
}

.quote-line-unit {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 9px;
  border: 1px solid #cce8e2;
  border-radius: 8px;
  background: #f7fcfb;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.quote-settings-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  padding: 24px 26px;
  background: linear-gradient(100deg, rgba(231, 250, 244, 0.92), #fff 60%, rgba(255, 243, 250, 0.78));
}

.quote-settings-intro h3,
.quote-settings-intro p {
  margin: 0;
}

.quote-settings-intro h3 {
  font-size: 24px;
}

.quote-settings-intro p {
  max-width: 70ch;
  margin-top: 7px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.6;
}

.quote-settings-status {
  flex: 0 0 auto;
  min-width: 168px;
  padding-inline-start: 24px;
  border-inline-start: 1px solid #bfe8e0;
}

.quote-settings-status strong,
.quote-settings-status span {
  display: block;
}

.quote-settings-status strong {
  color: var(--teal-dark);
  font-size: 27px;
}

.quote-settings-status span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.quote-settings-editor,
.quote-settings-history {
  margin-bottom: 18px;
}

.quote-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.quote-settings-columns,
.quote-setting-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(170px, 0.9fr) minmax(280px, 1.5fr);
  align-items: center;
  gap: 14px;
}

.quote-settings-columns {
  margin: 0 22px;
  padding: 0 14px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.quote-settings-list {
  display: grid;
  gap: 1px;
  margin: 0 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.quote-setting-row {
  min-width: 0;
  padding: 16px 14px;
  background: #fff;
}

.quote-setting-name,
.quote-setting-name strong,
.quote-setting-name span {
  min-width: 0;
}

.quote-setting-name strong,
.quote-setting-name span {
  display: block;
}

.quote-setting-name strong {
  font-size: 16px;
}

.quote-setting-name span,
.quote-setting-row p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.quote-setting-name span {
  margin-top: 4px;
}

.quote-setting-row p {
  margin: 0;
  overflow-wrap: anywhere;
}

.quote-setting-row p strong {
  color: var(--teal-dark);
}

.money-input.quote-setting-price {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.money-input.quote-setting-price > span {
  padding-inline-start: 13px;
  color: var(--teal-dark);
  font-size: 15px;
  font-weight: 950;
}

.money-input.quote-setting-price .input {
  width: 100%;
  min-width: 0;
  border: 0;
  box-shadow: none;
}

.money-input.quote-setting-price:focus-within {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(16, 201, 167, 0.12);
}

.quote-settings-savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 0 22px 22px;
}

.quote-settings-savebar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.quote-settings-savebar .form-error {
  color: #d92d7a;
}

@media (max-width: 900px) {
  .quote-settings-intro,
  .quote-settings-head,
  .quote-settings-savebar {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-settings-status {
    min-width: 0;
    padding-block-start: 14px;
    padding-inline-start: 0;
    border-block-start: 1px solid #bfe8e0;
    border-inline-start: 0;
  }

  .quote-settings-columns {
    display: none;
  }

  .quote-settings-list {
    margin-top: 4px;
  }

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

  .quote-setting-row p {
    grid-column: 1 / -1;
  }

  .quote-settings-savebar button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .quote-setting-row {
    grid-template-columns: 1fr;
  }

  .quote-setting-row p {
    grid-column: 1;
  }
}

.printer-inbound-submit {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid #c9f2eb;
}

.printer-inbound-submit div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.printer-inbound-submit strong {
  font-size: 15px;
}

.printer-inbound-submit span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.change-editor {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.change-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(5, minmax(92px, 0.7fr));
  align-items: center;
  gap: 10px;
  min-width: 820px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.change-row.change-head {
  background: #f6fbfa;
  color: var(--muted);
  font-weight: 900;
}

.change-row strong {
  display: grid;
  gap: 4px;
}

.change-row small {
  color: var(--muted);
  font-size: 12px;
}

.change-row .input {
  min-width: 0;
  padding: 10px 11px;
}

.flow-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #b8efe6;
  border-radius: 8px;
  background: #effbf8;
}

.flow-note strong {
  color: var(--teal);
  white-space: nowrap;
}

.flow-note span {
  color: var(--muted);
  font-weight: 800;
}

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

.settlement-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.settlement-step > span:first-child {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef3f5;
  font-weight: 950;
}

.settlement-step-copy {
  min-width: 0;
}

.settlement-step strong {
  display: block;
  line-height: 1.15;
}

.settlement-step em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.settlement-step.done,
.settlement-step.current {
  border-color: #b8efe6;
  background: #effbf8;
}

.settlement-step.done > span:first-child,
.settlement-step.current > span:first-child {
  color: #fff;
  background: var(--teal);
}

.settlement-step.current {
  box-shadow: 0 14px 30px rgba(8, 127, 112, 0.1);
}

.timeline {
  display: grid;
  gap: 12px;
  padding: 4px 0 2px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfefd;
}

.timeline-item > span {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(16, 201, 167, 0.14);
}

.timeline-item strong {
  display: block;
  margin-bottom: 3px;
}

.modal-section {
  padding: 0 24px 18px;
}

.modal-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 12px;
}

.modal-section-title h4 {
  margin: 0;
  font-size: 18px;
}

.modal-section-title p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.quick-rule-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

@media (max-width: 1100px) {
  body {
    min-width: 0;
  }

  .board-toolbar {
    grid-template-columns: 1fr;
  }

  .modal-financial-disclosure > summary {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .modal-financial-disclosure > summary .disclosure-label {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .recovery-detail-grid,
  .book-cost-overview,
  .project-recovery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-toolbar {
    justify-content: flex-start;
  }

  .quick-date-group {
    flex: 1 1 100%;
  }

  .trend-control-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .trend-control-actions {
    justify-content: flex-start;
  }

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

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

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

  .warehouse-pick-book-line,
  .warehouse-pick-form-row {
    grid-template-columns: 1fr;
  }

  .warehouse-shipped-row {
    grid-template-columns: 1fr;
  }

  .login-screen {
    --login-peek-width: clamp(132px, 24vw, 150px);
    grid-template-columns: 1fr;
    align-items: start;
    padding: 112px 28px 36px;
  }

  .login-brand {
    left: 28px;
  }

  .login-copy {
    margin-top: 110px;
  }

  .login-copy h1 {
    font-size: clamp(34px, 8vw, 44px);
  }

  .login-card-shell {
    margin-left: 0;
  }

  .login-peek {
    left: 65%;
  }

  .stats,
	  .stats-five,
	  .two,
	  .approval-board,
	  .book-workbench-actions,
	  .detail-grid,
	  .warehouse-grid,
	  .warehouse-pick-grid,
	  .warehouse-shipped-layout,
	  .shipping-info-grid,
	  .quote-form {
    grid-template-columns: 1fr 1fr;
  }

  .ledger-book-head {
    grid-template-columns: 1fr;
  }

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

  .ledger-reset-advanced {
    justify-self: start;
  }

  .ledger-book-toggle {
    justify-self: start;
  }

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

  .warehouse-ship-form button {
    justify-self: start;
  }

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

  .dealer-layout {
    grid-template-columns: 1fr;
  }

  .cart-backdrop {
    display: none;
  }

  .cart-panel {
    position: sticky;
    top: 84px;
    width: auto;
    max-height: none;
    overflow: auto;
  }

  .sidebar {
    width: 244px;
  }

  .app {
    margin-left: 244px;
  }
}

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

@media (max-width: 760px) {
  .ledger-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ledger-entry-group-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
  }

  .ledger-entry {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 14px 16px;
  }

  .ledger-entry-amount {
    grid-column: 2;
    text-align: left;
  }

  .sales-order-board {
    gap: 14px;
    padding: 12px;
  }

  .sales-order-card-head,
  .sales-order-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .sales-order-badges,
  .sales-order-actions {
    justify-content: flex-start;
  }

  .sales-order-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 14px;
  }

  .sales-order-warning {
    margin: 14px 14px 0;
  }

  .sales-order-actions button {
    flex: 1 1 auto;
  }

  .analysis-breakdown-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .analysis-breakdown-card-head .input {
    width: 100%;
    max-width: none;
  }

  .type-setting-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .type-setting-card-head .primary {
    width: 100%;
  }

  .profit-equation {
    align-items: flex-start;
    flex-direction: column;
  }

  .recovery-disclosure > summary,
  .modal-financial-disclosure > summary,
  .methodology-disclosure > summary {
    grid-template-columns: 1fr;
  }

  .recovery-disclosure > summary .disclosure-label,
  .modal-financial-disclosure > summary .disclosure-label,
  .methodology-disclosure > summary .disclosure-label {
    grid-column: auto;
    justify-self: start;
  }

  .recovery-detail-grid,
  .book-cost-overview,
  .project-recovery-grid,
  .analysis-note-grid {
    grid-template-columns: 1fr;
  }

  .recovery-equation,
  .methodology-disclosure summary > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .book-cost-overview {
    padding: 14px 16px;
  }

  .modal-financial-disclosure {
    margin-right: 16px;
    margin-left: 16px;
  }

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

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

  .packing-slip,
  .packing-slip div.wide {
    grid-template-columns: 1fr;
    grid-column: 1;
  }

  .internal-order-line,
  .internal-order-line-head {
    grid-template-columns: 1fr;
  }

  .internal-order-line-head {
    display: none;
  }

  .sidebar {
    position: static;
    width: auto;
  }

  .app {
    margin-left: 0;
  }

  .topbar,
  .content {
    padding: 20px;
  }

  .topbar {
    display: grid;
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

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

  .topbar h2 {
    font-size: 30px;
  }

  .top-actions {
    justify-content: space-between;
    width: 100%;
  }

  .trend-control-strip {
    margin-right: 12px;
    margin-left: 12px;
  }

  .trend-granularity-btn,
  .trend-yoy-check {
    flex: 1 1 calc(33.333% - 8px);
    justify-content: center;
  }

  .app-toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
  }

  .stats,
  .stats-five,
	  .two,
	  .approval-board,
	  .approval-meta,
	  .book-workbench-actions,
	  .detail-grid,
	  .warehouse-grid,
	  .warehouse-pick-grid,
	  .warehouse-pick-form-row,
	  .warehouse-ship-form,
	  .warehouse-shipped-layout,
	  .shipping-info-grid,
	  .quote-form {
    grid-template-columns: 1fr;
  }

  .warehouse-sync-note,
  .warehouse-ship-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .warehouse-shipped-kv strong {
    text-align: left;
  }

  .warehouse-step-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .warehouse-step-panel p {
    max-width: none;
    text-align: left;
  }

  .detail-box.wide {
    grid-column: 1;
  }

  .product-grid,
  .product-meta,
  .quantity-row {
    grid-template-columns: 1fr;
  }

  .modal-mask {
    padding: 14px;
  }

  .modal-section-title,
  .modal-foot,
  .modal-actions,
  .printer-inbound-submit {
    align-items: stretch;
    flex-direction: column;
  }

  .printer-inbound-submit button {
    width: 100%;
  }

  .compact-toolbar .input,
  .compact-toolbar .select-like,
  .compact-toolbar select,
  .compact-toolbar .date-range-trigger,
  .quick-date-group,
  .compact-toolbar button {
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
  }

  .ledger-main-toolbar .ledger-toolbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-left: 0;
  }

  .ledger-main-toolbar .ledger-toolbar-actions > *,
  .ledger-entry-menu > summary {
    width: 100%;
  }

  .ledger-entry-menu > div {
    right: auto;
    left: 0;
    width: min(320px, calc(100vw - 72px));
  }

  .ledger-advanced-filters {
    grid-template-columns: 1fr;
  }

  .ledger-filter-result {
    width: 100%;
    padding-right: 0;
    padding-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ledger-filter-chips {
    flex-basis: 100%;
  }

  .ledger-shell-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .quick-date-group .quick-date {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    width: auto;
  }

  .date-picker-head,
  .date-picker-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .date-picker-foot > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }
}

@media (max-width: 1180px) {
  .dealer-order-card-head {
    grid-template-columns: minmax(220px, 1fr) auto auto;
  }

  .dealer-order-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .dealer-orders-heading {
    align-items: flex-start;
  }

  .dealer-order-card-head {
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 16px;
  }

  .dealer-order-identity,
  .dealer-order-actions {
    grid-column: 1 / -1;
  }

  .dealer-order-head-status {
    align-self: end;
  }

  .dealer-order-total {
    grid-column: 2;
    grid-row: 2;
  }

  .dealer-order-actions button {
    flex: 1 1 auto;
  }

  .dealer-order-shipping {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 11px 16px;
  }

  .dealer-order-shipping time {
    flex-basis: 100%;
    margin-left: 0;
  }

  .dealer-order-items {
    min-width: 0;
  }

  .dealer-order-items thead {
    display: none;
  }

  .dealer-order-items tbody,
  .dealer-order-items tr,
  .dealer-order-items td {
    display: block;
  }

  .dealer-order-items tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }

  .dealer-order-items tr:last-child {
    border-bottom: 0;
  }

  .dealer-order-items td,
  .dealer-order-items th:not(:first-child),
  .dealer-order-items td:not(:first-child),
  .dealer-order-items th:first-child,
  .dealer-order-items td:first-child {
    width: auto;
    padding: 0;
    text-align: left;
    white-space: normal;
  }

  .dealer-order-items td:first-child {
    grid-column: 1 / -1;
  }

  .dealer-order-items td:not(:first-child)::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
  }
}

/* 经营分析 V2：样式全部收口在独立容器内，便于与原版切换或整体回退。 */
.business-analysis-v2 {
  --analysis-teal: #087f70;
  --analysis-teal-bright: #10b9a0;
  --analysis-teal-soft: #e8f8f4;
  --analysis-pink: #e845a4;
  --analysis-pink-soft: #fff1f8;
  --analysis-ink: #172331;
  --analysis-muted: #687687;
  --analysis-line: #dce7e5;
  display: grid;
  gap: 18px;
}

.business-analysis-v2 > .top-filter-bar {
  margin-bottom: 0;
}

.analysis-v2-result,
.analysis-v2-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--analysis-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(23, 35, 49, 0.055);
}

.analysis-v2-result {
  position: relative;
  border-color: rgba(160, 220, 210, 0.82);
  background:
    linear-gradient(132deg, rgba(232, 248, 244, 0.96), rgba(255, 255, 255, 0.96) 46%, rgba(255, 241, 248, 0.7)),
    #fff;
}

.analysis-v2-result::after {
  position: absolute;
  top: -88px;
  right: -92px;
  width: 240px;
  height: 240px;
  border: 42px solid rgba(232, 69, 164, 0.045);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.analysis-v2-result-head,
.analysis-v2-section-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(220, 231, 229, 0.86);
}

.analysis-v2-result-head h3,
.analysis-v2-section-head h3,
.analysis-v2-section-divider h3 {
  margin: 0;
  color: var(--analysis-ink);
  font-size: 20px;
  line-height: 1.25;
}

.analysis-v2-result-head p,
.analysis-v2-section-head p,
.analysis-v2-section-divider p {
  margin: 6px 0 0;
  color: var(--analysis-muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.analysis-v2-period-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(16, 185, 160, 0.24);
  border-radius: 7px;
  color: var(--analysis-teal);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.analysis-v2-result-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(230px, 0.95fr) minmax(330px, 1.25fr) minmax(250px, 0.9fr);
  gap: 0;
  min-height: 250px;
}

.analysis-v2-net-result,
.analysis-v2-profit-bridge,
.analysis-v2-revenue-summary {
  min-width: 0;
  padding: 24px;
}

.analysis-v2-net-result {
  display: flex;
  justify-content: center;
  flex-direction: column;
  border-right: 1px solid rgba(220, 231, 229, 0.9);
}

.analysis-v2-net-result > span,
.analysis-v2-revenue-primary > span,
.analysis-v2-limited-grid span {
  color: var(--analysis-muted);
  font-size: 13px;
  font-weight: 900;
}

.analysis-v2-net-result > strong {
  display: block;
  margin-top: 10px;
  color: var(--analysis-teal);
  font-size: clamp(34px, 3vw, 52px);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.analysis-v2-net-result.is-negative > strong {
  color: var(--analysis-pink);
}

.analysis-v2-net-result p {
  margin: 11px 0 0;
  color: var(--analysis-muted);
  font-size: 13px;
  font-weight: 750;
}

.analysis-v2-profit-bridge {
  display: grid;
  align-content: center;
  gap: 0;
  border-right: 1px solid rgba(220, 231, 229, 0.9);
  background: rgba(255, 255, 255, 0.46);
}

.analysis-v2-profit-bridge > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(180, 197, 194, 0.62);
}

.analysis-v2-profit-bridge span {
  color: var(--analysis-muted);
  font-size: 13px;
  font-weight: 800;
}

.analysis-v2-profit-bridge strong {
  color: var(--analysis-teal);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.analysis-v2-profit-bridge strong.is-deduction {
  color: var(--analysis-pink);
}

.analysis-v2-profit-bridge > .analysis-v2-profit-total {
  margin-top: 7px;
  padding-top: 12px;
  border-bottom: 0;
  border-top: 2px solid var(--analysis-ink);
}

.analysis-v2-profit-total span,
.analysis-v2-profit-total strong {
  color: var(--analysis-ink);
  font-size: 16px;
}

.analysis-v2-revenue-summary {
  display: grid;
  align-content: center;
  gap: 20px;
}

.analysis-v2-revenue-primary strong {
  display: block;
  margin-top: 8px;
  color: var(--analysis-ink);
  font-size: clamp(25px, 2vw, 34px);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.analysis-v2-revenue-primary em {
  display: block;
  margin-top: 8px;
  color: var(--analysis-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.45;
}

.analysis-v2-operating-support {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.analysis-v2-operating-support > div,
.analysis-v2-limited-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(220, 231, 229, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.analysis-v2-operating-support span,
.analysis-v2-operating-support strong {
  display: block;
}

.analysis-v2-operating-support span {
  color: var(--analysis-muted);
  font-size: 11px;
  font-weight: 850;
}

.analysis-v2-operating-support strong {
  margin-top: 5px;
  overflow: hidden;
  color: var(--analysis-ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-v2-limited-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 22px;
}

.analysis-v2-limited-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--analysis-ink);
  font-size: 28px;
}

.analysis-v2-section-head {
  padding: 18px 20px;
  background: rgba(250, 253, 252, 0.86);
}

.analysis-v2-section-head > div {
  min-width: 0;
}

.analysis-v2-section-head > .input {
  flex: 0 1 320px;
  width: min(320px, 38vw);
  max-width: 320px;
}

.analysis-v2-section-body {
  min-width: 0;
  padding: 0;
}

.analysis-v2-trend-section .analysis-v2-section-body {
  padding: 2px 4px 0;
}

.analysis-v2-trend-section .trend-overview {
  padding: 16px 16px 4px;
}

.analysis-v2-trend-section .trend-chart {
  min-height: 236px;
  border-bottom: 0;
}

.analysis-v2-trend-section .trend-detail-table {
  margin: 0 16px 16px;
}

.analysis-v2-granularity {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--analysis-line);
  border-radius: 9px;
  background: #f3f8f7;
}

.analysis-v2-granularity button {
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  color: var(--analysis-muted);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}

.analysis-v2-granularity button.active {
  color: #fff;
  background: var(--analysis-teal);
}

.analysis-v2-explore-section {
  box-shadow: 0 10px 28px rgba(23, 35, 49, 0.04);
}

.analysis-v2-view-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--analysis-line);
  border-radius: 9px;
  background: #f2f7f6;
}

.analysis-v2-view-tabs button {
  min-height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 6px;
  color: var(--analysis-muted);
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 850;
}

.analysis-v2-view-tabs button.active {
  color: #fff;
  background: var(--analysis-teal);
}

.analysis-v2-view-tabs button:focus-visible {
  outline: 3px solid rgba(16, 185, 160, 0.24);
  outline-offset: 2px;
}

.analysis-v2-tab-panel[hidden] {
  display: none;
}

.analysis-v2-tab-panel > .table-scroll,
.analysis-v2-book-ranking .table-scroll {
  max-height: none;
}

.analysis-v2-book-ranking .table-scroll table {
  min-width: 1030px;
}

.analysis-v2-book-ranking th:nth-child(2),
.analysis-v2-book-ranking td:nth-child(2) {
  min-width: 250px;
  white-space: normal;
}

.analysis-v2-book-ranking th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #f7fbfa;
}

.analysis-v2-rank-number {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 7px;
  color: var(--analysis-muted);
  background: #eff4f3;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.analysis-v2-dealer-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 8px 12px 12px;
}

.analysis-v2-dealer-row {
  display: grid;
  grid-template-columns: 30px minmax(140px, 1fr) max-content;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 70px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--analysis-line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.analysis-v2-dealer-row:last-child {
  border-bottom: 1px solid var(--analysis-line);
}

.analysis-v2-dealer-row:hover,
.analysis-v2-dealer-row:focus-visible {
  border-color: var(--analysis-line);
  background: var(--analysis-teal-soft);
  box-shadow: none;
  outline: none;
}

.analysis-v2-dealer-name {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.analysis-v2-dealer-name strong {
  overflow: hidden;
  color: var(--analysis-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-v2-dealer-name i {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eeec;
}

.analysis-v2-dealer-name b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--analysis-teal), var(--analysis-teal-bright));
}

.analysis-v2-dealer-value {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.analysis-v2-dealer-value strong {
  color: var(--analysis-teal);
  font-size: 14px;
}

.analysis-v2-dealer-value em {
  color: var(--analysis-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.analysis-v2-comparison {
  --analysis-comparison-accent: var(--analysis-teal);
  border-bottom: 1px solid var(--analysis-line);
  background: #fff;
}

.analysis-v2-comparison.is-amount {
  --analysis-comparison-accent: #159eb4;
}

.analysis-v2-comparison.is-profit {
  --analysis-comparison-accent: #7068d8;
}

.analysis-v2-comparison.is-margin {
  --analysis-comparison-accent: #b88121;
}

.analysis-v2-comparison-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--analysis-line);
  background: rgba(248, 252, 251, 0.76);
}

.analysis-v2-comparison-head > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.analysis-v2-comparison-head strong {
  color: var(--analysis-ink);
  font-size: 15px;
}

.analysis-v2-comparison-head > div:first-child span {
  color: var(--analysis-muted);
  font-size: 12px;
  font-weight: 700;
}

.analysis-v2-comparison-sort {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--analysis-line);
  border-radius: 8px;
  background: #eef5f3;
}

.analysis-v2-comparison-sort > span {
  padding: 0 8px;
  color: var(--analysis-muted);
  font-size: 11px;
  font-weight: 850;
}

.analysis-v2-comparison-sort button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  color: var(--analysis-muted);
  background: transparent;
  box-shadow: none;
  font-size: 11px;
  font-weight: 850;
}

.analysis-v2-comparison-sort button.active {
  color: #fff;
  background: var(--analysis-comparison-accent);
}

.analysis-v2-comparison-sort button:focus-visible {
  outline: 3px solid rgba(16, 185, 160, 0.24);
  outline-offset: 2px;
}

.analysis-v2-comparison-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.analysis-v2-comparison-bars {
  min-width: 0;
  border-right: 1px solid var(--analysis-line);
}

.analysis-v2-comparison-grid {
  min-width: 0;
  max-height: 640px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(8, 127, 112, 0.34) transparent;
  scrollbar-width: thin;
}

.analysis-v2-comparison-grid-head,
.analysis-v2-comparison-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(160px, 1.35fr) minmax(92px, 0.55fr);
  gap: 14px;
  align-items: center;
}

.analysis-v2-comparison-grid-head {
  position: sticky;
  z-index: 2;
  top: 0;
  min-height: 38px;
  padding: 0 20px;
  color: var(--analysis-muted);
  background: #f8fbfa;
  font-size: 11px;
  font-weight: 850;
}

.analysis-v2-comparison-grid-head span:not(:first-child) {
  text-align: right;
}

.analysis-v2-comparison-row {
  width: 100%;
  min-height: 74px;
  padding: 11px 20px;
  border: 0;
  border-top: 1px solid rgba(220, 231, 229, 0.82);
  border-radius: 0;
  color: inherit;
  text-align: left;
  background: #fff;
  box-shadow: none;
}

.analysis-v2-comparison-row:hover {
  background: rgba(232, 248, 244, 0.44);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 160, 0.18);
}

.analysis-v2-comparison-row:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(16, 185, 160, 0.26);
  outline-offset: -3px;
}

.analysis-v2-comparison-entity {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  min-width: 0;
}

.analysis-v2-comparison-entity > b {
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--analysis-teal);
  background: var(--analysis-teal-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.analysis-v2-comparison-entity > strong {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--analysis-ink);
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.analysis-v2-comparison-entity > small {
  overflow: hidden;
  color: var(--analysis-muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-v2-comparison-plot {
  display: block;
  min-width: 0;
}

.analysis-v2-comparison-result {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
}

.analysis-v2-comparison-result strong {
  color: var(--analysis-ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.analysis-v2-comparison-result small {
  max-width: 100%;
  overflow: hidden;
  color: var(--analysis-muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-v2-comparison-track {
  display: block;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7efed;
}

.analysis-v2-comparison-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--analysis-comparison-accent);
}

.analysis-v2-comparison-track .is-negative {
  background: var(--analysis-pink);
}

.analysis-v2-comparison-note {
  margin: 0;
  padding: 10px 20px 14px;
  color: var(--analysis-muted);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.analysis-v2-comparison-empty {
  margin: 16px 20px;
}

.analysis-v2-treemap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: #fbfdfc;
}

.analysis-v2-treemap-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.analysis-v2-treemap-head > div {
  display: grid;
  gap: 2px;
}

.analysis-v2-treemap-head strong {
  color: var(--analysis-ink);
  font-size: 13px;
}

.analysis-v2-treemap-head span,
.analysis-v2-treemap-head small {
  color: var(--analysis-muted);
  font-size: 10px;
  font-weight: 700;
}

.analysis-v2-treemap-head small {
  max-width: 280px;
  line-height: 1.45;
  text-align: right;
}

.analysis-v2-treemap-stage {
  position: relative;
  height: clamp(500px, 44vw, 640px);
  min-width: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #e7efed;
}

.analysis-v2-treemap-item {
  position: absolute;
  display: grid;
  align-content: space-between;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 10px;
  border: 2px solid #fff;
  border-radius: 8px;
  color: var(--analysis-ink);
  text-align: left;
  background: color-mix(in srgb, var(--analysis-comparison-accent) var(--tile-strength), white);
  box-shadow: none;
}

.analysis-v2-treemap-item:hover {
  z-index: 2;
  filter: saturate(1.08);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--analysis-comparison-accent) 64%, transparent);
}

.analysis-v2-treemap-item:focus-visible {
  z-index: 3;
  outline: 3px solid var(--analysis-comparison-accent);
  outline-offset: -4px;
}

.analysis-v2-treemap-item.is-negative {
  color: #8b1f5f;
  background: color-mix(in srgb, var(--analysis-pink) 26%, white);
}

.analysis-v2-treemap-item > span {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.analysis-v2-treemap-item b {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: inherit;
  background: rgba(255, 255, 255, 0.66);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.analysis-v2-treemap-item strong {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.analysis-v2-treemap-item em {
  align-self: end;
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.analysis-v2-treemap-item small {
  overflow: hidden;
  font-size: 9px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-v2-treemap-item.is-compact {
  align-content: center;
  justify-items: center;
  padding: 4px;
  text-align: center;
}

.analysis-v2-treemap-item.is-compact > span {
  justify-content: center;
}

.analysis-v2-treemap-item.is-compact > span strong,
.analysis-v2-treemap-item.is-compact small {
  display: none;
}

.analysis-v2-treemap-item.is-compact em {
  align-self: center;
  font-size: 11px;
}

.analysis-v2-drilldown-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 12px;
  background: #fff;
}

.analysis-v2-drilldown-head strong {
  color: var(--analysis-ink);
  font-size: 15px;
}

.analysis-v2-drilldown-head span {
  color: var(--analysis-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.analysis-v2-panel-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 22px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--analysis-line);
  background: rgba(248, 252, 251, 0.72);
}

.analysis-v2-panel-filter > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.analysis-v2-panel-filter strong {
  color: var(--analysis-ink);
  font-size: 14px;
}

.analysis-v2-panel-filter span {
  overflow: hidden;
  color: var(--analysis-muted);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-v2-panel-filter > .input {
  width: 100%;
  min-width: 0;
}

.analysis-v2-drilldown-empty {
  margin: 18px 20px 22px;
}

.analysis-v2-structure-summary {
  display: grid;
  grid-template-columns: repeat(var(--analysis-summary-items), minmax(120px, 1fr));
  border-bottom: 1px solid var(--analysis-line);
  background: #fff;
}

.analysis-v2-structure-summary > div {
  min-width: 0;
  padding: 15px 18px;
  border-right: 1px solid var(--analysis-line);
}

.analysis-v2-structure-summary > div:last-child {
  border-right: 0;
}

.analysis-v2-structure-summary span,
.analysis-v2-structure-summary strong {
  display: block;
}

.analysis-v2-structure-summary span {
  color: var(--analysis-muted);
  font-size: 11px;
  font-weight: 850;
}

.analysis-v2-structure-summary strong {
  margin-top: 5px;
  color: var(--analysis-ink);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.analysis-v2-structure-visual {
  padding: 20px;
  border-bottom: 1px solid var(--analysis-line);
  background: rgba(250, 253, 252, 0.52);
}

.analysis-v2-structure-visual-head,
.analysis-v2-structure-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.analysis-v2-structure-visual-head > div:first-child,
.analysis-v2-structure-detail-head {
  min-width: 0;
}

.analysis-v2-structure-visual-head strong,
.analysis-v2-structure-detail-head strong {
  color: var(--analysis-ink);
  font-size: 14px;
}

.analysis-v2-structure-visual-head span,
.analysis-v2-structure-detail-head span {
  margin-left: 8px;
  color: var(--analysis-muted);
  font-size: 12px;
  font-weight: 700;
}

.analysis-v2-metric-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--analysis-line);
  border-radius: 8px;
  background: #f1f6f5;
}

.analysis-v2-metric-tabs button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  color: var(--analysis-muted);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 850;
}

.analysis-v2-metric-tabs button.active {
  color: #fff;
  background: var(--analysis-teal);
}

.analysis-v2-metric-tabs button:focus-visible {
  outline: 3px solid rgba(16, 185, 160, 0.24);
  outline-offset: 2px;
}

.analysis-v2-structure-visual-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.28fr);
  gap: 28px;
  margin-top: 18px;
}

.analysis-v2-composition-list {
  display: grid;
  align-content: start;
  gap: 13px;
  min-width: 0;
}

.analysis-v2-composition-row {
  display: grid;
  grid-template-columns: minmax(190px, 0.62fr) minmax(180px, 1fr) minmax(115px, 0.35fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.analysis-v2-composition-row > strong {
  color: var(--analysis-ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.analysis-v2-composition-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7efed;
}

.analysis-v2-composition-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--analysis-teal), var(--analysis-teal-bright));
}

.analysis-v2-composition-track span.is-negative {
  background: var(--analysis-pink);
}

.analysis-v2-composition-row > div:last-child {
  display: grid;
  justify-items: end;
  min-width: 0;
}

.analysis-v2-composition-row b {
  color: var(--analysis-ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.analysis-v2-composition-row small {
  margin-top: 2px;
  color: var(--analysis-muted);
  font-size: 10px;
  font-weight: 750;
}

.analysis-v2-structure-insights {
  display: grid;
  align-content: start;
  gap: 14px;
  padding-left: 24px;
  border-left: 1px solid var(--analysis-line);
}

.analysis-v2-structure-insights > div {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--analysis-line);
}

.analysis-v2-structure-insights > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.analysis-v2-structure-insights span,
.analysis-v2-structure-insights strong {
  display: block;
}

.analysis-v2-structure-insights span {
  color: var(--analysis-muted);
  font-size: 11px;
  font-weight: 850;
}

.analysis-v2-structure-insights strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--analysis-ink);
  font-size: 15px;
  line-height: 1.35;
}

.analysis-v2-structure-insights p {
  margin: 4px 0 0;
  color: var(--analysis-muted);
  font-size: 11px;
  font-weight: 700;
}

.analysis-v2-structure-detail-head {
  padding: 14px 20px;
  background: #fff;
}

.analysis-v2-structure-detail > .table-scroll {
  max-height: none;
  border-top: 1px solid var(--analysis-line);
}

.analysis-v2-structure-detail > .table-scroll table {
  min-width: 1020px;
}

.analysis-v2-structure-detail > .table-scroll th:first-child,
.analysis-v2-structure-detail > .table-scroll td:first-child {
  min-width: 250px;
  white-space: normal;
}

.analysis-v2-section-divider {
  display: none;
}

.analysis-v2-scrap-disclosure {
  overflow: hidden;
  border: 1px solid var(--analysis-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(23, 35, 49, 0.04);
}

.analysis-v2-scrap-disclosure > summary {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(430px, 1.4fr) auto;
  gap: 24px;
  align-items: center;
  padding: 17px 20px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(90deg, rgba(232, 248, 244, 0.62), rgba(255, 255, 255, 0.92));
}

.analysis-v2-scrap-disclosure > summary::-webkit-details-marker {
  display: none;
}

.analysis-v2-scrap-disclosure > summary:focus-visible {
  outline: 3px solid rgba(16, 185, 160, 0.24);
  outline-offset: -3px;
}

.analysis-v2-scrap-title h3 {
  margin: 0;
  color: var(--analysis-ink);
  font-size: 17px;
}

.analysis-v2-scrap-title p {
  margin: 4px 0 0;
  color: var(--analysis-muted);
  font-size: 12px;
  font-weight: 700;
}

.analysis-v2-scrap-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analysis-v2-scrap-summary > div {
  min-width: 0;
  padding: 0 18px;
  border-left: 1px solid var(--analysis-line);
}

.analysis-v2-scrap-summary span,
.analysis-v2-scrap-summary strong {
  display: block;
}

.analysis-v2-scrap-summary span {
  color: var(--analysis-muted);
  font-size: 11px;
  font-weight: 800;
}

.analysis-v2-scrap-summary strong {
  margin-top: 4px;
  color: var(--analysis-ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.analysis-v2-scrap-disclosure .disclosure-label {
  color: var(--analysis-teal);
  font-size: 12px;
  font-weight: 900;
}

.analysis-v2-scrap-disclosure .disclosure-label::after {
  display: inline-block;
  margin-left: 7px;
  content: "▾";
  transition: transform 160ms ease;
}

.analysis-v2-scrap-disclosure[open] .disclosure-label::after {
  transform: rotate(180deg);
}

.analysis-v2-scrap-detail {
  padding: 14px;
  border-top: 1px solid var(--analysis-line);
}

.analysis-v2-scrap-detail .scrap-analysis-panel {
  margin: 0;
  border: 0;
  box-shadow: none;
}

.analysis-v2-scrap-detail .scrap-analysis-head {
  display: none;
}

.analysis-v2-scrap-detail .scrap-analysis-metrics {
  border-top: 0;
}

.business-analysis-v2 > .recovery-overview,
.business-analysis-v2 > .analysis-v2-methodology {
  margin-top: 0;
  border-radius: 12px;
}

@media (max-width: 1220px) {
  .analysis-v2-result-body {
    grid-template-columns: minmax(220px, 0.85fr) minmax(300px, 1.15fr);
  }

  .analysis-v2-revenue-summary {
    grid-column: 1 / -1;
    grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.35fr);
    border-top: 1px solid rgba(220, 231, 229, 0.9);
  }

  .analysis-v2-profit-bridge {
    border-right: 0;
  }

  .analysis-v2-structure-summary {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .analysis-v2-structure-summary > div:nth-child(3n) {
    border-right: 0;
  }

  .analysis-v2-structure-summary > div:nth-child(-n + 3) {
    border-bottom: 1px solid var(--analysis-line);
  }

  .analysis-v2-comparison-grid-head,
  .analysis-v2-comparison-row {
    grid-template-columns: minmax(130px, 0.9fr) minmax(120px, 1.3fr) minmax(82px, 0.55fr);
    gap: 12px;
  }

  .analysis-v2-structure-visual-body {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .analysis-v2-structure-insights {
    grid-template-columns: repeat(var(--analysis-insight-items), minmax(0, 1fr));
    gap: 12px;
    padding: 18px 0 0;
    border-top: 1px solid var(--analysis-line);
    border-left: 0;
  }

  .analysis-v2-structure-insights > div,
  .analysis-v2-structure-insights > div:last-child {
    padding: 0 12px 0 0;
    border-right: 1px solid var(--analysis-line);
    border-bottom: 0;
  }

  .analysis-v2-structure-insights > div:last-child {
    border-right: 0;
  }

  .analysis-v2-scrap-disclosure > summary {
    grid-template-columns: minmax(220px, 1fr) auto;
  }

  .analysis-v2-scrap-summary {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 1100px) {
  .analysis-v2-comparison-body {
    grid-template-columns: 1fr;
  }

  .analysis-v2-comparison-bars {
    border-right: 0;
    border-bottom: 1px solid var(--analysis-line);
  }

  .analysis-v2-comparison-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .analysis-v2-comparison-sort {
    display: grid;
    grid-template-columns: repeat(var(--analysis-comparison-metrics), minmax(0, 1fr));
    width: 100%;
  }

  .analysis-v2-comparison-sort > span {
    display: none;
  }

  .analysis-v2-comparison-sort button,
  .analysis-v2-metric-tabs button {
    min-width: 0;
    min-height: 38px;
    padding: 0 6px;
  }

  .analysis-v2-comparison-grid-head {
    display: none;
  }

  .analysis-v2-comparison-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    padding: 16px 20px;
  }

  .analysis-v2-comparison-entity {
    grid-column: 1 / -1;
  }

  .analysis-v2-comparison-plot::before {
    display: block;
    margin-bottom: 6px;
    color: var(--analysis-muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 850;
  }

  .analysis-v2-treemap-stage {
    height: 500px;
  }

  .analysis-v2-composition-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
  }

  .analysis-v2-composition-row > strong {
    white-space: normal;
  }

  .analysis-v2-composition-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .analysis-v2-composition-row > div:last-child {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 760px) {
  .business-analysis-v2 {
    gap: 14px;
  }

  .analysis-v2-result-head,
  .analysis-v2-section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }

  .analysis-v2-result-head h3,
  .analysis-v2-section-head h3 {
    font-size: 18px;
  }

  .analysis-v2-period-label {
    align-self: flex-start;
  }

  .analysis-v2-result-body,
  .analysis-v2-revenue-summary,
  .analysis-v2-limited-grid {
    grid-template-columns: 1fr;
  }

  .analysis-v2-net-result,
  .analysis-v2-profit-bridge,
  .analysis-v2-revenue-summary {
    padding: 18px 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(220, 231, 229, 0.9);
  }

  .analysis-v2-revenue-summary {
    border-bottom: 0;
  }

  .analysis-v2-net-result > strong {
    font-size: 38px;
  }

  .analysis-v2-operating-support {
    grid-template-columns: 1fr;
  }

  .analysis-v2-section-head > .input {
    flex-basis: auto;
    width: 100%;
    max-width: none;
  }

  .analysis-v2-granularity {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
  }

  .analysis-v2-granularity button {
    min-width: 0;
    padding: 0 5px;
  }

  .analysis-v2-trend-section .trend-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-v2-view-tabs {
    align-self: flex-start;
  }

  .analysis-v2-dealer-list {
    grid-template-columns: 1fr;
  }

  .analysis-v2-dealer-row {
    grid-template-columns: 28px minmax(90px, 1fr);
  }

  .analysis-v2-dealer-value {
    grid-column: 2;
    justify-items: start;
  }

  .analysis-v2-panel-filter {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 16px;
  }

  .analysis-v2-panel-filter span {
    white-space: normal;
  }

  .analysis-v2-comparison-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .analysis-v2-comparison-sort {
    display: grid;
    grid-template-columns: repeat(var(--analysis-comparison-metrics), minmax(0, 1fr));
    width: 100%;
  }

  .analysis-v2-comparison-sort > span {
    display: none;
  }

  .analysis-v2-comparison-sort button {
    min-width: 0;
    padding: 0 5px;
  }

  .analysis-v2-comparison-grid-head {
    display: none;
  }

  .analysis-v2-comparison-grid {
    max-height: none;
    overflow-y: visible;
  }

  .analysis-v2-comparison-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    padding: 16px;
  }

  .analysis-v2-comparison-entity {
    grid-column: 1 / -1;
  }

  .analysis-v2-comparison-plot::before {
    display: block;
    margin-bottom: 6px;
    color: var(--analysis-muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 850;
  }

  .analysis-v2-comparison-result {
    align-self: end;
  }

  .analysis-v2-comparison-note {
    padding: 10px 16px 14px;
  }

  .analysis-v2-treemap {
    padding: 12px;
  }

  .analysis-v2-treemap-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .analysis-v2-treemap-head small {
    max-width: none;
    text-align: left;
  }

  .analysis-v2-treemap-stage {
    height: 420px;
  }

  .analysis-v2-treemap-item {
    padding: 7px;
  }

  .analysis-v2-treemap-item em {
    font-size: 14px;
  }

  .analysis-v2-drilldown-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 18px 16px 12px;
  }

  .analysis-v2-drilldown-head span {
    text-align: left;
  }

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

  .analysis-v2-structure-summary > div,
  .analysis-v2-structure-summary > div:nth-child(3n) {
    border-right: 1px solid var(--analysis-line);
    border-bottom: 1px solid var(--analysis-line);
  }

  .analysis-v2-structure-summary > div:nth-child(2n) {
    border-right: 0;
  }

  .analysis-v2-structure-visual {
    padding: 16px;
  }

  .analysis-v2-structure-visual-head,
  .analysis-v2-structure-detail-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .analysis-v2-structure-visual-head span,
  .analysis-v2-structure-detail-head span {
    display: block;
    margin: 4px 0 0;
  }

  .analysis-v2-metric-tabs {
    display: grid;
    grid-template-columns: repeat(var(--analysis-metric-options), minmax(0, 1fr));
    width: 100%;
  }

  .analysis-v2-metric-tabs button {
    min-width: 0;
    padding: 0 5px;
  }

  .analysis-v2-structure-visual-body {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .analysis-v2-composition-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
  }

  .analysis-v2-composition-row > strong {
    white-space: normal;
  }

  .analysis-v2-composition-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .analysis-v2-composition-row > div:last-child {
    grid-column: 2;
    grid-row: 1;
  }

  .analysis-v2-structure-insights {
    grid-template-columns: repeat(var(--analysis-insight-items), minmax(0, 1fr));
    gap: 12px;
    padding: 18px 0 0;
    border-top: 1px solid var(--analysis-line);
    border-left: 0;
  }

  .analysis-v2-structure-insights > div,
  .analysis-v2-structure-insights > div:last-child {
    padding: 0 12px 0 0;
    border-right: 1px solid var(--analysis-line);
    border-bottom: 0;
  }

  .analysis-v2-structure-insights > div:last-child {
    border-right: 0;
  }

  .analysis-v2-scrap-disclosure > summary {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .analysis-v2-scrap-summary {
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .analysis-v2-scrap-summary > div {
    padding: 0;
    border-left: 0;
  }

  .analysis-v2-scrap-disclosure .disclosure-label {
    justify-self: start;
  }

  .analysis-v2-scrap-detail {
    padding: 10px;
  }
}
