/* Jarvis — base UI. White surfaces, compact records, consistent controls. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --sidebar: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --line: #dbe2ea;
  --line-soft: #e8edf3;
  --text: #172338;
  --muted: #526176;
  --muted-2: #64748b;
  --cyan: #2563eb;
  --cyan-soft: #eff6ff;
  --amber: #a15c07;
  --rose: #be3449;
  --violet: #7153b0;
  --green: #15754f;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--bg); }
body { color: var(--text); }
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #93c5fd; outline-offset: 3px;
}
a { color: #1d4ed8; text-underline-offset: 3px; }
button, a { touch-action: manipulation; }
[hidden] { display: none !important; }
.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; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-150%); border: 1px solid #bfd4f4; border-radius: 6px; padding: 10px 14px; color: #1d4ed8; background: #fff; font-size: 12px; }
.skip-link:focus { transform: translateY(0); }
h1, h2, h3, p { overflow-wrap: break-word; }
button, input, select, section, aside, article { min-width: 0; }
.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; z-index: 30; display: flex; flex-direction: column; height: 100vh; border-right: 1px solid var(--line-soft); padding: 20px 12px 14px; background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; min-height: 32px; font-size: 20px; font-weight: 750; letter-spacing: -.04em; }
.brand-mark { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 7px; color: #fff; background: #2563eb; font-size: 18px; font-weight: 650; letter-spacing: -.06em; }
.brand-caption { display: block; margin-top: 1px; color: #64748b; font-size: 9px; font-weight: 400; letter-spacing: 0; }
.brand small { display: inline-block; margin-left: 3px; color: var(--muted-2); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.workspace { display: flex; align-items: center; gap: 8px; margin: 20px 4px 17px; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; color: var(--muted); background: #fff; font-size: 12px; }
.workspace-avatar, .topbar-avatar { display: grid; flex: 0 0 29px; width: 29px; height: 29px; place-items: center; border: 1px solid #dce4ed; border-radius: 6px; color: #526176; background: #f1f5f9; font-size: 10px; font-weight: 650; }
.workspace strong { display: block; color: #475569; font-size: 10px; font-weight: 600; line-height: 1.4; }
.workspace small { display: block; margin-top: 2px; color: #64748b; font-size: 9px; }
.topbar-avatar { border-radius: 50%; }
.dot { display: inline-block; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: #27855f; }
.dot-small { width: 5px; height: 5px; margin-right: 6px; vertical-align: middle; }
.side-nav { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.nav-label { margin: 20px 10px 7px; color: var(--muted-2); font-size: 10px; font-weight: 650; letter-spacing: .075em; text-transform: uppercase; }
.nav-areas > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.nav-areas > summary::-webkit-details-marker { display: none; }
.nav-areas > summary > span { color: #94a3b8; font-size: 13px; }
.nav-areas:not([open]) > summary > span { transform: rotate(-90deg); }
.nav-areas > div { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; border: 1px solid transparent; border-radius: 6px; padding: 7px 10px; color: #526176; background: transparent; text-align: left; font-size: 12px; font-weight: 500; line-height: 1.35; }
.nav-item > span:first-child { display: inline-flex; justify-content: center; flex: 0 0 17px; width: 17px; color: #718096; font-size: 16px; line-height: 1; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { color: var(--text); background: #eef2f7; }
.nav-item.active { color: #1d4ed8; background: #eaf1fe; font-weight: 650; }
.nav-item.active > span:first-child { color: #2563eb; }
.studio-launch { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 12px; border: 1px solid #cbdce2; border-radius: 10px; background: #f1f8fa; color: #244752; text-decoration: none; font-size: 12px; font-weight: 600; }
.studio-launch > span:nth-child(2) { flex: 1; }
.studio-launch small { display: block; margin-top: 3px; font-weight: 400; font-size: 10px; color: #536e77; }
.studio-launch:hover { background: #e5f2f6; }
.studio-launch:focus-visible { outline: 3px solid #23869c; outline-offset: 3px; }
.side-footer { margin-top: auto; border-top: 1px solid var(--line-soft); padding: 14px 10px 0; color: var(--muted-2); font-size: 10px; line-height: 1.5; }
.side-footer p { margin: 0 0 5px; color: var(--muted); }
.sidebar-profile { display: flex; align-items: center; gap: 9px; margin-top: auto; border-top: 1px solid var(--line-soft); padding: 16px 8px 0; font-size: 11px; }
.sidebar-profile > span:first-child, .profile-avatar { display: grid; flex: 0 0 31px; height: 31px; width: 31px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: #435571; background: #eaf0f7; font-size: 10px; font-weight: 700; }
.sidebar-profile strong, .sidebar-profile small { display: block; }
.sidebar-profile strong { color: #334155; font-size: 11px; font-weight: 650; }
.sidebar-profile small { color: var(--muted-2); font-size: 10px; }
.main-content { min-width: 0; padding: 0 28px 56px; background: #fff; }
.app-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; margin: 0 -28px 28px; border-bottom: 1px solid var(--line-soft); padding: 0 28px; background: #fff; }
.topbar-location, .topbar-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-location { color: var(--muted-2); font-size: 12px; }
.breadcrumb-divider { color: #c4ccd8; }
#breadcrumb-current { color: #475569; font-weight: 500; }
.topbar-location strong { color: var(--text); font-weight: 550; }
.topbar-location > span[aria-hidden] { color: #bdc8d6; }
.topbar-actions { gap: 12px; }
.topbar-meta { color: var(--muted-2); font-size: 11px; white-space: nowrap; }
.sidebar-toggle { display: none; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 19px; }
.sidebar-backdrop { display: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { display: flex; align-items: center; gap: 6px; margin: 0 0 7px; color: var(--muted-2); font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow > span { width: 5px; height: 5px; border-radius: 50%; background: #7892af; }
h1 { margin: 0; color: #172338; font-size: 27px; font-weight: 650; letter-spacing: -.035em; line-height: 1.2; }
#page-subtitle { max-width: 760px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.select-wrap { display: flex; align-items: center; gap: 8px; color: #64748b; font-size: 11px; }
.select-wrap .select { width: auto; min-width: 125px; padding: 7px 10px; font-size: 11px; }
.head-actions > .select { width: auto; min-width: 180px; min-height: 34px; padding: 7px 10px; font-size: 11px; }
.head-actions { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 9px; flex-shrink: 0; }
.readonly { display: inline-flex; align-items: center; gap: 6px; color: #64748b; font-size: 11px; white-space: nowrap; }
.button-outline, .button-primary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 11px; color: #334155; background: #fff; font-size: 12px; font-weight: 550; text-decoration: none; line-height: 1.35; }
.button-outline:hover { color: #1d4ed8; border-color: #b8c9e1; background: #f8fafc; }
.button-primary { border-color: #2563eb; color: #fff; background: #2563eb; }
.button-primary:hover { border-color: #1d4ed8; color: #fff; background: #1d4ed8; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 26px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.metric { position: relative; border: 0; text-align: left; min-width: 0; min-height: 88px; padding: 16px 18px; background: #fff; }
.metric:hover { background: #fafcff; }
.metric-arrow { position: absolute; top: 15px; right: 15px; color: #9cacbf; font-size: 12px; opacity: 0; }
.metric:hover .metric-arrow, .metric:focus-visible .metric-arrow { opacity: 1; }
.metric + .metric { border-left: 1px solid var(--line-soft); }
.metric-label { display: block; color: #64748b; font-size: 11px; font-weight: 500; }
.metric-value { display: block; margin-top: 6px; color: #1f2c41; font-size: 27px; font-weight: 650; line-height: 1.2; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.metric-value.p0, .metric-value.blocked { color: #be3449; }
.metric-value.p1, .metric-value.assign { color: #a15c07; }
.metric-value.live { color: #2563eb; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.panel-pad { padding: 18px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line-soft); padding-bottom: 14px; }
.panel-title h2 { margin: 0; color: #25334a; font-size: 14px; font-weight: 650; letter-spacing: -.015em; }
.panel-title p { max-width: 760px; margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.panel-title .meta, .meta { color: var(--muted-2); font-size: 11px; white-space: nowrap; }
.overview-grid, .grid-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.filters, .segmented { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filters { margin: 14px 0; }
.filter { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 29px; border: 1px solid var(--line); border-radius: 5px; padding: 5px 9px; color: var(--muted); background: #fff; font-size: 11px; font-weight: 500; white-space: nowrap; line-height: 1.35; }
.filter:hover { border-color: #b7c9e0; background: #f8fafc; }
.filter.active { border-color: #c4d7ff; color: #1d4ed8; background: #eff6ff; font-weight: 600; }
.filter-label { margin: 0 3px 0 6px; color: var(--muted-2); font-size: 10px; font-weight: 550; }
.chip, .status, .scope-tag, .source-state { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; border: 1px solid transparent; border-radius: 4px; padding: 3px 6px; font-size: 10px; font-weight: 600; line-height: 1.35; white-space: nowrap; }
.chip { font-size: 10px; letter-spacing: .015em; }
.chip.P0 { color: #ae3146; background: #fff0f2; }
.chip.P1 { color: #92580c; background: #fff7e7; }
.chip.P2 { color: #245cca; background: #eff6ff; }
.chip.P3 { color: #64748b; background: #f1f5f9; }
.status { color: #526176; background: #f1f5f9; }
.status.in_corso, .status.operativo { color: #2162bd; background: #edf5ff; }
.status.in_attesa, .status.pipeline, .status.validazione { color: #92580c; background: #fff7e7; }
.status.bloccata { color: #ae3146; background: #fff0f2; }
.status.da_decidere, .status.legale_riservato { color: #7153b0; background: #f4f0fb; }
.status.archiviata, .status.archiviato { color: #526176; background: #f1f5f9; }
.scope-tag { border-color: #e2e8f0; color: #526176; background: #f8fafc; font-weight: 500; }
.table-wrap { position: relative; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.table { width: 100%; border-collapse: collapse; text-align: left; }
.table th { border-bottom: 1px solid var(--line); padding: 10px 12px; color: #64748b; background: #f8fafc; font-size: 10px; font-weight: 550; text-align: left; white-space: nowrap; }
.table td { border-bottom: 1px solid var(--line-soft); padding: 13px 12px; color: #475569; font-size: 12px; line-height: 1.5; vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.selectable { cursor: pointer; }
.table tr.selectable:hover td { background: #f8fbff; }
.table tr.selected td { background: #f0f6ff; }
.table tr.selected td:first-child { box-shadow: inset 2px 0 0 #2563eb; }
.table-primary { color: #25334a; font-weight: 600; }
.table-secondary { display: block; margin-top: 4px; color: #64748b; font-size: 11px; line-height: 1.45; }
.owner-cell { display: block; max-width: 185px; color: #526176; font-size: 11px; line-height: 1.4; }
.detail-panel { position: static; height: fit-content; }
.detail-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail-title h2 { margin: 3px 0 0; color: #25334a; font-size: 20px; font-weight: 650; letter-spacing: -.025em; line-height: 1.35; }
.detail-actions { display: grid; gap: 9px; margin: 17px 0 0; }
.detail-actions .button-primary { width: 100%; font-size: 11px; }
.detail-actions .text-button { justify-self: start; }
.detail-section { margin-top: 19px; }
.detail-label { margin: 0 0 6px; color: #64748b; font-size: 10px; font-weight: 650; letter-spacing: .055em; text-transform: uppercase; }
.detail-copy { margin: 0; color: #475569; font-size: 12px; line-height: 1.65; }
.responsibility { display: grid; gap: 7px; margin-top: 18px; border: 1px solid var(--line-soft); border-radius: 6px; padding: 12px; background: #f8fafc; }
.responsibility p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.responsibility b { color: #334155; font-weight: 600; }
.source-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.source { border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; color: #526176; background: #fff; font-size: 10px; overflow-wrap: anywhere; }
.mini-timeline { display: grid; gap: 0; margin: 15px 0 0 3px; }
.mini-event { position: relative; border-left: 1px solid var(--line); padding: 0 0 18px 15px; }
.mini-event:last-child { padding-bottom: 0; }
.mini-event::before { position: absolute; top: 5px; left: -3px; width: 5px; height: 5px; border-radius: 50%; background: #8ca4c1; content: ""; }
.event-date { color: var(--muted-2); font-size: 10px; }
.event-title { display: block; margin-top: 3px; color: #334155; font-size: 12px; font-weight: 600; }
.event-copy { display: block; margin-top: 4px; color: #64748b; font-size: 11px; line-height: 1.55; }
.task-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 15px 0; }
.task-kpi { border: 1px solid var(--line-soft); border-radius: 6px; padding: 10px 13px; background: #f8fafc; }
.task-kpi span { color: var(--muted-2); font-size: 11px; }
.task-kpi strong { display: block; margin-top: 3px; font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.task-kpi strong.in_corso { color: #2563eb; }
.task-kpi strong.bloccata { color: #be3449; }
.task-kpi strong.in_attesa { color: #a15c07; }
.task-kpi strong.da_decidere { color: #7153b0; }
.history-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.history-filters { display: grid; gap: 8px; align-content: start; }
.select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 9px; color: var(--text); background: #fff; font-size: 12px; }
.timeline { display: grid; gap: 0; margin: 20px 0 0 4px; }
.timeline-item { position: relative; border-left: 1px solid var(--line); padding: 0 0 25px 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { position: absolute; top: 4px; left: -4px; width: 7px; height: 7px; border: 1px solid #fff; border-radius: 50%; background: #7892af; content: ""; }
.timeline-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timeline-item h3 { margin: 7px 0 0; color: #334155; font-size: 13px; font-weight: 600; }
.timeline-item p { max-width: 850px; margin: 5px 0 0; color: #526176; font-size: 12px; line-height: 1.6; }
.timeline-source { display: block; margin-top: 7px; color: var(--muted-2); font-size: 10px; }
.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.source-card { border: 1px solid var(--line); border-radius: 6px; padding: 16px; background: #fff; }
.source-card h3 { margin: 0; font-size: 13px; font-weight: 600; }
.source-card p { margin: 6px 0 0; color: #526176; font-size: 12px; line-height: 1.55; }
.source-state { margin-top: 12px; color: #15754f; background: #edf8f1; }
.source-state.partial { color: #92580c; background: #fff7e7; }
.source-state.missing { color: #ae3146; background: #fff0f2; }
.backup-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.backup-step { border: 1px solid var(--line); border-radius: 7px; padding: 16px; background: #fff; }
.backup-step .number { color: #2563eb; font-size: 11px; font-weight: 650; }
.backup-step h3 { margin: 13px 0 0; font-size: 14px; font-weight: 600; }
.backup-step p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.note { margin-top: 16px; border-left: 2px solid #e6be73; padding: 1px 0 1px 11px; color: #64748b; font-size: 11px; line-height: 1.6; }
.backup-bottom { margin-top: 20px; }
.area-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.area-panel h2 { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: -.025em; }
.area-icon { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid #d8e4f5; border-radius: 8px; color: #2563eb; background: #eff6ff; font-size: 21px; }
.area-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.area-module { border: 1px solid var(--line-soft); border-radius: 6px; padding: 16px; background: #f8fafc; }
.area-module h3 { margin: 0; font-size: 13px; font-weight: 600; }
.area-module p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.area-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.area-status { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.area-status span { border: 1px solid var(--line-soft); border-radius: 5px; padding: 5px 8px; color: #64748b; background: #f8fafc; font-size: 11px; }
.area-status b { margin-right: 5px; color: #475569; font-weight: 600; }
.integration-card, .ha-status { margin-top: 18px; border: 1px solid #d9e4f4; border-radius: 7px; padding: 16px; background: #f8fbff; }
.integration-card h3, .ha-status h3 { margin: 4px 0 0; color: #334155; font-size: 14px; font-weight: 600; }
.integration-card p, .ha-status p { max-width: 800px; margin: 8px 0 0; color: #526176; font-size: 12px; line-height: 1.65; }
.integration-kicker { color: #64748b; font-size: 10px; font-weight: 650; letter-spacing: .065em; }
.integration-card > .button-outline { margin-top: 13px; }
.area-jump { min-height: 118px; border: 1px solid var(--line); border-radius: 7px; padding: 16px; color: inherit; background: #fff; text-align: left; }
.area-jump:hover { border-color: #b9cee9; background: #f8fbff; }
.area-jump span { color: #64748b; font-size: 10px; font-weight: 600; letter-spacing: .065em; }
.area-jump h3 { margin: 10px 0 0; font-size: 13px; font-weight: 600; }
.area-jump p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.related-projects { margin-top: 18px; }
.whatsapp-inbox { display: grid; gap: 8px; max-height: 430px; margin-top: 14px; overflow: auto; }
.whatsapp-message { border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: #fff; }
.whatsapp-message span { color: #64748b; font-size: 10px; }
.whatsapp-message p { margin: 6px 0 0; color: #334155; white-space: pre-wrap; overflow-wrap: anywhere; }
.help { color: var(--muted); font-size: 12px; line-height: 1.6; }
.loading, .error { border: 1px solid var(--line); border-radius: 7px; padding: 24px; color: #64748b; background: #f8fafc; }
.error { border-color: #f0d3d8; color: #a73248; background: #fff8f9; }
.empty-card, .empty-state { border: 1px dashed #d5dfe9; border-radius: 6px; padding: 20px; color: #64748b; background: #fafcfe; font-size: 12px; line-height: 1.6; }
.empty-state { text-align: center; padding: 38px 20px; }
.empty-state strong { display: block; color: #334155; font-size: 14px; font-weight: 600; }
.empty-state p { margin: 5px 0 0; }
.content-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 28px; border-top: 1px solid var(--line-soft); padding-top: 14px; color: #718096; font-size: 10px; }
@media (min-width: 1400px) {
  .project-list-return { display: none; }
  .grid-two, .projects-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .overview-grid { grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); }
  .detail-panel { position: sticky; top: 20px; }
}
@media (min-width: 1720px) {
  .grid-two, .projects-layout { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 206px minmax(0, 1fr); }
  .sidebar { padding-left: 9px; padding-right: 9px; }
  .main-content { padding-right: 22px; padding-left: 22px; }
  .app-topbar { margin-left: -22px; margin-right: -22px; padding-left: 22px; padding-right: 22px; }
  .metric { padding: 14px 12px; }
  .metric-label { font-size: 10px; }
  .backup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .area-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-layout { grid-template-columns: 190px minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; height: 100dvh; padding: 22px 12px 16px; transform: translateX(-100%); transition: transform .18s ease; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; width: 100%; height: 100%; border: 0; background: rgba(15, 23, 42, .25); }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 6px 0 30px rgba(15, 23, 42, .12); }
  body.nav-open .sidebar-backdrop { display: block; }
  .sidebar-toggle { display: inline-flex; flex-shrink: 0; }
  .main-content { padding: 0 20px 40px; }
  .app-topbar { height: 60px; margin: 0 -20px 22px; padding: 0 20px; }
  .topbar-meta { display: none; }
  .page-head { align-items: flex-start; gap: 16px; }
  .head-actions .readonly { display: none; }
  .evidence-grid { grid-template-columns: 1fr; }
  .history-layout { grid-template-columns: 1fr; }
  .history-filters { grid-template-columns: minmax(0, 1fr) minmax(200px, 1fr); align-items: center; }
  .history-filters .note { grid-column: 1 / -1; margin: 0; }
}
@media (max-width: 580px) {
  .main-content { padding: 0 16px 36px; }
  .app-topbar { margin: 0 -16px 22px; padding: 0 16px; gap: 10px; }
  .topbar-location { gap: 9px; font-size: 11px; }
  .breadcrumb-root, .breadcrumb-divider { display: none; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .readonly { display: none; }
  .page-head { flex-direction: column; gap: 12px; margin-bottom: 18px; }
  h1 { font-size: 25px; }
  #page-subtitle { font-size: 12px; }
  .head-actions { justify-content: flex-start; flex-wrap: wrap; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
  .metric { min-height: 78px; padding: 13px 16px; }
  .metric:nth-child(odd) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .metric:last-child { grid-column: 1 / -1; }
  .metric-value { font-size: 24px; }
  .panel-pad { padding: 15px; }
  .panel-title { align-items: flex-start; gap: 10px; }
  .panel-title p { font-size: 11px; }
  .panel-title .meta { font-size: 10px; }
  .table { min-width: 600px; }
  .table th, .table td { padding-left: 10px; padding-right: 10px; }
  .task-summary, .area-grid, .area-summary, .backup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .area-grid, .area-summary { grid-template-columns: 1fr; }
  .history-filters { display: flex; flex-direction: column; align-items: stretch; }
  .backup-step { padding: 13px; }
  .area-status { display: grid; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* Four primary blocks: personal, work, home and properties. */
