/* C1 V5 adaptation. SVG artwork is the user's original V5 package. No remote
 * fonts, canvas, particles, business selectors or layout widths for form inputs. */
:root,:host{--panel:#fff;--c1-focus:#1765df;--c1-success:#17674e;--c1-warning:#805400;--c1-danger:#b4233f;--c1-field:var(--panel,#fff);--c1-neon-blue:#30baff;--c1-neon-teal:#3ff9f5;--c1-neon-purple:#cba1ff;--c1-neon-amber:#ffce83;--c1-header:var(--soft,#edf4ff)}
:root[data-theme=dark],:host([data-theme=dark]){color-scheme:dark;--bg:#101a2b;--panel:#19263a;--ink:#e4edf9;--muted:#a4b5cb;--line:#304158;--accent:#82b4ff;--soft:#223c60;--shadow:0 5px 24px #0002;--c1-field:#142238;--c1-focus:#82b4ff;--c1-danger:#ffacbc;--c1-warning:#ffcf82;--c1-success:#85e6bf;--green:#82b4ff;--red:#ffacbc}
:root[data-theme=neon],:host([data-theme=neon]){color-scheme:dark;--bg:#06152e;--panel:#0a2042;--ink:#eaf5ff;--muted:#a8c6e8;--line:#285b91;--accent:#79d9ff;--soft:#103461;--shadow:0 0 14px #0877ef2b,inset 0 1px #62baff22;--c1-header:#0c2e5b;--c1-field:#081c39;--c1-focus:#80ecff;--c1-success:#8df0d2;--c1-warning:#ffce83;--c1-danger:#ffacbc;--green:#79d9ff;--red:#ffacbc;--danger:#ffacbc;--fc-border-color:#285b91;--fc-page-bg-color:#0a2042;--fc-neutral-bg-color:#103461;--fc-list-event-hover-bg-color:#103461;--fc-today-bg-color:#14457980;--fc-button-bg-color:#0c3670;--fc-button-border-color:#4389d6;--fc-button-hover-bg-color:#15518c;--fc-button-hover-border-color:#79d9ff;--fc-button-active-bg-color:#075b92;--fc-button-active-border-color:#80ecff}
/* Existing day layout is retained. Correct only known low-contrast small text. */
:root[data-theme=light] .badge,:root[data-theme=light] .nav-badge{background:#c82843;color:#fff}
:root[data-theme=light] .status.working{color:#805400;background:#fff0ce}
:root[data-theme=light] .status.pending{color:#b4233f;background:#ffe9ed}
:root[data-theme=light] .stats button:nth-child(2) strong{color:#805400}
:root[data-theme=light] .stats button:nth-child(3) strong{color:#17674e}
:root[data-theme=light] .hero{background:linear-gradient(115deg,#185bd8,#1d40b8)}
/* Existing dark theme is independent, including legacy shared management cards. */
:root[data-theme=dark] body{background:var(--bg);color:var(--ink)}
:root[data-theme=dark] :is(.card,.case-card,.search-form,#startup,.login-screen),:host([data-theme=dark]) :is(.card,.case-card,.search-form){background:var(--panel);color:var(--ink);border-color:var(--line)}
:root[data-theme=dark] :is(input,select,textarea),:host([data-theme=dark]) :is(input,select,textarea){background-color:var(--c1-field);color:var(--ink);border-color:#536c8f}
:root[data-theme=dark] label,:host([data-theme=dark]) label{color:var(--muted)}
:root[data-theme=dark] a,:host([data-theme=dark]) a{color:var(--accent)}
:root[data-theme=dark] button.primary,:host([data-theme=dark]) button.primary{background:#1856ac;color:#fff;border-color:#82b4ff}
:root[data-theme=dark] :is(.report-card,.person-picker-panel,.pending-owner,.notice-card),:host([data-theme=dark]) :is(.report-card,.person-picker-panel,.pending-owner,.notice-card){color:var(--ink);background:var(--panel);border-color:var(--line)}
:root[data-theme=dark] :is(dialog,fieldset,th),:host([data-theme=dark]) :is(dialog,fieldset,th){color:var(--ink);background:var(--panel);border-color:var(--line)}
:root[data-theme=dark] .status,:host([data-theme=dark]) .status{background:#223c60;color:#b9dcff}
:root[data-theme=dark] .danger,:host([data-theme=dark]) .danger{color:var(--c1-danger);border-color:#936077;background:var(--panel)}
:root[data-theme=dark] .reminder-row.unread,:host([data-theme=dark]) .reminder-row.unread{background:#293a52}
/* Shared palette covers every native/embedded form without changing its state. */
:root[data-theme=neon] body{background:radial-gradient(ellipse at 60% -10%,#0e3674,transparent 55%),var(--bg);color:var(--ink)}
:root[data-theme=neon] :is(h1,h2,h3,strong,legend),:host([data-theme=neon]) :is(h1,h2,h3,strong,legend){color:var(--ink)}
:root[data-theme=neon] :is(p,label,td,li,dt,dd),:host([data-theme=neon]) :is(p,label,td,li,dt,dd){color:inherit}
:root[data-theme=neon] :is(small,.muted,.version,.read-only-note),:host([data-theme=neon]) :is(small,.muted,.version,.read-only-note){color:var(--muted)}
:root[data-theme=neon] a,:host([data-theme=neon]) a{color:var(--accent)}
:root[data-theme=neon] button,:host([data-theme=neon]) button{color:var(--ink);background:linear-gradient(140deg,#123b70,#0b254b);border-color:#387ac0;box-shadow:inset 0 1px #75cfff20;transition:background .15s,border-color .15s,box-shadow .15s}
:root[data-theme=neon] button:hover:not(:disabled),:host([data-theme=neon]) button:hover:not(:disabled){background:#154979;border-color:#73dcff;box-shadow:0 0 10px #138bff44}
:root[data-theme=neon] button.primary,:host([data-theme=neon]) button.primary{color:#fff;background:linear-gradient(105deg,#0752ad,#08708a);border-color:#6de8ff;box-shadow:0 0 12px #008cff45,inset 0 1px #c7ffff55}
:root[data-theme=neon] :is(button.danger,.danger),:host([data-theme=neon]) :is(button.danger,.danger){color:var(--c1-danger);background:#341b36;border-color:#b05e7e}
:root[data-theme=neon] button:disabled,:host([data-theme=neon]) button:disabled{opacity:.55;box-shadow:none;cursor:not-allowed}
:root[data-theme=neon] :is(input,select,textarea),:host([data-theme=neon]) :is(input,select,textarea){color:var(--ink);background-color:var(--c1-field);border-color:#3d6d9f;accent-color:#64dfff;caret-color:#92f3ff}
:root[data-theme=neon] :is(input,textarea)::placeholder,:host([data-theme=neon]) :is(input,textarea)::placeholder{color:#91b0d4;opacity:1}
:root[data-theme=neon] :is(input,select,textarea,button,a,summary):focus-visible,:host([data-theme=neon]) :is(input,select,textarea,button,a,summary):focus-visible{outline:3px solid var(--c1-focus);outline-offset:3px}
:root[data-theme=neon] option,:host([data-theme=neon]) option{background:var(--c1-field);color:var(--ink)}
:root[data-theme=neon] :is(.card,.case-card,.report-card,.search-form,.stat,.notice-card,.empty,.person-picker-panel,.pending-owner),:host([data-theme=neon]) :is(.card,.case-card,.report-card,.search-form,.notice-card,.empty,.person-picker-panel,.pending-owner){color:var(--ink);background:linear-gradient(135deg,#0b2b56,#081a36 88%);border-color:#2878c9;box-shadow:var(--shadow);border-radius:14px}
:root[data-theme=neon] :is(.card,.report-card,.case-card),:host([data-theme=neon]) :is(.card,.report-card,.case-card){background-image:url('theme-v5/panel-corners.svg'),linear-gradient(135deg,#0b2b56,#081a36 88%);background-position:right bottom,center;background-size:90% auto,auto;background-repeat:no-repeat}
:root[data-theme=neon] dialog,:host([data-theme=neon]) dialog{color:var(--ink);background:linear-gradient(140deg,#0c2b55,#07172f);border:1px solid #439de8;box-shadow:0 0 0 1px #2766a844,0 0 24px #097bea40,0 20px 60px #0008}
:root[data-theme=neon] dialog::backdrop,:host([data-theme=neon]) dialog::backdrop{background:#020c20c9;backdrop-filter:blur(3px)}
:root[data-theme=neon] :is(dialog header,.section-title,.btn-row h2),:host([data-theme=neon]) :is(dialog header,.section-title,.btn-row h2){color:var(--ink)}
:root[data-theme=neon] table,:host([data-theme=neon]) table{color:var(--ink);border-color:var(--line)}
:root[data-theme=neon] :is(th,thead),:host([data-theme=neon]) :is(th,thead){background:var(--c1-header);color:#cbeaff;border-color:var(--line)}
:root[data-theme=neon] :is(td,tr,fieldset,details),:host([data-theme=neon]) :is(td,tr,fieldset,details){border-color:var(--line)}
:root[data-theme=neon] tbody tr:nth-child(even),:host([data-theme=neon]) tbody tr:nth-child(even){background:#12325a44}
:root[data-theme=neon] summary,:host([data-theme=neon]) summary{color:var(--accent)}
:root[data-theme=neon] .person-picker-panel,:host([data-theme=neon]) .person-picker-panel{background:#0b2448}
:root[data-theme=neon] .person-picker-list [aria-selected=true],:host([data-theme=neon]) .person-picker-list [aria-selected=true]{outline-color:#7cecff;background:#124878}
:root[data-theme=neon] pre,:host([data-theme=neon]) pre{color:#c5e5ff;background:#06162c88;border-radius:8px;padding:12px;white-space:pre-wrap;overflow-wrap:anywhere}
:root[data-theme=neon] :is(.sync-note,.read-only-note,.notice-card,#connection),:host([data-theme=neon]) :is(.sync-note,.read-only-note,.notice-card){color:#c0dcfb;background:#0d2c50;border-color:#387ac0}
:root[data-theme=neon] :is([role=alert],#startup-error,#login-error),:host([data-theme=neon]) [role=alert]{color:#ffc3d2}
:root[data-theme=neon] .reminder-row.unread,:host([data-theme=neon]) .reminder-row.unread{background:#183454;color:#eaf5ff}
:root[data-theme=neon] .reminder-row.read,:host([data-theme=neon]) .reminder-row.read{color:var(--muted)}
:root[data-theme=neon] .status,:host([data-theme=neon]) .status{color:#b9e4ff;background:#103d69;border-color:#4f8aba}
:root[data-theme=neon] .status.done,:host([data-theme=neon]) .status.done{color:var(--c1-success);background:#103b39}
:root[data-theme=neon] .status.working,:host([data-theme=neon]) .status.working{color:var(--c1-warning);background:#453317}
:root[data-theme=neon] .status.pending,:host([data-theme=neon]) .status.pending{color:var(--c1-danger);background:#3e2039}
:root[data-theme=neon] :is(.badge,.nav-badge,#unread),:host([data-theme=neon]) :is(.badge,.nav-badge){background:#a41f43;color:#fff;box-shadow:0 0 9px #f4537755}
/* Desktop composition follows V5: purposeful circuit-filled navigation, city
 * bottom and circuit background. Decoration never overlays hit targets. */
:root[data-theme=neon] .cloud-sidebar{isolation:isolate;background:linear-gradient(175deg,#0a2856,#06132c 85%);border-right:1px solid #2578c6;box-shadow:inset -3px 0 14px #1670b533}
:root[data-theme=neon] .cloud-sidebar::before{content:'';position:absolute;inset:65px 0 0;z-index:-1;pointer-events:none;background:url('theme-v5/sidebar-circuit.svg') center/100% 100% no-repeat,url('theme-v5/skyline.svg') left bottom/340px auto no-repeat;opacity:.65}
:root[data-theme=neon] .cloud-sidebar :is(h2,nav,footer){position:relative}
:root[data-theme=neon] .cloud-sidebar nav button{color:#c9e5ff;background:transparent;border-color:transparent;box-shadow:none;text-shadow:0 1px 3px #041124}
:root[data-theme=neon] .cloud-sidebar nav button[aria-current=page]{color:#fff;background:linear-gradient(105deg,#0864d3,#075f82);border-color:#55dfff;box-shadow:0 0 12px #129cfe55,inset 0 0 0 1px #4bd8ff}
:root[data-theme=neon] .cloud-sidebar footer{color:#a1c7ee}
:root[data-theme=neon] .cloud-main{position:relative;isolation:isolate;background:radial-gradient(ellipse at 57% 0%,#0e367488,transparent 58%)}
:root[data-theme=neon] .cloud-main::before{content:'';position:absolute;inset:0;pointer-events:none;z-index:-1;background:url('theme-v5/circuit-traces.svg') center 8%/125% auto no-repeat;opacity:.65}
:root[data-theme=neon] .topbar{position:relative;isolation:isolate;border-color:#268deb;background:linear-gradient(100deg,#123a75cc,#071c3dcc 68%,#0a2555aa);box-shadow:0 0 16px #1486ff40,inset 0 1px #4bbdff55,inset 0 -1px #0c6ef688}
:root[data-theme=neon] .topbar::before{content:'';position:absolute;inset:0;pointer-events:none;z-index:-1;background:url('theme-v5/panel-corners.svg') center/cover no-repeat;opacity:.36}
:root[data-theme=neon] :is(.brand-mark,.brand-mini,.brand-tile){color:#bcf8ff;background:linear-gradient(140deg,#0878e8,#06336b);border:1px solid #64dfff;box-shadow:0 0 15px #078aff66,inset 0 1px #9ef2ff66}
.theme-icon{width:23px;height:23px;vertical-align:middle;flex:none}.brand-mark .theme-icon,.brand-mini .theme-icon,.brand-tile .theme-icon{width:31px;height:31px}.stat-symbol{display:none}
:root[data-theme=neon] .stat-symbol{display:grid;place-items:center;float:left;margin:0 12px 12px 0;width:42px;height:42px;border:1px solid var(--edge);border-radius:10px;background:linear-gradient(140deg,#137eff,#06346b);box-shadow:0 0 14px var(--glow);color:#c5f8ff}
:root[data-theme=neon] .stat-symbol .theme-icon{width:27px;height:27px}
:root[data-theme=neon] .stats-grid .stat{--edge:#30baff;--base:#064aa5;--glow:#078cff88;--shade:#028cff50;position:relative;isolation:isolate;min-height:168px;border:1px solid var(--edge);background:linear-gradient(132deg,#ffffff17 0 2%,transparent 2% 52%,#ffffff08 52% 62%,transparent 62%),radial-gradient(ellipse at 105% 103%,var(--glow),transparent 61%),linear-gradient(135deg,var(--base),#071b3b 85%);box-shadow:0 0 10px var(--shade),inset 0 1px #ffffff77,inset 0 -4px 13px var(--shade);color:#f4f9ff;text-align:left;overflow:hidden}
:root[data-theme=neon] .stats-grid .stat:nth-child(2){--edge:#3ff9f5;--base:#075b69;--glow:#08c8d566;--shade:#08f5ed44}
:root[data-theme=neon] .stats-grid .stat:nth-child(3){--edge:#cba1ff;--base:#392180;--glow:#9855ff88;--shade:#ad65ff44}
:root[data-theme=neon] .stats-grid .stat:nth-child(4){--edge:#ffce83;--base:#5b301e;--glow:#ff9e3b66;--shade:#ffab4744}
:root[data-theme=neon] .stats-grid .stat :is(span:not(.stat-symbol),strong,small){color:#f4f9ff}
:root[data-theme=neon] .stats-grid .stat>strong{clear:both;font-size:40px;line-height:1.2}
:root[data-theme=neon] .stats-grid .stat>span:not(.stat-symbol){padding-block:10px;display:block}
:root[data-theme=neon] .stats-grid .stat::after{content:'';position:absolute;pointer-events:none;z-index:-1;bottom:0;right:0;width:65%;height:42%;background:radial-gradient(ellipse at bottom right,var(--shade),transparent 73%);opacity:.6}
/* Mobile has its own composition, not a scaled desktop. Existing six tiles and
 * badges remain; V5's blue/teal/purple/amber visual language maps to those tiles. */
:root[data-theme=neon] .mobile-shell{isolation:isolate;position:relative;background:radial-gradient(ellipse at top,#0c387777,transparent 66%),var(--bg)}
:root[data-theme=neon] .mobile-shell::before{content:'';position:absolute;inset:70px 0 90px;pointer-events:none;z-index:-1;background:url('theme-v5/sidebar-circuit.svg') right center/200px 100% no-repeat,url('theme-v5/circuit-traces.svg') center top/auto 80% no-repeat;opacity:.22}
:root[data-theme=neon] :is(.app-header,.scope-row){background:#0b2750dd;border-color:#2c78bf}
:root[data-theme=neon] .hero{background:linear-gradient(120deg,#0c3e7d,#0a244f);border:1px solid #319bdf;box-shadow:var(--shadow)}
:root[data-theme=neon] .hero :is(h1,p){color:#eaf5ff}
:root[data-theme=neon] .hero::after{opacity:.35}
:root[data-theme=neon] .tile{color:#eaf5ff;background:linear-gradient(135deg,#0b3764,#0b2349);border-color:#3182cc;box-shadow:0 0 10px #028cff25,inset 0 1px #72dfff33}
:root[data-theme=neon] .tile:nth-child(3n+2){border-color:#a486de;background:linear-gradient(135deg,#33245a,#0c2349)}
:root[data-theme=neon] .tile:nth-child(3n){border-color:#2cb9bd;background:linear-gradient(135deg,#084954,#0c2349)}
:root[data-theme=neon] .tile .icon-box{background:linear-gradient(135deg,#0c69c9,#082e5f);color:#bdf4ff;border:1px solid #3aabdf;box-shadow:0 0 10px #0a8cff44}
:root[data-theme=neon] .bottom-nav{background:#0d2444f5;border-color:#2866a4;box-shadow:0 -8px 18px #061127aa}
:root[data-theme=neon] .bottom-nav button{color:#a9c8e9;background:transparent;border:0;box-shadow:none}
:root[data-theme=neon] .bottom-nav button[aria-current=page]{color:#80e8ff}
:root[data-theme=neon] .bottom-nav .create-button{color:#fff;background:linear-gradient(145deg,#0860d6,#1647aa);border:2px solid #4ed8ff;box-shadow:0 0 18px #128bff66}
:root[data-theme=neon] .more-list button{background:#0b2448;border-color:var(--line)}
:root[data-theme=neon] .mobile-shell .stats button{background:#103461;color:var(--ink)}
:root[data-theme=neon] .mobile-shell .stats strong{color:var(--accent)}
:root[data-theme=neon] .timeline,:host([data-theme=neon]) .timeline{border-color:#459dd8}
:root[data-theme=neon] :is(.fc-event,.fc-daygrid-event),:host([data-theme=neon]) :is(.fc-event,.fc-daygrid-event){color:#eaf5ff;background:#123f73;border-color:#3d87c5}
/* Ancillary login/callback/initialization/retired-link pages share the theme. */
.auth-page{max-width:760px;margin:clamp(12px,5vh,48px) auto;padding:20px}.auth-page>main{margin:0}.auth-page .card{padding:24px}
:root[data-theme=neon] :is(#startup,.login-screen){color:var(--ink);background:linear-gradient(140deg,#0c2b55,#07172f);border:1px solid #368cda;border-radius:18px;box-shadow:0 0 24px #1486ff33}
:root[data-theme=neon] #startup{background-image:url('theme-v5/panel-corners.svg'),linear-gradient(140deg,#0c2b55,#07172f);background-repeat:no-repeat;background-position:right bottom}
:root[data-theme=neon] .login-screen{padding:26px 22px}
:root[data-theme=neon] ::selection{background:#245d95;color:#fff}
@media(prefers-reduced-motion:reduce){:root[data-theme=neon] *,:host([data-theme=neon]) *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
@media(max-width:600px){:root[data-theme=neon] .cloud-main{background-size:auto}:root[data-theme=neon] .cloud-sidebar::before{opacity:.35}.auth-page{padding:12px}}

dialog header h2{margin:0;margin-right:auto}

:root[data-theme=neon] .welcome label{white-space:nowrap}.app-header>[data-c1-theme-cycle]{flex:none}

:root[data-theme=neon] .tile:nth-child(4){border-color:#e5ad69;background:linear-gradient(135deg,#49301f,#0c2349)}:root[data-theme=neon] .tile:nth-child(3n+2) .icon-box{border-color:#b59ae9;color:#decaff;background:linear-gradient(135deg,#51338d,#192e5f)}:root[data-theme=neon] .tile:nth-child(3n) .icon-box{border-color:#41d5d2;color:#a4fff0;background:linear-gradient(135deg,#076a77,#0b324c)}:root[data-theme=neon] .tile:nth-child(4) .icon-box{border-color:#ffce83;color:#ffe1ab;background:linear-gradient(135deg,#7c491d,#3d293c)}
/* Loading feedback uses existing theme tokens, without changing business controls. */
.c1-loading{min-width:0;min-height:160px;padding:12px}.c1-loading h2{font-size:18px;margin:0 0 8px}.c1-skeleton{height:42px;border-radius:10px;margin-block:12px;background:var(--soft);opacity:.65}.c1-skeleton:nth-last-child(1){width:72%}.c1-progress{padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--soft);color:var(--ink);font-size:13px;line-height:1.5}

/* Desktop home only: separate recent cases into soft V5 cards, without
 * changing case content, order, hit targets or other theme layouts. */
:root[data-theme=neon] #home-cases{display:grid;gap:10px;margin-top:12px}
:root[data-theme=neon] #home-cases .recent-case{min-width:0;grid-template-columns:minmax(0,1fr) auto;border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:linear-gradient(135deg,#10346199,#081a36d9);box-shadow:none}
:root[data-theme=neon] #home-cases .recent-case:hover:not(:disabled){background:#123861;border-color:var(--accent);box-shadow:0 0 8px #138bff22}
