.estimate-fields { border:0; padding:0; margin:0; min-width:0; }
/* A locked box has to look locked. On a sent estimate the date and department
   looked exactly like the name and job beside them, and nobody could tell which
   of them could still be changed. */
.estimate-fields input:disabled:not([type=checkbox]), .estimate-fields select:disabled, .estimate-fields textarea:disabled { background:var(--sunken); color:var(--muted); cursor:not-allowed; }
.estimate-heading, .estimate-toolbar, .estimate-tools, .estimate-table-top, .estimate-detail-toolbar, .estimate-item-tools, .estimate-footer, .estimate-summary, .estimate-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.estimate-editor { padding:18px 20px; }
.estimate-heading { margin-bottom:14px; }
.estimate-heading h1 { display:inline-block; margin:0 0 0 18px; vertical-align:middle; font-size:1.3rem; }
.estimate-meta { display:grid; grid-template-columns:1.3fr 1.7fr .8fr 1fr; gap:14px; }
.estimate-meta label, .estimate-extra-fields label, .estimate-import-panel label, .estimate-item-tools label, .estimate-item-details label, .estimate-notes { display:flex; flex-direction:column; gap:5px; font-size:12px; }
.estimate-editor input, .estimate-editor select { width:100%; min-width:0; margin:0; padding:7px 9px; font-size:13px; }
.estimate-extra { margin-top:12px; }
.estimate-extra summary { color:var(--muted); font-size:12px; cursor:pointer; }
.estimate-extra-fields { display:grid; grid-template-columns:2fr 1fr; gap:12px; margin-top:10px; }
/* clip, not hidden: hidden makes the card a scroll box of its own, and the line
   table's headings could then only stick inside the card, never to the page. */
