/* TW light. Explicit component classes: no structural guesses about runtime wrappers. */
:root{color-scheme:light;--ink:#131722;--muted:#646977;--line:#e0e3eb;--blue:#2962ff;--hover:#f0f3fa;--label-width:188px;--surface:#fff;--surface-muted:#f8f9fd;--selected:#f8faff;--selected-hover:#edf2ff;--accent-soft:#e3ebfd;--accent-border:#d3dffc;--blue-hover:#1e53e5;--ui-font:-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif}
html,body,.app-shell{background:var(--surface)!important;color:var(--ink)!important;font-family:var(--ui-font)!important}
.app-shell{font-size:12px;line-height:1.4}
.app-shell button,.app-shell input,.app-shell select{font-family:inherit!important;box-sizing:border-box}
.app-shell input::placeholder{color:var(--muted);opacity:1}
.app-shell button{transition:background-color .12s,border-color .12s}
button:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--blue)!important;outline-offset:-2px}
.app-shell button:disabled{opacity:.5;cursor:default}
/* Toolbar */
.app-header{padding:8px 16px!important;gap:8px 14px!important;grid-template-columns:auto minmax(180px,1fr) auto auto 36px!important;border-bottom:1px solid var(--line)!important}
.header-brand{gap:9px!important}.header-brand>div{border-radius:6px!important;background:var(--blue)!important;width:28px!important;height:28px!important;flex:none}
.header-brand>p:first-of-type{font-family:inherit!important;font-size:18px!important;letter-spacing:-.5px;color:var(--ink)!important}
.header-brand>p:last-child{font-size:12px!important;color:var(--muted)!important;border-color:var(--line)!important}
.header-assistant{border-radius:6px!important;background:var(--surface-muted)!important;border:1px solid var(--line)!important;height:44px!important;max-width:520px!important;padding:0 3px 0 12px!important}
.header-assistant:focus-within{border-color:var(--blue)!important}
.header-assistant input{font-size:13px!important}.header-assistant button{background:transparent!important;width:36px!important;flex:none;border-radius:4px!important}
.header-assistant button:hover{background:var(--accent-soft)!important}.header-assistant button svg{stroke:var(--blue)!important}
.header-scale{background:transparent!important;border-radius:0!important;border-left:1px solid var(--line);padding:0 0 0 10px!important;gap:2px!important}
.header-scale button{border-radius:4px!important;font-size:12px!important;font-weight:600!important;min-height:44px!important}
.header-scale button[aria-pressed=true]{background:var(--accent-soft)!important;color:var(--blue)!important}
.header-scale button[aria-pressed=false]{background:transparent!important;color:var(--ink)!important}
.header-scale button:hover{background:var(--hover)!important}
.header-actions>button{background:var(--blue)!important;border-radius:6px!important;font-size:13px!important;min-height:44px!important}
.header-actions>button:hover{background:var(--blue-hover)!important}
.header-avatar{border-radius:50%!important;background:#f0f3fa!important;color:var(--ink)!important}
.header-actions [role=menu]{width:280px!important;max-width:calc(100vw - 24px);max-height:calc(100dvh - 80px);overflow:auto;border-radius:8px!important;box-shadow:0 8px 24px #13172220!important}
.header-actions [role=menuitem]{font-size:13px!important;min-height:44px!important;border-radius:4px!important}
.header-actions [role=menuitem]:hover{background:var(--hover)!important}
/* Timeline */
.app-workspace{grid-template-columns:minmax(0,1fr) clamp(280px,26vw,360px)!important}
.map-main,.map-panel{background:var(--surface)!important;min-width:0}
.time-axis{background:var(--surface)!important;border-color:var(--line)!important;min-height:48px}
.time-range,.layer-drag-handle{flex:0 0 var(--label-width)!important;width:var(--label-width);box-sizing:border-box;border-right:1px solid var(--line)!important}
.time-range{padding:8px 12px!important;display:flex;align-items:center}
.time-range p{font-family:inherit!important;font-size:11px!important;font-weight:400!important;line-height:1.45;color:var(--muted)!important}
.time-plot{height:48px!important;min-width:0}
.time-tick{top:27px!important;margin-left:4px!important;font-size:11px!important;font-weight:400!important;color:var(--muted)!important;line-height:16px;white-space:nowrap}
.today-label{top:3px!important;font-size:10px!important;line-height:16px;border-radius:3px!important;background:var(--ink)!important;color:white!important}
.selection-bar{gap:8px!important;padding:6px 12px!important;align-items:center!important}
.selection-bar>span{display:none}.selection-bar p{font-size:12px!important;min-width:0;overflow-wrap:anywhere}.selection-bar button{flex:none;font-size:11px!important;min-height:36px!important;border-radius:4px!important}
.map-panel [data-layer-id]{border-bottom:1px solid var(--line)!important}
.layer-drag-handle{background:var(--surface)!important;padding:8px 10px 8px 24px!important;gap:4px!important;overflow:hidden}
.layer-drag-handle:hover{background:var(--surface-muted)!important}.layer-drag-handle::before{color:#8b92a0!important;font-size:13px!important}
.layer-drag-handle p:first-child{font-size:12px!important;font-weight:600!important;color:var(--ink)!important;line-height:1.3}
.layer-drag-handle p:last-child{font-size:11px!important;color:var(--muted)!important;line-height:1.4}
.layer-drag-handle p:first-child>span[style*="width: 10px"]{width:7px!important;height:7px!important;border-radius:50%!important}
.event-block{border-radius:3px!important;font-size:11px!important;font-weight:500!important;line-height:20px!important}
.event-block:hover{filter:brightness(.85)}
.lane-plot>p{border-radius:2px!important;font-size:11px!important;font-variant-numeric:tabular-nums;line-height:14px}
/* Sidebar: uniform 16px inset for section titles, group titles and rows. */
.layers-panel{padding:0!important;gap:0!important;border-color:var(--line)!important;background:var(--surface)!important;font-size:12px}
.sidebar-problem{background:var(--surface)!important;border-radius:0!important;padding:16px!important;border-bottom:1px solid var(--line);gap:8px!important}
.sidebar-problem>label{font-size:11px!important;letter-spacing:.06em!important;color:var(--muted)!important}
#problem{border-radius:4px!important;font-size:12px!important;font-weight:600!important;border-color:var(--line)!important}
.sidebar-problem button{border-radius:4px!important;border-color:var(--line)!important}.sidebar-problem button:hover{background:var(--hover)!important}
.sidebar-title{padding:16px 16px 8px!important}.sidebar-title h2{font-family:inherit!important;font-size:14px!important;font-weight:600!important;line-height:1.4}
.sidebar-search{padding:0 16px 16px!important;font-size:11px!important;color:var(--muted)!important;gap:6px!important}
.sidebar-search input{width:100%;min-height:40px!important;background:var(--surface-muted)!important;border:1px solid var(--line)!important;border-radius:4px!important;font-size:12px!important}
.sidebar-section{padding:12px 0!important;gap:0!important;border-top:1px solid var(--line)}
.section-heading{padding:0 16px 10px!important;gap:8px!important;align-items:center!important}
.section-heading h3{font-family:inherit!important;font-size:11px!important;letter-spacing:.05em;color:var(--muted)!important;line-height:1.4}
.section-heading p{font-size:11px!important;color:var(--muted)!important;text-align:right;line-height:1.4}
.source-group{gap:0!important;padding:0 0 8px}
.source-heading{box-sizing:border-box;display:block;margin:0;padding:12px 16px 6px;font-family:inherit;font-size:11px;line-height:16px;font-weight:600;color:var(--muted);border:0}
.layer-option{display:grid!important;grid-template-columns:16px minmax(0,1fr) auto;align-items:center!important;column-gap:10px!important;row-gap:2px;border:0!important;border-radius:0!important;background:var(--surface)!important;padding:8px 16px!important;width:100%;min-height:44px!important;font-size:12px!important;text-align:left;box-shadow:inset 2px 0 transparent}
.layer-option:hover{background:var(--hover)!important}
.layer-option[aria-pressed=true]{background:var(--selected)!important;box-shadow:inset 2px 0 var(--accent-border)}
.layer-option[aria-pressed=true]:hover{background:var(--selected-hover)!important}
.layer-swatch{width:14px!important;height:14px!important;border-radius:3px!important;border-width:1px!important;flex:none}
.layer-copy{min-width:0;gap:2px}
.tw-layer-name{min-width:0;font-size:12px!important;line-height:1.4;color:var(--ink)!important;overflow-wrap:anywhere}
.tw-layer-description{font-size:11px!important;line-height:1.4;color:var(--muted)!important;overflow-wrap:anywhere}
.tw-layer-count{font-size:11px!important;line-height:1.4;color:var(--muted)!important;font-variant-numeric:tabular-nums;min-width:14px;text-align:right}
.tw-layer-value{font-size:12px!important;line-height:1.4;font-weight:600!important;color:var(--ink)!important;font-variant-numeric:tabular-nums;text-align:right;max-width:112px;overflow-wrap:normal}
/* Dialogs, forms and menus share the same type scale. */
.modal-overlay{padding:24px 16px!important;align-items:center!important}
.app-shell [role=dialog]{border-radius:var(--nk-radius-dialog)!important;box-shadow:var(--nk-dialog-shadow)!important;background:var(--surface)!important;font-family:var(--ui-font)!important;font-size:13px;max-height:calc(100dvh - 48px)!important;gap:var(--nk-dialog-gap)!important;padding:var(--nk-dialog-padding)!important}
.app-shell [role=dialog][aria-modal=true]{width:var(--nk-dialog-width)!important}
.app-shell [role=dialog] h2{font-family:inherit!important;font-size:var(--nk-title)!important;line-height:var(--nk-leading-title);color:var(--ink)!important}
.app-shell [role=dialog] p{font-size:13px!important;line-height:1.5}
.app-shell [role=dialog] label{font-size:12px!important;min-width:0}
.app-shell [role=dialog] button{border-radius:var(--nk-radius-control)!important;font-size:var(--nk-text-sm)!important;min-height:var(--nk-control)!important}
.app-shell [role=dialog] input,.app-shell [role=dialog] select{border-radius:4px!important;font-size:13px!important;min-width:0;max-width:100%;min-height:44px!important}
.app-shell [role=dialog] input:focus-visible,.app-shell [role=dialog] select:focus-visible{outline-offset:1px}
.app-shell [role=dialog] button:hover{filter:brightness(.97)}
.app-shell [role=dialog] .comparison-grid{border-radius:4px!important;font-size:12px!important;overflow:hidden}
.app-shell [role=dialog] .comparison-grid p{padding:8px!important;font-size:12px!important;min-width:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.import-row{display:grid!important;grid-template-columns:18px minmax(0,1fr) auto;gap:6px 10px!important;align-items:center!important}
.import-row>span:last-child{grid-column:2/-1;width:auto!important;font-size:11px!important;line-height:1.4}
.import-row>span{min-width:0;font-size:12px!important}
@media(max-width:1200px){.header-brand>p:last-child{display:none!important}}
@media(max-width:1000px) and (min-width:701px){.app-header{grid-template-columns:auto minmax(0,1fr) auto 36px!important}.header-brand{grid-column:1;grid-row:1}.header-assistant{grid-column:2;grid-row:1}.header-actions{grid-column:3;grid-row:1}.header-avatar{grid-column:4;grid-row:1}.header-scale{grid-column:1/-1;grid-row:2;justify-self:start;border:0!important;padding:0!important}}
@media(max-width:700px){
 :root{--label-width:128px}
 .app-header{grid-template-columns:minmax(0,1fr) auto 32px!important;padding:6px 10px!important;gap:6px 8px!important}
 .header-brand{grid-column:1;grid-row:1;gap:6px!important}.header-brand>p:first-of-type{font-size:16px!important}.header-brand>div{width:24px!important;height:24px!important}
 .header-actions{grid-column:2;grid-row:1}.header-actions>button{padding:0 10px!important;font-size:12px!important}
 .header-avatar{grid-column:3;grid-row:1;width:32px!important;height:32px!important}
 .header-assistant{grid-column:1/-1;grid-row:2;max-width:none!important;width:100%}
 .header-scale{grid-column:1/-1;grid-row:3;justify-self:stretch;border:0!important;padding:0!important;justify-content:space-between}
 .header-scale button{flex:1}.header-actions [role=menu]{position:fixed!important;top:56px!important;right:10px!important;max-height:calc(100dvh - 70px)}
 .app-workspace{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr) minmax(0,.7fr)!important}
 .layers-panel{border-top:1px solid var(--line)!important}
 .layer-drag-handle{padding:6px 6px 6px 20px!important}.layer-drag-handle p:first-child{font-size:11px!important}.layer-drag-handle p:last-child{font-size:10px!important}
 .time-range{padding:6px 8px!important}.time-range p{font-size:10px!important}.time-tick{font-size:10px!important}
 .selection-bar{flex-wrap:wrap}.selection-bar p{flex-basis:60%!important}.selection-bar button{margin-left:auto}
 .modal-overlay{padding:10px!important}.app-shell [role=dialog]{padding:16px!important;max-height:calc(100dvh - 20px)!important;gap:10px!important}.app-shell [role=dialog] h2{font-size:18px!important}
 .app-shell [role=dialog] .comparison-grid{grid-template-columns:minmax(0,1.7fr) repeat(3,minmax(0,1fr))!important}
 .app-shell [role=dialog] .comparison-grid p{padding:6px 4px!important;font-size:11px!important}
 .date-fields{grid-template-columns:1fr!important}
 .app-shell [role=dialog]:not([aria-modal=true]){top:108px!important;max-height:calc(100dvh - 128px)!important}
}
@media(prefers-reduced-motion:reduce){.app-shell button{transition:none}}

.layers-column{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:var(--surface)}
.layers-column>.layers-panel{flex:1 1 0!important;min-height:0}
.layer-bulk-actions{display:flex;flex:0 0 auto;gap:8px;padding:10px 16px;padding-bottom:max(10px,env(safe-area-inset-bottom));border-top:1px solid var(--line);border-left:1px solid var(--line);background:var(--surface)}
.layer-bulk-actions button,.map-empty button{min-height:44px;padding:6px 12px;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--blue);font-size:12px;font-weight:500;cursor:pointer}
.layer-bulk-actions button{flex:1}
.layer-bulk-actions button:hover:not(:disabled),.map-empty button:hover{background:var(--hover)}
.layer-bulk-actions button:disabled{opacity:1;color:var(--muted);background:var(--surface-muted);cursor:default}
.map-empty{padding:40px 24px;text-align:center;color:var(--muted)}
.map-empty p{margin:0 0 12px;font-size:13px}.map-empty p:first-child{color:var(--ink);font-weight:600;font-size:15px}

/* Center the assistant on the header itself on desktop. */
.header-assistant{justify-self:center}
@media(min-width:1201px){
 .app-header{grid-template-columns:minmax(0,1fr) auto auto 36px!important}
 .header-assistant{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(520px,calc(100% - 840px))!important}
}

.event-block{white-space:nowrap!important;text-indent:0!important;padding:0 8px!important;line-height:26px!important;background:transparent!important;border:0!important}

.catalog-open{margin:16px 16px 12px;min-height:44px;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--blue);font-size:12px;cursor:pointer}
.catalog-open:hover{background:var(--hover)}
.app-shell .catalog-modal[role=dialog][aria-modal=true]{width:900px!important;overflow:hidden;display:flex}
.catalog-intro,.catalog-count{margin:0;color:var(--muted)}
.catalog-search{display:flex;flex-direction:column;gap:6px;color:var(--muted)}
.catalog-search input{padding:10px 12px;border:1px solid var(--line);background:var(--surface-muted);width:100%}
.catalog-filters{display:flex;gap:6px;flex-wrap:wrap}
.catalog-filters button,.catalog-footer button{padding:8px 12px;border:1px solid var(--line);background:var(--surface);color:var(--ink);cursor:pointer}
.catalog-filters button[aria-pressed=true]{color:var(--blue);border-color:var(--blue);background:var(--accent-soft)}
.app-shell [role=dialog]>.catalog-list{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}
.catalog-group h3{font-size:13px;margin:8px 0 10px;color:var(--ink)}
.catalog-group+ .catalog-group{margin-top:20px}
.catalog-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.catalog-item{display:flex;gap:10px;align-items:flex-start;padding:12px;text-align:left;border:1px solid var(--line);background:var(--surface);cursor:pointer;min-width:0}
.catalog-item[aria-pressed=true]{border-color:var(--blue);background:var(--selected)}
.catalog-check{width:18px;height:18px;flex:0 0 18px;border:1px solid var(--line);border-radius:3px;text-align:center;line-height:18px}
.catalog-item[aria-pressed=true] .catalog-check{background:var(--blue);border-color:var(--blue);color:#fff}
.catalog-copy{display:flex;flex-direction:column;gap:4px;min-width:0}.catalog-copy strong{font-size:13px;font-weight:600;color:var(--ink)}.catalog-copy span,.catalog-copy small{font-size:11px;color:var(--muted);line-height:1.5}
.catalog-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--line);padding-top:12px;font-size:12px;color:var(--muted)}
.catalog-footer>div{display:flex;gap:8px}.catalog-footer .catalog-save{background:var(--blue);color:#fff;border-color:var(--blue)}
.empty-metric{position:absolute;top:50%;left:12px;right:12px;margin:0;transform:translateY(-50%);font-size:12px;color:var(--muted)}
@media(max-width:700px){.catalog-grid{grid-template-columns:1fr}.catalog-footer{flex-wrap:wrap}.catalog-footer>div{width:100%}.catalog-footer button{flex:1}.catalog-filters{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px}.catalog-filters button{flex:none}}

.record-open{align-self:flex-start;max-width:100%;margin-top:0;padding:4px 0;border:0;background:transparent;color:var(--blue);font-size:11px;line-height:16px;text-align:left;cursor:pointer}
.record-open:hover{text-decoration:underline}
.record-form{display:flex;flex-direction:column;gap:12px}.record-form label{display:flex;flex-direction:column;gap:6px;color:var(--ink)}
.record-form input,.record-form textarea{padding:10px 12px;border:1px solid var(--line);border-radius:4px;background:var(--surface);font:inherit;color:var(--ink);box-sizing:border-box;width:100%}
.record-form textarea{resize:vertical;min-height:80px;max-height:180px}.record-hint{margin:0;color:var(--muted)}
.record-score{display:flex;flex-wrap:wrap;gap:6px}.record-score button{min-width:40px;border:1px solid var(--line);background:var(--surface);color:var(--ink);cursor:pointer}
.record-score button[aria-pressed=true]{background:var(--accent-soft);border-color:var(--blue);color:var(--blue)}
.record-error{margin:0;color:#b42318}.record-footer{display:flex;justify-content:flex-end;gap:8px}
.record-footer button{padding:10px 16px;border:1px solid var(--line);background:var(--surface);cursor:pointer}.record-footer .record-save{background:var(--blue);border-color:var(--blue);color:#fff}

/* Custom metric editor and non-numeric observations. */
.custom-metric-open{align-self:flex-start;min-height:44px;padding:8px 16px;border:1px solid var(--blue);background:var(--surface);border-radius:6px;color:var(--blue);font:inherit;cursor:pointer}
.record-form select{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--ink);font:inherit;min-height:44px}
.custom-scale{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.custom-scale label{min-width:0}
.verbal-point{position:absolute;top:40%;min-width:8px;min-height:24px;padding:3px 5px;border:1px solid #6370AD;border-radius:4px;background:#F0F2FA;color:#394578;font:12px var(--ui-font,Arial);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}

.scenario-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.scenario-grid button{display:flex;flex-direction:column;gap:4px;min-height:70px;text-align:left;padding:10px 12px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}.scenario-grid button span{color:var(--muted);font-size:12px;line-height:1.4}.scenario-grid button[aria-pressed=true],.day-entries button[aria-pressed=true]{border-color:var(--blue);background:#F0F4FF}.custom-scale-labels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.custom-preview{padding:12px;background:#F4F6FB;border:1px solid var(--line);border-radius:6px}.custom-preview p{margin:6px 0}.custom-preview small{color:var(--muted)}.day-summary{margin:0;padding:10px;background:#F4F6FB;border-radius:6px;overflow-wrap:anywhere}.day-entries{display:flex;flex-direction:column;gap:6px;max-height:160px;overflow:auto}.day-entries button{display:flex;flex-direction:column;gap:4px;text-align:left;flex-shrink:0;border:1px solid var(--line);border-radius:4px;background:var(--surface);padding:10px;font:inherit;color:var(--ink);cursor:pointer;overflow-wrap:anywhere}.day-entries span{color:var(--muted)}
@media(max-width:560px){.scenario-grid,.custom-scale-labels{grid-template-columns:1fr}}
.app-shell [role=dialog]>.record-form{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 3px 2px;flex:1 1 auto}.record-form>*{flex-shrink:0}.record-form .record-footer{position:sticky;bottom:0;background:var(--surface);padding:12px 0 2px;border-top:1px solid var(--line);z-index:1}

.sidebar-tabs{display:flex;gap:0;padding:0 16px;border-bottom:1px solid var(--line);background:var(--surface);position:sticky;top:0;z-index:2}.sidebar-tabs button{flex:1;min-height:46px;border:0;border-bottom:2px solid transparent;background:transparent;color:var(--muted);font:600 13px var(--ui-font,Arial);cursor:pointer}.sidebar-tabs button[aria-selected=true]{color:var(--blue);border-bottom-color:var(--blue)}.layers-tab-content{display:flex;flex-direction:column;gap:16px}.insights-panel{padding:16px;display:flex;flex-direction:column;gap:14px;font-size:13px;line-height:1.55;overflow-wrap:anywhere}.insights-panel p{margin:6px 0}.insights-panel h3{font-size:14px;line-height:1.4;margin:8px 0;font-weight:600}.insights-panel h4{font-size:13px;line-height:1.4;margin:10px 0 4px;font-weight:600}.insight-card{border:1px solid var(--line);border-radius:6px;padding:12px;background:var(--surface)}.insight-source{font-size:12px;color:var(--muted)}.insight-caption{font-size:12px;color:var(--muted)}.insight-tag{font-size:11px;font-weight:600;color:var(--blue);background:#F0F4FF;padding:3px 6px;border-radius:3px}.insight-tag.hypothesis{color:#75501F;background:#FFF5E6;display:inline-block}.insight-card article+article{border-top:1px solid var(--line);margin-top:12px;padding-top:4px}.insight-card button{min-height:40px;padding:7px 10px;border:1px solid var(--line);background:var(--surface);color:var(--blue);border-radius:4px;font:inherit;cursor:pointer;text-align:left}

.demo-home{display:inline-flex;align-items:center;min-height:44px;white-space:nowrap;margin-left:4px;padding:0 8px;border-left:1px solid var(--line);font-size:12px;color:var(--muted);text-decoration:none}.demo-home:hover{color:var(--blue);text-decoration:underline}

.app-shell [role=dialog]:not(.catalog-modal){overflow-y:auto;overscroll-behavior:contain}
@media(max-width:700px){
 .app-shell [role=dialog] input,.app-shell [role=dialog] select,.app-shell [role=dialog] textarea,.sidebar-search input{font-size:16px!important}
 .record-footer{flex-wrap:wrap}.record-footer button{flex:1 1 120px}
 .header-brand .demo-home{font-size:0;padding:0 6px;margin-left:0}.header-brand .demo-home::before{content:'←';font-size:16px}
}
@media(pointer:coarse){.app-shell [role=dialog] button{min-height:44px!important}.record-open{min-height:44px}.header-assistant a{min-height:44px}}

/* Account controls stay subordinate to the health map. Native details is the disclosure. */
.app-header{display:flex!important;flex-wrap:nowrap!important;gap:8px 14px!important}
.header-brand{margin-right:auto;flex:none}
.header-context{display:flex;align-items:center;gap:10px;min-width:0;margin-right:auto}
.header-context:empty{display:none}
.map-context-label{font-size:12px;color:var(--muted);white-space:nowrap}
.map-notes-link{display:inline-flex;align-items:center;gap:5px;min-height:36px;font-size:12px;color:var(--muted);text-decoration:none;white-space:nowrap}
.map-notes-link:hover{color:var(--blue)}
.header-scale,.header-actions,.header-account{flex:none}
.header-account{position:relative;min-width:0;font-size:13px}
.header-account>summary{list-style:none;display:flex;align-items:center;gap:8px;min-height:40px;padding:2px 5px;border-radius:6px;cursor:pointer;color:var(--ink);box-sizing:border-box}
.header-account>summary::-webkit-details-marker{display:none}
.header-account>summary:hover,.header-account[open]>summary{background:var(--hover)}
.header-account>summary:focus-visible,.account-dropdown a:focus-visible,.account-dropdown button:focus-visible,.map-notes-link:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.account-avatar{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex:none;border-radius:50%;background:var(--accent-soft);color:var(--blue);font-size:13px;font-weight:600}
.account-trigger-name{max-width:136px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:12px;font-weight:500}
.account-chevron{flex:none;color:var(--muted)}
.header-account[open] .account-chevron{transform:rotate(180deg)}
.account-dropdown{position:absolute;z-index:18;right:0;top:calc(100% + 8px);width:248px;max-width:calc(100vw - 24px);box-sizing:border-box;padding:6px;border:1px solid var(--line);border-radius:8px;background:var(--surface);box-shadow:0 8px 24px #13172220;max-height:calc(100dvh - 80px);overflow:auto;overscroll-behavior:contain}
.account-menu-identity{display:flex;flex-direction:column;gap:4px;padding:10px 10px 12px;margin-bottom:4px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.account-menu-identity strong{font-size:13px;font-weight:600}.account-menu-identity span{font-size:11px;color:var(--muted)}
.account-dropdown nav{display:flex;flex-direction:column}
.account-dropdown a,.account-dropdown button{display:flex;align-items:center;width:100%;box-sizing:border-box;min-height:40px;padding:8px 10px;border:0;border-radius:4px;background:transparent;color:var(--ink);font:inherit;text-align:left;text-decoration:none;cursor:pointer}
.account-dropdown a:hover,.account-dropdown button:hover{background:var(--hover);color:var(--blue)}
.account-menu-bottom{padding-top:4px;margin-top:4px;border-top:1px solid var(--line)}
.account-demo-note{margin:6px 4px 2px;padding:8px 6px;border-top:1px solid var(--line);font-size:11px;line-height:1.5;color:var(--muted)}
@media(max-width:1000px){.app-header{gap:8px 10px!important}.header-brand .demo-home{display:none}.account-trigger-name{max-width:100px}.map-notes-link{font-size:11px}.header-scale{border:0!important;padding:0!important}}
@media(max-width:760px){.app-header{flex-wrap:wrap!important;padding:6px 10px!important}.header-brand{margin-right:auto}.header-context{margin-right:0}.header-actions>button{padding:0 10px!important;font-size:12px!important}.header-account>summary{padding:2px;min-width:36px;justify-content:center}.account-trigger-name,.account-chevron{display:none}.header-scale{order:5;flex:1 0 100%;justify-content:space-between;gap:2px!important}.header-scale button{flex:1;min-height:36px!important}.map-notes-link{display:none}.map-context-label{font-size:11px}.account-dropdown{position:fixed;top:54px;right:10px;max-height:calc(100dvh - 66px)}}
@media(max-width:380px){.header-brand>p:first-of-type{font-size:16px!important}.header-brand{gap:6px!important}.app-header{gap:6px!important}.header-context{display:none}}

.map-welcome{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:14px 20px;border-bottom:1px solid var(--line);background:var(--surface-muted);color:var(--ink)}
.map-welcome strong{font-size:13px;font-weight:600}.map-welcome p{margin:4px 0 0;font-size:12px;line-height:1.5;color:var(--muted)}
.map-welcome button{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:none;min-height:38px;padding:8px 12px;border:1px solid var(--blue);border-radius:6px;background:var(--blue);color:#fff;font:500 12px var(--ui-font);cursor:pointer}.map-welcome button:hover{background:var(--blue-hover)}
@media(max-width:560px){.map-welcome{align-items:flex-start;gap:12px;padding:14px 12px}.map-welcome button{min-height:40px}.map-welcome p{max-width:240px}}
@media(max-width:380px){.map-welcome{flex-wrap:wrap}}

/* The brand itself is the account-aware home link; no separate landing shortcut. */
a.header-brand{text-decoration:none;color:var(--ink)}
a.header-brand>p:first-of-type{display:block!important;font-size:18px!important;font-weight:700!important;color:var(--ink)!important}
a.header-brand:hover{color:var(--ink)}
a.header-brand:focus-visible{outline:2px solid var(--blue);outline-offset:4px;border-radius:4px}
@media(max-width:700px){a.header-brand>p:first-of-type{font-size:16px!important}}

.catalog-limit{margin:0;padding:10px 12px;background:var(--surface-muted);border-radius:6px;font-size:13px;line-height:1.5;color:var(--muted)}
.catalog-limit a{color:var(--blue);white-space:nowrap}.catalog-error{color:#9b2435}
.catalog-item:disabled{opacity:.5;cursor:not-allowed}
