/* NEXUS Home: one operations workspace, gold and parchment in both themes. */
#homeView { background: var(--nx-bg); }
#homeView .home-page {
  --home-paper: var(--nx-surface-solid, #16171a);
  --home-line: var(--nx-border, #c9a96e33);
  max-width: 1180px;
  padding: 24px clamp(16px, 3vw, 32px) calc(180px + env(safe-area-inset-bottom));
  overflow: visible;
}
#homeView .home-continuity-bar { margin: 0; border: 0; padding: 0; }
#homeView #homeFreshness[data-state=warning] { color: var(--nx-gold-ink); }
#homeView .home-greet { margin: 20px 0; }
#homeView .home-greet-line { font-size: clamp(26px, 4vw, 38px); font-weight: 450; letter-spacing: -.035em; margin-bottom: 8px; }
#homeView .home-greet-name { color: var(--nx-gold-ink); }
#homeView .home-intro { max-width: 70ch; font-size: 14px; line-height: 1.6; }
#homeView .home-quick { gap: 10px; margin-bottom: 20px; }
#homeView .home-quick-btn { flex-direction: row; gap: 10px; min-height: 52px; padding: 12px; border: 1px solid var(--home-line); border-radius: 10px; background: var(--home-paper); font-size: 13px; font-weight: 550; box-shadow: none; }
#homeView .home-quick-btn svg { color: var(--nx-gold-ink); flex: none; }
#homeView .home-glance { gap: 10px; margin-bottom: 20px; }
#homeView .home-kpi { align-items: flex-start; min-height: 92px; border-radius: 12px; border: 1px solid var(--home-line); background: var(--home-paper); padding: 16px; gap: 8px; text-align: left; box-shadow: none; }
#homeView .home-kpi-num { font-size: 28px; font-weight: 550; line-height: 1; }
#homeView .home-kpi-num.is-alert { color: var(--nx-red-ink); }
#homeView .home-kpi-label { font-family: var(--nx-font-body); font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--nx-muted); }
#homeView .home-panel { min-width: 0; border: 1px solid var(--home-line); border-radius: 14px; padding: 18px; background: var(--home-paper); margin: 16px 0; }
#homeView .home-panel > .nx-section { margin: 0 0 14px; }
#homeView .home-panel .nx-section-title { font-family: var(--nx-font-body); font-size: 16px; letter-spacing: -.01em; text-transform: none; font-weight: 650; color: var(--nx-text); }
#homeView .home-feed { gap: 10px; }
#homeView .home-item { padding: 14px; border-radius: 10px; box-shadow: none; }
#homeView .home-item-title { font-size: 14px; line-height: 1.5; }
#homeView .home-item-body { font-size: 12px; line-height: 1.6; }
#homeView .home-feed-calm { border-radius: 10px; padding: 22px 16px; min-height: 100px; }
#homeView .home-cal-viewall-row { margin: 14px 0 0; }
#homeView #homeCalView { width: 100%; min-height: 44px; border-radius: 8px; color: var(--nx-gold-ink); }
#homeView .home-vendor-watch[hidden] { display: none; }
#homeView .home-vendor-row { border-radius: 10px; box-shadow: none; }
#homeView .home-vendor-row-call { color: var(--nx-gold-ink); }
#homeView :is(.home-kpi,.home-quick-btn):hover { border-color: var(--nx-gold-ink); transform: none; }
#homeView :is(button,a,input):focus-visible { outline: 2px solid var(--nx-gold-ink); outline-offset: 3px; }
@media(min-width: 1050px) {
  #homeView .home-page { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); column-gap: 22px; align-items: start; }
  #homeView .home-page > * { grid-column: 1 / -1; min-width: 0; }
  #homeView .home-attention { grid-column: 1; }
  #homeView .home-calendar { grid-column: 2; }
  #homeView .home-panel { margin-top: 4px; }
}
@media(max-width: 440px) {
  #homeView .home-page { padding-top: 16px; }
  #homeView .home-panel { padding: 14px; }
  #homeView .home-quick-btn { flex-direction: column; gap: 6px; font-size: 12px; }
  #homeView .home-kpi { min-height: 86px; padding: 14px; }
}
@media(prefers-reduced-motion: reduce) {
  #homeView *, #homeView *::before, #homeView *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}

#homeView .home-page { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
#homeView .home-workspace { min-width: 0; }
@media(min-width:1050px) { #homeView .home-workspace { display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:22px;align-items:start; } }
#homeView .home-panel .home-item { display:grid !important; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
#homeView .home-panel .home-item-num { position:static !important; grid-column:2; grid-row:1; font-size:11px; text-align:right; color:var(--nx-muted); }
#homeView .home-panel .home-item-kicker { grid-column:1; grid-row:1; margin:0; }
#homeView .home-panel :is(.home-item-title,.home-item-body,.home-item-action) { grid-column:1/-1; margin:0; }

/* A readable operations queue, shared with the full Work Orders workspace. */
#homeView .home-rm-wo .nx-section { display:flex; align-items:center; justify-content:space-between; gap:12px; }
#homeView .home-rm-wo-count { color:var(--nx-muted); font:500 12px var(--nx-font-body); letter-spacing:0; white-space:nowrap; }
#homeView .home-rm-wo-list { display:grid; gap:10px; }
#homeView .home-rm-wo-item { display:grid; grid-template-columns:minmax(0,1fr) 20px; align-items:center; gap:12px; width:100%; min-height:112px; padding:14px; border:1px solid var(--home-line); border-radius:10px; background:var(--nx-bg); color:var(--nx-text); text-align:left; box-shadow:none; }
#homeView .home-rm-wo-body { display:grid; min-width:0; gap:7px; }
#homeView .home-rm-wo-topline { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 10px; color:var(--nx-gold-ink); font-size:11px; font-weight:600; }
#homeView .home-rm-wo-title { display:block; font:600 16px/1.45 var(--nx-font-body); white-space:normal; overflow-wrap:anywhere; overflow:visible; text-overflow:clip; -webkit-line-clamp:unset; }
#homeView :is(.home-rm-wo-meta,.home-rm-wo-age) { display:block; position:static; font:400 12px/1.5 var(--nx-font-body); color:var(--nx-text) !important; white-space:normal; }
#homeView .home-rm-wo-chevron { color:var(--nx-gold-ink); font-size:18px; }
#homeView .home-rm-wo-viewall { position:static; width:100%; min-height:44px; margin:12px 0 0; padding:10px; border:1px solid var(--home-line); border-radius:8px; background:transparent; color:var(--nx-gold-ink); font-size:13px; }
#homeView :is(.home-rm-wo-empty,.home-rm-wo-warning) { padding:14px 0; color:var(--nx-muted); font-size:13px; line-height:1.6; }
#homeView .home-rm-wo-warning button { min-height:44px; margin-left:8px; }
#homeView .home-rm-support { margin:4px 0 22px; min-width:0; }
@media(max-width:600px) {
  #homeView .home-glance { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
  #homeView .home-kpi { padding:12px 8px; min-height:80px; gap:7px; }
  #homeView .home-kpi-num { font-size:24px; }
  #homeView .home-kpi-label { font-size:11px; line-height:1.35; overflow-wrap:normal; }
  #homeView .home-greet { margin:14px 0; }
  #homeView .home-quick { margin-bottom:14px; }
}
@media(min-width:1050px) {
  #homeView .home-workspace .home-attention { grid-column:1; }
  #homeView .home-workspace .home-rm-wo { grid-column:2; }
  #homeView .home-workspace .home-calendar { grid-column:1/-1; }
}

/* Shared spacing and card geometry; live updates do not animate whole panels. */
#homeView .home-page { --home-radius:16px; --home-gap:16px; width:100%; margin:0 auto; box-sizing:border-box; display:block; }
#homeView .home-greet { display:grid; grid-template-columns:minmax(0,1fr); align-items:center; gap:8px 12px; margin:0 0 20px; }
#homeView .home-greet-line { margin:0; min-width:0; }
#homeView .home-intro { grid-column:1/-1; margin:0; font-size:14px; line-height:1.6; }
#homeView #homeFreshness { grid-column:1/-1; font-size:12px; line-height:1.5; padding:10px 12px; margin:0; border:1px solid var(--home-line); border-radius:10px; }
#homeView #homeFreshness[hidden] { display:none !important; }
#homeView :is(.home-quick,.home-glance) { gap:10px; margin:0 0 var(--home-gap); }
#homeView .home-quick { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
#homeView :is(.home-quick-btn,.home-kpi) { border-radius:12px; min-width:0; font-family:var(--nx-font-body,system-ui); }
#homeView .home-workspace { display:grid; grid-template-columns:minmax(0,1fr); gap:var(--home-gap); margin-bottom:var(--home-gap); }
#homeView .home-panel { margin:0; padding:18px; border-radius:var(--home-radius); width:100%; box-sizing:border-box; }
#homeView :is(.home-feed,.home-rm-wo-list) { display:grid; gap:10px; }
#homeView :is(.home-item,.home-rm-wo-item,.home-vendor-row) { min-height:0; margin:0; padding:14px; border:1px solid var(--home-line); border-radius:12px; background:var(--nx-bg); box-shadow:none; }
#homeView :is(.home-item-title,.home-rm-wo-title) { font:600 15px/1.5 var(--nx-font-body,system-ui); letter-spacing:0; color:var(--nx-text-strong); }
#homeView :is(.home-item-body,.home-rm-wo-meta,.home-rm-wo-age) { font:400 12px/1.6 var(--nx-font-body,system-ui); color:var(--nx-text); }
#homeView .home-rm-wo-topline { justify-content:flex-start; gap:6px 12px; }
#homeView :is(.home-rm-wo-viewall,#homeCalView) { margin-top:14px; min-height:44px; padding:10px 12px; border:1px solid var(--home-line); border-radius:10px; font:500 13px/1.4 var(--nx-font-body,system-ui); background:transparent; }
#homeView .home-rm-support { display:grid; gap:var(--home-gap); margin:0 0 var(--home-gap); }
#homeView :is(.home-rm-tiles,.home-rm-decisions,.home-rm-wins) { margin:0; min-width:0; }
#homeView .home-rm-tiles { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
#homeView .home-rm-tile { min-width:0; min-height:86px; border:1px solid var(--home-line); border-radius:12px; padding:14px; background:var(--home-paper); box-shadow:none; }
#homeView .home-rm-tiles .home-rm-tile-num { font-size:28px !important; font-weight:550; }
#homeView .home-rm-tile-lbl { font:400 12px/1.5 var(--nx-font-body,system-ui); letter-spacing:0; text-transform:none; }
#homeView .home-rm-tile.is-hero { gap:12px !important; border-color:var(--home-line); }
#homeView .home-rm-tile.is-hero>div:nth-child(2)>div:first-child { font-size:15px !important; }
#homeView :is(.home-rm-decision,.home-rm-wins) { border:1px solid var(--home-line); border-radius:var(--home-radius); background:var(--home-paper); box-shadow:none; }
#homeView .home-rm-wins { padding:16px; }
#homeView :is(.home-rm-decisions-head,.home-rm-wins-head) { font:600 13px/1.5 var(--nx-font-body,system-ui); letter-spacing:0; }
#homeView :is(.home-panel,.home-item,.home-kpi,.home-rm-wo-item) { animation:none; }
#homeView :is(button,a) { touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
@media(min-width:900px) {
  #homeView .home-workspace { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; }
  #homeView .home-workspace .home-attention { grid-column:1; }
  #homeView .home-workspace .home-rm-wo { grid-column:2; }
  #homeView .home-workspace .home-calendar { grid-column:1/-1; }
}
@media(max-width:600px) {
  #homeView .home-page { padding:16px 14px calc(100px + env(safe-area-inset-bottom)); --home-gap:14px; }
  #homeView .home-panel { padding:14px; }
  #homeView .home-quick-btn { flex-direction:column; min-height:62px; padding:10px 6px; font-size:12px; }
}
@media(max-width:370px) {
  #homeView .home-glance { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #homeView .home-kpi { min-height:72px; }
}

/* One date column and one event list; no empty day cards or nested card stacks. */
#homeView .home-agenda { display:grid; gap:0; }
#homeView .home-agenda-day { display:grid; grid-template-columns:46px minmax(0,1fr); align-items:start; gap:12px; padding:16px 0; border-top:1px solid var(--home-line); }
#homeView .home-agenda-day:first-child { padding-top:2px; border-top:0; }
#homeView .home-agenda-date { display:grid; justify-items:center; gap:2px; padding:10px 2px; border-radius:10px; background:var(--nx-gold-faint); color:var(--nx-gold-ink); font:500 11px/1.3 var(--nx-font-body,system-ui); }
#homeView .home-agenda-date strong { font-size:25px; font-weight:550; line-height:1.1; font-variant-numeric:tabular-nums; }
#homeView .home-agenda-date.is-today { background:var(--nx-gold-fill); color:var(--nx-gold-on,#2a1f10); }
#homeView .home-agenda-entries { min-width:0; display:grid; gap:4px; }
#homeView .home-agenda-entry { display:grid; grid-template-columns:minmax(0,1fr) 12px; align-items:center; gap:8px; width:100%; min-width:0; min-height:60px; padding:10px 8px; margin:0; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--nx-text); text-align:left; box-shadow:none; transform:none; transition:background-color .15s,border-color .15s; }
#homeView .home-agenda-entry+.home-agenda-entry { border-top-color:var(--home-line); }
#homeView .home-agenda-content { display:grid; gap:5px; min-width:0; }
#homeView .home-agenda-title { font:600 15px/1.45 var(--nx-font-body,system-ui); letter-spacing:0; color:var(--nx-text-strong); white-space:normal; overflow-wrap:anywhere; }
#homeView :is(.home-agenda-meta,.home-agenda-description) { font:400 12px/1.6 var(--nx-font-body,system-ui); letter-spacing:0; color:var(--nx-muted); white-space:normal; overflow-wrap:anywhere; }
#homeView .home-agenda-next { justify-self:start; padding:2px 6px; border-radius:5px; background:var(--nx-gold-faint); color:var(--nx-gold-ink); font:600 10px/1.5 var(--nx-font-body,system-ui); }
#homeView .home-agenda-arrow { color:var(--nx-gold-ink); font:400 22px/1 system-ui; }
#homeView .home-agenda-entry:active { background:var(--nx-surface-2); }
#homeView :is(.home-agenda-empty,.home-agenda-more) { margin:0; padding:12px 0; font:400 13px/1.6 var(--nx-font-body,system-ui); color:var(--nx-muted); }
#homeView .home-agenda-followup { margin-top:4px; border-top:1px solid var(--home-line); }
#homeView .home-agenda-followup summary { min-height:44px; padding:12px 0; color:var(--nx-gold-ink); font:500 13px/1.5 var(--nx-font-body,system-ui); cursor:pointer; }
#homeView .home-agenda-followup summary span { margin-left:6px; font-variant-numeric:tabular-nums; }
#homeView .home-agenda-followup>p { margin:0 0 12px; color:var(--nx-muted); font:400 12px/1.5 var(--nx-font-body,system-ui); }
#homeView .home-cal-viewall-row { margin:0; }
#homeView #homeCalView { margin-top:8px; }
/* Keep the button outside the scrolling page's animation/height-reservation wrapper. */
#homeView .home-assistant { position:fixed; left:max(14px,env(safe-area-inset-left)); bottom:calc(var(--nx-bottom-nav-h,65px) + 16px + env(safe-area-inset-bottom)); z-index:96; display:grid; place-items:center; width:48px; height:48px; min-width:48px; min-height:48px; padding:12px; margin:0; border:1px solid var(--nx-gold-line-2); border-radius:50%; background:var(--nx-surface-solid,#16171a); color:var(--nx-gold-ink); box-shadow:0 3px 12px #0002; cursor:pointer; animation:none; transform:none; transition:background-color .15s; }
#homeView .home-assistant svg { width:23px; height:23px; }
#homeView .home-assistant:active { background:var(--nx-surface-2); }
#homeView .home-assistant[aria-busy=true] { opacity:.65; cursor:progress; }
#homeView .home-assistant-label { position:absolute; left:calc(100% + 8px); white-space:nowrap; padding:6px 10px; border:1px solid var(--nx-border); border-radius:8px; background:var(--nx-surface-solid,#16171a); color:var(--nx-text); font:500 12px/1.5 var(--nx-font-body,system-ui); opacity:0; pointer-events:none; }
#homeView .home-assistant:focus-visible .home-assistant-label { opacity:1; }
#homeView .home-page { padding-bottom:calc(var(--nx-bottom-nav-h,65px) + 88px + env(safe-area-inset-bottom)) !important; }
@media(hover:hover) {
  #homeView .home-agenda-entry:hover { background:var(--nx-surface-2); border-color:var(--home-line); }
  #homeView .home-assistant:hover .home-assistant-label { opacity:1; }
}
@media(min-width:900px) {
  #homeView .home-agenda-day { grid-template-columns:54px minmax(0,1fr); gap:18px; }
  #homeView .home-assistant { left:256px; bottom:24px; }
}
