:root {
  color-scheme: light;
  --ink: #252a27;
  --ink-soft: #5d625e;
  --ink-faint: #888d88;
  --paper: #f4f1ea;
  --paper-deep: #ece8df;
  --surface: #fffdfa;
  --surface-muted: #f8f6f1;
  --line: #dedad1;
  --line-strong: #c9c4ba;
  --forest: #1e2b27;
  --forest-soft: #2a3934;
  --clay: #bd6849;
  --clay-dark: #985039;
  --clay-soft: #f1ded5;
  --sage: #61786d;
  --sage-soft: #dce5df;
  --blue: #5d7180;
  --gold: #a6793d;
  --danger: #a44739;
  --success: #52735d;
  --shadow-sm: 0 1px 2px rgba(25, 31, 27, .06), 0 4px 14px rgba(25, 31, 27, .04);
  --shadow-lg: 0 22px 70px rgba(20, 28, 24, .22);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --sidebar-width: 244px;
  --topbar-height: 68px;
  --font-sans: Aptos, "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font-sans); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a, select, input[type="checkbox"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(189, 104, 73, .28); outline-offset: 2px; }
button:disabled, input:disabled, textarea:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
.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; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; z-index: 1000; left: 16px; top: -100px; padding: 10px 14px; color: white; background: var(--forest); border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }

