/* SHUBHI v1.04 — Shubh Ventures Intelligence */

/* ---------------------------------------------------------------- living glow v1.04 (Siri-style, GPU-only)
   Four soft light bands hug the edges. Colours flow via a transform animation on a small pre-rendered gradient
   (no canvas, no blur filter, no repaint per frame); the band depth follows the voice level from JS (transform). */
#shubhi-ring { position: fixed; inset: 0; z-index: 2147483600; pointer-events: none; opacity: 0; transition: opacity .5s ease; contain: strict; }
#shubhi-ring.on { opacity: 1; }
#shubhi-ring .e { position: absolute; overflow: hidden; will-change: transform; transition: transform .09s linear; }
#shubhi-ring .e.t { left: 0; right: 0; top: 0; height: 110px; transform-origin: 50% 0; -webkit-mask: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 22%, rgba(0,0,0,.18) 55%, transparent 100%); mask: linear-gradient(180deg, #000 0%, rgba(0,0,0,.55) 22%, rgba(0,0,0,.18) 55%, transparent 100%); }
#shubhi-ring .e.b { left: 0; right: 0; bottom: 0; height: 110px; transform-origin: 50% 100%; -webkit-mask: linear-gradient(0deg, #000 0%, rgba(0,0,0,.55) 22%, rgba(0,0,0,.18) 55%, transparent 100%); mask: linear-gradient(0deg, #000 0%, rgba(0,0,0,.55) 22%, rgba(0,0,0,.18) 55%, transparent 100%); }
#shubhi-ring .e.l { top: 0; bottom: 0; left: 0; width: 110px; transform-origin: 0 50%; -webkit-mask: linear-gradient(90deg, #000 0%, rgba(0,0,0,.55) 22%, rgba(0,0,0,.18) 55%, transparent 100%); mask: linear-gradient(90deg, #000 0%, rgba(0,0,0,.55) 22%, rgba(0,0,0,.18) 55%, transparent 100%); }
#shubhi-ring .e.r { top: 0; bottom: 0; right: 0; width: 110px; transform-origin: 100% 50%; -webkit-mask: linear-gradient(270deg, #000 0%, rgba(0,0,0,.55) 22%, rgba(0,0,0,.18) 55%, transparent 100%); mask: linear-gradient(270deg, #000 0%, rgba(0,0,0,.55) 22%, rgba(0,0,0,.18) 55%, transparent 100%); }
/* the moving colour field: a 300%-wide seamless gradient that slides (translate only) */
#shubhi-ring .e i { position: absolute; top: 0; left: 0; height: 100%; width: 300%; will-change: transform;
  background: linear-gradient(90deg, #22d3ee 0%, #6366f1 11%, #a855f7 22%, #ec4899 33%, #fb923c 44%, #22d3ee 55%, #8b5cf6 66%, #f472b6 77%, #38bdf8 88%, #22d3ee 100%);
  animation: sh-flow 9s linear infinite; }
