/* Staff assistant: the firm workspace frame around the client assistant's chat. The chat itself is styled by staff-chat.css,
   generated from the client portal's rules (tools/staff_chat_css.py); only the layout inside the firm page is set here. */
body[data-screen="staff-assistant"] main { padding: 12px 24px 0; }
body[data-screen="staff-assistant"] .page-heading, body[data-screen="staff-assistant"] main > footer { display: none; }
#staff-assistant { min-width: 0; color: var(--ink); }
#staff-assistant[hidden] { display: none; }
#staff-assistant .sa-layout { position: relative; display: flex; height: calc(100vh - 90px); height: calc(100dvh - 90px); min-height: 430px; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
#staff-assistant .sa-side { flex: none; display: flex; flex-direction: column; width: 248px; min-height: 0; padding: 12px; border-right: 1px solid var(--line); background: #fff; }
#staff-assistant .sa-side .side-recent { display: flex; flex-direction: column; }
#staff-assistant .sa-side .sa-side-head { display: none; }
#staff-assistant .sa-off { margin: 16px; }
/* The left column's tools, under New chat: What I remember, Assistant actions, and the firm switch. */
#staff-assistant .sa-side-tools { flex: none; display: grid; gap: 2px; }
#staff-assistant .sa-side-tool { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 7px 12px; color: var(--body); font-size: 14px; font-weight: 500; text-align: left; }
#staff-assistant .sa-side-tool[aria-expanded="true"] { background: var(--green-tint); color: var(--green-dark); }
#staff-assistant .sa-switch { display: grid; gap: 6px; margin-top: 6px; padding: 8px 12px; border-radius: 9px; background: var(--background); color: var(--muted); font-size: 12.5px; line-height: 1.4; }
#staff-assistant .sa-switch p { margin: 0; overflow-wrap: anywhere; }
#staff-assistant .sa-switch p:empty { display: none; }
#staff-assistant .sa-switch button { justify-self: start; min-height: 32px; padding: 5px 12px; font-size: 13px; }
#staff-assistant .sa-hide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Dictation's language sits in the input row, beside the microphone. */
#staff-assistant .as-input .as-lang { flex: none; align-self: flex-end; margin: 0 0 6px; }
#staff-assistant .as-input .as-lang select { max-width: 132px; min-height: 28px; padding: 2px 4px; border-color: var(--line); color: var(--muted); font-size: 12.5px; text-overflow: ellipsis; }
/* One line of fine print under the input: the consent given (with Withdraw) and the AI note. */
#staff-assistant .sa-fine { width: 100%; max-width: 760px; margin: 6px auto 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; overflow-wrap: anywhere; }
#staff-assistant .sa-fine .as-link { font-size: inherit; }
#staff-assistant .as-legal-inline, #staff-assistant .talking .as-legal-inline:not([hidden]) { display: none; }
#staff-assistant .sa-scrim { display: none; }
#staff-assistant .as-draft { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--background); }
#staff-assistant .as-draft h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--ink); font-size: 15px; }
#staff-assistant .as-draft h4 small { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 500; }
#staff-assistant .as-draft textarea { display: block; width: 100%; min-width: 0; box-sizing: border-box; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; line-height: 1.5; resize: vertical; }
#staff-assistant .as-draft p { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
#staff-assistant .as-draft .secondary { margin-top: 10px; }
#staff-assistant .sa-memory { position: absolute; top: 60px; right: 12px; z-index: 30; width: min(380px, calc(100% - 24px)); max-height: calc(100% - 80px); overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 35px #10243d22; box-sizing: border-box; }
#staff-assistant .sa-memory[hidden] { display: none; }
#staff-assistant .sa-memory h2 { font-size: 17px; margin: 0; }
#staff-assistant .sa-memory .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
#staff-assistant .sa-draft-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#staff-assistant .sa-draft-actions .secondary, #staff-assistant .sa-draft-actions .primary { margin-top: 0; }
#staff-assistant .sa-send-all { display: flex; justify-content: flex-end; margin-top: 16px; }
#staff-assistant .sa-repeat { display: grid; gap: 10px; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--background); }
#staff-assistant .sa-repeat label { display: grid; gap: 4px; font-size: 14px; }
#staff-assistant .sa-repeat label.checkbox { display: flex; align-items: flex-start; gap: 8px; }
#staff-assistant .sa-repeat select { min-height: 38px; max-width: 100%; }
#staff-assistant .sa-repeat p { margin: 0; }
#staff-assistant .sa-repeat-done { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--green-dark); font-size: 13.5px; }
#staff-assistant .sa-tasks { flex: none; max-height: 40%; }
#staff-assistant .sa-task { display: grid; gap: 2px; padding: 8px 12px; border-radius: 9px; }
#staff-assistant .sa-task strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
#staff-assistant .sa-task small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
#staff-assistant .sa-task span { display: flex; gap: 4px; }
#staff-assistant .sa-task .plain { min-height: 30px; padding: 4px 8px; font-size: 13px; }
#staff-assistant .sa-dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); box-sizing: border-box; padding: 20px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); overflow-wrap: anywhere; }
#staff-assistant .sa-dialog::backdrop { background: #0e223866; }
#staff-assistant .sa-dialog h2 { margin: 0 0 8px; font-size: 18px; }
#staff-assistant .sa-dialog p { margin: 8px 0; font-size: 14px; }
#staff-assistant .sa-recipients { margin: 8px 0; padding-left: 18px; font-size: 14px; }
#staff-assistant .sa-recipients li { margin: 4px 0; }
#staff-assistant .as-card-links { display: flex; flex-wrap: wrap; gap: 8px; }
#staff-assistant .as-starter small { display: block; color: var(--muted); }
#staff-assistant .sa-memory .mem-add div { display: flex; gap: 8px; }
#staff-assistant .sa-memory .mem-add input { flex: 1; min-width: 0; }
#staff-assistant .sa-action-table { max-height: 320px; margin-top: 8px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
#staff-assistant .sa-action-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
#staff-assistant .sa-action-table th, #staff-assistant .sa-action-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
#staff-assistant .sa-action-table th { position: sticky; top: 0; background: var(--background); font-weight: 600; }
#staff-assistant .sa-action-summary { color: var(--ink) !important; font-size: 14px !important; }
#staff-assistant .sa-step { margin-top: 10px; }
#staff-assistant .sa-step h5 { margin: 0; font-size: 13.5px; }
#staff-assistant .sa-step h5 small, #staff-assistant .sa-selection { color: var(--muted); font-weight: 400; }
#staff-assistant .sa-selection { margin: 6px 0 0; font-size: 13.5px; }
#staff-assistant .sa-skipped td { color: var(--muted); }
#staff-assistant .sa-message { margin: 6px 0 0; white-space: pre-wrap; font: inherit; font-size: 12.5px; }
#staff-assistant .sa-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; }
#staff-assistant .sa-progress progress { flex: 1 1 160px; max-width: 100%; }
#staff-assistant .sa-action-notes { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; }
/* The planner's options: one button each, written by code; a click is the person's own turn. */
#staff-assistant .sa-choice-list { display: grid; gap: 8px; margin-top: 10px; }
#staff-assistant .sa-choice-list button { margin: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
#staff-assistant .sa-choice-list button small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
#staff-assistant .sa-actions, #staff-assistant .sa-actions[open] { padding: 0; border: 0; border-radius: 0; background: none; font-size: 13px; }
#staff-assistant .sa-actions > .sa-actions-panel { margin-top: 0; }
#staff-assistant .sa-actions[hidden] { display: none; }
#staff-assistant .sa-actions summary { min-height: 36px; padding: 8px 12px; border-radius: 9px; color: var(--body); font-size: 14px; font-weight: 500; line-height: 20px; cursor: pointer; box-sizing: border-box; }
#staff-assistant .sa-actions summary:hover, #staff-assistant .sa-actions[open] summary { background: var(--green-tint); color: var(--green-dark); }
#staff-assistant .sa-actions label.checkbox { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; }
/* The permissions table needs width: it opens as a wide panel over the conversation, never squeezed into the column. */
#staff-assistant .sa-actions-panel { position: absolute; top: 12px; left: 260px; z-index: 31; width: min(600px, calc(100% - 284px)); max-height: calc(100% - 24px); overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 12px 35px #10243d22; box-sizing: border-box; font-size: 13.5px; }
#staff-assistant .sa-actions-panel .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#staff-assistant .sa-actions-panel h2 { margin: 0; font-size: 17px; }
#staff-assistant .sa-actions-panel table { white-space: normal; }
#staff-assistant .sa-actions-panel th { overflow-wrap: normal; }
#staff-assistant .sa-memory { top: 12px; left: 12px; right: auto; max-height: calc(100% - 24px); }
@media (max-width: 900px) {
  body[data-screen="staff-assistant"] main { padding: 8px 8px 0; }
  #staff-assistant .sa-layout { height: calc(100vh - 82px); height: calc(100dvh - 82px); }
  #staff-assistant .sa-side { position: absolute; inset: 0 auto 0 0; z-index: 35; width: min(300px, 86%); box-shadow: 12px 0 40px #0e223833; transform: translateX(-105%); visibility: hidden; transition: transform .2s ease-out, visibility .2s; }
  #staff-assistant .sa-layout.side-open .sa-side { transform: none; visibility: visible; }
  #staff-assistant .sa-side .sa-side-head { display: flex; justify-content: flex-end; }
  #staff-assistant .sa-layout.side-open .sa-scrim { display: block; position: absolute; inset: 0; z-index: 34; background: #0e223833; }
  /* In the drawer: the settings rise as a sheet over the screen, and What I remember stands above the drawer. */
  #staff-assistant .sa-actions-panel { position: fixed; inset: auto 0 0 0; z-index: 40; width: auto; max-height: 82vh; max-height: 82dvh; border: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -14px 50px #0e223847; }
  #staff-assistant .sa-memory { z-index: 36; left: auto; right: 12px; }
}
@media (max-width: 420px) {
  #staff-assistant .as-input .as-lang select { max-width: 84px; }
}
@media (prefers-reduced-motion: reduce) { #staff-assistant .sa-side { transition: none; } }