.estimate-workspace { padding:0; overflow:clip; }
.estimate-toolbar { padding:18px 20px 14px; }
.estimate-toolbar h2 { margin:0 0 4px; font-size:1.06rem; }
.estimate-toolbar .muted { font-size:12px; }
.estimate-tools { justify-content:flex-end; }
.estimate-workspace button { font-size:12px; border-radius:5px; padding:7px 10px; }
.estimate-import-panel { display:grid; grid-template-columns:1fr 1.3fr; gap:24px; margin:0 20px 18px; padding:16px; background:var(--sunken); border:1px solid var(--line); border-radius:6px; }
.estimate-import-panel input, .estimate-import-panel select { width:100%; font-size:13px; margin:0; }
.estimate-import-panel label { margin-bottom:10px; }
.estimate-import-panel p { font-size:12px; }
.estimate-file input[type=file] { display:block; padding:8px; }
.estimate-source, .estimate-warnings { font-size:12px; margin:0 20px 12px; }
.estimate-warnings summary { cursor:pointer; color:var(--warn); }
.estimate-table-top { padding:10px 20px; border-top:1px solid var(--line); background:var(--sunken); font-size:12px; }
.estimate-period, .estimate-detail-tabs { display:flex; }
.estimate-period button { border-radius:0; background:var(--card); color:var(--muted); min-width:100px; }
.estimate-period button:first-child { border-radius:5px 0 0 5px; }
.estimate-period button:last-child { border-radius:0 5px 5px 0; margin-left:-1px; }
.estimate-period button[aria-pressed=true] { background:var(--brand); color:var(--on-brand); font-weight:600; border-color:var(--blueprint); }
.estimate-scroll { overflow:auto; max-width:100%; }
.estimate-service-table { width:100%; min-width:1150px; border-collapse:collapse; table-layout:fixed; font-size:12px; line-height:1.4; }
.estimate-service-table .es-edit { width:73px; }
.estimate-service-table .es-order { width:52px; }
.estimate-service-table .es-check { width:28px; }
.estimate-service-table .es-name { width:17%; }
.estimate-service-table .es-code { width:19%; }
.estimate-service-table .es-type { width:12%; }
.estimate-service-table .es-billing { width:105px; }
.estimate-service-table .es-visits { width:54px; }
.estimate-service-table .es-money { width:100px; }
.estimate-service-table .es-margin { width:66px; }
.estimate-service-table th, .estimate-service-table td { padding:8px 6px; vertical-align:middle; text-align:left; border-bottom:1px solid var(--line); }
.estimate-service-table th { background:var(--card); font-size:11px; font-weight:600; color:var(--muted); white-space:normal; letter-spacing:0; text-transform:none; }
.estimate-service-table .num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.estimate-service-row { background:var(--card); }
.estimate-service-table > tbody:nth-of-type(even) > .estimate-service-row { background:color-mix(in srgb,var(--sunken) 45%,var(--card)); }
.estimate-service-table > tbody.is-open > .estimate-service-row { background:color-mix(in srgb,var(--blueprint) 8%,var(--card)); }
.estimate-service-table .estimate-toggle { min-width:61px; padding:6px 7px; }
.estimate-service-table input, .estimate-service-table select, .estimate-service-table textarea { font:inherit; color:var(--ink); width:100%; min-width:0; margin:0; border:1px solid var(--line); border-radius:3px; padding:6px; background:var(--field); }
.estimate-service-table input[type=number] { text-align:right; font-variant-numeric:tabular-nums; appearance:textfield; -moz-appearance:textfield; }
.estimate-service-table input[type=number]::-webkit-inner-spin-button { -webkit-appearance:none; }
.estimate-service-table input[type=checkbox] { width:15px; height:15px; accent-color:var(--good); vertical-align:middle; }
.estimate-service-table input:focus, .estimate-service-table select:focus { outline:2px solid var(--blueprint); outline-offset:1px; }
.estimate-code { display:block; overflow-wrap:anywhere; font-size:11px; line-height:1.5; }
.estimate-service-table .estimate-service-detail > td { padding:0; border-bottom:2px solid var(--blueprint); }
.estimate-service-editor { padding:10px; background:color-mix(in srgb,var(--sunken) 60%,var(--card)); box-shadow:inset 3px 0 var(--blueprint); }
.estimate-detail-toolbar { margin-bottom:10px; }
.estimate-detail-tabs button { background:transparent; color:var(--muted); border-radius:4px 4px 0 0; border-bottom:2px solid transparent; }
.estimate-detail-tabs button[aria-pressed=true] { background:var(--card); color:var(--ink); border-bottom-color:var(--blueprint); }
.estimate-item-tools { justify-content:flex-start; align-items:flex-end; margin:10px 0; }
.estimate-item-tools label { text-transform:none; letter-spacing:0; }
.estimate-item-tools select { width:320px; }
.estimate-item-tools button { margin:0; }
.estimate-item-table { width:100%; table-layout:fixed; border-collapse:collapse; background:var(--card); }
.estimate-item-table th, .estimate-item-table td { padding:5px 4px; }
.estimate-item-actions { white-space:nowrap; }
.estimate-item-actions button { padding:5px 7px; margin:0 0 0 3px; }
.estimate-item-table .estimate-item-details { display:grid; grid-template-columns:2fr 1.7fr 1fr .6fr 1fr; gap:12px; padding:12px; background:var(--sunken); }
.estimate-item-details label, .estimate-notes { text-transform:none; letter-spacing:0; color:var(--muted); }
.estimate-price-note { grid-column:1 / -1; color:var(--muted); font-size:11px; }
.estimate-item-table .is-excluded > tr:first-child { opacity:.55; }
.estimate-items-empty { padding:24px !important; text-align:center !important; color:var(--muted); }
.estimate-notes { padding:12px; }
.estimate-notes textarea { background:var(--field); width:100%; margin-top:6px; }
.estimate-empty { padding:36px 20px; text-align:center; max-width:650px; margin:auto; }
.estimate-empty h3 { font-size:1.1rem; }
.estimate-empty p { font-size:14px; color:var(--muted); }
.estimate-footer { padding:20px; border-top:1px solid var(--line); }
.estimate-footer > div:first-child { font-size:12px; }
.estimate-summary { gap:28px; text-align:right; }
.estimate-summary span, .estimate-summary strong { display:block; }
.estimate-summary span { font-size:11px; color:var(--muted); margin-bottom:4px; }
.estimate-summary strong { font-size:17px; font-variant-numeric:tabular-nums; }
.estimate-grand-total { padding-left:24px; border-left:1px solid var(--line); }
.estimate-grand-total strong { font-size:24px; }
.estimate-actions { justify-content:flex-start; padding:0 20px 14px; }
/* Why Save or Preview did not happen, on a row of its own in the bar that stays
   at the foot of the screen. The page's own message box is at the top, out of
   sight from here. */
