/* Telemonit UI foundation 0.7. Plain CSS; no build, external fonts or CDN required.
   Order: feature styles → appearance.css → this file → validated Branding tokens. */
:root {
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: var(--font);
  --font-body: 1rem;
  --font-label: .875rem;
  --font-caption: .875rem;
  --control-height: 2.75rem;
  --control-border: #71888d;
  --muted: #536a70;
  --brand: #146b63;
  --brand-ink: #ffffff;
  --brand-border: var(--focus-ring);
  --brand-link: #146b63;
  --focus-ring: #146b63;
  --teal: var(--brand-link);
  --teal-dark: var(--brand-link);
  --focus: var(--focus-ring);
  --on-accent: var(--brand-ink);
  --danger-surface: #ffefeb;
  --danger-ink: #952c26;
  --warning-surface: #fff1d1;
  --warning-ink: #755015;
  --success-surface: #e6f3e9;
  --success-ink: #275f3b;
  --sidebar-ink: #f1f7f4;
  --sidebar-muted: #b8ccc5;
  --ui-sidebar-width: 218px;
  --demo-ribbon-height: 0px;
  font-size: calc(100% * var(--text-scale, 1));
}
:root[data-theme="warm"] {
  --muted: #735d4a;
  --control-border: #947c5e;
  --brand: #75551e;
  --brand-ink: #ffffff;
  --brand-border: var(--focus-ring);
  --brand-link: #75551e;
  --focus-ring: #75551e;
  --teal: var(--brand-link);
  --teal-dark: var(--brand-link);
  --focus: var(--focus-ring);
  --danger-surface: #f8e4da;
  --danger-ink: #8c3025;
  --warning-surface: #f4e4bd;
  --warning-ink: #6f4d12;
  --success-surface: #e6ecd7;
  --success-ink: #345b32;
}
:root[data-theme="dark"] {
  --control-border: #708c93;
  --brand: #75d9c9;
  --brand-ink: #102d34;
  --brand-border: var(--focus-ring);
  --brand-link: #91e5d8;
  --focus-ring: #91e5d8;
  --teal: var(--brand-link);
  --teal-dark: var(--brand-link);
  --focus: var(--focus-ring);
  --danger-surface: #462c2d;
  --danger-ink: #ffd0c7;
  --warning-surface: #433b24;
  --warning-ink: #f6dfa7;
  --success-surface: #234336;
  --success-ink: #c0efc9;
}
body, body.app-page, body.market-page { font-family: var(--font); font-size: var(--font-body); line-height: 1.55; color: var(--ink); background: var(--bg); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font); letter-spacing: -.025em; overflow-wrap: break-word; word-break: normal; }
/* Prose wraps at spaces first. Unlike anywhere, this does not make a whole word
   a one-character min-content item in a flex/grid layout. Technical IDs and URLs
   keep their explicit anywhere rules in the components that display them. */
