/* P2 home, lists and simple project creation. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.hub-start { justify-content: flex-end; margin-bottom: 24px; }
.hub-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.hub-metrics .metric { text-decoration: none; border: 0; border-right: 1px solid var(--line); }
.hub-metrics .metric:last-child { border: 0; }
.hub-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; align-items: end; }
.hub-filters > * { min-width: 0; }
.hub-filters select { max-width: 100%; }
.hub-checkbox { display: flex; align-items: center; gap: 10px; }
.hub-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.hub-table th, .hub-table td { padding: 16px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.hub-table th { background: var(--surface-2); }
.hub-table .num { text-align: right; }
.hub-table td a { display: inline-flex; min-height: 44px; align-items: center; }
.hub-table .tag { margin-top: 8px; }
#new-quote-dialog { width: min(760px,calc(100% - 32px)); max-height: 90vh; overflow-y: auto; }
#project-search { display: flex; gap: 10px; align-items: end; margin-block: 18px; }
#project-search .field { flex: 1; min-width: 0; }
#project-choices { display: grid; gap: 8px; margin-bottom: 20px; }
#project-choices a { justify-content: flex-start; text-align: left; }
#project-customer-dialog { width: min(1080px,calc(100% - 24px)); max-height: 95vh; padding: 18px; }
#project-customer-dialog iframe { display: block; width: 100%; height: 65vh; border: 1px solid var(--line); margin-block: 12px; }
.recent a { gap: 12px; }
.todo > div { min-width: 0; }
.todo-action { flex-shrink: 0; text-align: right; }
.result-history { padding-left: 24px; }
#result { scroll-margin-top: 24px; }
#result-form { margin-top: 24px; }
[data-result-order] summary { min-height: 44px; padding-block: 8px; cursor: pointer; }
[data-order-group], [data-billing-order], [data-result-order] { min-width: 0; overflow-wrap: anywhere; }
#result-form [hidden], #result-form[hidden] { display: none !important; }
[data-discard][hidden] { display: none !important; }
.project-quotes td { overflow-wrap: anywhere; }
.order-editor { margin-block: 20px; }
.order-editor .form-grid { margin-bottom: 16px; }
.order-lines { display: grid; gap: 24px; margin-top: 24px; }
.order-card { min-width: 0; border-top: 1px solid var(--line); padding-top: 20px; overflow-wrap: anywhere; }
.order-card .form-grid, .billing-row .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.order-card .field, .billing-row .field, [data-result-field] { min-width: 0; }
.order-card input, .order-card select, .billing-row input, .billing-row select { width: 100%; min-width: 0; max-width: 100%; }
.order-card input[type=checkbox] { width: 24px; min-height: 44px; flex-shrink: 0; }
.order-card details { margin-top: 16px; }
.order-card summary { min-height: 44px; cursor: pointer; }
.billing-row { border: 1px solid var(--line); min-width: 0; margin: 18px 0; padding: 16px; }
.billing-row button { margin-top: 16px; }
.overdue { color: #a92318; font-weight: 700; }
.order-lines { display: table; width: 100%; border-collapse: collapse; table-layout: fixed; }
.order-lines th, .order-lines td { text-align: left; padding: 6px 4px; vertical-align: middle; overflow-wrap: anywhere; }
.order-lines th { background: var(--surface-2); }
.order-lines th:nth-child(1) { width: 4%; }
.order-lines th:nth-child(2) { width: 14%; }
.order-lines th:nth-child(3) { width: 6%; }
.order-lines th:nth-child(4) { width: 9%; }
.order-lines th:nth-child(5) { width: 14%; }
.order-lines th:nth-child(6), .order-lines th:nth-child(7) { width: 13%; }
.order-lines th:nth-child(8) { width: 7%; }
.order-lines th:nth-child(9) { width: 12%; }
.order-lines th:nth-child(10) { width: 8%; }
.order-lines .order-card { display: table-row; padding: 0; }
.order-lines .order-spec { margin: 4px 0 0; font-size: max(17px,.85em); color: var(--muted); }
.order-lines input, .order-lines select { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; padding-inline: 3px; }
.order-lines button { width: 100%; padding: 8px 3px; }
.order-extra summary { min-height: 44px; cursor: pointer; }
.order-extra td { padding-top: 0; border-bottom: 1px solid var(--line); }
.order-extra .form-grid { margin-block: 12px; }
.order-unit-price { display: none; }
.access-record dd { margin: 4px 0 12px; overflow-wrap: anywhere; }
.access-record dt { font-weight: 700; }
.legacy-check, .legacy-check p, .legacy-check a { overflow-wrap: anywhere; }
.legacy-check summary { min-height: 44px; cursor: pointer; }
.legacy-decisions { grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); }
.legacy-decisions form { min-width: 0; }
.legacy-decisions textarea { min-height: 88px; width: 100%; }
@media(max-width:1023px) {
  .order-unit-price { display: block; }
  .order-lines, .order-lines tbody { display: block; }
  .order-lines thead { display: none; }
  .order-lines .order-card { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding-top: 20px; }
  .order-lines td { display: block; padding: 0; }
  .order-card td::before { content: attr(data-label); display: block; color: var(--muted); }
  .order-lines .order-extra { display: block; margin-bottom: 24px; }
  .order-lines .order-extra td { padding-block: 16px; }
}
@media(max-width:600px) {
  .order-lines .order-card { grid-template-columns: 1fr; }
}
.hub-table td { overflow-wrap: anywhere; }
.order-purchase{margin:0;font-size:max(17px,.85em);overflow-wrap:anywhere}.order-purchase + .order-purchase{margin-top:8px}
@media(max-width:600px) {
  .order-card .form-grid, .billing-row .form-grid { grid-template-columns: 1fr; }
}
.project-revision { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; }
.project-quotes .project-revision .tag { margin-top: 0; }
@media(max-width:1000px) {
  .hub-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hub-table, .hub-table tbody { display: block; }
  .hub-table thead { display: none; }
  .hub-table tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 18px; gap: 12px; border-bottom: 1px solid var(--line); }
  .hub-table td { display: block; border: 0; padding: 0; }
  .hub-table td::before { content: attr(data-label); display: block; color: var(--muted); }
  .hub-table .num { text-align: left; }
}
@media(max-width:600px) {
  .todo { flex-wrap: wrap; }
  .todo-action { width: 100%; text-align: left; }
  .hub-filters, .hub-metrics { grid-template-columns: 1fr; }
  .hub-metrics .metric { border-right: 0; border-bottom: 1px solid var(--line); }
  .hub-table tr { grid-template-columns: 1fr; }
  .hub-quotes td:nth-child(2), .hub-quotes td:nth-child(4), .hub-quotes td:nth-child(7) { display: none; }
  .recent a { flex-wrap: wrap; }
  #project-search { flex-wrap: wrap; }
  #project-search .field { flex-basis: 100%; }
  dialog { padding: 18px; }
}
.hub-metrics.finance-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
@media(max-width: 1100px) { .hub-metrics.finance-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width: 600px) { .hub-metrics.finance-metrics { grid-template-columns: minmax(0,1fr); } }