.four-block-nav { gap: 7px; }
.four-block-nav .nav-block { border-bottom: 1px solid #e8edf3; padding-bottom: 7px; }
.four-block-nav .nav-block:last-child { border-bottom: 0; }
.four-block-nav .nav-block-title { min-height: 44px; font-size: 13px; font-weight: 650; }
.four-block-nav .current-block > .nav-block-title { color: #1d4ed8; background: #eaf1fe; }
.four-block-nav .nav-block-children { margin: 5px 0 2px 17px; border-left: 1px solid #dbe2ea; padding-left: 9px; }
.four-block-nav .nav-block-children .nav-item { min-height: 34px; padding: 7px 8px; font-size: 11px; }
.four-block-nav .folder-navigation { margin: 0; border: 0; padding: 0; }
.four-block-nav .folder-nav-item { min-height: 34px; font-size: 11px; }
.four-block-nav .nav-advanced { margin-top: 7px; }
.four-block-nav .nav-advanced > summary { margin: 7px 8px; font-size: 9px; letter-spacing: .025em; }
.nav-section-caption { margin: 10px 8px 4px; color: #64748b; font-size: 10px; }
.company-navigation { display: grid; margin-bottom: 9px; border-bottom: 1px solid #e2e8f0; padding-bottom: 9px; }
.company-nav-item { width: 100%; min-height: 32px; border: 0; border-radius: 5px; padding: 6px 8px; text-align: left; background: transparent; color: #526176; font-size: 11px; }
.company-nav-item:hover { background: #eef2f7; }
.company-nav-item.active { color: #1d4ed8; background: #eaf1fe; font-weight: 650; }
.property-workspace { max-width: 1200px; }
.property-archive-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 24px 0 18px; }
.property-archive-heading h2 { margin: 4px 0 6px; font-size: 22px; font-weight: 650; letter-spacing: -.025em; }
.property-archive-heading p { margin: 0; color: #64748b; }
.property-archive-heading .button-outline { flex-shrink: 0; }
.archive-progress { display: flex; align-items: flex-start; gap: 11px; border: 1px solid #f1dfbc; border-radius: 7px; padding: 12px 15px; background: #fffcf5; }
.archive-progress-dot { width: 7px; height: 7px; flex: 0 0 7px; margin-top: 6px; border-radius: 50%; background: #b87b1a; }
.archive-progress strong { color: #805816; font-size: 12px; font-weight: 600; }
.archive-progress p { margin: 3px 0 0; color: #786849; font-size: 12px; }
.property-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 22px 0 14px; }
.property-toolbar label { display: flex; align-items: center; gap: 10px; color: #526176; font-size: 12px; }
.property-toolbar .select { width: 240px; min-height: 35px; padding: 7px 10px; }
.property-toolbar > span { color: #64748b; font-size: 11px; }
.property-company-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; align-items: start; }
.company-card { padding: 20px; }
.company-card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.company-monogram { display: grid; flex: 0 0 42px; height: 42px; place-items: center; border: 1px solid #dce7f6; border-radius: 8px; background: #f3f7fc; color: #526e96; font-size: 12px; font-weight: 650; }
.company-card h3 { margin: 0 0 3px; color: #25334a; font-size: 16px; font-weight: 600; }
.company-card-heading div > span { color: #64748b; font-size: 11px; }
.company-archive-note { margin: -3px 0 14px; color: #64748b; font-size: 11px; }
.company-archive-link { width: 100%; justify-content: space-between; padding: 10px 12px; }
.company-folders { margin-top: 13px; }
.company-folders > summary { display: flex; align-items: center; justify-content: space-between; min-height: 32px; gap: 12px; cursor: pointer; list-style: none; color: #526176; font-size: 12px; }
.company-folders > summary::-webkit-details-marker { display: none; }
.company-folders > summary::before { content: '›'; font-size: 17px; color: #94a3b8; }
.company-folders[open] > summary::before { transform: rotate(90deg); }
.company-folders > summary span:first-child { flex: 1; }
.company-folders > summary span:last-child { border-radius: 4px; padding: 1px 6px; background: #f1f5f9; font-size: 10px; }
.company-folders ul { list-style: none; margin: 8px 0 0; border-top: 1px solid #e8edf3; padding: 6px 0 0; }
.company-folders a { display: flex; justify-content: space-between; gap: 12px; border-radius: 4px; padding: 8px 7px; font-size: 12px; text-decoration: none; color: #526176; }
.company-folders a:hover { background: #f1f6ff; color: #1d4ed8; }
.company-folders a span { color: #94a3b8; }
.property-shared-archive { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 14px 0 24px; color: #64748b; font-size: 11px; }
.property-shared-archive a { color: #526176; }
.property-accounting { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-color: #cfdef3; padding: 23px; background: #f9fbff; }
.property-accounting h2 { margin: 3px 0 6px; font-size: 20px; font-weight: 650; letter-spacing: -.025em; }
.property-accounting p { margin: 0; color: #526176; }
.property-accounting-status { display: block; margin-top: 10px; color: #64748b; font-size: 11px; }
.property-accounting .button-primary { flex-shrink: 0; }
.property-assets { margin-top: 18px; }
.property-assets > summary { padding: 15px 20px; cursor: pointer; color: #526176; font-size: 13px; }
.property-source-note { margin: 15px 0 0; color: #64748b; font-size: 11px; }
body[data-block="properties"] .content-footer, body[data-block="properties"] .side-footer { display: none; }
@media (max-width: 720px) {
  .property-archive-heading, .property-accounting { align-items: flex-start; flex-direction: column; gap: 16px; }
  .property-company-grid { grid-template-columns: minmax(0,1fr); }
  .property-toolbar { flex-wrap: wrap; gap: 9px; }
  .property-toolbar label { min-width: 0; width: 100%; }
  .property-toolbar .select { flex: 1; width: 100%; min-width: 0; }
  .company-card { padding: 17px; }
  .property-accounting { padding: 20px; }
}