:where(p, li, dd, dt, label, small, .muted, .small-note) { overflow-wrap: break-word; word-break: normal; }
:where(main, section, article, aside, form, fieldset, .form-grid, .content-card, .form-field) { min-width: 0; }
:where(input, select, textarea, button) { max-width: 100%; }
:where(img, video, canvas, audio) { max-width: 100%; }
:where(pre, .table-scroll) { max-width: 100%; overflow-x: auto; }
:where(a) { text-underline-offset: .2em; }
:where(p, li, dd, small, .content-prose) a:not(.button) { text-decoration: underline; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring) !important;
  outline-offset: 3px !important;
  scroll-margin: 6rem 1rem;
}
:where(a, button, input, select, textarea, summary) { touch-action: manipulation; }
:where(button, select, summary, input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]), .button) {
  min-height: var(--control-height);
}
button:disabled { cursor: not-allowed; }
.button, .v4-page button { font-size: var(--font-label); white-space: normal; text-wrap: wrap; overflow-wrap: normal; word-break: normal; }
.button > .icon, button > .icon { flex-shrink: 0; }
.button-small, .modal-actions .button { min-height: var(--control-height); }
.icon-button, .nav-toggle, .object-panel-heading .icon-button, .app-header-actions .icon-button {
  width: var(--control-height); height: var(--control-height); min-width: var(--control-height);
  flex: 0 0 var(--control-height); min-height: var(--control-height);
}
.form-field, .v4-page label, .settings-section .form-field { font-size: var(--font-label); line-height: 1.55; }
.form-field input, .form-field select, .form-field textarea, .v4-page :is(input, select, textarea),
.search-field > input, .filter-row select, .parameter-row input, .chat-order-label > select {
  font-size: var(--font-body); line-height: 1.5; border-color: var(--control-border); color: var(--ink); background-color: var(--surface);
}
.form-field input::placeholder, .form-field textarea::placeholder, .search-field > input::placeholder,
.market-assistant textarea::placeholder, .parameter-row input::placeholder { color: var(--muted); opacity: 1; }
:where(input[type="checkbox"], input[type="radio"]) { accent-color: var(--brand); min-width: 1.125rem; min-height: 1.125rem; }
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { min-height: var(--control-height); }
.button-dark, [data-theme="dark"] .button-dark, .button-dark:hover, [data-theme="dark"] .button-dark:hover {
  background: var(--brand); border-color: var(--brand-border, var(--focus-ring)); color: var(--brand-ink);
}
.button-dark:hover { box-shadow: inset 0 0 0 2px var(--brand-ink); transform: none; }
.button-outline, [data-theme="dark"] .button-outline { border-color: var(--control-border); color: var(--ink); }
.button-outline:hover { background: var(--soft); }
.button-quiet, .icon-button { color: var(--muted); }
.button-danger, .button-danger:hover { background: var(--danger-ink); color: var(--danger-surface); border-color: var(--danger-ink); }
.danger-text, .danger-text:hover, .import-errors { color: var(--danger-ink); }
.skip-link { background: var(--brand); color: var(--brand-ink); max-width: calc(100vw - 2rem); }
.skip-link:focus { color: var(--brand-ink); }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

