/* Larger reading sizes, loaded last. Layouts keep their own hierarchy. */
html {
  font-size: 16px;
}
body {
  font-size: 16px;
  line-height: 1.65;
}
button,
input,
select,
textarea {
  font-size: 16px;
  line-height: 1.5;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  min-height: 42px;
}
textarea {
  min-height: 98px;
}
button {
  padding: 10px 15px;
}
button.small,
.small {
  font-size: 15px;
  padding: 8px 12px;
}
.text-button,
button.text-button {
  font-size: 15px;
  line-height: 1.6;
}
.field > label,
.filter > label,
.field label,
.filter label {
  font-size: 15px;
  line-height: 1.6;
}
table,
thead,
tbody {
  font-size: 15px;
}
th,
td {
  font-size: 15px;
  line-height: 1.65;
}
th {
  font-weight: 650;
}
.table-wrap th,
.table-wrap td {
  padding-top: 14px;
  padding-bottom: 14px;
}
.number,
.money-value,
.metric-blue,
.metric-green,
.metric-red,
.metric-pink,
.metric-orange {
  font-variant-numeric: tabular-nums;
}
.source-label,
.section-note,
.form-hint,
.muted,
.subtitle,
.small-description,
.order-code,
.customer,
.pager,
.history-warning,
.info-item > label,
.source-note,
.status-note,
.empty,
.banner,
.permission-item,
.menu-section-title {
  font-size: 14px;
  line-height: 1.7;
}
small,
.section-note small,
.form-hint small,
.source-label small {
  font-size: 13px;
  line-height: 1.6;
}
.pill,
.status-pill,
.category-pill {
  font-size: 13px;
  padding: 5px 8px;
  line-height: 1.5;
}
.sidebar nav a {
  font-size: 16px;
  padding: 12px 14px;
}
.side-section,
.side-footer,
.local-badge,
.topbar,
.actor-button,
.back-link {
  font-size: 14px;
}
.side-footer small {
  font-size: 13px;
}
.page-title h1 {
  font-size: 30px;
  line-height: 1.4;
}
.panel-head h2,
.modal-head h2 {
  font-size: 23px;
  line-height: 1.45;
}
.panel-head h3,
.modal-body h3 {
  font-size: 20px;
  line-height: 1.5;
}
.info-item > div,
.info-grid .info-item,
.approval-card,
.member-row,
.financial-grid .stat-label {
  font-size: 15px;
  line-height: 1.7;
}
.stat-label,
.stat-foot {
  font-size: 14px;
  line-height: 1.6;
}
.stat-value {
  font-size: 30px;
  line-height: 1.4;
}
.stat-value small {
  font-size: 15px;
}
.order-select-button,
.order-title,
.order-menu-link {
  font-size: 16px;
  line-height: 1.65;
}
.order-menu-link {
  padding: 12px;
}
.row-arrangement-link {
  font-size: 15px;
}
.orders-table th {
  font-size: 14px;
  line-height: 1.55;
}
.orders-table td {
  font-size: 15px;
}
.orders-table td .section-note,
.orders-table .customer,
.orders-table .order-code {
  font-size: 14px;
}
.orders-head-scroll th {
  height: 51px;
}
.page-total-title {
  font-size: 15px;
  flex-basis: 105px;
}
.page-total-title small {
  font-size: 13px;
}
.page-total-item {
  min-width: 125px;
}
.page-total-item > span {
  font-size: 13px;
}
.page-total-item strong {
  font-size: 18px;
}
.page-total-values {
  gap: 20px;
}
.selection-heading h2 {
  font-size: 20px;
}
.selection-heading p,
.selected-order-menu .form-hint {
  font-size: 14px;
}
.arrangement-category-heading h3 {
  font-size: 25px;
}
.arrangement-category-heading h3 small {
  font-size: 14px;
}
.arrangement-overview-heading h2 {
  font-size: 26px;
}
.arrangement-overview-heading p,
.arrangement-summary,
.arrangement-category-empty {
  font-size: 15px;
}
.arrangement-workspace-v06 .arrangement-table th {
  font-size: 14px;
}
.arrangement-workspace-v06 .arrangement-table td {
  font-size: 15px;
  line-height: 1.75;
}
.arrangement-line-text,
.arrangement-note-preview summary,
.arrangement-note-preview > div {
  font-size: 14px;
  line-height: 1.8;
}
.arrangement-legacy-label {
  font-size: 13px;
}
.arrangement-review-state strong,
.arrangement-request-state {
  font-size: 15px;
}
.arrangement-review-state span,
.arrangement-review-state small {
  font-size: 14px;
}
.arrangement-editor-v06 .cost-lines-v06 input,
.arrangement-editor-v06 .cost-lines-v06 select {
  font-size: 16px;
  min-height: 42px;
}
.arrangement-editor-v06 .cost-lines-v06 [data-line-cny] {
  font-size: 16px;
}
.arrangement-grand-total span,
.arrangement-grand-total small {
  font-size: 14px;
}
.arrangement-grand-total strong {
  font-size: 28px;
}
.price-lines-table input,
.price-lines-table select {
  font-size: 16px;
}
.price-lines-table td,
.price-lines-table th {
  font-size: 15px;
}
.price-currency-row,
.price-currency-row label,
.price-lines-table .section-note {
  font-size: 14px;
}
.price-total {
  font-size: 16px;
  line-height: 1.7;
}
.price-total strong {
  font-size: 24px;
}
.cashflow-dialog input,
.cashflow-dialog select,
.cashflow-dialog textarea {
  font-size: 16px;
}
.cashflow-table td,
.account-ledger-table td,
.cashflow-table th {
  font-size: 15px;
  line-height: 1.75;
}
.cashflow-table strong {
  font-size: 17px;
}
.cash-order-summary,
.cash-workflow small,
.cash-submitted,
.cash-vouchers,
.cash-converted {
  font-size: 15px;
  line-height: 1.75;
}
.cash-order-summary strong,
.cashflow-header h2 {
  font-size: 23px;
}
.waiting-review {
  font-size: 16px;
}
.financial-metric-group > h3 {
  font-size: 21px;
}
.financial-metric-group .stat-label {
  font-size: 15px;
}
.financial-metric-group .stat-value {
  font-size: 28px;
  line-height: 1.45;
}
.catalog-picker-control input,
.catalog-picker-control select,
.catalog-picker-control button {
  font-size: 16px;
}
.catalog-picker-control small,
.catalog-picker-hint,
.catalog-legacy {
  font-size: 14px;
}
@media (max-width: 700px) {
  .page-title h1 {
    font-size: 27px;
  }
  .panel-head h2,
  .modal-head h2 {
    font-size: 22px;
  }
  .arrangement-category-heading h3 {
    font-size: 23px;
  }
  .financial-metric-group .stat-value {
    font-size: 23px;
  }
  .source-label,
  .section-note,
  .form-hint,
  .small-description {
    font-size: 14px;
  }
  .page-total-title {
    flex-basis: 95px;
  }
  .page-total-item {
    min-width: 120px;
  }
}
@media print {
  body,
  table,
  th,
  td {
    font-size: 12pt;
  }
  .page-title h1 {
    font-size: 20pt;
  }
  .panel-head h2 {
    font-size: 16pt;
  }
}

