:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #17293a;
  background: #edf2f6;
  --teal: #09655c;
  --line: #dce5eb;
  --muted: #526475;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.wrap { width: min(1120px, calc(100% - 40px)); margin: auto; }
header { background: #142e3e; color: white; }
header .wrap { display: flex; gap: 12px; align-items: center; min-height: 64px; font-weight: 650; }
.mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: #102d32; background: #9be4cc; }
main { padding-block: 34px 48px; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); letter-spacing: -.045em; }
h2 { font-size: 1.25rem; }
p { color: var(--muted); margin-top: 6px; }
.project-total { padding: 16px 20px; min-width: 210px; background: #d9eee7; border: 1px solid #c0ded4; border-radius: 12px; color: #164a40; }
.project-total span, .project-total strong { display: block; }
.project-total strong { font-size: 1.55rem; margin-top: 3px; }
.project-summary { display: grid; gap: 8px; }
.layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: start; gap: 20px; }
nav, .panel, dialog { background: white; border: 1px solid var(--line); border-radius: 14px; }
nav { padding: 16px; }
nav h2 { font-size: 1rem; margin-bottom: 12px; }
#rooms { display: grid; gap: 4px; }
button, input, select { font: inherit; }
button { cursor: pointer; border: 1px solid transparent; border-radius: 8px; padding: 9px 13px; font-size: .9rem; font-weight: 650; background: var(--teal); color: white; }
button:hover { filter: brightness(.94); }
button:disabled { opacity: .55; cursor: default; }
button.secondary { background: white; color: #31485c; border-color: var(--line); }
nav button.secondary { text-align: left; border-color: transparent; }
nav button[aria-current="true"] { color: #095348; background: #dcf1e9; }
.panel { overflow: hidden; }
.section-title, .subtotal { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; }
.section-title p { font-size: .9rem; }
.room-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
.table-area { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { border-top: 1px solid var(--line); padding: 12px 14px; }
th { background: #f4f7fa; font-size: .875rem; white-space: nowrap; }
td:not(:first-child) { white-space: nowrap; }
td:first-child { overflow-wrap: anywhere; min-width: 115px; }
td button { padding: 5px 8px; margin-right: 4px; }
.empty { text-align: center; padding: 62px 16px; border-top: 1px solid var(--line); }
.subtotal { border-top: 1px solid var(--line); background: #f4f8f8; }
.subtotal strong { color: var(--teal); font-size: 1.25rem; }
#status:not(:empty) { margin: 0; padding: 0 20px 12px; }
dialog { width: min(460px, calc(100% - 24px)); padding: 24px; color: inherit; }
dialog::backdrop { background: #112d41a6; }
label { display: grid; gap: 5px; margin-top: 16px; font-size: .9rem; font-weight: 600; }
input, select { width: 100%; border: 1px solid #acbcc8; border-radius: 8px; padding: 9px 10px; }
:focus-visible { outline: 2px solid #087c72; outline-offset: 3px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.estimate { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; padding: 12px; border-radius: 8px; background: #e5f3ee; }
.name-field { position: relative; }
#name-suggestions { position: absolute; z-index: 1; inset: 100% 0 auto; display: grid; max-height: 150px; overflow: auto; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 14px #142e3e26; }
#name-suggestions button { text-align: left; overflow-wrap: anywhere; }
#report-dialog { width: min(680px, calc(100% - 24px)); }
#report-table { margin-top: 16px; max-height: 55vh; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 18px; }
#copy-selection { min-width: 0; margin: 16px 0 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
#copy-selection legend { padding: 0 4px; font-size: .9rem; font-weight: 650; }
#copy-items { max-height: min(230px, 32vh); overflow: auto; }
.copy-option { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 3px; font-weight: 400; overflow-wrap: anywhere; }
.copy-option input { width: 1rem; height: 1rem; flex: none; accent-color: var(--teal); }
.copy-option.copy-all { border-bottom: 1px solid var(--line); font-weight: 650; }
#form-status, .error { color: #992d27; }
@media (max-width: 700px) {
  .wrap { width: calc(100% - 24px); }
  .intro { align-items: stretch; flex-direction: column; }
  .layout { grid-template-columns: 1fr; }
  #rooms { display: flex; flex-wrap: wrap; }
  .section-title, .subtotal { padding: 16px; }
}
