/* Workspace assistant: sits above the drawer (80) and below confirm dialogs (90+). */
.assistant-launcher { position: fixed; right: 20px; bottom: 20px; z-index: 85; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 10px; border: 0; border-radius: 999px; color: #fff; background: var(--navy-900); box-shadow: var(--shadow-lg); font: inherit; font-size: 13px; font-weight: 750; cursor: pointer; }
.assistant-launcher:hover { background: var(--navy-800); }
.assistant-launcher:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.assistant-launcher[aria-expanded="true"] { display: none; }
.assistant-launcher-mark { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--teal); font-weight: 800; }

.assistant-panel { position: fixed; right: 20px; bottom: 20px; z-index: 85; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 40px)); display: grid; grid-template-rows: auto 1fr auto auto; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.assistant-panel[hidden] { display: none; }
.assistant-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line-soft); }
.assistant-head h2 { margin: 2px 0 0; font-size: 17px; }
.assistant-head .icon-button { font-size: 20px; line-height: 1; }
.assistant-log { overflow-y: auto; padding: 14px 16px; display: grid; align-content: start; gap: 12px; background: var(--canvas); }
.assistant-message { max-width: 100%; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); font-size: 13px; line-height: 1.5; color: var(--ink); }
.assistant-message p { margin: 0 0 8px; }
.assistant-message p:last-child { margin-bottom: 0; }
.assistant-message.is-user { justify-self: end; max-width: 85%; color: #fff; background: var(--navy-900); }
.assistant-topic { font-weight: 800; font-size: 14px; }
.assistant-steps { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; }
.assistant-meta { color: var(--muted); font-size: 12px; }
.assistant-buttons, .assistant-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.assistant-buttons .button { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.assistant-chips .button-chip { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--teal-strong); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; text-align: left; }
.assistant-chips .button-chip:hover { border-color: var(--teal); background: var(--teal-soft); }
.assistant-permission { padding: 10px 12px; border: 1px solid var(--amber); border-radius: var(--radius-sm); background: var(--amber-soft); }
.assistant-compose { display: flex; gap: 8px; padding: 12px 16px 6px; border-top: 1px solid var(--line-soft); }
.assistant-compose input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; font-size: 13px; }
.assistant-compose input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.assistant-foot { margin: 0; padding: 0 16px 12px; color: var(--muted-2); font-size: 11px; line-height: 1.4; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Live screen preview: an inert, scaled copy of the relevant part of the page. */
.assistant-preview { position: relative; margin: 10px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--canvas); }
.assistant-preview-stage { transform-origin: top left; pointer-events: none; user-select: none; background: var(--surface); }
.assistant-preview-stage tbody, .assistant-preview-stage dd, .assistant-preview-stage .profile-row, .assistant-preview-stage .timeline { filter: blur(3px); }
.assistant-preview-target { outline: 4px solid var(--amber) !important; outline-offset: 3px; border-radius: 6px; box-shadow: 0 0 0 9px rgba(195, 123, 11, .22); filter: none !important; }
.assistant-preview figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; color: var(--muted); background: rgba(255, 255, 255, .94); border-top: 1px solid var(--line-soft); font-size: 11px; }

/* Walkthrough: rings the real control; clicks still reach the page. */
.assistant-tour { position: fixed; inset: 0; z-index: 86; pointer-events: none; }
.assistant-tour[hidden] { display: none; }
.assistant-tour-ring { position: fixed; border: 3px solid var(--amber); border-radius: 10px; box-shadow: 0 0 0 9999px rgba(2, 15, 25, .38); transition: top .18s ease, left .18s ease, width .18s ease, height .18s ease; }
.assistant-tour-ring[hidden] { display: none; }
.assistant-tour-card { position: fixed; top: 96px; left: 50%; width: min(360px, calc(100vw - 24px)); padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); pointer-events: auto; }
.assistant-tour:not(.is-floating) .assistant-tour-card { transform: none; }
.assistant-tour.is-floating { background: rgba(2, 15, 25, .38); }
.assistant-tour.is-floating .assistant-tour-card { top: 50% !important; left: 50% !important; transform: translate(-50%, -50%); }
.assistant-tour-card h3 { margin: 4px 0 8px; font-size: 15px; line-height: 1.4; }
.assistant-tour-card p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.assistant-tour-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

@media (max-width: 640px) {
  .assistant-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: min(78vh, 640px); }
  .assistant-launcher { right: 12px; bottom: 12px; }
  .assistant-launcher[aria-expanded="false"] span:last-child { display: none; }
  .assistant-launcher { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { .assistant-tour-ring { transition: none; } }

/* Bank administrator setting (Security settings > Intelligent assistant). */
.assistant-setting { margin-top: var(--space-md); }
.assistant-setting .bank-assistance-confirmation { display: flex; gap: .6rem; align-items: flex-start; margin-block: 1rem; }
.assistant-setting .bank-assistance-confirmation input { flex: 0 0 auto; width: auto; margin-top: .25rem; }
.assistant-setting [data-guide-toggle] { margin-top: 8px; }
