/* Screen-only mobile quote entry. Does not change paper/print or calculation. */
@media screen and (max-width: 700px) {
  .guided-workflow [aria-labelledby="lines-title"] .pricing-choice-label {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    margin: 4px 0 16px;
  }
  .guided-workflow #pricing-choice {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 46px;
  }
  .guided-workflow .editor-table,
  .guided-workflow .editor-table tbody,
  .guided-workflow .editor-table tbody tr,
  .guided-workflow #price-groups,
  .guided-workflow .group-card,
  .guided-workflow .group-card .field-grid,
  .guided-workflow .target-panel {
    min-width: 0;
    max-width: 100%;
  }
  .guided-workflow .editor-table tbody tr {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
  }
  /* Give before/after prices their own labelled rows, rather than narrow pairs. */
  .guided-workflow .editor-table tbody td:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .guided-workflow.negotiated-mode .editor-table tbody td.negotiated-only {
    grid-column: 1 / -1;
    grid-row: 4;
    padding: 10px;
    background: #f0f6f2;
    border: 1px solid #d4e2d9;
    border-radius: 8px;
  }
  .guided-workflow .editor-table tbody td:nth-child(5) {
    grid-column: 1;
    grid-row: 4;
  }
  .guided-workflow .editor-table tbody td:nth-child(6) {
    grid-column: 2;
    grid-row: 4;
    align-self: end;
    white-space: normal;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
    font-size: 18px;
  }
  .guided-workflow.negotiated-mode .editor-table tbody td:nth-child(5),
  .guided-workflow.negotiated-mode .editor-table tbody td:nth-child(6) {
    grid-row: 5;
  }
  /* Total-priced work items have scope quantities, not individual prices. */
  .guided-workflow .editor-table tbody tr:has(.grouped-price) td:nth-child(3),
  .guided-workflow .editor-table tbody tr:has(.grouped-price) td:nth-child(4) {
    display: none;
  }
  .guided-workflow .editor-table tbody tr:has(.grouped-price) td:nth-child(5),
  .guided-workflow .editor-table tbody tr:has(.grouped-price) td:nth-child(6) {
    grid-row: 3;
  }
  .guided-workflow .editor-table tbody tr:has(.grouped-price) td:nth-child(5)::before {
    content: '工作範圍數量';
  }
  .guided-workflow .editor-table tbody tr:has(.grouped-price) td:nth-child(6)::before {
    content: '計價方式';
  }
  .guided-workflow .group-card {
    padding: 14px 12px;
    margin: 14px 0;
  }
  .guided-workflow .group-card h3 {
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
  }
  .guided-workflow .group-card .field-grid,
  .guided-workflow .target-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .guided-workflow .group-card label,
  .guided-workflow .target-panel label,
  .guided-workflow .reverse-editor label {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
  }
  .guided-workflow .editor-table input:not([type=checkbox]),
  .guided-workflow .editor-table textarea,
  .guided-workflow .editor-table select,
  .guided-workflow .group-card input,
  .guided-workflow .target-panel input,
  .guided-workflow .target-panel select {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    font-size: 16px;
  }
  .guided-workflow .group-card input,
  .guided-workflow .editor-table input[inputmode] {
    font-variant-numeric: tabular-nums;
  }
  .guided-workflow .reverse-editor,
  .guided-workflow .reverse-editor summary,
  .guided-workflow .reverse-editor button,
  .guided-workflow .target-result,
  .guided-workflow .calculation-status,
  .guided-workflow .workbench-totals b {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
