:root { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif; }
.login-shell { max-width:560px; margin:0 auto; padding:48px 20px; min-height:100dvh; }
.login-brand { display:flex; align-items:center; gap:16px; margin-bottom:24px; }
.login-brand img { width:64px; height:64px; object-fit:contain; }
.login-brand h1 { margin:0; }
.login-shell form { margin-top:20px; display:grid; gap:16px; }
.app .side { overflow-y:auto; }
.app .content { min-height:500px; }
.app .topbar { height:auto; min-height:68px; padding-block:12px; }
.app h1:focus { outline:none; }
.app .workflow-toolbar { align-items:center; }
.app .mobile-section { display:none; }
.app .side .nav button span { width:auto; }
.app .nav { gap:4px; }
.app .brand { padding:0 8px; }
.app .brand strong { display:block; }
.app .side-note { margin-top:16px; }
.app section.demo-card { margin-bottom:16px; }
.app .data-list { margin-top:24px; }
.app .data-list .workflow-row { margin-bottom:10px; }
.app .workflow-row { font-size:1rem; }
.app .form-wide { max-width:960px; }
.app .loading-space { min-height:300px; }
.app .status-line { color:var(--secondary); margin-block:0 16px; }
.app .demo-check { margin:0; min-height:48px; }
.app .demo-check input { width:22px; height:22px; }
.app .audit-row { margin-bottom:12px; padding:16px; border:1px solid var(--divider); background:var(--surface); border-radius:12px; }
.app .audit-row summary { min-height:44px; cursor:pointer; font-weight:700; }
.app .audit-change { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.app pre { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; font-size:.875rem; }
.app .empty-box { background:var(--surface); padding:24px; border:1px dashed var(--divider); border-radius:12px; }
.app button:disabled,.login-shell button:disabled { cursor:default; opacity:.65; }
.app .topbar .user { flex-wrap:wrap; }
.skip-link { position:fixed; top:0; transform:translateY(-150%); left:12px; z-index:100; background:var(--surface); padding:12px; color:var(--accent); }
.skip-link:focus { top:12px; transform:translateY(0); }
.app .demo-form-actions { position:static; flex-wrap:wrap; }
.app input[type=color] { padding:5px; }
.app .side .nav button,.app .btn,.login-shell .btn { min-width:44px; min-height:44px; }
@media(max-width:980px) and (min-width:701px) { .app { grid-template-columns:190px minmax(0,1fr); } .app .nav button { text-align:left; padding:10px; } }
@media(max-width:700px) {
 .app { padding-bottom:0; }
 .app .mobile-section { display:grid; min-width:0; }
 .app .mobile-section select { width:100%; min-height:44px; padding:8px 44px 8px 12px; border:1px solid var(--divider); border-radius:9px; background:var(--surface); font:inherit; }
 .app .topbar { display:grid; gap:12px; padding:16px; }
 .app .topbar .user { display:flex; gap:12px; }
 .app .audit-change { grid-template-columns:1fr; }
 .app .brand { display:none; }
 .app .content { padding:20px 12px; }
 .login-shell { padding:24px 12px; }
 .app .workflow-toolbar { align-items:stretch; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; animation:none!important; } }
.app .device-banner { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:12px 24px; background:var(--surface); border-bottom:1px solid var(--divider); color:var(--ink); line-height:1.5; }
.app .device-banner span { flex:1 1 240px; overflow-wrap:anywhere; }
.app .offline-note { padding:16px; border:1px solid var(--divider); border-radius:12px; background:var(--surface); color:var(--ink); }
.app .sync-conflict { margin:16px 0; padding:16px; border:1px solid var(--divider); border-radius:12px; min-width:0; overflow-wrap:anywhere; }
.app #sync-entries dd { margin:8px 0 16px; white-space:pre-wrap; overflow-wrap:anywhere; }
.app #sync-entries dt { font-weight:600; }
.app #sync-entries summary { min-height:44px; cursor:pointer; padding-block:12px; }
.app #prepare-form { display:flex; gap:16px; align-items:end; flex-wrap:wrap; margin-block:16px; }
@media(min-width:1300px) { .app .content { max-width:1680px; margin-inline:auto; } .app #page-body.calendar-page { max-width:1400px; } }
@media(max-width:700px) { .app .device-banner { padding:12px; } }

/* Mobile workspace: navigation stays at the edges, programs stay in the content. */
.app .mobile-only { display:none; }
.app .icon-button { display:inline-flex; align-items:center; justify-content:center; padding:8px; flex:none; }
.app svg { flex:none; }
.app button:focus-visible,.app summary:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
.app .app-drawer { position:fixed; inset:0 auto 0 0; width:min(340px,calc(100vw - 44px)); max-width:none; height:100vh; height:100dvh; max-height:none; margin:0; padding:8px 12px max(16px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); padding-top:max(8px,env(safe-area-inset-top)); border:0; border-right:1px solid var(--divider); background:var(--surface); color:var(--ink); overflow:auto; overscroll-behavior:contain; }
.app-drawer::backdrop { background:var(--ink); opacity:.4; }
.app .drawer-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-inline-start:12px; }
.app .drawer-user { display:grid; gap:4px; padding:12px; margin-bottom:8px; border-bottom:1px solid var(--divider); overflow-wrap:anywhere; }
.app .drawer-user span { color:var(--secondary); font-size:.875rem; }
.app .app-drawer .nav button { min-height:44px; padding:8px 12px; overflow-wrap:anywhere; text-align:start; }
.app .app-drawer .side-note { display:block; }
body.menu-open { overflow:hidden; }
.app .status-line:empty { margin:0; }
@media(max-width:700px) {
 .app { padding-bottom:calc(var(--mobile-nav-height,76px) + 12px); }
 .app .desktop-only,.app .topbar .desktop-only { display:none; }
 .app .mobile-only { display:inline-flex; }
 .app .topbar,.app:has(.program-card-page) .topbar { display:flex; padding:4px 12px; gap:4px; min-height:52px; padding-top:max(4px,env(safe-area-inset-top)); }
 .app .topbar > .app-title,.app:has(.program-card-page) .topbar > .app-title { display:block; min-width:0; flex:1; font-size:1rem; }
 .app .connection-chip { border:0; background:transparent; border-radius:9px; color:var(--secondary); min-width:44px; min-height:44px; padding:8px; font:inherit; font-size:.75rem; white-space:nowrap; }
 .app .connection-chip[data-attention=true] { color:var(--ink); font-weight:700; }
 .app .device-banner,.app:has(.program-card-page) .device-banner { padding:8px 12px; }
 .app .device-banner span,.app:has(.program-card-page) .device-banner span { font-size:.8125rem; flex:1 1 180px; }
 .app .content,.app:has(.program-card-page) .content { padding:12px; }
 .app #workspace > h1 { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
 .app #reminder-status,.app .device-banner { display:none; }
 .app .mobile-nav { display:flex; height:auto; min-height:56px; padding:4px max(4px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left)); background:var(--surface); border-color:var(--divider); }
 .app .mobile-nav button { position:relative; flex:1; min-width:44px; min-height:48px; gap:2px; padding:3px 2px; border-radius:9px; font:inherit; font-size:.6875rem; color:var(--secondary); }
 .app .mobile-nav:empty { display:none; }
 .app .mobile-nav button svg { width:20px; height:20px; }
 .app .mobile-nav button span { font-size:inherit; }
 .app .mobile-nav button.active { color:var(--accent); background:#e9f5e5; }
 .app .reminder-badge { position:absolute; top:0; right:8px; border-radius:12px; padding:1px 5px; font-size:.6875rem; font-weight:700; color:var(--surface); background:var(--accent); }
 .app .reminder-badge[hidden] { display:none; }
}

.app .topbar .mobile-only { display:none; }
@media(max-width:700px) {
 .app .topbar .mobile-only { display:inline-flex; }
 .app .device-banner[data-quiet=true] { display:none; }
}

.app .mobile-nav button span { max-width:100%; overflow-wrap:anywhere; }

.app .connection-chip { border:0; background:transparent; border-radius:9px; color:var(--secondary); min-width:44px; min-height:44px; padding:8px; font:inherit; font-size:.75rem; }
.app .connection-chip[data-attention=true] { color:var(--ink); font-weight:700; }
.app .device-banner[data-quiet=true] { display:none; }
@media(max-width:700px) {
 .app .app-title .mobile-only { display:block; overflow-wrap:anywhere; }
 .app .connection-chip { max-width:42%; white-space:normal; overflow-wrap:anywhere; }
}

.app .connection-chip { min-width:0; min-height:0; margin-inline-start:auto; padding:4px 8px; }
.app .connection-chip:empty { display:none; }
.app .connection-chip[data-attention=true] { border:1px solid var(--divider); background:#f4f7f4; }
.app .sync-badge { margin-inline-start:8px; padding:2px 6px; border-radius:12px; background:var(--accent); color:var(--surface); font:inherit; font-size:.75rem; }
.app .sync-badge[hidden] { display:none; }
.app .empty-box > p:first-child { margin-top:0; }
