/* === agent b4: Sunny as a chief of staff ===
   The floating Sunny dot (.sun-dot), the Today / Ask / Tasks switch in the Sunny panel (.sun-seg), Today (.sun-today),
   Tasks (.sun-tasks) and the one-line record brief (.sun-line). Everything here is scoped to .sun-* and .sn-panel. */

/* ---- the dot: realistic Sunny, bottom-right, above bottom bars, a quiet living glow */
.sun-dot { --sun-base: 16px; --sun-x: 0px; position: fixed; z-index: calc(var(--z-panel, 50) - 1); right: max(16px, calc(env(safe-area-inset-right, 0px) + 12px));
  bottom: calc(var(--sun-base) + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: inherit;
  background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / .95), rgb(255 247 226 / .9) 55%, rgb(252 181 55 / .28));
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgb(252 181 55 / .45), 0 6px 16px rgb(var(--sg-blue-rgb) / .18), 0 16px 34px rgb(var(--sg-blue-rgb) / .14);
  translate: var(--sun-x) calc(var(--sun-lift, 0px) * -1); transition: translate .42s cubic-bezier(.22, 1, .36, 1), opacity .2s ease, scale .1s var(--ease-out); -webkit-tap-highlight-color: transparent; }
.sun-dot .sunny-mark { position: relative; z-index: 1; }
.sun-dot:hover { box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgb(252 181 55 / .75), 0 8px 20px rgb(var(--sg-blue-rgb) / .22), 0 18px 40px rgb(var(--sg-blue-rgb) / .16); }
.sun-dot:active { scale: .93; }
.sun-dot:focus-visible { outline: 3px solid var(--sg-gold); outline-offset: 3px; }
.sun-dot.hide { opacity: 0; scale: .7; pointer-events: none; }
.sun-glow { position: absolute; inset: -7px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgb(252 181 55 / .42) 0%, rgb(252 181 55 / .14) 48%, rgb(252 181 55 / 0) 70%); animation: sun-breathe 5.2s ease-in-out infinite; }
@keyframes sun-breathe { 0%, 100% { opacity: .45; transform: scale(.94); } 50% { opacity: .9; transform: scale(1.06); } }
.sun-count { position: absolute; z-index: 2; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: #fff; background: var(--sg-blue); box-shadow: 0 0 0 2px #fff, 0 2px 6px rgb(var(--sg-blue-rgb) / .35); }
/* full-screen boards (dispatch, service board): tucked into the right edge, slides out on hover or keyboard focus */
.sun-dot.edge { --sun-x: 28px; width: 46px; height: 46px; right: 0; }
.sun-dot.edge .sun-glow { display: none; }
.sun-dot.edge .sun-count { right: auto; left: -4px; }
.sun-dot.edge:hover, .sun-dot.edge:focus-visible { --sun-x: -10px; }
@media (max-width: 700px) {
  .sun-dot { --sun-base: 14px; width: 52px; height: 52px; }
  .sun-dot.edge { --sun-x: 30px; width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .sun-dot { transition: opacity .15s ease; }
  .sun-glow { animation: none; opacity: .6; }
  /* the realistic Sunny holds still everywhere (x-a.css's own rule loses to its .live .sm-rays rule on specificity) */
  .sunny-mark.live .sm-rays, .sunny-mark.live .sm-face { animation: none; }
}
@media (prefers-reduced-transparency: reduce) { .sun-dot { background: #FFF7E2; } }
@media (prefers-contrast: more) { .sun-dot { box-shadow: 0 0 0 2px var(--sg-blue); } }
@media print { .sun-dot { display: none; } }

/* ---- the panel: Today / Ask / Tasks */
.sun-seg { display: flex; gap: 4px; margin: 10px 14px 0 20px; padding: 4px; border-radius: var(--r-pill); background: rgb(var(--sg-blue-rgb) / .06); box-shadow: inset 0 0 0 1px rgb(var(--sg-blue-rgb) / .05); flex: none; }
.sun-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; border: 0; border-radius: var(--r-pill); background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s, transform var(--press-ms, 100ms) var(--ease-out); }
.sun-seg button:hover { color: var(--ink); }
.sun-seg button:active { transform: scale(.97); }
.sun-seg button.on { background: #fff; color: var(--sg-blue); box-shadow: 0 1px 2px rgb(var(--sg-blue-rgb) / .12), 0 3px 8px rgb(var(--sg-blue-rgb) / .08); }
.sun-seg button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.sun-seg .ico { color: currentColor; }
.sun-n { font-style: normal; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--sg-blue); color: #fff; font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }

/* skeletons and states */
.sun-skel { height: 14px; border-radius: 7px; margin: 6px 0; background: linear-gradient(90deg, rgb(var(--sg-blue-rgb) / .06), rgb(var(--sg-blue-rgb) / .11), rgb(var(--sg-blue-rgb) / .06)); background-size: 200% 100%; animation: sun-shim 1.3s linear infinite; }
.sun-skel.w60 { width: 60%; } .sun-skel.w70 { width: 70%; } .sun-skel.w80 { width: 80%; } .sun-skel.w90 { width: 90%; }
@keyframes sun-shim { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sun-skel { animation: none; } }
.sun-err { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; font-size: 13px; color: var(--bad, #b42318); }
.sun-quiet { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--muted); }
.sun-quiet .ico { color: #0F8A6B; flex: none; }

/* ---- Today */
.sun-today { display: flex; flex-direction: column; gap: 14px; }
.sun-hi h2 { margin: 2px 0 6px; font-size: 21px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; color: var(--ink); }
.sun-lead { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); letter-spacing: -.005em; }
.sun-modeline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 8px; }
.sun-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; color: var(--muted); background: rgb(var(--sg-blue-rgb) / .06); }
.sun-chip.ai { color: var(--sg-blue); background: rgb(var(--sg-blue-rgb) / .09); }
.sun-note { font-size: 11.5px; color: var(--muted); }
.sun-g h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 2px 6px; font-size: 12.5px; font-weight: 650; letter-spacing: .005em; color: var(--muted); }
.sun-g h3 b { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sun-g ul, .sun-lines ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sun-row { width: 100%; display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px 9px 11px; border: 0; border-radius: 13px; cursor: pointer; text-align: left;
  font-size: 13.5px; line-height: 1.4; color: var(--ink-2); background: rgb(255 255 255 / .72); box-shadow: inset 0 0 0 1px rgb(var(--sg-blue-rgb) / .07); transition: background .15s, transform var(--press-ms, 100ms) var(--ease-out); }
.sun-row > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sun-row > .ico:first-child { color: var(--sg-blue-lift); margin-top: 2px; flex: none; }
.sun-row > .ico:last-child { color: var(--faint); margin-top: 2px; flex: none; }
.sun-row:hover:not(:disabled) { background: #fff; }
.sun-row:active:not(:disabled) { transform: scale(.985); }
.sun-row:disabled { cursor: default; }
.sun-row:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--sg-blue-lift), 0 0 0 3px var(--focus-ring); }
.sun-g[aria-label="Needs you today"] .sun-row > .ico:first-child, .sun-g[aria-label="Past due"] .sun-row > .ico:first-child { color: #B54708; }
.sun-more-n { margin: 4px 4px 0; font-size: 12px; color: var(--muted); }
.sun-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 4px; font-size: 11.5px; color: var(--faint); }
.sun-foot > span { flex: 1 1 100%; }

/* ---- Tasks */
.sun-tasks { display: flex; flex-direction: column; gap: 14px; }
.sun-new { display: flex; flex-direction: column; gap: 8px; }
.sun-new-h { font-size: 15px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); margin: 2px 2px 0; }
.sun-tpl { display: flex; flex-wrap: wrap; gap: 6px; }
.sun-tpl .sx-p { text-align: left; }
.sun-new .sn-fine { margin: 0 2px; }
.sun-pick { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 16px; background: rgb(255 255 255 / .8); box-shadow: inset 0 0 0 1px var(--line-2); }
.sun-pick input { border-radius: 12px; }
.sun-pick .sn-chip { align-self: flex-start; }
.sun-tlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sun-task { border-radius: 18px; background: rgb(255 255 255 / .82); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgb(var(--sg-blue-rgb) / .07), 0 2px 6px rgb(var(--sg-blue-rgb) / .05); }
.sun-task-h { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 0; background: transparent; cursor: pointer; text-align: left; border-radius: 18px; color: var(--ink); }
.sun-task-h:active { transform: scale(.99); }
.sun-task-h:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.sun-task-h > .ico { color: var(--faint); flex: none; }
.sun-task-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sun-task-t b { font-size: 13.5px; font-weight: 600; letter-spacing: -.005em; line-height: 1.3; overflow-wrap: anywhere; }
.sun-task-t small { font-size: 11.5px; color: var(--muted); }
.sun-st { width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center; color: var(--muted); background: rgb(var(--sg-blue-rgb) / .06); }
.sun-task[data-status="working"] .sun-st { color: var(--sg-blue-lift); background: rgb(var(--sg-blue-rgb) / .09); }
.sun-task[data-status="working"] .sun-st .ico { animation: sun-spin 1.4s linear infinite; }
@keyframes sun-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sun-task[data-status="working"] .sun-st .ico { animation: none; } }
.sun-task[data-status="review"] .sun-st { color: #fff; background: linear-gradient(145deg, var(--sg-blue-lift), var(--sg-blue)); }
.sun-task[data-status="done"] .sun-st { color: #0F8A6B; background: rgb(15 138 107 / .1); }
.sun-task[data-status="failed"] .sun-st { color: #B42318; background: rgb(180 35 24 / .09); }
.sun-task[data-status="waiting"] .sun-st { color: #8A4B00; background: rgb(var(--sg-gold-rgb) / .18); }
.sun-task[data-status="done"] .sun-task-t b { color: var(--muted); font-weight: 500; }
.sun-task-b { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; }
.sun-sum { display: flex; flex-direction: column; gap: 6px; }
.sun-sum .sun-lead { font-size: 14px; }
.sun-note-box { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding: 8px 10px; border-radius: 12px; font-size: 12.5px; color: #6B3C00; background: rgb(var(--sg-gold-rgb) / .14); }
.sun-lines summary, .sun-hist summary, .sun-more summary, .sun-ideas summary { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; list-style: none; font-size: 12px; font-weight: 600; color: var(--sg-blue-lift); padding: 4px 2px; border-radius: 8px; }
.sun-lines summary::-webkit-details-marker, .sun-hist summary::-webkit-details-marker, .sun-more summary::-webkit-details-marker, .sun-ideas summary::-webkit-details-marker { display: none; }
.sun-ideas[open] summary .ico { transform: rotate(180deg); }
.sun-ideas .sun-tpl { margin-top: 6px; }
.sun-lines summary:focus-visible, .sun-hist summary:focus-visible, .sun-more summary:focus-visible, .sun-ideas summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.sun-lines ul { margin-top: 6px; }
.sun-lines .sun-row { font-size: 12.5px; padding: 7px 9px; }
.sun-hist ol { margin: 6px 0 0; padding-left: 1.1em; font-size: 12px; color: var(--muted); line-height: 1.5; }
.sun-hist time { font-variant-numeric: tabular-nums; color: var(--faint); margin-right: 4px; }
.sun-task-a { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sun-task-a:empty { display: none; }
.sun-prop { animation: none; }

/* ---- the record you are on: one line, two prompts, the rest folded */
.sn-panel .sun-line { margin: -2px 2px 0; font-size: 14px; line-height: 1.4; color: var(--ink-2); letter-spacing: -.005em; }
.sn-panel .sun-top .sx-p { flex-direction: row; flex-wrap: wrap; }
.sn-panel .sun-top .sx-p small { flex-basis: 100%; padding-left: 19px; margin-top: -2px; font-size: 11px; color: var(--muted); text-align: left; }
.sn-panel .sun-more[open] summary .ico { transform: rotate(180deg); }
.sn-panel .sun-more .sx-prompts { margin-top: 6px; }

@media (max-width: 700px) {
  .sun-seg { margin: 8px 12px 0 16px; }
  .sun-row { font-size: 14px; }
}
/* === end agent b4 === */