/* Common cards, metadata and status colors. These replace inherited pastel hexes. */
.app-header, .detail-panel, .detail-tabs, .object-panel, .content-card, .modal,
.note-card, .issue-card, .service-order-card, .field-gps-row, .chat-message,
.auth-content, .market-header, .market-detail, .market-inline-form,
.market-confirm > div, .public-footer, .object-panel-foot {
  background: var(--surface); color: var(--ink); border-color: var(--line);
}
.search-field, .filter-row select, .info-box, .file-drop, .field-photo-area, .field-metadata,
.field-check-option, .analysis-card, .chat-context-bar, .chat-readonly, .device-address,
.vault-revealed, .vault-reveal-consent, .travel-estimate, .market-segmented,
.market-assistant-entry, .market-job-message, .market-skills label, .content-prose blockquote,
.content-prose th, .permission-tag, .auth-welcome-icon, .field-ai-note,
#market-key-once, .device-modal #device-editor { background: var(--soft); color: var(--ink); border-color: var(--line); }
.object-row:hover, .object-row.selected, .market-assistant-entry.user, .market-job-message.own,
.admin-content-row:hover, .admin-content-row.active,
.provider-option:has(input:checked), .permission-options > label:has(input:checked),
.workspace-option.active, .observation-kind input:checked + span { background: var(--soft); border-color: var(--control-border); color: var(--ink); }
.app-breadcrumb, .app-breadcrumb > span:last-child, .header-date,
.object-row-number, .object-row-meta, .object-panel-foot, .detail-heading-main > small,
.detail-properties dt, .detail-coordinates, .detail-tabs button, .record-meta,
.record-meta > time, .issue-card-heading > small, .history-item small, .history-item p,
.detail-footer-note, .plan-usage-caption, .plan-expiry, .quote-expiry, .checkout-footnote,
.order-invoice, .empty-state p, .loading-state, .file-drop > span, .file-drop > input,
.permission-options small, .auth-footnote, .auth-mobile-brand, .form-field .optional,
.field-toolbar-label, .field-record-author > small, .field-media-caption,
.field-meta-details > summary, .field-meta-list dt, .field-meta-warnings > p,
.analysis-caution, .analysis-reviewed, .observation-kind small, .field-photo-empty > p,
.field-gps-row p, .field-metadata-actions > span, .field-check-option small,
.field-check-option small + small, .field-privacy-note, .chat-context-bar > span,
.chat-order-label, .point-member-main > .point-member-scope, .service-order-description,
.service-order-meta, .service-order-finance > span, .service-order-finance > small,
.service-payments > summary, .service-payment-record > small, .analysis-proposal-section li,
.analysis-proposal-section > p, .analysis-proposal-section li > small, .analysis-language,
.market-segmented button, .market-mobile-nav button, .object-list-tabs button,
.buyer-details summary, .mobile-map-toggle button { color: var(--muted); }
.detail-properties dd, .note-card p, .issue-card p, .record-meta > .record-author,
.issue-status-select, .history-item strong, .field-record-body, .field-meta-list dd,
.analysis-result, .analysis-proposal-section > h4, .chat-order-label > select,
.site-nav a, .toast { color: var(--ink); }
.form-alert, .app-error-banner, .toast-error, .kind-issue, .analysis-failed,
.analysis-needs_reconciliation, .market-status-manual_review, .status-new {
  background: var(--danger-surface); color: var(--danger-ink); border-color: var(--danger-ink);
}
.connection-banner, .field-analysis-error, .analysis-processing, .analysis-queued,
.order-in_progress, .market-status-auction, .market-auction-clock,
.status-in_progress, .provider-unavailable { background: var(--warning-surface); color: var(--warning-ink); }
.market-auction-clock span { color: var(--warning-ink); }
.kind-state, .analysis-completed, .order-done, .market-status-funded,
.market-status-accepted, .market-status-released, .status-resolved, .import-summary {
  background: var(--success-surface); color: var(--success-ink);
}
.field-role, .analysis-status, .service-order-status, .market-status,
.message-order-context { background: var(--soft); color: var(--muted); }
.analysis-status.analysis-completed, .service-order-status.order-done,
.market-status.market-status-funded, .market-status.market-status-accepted,
.market-status.market-status-released { background: var(--success-surface); color: var(--success-ink); }
.analysis-status.analysis-processing, .analysis-status.analysis-queued,
.service-order-status.order-in_progress, .market-status.market-status-auction { background: var(--warning-surface); color: var(--warning-ink); }
.analysis-status.analysis-failed, .analysis-status.analysis-needs_reconciliation,
.market-status.market-status-manual_review { background: var(--danger-surface); color: var(--danger-ink); }
.market-available, .live-location-active { color: var(--success-ink); }
.app-sidebar, .admin-sidebar { color: var(--sidebar-ink); }
.app-sidebar .sidebar-label, .admin-sidebar .sidebar-label, .app-sidebar .nav-item,
.admin-sidebar .nav-item, .workspace-card small, .profile-button small,
.admin-sidebar-bottom a, .plan-mini > strong { color: var(--sidebar-muted); }
.app-sidebar .nav-item.active, .admin-sidebar .nav-item.active { color: var(--lime); }
.app-navigation .nav-item { min-height: var(--control-height); }