/* Search results use the same readable size as the fields. */
.search-combobox-popup,
.search-combobox-option {
  font-size: 16px;
  line-height: 1.65;
}
.search-combobox-group,
.search-combobox-empty {
  font-size: 14px;
  line-height: 1.7;
}

input[type="date"]:not(:disabled):not([readonly]) {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23456258' stroke-width='1.8'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M7 3v4m10-4v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 19px;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  pointer-events: none;
}
.date-picker {
  position: fixed;
  inset: auto;
  margin: 0;
  width: min(415px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  box-sizing: border-box;
  overflow: auto;
  padding: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 38px #142d2940;
}
.date-picker-header,
.date-picker-footer {
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-picker-header strong {
  flex: 1;
  text-align: center;
  font-size: 18px;
}
.date-picker-header button {
  padding: 4px 8px;
  min-width: 32px;
}
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  align-items: center;
  text-align: center;
  margin: 10px 0;
}
.date-picker-grid button {
  min-height: 38px;
  padding: 3px;
}
.date-picker-grid button[aria-current="date"] {
  border-color: var(--teal);
}
.date-picker-grid button[aria-pressed="true"] {
  background: var(--teal);
  color: white;
}
.date-picker-footer {
  justify-content: flex-end;
}
.receipt-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
  padding: 12px 18px 0;
}
.receipt-summary > div {
  display: grid;
  gap: 5px;
  background: #f1f7f4;
  border-radius: 8px;
  padding: 12px;
}
.receipt-summary strong {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}
.receipt-summary .receipt-pending {
  color: #805407;
}
.receipt-summary-note {
  padding: 0 18px;
}
.receipt-group + .receipt-group {
  border-top: 1px solid var(--line);
}
.receipt-group h3 {
  margin: 0;
  padding: 12px 18px;
  background: #f6f9f7;
  font-size: 17px;
}
button.text-button:disabled {
  color: #737c77;
  opacity: 1;
  cursor: not-allowed;
}