#estimate-near-message { flex:0 0 100%; margin:0; box-sizing:border-box; }
.estimate-confirm { display:flex; align-items:center; gap:8px; text-transform:none; letter-spacing:0; font-size:12px; margin:0; }
.estimate-confirm input { width:auto; margin:0; }
.estimate-workspace > p.muted { margin:0 20px 14px; font-size:12px; }
.estimate-footnote { line-height:1.6; max-width:1050px; }
.estimate-list-row { display:flex; width:100%; justify-content:space-between; text-align:left; gap:14px; margin-top:10px; padding:18px; }
.estimate-list-row strong, .estimate-list-row .muted { display:block; }
.estimate-list-status { white-space:nowrap; }
.estimate-list-status.good { color:var(--good, #1f7a4d); }
.estimate-list-status.bad { color:var(--bad); font-weight:600; }
.estimate-mobile-hint { display:none; }
.estimate-type-choices { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:12px 0 24px; }
.estimate-type-choices button { padding:22px; text-align:left; border:1px solid var(--line); background:var(--card); white-space:normal; }
.estimate-type-choices strong, .estimate-type-choices span { display:block; }
.estimate-type-choices strong { font-size:18px; margin-bottom:8px; color:var(--ink); }
.estimate-type-choices span { font-size:13px; color:var(--muted); line-height:1.5; }
.estimate-type-choices .estimate-type-action { margin-top:18px; color:var(--blueprint); font-weight:600; }
.estimate-type-choices button:hover { border-color:var(--blueprint); background:var(--sunken); }
.estimate-type-label { display:block; color:var(--muted); font-size:12px; margin-top:7px; }
.estimate-budget-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:8px 0 20px; }
.estimate-budget-heading h1 { font-size:1.5rem; margin:14px 0 0; }
.estimate-budget-layout { display:grid; grid-template-columns:250px minmax(0,1fr); gap:18px; align-items:start; }
.estimate-budget-setup { padding:18px; margin:0; min-width:0; }
.estimate-budget-setup h2 { font-size:15px; margin:0 0 16px; }
.estimate-budget-setup label { display:flex; flex-direction:column; gap:6px; margin:12px 0; font-size:11px; }
.estimate-budget-setup input, .estimate-budget-setup select, .estimate-budget-setup textarea { width:100%; min-width:0; margin:0; font-size:12px; padding:9px; }
.estimate-budget-setup p { font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.estimate-budget-setup button { font-size:12px; width:100%; white-space:normal; }
.estimate-budget-import { margin-top:22px; padding-top:18px; border-top:1px solid var(--line); }
.estimate-budget-import input[type=file] { padding:4px 0; border:0; font-size:11px; }
.estimate-budget-import input[type=file]::file-selector-button { font:inherit; padding:7px; margin-right:8px; }
.estimate-budget-workspace { min-width:0; margin:0; }
/* 1,216px: narrow enough to sit on the page beside the setup panel on a 1,600px
   window, so it scrolls with the page with its headings in view. */
.estimate-budget-table { min-width:1216px; width:100%; border-collapse:collapse; table-layout:fixed; font-size:12px; }
.estimate-budget-table th, .estimate-budget-table td { border-bottom:1px solid var(--line); padding:6px 5px; text-align:left; vertical-align:middle; }
.estimate-budget-table th { color:var(--muted); background:var(--sunken); text-transform:none; font-size:11px; letter-spacing:0; white-space:normal; }
.estimate-budget-table input, .estimate-budget-table textarea, .estimate-budget-table select { width:100%; min-width:0; color:var(--ink); background:var(--field); border:1px solid var(--line); border-radius:3px; padding:6px; margin:0; font:inherit; }
.estimate-budget-table textarea { resize:vertical; min-height:44px; display:block; line-height:1.4; }
.estimate-budget-table input[type=checkbox] { width:15px; height:15px; accent-color:var(--good); }
.estimate-budget-table input[type=number] { appearance:textfield; -moz-appearance:textfield; text-align:right; }
.estimate-budget-table input[type=number]::-webkit-inner-spin-button { -webkit-appearance:none; }
.estimate-budget-table :is(input,textarea,select):focus { outline:2px solid var(--blueprint); outline-offset:1px; }
.estimate-budget-table small { display:block; color:var(--muted); font-size:10px; margin-top:4px; }
.estimate-full-code { display:block; margin-top:6px; font-size:11px; line-height:1.5; white-space:normal; overflow-wrap:anywhere; color:var(--ink); }
.estimate-full-code:empty { display:none; }
.estimate-preview { padding:0; overflow:hidden; }
.estimate-preview h1 { margin:12px 0 6px; font-size:1.5rem; }
.estimate-preview-meta { display:grid; grid-template-columns:2fr 1fr 1.5fr 1.5fr; gap:18px; padding:20px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.estimate-preview-meta span, .estimate-preview-meta strong { display:block; overflow-wrap:anywhere; }
.estimate-preview-meta span { font-size:11px; color:var(--muted); margin-bottom:6px; }
.estimate-preview-meta strong { font-size:14px; }
.estimate-preview-note, .estimate-preview-memo { margin:16px 20px; font-size:12px; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; }
.estimate-preview > .notice, .estimate-preview > #estimate-message:not(:empty) { margin:16px 20px; }
.estimate-preview-table { width:100%; min-width:900px; border-collapse:collapse; table-layout:fixed; font-size:12px; }
.estimate-preview-table th, .estimate-preview-table td { padding:12px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; white-space:pre-wrap; overflow-wrap:anywhere; }
.estimate-preview-table th { background:var(--sunken); color:var(--muted); font-size:11px; }
.estimate-preview-table .num { text-align:right; font-variant-numeric:tabular-nums; }
.estimate-preview-section, .estimate-preview-subtotal { background:var(--sunken); font-weight:600; }
.estimate-preview .estimate-footer > .muted { max-width:650px; font-size:12px; line-height:1.6; }
.estimate-budget-table .num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.estimate-budget-table .estimate-budget-section td { background:var(--brand); color:var(--on-brand); padding-top:9px; padding-bottom:9px; }
.estimate-budget-section input:not([type=checkbox]) { background:transparent; color:var(--on-brand); border-color:color-mix(in srgb,var(--on-brand) 30%,transparent); font-weight:600; }
.estimate-budget-section button { background:transparent; color:var(--on-brand); }
.estimate-budget-table .estimate-budget-subtotal { background:color-mix(in srgb,var(--good) 10%,var(--card)); color:var(--ink); font-weight:600; }
.estimate-budget-table .estimate-budget-subtotal td { padding-top:10px; padding-bottom:10px; }
.estimate-budget-add .estimate-item-tools { margin:4px 0 14px; }
.estimate-budget-add .estimate-item-tools select { width:320px; }
.estimate-budget-table .is-excluded > td { opacity:.5; }
.estimate-budget-layout .sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
@media(max-width:1000px) {
  .estimate-budget-layout { grid-template-columns:1fr; }
  .estimate-budget-setup > fieldset { display:grid; grid-template-columns:1fr 1fr; gap:0 14px; }
  .estimate-budget-setup > fieldset p { grid-column:1 / -1; }
}
.estimate-service-table .sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
@media(max-width:800px) {
  .estimate-preview-meta { grid-template-columns:1fr 1fr; }
  .estimate-meta { grid-template-columns:1fr 1fr; }
  .estimate-heading h1 { display:block; margin:10px 0 0; }
  .estimate-mobile-hint { display:block; font-size:11px; margin:6px 14px; }
  .estimate-import-panel, .estimate-extra-fields { grid-template-columns:1fr; }
}
@media(max-width:500px) {
  .estimate-preview-meta { grid-template-columns:1fr; padding:14px; }
  .estimate-type-choices, .estimate-budget-setup > fieldset { grid-template-columns:1fr; }
  .estimate-budget-setup, .estimate-type-choices button { padding:14px; }
  .estimate-editor { padding:14px; }
  .estimate-meta { grid-template-columns:1fr; gap:8px; }
  .estimate-toolbar, .estimate-table-top, .estimate-footer { padding:14px; }
  .estimate-tools { width:100%; justify-content:flex-start; }
  .estimate-summary { width:100%; gap:12px; justify-content:space-between; }
  .estimate-grand-total { padding-left:12px; }
  .estimate-grand-total strong { font-size:20px; }
  .estimate-summary strong { font-size:16px; }
  .estimate-actions { padding:0 14px 14px; }
}
