.pm-page {
    background: #f2f5f9;
    color: #172b44;
    font-family: "Segoe UI", Arial, sans-serif;
}

.pm-page .site-header {
    padding: 24px 28px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 35, 65, 0.12);
}

.pm-container { max-width: 1100px; padding: 0; }
.pm-calculator { padding: 0; background: none; box-shadow: none; overflow: visible; }
.pm-calculator > .tool-category-label {
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    background: none;
    color: #5c7290;
    letter-spacing: 0.08em;
}

.pm-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.pm-heading h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -0.8px; text-align: left; line-height: 1.2; }
.pm-heading p { margin: 0; color: #607088; font-size: 15px; line-height: 1.6; }
.pm-estimate-link { flex-shrink: 0; color: #245c9c; text-decoration: none; font-size: 14px; font-weight: 600; }
.pm-estimate-link:hover { text-decoration: underline; }
.pm-workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(340px, 1fr); align-items: start; gap: 22px; }
.pm-inputs { display: grid; gap: 20px; min-width: 0; }
.pm-card { min-width: 0; padding: 24px; background: #fff; border: 1px solid #dce4ee; border-radius: 16px; box-shadow: 0 3px 12px rgba(30, 52, 82, 0.025); }
.pm-card-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
.pm-card h2 { margin: 0; text-align: left; font-size: 19px; letter-spacing: -0.3px; }
.pm-card-heading p { margin: 5px 0 0; font-size: 13px; line-height: 1.5; color: #65768c; }
.pm-step { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 10px; background: #edf3fa; color: #315e90; font-size: 12px; font-weight: 700; }
.pm-optional { color: #728197; font-size: 11px; font-weight: 400; letter-spacing: 0; margin-left: 6px; }
.pm-field { min-width: 0; }
.pm-field label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.pm-page .pm-field input, .pm-page .pm-field select, .pm-page .pm-field textarea {
    width: 100%; margin: 0; padding: 11px 12px; border: 1px solid #cad5e2;
    border-radius: 8px; background: #fff; color: #172b44; font: inherit; font-size: 16px; min-height: 44px;
}
.pm-page .pm-field textarea { resize: vertical; line-height: 1.5; }
.pm-page input::placeholder { color: #8592a4; opacity: 1; }
.pm-page input:focus-visible, .pm-page select:focus-visible, .pm-page textarea:focus-visible, .pm-page button:focus-visible,
.pm-page summary:focus-visible, .pm-page a:focus-visible, .pm-marking-table:focus-visible {
    outline: 3px solid #79a8e5; outline-offset: 3px;
}
.pm-line-inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: 24px; }
.pm-long-line { padding: 18px; margin-bottom: 16px; border: 1px solid #dce4ee; border-radius: 10px; background: #fbfcfe; }
.pm-line-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.pm-line-heading h3 { margin: 0; color: #315e90; font-size: 14px; }
.pm-remove-line { margin: 0; padding: 6px 10px; min-height: 36px; border: 1px solid #dce4ee; border-radius: 6px; background: #fff; color: #7c4040; font: inherit; font-size: 12px; cursor: pointer; }
.pm-add-line { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px dashed #7b9bbd; border-radius: 8px; background: #f2f7fd; color: #245c9c; font: inherit; font-weight: 600; cursor: pointer; }
.pm-add-line:hover { background: #e7f0fc; }
.pm-line-reference { margin-top: 16px; }
.pm-long-line .pm-line-inputs { margin-top: 16px; gap: 16px; }
.pm-line-basis { font-size: 11px; margin-top: 12px; }
.pm-line-quantity { margin: 8px 0 0; font-size: 12px; font-weight: 600; color: #315e90; }
.pm-material-summary { padding: 15px; margin-bottom: 12px; border-radius: 9px; background: #edf3fa; color: #214c7b; }
.pm-material-summary h3 { margin: 0; font-size: 13px; line-height: 1.5; }
.pm-material-summary p { margin: 6px 0 0; font-size: 12px; }
.pm-material-summary .pm-material-amount { font-size: 26px; font-weight: 650; overflow-wrap: anywhere; }
.pm-material-summary h4 { margin: 16px 0 0; font-size: 12px; line-height: 1.5; }
.pm-material-summary .pm-thickness { margin: 0; }
.pm-material-summary .pm-thickness > div { gap: 12px; line-height: 1.5; }
.pm-material-summary .pm-thickness dt { color: inherit; }
.pm-line-summary { padding: 10px 0; border-bottom: 1px solid #e8edf3; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.pm-line-summary p { margin: 5px 0 0; color: #607490; }
.pm-line-summary p:empty { display: none; }
.pm-special-card > .pm-rate-settings { margin-bottom: 22px; }
.pm-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 25px; margin-bottom: 8px; }
.pm-label-row label { margin: 0; }
.pm-label-row output { padding: 3px 8px; background: #eaf2fd; color: #255a99; border-radius: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pm-page .pm-field input[type="range"] { padding: 0; min-height: 24px; height: 24px; accent-color: #2e64a4; border: 0; background: none; cursor: pointer; }
.pm-range-labels { display: flex; justify-content: space-between; color: #7c8a9c; font-size: 11px; }
.pm-input-unit { position: relative; }
.pm-page .pm-input-unit input { padding-right: 36px; }
.pm-input-unit > span { position: absolute; right: 13px; top: 12px; color: #6d7e94; font-size: 14px; pointer-events: none; }
.pm-help { margin: 16px 0 0; color: #66768b; font-size: 13px; line-height: 1.6; font-weight: 400; }
.pm-help a { color: #255e9f; }
.pm-rate-settings { margin-top: 20px; }
.pm-rate-settings .pm-field { margin-bottom: 14px; }
.pm-rate-settings fieldset { min-width: 0; margin: 18px 0 0; padding: 14px; border: 1px solid #dce4ee; border-radius: 8px; }
.pm-rate-settings legend { padding: 0 5px; font-size: 13px; font-weight: 600; }
.pm-rate-settings fieldset .pm-help { margin: 0 0 14px; }
.pm-size-details { margin-top: 6px; text-align: left; font-weight: 400; }
.pm-page .pm-marking-group .pm-size-details summary { display: block; padding: 4px 0; min-height: 24px; border: 0; background: none; color: #255e9f; font-size: 11px; font-weight: 400; }
.pm-size-details label { display: block; margin: 8px 0 4px; font-size: 11px; }
.pm-page .pm-marking-table .pm-size-details select, .pm-page .pm-marking-table .pm-size-details textarea, .pm-page .pm-marking-table .pm-size-details input { width: 100%; max-width: 100%; box-sizing: border-box; padding: 8px; min-height: 40px; margin: 0; border: 1px solid #cad5e2; border-radius: 6px; background: white; color: #172b44; font: inherit; font-size: 13px; text-align: left; }
.pm-size-details textarea { resize: vertical; }
.pm-size-help { color: #65768c; font-size: 11px; line-height: 1.5; }
.pm-size-help:empty { display: none; }
.pm-search-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.pm-search-bar > .pm-field { flex: 1; }
.pm-page .pm-search-bar input[type="search"] { font-size: 14px; background: #f8fafc; }
.pm-filter-toggle { display: flex; align-items: center; gap: 7px; flex-shrink: 0; color: #52677f; font-size: 12px; cursor: pointer; }
.pm-page .pm-filter-toggle input { width: 17px; height: 17px; margin: 0; padding: 0; accent-color: #2e64a4; }
.pm-filter-status { margin: 0; color: #66768b; font-size: 13px; line-height: 1.5; }
.pm-filter-status:not(:empty) { margin: 0 0 14px; }
.pm-marking-group { border: 1px solid #dce4ee; border-radius: 10px; overflow: hidden; }
.pm-marking-group + .pm-marking-group { margin-top: 10px; }
.pm-marking-group summary, .pm-result-details summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; }
.pm-marking-group summary::-webkit-details-marker, .pm-result-details summary::-webkit-details-marker { display: none; }
.pm-marking-group summary { padding: 16px; }
.pm-marking-group summary:hover { background: #f5f8fc; }
.pm-marking-group[open] summary { border-bottom: 1px solid #dce4ee; background: #f8fafc; }
.pm-group-count { margin-left: auto; color: #738298; font-size: 12px; font-weight: 400; }
.pm-disclosure { flex-shrink: 0; display: inline-block; color: #7286a0; font-size: 20px; font-weight: 400; line-height: 1; }
details[open] > summary > .pm-disclosure { transform: rotate(45deg); }
.pm-page .pm-marking-table { max-height: 340px; overflow: auto; margin: 0; scrollbar-width: thin; }
.pm-page .pm-marking-table table { margin: 0; table-layout: fixed; }
.pm-page .pm-marking-table th, .pm-page .pm-marking-table td { border: 0; border-bottom: 1px solid #edf0f5; padding: 9px 12px; }
.pm-page .pm-marking-table thead th { position: sticky; top: 0; z-index: 1; background: #f8fafc; color: #738298; font-size: 11px; font-weight: 600; }
.pm-page .pm-marking-table th:first-child { width: 52%; }
.pm-page .pm-marking-table th:nth-child(2) { width: 22%; }
.pm-page .pm-marking-table th:last-child { width: 26%; text-align: right; }
.pm-marking-table td:first-child { font-size: 12px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.pm-marking-table td:last-child { color: #76859a; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.pm-page .pm-marking-table input { width: 100%; min-width: 0; min-height: 40px; margin: 0; padding: 8px; border: 1px solid #d6e0ec; border-radius: 6px; font-size: 16px; text-align: center; background: #fff; color: #183d67; box-sizing: border-box; }
.pm-marking-table tr.pm-entered { background: #f0f6ff; }
.pm-page input[aria-invalid="true"], .pm-page select[aria-invalid="true"], .pm-page textarea[aria-invalid="true"] { border-color: #c94747; background: #fff6f6; }
.pm-selection-note { margin-top: 14px; font-size: 12px; }
.pm-estimate { position: sticky; top: 20px; border-top: 3px solid #365f91; scroll-margin-top: 20px; }
.pm-estimate-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pm-live { display: inline-flex; align-items: center; gap: 5px; color: #4f7180; font-size: 11px; }
.pm-live > span { width: 6px; height: 6px; border-radius: 50%; background: #4b9479; }
.pm-estimate > .pm-help { margin-top: 6px; font-size: 12px; }
.pm-error { padding: 12px; background: #fff3f1; color: #a5362d; border: 1px solid #f0cdc8; border-radius: 8px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.pm-empty { padding: 36px 12px 30px; text-align: center; }
.pm-empty h3 { margin: 16px 0 8px; font-size: 16px; font-weight: 600; }
.pm-empty p { margin: 0 auto; max-width: 230px; color: #7a8899; font-size: 13px; line-height: 1.7; }
.pm-estimate .result { margin-top: 20px; font-size: 14px; font-weight: 400; }
.pm-material-name { margin: 0 0 12px; font-size: 12px; font-weight: 600; color: #607490; }
.pm-basis-summary { margin: 0 0 14px; font-size: 12px; }
.pm-totals { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.pm-total { padding: 16px 14px; border-radius: 10px; background: #edf3fa; color: #214c7b; }
.pm-total-primary { background: #163e69; color: #fff; }
.pm-total > span { font-size: 12px; }
.pm-total > div { margin-top: 10px; line-height: 1.15; overflow-wrap: anywhere; }
.pm-total strong { font-size: 29px; font-weight: 650; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.pm-total div > span { font-size: 13px; opacity: 0.85; }
.pm-total-note { margin-top: 10px; font-size: 11px; }
.pm-breakdown { margin-top: 24px; }
.pm-breakdown h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; }
.pm-breakdown table { margin: 0; font-size: 12px; }
.pm-breakdown th, .pm-breakdown td { padding: 11px 0; border-bottom: 1px solid #e8edf3; background: none; }
.pm-breakdown thead th { padding-top: 0; color: #7c8b9c; font-size: 11px; font-weight: 400; }
.pm-breakdown tbody th { font-weight: 400; color: #536980; }
.pm-breakdown th:not(:first-child), .pm-breakdown td { text-align: right; font-variant-numeric: tabular-nums; padding-left: 10px; overflow-wrap: anywhere; }
.pm-breakdown td { font-weight: 600; }
.pm-breakdown small { display: block; margin-top: 3px; font-size: 10px; }
.pm-area-total { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; font-size: 12px; color: #738298; }
.pm-area-total strong { color: #38516f; font-weight: 600; }
.pm-result-details { border-top: 1px solid #e2e9f1; }
.pm-result-details summary { min-height: 50px; font-size: 13px; }
.pm-result-details .pm-disclosure { margin-left: auto; }
.pm-result-details > .pm-help { margin: 0 0 12px; font-size: 12px; }
.pm-rates { margin: 0 0 14px; }
.pm-rates > div { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 8px 0; font-size: 12px; border-bottom: 1px dashed #e7ecf3; }
.pm-rates dt { color: #65788e; }
.pm-rates dd { margin: 0; text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pm-rates small { color: #788a9d; font-size: 10px; }
.pm-project-details .pm-field { margin-bottom: 14px; }
.pm-project-details label { font-size: 12px; }
.pm-export { display: flex; justify-content: center; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 12px 18px; margin-top: 12px; border: 0; border-radius: 8px; background: #255c99; color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.pm-export:hover { background: #174779; }
.pm-export-note { margin: 10px 0 0; text-align: center; font-size: 11px; line-height: 1.6; color: #7e8b9d; }
.pm-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.pm-page .hidden, .pm-page [hidden] { display: none !important; }

@media (max-width: 900px) {
    .pm-workspace { grid-template-columns: minmax(0, 1fr); }
    .pm-estimate { position: static; }
    .pm-heading { align-items: flex-start; }
    .pm-heading h1 { font-size: 29px; }
    .pm-estimate-link { margin-top: 6px; }
    .pm-totals { gap: 16px; }
}

@media (max-width: 540px) {
    .pm-page { padding: 14px; }
    .pm-page .site-header { margin-top: 0; padding: 20px; }
    .pm-page .site-identity h1 { font-size: 24px; text-align: left; }
    .pm-page .site-tagline { font-size: 13px; line-height: 1.5; }
    .pm-heading { flex-direction: column; gap: 8px; margin-bottom: 20px; }
    .pm-heading h1 { font-size: 28px; }
    .pm-heading p { font-size: 14px; }
    .pm-card { padding: 20px 16px; border-radius: 12px; }
    .pm-card h2 { font-size: 17px; }
    .pm-card-heading { gap: 10px; margin-bottom: 20px; }
    .pm-step { flex-basis: 30px; height: 30px; border-radius: 8px; }
    .pm-line-inputs { gap: 16px; margin-top: 20px; }
    .pm-search-bar { flex-wrap: wrap; gap: 12px; }
    .pm-search-bar > .pm-field { flex-basis: 100%; }
    .pm-filter-toggle { min-height: 24px; }
    .pm-page .pm-marking-table th, .pm-page .pm-marking-table td { padding: 8px; }
    .pm-page .pm-marking-table th:first-child { width: 46%; }
    .pm-page .pm-marking-table th:nth-child(2) { width: 26%; }
    .pm-page .pm-marking-table th:last-child { width: 28%; }
    .pm-page .pm-marking-table th { font-size: 10px; }
    .pm-marking-table td:first-child { font-size: 11px; }
    .pm-group-count { font-size: 11px; }
    .pm-totals { gap: 10px; }
    .pm-total { padding: 16px 12px; }
    .pm-total strong { font-size: 28px; }
}

@media print {
    .pm-page { padding: 0; background: #fff; }
    .pm-page #header-placeholder, .pm-page #footer-placeholder, .pm-inputs, .pm-estimate-link,
    .pm-export, .pm-export-note, .pm-project-details, .pm-live { display: none; }
    .pm-workspace { display: block; }
    .pm-estimate { position: static; box-shadow: none; }
}