.splash-screen { position: fixed; z-index: 2000; inset: 0; display: grid; place-items: center; overflow: hidden; padding: clamp(18px, 4vw, 56px); background: #fff; opacity: 1; transition: opacity .35s ease, visibility .35s ease; }
.splash-screen.is-leaving { visibility: hidden; opacity: 0; pointer-events: none; }
.splash-art { width: min(92vw, 920px); max-height: 82vh; object-fit: contain; }
.splash-footer { position: absolute; left: 50%; bottom: clamp(14px, 3vh, 34px); display: flex; align-items: center; gap: 14px; transform: translateX(-50%); }
.splash-footer img { width: 104px; max-height: 48px; object-fit: contain; }
.splash-loader { width: 22px; height: 22px; padding: 5px; border: 1px solid #d7c7aa; border-radius: 50%; }
.splash-loader i { display: block; width: 100%; height: 100%; background: var(--gold); border-radius: 50%; animation: breathe 1.1s ease-in-out infinite; }

.auth-shell { min-height: 100%; display: grid; place-items: center; padding: 28px 16px; background: radial-gradient(circle at 50% 20%, #fff 0, var(--paper) 58%, var(--paper-deep) 100%); }
.auth-card { width: min(440px, 100%); padding: clamp(25px, 5vw, 42px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; align-items: center; flex-direction: column; margin-bottom: 30px; text-align: center; }
.auth-brand img { width: 190px; max-height: 120px; object-fit: contain; }
.auth-brand span { margin-top: 8px; color: var(--ink-faint); font-size: 8px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.auth-card h1 { margin: 0; font-family: var(--font-serif); font-size: 31px; font-weight: 500; }
.auth-card > p { margin: 9px 0 22px; color: var(--ink-soft); line-height: 1.55; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form > small { color: var(--ink-faint); font-size: 9px; line-height: 1.45; }
.auth-submit { width: 100%; min-height: 44px; margin-top: 5px; }
.auth-message { margin: 0 0 17px; padding: 10px 12px; color: var(--ink-soft); background: var(--sage-soft); border: 1px solid #c9d8ce; border-radius: 6px; font-size: 10px; line-height: 1.45; }

.app-shell { display: flex; height: 100%; min-width: 0; }
.sidebar { width: var(--sidebar-width); flex: 0 0 var(--sidebar-width); display: flex; flex-direction: column; color: #e7ebe8; background: var(--forest); border-right: 1px solid rgba(255, 255, 255, .05); }
.brand { min-height: 116px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 22px; background: #fff; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand > img { width: 100%; height: 90px; object-fit: contain; }
.museum-logo-placeholder { color: var(--forest); font-family: var(--font-serif); font-size: 15px; text-align: center; }
.brand-mark, .loading-mark { width: 26px; height: 30px; display: flex; align-items: flex-end; gap: 3px; }
.brand-mark i, .loading-mark i { display: block; width: 6px; border: 1.5px solid currentColor; border-bottom: 0; }
.brand-mark i:nth-child(1), .loading-mark i:nth-child(1) { height: 17px; }
.brand-mark i:nth-child(2), .loading-mark i:nth-child(2) { height: 27px; }
.brand-mark i:nth-child(3), .loading-mark i:nth-child(3) { height: 21px; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-family: var(--font-serif); font-size: 21px; font-weight: 500; letter-spacing: .01em; }
.brand small { margin-top: 4px; color: #9ba8a2; font-size: 9px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.sidebar-nav { padding: 19px 13px; display: flex; flex-direction: column; gap: 3px; }
.nav-item { position: relative; width: 100%; height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 11px; border: 0; border-radius: 7px; color: #aeb9b4; background: transparent; cursor: pointer; text-align: left; transition: color .18s ease, background .18s ease; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: white; background: rgba(255, 255, 255, .055); }
.nav-item.is-active { color: white; background: var(--forest-soft); }
.nav-item.is-active::before { content: ""; position: absolute; left: -13px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--clay); }
.nav-count { margin-left: auto; min-width: 22px; padding: 2px 6px; color: #bdc8c3; background: rgba(255, 255, 255, .07); border-radius: 999px; font-size: 11px; text-align: center; }
.nav-divider { height: 1px; margin: 12px 11px; background: rgba(255, 255, 255, .08); }
.sidebar-foot { margin-top: auto; padding: 18px 24px 22px; border-top: 1px solid rgba(255, 255, 255, .08); }
.storage-label { display: flex; justify-content: space-between; gap: 8px; color: #b9c3be; font-size: 10px; }
.storage-label strong { color: #e3e8e5; font-weight: 600; }
.storage-bar { height: 3px; margin: 9px 0 8px; overflow: hidden; background: rgba(255, 255, 255, .1); border-radius: 3px; }
.storage-bar span { display: block; width: 18%; height: 100%; background: var(--clay); }
.sidebar-foot small { color: #7f8f87; font-size: 10px; }

/* Ajuda: linguagem e navegação próprias, sem alterar os ecrãs de trabalho. */
.help-page { --help-navy: #1c3d6b; --help-blue: #44849f; --help-coral: #f15f45; --help-gold: #e9bb49; max-width: 1440px; font-family: Helvetica, Arial, sans-serif; }
.help-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; padding: clamp(26px, 4vw, 46px); color: #fff; background: linear-gradient(125deg, #173452, var(--help-navy) 68%, #325d83); border-radius: 18px; box-shadow: 0 15px 35px rgba(23, 52, 82, .12); }
.help-hero .eyebrow { color: var(--help-gold); }
.help-hero h1 { margin: 8px 0 12px; font-family: Helvetica, Arial, sans-serif; font-size: clamp(32px, 4vw, 48px); font-weight: 700; letter-spacing: -.04em; }
.help-hero p { max-width: 660px; margin: 0; color: #e4edf5; font-size: 15px; line-height: 1.6; }
.help-pdf-link { flex: 0 0 auto; white-space: nowrap; background: #fff !important; color: var(--help-navy) !important; border-color: #fff !important; }
.help-pdf-link:hover { background: #ecf4f7 !important; }
.help-first { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 24px 0; padding: 24px 28px; background: #fff; border: 1px solid #dce5ec; border-radius: 14px; }
.help-first > div { max-width: 650px; }
.help-first-mark { display: inline-block; margin-bottom: 9px; color: var(--help-coral); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.help-first h2 { margin: 0 0 7px; color: var(--help-navy); font-size: 22px; }
.help-first p { margin: 0; color: #506171; line-height: 1.6; }
.help-search { width: min(340px, 100%); min-height: 46px; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #f6f9fb; border: 1px solid #c9d7e0; border-radius: 9px; }
.help-search svg { flex: 0 0 18px; color: var(--help-blue); }
.help-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--help-navy); background: transparent; }
.help-terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 26px; }
.help-terms > div { min-height: 93px; display: flex; flex-direction: column; gap: 6px; padding: 15px 17px; background: #fff; border: 1px solid #e1e7ea; border-radius: 10px; }
.help-terms strong { color: var(--help-navy); font-size: 13px; }
.help-terms span { color: #56646c; font-size: 12px; line-height: 1.5; }
.help-layout { display: grid; grid-template-columns: minmax(210px, 258px) minmax(0, 1fr); align-items: start; gap: 24px; }
.help-toc { position: sticky; top: 22px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 120px); overflow: auto; padding: 18px 10px; background: #fff; border: 1px solid #e1e7ea; border-radius: 12px; }
.help-toc h2 { margin: 0 12px 10px; color: var(--help-navy); font-size: 14px; }
.help-toc button { display: flex; align-items: start; gap: 9px; width: 100%; padding: 9px 11px; color: #3e5666; background: transparent; border: 0; border-radius: 7px; cursor: pointer; text-align: left; font-size: 12px; line-height: 1.35; }
.help-toc button:hover, .help-toc button:focus-visible { color: var(--help-navy); background: #edf4f8; }
.help-toc button span { flex: 0 0 22px; color: var(--help-coral); font-size: 10px; font-weight: 800; }
.help-articles { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.help-article { scroll-margin-top: 20px; padding: clamp(22px, 3.2vw, 38px); background: #fff; border: 1px solid #dfe8eb; border-radius: 14px; box-shadow: 0 5px 20px rgba(23, 52, 82, .035); }
.help-article > header { padding-bottom: 20px; border-bottom: 1px solid #e8eff2; }
.help-chapter { color: var(--help-coral); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.help-article h2 { margin: 8px 0 9px; color: var(--help-navy); font-family: Helvetica, Arial, sans-serif; font-size: clamp(22px, 2.7vw, 29px); line-height: 1.15; }
.help-article > header p { margin: 0; color: #5a6e7a; line-height: 1.55; }
.help-figure { margin: 22px 0 2px; padding: 8px; background: #f4f7f9; border: 1px solid #e1e9ed; border-radius: 10px; }
.help-figure img { width: 100%; max-height: 420px; object-fit: contain; background: #fff; border-radius: 6px; }
.help-figure figcaption { padding: 7px 4px 2px; color: #6b7d88; font-size: 10px; text-align: center; }
.help-steps { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: help-step; }
.help-steps li { position: relative; min-height: 42px; margin: 0 0 16px; padding-left: 48px; counter-increment: help-step; }
.help-steps li:last-child { margin-bottom: 0; }
.help-steps li::before { content: counter(help-step); position: absolute; left: 0; top: 0; width: 29px; height: 29px; display: grid; place-items: center; color: #fff; background: var(--help-blue); border-radius: 50%; font-size: 12px; font-weight: 700; }
.help-steps h3 { margin: 0 0 4px; color: #213e54; font-family: Helvetica, Arial, sans-serif; font-size: 14px; }
.help-steps p { margin: 0; color: #4e5d67; font-size: 13px; line-height: 1.65; }
.help-note { margin-top: 22px; padding: 14px 17px; background: #fff9eb; border-left: 4px solid var(--help-gold); border-radius: 4px 9px 9px 4px; }
.help-note strong { color: #6b5324; font-size: 12px; }
.help-note p { margin: 4px 0 0; color: #665a43; font-size: 12px; line-height: 1.55; }
.help-search-empty { padding: 20px; color: #5a6e7a; background: #fff; border: 1px solid #dfe8eb; border-radius: 10px; }
.help-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 26px; padding: 20px 4px 0; color: #647782; border-top: 1px solid #d7e1e7; font-size: 12px; }
.help-footer a { display: block; flex: 0 0 auto; }
.help-footer img { width: 112px; height: 50px; object-fit: contain; }

@media (max-width: 980px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; max-height: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .help-toc h2 { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .help-hero, .help-first { align-items: stretch; flex-direction: column; }
  .help-pdf-link { align-self: flex-start; }
  .help-terms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .help-search { width: 100%; }
  .help-toc { grid-template-columns: 1fr; }
  .help-article { padding: 22px 17px; }
  .help-footer { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 440px) {
  .help-terms { grid-template-columns: 1fr; }
}

.app-column { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-height); flex: 0 0 var(--topbar-height); display: flex; align-items: center; gap: 18px; padding: 0 28px; background: rgba(255, 253, 250, .96); border-bottom: 1px solid var(--line); }
.global-search { width: min(430px, 42vw); height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 11px; color: var(--ink-faint); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 7px; cursor: text; text-align: left; }
.global-search svg { width: 17px; height: 17px; }
.global-search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-search kbd { margin-left: auto; padding: 2px 5px; color: var(--ink-faint); background: var(--surface); border: 1px solid var(--line); border-bottom-color: var(--line-strong); border-radius: 4px; font-family: inherit; font-size: 10px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-button { width: 36px; height: 36px; flex: 0 0 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--ink-soft); background: transparent; border: 1px solid transparent; border-radius: 7px; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: var(--surface-muted); border-color: var(--line); }
.notification-button { position: relative; }
.notification-button > span { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; background: var(--clay); border: 1px solid var(--surface); border-radius: 50%; }
.notification-wrap { position: relative; }
.notification-popover { position: absolute; z-index: 40; top: 45px; right: 0; width: min(370px, calc(100vw - 30px)); overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.notification-popover > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); }
.notification-popover > header > div { display: flex; flex-direction: column; }
.notification-popover > header strong { font-family: var(--font-serif); font-size: 17px; font-weight: 500; }
.notification-popover > header small { color: var(--ink-faint); font-size: 8px; }
.notification-list { max-height: 410px; overflow: auto; padding: 6px; }
.notification-item { width: 100%; display: grid; grid-template-columns: 30px 1fr; gap: 9px; padding: 10px; color: var(--ink); background: transparent; border: 0; border-radius: 6px; cursor: pointer; text-align: left; }
.notification-item:hover { background: var(--surface-muted); }
.notification-item.is-unread { background: #f7f1e8; }
.notification-kind { width: 28px; height: 28px; display: grid; place-items: center; color: var(--clay-dark); background: var(--clay-soft); border-radius: 50%; }
.notification-kind svg { width: 13px; height: 13px; }
.notification-item > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.notification-item strong { font-size: 10px; }
.notification-item small { margin-top: 3px; color: var(--ink-soft); font-size: 9px; line-height: 1.35; }
.notification-item time { margin-top: 4px; color: var(--ink-faint); font-size: 8px; }
.notification-empty { padding: 30px 12px; color: var(--ink-faint); font-size: 10px; text-align: center; }
.profile-chip { display: flex; align-items: center; gap: 9px; min-width: 178px; padding: 3px 5px 3px 3px; background: transparent; border: 0; border-radius: 7px; cursor: pointer; text-align: left; }
.profile-chip:hover { background: var(--surface-muted); }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; display: inline-flex; align-items: center; justify-content: center; color: white; background: var(--clay); border-radius: 50%; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.profile-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.profile-copy strong { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { margin-top: 2px; color: var(--ink-faint); font-size: 10px; }
.profile-chip > svg { width: 14px; height: 14px; transform: rotate(90deg); }
.mobile-menu { display: none; }

#mainContent { min-height: 0; flex: 1; overflow: auto; background: var(--paper); }
#mainContent.is-viewer { display: flex; overflow: hidden; }
.page { width: min(1420px, 100%); margin: 0 auto; padding: 34px 38px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h1 { margin: 0; font-family: var(--font-serif); font-size: clamp(28px, 3vw, 38px); font-weight: 500; letter-spacing: -.025em; }
.page-head p { max-width: 660px; margin: 8px 0 0; color: var(--ink-soft); line-height: 1.55; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--clay-dark); font-size: 10px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.head-actions, .toolbar-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); cursor: pointer; font-weight: 600; font-size: 12px; text-decoration: none; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { background: var(--surface-muted); border-color: #b4afa6; }
.button:active { transform: translateY(1px); }
.button svg { width: 16px; height: 16px; }
.button.primary { color: white; background: var(--forest); border-color: var(--forest); }
.button.primary:hover { background: var(--forest-soft); }
.button.clay { color: white; background: var(--clay); border-color: var(--clay); }
.button.clay:hover { background: var(--clay-dark); }
.button.secondary { background: transparent; }
.button.ghost { min-height: 32px; padding: 0 8px; color: var(--ink-soft); background: transparent; border-color: transparent; }
.button.danger { color: white; background: var(--danger); border-color: var(--danger); }
.button.danger-ghost { color: var(--danger); background: transparent; border-color: transparent; }
.button.small { min-height: 32px; padding: 0 10px; }
.loading-state { min-height: calc(100vh - var(--topbar-height)); display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--sage); }
.loading-mark { color: var(--sage); animation: breathe 1.4s ease-in-out infinite; }
.loading-state p { margin-top: 16px; color: var(--ink-faint); font-size: 12px; }
@keyframes breathe { 50% { opacity: .45; transform: translateY(-2px); } }

.dashboard-intro { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 32px; margin-bottom: 26px; }
.dashboard-intro h1 { margin: 0; font-family: var(--font-serif); font-size: clamp(30px, 4vw, 43px); font-weight: 500; letter-spacing: -.03em; }
.dashboard-intro p { margin: 9px 0 0; color: var(--ink-soft); }
.date-block { padding-left: 20px; border-left: 1px solid var(--line-strong); text-align: right; }
.date-block strong { display: block; font-family: var(--font-serif); font-size: 22px; font-weight: 500; }
.date-block span { color: var(--ink-faint); font-size: 11px; text-transform: capitalize; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0 32px; }
.metric { min-width: 0; padding: 18px 19px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 11px; }
.metric-icon { width: 31px; height: 31px; display: grid; place-items: center; color: var(--sage); background: var(--sage-soft); border-radius: 50%; }
.metric-icon.clay { color: var(--clay-dark); background: var(--clay-soft); }
.metric-icon.gold { color: #80602f; background: #eee3d0; }
.metric-icon.blue { color: #48616f; background: #dfe7eb; }
.metric-icon svg { width: 15px; height: 15px; }
.metric-value { display: block; margin-top: 14px; font-family: var(--font-serif); font-size: 30px; font-weight: 500; line-height: 1; }
.metric-foot { display: flex; align-items: center; gap: 5px; margin-top: 8px; color: var(--ink-faint); font-size: 10px; }
.metric-foot strong { color: var(--success); font-weight: 650; }
.typology-overview { margin: 0 0 32px; padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.typology-overview .section-head { align-items: flex-end; }
.typology-overview .section-head p { margin: 5px 0 0; color: var(--ink-faint); font-size: 10px; }
.typology-total { color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.typology-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.typology-summary-card { min-width: 0; padding: 13px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 8px; }
.typology-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.typology-summary-head span { min-width: 0; display: flex; align-items: center; gap: 7px; overflow: hidden; color: var(--ink-soft); font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.typology-summary-head i { width: 9px; height: 9px; flex: 0 0 9px; background: var(--type-color); border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, var(--type-color) 14%, transparent); }
.typology-summary-head strong { color: var(--ink); font-family: var(--font-serif); font-size: 23px; font-weight: 500; line-height: 1; }
.typology-progress { height: 7px; margin-top: 13px; overflow: hidden; background: var(--paper-deep); border-radius: 999px; }
.typology-progress span { display: block; min-width: 0; height: 100%; background: var(--type-color); border-radius: inherit; }
.typology-summary-card small { display: block; margin-top: 7px; color: var(--ink-faint); font-size: 9px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.section-head h2 { margin: 0; font-family: var(--font-serif); font-size: 21px; font-weight: 500; }
.text-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; color: var(--clay-dark); background: none; border: 0; cursor: pointer; font-size: 11px; font-weight: 650; }
.text-link svg { width: 13px; height: 13px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(270px, .75fr); gap: 24px; }
.project-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.project-card { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(25, 31, 27, .09); }
.project-card-cover { position: relative; aspect-ratio: 1.7; overflow: hidden; background: var(--paper-deep); }
.project-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.project-card:hover .project-card-cover img { transform: scale(1.025); }
.project-card-cover::after { content: ""; position: absolute; inset: auto 0 0; height: 45%; background: linear-gradient(transparent, rgba(19, 24, 21, .38)); pointer-events: none; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.project-card-cover .status-pill { position: absolute; z-index: 1; top: 10px; left: 10px; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.active { color: #31594a; background: #dce9e2; }
.status-pill.review { color: #7b5929; background: #f1e6d4; }
.status-pill.archived { color: #5d625e; background: #ebe9e4; }
.project-card-body { padding: 14px; }
.project-card h3 { margin: 0 0 4px; overflow: hidden; font-family: var(--font-serif); font-size: 16px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.project-location { display: block; color: var(--ink-faint); font-size: 10px; }
.project-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 11px; color: var(--ink-soft); border-top: 1px solid var(--line); font-size: 10px; }
.avatar-stack { display: flex; padding-left: 5px; }
.avatar-mini { width: 23px; height: 23px; display: inline-flex; align-items: center; justify-content: center; margin-left: -5px; color: white; background: var(--sage); border: 2px solid var(--surface); border-radius: 50%; font-size: 7px; font-weight: 700; }
.avatar-mini:nth-child(2) { background: var(--clay); }
.avatar-mini:nth-child(3) { background: var(--blue); }
.activity-panel { padding: 17px 17px 5px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-item { position: relative; display: grid; grid-template-columns: 29px 1fr; gap: 10px; padding-bottom: 17px; }
.activity-item:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 31px; bottom: 4px; width: 1px; background: var(--line); }
.activity-item .avatar-mini { width: 29px; height: 29px; margin: 0; border: 0; font-size: 8px; }
.activity-copy { min-width: 0; line-height: 1.4; }
.activity-copy strong { font-weight: 650; }
.activity-copy span { color: var(--ink-soft); }
.activity-copy small { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 9px; }

.view-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 11px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar-search { min-width: 210px; flex: 1; position: relative; }
.toolbar-search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--ink-faint); }
.toolbar-search input { width: 100%; height: 36px; padding: 0 11px 0 35px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; }
.select-control { height: 36px; padding: 0 32px 0 10px; color: var(--ink-soft); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; }
.projects-list { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 15px; }
.projects-list .project-card-body { padding: 17px; }
.projects-list .project-card h3 { font-size: 18px; }
.project-card-description { height: 38px; margin: 10px 0 0; overflow: hidden; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.project-card-actions { display: flex; align-items: center; gap: 5px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 11px 15px; color: var(--ink-faint); background: var(--surface-muted); border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 12px 15px; border-bottom: 1px solid var(--line); font-size: 11px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #faf8f3; }
.point-code { color: var(--clay-dark); font-weight: 750; letter-spacing: .035em; }
.typology-key { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.typology-key i { width: 8px; height: 8px; border-radius: 50%; background: var(--type-color); }
.typology-key small { color: var(--ink-faint); }
.yes-no { display: inline-flex; min-width: 34px; justify-content: center; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.yes-no.yes { color: #31594a; background: #dce9e2; }
.yes-no.no { color: #6c6255; background: #eee9df; }
.result-count { align-self: center; color: var(--ink-faint); font-size: 10px; white-space: nowrap; }
.date-control { height: 36px; padding: 0 9px; color: var(--ink-soft); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; }
.filter-toolbar { align-items: flex-start; }
.filter-toolbar .toolbar-actions { justify-content: flex-end; }
.empty-state { padding: 60px 20px; color: var(--ink-faint); text-align: center; }
.empty-state svg { width: 32px; height: 32px; margin-bottom: 10px; }

.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.photo-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.photo-card img { width: 100%; aspect-ratio: 1.2; object-fit: cover; background: var(--paper-deep); }
.photo-card-copy { padding: 12px; }
.photo-card-copy strong { display: block; overflow: hidden; font-family: var(--font-serif); font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.photo-card-copy span { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 9px; }

.reports-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(290px, .6fr); gap: 20px; align-items: start; }
.report-preview { padding: 30px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.report-masthead { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.report-brand { width: 170px; min-height: 42px; display: flex; align-items: center; font-family: var(--font-serif); font-size: 18px; }
.report-brand img { width: 100%; max-height: 62px; object-fit: contain; object-position: left center; }
.report-meta { color: var(--ink-faint); font-size: 9px; text-align: right; }
.report-preview h2 { margin: 23px 0 5px; font-family: var(--font-serif); font-size: 25px; font-weight: 500; }
.report-subtitle { color: var(--ink-soft); font-size: 11px; }
.report-image { position: relative; margin: 20px 0; aspect-ratio: 1.75; overflow: hidden; background: var(--paper-deep); }
.report-image img { width: 100%; height: 100%; object-fit: cover; }
.report-image .mini-marker { position: absolute; transform: translate(-50%, -50%); }
.report-area-maps { margin-top: 24px; }
.report-area-maps > h3 { margin: 0 0 13px; font-family: var(--font-serif); font-size: 18px; font-weight: 500; }
.report-area-maps figure { margin: 0 0 18px; break-inside: avoid; }
.report-area-maps figcaption { margin-bottom: 6px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.report-area-maps .report-image { margin: 0; }
.report-table-wrap { overflow-x: auto; }
.report-table-wrap .data-table { min-width: 960px; }
.report-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0; border-block: 1px solid var(--line); }
.report-summary div { padding: 13px; text-align: center; border-right: 1px solid var(--line); }
.report-summary div:last-child { border: 0; }
.report-summary strong { display: block; font-family: var(--font-serif); font-size: 22px; font-weight: 500; }
.report-summary span { color: var(--ink-faint); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.report-controls { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.report-controls h3 { margin: 0 0 18px; font-family: var(--font-serif); font-size: 19px; font-weight: 500; }
.report-controls .field { margin-bottom: 14px; }
.report-controls .button { width: 100%; margin-top: 6px; }
.check-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; color: var(--ink-soft); font-size: 11px; }
.check-row input { accent-color: var(--clay); }
.elevation-export { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.elevation-export-heading { margin-bottom: 16px; }
.report-controls .elevation-export-heading h3 { margin: 3px 0 5px; }
.elevation-export-heading p { margin: 0; color: var(--ink-faint); font-size: 10px; line-height: 1.5; }
.elevation-base-status { display: grid; gap: 3px; margin: 12px 0 16px; padding: 10px 12px; color: #625546; background: #f2eadc; border-left: 3px solid #a6793d; border-radius: 4px; }
.elevation-base-status.is-vector { color: #284d3f; background: #e3eee8; border-left-color: #3f7b75; }
.elevation-base-status strong { font-size: 10px; }
.elevation-base-status span { font-size: 9px; line-height: 1.4; }
.elevation-detail-help { margin: -3px 0 9px 25px; color: var(--ink-faint); font-size: 8.5px; line-height: 1.45; }
.elevation-selection-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.elevation-selection-head strong { font-size: 11px; }
.elevation-selection-head span { color: var(--ink-faint); font-size: 9px; }
.elevation-selection-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 8px 0; }
.report-controls .elevation-selection-actions .button { width: auto; margin: 0; }
.elevation-search { width: 100%; margin: 7px 0 9px; background: var(--surface-muted); border: 1px solid var(--line); }
.elevation-search input { width: 100%; }
.elevation-category-selectors { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.elevation-category-selectors button { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 7px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 8px; }
.elevation-category-selectors button i { width: 7px; height: 7px; flex: 0 0 7px; background: var(--type-color); border-radius: 50%; }
.elevation-category-selectors button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elevation-category-selectors button small { color: var(--ink-faint); }
.elevation-category-selectors button.is-active { color: var(--surface); background: var(--ink); border-color: var(--ink); }
.elevation-category-selectors button.is-partial { border-color: var(--clay); box-shadow: inset 0 0 0 1px var(--clay); }
.elevation-point-list { max-height: 270px; margin-bottom: 10px; overflow: auto; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; }
.elevation-point-list > label { display: grid; grid-template-columns: auto 9px 1fr; align-items: center; gap: 8px; min-height: 43px; padding: 6px 9px; border-bottom: 1px solid var(--line); cursor: pointer; }
.elevation-point-list > label:last-child { border-bottom: 0; }
.elevation-point-list > label:hover { background: var(--surface); }
.elevation-point-list > label input { accent-color: var(--clay); }
.elevation-point-list > label > i { width: 8px; height: 8px; background: var(--type-color); border-radius: 50%; }
.elevation-point-list > label span { min-width: 0; }
.elevation-point-list > label strong, .elevation-point-list > label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elevation-point-list > label strong { color: var(--ink); font-size: 10px; }
.elevation-point-list > label small { margin-top: 2px; color: var(--ink-faint); font-size: 8px; }
.report-photo-annex { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.report-photo-annex h3 { margin: 0 0 12px; font-family: var(--font-serif); font-size: 18px; font-weight: 500; }
.report-photo-annex > div { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.report-photo-annex figure { margin: 0; border: 1px solid var(--line); }
.report-photo-annex img { width: 100%; aspect-ratio: 1.35; object-fit: cover; }
.report-photo-annex figcaption { padding: 7px; color: var(--ink-soft); font-size: 9px; }

.admin-grid, .admin-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-panel { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.admin-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.admin-panel h2 { margin: 0; font-family: var(--font-serif); font-size: 20px; font-weight: 500; }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-row { display: flex; align-items: center; gap: 11px; min-height: 50px; border-bottom: 1px solid var(--line); }
.admin-row:last-child { border-bottom: 0; }
.admin-row.is-disabled { opacity: .58; }
.admin-row-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.admin-row-copy strong { font-size: 11px; font-weight: 650; }
.admin-row-copy small { margin-top: 3px; color: var(--ink-faint); font-size: 9px; }
.role-badge { padding: 4px 7px; color: var(--ink-soft); background: var(--paper-deep); border-radius: 999px; font-size: 9px; white-space: nowrap; }
.admin-row-actions { display: flex; gap: 2px; }
.typology-admin-swatch { width: 22px; height: 22px; flex: 0 0 22px; background: var(--type-color); border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.typology-color-input { min-height: 42px; padding: 5px; cursor: pointer; }
.asset-settings { display: flex; flex-direction: column; gap: 14px; }
.asset-setting { display: grid; grid-template-columns: 116px 1fr; gap: 14px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.asset-setting:last-child { padding-bottom: 0; border-bottom: 0; }
.asset-preview { min-height: 86px; display: grid; place-items: center; overflow: hidden; color: var(--ink-faint); background: white; border: 1px solid var(--line); border-radius: 6px; }
.asset-preview.is-wide { min-height: 105px; }
.asset-preview img { width: 100%; max-height: 112px; object-fit: contain; }
.asset-preview span { display: flex; align-items: center; flex-direction: column; gap: 5px; font-size: 9px; }
.asset-copy { min-width: 0; display: flex; flex-direction: column; }
.asset-copy > strong { font-size: 12px; }
.asset-copy > small { margin: 4px 0 10px; color: var(--ink-faint); font-size: 9px; line-height: 1.4; }
.asset-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.admin-wide { grid-column: 1 / -1; }
.operation-loading, .empty-inline { padding: 22px; color: var(--ink-faint); background: var(--surface-muted); border: 1px dashed var(--line); border-radius: 7px; font-size: 10px; text-align: center; }
.empty-inline.error { color: var(--danger); }
.operation-list, .audit-log-list { max-height: 420px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.operation-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.operation-list li > span { min-width: 0; display: flex; align-items: center; gap: 10px; }
.operation-list li > span > svg { width: 18px; height: 18px; color: var(--clay-dark); }
.operation-list strong, .operation-list small, .audit-log-list strong, .audit-log-list small { display: block; }
.operation-list strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.operation-list small, .audit-log-list small { margin-top: 3px; color: var(--ink-faint); font-size: 8px; }
.audit-log-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px 0; color: var(--ink-soft); border-bottom: 1px solid var(--line); font-size: 10px; line-height: 1.45; }
.audit-log-list strong { display: inline; color: var(--ink); }
.email-health { display: flex; align-items: center; gap: 10px; padding: 10px 0 14px; color: var(--ink-soft); font-size: 10px; }

.viewer-shell { min-width: 0; flex: 1; display: flex; flex-direction: column; background: #d9d8d2; }
.viewer-top { height: 57px; flex: 0 0 57px; display: flex; align-items: center; gap: 16px; padding: 0 15px 0 19px; background: var(--surface); border-bottom: 1px solid var(--line); }
.viewer-context { min-width: 0; display: flex; align-items: center; gap: 8px; }
.viewer-context .project-label { max-width: 210px; overflow: hidden; font-family: var(--font-serif); font-size: 16px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.viewer-context > svg { width: 13px; color: var(--ink-faint); }
.area-select { max-width: 200px; height: 32px; padding: 0 26px 0 8px; color: var(--ink-soft); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }
.viewer-toolbar { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tool-divider { width: 1px; height: 24px; margin: 0 3px; background: var(--line); }
.zoom-value { min-width: 45px; color: var(--ink-soft); font-size: 10px; text-align: center; }
.viewer-body { min-height: 0; flex: 1; display: flex; }
.canvas-panel { min-width: 0; flex: 1; position: relative; overflow: hidden; background: #fff; touch-action: none; user-select: none; }
.canvas-panel.is-adding { cursor: crosshair; }
.canvas-panel.is-panning { cursor: grabbing; }
.canvas-scene { position: absolute; left: 50%; top: 50%; width: min(82%, 1040px); background: #fff; transform-origin: center; box-shadow: 0 16px 55px rgba(34, 39, 35, .16); }
.reference-image { width: 100%; height: auto; pointer-events: none; }
.marker-layer { position: absolute; inset: 0; pointer-events: none; }
.point-marker { position: absolute; width: 27px; height: 27px; display: grid; place-items: center; padding: 0; color: white; background-color: #60776d; background-color: var(--marker-color, #60776d); border: 2px solid rgba(255, 255, 255, .94); border-radius: 50% 50% 50% 5px; box-shadow: 0 2px 7px rgba(25, 30, 27, .35); cursor: pointer; pointer-events: auto; transform: translate(-50%, -78%) rotate(-45deg); transition: transform .16s ease, box-shadow .16s ease; }
.point-marker span { font-size: 8px; font-weight: 750; transform: rotate(45deg); }
.point-marker:hover, .point-marker.is-selected { z-index: 2; transform: translate(-50%, -78%) rotate(-45deg) scale(1.2); box-shadow: 0 3px 12px rgba(25, 30, 27, .42); }
.point-marker.is-selected { z-index: 5; color: #fff; background: #111 !important; border-width: 3px; border-color: #fff; outline: 4px solid var(--marker-color, #60776d); outline-offset: 2px; transform: translate(-50%, -78%) rotate(-45deg) scale(1.45); box-shadow: 0 0 0 8px rgba(17, 17, 17, .32), 0 6px 20px rgba(17, 17, 17, .58); animation: selected-point-pulse .8s ease-in-out 3; }
@keyframes selected-point-pulse { 50% { transform: translate(-50%, -78%) rotate(-45deg) scale(1.72); box-shadow: 0 0 0 13px rgba(17, 17, 17, .12), 0 7px 24px rgba(17, 17, 17, .62); } }
.placement-crosshair { position: absolute; z-index: 4; width: 34px; height: 34px; border: 2px solid #b72e2e; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 2px 9px rgba(33, 24, 22, .35); pointer-events: none; transform: translate(-50%, -50%); }
.placement-crosshair::before, .placement-crosshair::after { content: ""; position: absolute; left: 50%; top: 50%; background: #b72e2e; transform: translate(-50%, -50%); }
.placement-crosshair::before { width: 46px; height: 2px; }
.placement-crosshair::after { width: 2px; height: 46px; }
.canvas-info { position: absolute; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; color: #e9eeeb; background: rgba(30, 43, 39, .88); border-radius: 6px; font-size: 9px; backdrop-filter: blur(6px); }
.canvas-info strong { font-weight: 650; }
.canvas-info i { width: 1px; height: 13px; background: rgba(255, 255, 255, .25); }
.mini-map { position: absolute; right: 14px; bottom: 14px; width: 132px; padding: 5px; background: rgba(255, 253, 250, .92); border: 1px solid rgba(42, 47, 43, .24); border-radius: 6px; box-shadow: var(--shadow-sm); }
.mini-map-inner { position: relative; aspect-ratio: 1.6; overflow: hidden; background: var(--paper-deep); }
.mini-map img { width: 100%; height: 100%; object-fit: cover; }
.mini-dot { position: absolute; width: 4px; height: 4px; background-color: #60776d; background-color: var(--marker-color, #60776d); border: 1px solid white; border-radius: 50%; transform: translate(-50%, -50%); }
.mini-dot.is-selected { z-index: 2; width: 9px; height: 9px; background: #111; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--marker-color); }
.mini-viewport { position: absolute; inset: 12% 15%; border: 1px solid var(--clay); background: rgba(189, 104, 73, .08); }
.filter-popover { position: absolute; z-index: 5; right: 14px; top: 14px; width: 245px; padding: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.filter-popover[hidden] { display: none; }
.filter-popover h3 { margin: 0 0 12px; font-family: var(--font-serif); font-size: 17px; font-weight: 500; }
.filter-options { display: flex; flex-direction: column; gap: 8px; }
.filter-option { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 11px; }
.filter-option input { accent-color: var(--clay); }
.filter-option i { width: 8px; height: 8px; margin-left: auto; background: var(--type-color); border-radius: 50%; }
.add-hint { position: absolute; z-index: 3; left: 50%; top: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 9px 13px; color: white; background: var(--forest); border-radius: 6px; box-shadow: var(--shadow-sm); font-size: 11px; }
.add-hint[hidden] { display: none; }
.hint-cancel { min-height: 28px; padding: 0 9px; color: white; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .42); border-radius: 5px; cursor: pointer; font-size: 9px; font-weight: 700; }
.hint-cancel:hover { background: rgba(255, 255, 255, .22); }
.placement-controls { position: absolute; z-index: 6; left: 50%; bottom: 18px; width: min(440px, calc(100% - 28px)); display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; color: var(--ink); background: rgba(255, 253, 250, .97); border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: var(--shadow-lg); transform: translateX(-50%); }
.placement-controls label { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 9px; }
.placement-controls select { height: 30px; border: 1px solid var(--line); border-radius: 5px; font-size: 9px; }
.placement-nudge { display: grid; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(3, 30px); gap: 3px; }
.placement-nudge button { display: grid; place-items: center; padding: 0; color: var(--ink); background: white; border: 1px solid var(--line-strong); border-radius: 5px; font-size: 16px; }
.placement-nudge button:nth-child(1) { grid-column: 2; grid-row: 1; }
.placement-nudge button:nth-child(2) { grid-column: 1; grid-row: 2; }
.placement-nudge span { grid-column: 2; grid-row: 2; display: grid; place-items: center; color: #b72e2e; font-weight: 800; }
.placement-nudge button:nth-child(4) { grid-column: 3; grid-row: 2; }
.placement-nudge button:nth-child(5) { grid-column: 2; grid-row: 3; }
.placement-coordinate { color: var(--ink-soft); font-size: 9px; font-variant-numeric: tabular-nums; text-align: center; }
.point-inspector { width: 368px; flex: 0 0 368px; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); }
.inspector-empty { height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 30px; color: var(--ink-faint); text-align: center; }
.inspector-empty svg { width: 34px; height: 34px; margin-bottom: 11px; }
.inspector-empty strong { color: var(--ink-soft); font-family: var(--font-serif); font-size: 17px; font-weight: 500; }
.inspector-empty p { max-width: 235px; margin: 7px 0 0; font-size: 10px; line-height: 1.5; }
.inspector-head { padding: 17px 18px 13px; border-bottom: 1px solid var(--line); }
.inspector-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.inspector-code { display: flex; align-items: center; gap: 8px; }
.inspector-code i { width: 9px; height: 9px; background: var(--type-color); border-radius: 50%; }
.inspector-code h2 { margin: 0; font-family: var(--font-serif); font-size: 20px; font-weight: 500; }
.inspector-head p { margin: 4px 0 0 17px; color: var(--ink-faint); font-size: 9px; }
.inspector-actions { display: flex; gap: 2px; }
.inspector-actions .icon-button { width: 30px; height: 30px; flex-basis: 30px; }
.inspector-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.inspector-tab { position: relative; min-width: 0; height: 40px; padding: 0 4px; color: var(--ink-faint); background: none; border: 0; cursor: pointer; font-size: 9px; font-weight: 650; }
.inspector-tab.is-active { color: var(--ink); }
.inspector-tab.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--clay); }
.inspector-tab span { display: inline-flex; min-width: 16px; height: 16px; align-items: center; justify-content: center; margin-left: 3px; color: var(--ink-soft); background: var(--paper-deep); border-radius: 8px; font-size: 8px; }
.inspector-content { min-height: 0; flex: 1; overflow: auto; padding: 17px 18px 25px; }
.inspector-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.inspector-section:last-child { border: 0; margin-bottom: 0; }
.inspector-section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.inspector-section-title h3 { margin: 0; font-size: 9px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.readonly-note, .autosave-status, .photo-count { color: var(--ink-faint); font-size: 8px; }
.precision-step { display: flex; align-items: center; gap: 5px; color: var(--ink-faint); font-size: 8px; }
.precision-step select { height: 27px; padding: 0 5px; color: var(--ink-soft); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 5px; font-size: 9px; }
.precision-coordinates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 11px; }
.precision-coordinates span { padding: 8px 10px; color: var(--ink-faint); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; font-size: 9px; }
.precision-coordinates strong { float: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.nudge-pad { width: 136px; display: grid; grid-template-columns: repeat(3, 42px); grid-template-rows: repeat(3, 42px); gap: 5px; margin: 0 auto; }
.nudge-button { display: grid; place-items: center; padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; cursor: pointer; font-size: 18px; }
.nudge-button:hover { background: var(--surface-muted); border-color: var(--clay); }
.nudge-button:disabled { opacity: .45; }
.nudge-up { grid-column: 2; grid-row: 1; }
.nudge-left { grid-column: 1; grid-row: 2; }
.nudge-center { grid-column: 2; grid-row: 2; display: grid; place-items: center; color: var(--clay); background: var(--clay-soft); border-radius: 50%; }
.nudge-center svg { width: 18px; height: 18px; }
.nudge-right { grid-column: 3; grid-row: 2; }
.nudge-down { grid-column: 2; grid-row: 3; }
.precision-help { display: block; margin-top: 9px; color: var(--ink-faint); font-size: 8px; line-height: 1.45; text-align: center; }
.autosave-status.is-saving, .autosave-status.is-pending { color: var(--gold); }
.autosave-status.is-saved { color: var(--success); }
.autosave-status.is-error { color: var(--danger); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--ink-soft); font-size: 10px; font-weight: 650; }
.field input, .field textarea, .field select { width: 100%; min-height: 36px; padding: 8px 10px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; outline: 0; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--clay); box-shadow: 0 0 0 3px rgba(189, 104, 73, .12); }
.field small { color: var(--ink-faint); font-size: 9px; line-height: 1.4; }
.field-error { min-height: 12px; color: var(--danger) !important; }
.input-with-unit { position: relative; display: block; }
.input-with-unit input { padding-right: 40px; }
.input-with-unit b { position: absolute; right: 10px; top: 50%; color: var(--ink-faint); font-size: 9px; font-weight: 700; transform: translateY(-50%); pointer-events: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-wide { grid-column: 1 / -1; }
.inspector-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.inspector-form-grid .field-wide { grid-column: 1 / -1; }
.coordinate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coordinate { padding: 9px 10px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 5px; }
.coordinate span { display: block; color: var(--ink-faint); font-size: 8px; text-transform: uppercase; }
.coordinate strong { display: block; margin-top: 3px; font-family: var(--font-serif); font-size: 15px; font-weight: 500; }
.inspector-save-bar { position: relative; z-index: 4; flex: 0 0 auto; padding: 10px 18px; background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--line); box-shadow: 0 -8px 22px rgba(31, 37, 33, .08); }
.inspector-save { width: 100%; margin: 0; }
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.media-thumb { position: relative; overflow: hidden; background: var(--paper-deep); border: 1px solid var(--line); border-radius: 6px; }
.photo-open { width: 100%; display: block; padding: 0; background: transparent; border: 0; cursor: zoom-in; text-align: left; }
.media-thumb img { width: 100%; aspect-ratio: 1.1; object-fit: cover; }
.professional-media-thumb img { aspect-ratio: 1 / 1; object-fit: contain; background: #fff; }
.professional-point-photos { background: color-mix(in srgb, var(--paper) 70%, white); }
.media-thumb span { display: block; padding: 7px; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.photo-remove { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; color: white; background: rgba(44, 30, 27, .78); border: 0; border-radius: 50%; cursor: pointer; }
.photo-remove svg { width: 13px; height: 13px; }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.photo-actions .button { min-width: 0; padding-inline: 8px; text-align: center; }
.photo-measure { width: 100%; justify-content: center; color: var(--clay-dark); background: var(--clay-soft); border: 0; border-top: 1px solid rgba(189, 104, 73, .2); border-radius: 0; }
.photo-measure svg { width: 13px; height: 13px; }
.photo-measure-status { position: absolute; left: 5px; top: 5px; max-width: calc(100% - 42px); padding: 4px 6px !important; color: #fff; background: rgba(36, 59, 52, .88); border-radius: 4px; font-size: 7px !important; font-weight: 700; line-height: 1 !important; }
.upload-help { display: block; margin-top: 7px; color: var(--ink-faint); font-size: 8px; text-align: center; }
.photo-empty { min-height: 88px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; padding: 14px; color: var(--ink-faint); background: var(--surface-muted); border: 1px dashed var(--line-strong); border-radius: 7px; font-size: 9px; text-align: center; }
.audit-list { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.audit-list div { min-width: 0; }
.audit-list dt { color: var(--ink-faint); font-size: 8px; text-transform: uppercase; }
.audit-list dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 9px; }
.consultation-note { margin: 12px 0 0; padding: 10px; color: var(--ink-soft); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; font-size: 9px; line-height: 1.45; text-align: center; }
.upload-zone { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 105px; margin-top: 10px; color: var(--ink-faint); background: var(--surface-muted); border: 1px dashed var(--line-strong); border-radius: 7px; cursor: pointer; text-align: center; }
.upload-zone:hover { color: var(--clay-dark); border-color: var(--clay); }
.upload-zone svg { margin-bottom: 6px; }
.upload-zone strong { color: inherit; font-size: 10px; }
.upload-zone small { margin-top: 3px; font-size: 8px; }
.timeline { list-style: none; margin: 0; padding: 2px 0 0; }
.timeline li { position: relative; padding: 0 0 18px 20px; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.timeline li::before { content: ""; position: absolute; left: 1px; top: 3px; width: 7px; height: 7px; background: var(--surface); border: 2px solid var(--sage); border-radius: 50%; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 12px; bottom: 2px; width: 1px; background: var(--line); }
.timeline strong { display: block; color: var(--ink); font-weight: 650; }
.timeline small { display: block; margin-top: 3px; color: var(--ink-faint); font-size: 8px; }
.document-list { list-style: none; margin: 0; padding: 0; }
.document-row { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.document-icon { width: 31px; height: 35px; display: grid; place-items: center; color: var(--clay-dark); background: var(--clay-soft); border-radius: 4px; }
.document-icon svg { width: 15px; height: 15px; }
.document-copy { min-width: 0; }
.document-copy strong { display: block; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.document-copy small { color: var(--ink-faint); font-size: 8px; }

.modal, .search-modal { width: min(560px, calc(100vw - 28px)); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal::backdrop, .search-modal::backdrop { background: rgba(22, 30, 26, .53); backdrop-filter: blur(3px); }
.modal form { padding: 23px; }
.modal-small { width: min(440px, calc(100vw - 28px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.modal-head h2 { margin: 0; font-family: var(--font-serif); font-size: 25px; font-weight: 500; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.measurement-modal { width: min(1180px, calc(100vw - 22px)); max-height: calc(100vh - 22px); }
.measurement-dialog-content { padding: 20px; }
.measurement-dialog-content > .modal-head { margin-bottom: 13px; }
.measurement-dialog-content > .modal-head p { margin: 4px 0 0; color: var(--ink-faint); font-size: 9px; }
.measurement-intro { display: flex; flex-direction: column; gap: 4px; padding: 11px 13px; color: var(--ink-soft); background: var(--clay-soft); border: 1px solid rgba(189, 104, 73, .25); border-radius: 7px; font-size: 10px; line-height: 1.45; }
.measurement-intro strong { color: var(--ink); }
.measurement-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 13px; margin-top: 13px; }
.measurement-sidebar { max-height: 66vh; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; padding-right: 2px; }
.measurement-panel { padding: 11px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 7px; }
.measurement-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.measurement-panel-head > div { display: flex; align-items: center; gap: 7px; }
.measurement-panel-head > div > span { width: 20px; height: 20px; display: grid; place-items: center; color: #fff; background: var(--forest); border-radius: 50%; font-size: 8px; font-weight: 800; }
.measurement-panel-head h3 { margin: 0; font-size: 10px; }
.measurement-panel-head > strong { color: var(--ink-faint); font-size: 8px; }
.measurement-panel .field + .field, .measurement-plane-fields { margin-top: 8px; }
.measurement-plane-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.measurement-plane-fields[hidden] { display: none; }
.measurement-panel-help { margin: 8px 0 0; color: var(--ink-faint); font-size: 8px; line-height: 1.45; }
.measurement-panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.measurement-panel-actions .button { min-width: 0; padding-inline: 7px; }
.measurement-list { display: flex; flex-direction: column; gap: 6px; }
.measurement-list-empty { padding: 10px; color: var(--ink-faint); border: 1px dashed var(--line-strong); border-radius: 6px; font-size: 8px; line-height: 1.4; text-align: center; }
.measurement-list-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.measurement-list-copy { min-width: 0; }
.measurement-list-copy strong, .measurement-list-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.measurement-list-copy strong { font-size: 9px; }
.measurement-list-copy span { margin-top: 2px; color: var(--forest); font-size: 11px; font-weight: 750; }
.measurement-list-actions { display: flex; gap: 3px; }
.measurement-list-actions button { width: 27px; height: 27px; display: grid; place-items: center; padding: 0; color: var(--ink-soft); background: transparent; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.measurement-list-actions button svg { width: 12px; height: 12px; }
.measurement-list-actions button:last-child { color: var(--danger); }
.measurement-workspace { min-width: 0; min-height: 0; }
.measurement-instruction { margin: 8px 0; color: var(--ink); font-size: 11px; font-weight: 700; text-align: center; }
.measurement-image-scroll { height: min(58vh, 650px); overflow: auto; background: #222; border: 1px solid var(--line-strong); border-radius: 7px; }
.measurement-image-stage { position: relative; width: 100%; min-width: 100%; margin: auto; cursor: crosshair; }
.measurement-image-stage img { width: 100%; height: auto; display: block; }
.measurement-image-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.measurement-marker-layer { position: absolute; inset: 0; pointer-events: none; }
.measurement-crosshair { position: absolute; width: 22px; height: 22px; color: #ffd84c; transform: translate(-50%, -50%); filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000); }
.measurement-crosshair::before, .measurement-crosshair::after { content: ""; position: absolute; left: 50%; top: 50%; background: currentColor; transform: translate(-50%, -50%); }
.measurement-crosshair::before { width: 22px; height: 1px; }
.measurement-crosshair::after { width: 1px; height: 22px; }
.measurement-crosshair.target { color: #56e5ff; }
.measurement-crosshair.saved { color: #48e0a4; }
.measurement-crosshair b { position: absolute; left: 15px; top: -7px; color: currentColor; font: 800 9px/1 sans-serif; text-shadow: 0 1px 2px #000, 0 0 2px #000; white-space: nowrap; }
.measurement-line { stroke-width: 3px; stroke-linecap: round; }
.measurement-line.reference { stroke: #ffd84c; }
.measurement-line.target { stroke: #56e5ff; }
.measurement-line.saved { stroke: #48e0a4; }
.measurement-polygon { fill: rgba(255, 216, 76, .12); stroke: #ffd84c; stroke-width: 3px; }
.measurement-result { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px; color: var(--ink-soft); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 7px; }
.measurement-result span { font-size: 9px; text-transform: uppercase; }
.measurement-result strong { color: var(--forest); font-family: var(--font-serif); font-size: 22px; }
.measurement-tools { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.measurement-tools label { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 9px; }
.measurement-tools input { width: 100px; accent-color: var(--clay); }
.measurement-warning { margin: 8px 0 0; color: var(--ink-faint); font-size: 8px; line-height: 1.45; text-align: center; }
.modal-copy { color: var(--ink-soft); line-height: 1.55; }
.confirm-phrase { margin-top: 16px; padding: 12px; background: #fff6f4; border: 1px solid #e3b9b0; border-radius: 7px; }
.confirm-phrase strong { color: var(--danger); letter-spacing: .06em; }
.confirm-phrase input { text-transform: uppercase; }
.upload-field { padding: 13px; background: var(--surface-muted); border: 1px dashed var(--line-strong); border-radius: 7px; }
.upload-field input { padding: 5px; background: transparent; border: 0; }
.member-picker { min-width: 0; padding: 13px; margin: 0; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 7px; }
.member-picker legend { padding: 0 5px; color: var(--ink-soft); font-size: 10px; font-weight: 650; }
.member-picker > div { max-height: 190px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; overflow: auto; }
.member-option { min-width: 0; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.member-option input { width: 16px; min-height: 16px; accent-color: var(--clay); }
.member-option > span:last-child { min-width: 0; }
.member-option strong, .member-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-option strong { font-size: 9px; }
.member-option small { margin-top: 2px; color: var(--ink-faint); font-size: 8px; }
.search-modal { width: min(680px, calc(100vw - 28px)); margin-top: 11vh; vertical-align: top; }
.search-dialog-form { padding: 0; }
.search-input-wrap { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.search-input-wrap svg { color: var(--ink-faint); }
.search-input-wrap input { min-width: 0; flex: 1; height: 35px; padding: 0; background: transparent; border: 0; outline: 0; font-size: 16px; }
.key-button { padding: 3px 6px; color: var(--ink-faint); background: var(--surface-muted); border: 1px solid var(--line); border-radius: 4px; font-size: 9px; cursor: pointer; }
.search-results { max-height: 420px; overflow: auto; padding: 8px; }
.search-hint { padding: 35px; color: var(--ink-faint); font-size: 11px; text-align: center; }
.search-result { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 11px; background: transparent; border: 0; border-radius: 6px; cursor: pointer; text-align: left; }
.search-result:hover { background: var(--surface-muted); }
.search-result-icon { width: 29px; height: 29px; display: grid; place-items: center; color: var(--clay-dark); background: var(--clay-soft); border-radius: 50%; }
.search-result-icon svg { width: 14px; height: 14px; }
.search-result-copy { min-width: 0; }
.search-result-copy strong { display: block; font-size: 11px; }
.search-result-copy span { display: block; margin-top: 3px; overflow: hidden; color: var(--ink-faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.search-result > small { color: var(--ink-faint); font-size: 8px; }
.photo-lightbox { width: min(1000px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 44px 16px 14px; color: white; background: rgba(19, 24, 21, .98); border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.photo-lightbox::backdrop { background: rgba(5, 8, 6, .82); backdrop-filter: blur(3px); }
.photo-lightbox .lightbox-close { position: absolute; top: 7px; right: 7px; color: white; }
.photo-lightbox img { width: 100%; max-height: calc(100vh - 125px); object-fit: contain; }
.photo-lightbox p { margin: 10px 0 0; color: #d9dedb; font-size: 11px; text-align: center; }
.toast-region { position: fixed; z-index: 1000; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 390px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: white; background: var(--forest); border-radius: 8px; box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out; font-size: 11px; }
.toast.error { background: var(--danger); }
.toast svg { width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.mobile-nav { display: none; }

/* Associação de fotografias profissionais */
.professional-page { max-width: none; }
.professional-import-actions, .professional-toolbar, .professional-panel-head { display: flex; align-items: center; gap: 10px; }
.professional-import-actions .button { cursor: pointer; }
.professional-import-actions .is-disabled { opacity: .5; pointer-events: none; }
.professional-toolbar { flex-wrap: wrap; margin-bottom: 14px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.professional-toolbar select { min-height: 38px; padding: 0 34px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.professional-toolbar label { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; }
#professionalImportProgress { margin-left: auto; color: var(--ink-soft); font-size: 12px; }
.professional-workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); min-height: calc(100vh - 270px); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.professional-gallery-panel, .professional-points-panel { min-width: 0; padding: 16px; }
.professional-gallery-panel { border-right: 1px solid var(--line); background: var(--paper); }
.professional-panel-head { justify-content: space-between; margin-bottom: 12px; }
.professional-panel-head h2 { margin: 0; font-family: var(--serif); font-size: 20px; }
.professional-panel-head strong { color: var(--clay-dark); font-size: 12px; }
.professional-panel-head select { max-width: 220px; }
.professional-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--professional-thumb), 1fr)); gap: 12px; align-content: start; max-height: calc(100vh - 345px); overflow: auto; padding: 3px; }
.professional-photo-card { position: relative; min-width: 0; padding: 7px; border: 2px solid transparent; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-soft); cursor: pointer; user-select: none; }
.professional-photo-card.is-selected { border-color: var(--clay); box-shadow: 0 0 0 2px color-mix(in srgb, var(--clay) 25%, transparent); }
.professional-photo-image { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 7px; background: #e8e6e1; }
.professional-photo-image img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.professional-check { position: absolute; top: 7px; right: 7px; display: none; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--clay); color: #fff; font-weight: 700; }
.professional-photo-card.is-selected .professional-check { display: grid; }
.professional-photo-card > strong, .professional-photo-card > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.professional-photo-card > strong { margin-top: 7px; font-size: 12px; }
.professional-photo-card > small { margin-top: 2px; color: var(--ink-faint); font-size: 10px; }
.professional-state { display: inline-block; margin-top: 6px; padding: 3px 6px; border-radius: 999px; background: #eceae5; color: var(--ink-soft); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.professional-state.associated { background: #dcebe2; color: #315d45; }
.professional-state.ignored { background: #e8e8e8; color: #666; }
.professional-state.possible_duplicate { background: #f5e4c6; color: #835b17; }
.professional-points-panel { display: flex; flex-direction: column; gap: 10px; }
.professional-points-panel .toolbar-search { width: 100%; }
.professional-point-list { display: flex; flex-direction: column; gap: 10px; overflow: auto; max-height: calc(100vh - 405px); padding: 3px; }
.professional-point-card { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s; }
.professional-point-card.is-active { border-color: var(--clay); }
.professional-point-card.is-drop-target { border-color: var(--clay); background: color-mix(in srgb, var(--clay) 12%, white); box-shadow: 0 0 0 3px color-mix(in srgb, var(--clay) 25%, transparent); }
.professional-point-card.has-no-photos { opacity: .68; }
.professional-point-head { display: grid; grid-template-columns: 144px 1fr; gap: 12px; align-items: center; }
.field-photo-thumb { display: grid; place-items: center; width: 144px; min-height: 96px; height: auto; overflow: visible; border-radius: 9px; background: #fff; color: var(--ink-faint); }
.field-photo-thumb img { display: block; width: 100%; height: auto !important; max-width: 100%; max-height: none !important; object-fit: contain !important; object-position: center; border-radius: 9px; background: #fff; }
.field-photo-thumb svg { width: 24px; height: 24px; }
.professional-point-head strong, .professional-point-head small, .professional-point-head span { display: block; }
.professional-point-head strong { font-family: var(--mono); }
.professional-point-head small, .professional-point-head span { margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
.professional-drop-hint { margin: 8px 0 0; padding: 8px; border: 1px dashed var(--line-strong); border-radius: 7px; color: var(--ink-faint); font-size: 11px; text-align: center; }
.professional-linked-list { display: grid; gap: 5px; margin-top: 8px; }
.professional-linked-list > div { display: grid; grid-template-columns: 32px minmax(0, 1fr) 28px 28px; gap: 6px; align-items: center; }
.professional-linked-list img { display: block; width: 32px; height: 32px; object-fit: contain !important; object-position: center; border-radius: 5px; background: #fff; }
.professional-linked-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.professional-linked-list button { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 6px; background: var(--paper); color: var(--ink-soft); cursor: pointer; }
.professional-linked-list button svg { width: 14px; height: 14px; }
.professional-next-button { width: 100%; margin-top: auto; }
.professional-drag-status { position: fixed; z-index: 100; left: 50%; bottom: 28px; display: none; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: var(--ink); color: white; box-shadow: var(--shadow); font-weight: 700; }
.professional-drag-status.is-visible { display: block; }
.professional-compare-modal { width: min(1200px, calc(100vw - 32px)); }
.professional-compare-modal > section { padding: 22px; }
.professional-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.professional-compare-grid figure { min-width: 0; margin: 0; }
.professional-compare-grid figcaption { margin-bottom: 8px; font-weight: 700; }
.compare-image-frame { height: min(65vh, 650px); overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.compare-image-frame img { display: block; width: 100%; height: 100%; object-fit: contain; transform-origin: center; }
.professional-compare-grid label { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; }
.professional-compare-grid input { flex: 1; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .typology-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .project-strip { grid-template-columns: repeat(3, 1fr); }
  .projects-list { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .point-inspector { width: 340px; flex-basis: 340px; }
}

@media (max-width: 920px) {
  :root { --sidebar-width: 210px; }
  .topbar { padding: 0 18px; }
  .profile-chip { min-width: 40px; }
  .profile-copy, .profile-chip > svg { display: none; }
  .point-inspector { position: absolute; z-index: 6; top: 57px; right: 0; bottom: 0; width: min(368px, 88vw); box-shadow: -14px 0 35px rgba(25, 31, 27, .16); }
  .point-inspector.is-empty-mobile { display: none; }
  .reports-layout { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .button, .icon-button, .select-control, .date-control, .field input, .field select { min-height: 44px; }
  .point-marker { width: 34px; height: 34px; }
}

@media (max-width: 760px) {
  :root { --topbar-height: 58px; }
  body { padding-bottom: 61px; }
  .sidebar { position: fixed; z-index: 20; inset: 0 auto 61px 0; width: 244px; transform: translateX(-105%); box-shadow: 18px 0 50px rgba(20, 28, 24, .35); transition: transform .22s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .brand { min-height: 108px; }
  .mobile-menu { display: inline-flex; }
  .topbar { gap: 8px; padding: 0 10px; }
  .global-search { width: auto; flex: 1; border-color: transparent; background: transparent; }
  .global-search span, .global-search kbd { display: none; }
  .global-search svg { width: 20px; height: 20px; }
  .notification-popover { position: fixed; top: calc(var(--topbar-height) + 6px); left: 10px; right: 10px; width: auto; }
  .profile-chip { min-width: 34px; padding: 0; }
  .avatar { width: 32px; height: 32px; flex-basis: 32px; }
  .mobile-nav { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; height: 61px; display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
  .mobile-nav button { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; color: var(--ink-faint); background: none; border: 0; font-size: 8px; }
  .mobile-nav button svg { width: 18px; height: 18px; }
  .mobile-nav button.is-active { color: var(--clay-dark); }
  .mobile-nav button.is-active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; background: var(--clay); }
  .page { padding: 24px 16px 35px; }
  .page-head, .dashboard-intro { align-items: flex-start; flex-direction: column; display: flex; }
  .date-block { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { padding: 14px; }
  .metric-value { font-size: 25px; }
  .typology-overview { padding: 14px; }
  .typology-overview .section-head { align-items: flex-start; }
  .typology-summary-grid { grid-template-columns: 1fr; }
  .project-strip, .projects-list { grid-template-columns: 1fr; }
  .project-strip .project-card:nth-child(n+3) { display: none; }
  .view-toolbar { align-items: stretch; flex-direction: column; }
  .professional-import-actions { width: 100%; flex-wrap: wrap; }
  .professional-workspace { grid-template-columns: 1fr; }
  .professional-gallery-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .professional-gallery, .professional-point-list { max-height: 48vh; }
  .professional-compare-grid { grid-template-columns: 1fr; }
  .compare-image-frame { height: 42vh; }
  .professional-point-head { grid-template-columns: 108px 1fr; }
  .field-photo-thumb { width: 108px; min-height: 72px; height: auto; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar-actions > * { width: 100%; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid, .admin-layout { grid-template-columns: 1fr; }
  .viewer-top { height: auto; min-height: 55px; flex: 0 0 auto; flex-wrap: wrap; gap: 7px; padding: 8px 10px; }
  .viewer-context { flex: 1; }
  .viewer-context .project-label { max-width: 145px; font-size: 14px; }
  .area-select { max-width: 135px; }
  .viewer-toolbar { width: 100%; margin-left: 0; justify-content: space-between; padding-top: 7px; border-top: 1px solid var(--line); }
  .viewer-toolbar .button span { display: none; }
  .viewer-toolbar .button { width: 36px; padding: 0; }
  .canvas-scene { width: 95%; }
  .canvas-info { bottom: 9px; left: 9px; }
  .mini-map { display: none; }
  .point-marker { width: 25px; height: 25px; }
  .point-inspector { top: 99px; bottom: 61px; width: 100%; }
  .inspector-save-bar { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .filter-popover { left: 10px; right: 10px; top: 10px; width: auto; }
  .add-hint { max-width: calc(100% - 20px); width: max-content; top: 10px; }
  .placement-controls { bottom: 68px; grid-template-columns: auto 1fr; gap: 7px 10px; padding: 9px; }
  .placement-nudge { grid-column: 1; grid-row: 1 / span 3; }
  .placement-controls label, .placement-coordinate, .placement-controls > .button { grid-column: 2; }
  .placement-controls > .button { width: 100%; }
  .reports-layout { display: block; }
  .report-preview { padding: 18px; margin-bottom: 14px; }
  .report-summary div { padding: 9px 4px; }
  .report-summary strong { font-size: 18px; }
  .modal form { padding: 19px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .toast-region { left: 12px; right: 12px; bottom: 72px; }
  .toast { min-width: 0; max-width: none; }
  .asset-setting { grid-template-columns: 96px 1fr; }
  .photo-actions { grid-template-columns: 1fr; }
  .measurement-dialog-content { padding: 15px; }
  .measurement-layout { grid-template-columns: 1fr; }
  .measurement-sidebar { max-height: none; overflow: visible; }
  .measurement-workspace { order: -1; }
  .measurement-image-scroll { height: 45vh; }
  .measurement-tools { display: grid; grid-template-columns: 1fr 1fr; }
  .measurement-tools label { grid-column: 1 / -1; justify-content: center; }
  .measurement-tools .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .point-marker.is-selected { animation: none; }
}

@media (max-width: 420px) {
  .metric-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .report-masthead { flex-direction: column; gap: 9px; }
  .report-meta { text-align: left; }
  .report-photo-annex > div { grid-template-columns: 1fr; }
  .asset-setting { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { padding: 0; background: white; }
  .splash-screen, .sidebar, .topbar, .mobile-nav, .page-head, .report-controls { display: none !important; }
  .app-shell, .app-column, #mainContent { display: block; height: auto; overflow: visible; }
  .page { width: 100%; padding: 0; }
  .reports-layout { display: block; }
  .report-preview { border: 0; box-shadow: none; }
  .report-table-wrap { overflow: visible; }
  .report-table-wrap .data-table { min-width: 0; table-layout: fixed; }
  .report-table-wrap .data-table th, .report-table-wrap .data-table td { padding: 5px; overflow-wrap: anywhere; font-size: 7px; }
  .report-photo-annex figure, .report-area-maps figure { break-inside: avoid; }
}
