/* Approved three-pane shell. Product navigation lives in resources/theme/navigation.json. */
.app-page.theme-app { --theme-rail-width: 3.75rem; --theme-nav-width: 15.75rem; display: grid; height: 100dvh; min-height: 0; overflow: hidden; grid-template: var(--topbar-height) minmax(0,1fr) / var(--theme-rail-width) var(--theme-nav-width) minmax(0,1fr); grid-template-areas: "rail navigation topbar" "rail navigation workspace"; }
.theme-rail { grid-area: rail; display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: .75rem .5rem; background: var(--sidebar); border-right: 1px solid var(--line); z-index: 40; }
.theme-rail-button { position: relative; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; border: 0; border-radius: .6rem; color: var(--ink); background: transparent; text-decoration: none; cursor: pointer; }
.theme-rail-button .icon { width: 1.25rem; height: 1.25rem; }
.theme-rail-button:hover, .theme-rail-button.is-active { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.theme-rail-button:disabled { cursor: not-allowed; opacity: .5; }
.theme-tooltip { display:none; position:absolute; left:calc(100% + .5rem); top:.5rem; padding:.3rem .6rem; border:1px solid var(--line); border-radius:.4rem; background:var(--surface); color:var(--ink); white-space:nowrap; box-shadow:0 3px 12px #0001; font-size:.8rem; pointer-events:none; }
.theme-rail-button:hover .theme-tooltip, .theme-rail-button:focus-visible .theme-tooltip { display:block; }
.theme-more-wrap { position:relative; }
.theme-more-menu { position:absolute; top:0; left:calc(100% + .65rem); width:15rem; padding:.4rem; background:var(--surface); border:1px solid var(--line); border-radius:.75rem; box-shadow:0 .5rem 2rem #0002; }
.theme-more-menu[hidden] { display:none; }
.theme-more-menu a, .theme-more-menu button, .theme-more-menu > span { display:block; width:100%; padding:.6rem .75rem; text-align:left; border:0; border-radius:.4rem; color:var(--ink); background:transparent; text-decoration:none; font:inherit; font-size:.85rem; }
.theme-more-menu a:hover, .theme-more-menu button:hover { background:var(--sidebar); cursor:pointer; }
.theme-more-menu [aria-disabled] { opacity:.5; }
.theme-navigation { grid-area:navigation; display:flex; min-height:0; min-width:0; flex-direction:column; background:var(--sidebar); border-right:1px solid var(--line); }
.theme-navigation-header { min-height:3.75rem; padding:.75rem 1rem; display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.theme-brand { font-size:.95rem; font-weight:650; overflow-wrap:anywhere; }
.theme-navigation-scroll { flex:1; overflow-y:auto; padding:.5rem .65rem; }
.theme-navigation-label { padding:.4rem .6rem; margin:0 0 .5rem; font-size:.75rem; color:var(--muted); font-weight:600; }
.theme-navigation-link { display:flex; align-items:center; gap:.65rem; min-height:2.5rem; margin:.15rem 0; padding:.55rem .65rem; border-radius:.5rem; font-size:.875rem; text-decoration:none; color:var(--ink); }
.theme-navigation-link > span { flex:1; overflow-wrap:anywhere; }
.theme-navigation-link .icon { width:1.1rem; height:1.1rem; flex:none; }
.theme-navigation-link small { font-size:.65rem; color:var(--muted); }
.theme-navigation-link:hover, .theme-navigation-link.is-active { background:color-mix(in srgb, var(--ink) 7%, transparent); }
.theme-navigation-footer { padding:1rem; font-size:.8rem; color:var(--muted); border-top:1px solid var(--line); }
.theme-app .topbar { position:static; grid-template-columns:minmax(0,1fr) auto; background:var(--workspace); }
.theme-app .global-search { max-width:30rem; }
.theme-app .workspace { padding:2rem 2.25rem; min-height:0; overflow-y:auto; overscroll-behavior:contain; }
.theme-app .workspace-content { width:100%; max-width:90rem; }
.theme-app .page-header h1 { font-size:1.5rem; font-weight:650; letter-spacing:-.03em; }
.theme-module { margin:0 0 2rem; }
.theme-module-heading { display:flex; gap:1rem; justify-content:space-between; align-items:center; margin:0 0 .85rem; }
.theme-module-heading h2 { margin:0; font-size:1rem; font-weight:600; }
.theme-module-heading > a { font-size:.8rem; color:var(--muted); }
.theme-section-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr)); gap:.85rem; }
.theme-section-card { display:block; min-width:0; padding:1.1rem 1.2rem; border:1px solid var(--line); border-radius:.8rem; color:var(--ink); background:var(--surface); text-decoration:none; transition:border-color 120ms ease,box-shadow 120ms ease; }
a.theme-section-card:hover { border-color:var(--accent); box-shadow:0 2px 8px #0001; }
.theme-card-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.theme-card-heading h3 { margin:0; font-size:.9rem; font-weight:600; }
.theme-card-heading > span { color:var(--muted); }
.theme-card-metrics { display:flex; flex-wrap:wrap; gap:1rem 2rem; margin:1rem 0 0; }
.theme-card-metrics dt { color:var(--muted); font-size:.75rem; }
.theme-card-metrics dd { margin:.3rem 0 0; font-size:1.65rem; font-weight:600; }
.theme-section-card > p { font-size:.8rem; margin:.85rem 0 0; }
.is-unavailable { opacity:.65; }
.theme-page-directory { display:flex; gap:1rem 2rem; flex-wrap:wrap; padding-left:1rem; }
.theme-close-navigation, .theme-open-navigation { display:none; }
.theme-app :is(a,button,input,select,summary):focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
@media(max-width:1000px) { .app-page.theme-app { --theme-nav-width:13rem; } .theme-app .workspace { padding:1.3rem; } }
@media(max-width:760px) {
 .app-page.theme-app { --theme-rail-width:3.5rem; grid-template:var(--topbar-height) minmax(0,1fr) / var(--theme-rail-width) minmax(0,1fr); grid-template-areas:"rail topbar" "rail workspace"; }
 .theme-rail { padding:.6rem .35rem; }
 .theme-navigation { display:none; position:fixed; z-index:35; top:0; bottom:0; left:var(--theme-rail-width); width:min(16rem,calc(100vw - var(--theme-rail-width) - 1rem)); box-shadow:1rem 0 2rem #0002; }
 .theme-app.theme-navigation-open .theme-navigation { display:flex; }
 .theme-app .topbar { grid-template-columns:auto minmax(0,1fr); padding:0 .7rem; }
 .theme-open-navigation, .theme-close-navigation { display:grid; }
 .theme-app .topbar-user { display:none; }
 .theme-navigation-scrim:not([hidden]) { display:block; position:fixed; inset:0 0 0 var(--theme-rail-width); background:#0003; border:0; z-index:30; }
 .theme-app .workspace { padding:1rem; }
 .theme-app .workspace-content { min-width:0; }
 .theme-more-menu { width:min(15rem,calc(100vw - 5rem)); }
 .theme-module-heading { align-items:flex-start; }
}
@media(prefers-reduced-motion:reduce) { .theme-section-card { transition:none; } }

/* Shared section attention; selected navigation remains a separate state. */
[data-attention-module] { position:relative; }
.theme-app .theme-attention-highlight { background:color-mix(in srgb, var(--attention-color,var(--accent)) 18%, var(--surface)); box-shadow:inset 0 0 0 2px var(--attention-color,var(--accent)); }
.theme-app .theme-attention-color { color:var(--attention-color,var(--accent)); font-weight:700; }
.theme-attention-dot::after { content:""; position:absolute; top:.35rem; right:.35rem; width:.5rem; height:.5rem; border-radius:50%; background:var(--attention-color,var(--accent)); outline:2px solid var(--surface); }
.theme-attention-count { display:inline-flex; align-items:center; justify-content:center; min-width:1.3rem; padding:.1rem .3rem; border-radius:1rem; background:var(--ink); color:var(--surface); font-size:.7rem; font-weight:700; flex:none!important; }
.theme-attention-count[hidden], .theme-attention-actions[hidden] { display:none; }
.theme-rail-button .theme-attention-count { position:absolute; right:-.25rem; bottom:-.15rem; }
.theme-section-card > .theme-attention-count { margin-top:.6rem; }
.theme-attention-pulse { outline:2px solid var(--attention-color,var(--accent)); animation:theme-attention-pulse var(--attention-speed,1.5s) ease-in-out var(--attention-iterations,3); }
@keyframes theme-attention-pulse { 50% { box-shadow:0 0 0 4px color-mix(in srgb,var(--attention-color,var(--accent)) 45%,transparent); } }
@media (prefers-reduced-motion: reduce) { .theme-attention-pulse { animation:none; outline:2px solid var(--attention-color,var(--accent)); } }
.reduce-motion .theme-attention-pulse { animation:none; outline:2px solid var(--attention-color,var(--accent)); }
.theme-attention-settings { min-width:0; margin:0 0 1rem; }
.theme-attention-settings legend { font-weight:650; }
.theme-attention-options { display:flex; flex-wrap:wrap; gap:.65rem 1.25rem; margin-bottom:1rem; }
.theme-attention-options label { display:flex; align-items:center; gap:.35rem; }
.theme-attention-options input { width:auto; }
.theme-attention-actions { display:flex; align-items:center; flex-wrap:wrap; gap:1rem; margin-bottom:1rem; }


/* Owner-requested content-sized second column; mobile drawer remains unchanged. */
@media(min-width:761px){
 .app-page.theme-app{grid-template-columns:var(--theme-rail-width) max-content minmax(0,1fr);}
 .theme-navigation{width:max-content;}
 .theme-navigation-scroll{padding:.5rem;}
 .theme-navigation-link{padding:.55rem .6rem;}
 .theme-navigation-link>span{flex:initial;white-space:nowrap;overflow-wrap:normal;}
 .theme-navigation-header,.theme-navigation-footer{contain:inline-size;min-width:0;}
 .theme-navigation-header{padding:.75rem .6rem;}
 .theme-brand{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
 .theme-navigation-footer{overflow-wrap:anywhere;}
 .theme-navigation-label{contain:inline-size;}
}

/* Saved, explicitly adjusted navigation settings. Absent preferences keep the baseline. */
.app-page.theme-app[data-navigation-custom=true]{--theme-rail-width:var(--user-rail-width,3.75rem);}
@media(min-width:761px){
 .app-page.theme-app[data-navigation-custom=true]{grid-template-columns:var(--theme-rail-width) var(--user-module-width,max-content) var(--user-content-width,minmax(0,1fr));}
 .theme-app[data-navigation-custom=true]>.theme-navigation{width:auto;}
 .theme-app[data-navigation-custom=true] .theme-navigation-link>span{white-space:normal;overflow-wrap:anywhere;}
}
.theme-app[data-navigation-custom=true] .theme-rail-button{width:100%;}
.theme-app[data-navigation-custom=true] .theme-more-wrap{width:100%;}
.theme-app[data-navigation-custom=true] .theme-rail-button .icon{width:var(--user-icon-size);height:var(--user-icon-size);}
.theme-app[data-navigation-custom=true] .theme-navigation-link .icon{width:var(--user-module-icon-size);height:var(--user-module-icon-size);}
.theme-app[data-navigation-custom=true] .theme-navigation-link{font-size:var(--user-link-size);font-weight:var(--user-link-weight,inherit);border:var(--user-link-border-width) var(--user-link-border-style) var(--user-link-border-color);border-radius:var(--user-link-radius);}

/* Mirror the same chosen settings inside the live full-page preview. */
.theme-app[data-navigation-custom=true] .customize-settings.settings-workspace .settings-zoom-canvas .settings-preview-frame{grid-template-columns:var(--user-rail-width) var(--user-module-width) var(--user-content-width);}
.theme-app[data-navigation-custom=true] .settings-preview-rail svg{width:var(--user-icon-size);height:var(--user-icon-size);}
.theme-app[data-navigation-custom=true] .customize-settings.settings-workspace .settings-preview-frame .settings-preview-nav button{font-size:var(--user-link-size);font-weight:var(--user-link-weight,inherit);border:var(--user-link-border-width) var(--user-link-border-style) var(--user-link-border-color);border-radius:var(--user-link-radius);}

/* Owner-requested center-column collapse; the reopen control remains reachable. */
.theme-collapse-navigation{display:none;flex:none;}
@media(min-width:761px){
 .theme-collapse-navigation{display:grid;width:28px;height:28px;padding:4px;}
 .app-page.theme-app.theme-navigation-collapsed{grid-template-columns:var(--theme-rail-width) 52px var(--user-content-width,minmax(0,1fr));}
 .theme-app.theme-navigation-collapsed>.theme-navigation{width:52px;}
 .theme-navigation-collapsed .theme-navigation-header{padding:.75rem 3px;justify-content:center;}
 .theme-navigation-collapsed .theme-navigation-header>.theme-brand,
 .theme-navigation-collapsed .theme-navigation-footer{display:none;}
 .theme-navigation-collapsed .theme-collapse-navigation svg{transform:scaleX(-1);}
}

.theme-navigation-link .theme-section-link-icon{display:none;}
.theme-navigation-tooltip{position:fixed;z-index:1000;padding:.3rem .6rem;border:1px solid var(--line);border-radius:.4rem;background:var(--surface);color:var(--ink);box-shadow:0 3px 12px #0001;font-size:.8rem;pointer-events:none;max-width:calc(100vw - 80px);overflow-wrap:anywhere;}
.theme-navigation-tooltip[hidden]{display:none;}
@media(min-width:761px){
 .theme-navigation-collapsed .theme-navigation-scroll{display:block;padding:.5rem 3px;}
 .theme-navigation-collapsed .theme-navigation-label,
 .theme-navigation-collapsed .theme-navigation-link>span:not(.theme-attention-count),
 .theme-navigation-collapsed .theme-navigation-link>small{display:none;}
 .theme-app.theme-navigation-collapsed .theme-navigation-link{justify-content:center;gap:0;min-height:44px;padding:4px;}
 .theme-navigation-collapsed .theme-navigation-link .theme-section-link-icon{display:block;}
 .theme-navigation-collapsed .theme-navigation-link .theme-attention-count{position:absolute;right:0;bottom:0;font-size:.6rem;}
}

/* User entry stays at the bottom of the first rail. */
.theme-rail>.theme-rail-bottom{margin-top:auto;}

/* Explicit rail light/dark switch; light uses the unchanged approved defaults. */
:root[data-app-appearance=dark]{color-scheme:dark;--ink:#E6E6E8;--muted:#A0A0A7;--line:#3B3B40;--surface:#252528;--surface-raised:#29292D;--surface-soft:#202023;--sidebar:#202023;--workspace:#18181B;--accent:#90A9ED;--focus:#90A9ED;}
[data-app-appearance=dark] .theme-app :is(input,select,textarea,.button-secondary){background:var(--surface);color:var(--ink);border-color:var(--line);}
[data-app-appearance=dark] .theme-app .icon-button{color:var(--ink);}
[data-app-appearance=dark] .theme-app .icon-button:hover{background:var(--surface);border-color:var(--line);}
[data-app-appearance=dark] .settings-dock{--surface:#252528;--field:#29292D;--text:#E6E6E8;--ink:#E6E6E8;--muted:#A0A0A7;--line:#3B3B40;color:var(--text);}
[data-app-appearance=dark] .settings-dock :is(.btn:not(.primary),.dirty-bar,.scheme,.advanced-group){background:var(--surface);color:var(--text);border-color:var(--line);}
[data-app-appearance=dark] .settings-preview-head{background:#252528;color:#E6E6E8;border-color:#3B3B40;}

/* Catalog-driven status summaries, using the approved shell colors. */
.theme-card-statuses{display:flex;flex-wrap:wrap;gap:.4rem;margin:.85rem 0 0;}
.theme-card-status{display:inline-flex;align-items:center;gap:.4rem;padding:.25rem .5rem;border:1px solid var(--line);border-radius:.4rem;background:var(--surface-soft);color:var(--muted);font-size:.75rem;}
.theme-card-status dt{font-weight:500;}
.theme-card-status dd{margin:0;font-weight:650;color:var(--ink);font-variant-numeric:tabular-nums;}
.theme-card-status.has-count{color:var(--ink);border-color:var(--accent);}
.theme-card-status[data-status=overdue].has-count{font-weight:650;border-width:2px;}

.theme-attention-sample{position:relative;padding:.75rem 1rem;border:1px solid var(--line);border-radius:.5rem;min-width:180px;display:flex;gap:.75rem;align-items:center;}
.theme-attention-options input:not([type=checkbox]){width:9rem;}

.attention-options-group{border-top:1px solid var(--line);padding:.65rem 0;}.attention-options-group summary{cursor:pointer;font-weight:600;}.attention-advanced-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:1rem;padding:1rem 0;}.attention-advanced-grid label{display:block;}.attention-advanced-grid input[type=checkbox]{width:auto;}.attention-advanced-grid fieldset{border:1px solid var(--line);padding:.75rem;}.attention-advanced-grid input,.attention-advanced-grid select{max-width:100%;}.attention-advanced-grid button{margin-top:.4rem;}
.theme-app [data-attention-intensity=subtle].theme-attention-highlight{background:color-mix(in srgb,var(--attention-color,var(--accent)) 8%,var(--surface));box-shadow:none;}
.theme-app [data-attention-intensity=strong].theme-attention-highlight{background:color-mix(in srgb,var(--attention-color,var(--accent)) 30%,var(--surface));box-shadow:inset 0 0 0 3px var(--attention-color,var(--accent));}
.theme-app [data-attention-intensity=outline].theme-attention-highlight{background:transparent;box-shadow:inset 0 0 0 2px var(--attention-color,var(--accent));}
.theme-app [data-attention-intensity=text].theme-attention-highlight{background:transparent;box-shadow:none;color:var(--attention-color,var(--accent));font-weight:700;}
.attention-contrast{outline:3px solid currentColor!important;font-weight:700;}.attention-contrast .theme-attention-count{background:#000;color:#fff;border:2px solid #fff;}
[data-attention-size=large] .theme-attention-count{font-size:.9rem;min-width:1.7rem;}[data-attention-size=larger] .theme-attention-count{font-size:1.1rem;min-width:2rem;}
[data-attention-symbol]:not([data-attention-symbol=""])::before{content:attr(data-attention-symbol);font-weight:900;margin-right:.3rem;}
[data-attention-locked=true]{opacity:.7;}[data-attention-locked=true]>legend::after{content:' · Owner locked';}
/* Keep every approved rail action visible in short desktop/landscape windows. */
@media(max-height:600px){
 .theme-app .theme-rail{gap:2px;padding-top:4px;padding-bottom:4px;}
}
@media(max-height:470px){
 .theme-app .theme-rail-button{height:calc((100dvh - 26px)/10);}
 .theme-app .theme-tooltip{top:0;}
}

/* Owner-requested independent panel orientation; colors and icon styles stay shared. */
.theme-navigation-actions{display:flex;align-items:center;gap:4px;flex:none;}
.theme-orientation-navigation{display:grid;width:28px;height:28px;padding:4px;flex:none;}
.theme-navigation-collapsed:not(.theme-navigation-top) .theme-navigation-actions{flex-direction:column;}
.app-page.theme-app.theme-rail-top{grid-template:52px var(--topbar-height) minmax(0,1fr) / var(--theme-nav-width) minmax(0,1fr);grid-template-areas:"rail rail" "navigation topbar" "navigation workspace";}
@media(min-width:761px){.app-page.theme-app.theme-rail-top{grid-template-columns:max-content minmax(0,1fr);}.app-page.theme-app.theme-rail-top.theme-navigation-collapsed{grid-template-columns:52px minmax(0,1fr);}}
.app-page.theme-app.theme-navigation-top{grid-template:60px var(--topbar-height) minmax(0,1fr) / var(--theme-rail-width) minmax(0,1fr);grid-template-areas:"rail navigation" "rail topbar" "rail workspace";}
.app-page.theme-app.theme-rail-top.theme-navigation-top{grid-template:52px 60px var(--topbar-height) minmax(0,1fr) / minmax(0,1fr);grid-template-areas:"rail" "navigation" "topbar" "workspace";}
.theme-rail-top .theme-rail{flex-direction:row;gap:2px;padding:4px 8px;min-width:0;border-right:0;border-bottom:1px solid var(--line);}
.theme-rail-top .theme-rail-button,.theme-app.theme-rail-top[data-navigation-custom=true] .theme-rail-button{width:clamp(24px,calc((100vw - 40px)/11),44px);height:44px;flex:none;}
.theme-app.theme-rail-top[data-navigation-custom=true] .theme-more-wrap{width:auto;flex:none;}
.theme-rail-top .theme-rail>.theme-rail-bottom{margin-top:0;margin-left:auto;}
.theme-rail-top .theme-tooltip{top:calc(100% + 4px);left:0;}
.theme-rail-top .theme-rail-button:nth-last-child(-n+3) .theme-tooltip{left:auto;right:0;}
.theme-rail-top .theme-more-menu{top:calc(100% + 4px);left:0;}
.theme-app.theme-navigation-top>.theme-navigation{position:static;display:flex;flex-direction:row;width:auto;min-width:0;box-shadow:none;border-right:0;border-bottom:1px solid var(--line);}
.theme-navigation-top .theme-navigation-header{contain:none;min-height:0;padding:4px 8px;}
.theme-navigation-top .theme-brand,.theme-navigation-top .theme-navigation-label,.theme-navigation-top .theme-navigation-footer,.theme-navigation-top .theme-close-navigation{display:none;}
.theme-navigation-top .theme-navigation-actions{flex-direction:row;}
.theme-navigation-top .theme-collapse-navigation{display:grid;width:28px;height:28px;padding:4px;}
.theme-navigation-top .theme-navigation-scroll{display:block;overflow:auto;padding:4px;min-width:0;}
.theme-navigation-top .theme-navigation-scroll>nav{display:flex;align-items:center;width:max-content;}
.theme-navigation-top .theme-navigation-link{white-space:nowrap;margin:0 4px 0 0;}
.theme-navigation-top .theme-navigation-link .theme-section-link-icon{display:block;}
.theme-navigation-top.theme-navigation-collapsed .theme-navigation-link>span:not(.theme-attention-count),.theme-navigation-top.theme-navigation-collapsed .theme-navigation-link>small{display:none;}
.theme-navigation-top.theme-navigation-collapsed .theme-navigation-link{width:44px;min-height:44px;justify-content:center;}
@media(max-width:760px){
 .app-page.theme-app.theme-rail-top:not(.theme-navigation-top){grid-template:52px var(--topbar-height) minmax(0,1fr) / minmax(0,1fr);grid-template-areas:"rail" "topbar" "workspace";}
 .theme-rail-top:not(.theme-navigation-top) .theme-navigation{top:52px;left:0;}
 .theme-rail-top .theme-navigation-scrim:not([hidden]){inset:52px 0 0;}
 .theme-navigation-top .theme-open-navigation{display:none;}
}