.detail-description, .field-record-body, .chat-message .field-record-body,
.service-order-description, .note-card p, .issue-card p, .market-detail-description,
.content-prose p, .content-prose li { font-size: 1rem; line-height: 1.65; }
.field-photo-actions, .field-gps-row, .chat-composer-controls, .field-record-header,
.field-metadata-actions, .issue-overview-row, .team-row, .invite-row { flex-wrap: wrap; }
.parameter-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) var(--control-height); }
.filter-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,9rem),1fr)); }
.filter-row select { min-width: 0; width: 100%; }
.audience-strip, .pricing-section, .currency-switch, .final-cta,
.asset-icon, .symbol-camera, .symbol-building, .symbol-trees { background: var(--soft); border-color: var(--line); }
.audience-strip .container > span, .audience-strip .icon, .step-number,
.coupon-note, .final-cta p { color: var(--muted); }
.asset-icon, .symbol-camera, .symbol-building, .symbol-trees { color: var(--brand-link); }
.map-pin, .demo-marker { background: var(--brand); color: var(--brand-ink); }
.app-sidebar, .admin-sidebar, .auth-aside, .capabilities-section, .price-card-featured { --focus-ring: #bcebd4; }
/* Branding surfaces: meaningful text uses the site's title; decorative mark has empty alt. */
.brand { min-width: 0; min-height: var(--control-height); overflow-wrap: normal; word-break: normal; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; flex: 0 0 2.5rem; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: .5rem; border: 1px solid var(--brand-border, var(--focus-ring)); }
.brand-mark .brand-initials, .brand-mark .brand-mark-text, .brand-mark .brand-monogram { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: .65rem; background: var(--brand); color: var(--brand-ink); font-size: .875rem; letter-spacing: 0; font-weight: 800; line-height: 1; border: 1px solid var(--brand-border, var(--focus-ring)); }
.brand-name { min-width: 0; overflow-wrap: break-word; }
.app-sidebar .brand-mark, .admin-sidebar .brand-mark, .market-header .brand-mark { width: 2.5rem; height: 2.5rem; flex-basis: 2.5rem; }

/* The illustrative map uses the same readable surfaces as real object cards. */
.product-preview, .preview-detail, .preview-toolbar, .preview-bottom, .floating-proof {
  background: var(--surface); color: var(--ink); border-color: var(--line);
}
.product-preview { transform: none; width: 100%; }
.product-preview :is(p, small, strong, .status-badge), .preview-workspace, .preview-add,
.preview-map-caption, .preview-bottom, .floating-proof strong, .floating-proof span { font-size: .875rem; }
.preview-detail > p { color: var(--ink); }
.preview-toolbar { height: auto; min-height: 4.5rem; padding: .75rem 1rem; gap: .5rem; flex-wrap: wrap; }
.preview-workspace { margin: 0 0 0 auto; }
.preview-canvas { height: auto; min-height: 26rem; padding: .5rem 0; }
.preview-detail { position: relative; top: auto; left: auto; right: auto; margin: 8rem 1rem 2.5rem; max-width: 26rem; padding: 1rem; }
.preview-detail-title { align-items: flex-start; }
.preview-detail-meta { flex-wrap: wrap; gap: .5rem; }
.preview-map-control { background: var(--surface); border-color: var(--control-border); }
.preview-map-control span { color: var(--ink); }
.preview-map-caption, .map-street, .map-area-label { color: #435951; background: #ffffff; padding: .125rem .25rem; }
.preview-bottom { flex-wrap: wrap; gap: .5rem; padding: .75rem 1rem; }
.floating-proof { position: static; transform: none; margin: 1rem; max-width: calc(100% - 2rem); padding: .75rem; }
.step-illustration { color: var(--ink); }
.role-label, .mini-coordinate { font-size: .875rem; background: var(--surface); color: var(--muted); }

/* Grouped navigation: all modules remain links; profiles affect shortcut order only. */
.module-nav { position: relative; align-items: center; gap: .5rem; padding: 1rem 0; }
.module-nav .module-home { width: auto; gap: .6rem; margin-right: auto; padding-left: 0; font-size: 1.125rem; }
.module-shortcuts { display: flex; flex-wrap: wrap; gap: .25rem; }
.module-nav a { min-height: var(--control-height); font-size: .875rem; }
.module-nav a[aria-current="page"], .module-menu a[aria-current="page"] { color: var(--brand-link); background: var(--soft); text-decoration: underline; text-decoration-thickness: 2px; }
.module-location { flex: 0 0 100%; font-size: .875rem; padding: .25rem .25rem 0; }
.module-switcher { position: relative; }
.module-switcher > summary { display: flex; align-items: center; gap: .5rem; min-height: var(--control-height); padding: .65rem .85rem; border: 1px solid var(--control-border); border-radius: .65rem; background: var(--surface); color: var(--ink); cursor: pointer; list-style: none; font-size: .875rem; font-weight: 650; }
.module-switcher > summary::-webkit-details-marker { display: none; }
.module-switcher > summary .icon { width: 1.125rem; height: 1.125rem; }
.ui-chevron { margin-left: auto; font-size: 1rem; line-height: 1; }
.module-switcher[open] > summary .ui-chevron { transform: rotate(180deg); }
.module-switcher .module-menu, .quick-modules nav.module-menu {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 1600;
  width: min(39rem, calc(100vw - 2rem)); max-width: calc(100vw - 2rem);
  max-height: min(70dvh, 38rem); overflow: auto; overscroll-behavior: contain;
  padding: 1rem; border: 1px solid var(--control-border); border-radius: .875rem; background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.module-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.module-group h2 { font-size: .875rem; font-weight: 750; color: var(--muted); line-height: 1.4; margin: .25rem .5rem .5rem; letter-spacing: 0; }
.module-group ul { list-style: none; margin: 0; padding: 0; }
.module-menu a, .quick-modules .module-menu a { display: flex; align-items: center; gap: .5rem; padding: .65rem .5rem; min-height: var(--control-height); font-size: .875rem; color: var(--ink); font-weight: 550; line-height: 1.4; border-radius: .5rem; }
.module-menu a:hover { background: var(--soft); }
.module-current-label { margin-left: auto; color: var(--brand-link); font-size: .875rem; }
.module-access-note { font-size: .875rem; color: var(--muted); margin-top: 1rem; padding: .75rem .5rem 0; border-top: 1px solid var(--line); }

/* Public menu has one controller on every page, including CMS and public catalogues. */
.site-header { position: relative; background: var(--surface); border-color: var(--line); z-index: 90; }
.nav-wrap { height: auto; min-height: 5.5rem; gap: 1.25rem; padding-block: .75rem; }
.site-nav { gap: .75rem; font-size: .875rem; align-items: center; }
.site-nav a[aria-current="page"] { color: var(--brand-link); text-decoration: underline; text-decoration-thickness: 2px; }
.site-nav a { display: inline-flex; align-items: center; min-height: var(--control-height); padding: .25rem; line-height: 1.4; }
.nav-actions { gap: .75rem; }
.nav-actions > .button { font-size: .875rem; min-height: var(--control-height); }
.nav-toggle { display: none; }
.public-footer-grid { gap: 2rem; }
.public-footer nav a { min-height: var(--control-height); display: inline-flex; align-items: center; padding-block: .4rem; }

/* Admin filtering is a local view; fields retain their values and server permissions. */
.settings-search-panel { padding: 1.25rem; margin: 0 0 1.5rem; border: 1px solid var(--control-border); border-radius: .875rem; background: var(--surface); }
.settings-search-panel .form-field { max-width: 42rem; margin-bottom: .75rem; }
.settings-search-panel .small-note { font-size: .875rem; color: var(--muted); }
.settings-search-panel .button-row { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-top: .75rem; }
#admin-settings-count { min-height: 1.5rem; }

/* A card title is subordinate to the page heading, also at A+ on a phone. */
.ops-card h2, .ops-form h2, .v4-page .content-card h2, .app-page .content-card h2,
.admin-page .content-card h2, .market-page .content-card h2 { font-size: 1.25rem; line-height: 1.35; letter-spacing: -.015em; }
.ops-card h3, .ops-form h3, .v4-page .content-card h3, .app-page .content-card h3,
.admin-page .content-card h3, .market-page .content-card h3 { font-size: 1.0625rem; line-height: 1.4; letter-spacing: 0; }
.ops-card h2, .ops-card h3, .ops-form h2, .ops-form h3 { hyphens: auto; overflow-wrap: break-word; }

/* Native dialogs keep keyboard focus in the active task. */
dialog.modal { max-height: calc(100dvh - 2rem); overflow: auto; overscroll-behavior: contain; padding: clamp(1rem, 3vw, 2rem); border-color: var(--control-border); }
.modal-heading { align-items: flex-start; }
.modal-heading > .icon-button { margin: -.25rem -.25rem 0 0; }
.modal-actions { flex-wrap: wrap; }
.form-grid > *, .parameter-row > * { min-width: 0; }
.toast-stack { max-width: calc(100vw - 2rem); bottom: calc(5rem + env(safe-area-inset-bottom)); }
.toast { background: var(--surface); font-size: .875rem; }

/* App panels grow with text rather than clipping it into the old fixed header. */
.app-shell { height: calc(100dvh - var(--demo-ribbon-height)); min-height: 0; }
.app-header { min-height: 5.5rem; height: auto; flex: 0 0 auto; padding-block: .75rem; flex-wrap: wrap; }
.app-header > div:first-child { min-width: 0; flex: 1 1 12rem; }
.app-header-actions { flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.app-breadcrumb { line-height: 1.4; flex-wrap: wrap; }
.header-date { white-space: normal; }
.app-navigation { overscroll-behavior: contain; }
.object-row-name { line-height: 1.45; white-space: normal; }
.object-row-meta, .record-meta, .detail-actions { flex-wrap: wrap; }
.object-row { min-height: 5rem; }
.object-panel-heading h2 { min-width: 0; }
.detail-tabs { background: var(--surface); }
.detail-tabs button, .object-list-tabs button { min-height: var(--control-height); }
.detail-properties dd, .detail-coordinates { overflow-wrap: anywhere; }
.leaflet-container { font: 1rem/1.5 var(--font); }
.leaflet-popup-content, .leaflet-tooltip, .leaflet-control { font-family: var(--font); font-size: .875rem; line-height: 1.5; }
.leaflet-control-zoom a {
  width: var(--control-height) !important; height: var(--control-height) !important;
  min-width: var(--control-height); min-height: var(--control-height);
  line-height: var(--control-height) !important;
  color: var(--ink) !important; background: var(--surface) !important;
}
.leaflet-control-attribution { background: var(--surface) !important; color: var(--muted) !important; font-size: .875rem; }
.leaflet-control-attribution a { color: var(--brand-link) !important; text-decoration: underline; }
.map-legend, .map-basemap-control { background: var(--surface); color: var(--muted); font-size: .875rem; }
.map-tools > .icon-button { color: var(--ink); background: var(--surface); }
.map-empty-prompt, .map-unavailable { background: var(--surface); color: var(--ink); }
.demo-ribbon { position: relative; z-index: 0; font-size: .875rem; padding: .5rem .75rem; background: var(--warning-surface); color: var(--warning-ink); pointer-events: auto; }
.display-preferences { font-size: .875rem; }
.display-preferences > summary { min-height: var(--control-height); font-size: .875rem; border-color: var(--control-border); }
.display-preferences-panel { bottom: calc(100% + .5rem); width: min(22rem, calc(100vw - 2rem)); max-height: 65dvh; overflow: auto; padding: 1rem; border-color: var(--control-border); }
.display-preferences-panel small { font-size: .875rem; }
.display-choices { flex-wrap: wrap; }
.display-choices button { flex: 1 1 5rem; font-size: .875rem; min-height: var(--control-height); }
.voice-launch, .app-page .voice-launch { font-size: .875rem; min-height: var(--control-height); }
.app-page .voice-launch { left: calc(var(--ui-sidebar-width) + 1rem); }
.market-header { height: auto; min-height: 5rem; padding-block: .65rem; flex-wrap: wrap; gap: .75rem; }
.market-header-actions { flex-wrap: wrap; }
.market-main, .v4-page { min-width: 0; }
.market-detail, .market-device-panel { max-height: calc(100dvh - 7rem); }
.admin-header { flex-wrap: wrap; }
.admin-header > div { min-width: 0; }
.admin-sidebar .nav-item { justify-content: flex-start; }

@media (max-width: 74rem) {
  .nav-wrap { min-height: 4.5rem; }
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--control-border); box-shadow: var(--shadow); padding: 1rem max(1rem,calc((100vw - 75rem)/2)); flex-wrap: wrap; gap: .5rem; max-height: 70dvh; overflow: auto; }
  .site-nav.is-open { display: flex; }
  .site-nav a { flex: 1 1 12rem; min-height: var(--control-height); padding: .65rem .75rem; }
  .site-nav a:hover { background: var(--soft); }
}
@media (max-width: 1200px) { :root { --ui-sidebar-width: 194px; } }
@media (max-width: 1000px) {
  :root { --ui-sidebar-width: 76px; }
  .header-date { display: none; }
  .module-shortcuts { order: 3; flex: 0 0 100%; }
  .module-location { order: 4; }
  .object-panel { width: min(21rem, 42%); flex-basis: min(21rem, 42%); }
}
@media (max-width: 800px) { :root { --ui-sidebar-width: 66px; } }
@media (max-width: 760px) {
  .v4-page { padding-inline: 1rem; padding-bottom: 10rem; }
  .module-nav .module-home { width: auto; font-size: 1rem; }
  .module-nav > .module-switcher { margin-left: auto; }
  .module-switcher > summary { padding-inline: .65rem; }
  .module-shortcuts > a { flex: 1 1 6rem; justify-content: center; text-align: center; }
  .module-switcher .module-menu, .quick-modules nav.module-menu { position: fixed; top: 6rem; right: 1rem; left: 1rem; width: auto; max-width: none; max-height: calc(100dvh - 8rem); }
  .quick-modules > summary { min-width: var(--control-height); }
  .quick-modules > summary span { display: inline; }
  .quick-modules > summary .ui-chevron { display: none; }
  .display-preferences { right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); }
  .voice-launch, .app-page .voice-launch { left: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); }
  .app-page .display-preferences, .app-page .voice-launch,
  .market-page .display-preferences, .market-page .voice-launch { bottom: calc(4.75rem + env(safe-area-inset-bottom)); }
  .public-footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .nav-wrap { gap: .5rem; flex-wrap: wrap; }
  .nav-wrap > .brand { flex: 1 0 auto; max-width: 100%; }
  .nav-actions { margin-left: auto; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
  .nav-actions > .button { flex-shrink: 0; max-width: 100%; }
  .nav-actions .login-link { display: none; }
  .nav-actions > .button { padding-inline: .65rem; }
  .market-intro { flex-wrap: wrap; }
  .market-intro > .button { margin-top: 0; font-size: .875rem; }
  .market-intro p { max-width: none; }
  .admin-header > .button { font-size: .875rem; }
  .admin-sidebar .app-navigation { flex-wrap: wrap; overflow-x: visible; }
  .admin-sidebar .nav-item { font-size: .875rem; min-height: var(--control-height); flex: 1 1 7rem; }
  .admin-sidebar .nav-item .icon { width: 1.125rem; height: 1.125rem; flex-basis: 1.125rem; }
}
@media (max-width: 600px) {
  :root { --ui-sidebar-width: 0px; }
  .module-nav .module-home .brand-mark { width: 2rem; height: 2rem; flex-basis: 2rem; }
  .module-nav > .module-switcher > summary { font-size: .875rem; }
  .module-groups { grid-template-columns: minmax(0,1fr); gap: .75rem; }
  .module-group h2 { margin-top: .5rem; }
  .module-location { line-height: 1.5; }
  .brand { font-size: 1.25rem; }
  .nav-wrap > .brand { flex: 1 0 auto; }
  .nav-wrap .brand-mark { width: 2rem; height: 2rem; flex-basis: 2rem; }
  .nav-actions > .button > .icon { display: none; }
  .public-footer-grid { grid-template-columns: minmax(0,1fr); }
  .app-header { padding: .75rem 1rem; gap: .5rem; }
  .app-header > div:first-child { flex-basis: 100%; }
  .app-header-actions { justify-content: flex-start; width: 100%; }
  .app-header-actions .button { min-height: var(--control-height); font-size: .875rem; }
  .app-header h1 { font-size: 1.25rem; }
  .app-main { padding-bottom: calc(4rem + env(safe-area-inset-bottom)); }
  .object-panel { width: 100%; flex-basis: auto; padding-bottom: 8rem; }
  .mobile-app-nav, .market-mobile-nav { min-height: calc(4rem + env(safe-area-inset-bottom)); height: auto; padding-bottom: env(safe-area-inset-bottom); }
  .mobile-app-nav > button, .market-mobile-nav button { min-height: 4rem; font-size: .875rem; }
  .mobile-map-toggle { bottom: 5.5rem; max-width: calc(100% - 2rem); }
  .mobile-map-toggle button { min-height: var(--control-height); font-size: .875rem; min-width: 5.5rem; padding: .5rem; }
  .detail-panel { top: 1rem; padding-bottom: 6rem; }
  .map-legend { display: none; }
  .map-mode-banner { align-items: flex-start; flex-wrap: wrap; }
  .market-header .brand { font-size: 1.125rem; }
  .market-header-actions { margin-left: 0; gap: .25rem; }
  .market-detail { top: 1rem; bottom: 5rem; max-height: calc(100dvh - 6rem); padding: 1rem 1rem 6rem; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .modal-actions > .button { flex: 1 1 8rem; }
}
/* Mobile visual polish: theme-aware bottom bars, iOS no-zoom inputs (>=16px), and 44px touch targets. */
.market-mobile-nav, .admin-save-bar { background: var(--surface); border-color: var(--line); color: var(--ink); }
.market-mobile-nav button { color: var(--muted); }
.market-mobile-nav button.active { background: var(--soft); color: var(--brand-link); }
.mobile-app-nav > a { color: var(--sidebar-muted); min-height: 4rem; }
@media (max-width: 48rem) {
  :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea),
  .v4-page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea),
  .market-assistant textarea, .market-filters select, .market-job-chat-form > textarea,
  .map-saved-views :is(select, input), .map-workspace-share input {
    font-size: max(1rem, 16px);
  }
  .chat-composer textarea { font-size: max(1rem, 16px) !important; }
  :is(.field-toolbar, .field-gps-row, .chat-attachment-heading, .point-member-actions, .chat-composer-controls, .field-photo-actions, .detail-actions, .detail-heading) > .icon-button,
  .field-toolbar .icon-button {
    width: var(--control-height); height: var(--control-height);
    min-width: var(--control-height); min-height: var(--control-height);
    flex: 0 0 var(--control-height);
  }
}
@media (forced-colors: active) {
  :where(button, a, input, select, textarea, summary):focus-visible { outline-color: Highlight !important; }
  .button, .module-switcher > summary, .display-preferences > summary { border: 1px solid ButtonText; }
  .module-menu a[aria-current="page"] { border: 2px solid Highlight; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button:hover { transform: none; }
}
@media print {
  .module-nav, .quick-modules, .display-preferences, .voice-launch, .demo-ribbon, .site-header { display: none !important; }
  body, main { background: #fff !important; color: #000 !important; }
}