#shubhi-ring .e.l i, #shubhi-ring .e.r i { width: 100%; height: 300%; background: linear-gradient(180deg, #22d3ee 0%, #6366f1 11%, #a855f7 22%, #ec4899 33%, #fb923c 44%, #22d3ee 55%, #8b5cf6 66%, #f472b6 77%, #38bdf8 88%, #22d3ee 100%); animation-name: sh-flow-v; }
#shubhi-ring .e.b i { animation-direction: reverse; }
#shubhi-ring .e.l i { animation-direction: reverse; }
@keyframes sh-flow { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-66.666%, 0, 0); } }
@keyframes sh-flow-v { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, -66.666%, 0); } }
#shubhi-ring[data-s="working"] .e i { animation-duration: 3.5s; }
#shubhi-ring[data-s="speaking"] .e i { animation-duration: 6s; }
#shubhi-ring:not(.on) .e i { animation-play-state: paused; }
html.dark #shubhi-ring .e, html.theme-dark #shubhi-ring .e, html[data-theme="dark"] #shubhi-ring .e { opacity: .9; }
@media (prefers-reduced-motion: reduce) { #shubhi-ring .e i { animation: none; } }

/* ---------------------------------------------------------------- aurora sphere */
.sh-sphere { position: relative; display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; isolation: isolate;
  background: radial-gradient(circle at 50% 55%, #1e1b4b 0%, #0b1024 70%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.sh-sphere i { position: absolute; display: block; border-radius: 50%; mix-blend-mode: screen; filter: blur(6px); }
.sh-sphere .b1 { width: 80%; height: 80%; left: -12%; top: -8%; background: radial-gradient(circle, #22d3ee 0%, rgba(34, 211, 238, 0) 68%); animation: sh-orbit 7s linear infinite; }
.sh-sphere .b2 { width: 85%; height: 85%; right: -18%; top: 10%; background: radial-gradient(circle, #a855f7 0%, rgba(168, 85, 247, 0) 68%); animation: sh-orbit 9s linear infinite reverse; }
.sh-sphere .b3 { width: 75%; height: 75%; left: 12%; bottom: -22%; background: radial-gradient(circle, #ec4899 0%, rgba(236, 72, 153, 0) 68%); animation: sh-orbit 11s linear infinite; }
.sh-sphere .core { width: 34%; height: 34%; left: 33%; top: 33%; background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 70%); filter: blur(3px); opacity: .55; animation: sh-core 3.4s ease-in-out infinite; }
.sh-sphere .gloss { inset: 0; width: auto; height: auto; filter: none; mix-blend-mode: normal; background: radial-gradient(ellipse 60% 38% at 38% 18%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 70%); }
@keyframes sh-orbit { 0% { transform: rotate(0deg) translateX(8%) rotate(0deg); } 100% { transform: rotate(360deg) translateX(8%) rotate(-360deg); } }
@keyframes sh-core { 0%, 100% { transform: scale(.85); opacity: .45; } 50% { transform: scale(1.15); opacity: .8; } }
html[data-shubhi="listening"] .sh-sphere i:not(.gloss) { animation-duration: 2.2s; }
html[data-shubhi="listening"] .sh-sphere .core { opacity: .95; animation-duration: .9s; }
html[data-shubhi="working"] .sh-sphere .b1, html[data-shubhi="working"] .sh-sphere .b2, html[data-shubhi="working"] .sh-sphere .b3 { animation-duration: 1.2s; }
html[data-shubhi="speaking"] .sh-sphere .core { animation-duration: .55s; opacity: .9; }

/* ---------------------------------------------------------------- launcher orb */
#shubhi-orb { --lv: var(--sh-lv, 0); position: fixed; right: 22px; bottom: 22px; z-index: 2147483000; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: transparent;
  transform: scale(calc(1 + var(--lv) * .16)); transition: transform .12s linear, box-shadow .25s;
  box-shadow: 0 10px 28px -8px rgba(99, 102, 241, .55), 0 0 calc(var(--lv) * 46px) calc(var(--lv) * 8px) rgba(168, 85, 247, .55), 0 2px 6px rgba(15, 23, 42, .18); }
#shubhi-orb:hover { box-shadow: 0 16px 36px -8px rgba(99, 102, 241, .65), 0 2px 6px rgba(15, 23, 42, .2); }
#shubhi-orb:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 3px; }
#shubhi-orb .sh-orb-mic { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; pointer-events: none; }
#shubhi-orb .sh-orb-mic svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
#shubhi-orb .sh-dot { position: absolute; right: 3px; top: 3px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; opacity: 0; transition: opacity .2s; }
html.shubhi-wake #shubhi-orb .sh-dot { opacity: 1; }
#shubhi-orb .sh-sphere, .sh-head .sh-sphere { background: radial-gradient(circle at 50% 60%, #4f46e5 0%, #1e1b4b 80%); }
#shubhi-orb .sh-sphere i:not(.gloss):not(.core) { filter: blur(4px) saturate(1.4); }
.sh-head .sh-sphere.sm { transform: scale(calc(1 + var(--sh-lv, 0) * .22)); transition: transform .1s linear; }

/* ---------------------------------------------------------------- panel (light, frosted) */
#shubhi-panel {
  --p-bg: rgba(255, 255, 255, .86); --p-bd: rgba(15, 23, 42, .08); --p-tx: #0f172a; --p-mut: #64748b; --p-soft: #f1f5f9; --p-soft2: #f8fafc;
  --p-acc: #6d28d9; --p-acc2: #4f46e5; --p-chip: rgba(99, 102, 241, .08); --p-chipbd: rgba(99, 102, 241, .18); --p-chiptx: #4338ca; --p-card: #fff;
  position: fixed; right: 22px; bottom: 94px; z-index: 2147483001; width: 420px; max-width: calc(100vw - 24px); height: min(640px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; color: var(--p-tx);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--p-bg); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--p-bd); box-shadow: 0 30px 70px -24px rgba(30, 27, 75, .35), 0 8px 24px -12px rgba(15, 23, 42, .18);
  opacity: 0; transform: translateY(14px) scale(.98); transform-origin: bottom right; pointer-events: none;
  transition: opacity .22s ease, transform .28s cubic-bezier(.2, .8, .2, 1); }
html.dark #shubhi-panel, html[data-theme="dark"] #shubhi-panel, html.theme-dark #shubhi-panel {
  --p-bg: rgba(30, 33, 48, .88); --p-bd: rgba(255, 255, 255, .09); --p-tx: #eef2ff; --p-mut: #9aa4bf; --p-soft: rgba(255, 255, 255, .06); --p-soft2: rgba(255, 255, 255, .04);
  --p-acc: #c4b5fd; --p-acc2: #a5b4fc; --p-chip: rgba(129, 140, 248, .12); --p-chipbd: rgba(165, 180, 252, .22); --p-chiptx: #c7d2fe; --p-card: rgba(255, 255, 255, .05);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .6), 0 0 0 1px rgba(139, 92, 246, .12); }
#shubhi-panel.open { opacity: 1; transform: none; pointer-events: auto; }
#shubhi-panel .sh-aurora { position: absolute; inset: -30% -20% auto -20%; height: 230px; z-index: 0; pointer-events: none; opacity: calc(.28 + var(--sh-lv, 0) * .5); transition: opacity .15s linear;
  background: radial-gradient(40% 60% at 22% 60%, rgba(34, 211, 238, .45), transparent 70%), radial-gradient(40% 60% at 55% 50%, rgba(139, 92, 246, .45), transparent 70%), radial-gradient(35% 55% at 85% 60%, rgba(236, 72, 153, .4), transparent 70%); filter: blur(26px); }
#shubhi-panel > * { position: relative; z-index: 1; }
.sh-head { display: flex; align-items: center; gap: 11px; padding: 14px 12px 8px 16px; }
.sh-head .sh-sphere.sm { width: 36px; height: 36px; flex: none; }
.sh-title { flex: 1; min-width: 0; line-height: 1.15; }
.sh-title b { display: block; font-size: 15.5px; font-weight: 800; letter-spacing: .16em;
  background: linear-gradient(90deg, #0891b2, #6d28d9 50%, #db2777); -webkit-background-clip: text; background-clip: text; color: transparent; }
html.dark .sh-title b, html[data-theme="dark"] .sh-title b, html.theme-dark .sh-title b { background: linear-gradient(90deg, #67e8f9, #c4b5fd 50%, #f9a8d4); -webkit-background-clip: text; background-clip: text; }
.sh-title small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--p-mut); }
.sh-state { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--p-mut); background: var(--p-soft); border: 1px solid var(--p-bd); }
.sh-state em { font-style: normal; }
.sh-state i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
html[data-shubhi="listening"] .sh-state i { background: #06b6d4; box-shadow: 0 0 0 3px rgba(6, 182, 212, .22); animation: sh-blink 1s infinite; }
html[data-shubhi="working"] .sh-state i { background: #8b5cf6; animation: sh-blink .5s infinite; }
html[data-shubhi="speaking"] .sh-state i { background: #ec4899; animation: sh-blink .8s infinite; }
@keyframes sh-blink { 50% { opacity: .35; } }
.sh-ic { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--p-mut); cursor: pointer; transition: background .15s, color .15s; }
.sh-ic:hover { background: var(--p-soft); color: var(--p-tx); }
.sh-ic svg { width: 16px; height: 16px; }

.sh-viz { position: relative; height: 44px; margin: 0 14px; }
.sh-viz canvas { width: 100%; height: 44px; display: block; }
.sh-live { position: absolute; inset: auto 0 0 0; text-align: center; font-size: 12px; color: var(--p-acc2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }

.sh-log { flex: 1; overflow-y: auto; padding: 8px 14px 6px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, .3) transparent; }
.sh-msg { max-width: 88%; padding: 9px 13px; border-radius: 18px; font-size: 13.5px; line-height: 1.5; word-wrap: break-word; animation: sh-in .22s ease both; }
.sh-msg.j { align-self: flex-start; background: var(--p-soft); border: 1px solid var(--p-bd); border-bottom-left-radius: 6px; color: var(--p-tx); }
.sh-msg.u { align-self: flex-end; background: linear-gradient(135deg, #4f46e5, #7c3aed 60%, #a855f7); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 8px 18px -10px rgba(124, 58, 237, .8); }
.sh-msg.u.sub { opacity: .8; font-size: 12.5px; }
.sh-msg.sys { align-self: center; max-width: 100%; padding: 4px 10px; font-size: 11.5px; color: var(--p-mut); background: transparent; }
@keyframes sh-in { from { opacity: 0; transform: translateY(6px); } }
.sh-card { align-self: stretch; padding: 10px 12px; border-radius: 16px; background: var(--p-card); border: 1px solid var(--p-bd); box-shadow: 0 6px 18px -14px rgba(15, 23, 42, .35); animation: sh-in .22s ease both; }
.sh-card h4 { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--p-acc); }
.sh-card table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sh-card td { padding: 4px 0; border-top: 1px solid var(--p-bd); vertical-align: top; }
.sh-card tr:first-child td { border-top: 0; }
.sh-card td:first-child { color: var(--p-mut); padding-right: 10px; white-space: nowrap; }
.sh-card td:last-child { color: var(--p-tx); text-align: right; font-variant-numeric: tabular-nums; }
.sh-card td.miss { color: #d97706; }
.sh-card table.help td:last-child { text-align: left; }
.sh-card table.help td:first-child { color: var(--p-acc); font-weight: 600; }
.sh-card p { margin: 0; font-size: 12.5px; }
.sh-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.sh-row-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; margin: 0; border: 0; border-radius: 10px; background: transparent; color: var(--p-tx); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.sh-row-btn:hover { background: var(--p-soft); }
.sh-row-btn .n { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 6px; background: rgba(139, 92, 246, .14); color: var(--p-acc); font-size: 10.5px; font-weight: 700; flex: none; }
.sh-row-btn b { font-weight: 600; }
.sh-row-btn .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--p-mut); }
.sh-row-btn .amt { font-variant-numeric: tabular-nums; color: #059669; font-weight: 600; }
html.dark .sh-row-btn .amt, html[data-theme="dark"] .sh-row-btn .amt, html.theme-dark .sh-row-btn .amt { color: #6ee7b7; }

.sh-chips { display: flex; gap: 6px; padding: 6px 14px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.sh-chips::-webkit-scrollbar { display: none; }
.sh-chip { flex: none; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--p-chipbd); background: var(--p-chip); color: var(--p-chiptx); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s; }
.sh-chip:hover { background: rgba(99, 102, 241, .16); transform: translateY(-1px); }

.sh-bar { display: flex; align-items: center; gap: 8px; margin: 0 12px; padding: 6px; border-radius: 18px; background: var(--p-card); border: 1px solid var(--p-bd); box-shadow: 0 4px 14px -10px rgba(15, 23, 42, .3); transition: border-color .15s, box-shadow .15s; }
.sh-bar:focus-within { border-color: rgba(124, 58, 237, .5); box-shadow: 0 0 0 4px rgba(124, 58, 237, .12); }
.sh-bar input { flex: 1; min-width: 0; height: 36px; border: 0; outline: 0; background: transparent; color: var(--p-tx); font: inherit; font-size: 13.5px; padding: 0 4px; box-shadow: none !important; }
.sh-bar input::placeholder { color: var(--p-mut); }
.sh-mic, .sh-send { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 13px; cursor: pointer; color: #fff; transition: transform .15s, filter .15s; }
.sh-mic { background: linear-gradient(135deg, #06b6d4, #6366f1 55%, #a855f7); box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .7); }
.sh-mic.on { background: linear-gradient(135deg, #ec4899, #8b5cf6); box-shadow: 0 0 0 calc(3px + var(--sh-lv, 0) * 9px) rgba(236, 72, 153, .22); }
.sh-send { background: var(--p-soft); color: var(--p-mut); }
.sh-mic:hover, .sh-send:hover { transform: translateY(-1px); filter: brightness(1.05); }
.sh-mic svg, .sh-send svg { width: 18px; height: 18px; }

.sh-foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px 12px; font-size: 11.5px; color: var(--p-mut); flex-wrap: wrap; }
.sh-sw { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.sh-sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sh-sw span { position: relative; width: 28px; height: 16px; border-radius: 999px; background: rgba(148, 163, 184, .45); transition: background .2s; }
.sh-sw span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s; }
.sh-sw input:checked + span { background: #7c3aed; }
.sh-sw input:checked + span::after { transform: translateX(12px); }
.sh-sw input:focus-visible + span { outline: 2px solid #a5b4fc; outline-offset: 2px; }
.sh-ver { margin-left: auto; color: var(--p-mut); opacity: .8; }
.sh-vrow { flex-basis: 100%; display: flex; align-items: center; gap: 8px; }
.sh-vlabel { font-weight: 600; }
.sh-vsel, .sh-lsel, .sh-bsel { height: 28px; min-width: 0; max-width: 150px; flex: 0 1 auto; padding: 0 8px; border-radius: 9px; border: 1px solid var(--p-bd); background: var(--p-card); color: var(--p-tx); font: inherit; font-size: 12px; }
.sh-vtest { height: 28px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--p-chipbd); background: var(--p-chip); color: var(--p-chiptx); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.sh-vnote { margin-left: auto; font-size: 11px; white-space: nowrap; }
.sh-vnote.hd { color: #059669; font-weight: 600; }
html.dark .sh-vnote.hd, html[data-theme="dark"] .sh-vnote.hd, html.theme-dark .sh-vnote.hd { color: #6ee7b7; }

/* element highlighted by a voice command */
.sh-target { outline: 2px solid #8b5cf6 !important; outline-offset: 2px; border-radius: 8px; transition: outline-color .3s; }

@media (max-width: 520px) {
  #shubhi-panel { right: 8px; left: 8px; width: auto; bottom: 86px; height: calc(100vh - 110px); border-radius: 18px; }
  #shubhi-orb { right: 14px; bottom: 14px; width: 54px; height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  .sh-sphere i { animation-duration: 12s !important; }
}
@media print { #shubhi-ring, #shubhi-orb, #shubhi-panel { display: none !important; } }


/* v1.04 footer: language + brain */
.sh-foot .sh-vrow + .sh-vrow { margin-top: 6px; }
.sh-lsel, .sh-bsel { max-width: 150px; }
.sh-bnote { font-size: 11px; opacity: .75; margin-left: auto; white-space: nowrap; }
.sh-bnote.hd { color: #059669; opacity: 1; }
html.dark .sh-bnote.hd, html.theme-dark .sh-bnote.hd { color: #6ee7b7; }
html[data-shubhi="idle"] .sh-sphere i { animation-play-state: paused; }
html[data-shubhi="idle"] #shubhi-orb:hover .sh-sphere i { animation-play-state: running; }

/* ============================================================ v1.04 — compact panel footer + SHUBHI settings page (/shubhi) */
.sh-foot { gap: 10px; padding: 8px 16px 11px; }
.sh-fstat { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--p-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sh-fstat i { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; flex: none; }
.sh-fstat i.ok { background: #10b981; }
.sh-foot .sh-ver { margin-left: auto; }
.sh-setlink { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--p-chipbd); background: var(--p-chip); color: var(--p-chiptx); font-size: 11.5px; font-weight: 600; text-decoration: none; }
.sh-setlink svg { width: 13px; height: 13px; }
.sh-setlink:hover { filter: brightness(.97); }
a.sh-ic.sh-gear { display: inline-grid; place-items: center; }

html.shubhi-route main { display: none !important; }
#shubhi-settings { display: block; }
#shubhi-settings .ss-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
#shubhi-settings .ss-open { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 0; color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; background: linear-gradient(135deg, #2563eb, #7c3aed 60%, #db2777); box-shadow: 0 6px 18px -8px rgba(124, 58, 237, .6); }
#shubhi-settings .ss-open svg { width: 16px; height: 16px; }
#shubhi-settings .ss-status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 0; margin-bottom: 20px; overflow: hidden; }
#shubhi-settings .ss-st { display: flex; align-items: center; gap: 12px; padding: 16px 18px; min-width: 0; }
#shubhi-settings .ss-st + .ss-st { border-left: 1px solid var(--border, rgba(148, 163, 184, .25)); }
#shubhi-settings .ss-st i { width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; flex: none; }
#shubhi-settings .ss-st i.ok { background: #10b981; }
#shubhi-settings .ss-st i.no { background: #ef4444; }
#shubhi-settings .ss-st small { display: block; font-size: 11.5px; }
#shubhi-settings .ss-st b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#shubhi-settings .ss-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
#shubhi-settings .ss-card { padding: 20px 22px; }
#shubhi-settings .ss-card h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
#shubhi-settings .ss-h2 { margin-top: 20px !important; }
#shubhi-settings .ss-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border, rgba(148, 163, 184, .2)); }
#shubhi-settings .ss-card h3 + .ss-row { border-top: 0; }
#shubhi-settings .ss-txt { min-width: 0; }
#shubhi-settings .ss-txt b { display: block; font-size: 13.5px; font-weight: 600; }
#shubhi-settings .ss-txt small { display: block; font-size: 12.5px; line-height: 1.45; margin-top: 2px; max-width: 46ch; }
#shubhi-settings .ss-ctl { display: flex; align-items: center; gap: 8px; flex: none; }
#shubhi-settings .ss-sw span { width: 36px; height: 20px; }
#shubhi-settings .ss-sw span::after { width: 16px; height: 16px; }
#shubhi-settings .ss-sw input:checked + span::after { transform: translateX(16px); }
#shubhi-settings select { height: 34px; max-width: 220px; min-width: 180px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border, rgba(148, 163, 184, .4)); background: var(--surface, #fff); color: inherit; font: inherit; font-size: 13px; }
#shubhi-settings select:disabled { opacity: .55; }
#shubhi-settings .sh-vtest { height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid rgba(124, 58, 237, .3); background: rgba(124, 58, 237, .08); color: #6d28d9; font-size: 13px; }
#shubhi-settings .ss-note { padding: 0 0 10px; min-height: 18px; }
#shubhi-settings .sh-vnote, #shubhi-settings .sh-bnote { margin: 0; font-size: 12px; }
#shubhi-settings .ss-ex { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border, rgba(148, 163, 184, .2)); font-size: 12.5px; }
#shubhi-settings .ss-ex span { padding: 7px 10px; border-radius: 8px; background: rgba(124, 58, 237, .06); }
#shubhi-settings .ss-list { margin: 0; padding: 12px 0 0 18px; border-top: 1px solid var(--border, rgba(148, 163, 184, .2)); font-size: 12.5px; line-height: 1.8; }
#shubhi-settings .ss-p { font-size: 12.5px; margin: 0 0 12px; line-height: 1.5; }
#shubhi-settings .ss-perms { display: flex; flex-wrap: wrap; gap: 6px; }
#shubhi-settings .ss-pm { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
#shubhi-settings .ss-pm.ok { background: rgba(16, 185, 129, .12); color: #047857; }
#shubhi-settings .ss-pm.no { background: rgba(148, 163, 184, .16); color: #64748b; }
#shubhi-settings .ss-keys { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; }
#shubhi-settings kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; border: 1px solid rgba(148, 163, 184, .45); border-bottom-width: 2px; font: 600 11px/1.6 ui-monospace, monospace; text-align: center; }
html.theme-dark #shubhi-settings select { background: rgba(15, 23, 42, .6); border-color: rgba(148, 163, 184, .25); }
html.theme-dark #shubhi-settings .sh-vtest { color: #c4b5fd; background: rgba(124, 58, 237, .18); }
html.theme-dark #shubhi-settings .ss-pm.ok { color: #6ee7b7; }
html.theme-dark #shubhi-settings .ss-pm.no { color: #94a3b8; }
html.theme-dark #shubhi-settings .ss-ex span { background: rgba(124, 58, 237, .14); }
@media (max-width: 1100px) { #shubhi-settings .ss-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  #shubhi-settings .ss-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #shubhi-settings .ss-st:nth-child(3) { border-left: 0; }
  #shubhi-settings .ss-st:nth-child(n+3) { border-top: 1px solid var(--border, rgba(148, 163, 184, .25)); }
  #shubhi-settings .ss-row { flex-direction: column; align-items: stretch; }
  #shubhi-settings .ss-ctl select { flex: 1; max-width: none; min-width: 0; }
}
.sh-title { min-width: 0; }
.sh-title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.sh-head .sh-ic { width: 30px; height: 30px; }
.sh-head .sh-state { flex: none; }

/* v1.08 look & feel */
html.shubhi-noring #shubhi-ring { display: none !important; }
html[data-sh-glow="accent"] #shubhi-ring .e i { background: linear-gradient(90deg, var(--accent, #6366f1), color-mix(in srgb, var(--accent, #6366f1) 45%, #fff), var(--accent, #6366f1), color-mix(in srgb, var(--accent, #6366f1) 60%, #000), var(--accent, #6366f1)) !important; }
html[data-sh-glow="accent"] #shubhi-ring .e.l i, html[data-sh-glow="accent"] #shubhi-ring .e.r i { background: linear-gradient(180deg, var(--accent, #6366f1), color-mix(in srgb, var(--accent, #6366f1) 45%, #fff), var(--accent, #6366f1), color-mix(in srgb, var(--accent, #6366f1) 60%, #000), var(--accent, #6366f1)) !important; }
html[data-sh-glow="cool"] #shubhi-ring .e i { background: linear-gradient(90deg, #22d3ee, #3b82f6, #6366f1, #06b6d4, #38bdf8, #22d3ee) !important; }
html[data-sh-glow="cool"] #shubhi-ring .e.l i, html[data-sh-glow="cool"] #shubhi-ring .e.r i { background: linear-gradient(180deg, #22d3ee, #3b82f6, #6366f1, #06b6d4, #38bdf8, #22d3ee) !important; }
html[data-sh-glow="warm"] #shubhi-ring .e i { background: linear-gradient(90deg, #f97316, #ec4899, #f43f5e, #f59e0b, #fb7185, #f97316) !important; }
html[data-sh-glow="warm"] #shubhi-ring .e.l i, html[data-sh-glow="warm"] #shubhi-ring .e.r i { background: linear-gradient(180deg, #f97316, #ec4899, #f43f5e, #f59e0b, #fb7185, #f97316) !important; }
html.shubhi-still #shubhi-orb *, html.shubhi-still #shubhi-orb::before, html.shubhi-still #shubhi-orb::after { animation: none !important; }
html.shubhi-noorb:not(.shubhi-open) #shubhi-orb { display: none !important; }
/* v1.08: notes on the settings page wrap inside their card (the panel's one-line style leaked in) */
#shubhi-settings .sh-vnote, #shubhi-settings .sh-bnote { display: block; white-space: normal; overflow-wrap: anywhere; margin: 0; line-height: 1.5; opacity: 1; color: var(--text-muted, #64748b); }
#shubhi-settings .ss-card { min-width: 0; overflow-wrap: anywhere; }
#shubhi-settings .ss-txt small { max-width: none; }
#shubhi-settings .ss-list { padding-left: 16px; }
#shubhi-settings .ss-list li { margin: 2px 0; line-height: 1.55; }
@media (max-width: 720px) {
  #shubhi-settings .ss-card { padding: 16px; }
  #shubhi-settings .ss-ctl { width: 100%; flex-wrap: wrap; }
  #shubhi-settings .ss-ctl select { width: 100%; flex: 1 1 100%; }
  #shubhi-settings .ss-ctl .sh-vtest { flex: 1 1 100%; }
  #shubhi-settings .ss-row .sh-sw { align-self: flex-start; }
  #shubhi-settings .ss-head { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 720px) {
  #shubhi-settings .ss-row:not(:has(.ss-ctl)) { flex-direction: row; align-items: center; }
  #shubhi-settings .ss-row:not(:has(.ss-ctl)) .sh-sw { align-self: center; flex: none; }
}
#shubhi-settings .svs-trigger { max-width: 260px; min-width: 200px; }
@media (max-width: 720px) { #shubhi-settings .ss-ctl .svs-trigger { width: 100% !important; max-width: none !important; flex: 1 1 100%; } }

/* ---------------------------------------------------------------- v1.10 light mode: zero idle cost
   The orb and head sphere stand still while SHUBHI is idle (no per-frame paint on every page); they come alive only
   while she listens, thinks or speaks, or when you hover the orb. The aurora gets its own layer so the voice-level
   opacity changes never repaint the blur. */
html:not([data-shubhi="listening"]):not([data-shubhi="working"]):not([data-shubhi="speaking"]) .sh-sphere i { animation-play-state: paused !important; }
@media (hover: hover) and (pointer: fine) { html #shubhi-orb:hover .sh-sphere i { animation-play-state: running !important; } }
#shubhi-orb, #shubhi-orb .sh-sphere { contain: layout paint; }
#shubhi-panel .sh-aurora { will-change: opacity; }
#shubhi-panel { -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); }
@media (max-width: 900px), (pointer: coarse) { #shubhi-panel { -webkit-backdrop-filter: none; backdrop-filter: none; --p-bg: rgba(255,255,255,.97); } html.dark #shubhi-panel, html[data-theme="dark"] #shubhi-panel, html.theme-dark #shubhi-panel { --p-bg: rgba(30,33,48,.98); } #shubhi-panel .sh-aurora { filter: none; opacity: .18; } }

/* v1.11 Gemini key box */
.ss-gem { margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line, rgba(15,23,42,.1)); background: var(--surface-2, rgba(99,102,241,.04)); }
.ss-gem[hidden], .ss-gem [hidden] { display: none !important; }
.ss-gem-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.ss-gem-st { font-size: 12px; font-weight: 600; }
.ss-gem-p { margin: 6px 0 10px; font-size: 12.5px; line-height: 1.5; }
.ss-gem-p a { color: var(--accent, #4f46e5); text-decoration: underline; }
.ss-gem-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ss-gem-in { flex: 1 1 220px; min-width: 0; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line, rgba(15,23,42,.15)); background: var(--surface, #fff); color: inherit; font: inherit; font-size: 13px; }
.ss-gem-in:focus { outline: 2px solid rgba(99,102,241,.35); outline-offset: 1px; }
@media (max-width: 640px) { .ss-gem-row > button { flex: 1 1 auto; } }
.ss-gem-card { margin: 18px 0 0; padding: 18px 20px; border-radius: 16px; }
.ss-gem-card .ss-gem-h { align-items: flex-start; }
.ss-gem-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent, #4f46e5); }
.ss-gem-title { margin: 2px 0 0; font-size: 16px; }
.ss-gem-card .ss-gem-st { padding: 4px 10px; border-radius: 999px; background: rgba(100,116,139,.1); white-space: nowrap; }
.ss-gem-card .ss-gem-st.t-success { background: rgba(16,185,129,.12); }
.ss-gem-msg { margin-top: 10px; font-size: 12.5px; font-weight: 600; padding: 8px 12px; border-radius: 10px; }
.ss-gem-msg.ok { color: #047857; background: rgba(16,185,129,.1); }
.ss-gem-msg.bad { color: #b91c1c; background: rgba(239,68,68,.08); }
.ss-gem-card [hidden], .ss-gem-link[hidden] { display: none !important; }
.ss-gem-link a { color: var(--accent, #4f46e5); text-decoration: underline; font-weight: 600; }
/* v1.11 brain access policy */
.ss-pol:empty { display: none; }
.ss-pol { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line, rgba(15,23,42,.12)); }
.ss-pol-h { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #64748b); margin: 12px 0 8px; }
.ss-pol-h:first-child { margin-top: 0; }
.ss-pol-h .t-muted { text-transform: none; letter-spacing: 0; font-weight: 600; }
.ss-pol-shared { width: 100%; max-width: 420px; height: 40px; border-radius: 12px; padding: 0 12px; border: 1px solid var(--line, rgba(15,23,42,.15)); background: var(--surface, #fff); color: inherit; font: inherit; font-weight: 600; }
.ss-pol-p { font-size: 12.5px; margin: 6px 0 0; }
.ss-pol-scroll { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line, rgba(15,23,42,.1)); }
.ss-pol-t { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 460px; }
.ss-pol-t th { text-align: center; font-size: 11.5px; font-weight: 800; padding: 10px 8px; background: var(--surface-2, rgba(99,102,241,.05)); color: var(--muted, #64748b); }
.ss-pol-t th:first-child, .ss-pol-t td:first-child { text-align: left; padding-left: 14px; font-weight: 700; }
.ss-pol-t td { text-align: center; padding: 8px; border-top: 1px solid var(--line, rgba(15,23,42,.07)); }
.ss-pol-dev td { background: rgba(99,102,241,.04); }
.ss-pol-c { display: inline-flex; cursor: pointer; }
.ss-pol-c input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ss-pol-c span { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line, rgba(15,23,42,.25)); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.ss-pol-c input:checked + span { background: var(--accent, #6366f1); border-color: var(--accent, #6366f1); }
.ss-pol-c input:checked + span::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.ss-pol-c input:focus-visible + span { outline: 2px solid var(--accent, #6366f1); outline-offset: 2px; }
.ss-pol-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.ss-pol-u { font-size: 12.5px; }
.ss-pol-c { vertical-align: middle; line-height: 0; }
/* v1.15 API keys: Public / Private switch (role access lives in Roles & Permissions) */
.ss-vis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 640px; }
.ss-vis-b { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line, rgba(15,23,42,.14)); background: var(--surface, #fff); color: inherit; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.ss-vis-b b { font-size: 14px; }
.ss-vis-b span { font-size: 12px; line-height: 1.4; color: var(--muted, #64748b); }
.ss-vis-b:hover { border-color: var(--accent, #6366f1); }
.ss-vis-b.on { border-color: var(--accent, #6366f1); background: rgba(99,102,241,.07); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.ss-vis-b.on b::before { content: '● '; color: var(--accent, #6366f1); }
.ss-vis-b:disabled { opacity: .6; cursor: progress; }
.ss-vis-b:focus-visible { outline: 2px solid var(--accent, #6366f1); outline-offset: 2px; }
.ss-vis-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-vis-chip { font-size: 12.5px; font-weight: 700; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line, rgba(15,23,42,.12)); background: var(--surface-2, rgba(99,102,241,.05)); }
.ss-vis-chip i { font-style: normal; font-weight: 500; color: var(--muted, #64748b); margin-left: 4px; }
.ss-vis-chip.off { opacity: .55; text-decoration: line-through; }
.ss-vis-chip.dev { background: rgba(99,102,241,.1); }
@media (max-width: 560px) { .ss-vis { grid-template-columns: 1fr; } }
/* v1.16 daily limit per person */
.ss-lim { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 12px; }
.ss-lim-in { width: 96px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1.5px solid var(--line, rgba(15,23,42,.14)); background: var(--surface, #fff); color: inherit; font: inherit; }
.ss-lim span { flex: 1 1 220px; font-size: 12.5px; line-height: 1.4; }
.ss-lim-save { height: 36px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--accent, #6366f1); color: #fff; font-weight: 700; cursor: pointer; }
.ss-lim-save:disabled { opacity: .6; cursor: default; }