.selected-order-menu .menu-section-title {
  margin-top: 9px;
  padding: 7px 10px;
  border-radius: 6px;
  border-left: 3px solid #69998c;
  background: #edf5f1;
  color: #28574b;
  font-size: 16px;
  font-weight: 700;
}
.cash-cny-primary.receipt-pending {
  color: #805407;
}
.price-details {
  position: relative;
}
.price-details summary {
  min-height: 60px;
  padding-right: 130px;
}
.price-details-edit {
  position: absolute;
  right: 14px;
  top: 10px;
  z-index: 1;
}
.order-detail-main {
  min-width: 0;
}
@media print {
  .price-details-edit {
    display: none;
  }
}
@media screen {
  #app:has(> .order-detail-main) {
    max-width: none;
    padding-inline: 18px;
  }
}

.sidebar .nav-icon { width: 19px; height: 19px; flex: 0 0 19px; }
.approval-nav-counts:not([hidden]) { display: flex; gap: 4px; margin: 0 8px 5px; }
.sidebar nav .approval-nav-counts > :is(span, a) {
  display: block;
  background: #eef2ee;
  color: #56655e;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}
.sidebar nav .approval-nav-counts > .has-pending { background: #fff0c7; color: #754900; }
.sidebar nav .approval-nav-counts > a:is(:hover, :focus-visible, [aria-current]) {
  box-shadow: inset 0 0 0 1px currentColor;
}
.approval-section { margin-bottom: 16px; scroll-margin-top: 14px; }
.arrangement-request-state.is-unsubmitted { color: #ba2029; font-weight: 700; }
.receipt-summary.invoice-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
@media (max-width: 650px) { .receipt-summary.invoice-summary { grid-template-columns: 1fr; } }
.cost-lines-table select[data-line-field="currency"] { min-width: 105px; }
.price-currency-row select { max-width: 100%; }

.team-test-mode .local-badge { background: #fff0b8; color: #764600; border-color: #e8b52b; font-weight: 700; }
.team-test-mode .login-card h1::before { content: "团队测试版"; display: block; margin-bottom: 12px; color: #875800; font-size: 18px; }

/* Keep the order identity visible while its financial columns scroll. */
@media screen {
  .orders-table { border-collapse: separate; border-spacing: 0; }
  .orders-head-scroll .orders-table th:first-child,
  .orders-body-scroll .orders-table tr[data-order-row] > td:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    box-shadow: 3px 0 6px #233d3512, 1px 0 0 var(--line);
  }
  .orders-head-scroll .orders-table th:first-child { z-index: 3; background: #f9faf7; }
  .orders-body-scroll .orders-table tr[data-order-row] > td:first-child { z-index: 2; }
  .orders-body-scroll .orders-table tr[data-order-row]:hover > td:first-child { background: #fbfdf9; }
  .orders-body-scroll .orders-table tr[data-order-row].selected-order > td:first-child { background: #e6f2ed; }
}

/* Density follows usable CSS viewport space, including display scaling. */
@media screen and (max-width: 1440px), screen and (max-height: 850px) {
  body { font-size: 15px; line-height: 1.5; }
  button,input,select,textarea { font-size: 14px; line-height: 1.45; }
  button { padding: 7px 11px; }
  button.small,.small { font-size: 13px; padding: 5px 9px; }
  button.text-button,.text-button { font-size: 13px; padding: 3px 5px; }
  input:not([type=checkbox]):not([type=radio]):not([type=file]),select { min-height: 34px; padding-block: 6px; }
  textarea { min-height: 76px; }
  main { padding: 18px; }
  .main-shell > .topbar { height: 48px; padding-inline: 18px; font-size: 13px; }
  .top-right { gap: 12px; }
  .page-title { gap: 12px; margin-bottom: 14px; }
  .page-title h1 { font-size: 23px; line-height: 1.35; margin-bottom: 4px; }
  .subtitle,.source-label,.section-note,.form-hint,.small-description,.order-code,.customer { font-size: 12px; line-height: 1.45; }
  .stats { gap: 12px; margin: 12px 0; }
  .stat { min-width: 0; padding: 11px 14px; }
  .stat-label,.stat-foot { font-size: 12px; line-height: 1.4; }
  .stat-value { font-size: clamp(19px,1.8vw,26px); line-height: 1.3; margin-top: 5px; }
  .stat-value small { font-size: 12px; }
  .stat-foot { margin-top: 3px; }
  .panel { margin-block: 14px; }
  .panel-head { padding: 11px 14px; gap: 8px; }
  .panel-head h2,.modal-head h2 { font-size: 20px; line-height: 1.4; }
  .panel-body,.modal-body { padding: 16px; }
  .field > label,.filter > label,.field label,.filter label { font-size: 13px; line-height: 1.4; }
  .form-grid { gap: 14px; }
  .table-wrap td,.table-wrap th { font-size: 14px; line-height: 1.5; padding: 9px 12px; }
  .pill,.status-pill,.category-pill { padding: 3px 6px; font-size: 12px; }
  .order-select-button,.order-title,.order-menu-link { font-size: 14px; line-height: 1.45; }
  .orders-table td { padding-block: 10px; font-size: 14px; }
  .orders-table td .section-note,.orders-table .customer,.orders-table .order-code { font-size: 12px; line-height: 1.45; }
  .order-code { margin-top: 3px; letter-spacing: 0; }
  .customer { margin-top: 2px; }
  .row-arrangement-link { font-size: 13px; margin-top: 3px; }
  .orders-head-scroll th { height: 39px; font-size: 12px; padding: 8px 12px; }
  .today-divider td { padding: 8px 12px !important; }
  .today-divider small { margin-left: 10px; }
  .page-financial-footer { gap: 12px; padding: 7px 12px; }
  .page-total-title { flex-basis: 88px; font-size: 13px; gap: 3px; }
  .page-total-title small,.page-total-item > span { font-size: 12px; }
  .page-total-item { min-width: 110px; gap: 3px; }
  .page-total-item strong { font-size: 15px; }
  .page-total-values { gap: 12px; }
  .selected-order-menu nav { gap: 2px; padding: 8px; }
  .selection-heading { padding: 12px; }
  .selection-heading h2 { font-size: 17px; margin-block: 5px; }
  .selected-order-menu .menu-section-title { font-size: 14px; margin-top: 6px; padding: 5px 8px; }
  .order-menu-link { padding: 8px 10px; }
  .order-financial-details { margin-block: 10px; }
  .order-financial-details > summary { padding: 9px 12px; font-size: 13px; }
  .tabs button { padding: 8px 10px; font-size: 14px; }
  .order-detail-tabs { top: 0; }
  .arrangement-overview-heading,.arrangement-category-heading { padding: 14px 16px; }
  .arrangement-overview-heading h2,.arrangement-category-heading h3 { font-size: 21px; }
  .arrangement-summary,.arrangement-categories { padding: 10px 14px; gap: 8px 16px; font-size: 14px; }
  .arrangement-workspace-v06 .arrangement-table td,.cashflow-table td,.account-ledger-table td { font-size: 14px; line-height: 1.5; padding: 11px 12px; }
  .arrangement-line-text,.arrangement-note-preview summary { font-size: 13px; line-height: 1.55; }
  .arrangement-editor-v06 .cost-lines-v06 input,.arrangement-editor-v06 .cost-lines-v06 select,
  .cashflow-dialog input,.cashflow-dialog select,.cashflow-dialog textarea,
  .catalog-picker-control input,.catalog-picker-control select,.catalog-picker-control button,
  .price-lines-table input,.price-lines-table select { font-size: 14px; min-height: 34px; }
  .search-combobox-option { font-size: 14px; line-height: 1.5; }
  .receipt-summary { gap: 8px; padding: 10px 14px 0; }
  .receipt-summary > div { padding: 9px 11px; gap: 3px; }
  .receipt-summary strong { font-size: 17px; }
  .financial-metric-group .stat-value { font-size: 23px; }
}
@media screen and (min-width: 701px) {
  .sidebar { display: flex; flex-direction: column; overflow-y: auto; }
  .sidebar > * { flex-shrink: 0; }
  .side-footer { position: static; margin-top: auto; padding-top: 18px; }
}
@media screen and (min-width: 701px) and (max-width: 1440px), screen and (min-width: 701px) and (max-height: 850px) {
  .sidebar { width: 184px; padding: 18px 12px; }
  .main-shell { margin-left: 184px; }
  .side-section { margin: 22px 10px 10px; font-size: 12px; }
  .sidebar nav { gap: 2px; }
  .sidebar nav a { padding: 8px 10px; gap: 9px; font-size: 14px; }
  .sidebar .nav-icon { width: 17px; height: 17px; flex-basis: 17px; }
  .sidebar .primary { margin-top: 16px; }
  .side-footer { font-size: 12px; line-height: 1.6; padding-top: 14px; }
  .side-footer small { font-size: 11px; }
  .approval-nav-counts { margin-inline: 4px; gap: 3px; }
  .sidebar nav .approval-nav-counts > :is(span, a) { font-size: 11px; }
}
@media screen and (max-width: 700px) {
  main { padding: 14px 12px; }
  .page-title { flex-wrap: wrap; }
  .page-title .actions { gap: 6px; }
  .main-shell > .topbar { padding-inline: 12px; }
  .sidebar nav a { font-size: 13px; padding: 7px 8px; }
}

@media screen {
  .orders-list-column { container-type: inline-size; }
}

@media screen and (max-width: 700px) {
  .sidebar { padding: 12px; }
  .sidebar nav { flex-wrap: nowrap; overflow-x: auto; align-items: center; gap: 4px; margin-top: 8px; padding-bottom: 4px; scrollbar-width: thin; }
  .sidebar nav a { flex: 0 0 auto; white-space: nowrap; }
  .sidebar .approval-nav { display: flex; flex: 0 0 auto; align-items: center; gap: 3px; }
  .sidebar .approval-nav-counts:not([hidden]) { margin: 0; flex-wrap: nowrap; }
}

@media screen and (max-width: 700px) {
  .page-title { margin-bottom: 10px; }
  .stats { gap: 8px; margin-block: 10px; }
  .stats .stat { padding: 8px 10px; }
  .stats .stat-label,.stats .stat-foot { font-size: 11px; line-height: 1.3; }
  .stats .stat-value { font-size: 19px; line-height: 1.2; margin-top: 2px; }
  .stats .stat-foot { margin-top: 2px; }
  .orders-panel { margin-block: 10px; }
  .orders-frozen-header .panel-head { padding: 9px 10px; }
  .orders-head-scroll th { height: 35px; }
}
