:root {
    --bg: #0f1115;
    --panel: #16181b;
    --panel-2: #1c1f24;
    --line: #2e343d;
    --text: #f0f2f5;
    --muted: #a0a9b2;
    --accent: #b6e8ce;
    font-family: Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dashboard { max-width: 1280px; min-height: 100vh; margin: auto; }
.workspace-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--line);
    border-top: 2px solid #315747;
    border-radius: 0 0 10px 10px;
    background: linear-gradient(110deg, var(--panel), #11181a);
}
.kicker { font-size: 10px; letter-spacing: .15em; color: var(--muted); }
.site-version { margin-left: 10px; font-size: 10px; color: var(--muted); }
.workspace-head h1 { font-size: 23px; margin: 7px 0 0; }
.map-tools, .room-filters { display: flex; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.map-tools a, .room-filters button {
    padding: 11px 15px;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font-size: 13px;
}
.map-tools a { text-decoration: none; text-align: center; }
.map-tools a[aria-current="page"], button[aria-pressed="true"] { color: var(--accent); background: #1b2d26; border-color: #345e49; }
.workspace-content { padding: 28px 24px 48px; }
.view-panel { overflow-wrap: anywhere; }
h2 { margin: 12px 0; font-size: 28px; letter-spacing: -.03em; }
h3 { margin: 0 0 12px; font-size: 18px; }
p { color: var(--muted); line-height: 1.7; font-size: 14px; }
.hero { padding: 40px; border: 1px solid #2a4035; border-radius: 12px; background: linear-gradient(120deg, var(--panel), #122019); }
.hero h2 { max-width: 650px; font-size: clamp(28px, 4vw, 44px); line-height: 1.15; }
.hero p { max-width: 620px; font-size: 16px; }
.status { display: inline-block; margin-top: 14px; padding: 8px 12px; border: 1px solid #345e49; border-radius: 6px; color: var(--accent); font-size: 12px; }
.summary-grid, .two-column, .gallery-grid { display: grid; gap: 18px; margin: 24px 0; }
.summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.card .kicker { display: block; margin-bottom: 16px; }
.card p:last-child { margin-bottom: 0; }
.text-button { padding: 8px 0; border: 0; background: transparent; color: var(--accent); font-size: 13px; text-align: left; }
.section-heading { margin-bottom: 24px; }
.section-heading p { max-width: 780px; }
.empty-state { padding: 36px; border-style: dashed; }
.measurements { margin: 0; }
.measurements > div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; }
.muted { color: var(--muted); font-size: 12px; }
code { font-size: 12px; }
.room-filters { display: inline-flex; flex-wrap: wrap; }
.reference-card { overflow: hidden; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; text-align: left; }
.reference-card img { display: block; width: 100%; height: 230px; object-fit: cover; }
.reference-card span { display: block; padding: 16px; font-size: 13px; }
.notice { padding: 18px; border: 1px solid #345e49; border-radius: 9px; background: #15211c; }
.print-button { padding: 12px 16px; border: 1px solid #345e49; border-radius: 6px; background: #15251c; color: var(--accent); }

.photo-dialog {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 14px;
    overflow: hidden;
    overscroll-behavior: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
}

.photo-dialog[open] {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.photo-dialog::backdrop {
    background: #000c;
}

.photo-dialog-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex: 0 0 auto;
    margin-bottom: 0;
}

.photo-dialog-heading h2 {
    margin: 0;
    font-size: 16px;
}

.photo-dialog-heading button {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--panel-2);
    cursor: pointer;
}

.photo-dialog > img {
    display: block;
    width: 100%;
    height: 0;
    min-height: 0;
    flex: 1 1 0;
    max-width: none;
    max-height: none;
    margin: 0;
    object-fit: contain;
}

.photo-dialog > p {
    flex: 0 0 auto;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.photo-dialog > p:empty {
    display: none;
}

.photo-dialog-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 0 0 auto;
}

.photo-dialog-navigation button {
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--panel-2);
    color: var(--text);
}

.photo-dialog-navigation button:disabled {
    opacity: .5;
    cursor: default;
}

#photo-position {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

#photo-dialog-image {
    touch-action: pan-y pinch-zoom;
}
@media screen and (max-width: 1023px) {
    .workspace-head { flex-direction: column; align-items: stretch; gap: 18px; padding: 20px 14px; }
    .map-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .map-tools a { padding: 11px 3px; font-size: 12px; }
    .workspace-content { padding: 20px 14px 36px; }
    .summary-grid, .two-column, .gallery-grid { grid-template-columns: minmax(0, 1fr); }
    .hero, .card, .empty-state { padding: 24px 18px; }
    .measurements > div { font-size: 13px; }
    .room-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
    :root { color: #111; background: white; }
    body, .dashboard, .workspace-head, .workspace-content, .card { background: white; color: #111; }
    p, .kicker { color: #444; }
    .map-tools, .room-filters, .print-button, .text-button, .photo-dialog { display: none !important; }
    .workspace-content { padding: 12px 0; }
    .two-column, .summary-grid { grid-template-columns: 1fr; }
    .card { break-inside: avoid; }
}
