﻿/* in360sight · Virtual Secretary conversation (SEC1) · WCAG 2.1 AA · uses --is-* tokens from in360sight-core */
.sd{display:flex;flex-direction:column;gap:10px;margin-top:6px}
.sd-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.sd-log{display:flex;flex-direction:column;gap:10px;min-height:40px}
.sd-row{display:flex}
.sd-me{justify-content:flex-end}
.sd-bubble{max-width:92%;padding:10px 12px;border-radius:14px;font-size:14px;line-height:1.55;color:var(--is-text1);background:var(--is-s2);border:1px solid var(--is-line)}
.sd-me .sd-bubble{background:var(--is-accent);color:#fff;border-color:var(--is-accent);border-end-end-radius:4px}
html[data-theme="dark"] .sd-me .sd-bubble{color:#04211F}
.sd-them .sd-bubble{border-end-start-radius:4px;border-inline-start:4px solid var(--is-accent)}
.sd-them.tone-good .sd-bubble{border-inline-start-color:var(--is-gain)}
.sd-them.tone-warn .sd-bubble{border-inline-start-color:#B45309}
.sd-them.tone-stop .sd-bubble{border-inline-start-color:var(--is-leak)}
.sd-text{margin:0}
.sd-note{margin:8px 0 0;font-size:13px;color:var(--is-text2)}
.sd-typing{color:var(--is-text2);font-size:13px;padding:2px 4px}
.sd-lines{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:6px}
.sd-line{padding:7px 10px;border-radius:10px;background:var(--is-s1);border:1px solid var(--is-line);font-size:13.5px}
.sd-line.tag-warn{border-inline-start:3px solid #B45309}
.sd-line.tag-stop{border-inline-start:3px solid var(--is-leak)}
.sd-line.tag-good{border-inline-start:3px solid var(--is-gain)}
.sd-line.tag-quote{background:var(--is-accent-bg);border-color:var(--is-accent);font-size:14px;white-space:pre-wrap}
.sd-line.tag-step{background:transparent;border:0;padding:2px 0}
.sd-line a{color:var(--is-text1);text-decoration:underline;text-underline-offset:3px}
.sd-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.sd-btn{display:inline-flex;align-items:center;min-height:36px;padding:6px 12px;border-radius:999px;border:1px solid var(--is-line-strong);background:var(--is-s1);color:var(--is-text1);font:600 13px/1.2 inherit;cursor:pointer;text-decoration:none}
.sd-btn:hover{border-color:var(--is-accent)}
.sd-btn.confirm,.sd-btn.do{background:var(--is-accent);border-color:var(--is-accent);color:#fff}
html[data-theme="dark"] html[data-theme="dark"] .sd-btn.confirm,html[data-theme="dark"] .sd-btn.do{color:#04211F}
.sd-btn.cancel{background:transparent}
.sd-btn.ext{border-color:#128C4A}
.sd-btn[disabled]{opacity:.55;cursor:default}
.sd-btn:focus-visible,.sd-input:focus-visible,.sd-send:focus-visible,.sd-launch:focus-visible,.sd-close:focus-visible,.sd-line a:focus-visible{outline:3px solid #1D4ED8;outline-offset:2px}
html[data-theme="dark"] .sd-btn:focus-visible,html[data-theme="dark"] .sd-input:focus-visible,html[data-theme="dark"] .sd-send:focus-visible,html[data-theme="dark"] .sd-launch:focus-visible{outline-color:#93C5FD}
.sd-form{display:flex;gap:8px;align-items:stretch;position:sticky;bottom:0;padding:8px 0 2px;background:var(--is-s1)}
.sd-input{flex:1;min-width:0;min-height:44px;padding:10px 12px;border-radius:12px;border:1px solid var(--is-line-strong);background:var(--is-s1);color:var(--is-text1);font:15px/1.3 inherit}
.sd-input::placeholder{color:var(--is-text2);opacity:1}
.sd-send{min-height:44px;padding:0 16px;border-radius:12px;border:0;background:var(--is-accent);color:#fff;font:600 14px inherit;cursor:pointer}
html[data-theme="dark"] .sd-send{color:#04211F}
.sd-foot{margin:0;font-size:12.5px;color:var(--is-text2);line-height:1.5}
.sd-enter{animation:sdIn .28s ease-out}
@keyframes sdIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.sd-enter{animation:none}}

/* floating (setup pages) and the always-visible "Ask" pill on app pages */
.sd-launch,.sd-pill{position:fixed;bottom:20px;inset-inline-end:20px;z-index:60;display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:6px 16px 6px 6px;border-radius:999px;border:1px solid var(--is-accent);background:var(--is-s1);color:var(--is-text1);font:600 15px/1 inherit;box-shadow:0 8px 24px rgba(10,20,36,.18);cursor:pointer}
html[dir="rtl"] .sd-launch,html[dir="rtl"] .sd-pill{padding:6px 6px 6px 16px}
.sd-launch img,.sd-pill img{width:36px;height:36px;border-radius:50%;background:var(--is-accent-bg)}
.sd-float{position:fixed;bottom:80px;inset-inline-end:20px;z-index:61;width:min(420px,calc(100vw - 24px));max-height:min(72vh,640px);overflow:auto;padding:14px;border-radius:18px;border:1px solid var(--is-line-strong);background:var(--is-s1);box-shadow:0 18px 48px rgba(10,20,36,.28)}
.sd-head{display:grid;grid-template-columns:40px 1fr auto;grid-template-rows:auto auto;column-gap:10px;align-items:center;margin-bottom:8px}
.sd-head img{grid-row:1/3;width:40px;height:40px;border-radius:50%;background:var(--is-accent-bg)}
.sd-head strong{font-size:16px;color:var(--is-text1)}
.sd-sub{grid-column:2;font-size:12.5px;color:var(--is-text2)}
.sd-close{grid-row:1/3;grid-column:3;width:36px;height:36px;border-radius:50%;border:1px solid var(--is-line);background:transparent;color:var(--is-text1);font-size:20px;cursor:pointer}
@media (max-width:560px){.sd-float{inset-inline-end:12px;bottom:76px}.sd-launch,.sd-pill{bottom:14px;inset-inline-end:12px}}
@media print{.sd-launch,.sd-pill,.sd-float{display:none!important}}

/* ---------- SEC2 · the secretary's presence on every page ---------- */
.spx{margin:0 0 18px;border-radius:18px;border:1px solid var(--is-line);background:var(--is-s1);color:var(--is-text1);position:relative;overflow:hidden}
.spx::before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:5px;background:var(--is-accent)}
.spx.tone-warn::before{background:#B45309}
.spx.tone-stop::before{background:var(--is-leak)}
.spx.tone-good::before{background:var(--is-gain)}
.spx-full{display:grid;grid-template-columns:auto 1fr auto;gap:14px 16px;align-items:start;padding:16px 18px 16px 22px}
html[dir="rtl"] .spx-full{padding:16px 22px 16px 18px}
.spx-face{position:relative;display:inline-block;width:56px;height:56px}
.spx-face img{width:56px;height:56px;border-radius:50%;background:var(--is-accent-bg);display:block}
.spx-dot{position:absolute;bottom:2px;inset-inline-end:2px;width:13px;height:13px;border-radius:50%;background:#16A34A;border:2px solid var(--is-s1)}
.spx-face img{animation:spxBreathe 5s ease-in-out infinite}
@keyframes spxBreathe{0%,100%{transform:scale(1)}50%{transform:scale(1.035)}}
.spx-body{min-width:0}
.spx-who{margin:0;font-size:13.5px;color:var(--is-text2)}
.spx-who strong{color:var(--is-text1);font-size:15px}
.spx-say{margin:4px 0 0;font-size:16px;line-height:1.55;color:var(--is-text1);max-width:80ch}
.spx-notes{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:8px}
.spx-note{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;padding:9px 12px;border-radius:12px;background:var(--is-s2);border:1px solid var(--is-line);font-size:14.5px;line-height:1.5}
.spx-note.warn{background:#FFF8E8;border-color:#E9C77C}
.spx-note.stop{background:var(--is-leak-bg);border-color:var(--is-leak)}
.spx-note.good{background:var(--is-gain-bg);border-color:transparent}
html[data-theme="dark"] .spx-note.warn{background:rgba(245,184,67,.10);border-color:rgba(245,184,67,.4)}
.spx-note-text{flex:1 1 300px;min-width:0}
.spx-act{display:inline-flex;align-items:center;min-height:34px;padding:4px 12px;border-radius:999px;border:1px solid var(--is-accent);background:var(--is-s1);color:var(--is-text1);font:600 13.5px/1.2 inherit;text-decoration:none;cursor:pointer}
.spx-first{margin:8px 0 0;font-size:14.5px;color:var(--is-text2)}
.spx-links{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.spx-chip{display:inline-flex;align-items:center;gap:4px;min-height:36px;padding:6px 14px;border-radius:999px;border:1px solid var(--is-line-strong);background:var(--is-s1);color:var(--is-text1);font:600 13.5px/1.2 inherit;text-decoration:none;cursor:pointer}
.spx-chip:hover,.spx-act:hover{border-color:var(--is-accent);background:var(--is-accent-bg)}
.spx-chip.ask{border-style:dashed}
.spx-ctl{display:flex;flex-direction:column;gap:8px;align-items:stretch}
.spx-talk{min-height:40px;padding:8px 16px;border-radius:12px;border:0;background:var(--is-accent);color:#fff;font:600 14px/1.2 inherit;cursor:pointer;white-space:nowrap}
html[data-theme="dark"] .spx-talk{color:#04211F}
.spx-hide,.spx-show{min-height:36px;padding:6px 12px;border-radius:12px;border:1px solid var(--is-line);background:transparent;color:var(--is-text2);font:600 13px/1.2 inherit;cursor:pointer}
.spx-slim{display:flex;align-items:center;gap:10px;padding:8px 14px 8px 20px;font-size:14px;color:var(--is-text1)}
.spx-slim[hidden],.spx-full[hidden]{display:none}
.spx-slim img{width:28px;height:28px;border-radius:50%;background:var(--is-accent-bg)}
.spx-slim span{flex:1}
.spx-chip:focus-visible,.spx-act:focus-visible,.spx-talk:focus-visible,.spx-hide:focus-visible,.spx-show:focus-visible{outline:3px solid #1D4ED8;outline-offset:2px}
html[data-theme="dark"] .spx-chip:focus-visible,html[data-theme="dark"] .spx-act:focus-visible,html[data-theme="dark"] .spx-talk:focus-visible,html[data-theme="dark"] .spx-hide:focus-visible,html[data-theme="dark"] .spx-show:focus-visible{outline-color:#93C5FD}
@media (max-width:720px){.spx-full{grid-template-columns:auto 1fr}.spx-ctl{grid-column:1/-1;flex-direction:row}.spx-face,.spx-face img{width:44px;height:44px}}
@media (prefers-reduced-motion:reduce){.spx-face img{animation:none}}
@media print{.spx{display:none!important}}

/* the launcher: who she is, not "Ask …" */
.sd-pill strong,.sd-launch strong{display:block;font-size:14.5px;line-height:1.2}
.sd-pill small,.sd-launch small{display:block;font-size:12px;font-weight:500;color:var(--is-text2);line-height:1.2}
.sd-pill .spx-dot,.sd-launch .spx-dot{position:absolute;bottom:6px;inset-inline-start:32px;width:11px;height:11px}
.sd-pill,.sd-launch{position:fixed}

/* SEC3 · tick lists, inputs and email drafts in the conversation */
.sd-visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.sd-pick{border:1px solid var(--is-line);border-radius:12px;padding:8px 10px;margin:0;width:100%;background:var(--is-s1)}
.sd-pick.sd-need{border-color:#B45309}
.sd-pick-row{display:flex;gap:8px;align-items:flex-start;padding:6px 0;border-bottom:1px solid var(--is-line)}
.sd-pick-row:last-of-type{border-bottom:0}
.sd-pick-row input{width:18px;height:18px;margin-top:2px;flex:none;accent-color:var(--is-accent)}
.sd-pick-row label{font-size:13px;line-height:1.45;color:var(--is-text1);cursor:pointer}
.sd-pick .sd-btn{margin-top:8px}
.sd-field{display:flex;flex-wrap:wrap;gap:6px 8px;align-items:center;width:100%;padding:8px 10px;border:1px dashed var(--is-line-strong);border-radius:12px}
.sd-field-label{font-size:12px;font-weight:700;color:var(--is-text2)}
.sd-field-input{min-height:36px;padding:4px 10px;border:1px solid var(--is-line-strong);border-radius:8px;background:var(--is-s1);color:var(--is-text1);font:14px inherit;flex:1 1 140px;min-width:0}
.sd-field-input:focus{outline:none;border-color:var(--is-accent);box-shadow:0 0 0 3px var(--is-accent-bg)}
.sd-field-input[aria-invalid="true"]{border-color:var(--is-leak)}
.sd-draft{margin:10px 0 0;padding:10px 12px;border-inline-start:3px solid var(--is-line-strong);background:var(--is-s1);border-radius:8px;font-size:13px;line-height:1.6;color:var(--is-text1);max-height:220px;overflow:auto}
.sd-draft p{margin:0 0 8px;white-space:pre-wrap}
.sd-draft p:last-child{margin-bottom:0}
