@import url("./application-colours.css");
@import url('./journey.css');
@import url('./signup.css');
@import url("./buttons.css");
@import url("./messages.css");
@import url("./dock.css");
@import url("./inputs.css");

/* Shared application shell: the sidebar, header and layout used by every application page
   (chat, Converter para Excel and future apps). Load after foundations.css and before the
   application's own stylesheet. Spec: docs/design/DESIGN_SYSTEM.md#application-shell. */
.app { font: var(--text-16)/1.65 var(--font-sans); color: var(--ink); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
button, textarea, input { font: inherit; }
button { border: 1px solid transparent; border-radius: var(--radius-md); padding: 8px 15px; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:where(button, a, summary, [tabindex]):focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration: underline; }
.icon { display: block; width: 18px; height: 18px; flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; flex-shrink: 0; }
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); height: 100dvh; }
.sidebar { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; border-right: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: var(--text-13); overflow-y: auto; }
.brand-wordmark { display: block; width: auto; height: 20px; }
.brand-symbol { display: none; width: auto; height: 24px; }
.brand-row { display: flex; align-items: center; gap: 10px; padding: 0 4px; margin-bottom: 12px; }
.brand { display: flex; flex-shrink: 0; gap: 10px; align-items: center; color: inherit; text-decoration: none; font-weight: var(--weight-semibold); font-size: var(--text-17); min-width: 0; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 30px; padding: 5px; border: 0; background: transparent; color: var(--ink-muted); border-radius: var(--radius-md); }
#sidebar-toggle { margin-left: auto; }
.icon-button:hover { background: var(--surface-sunken); color: var(--ink); }
.new-chat { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); margin: 12px 0 6px; padding: 9px 14px; min-height: 46px; font-size: var(--text-14); box-shadow: 0 1px 2px rgb(19 19 19 / .04); }
.new-chat:hover:not(:disabled) { border-color: var(--ink); background: var(--paper); }
.new-chat:active:not(:disabled) { box-shadow: inset 0 2px 3px rgb(19 19 19 / .1); }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.brand-row, .sidebar > .new-chat, .account { flex-shrink: 0; }
.nav-caption { font-size: var(--text-12); color: var(--ink-muted); padding: 14px 12px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; text-align: left; background: transparent; color: var(--ink-muted); border-radius: var(--radius-md); font-size: var(--text-14); }
.nav-item .sidebar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover:not(:disabled) { background: var(--surface-sunken); }
.nav-item.selected { background: var(--surface); border: .5px solid var(--line); color: var(--ink); }
#current-chat .sidebar-label { color: var(--ink); }
.account { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 4px 0; border-top: .5px solid var(--line); font-size: var(--text-13); }
.account-info { display: flex; flex-direction: column; min-width: 0; }
.organization { color: var(--ink-muted); font-size: var(--text-12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-settings { margin-left: auto; color: var(--ink-muted); }
.account-info { overflow-wrap: anywhere; }
#account-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#account-error { color: var(--danger); font-size: var(--text-12); }
#account-control { flex-shrink: 0; min-height: 44px; padding: 8px; background: transparent; }
.account-icon { display: none; }
.main-panel { grid-column: 2; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface); }
.column { width: min(760px, calc(100% - 48px - var(--thread-gutter, 0px))); margin-inline: auto; }
.topbar { height: 52px; flex-shrink: 0; border-bottom: .5px solid var(--line); color: var(--ink); font-size: var(--text-16); }
.header-content { width: calc(100% - 48px); height: 100%; display: flex; align-items: center; justify-content: flex-start; gap: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
[hidden] { display: none !important; }
.app.sidebar-collapsed { grid-template-columns: 56px minmax(0, 1fr); }
.sidebar-collapsed .sidebar { padding: 16px 8px; align-items: center; }
.sidebar-collapsed .sidebar-label { display: none; }
.sidebar-collapsed .brand-row { flex-direction: column; padding: 0; gap: 8px; }
.sidebar-collapsed #sidebar-toggle { margin: 0; }
.sidebar-collapsed .new-chat, .sidebar-collapsed .nav-item { padding: 8px; width: 40px; justify-content: center; }
.sidebar-collapsed .account { padding-inline: 0; }
.sidebar-collapsed #account-control { width: 40px; display: flex; justify-content: center; }
.sidebar-collapsed .account-icon { display: inline-flex; }
.sidebar-collapsed .brand-wordmark { display: none; }
.sidebar-collapsed .brand-symbol { display: block; }
#mobile-menu, .sidebar-backdrop { display: none; }
@media (max-width: 960px) {
  .app, .app.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
  .main-panel { grid-column: 1; }
  .sidebar { display: none; }
  .sidebar-expanded .sidebar { display: flex; position: fixed; inset: 0 auto 0 0; width: min(248px, calc(100% - 48px)); z-index: 5; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 4; border: 0; border-radius: 0; background: rgb(19 19 19 / .3); }
  #mobile-menu { display: inline-flex; min-width: 40px; min-height: 40px; }
  .topbar { height: 56px; }
  .header-content { width: calc(100% - 24px); gap: 8px; }
}
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#saved-history { min-width: 0; }
#history-list { display: flex; flex-direction: column; gap: 4px; }
.history-row { display: flex; align-items: center; min-width: 0; border-radius: var(--radius-md); }
.history-row.selected { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.history-open { flex: 1; min-width: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; text-align: left; background: transparent; padding: 9px 8px; font-size: var(--text-13); color: var(--ink); }
.history-delete { flex: 0 0 auto; padding: 8px; background: transparent; color: var(--ink-muted); }
/* A page's saved work in CONVERSAS: a short muted label before its title. */
.history-tag { margin-right: 6px; padding: 1px 4px; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--text-11); font-weight: var(--weight-semibold); color: var(--ink-muted); }
.history-row:hover { background: var(--surface-sunken); }
#history-status { font-size: var(--text-12); color: var(--ink-muted); padding: 0 8px; }
#history-more, #history-retry { background: transparent; font-size: var(--text-12); color: var(--ink); }
#delete-title { overflow-wrap: anywhere; font-weight: var(--weight-semibold); }
/* One light sidebar, with the same catalogue and history controls in every application. */
.sidebar .new-chat { justify-content: center; min-height: 36px; margin: 0 0 12px; padding: 6px 10px; border-color: var(--line); background: var(--surface); color: var(--ink); box-shadow: none; font-size: var(--text-13); }
.sidebar .new-chat .icon { width: 14px; height: 14px; }
.sidebar .nav-item.selected, .sidebar .history-row.selected { background: var(--line); border-color: transparent; box-shadow: none; }
.sidebar .nav-item { color: var(--ink); font-size: var(--text-13); min-height: 38px; border-radius: var(--radius-md); }
.sidebar .nav-item .icon { color: var(--ink-muted); }
.sidebar .nav-caption { margin: 0; font-size: 11.5px; font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: .04em; padding: 10px 10px 4px; }
.sidebar-nav:not(:has(#guest-history-description:not([hidden]), #current-chat:not([hidden]), #saved-history:not([hidden]) .history-row)) > .nav-caption { display: none; }
#guest-history-description { padding: 4px 10px; margin: 0; font-size: 12px; line-height: 1.45; color: var(--ink-muted); }
.guest-reminder { flex-shrink: 0; margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.guest-card-row { display: flex; align-items: center; gap: 10px; }
.guest-avatar { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 12px; font-weight: 600; }
.guest-card-name { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; }
#sidebar-usage { color: var(--ink-muted); font-size: 12px; }
.sidebar:has(#guest-reminder:not([hidden])) .account { display: none; }
.sidebar-collapsed .sidebar:has(#guest-reminder:not([hidden])) .account { display: flex; }
.sidebar .account { padding-top: 16px; }
.account-info { flex: 1; }
#account-open { flex-shrink: 0; padding: 8px 4px; min-height: 44px; font-size: var(--text-12); background: transparent; color: var(--ink); }
.sidebar-collapsed .account { flex-direction: column; gap: 2px; }
#account-open .account-icon { display: inline-flex; }
#account-open .sidebar-label { display: none; }
.sidebar-collapsed #account-open { width: 40px; }

/* Application links (src/shared/applications.ts) sit between Nova conversa and Recentes. */
.app-links { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; margin: 0 0 8px; }
a.new-chat, .app-link { text-decoration: none; }
@media (max-width: 600px) {
  .sidebar :is(.icon-button,.new-chat,.nav-item) { min-height:44px; }
  .sidebar .icon-button { min-width:44px; }
  .column { width: calc(100% - 24px - var(--thread-gutter, 0px)); }
  .sidebar-collapsed .account { flex-direction: row; }
}
/* Header title for application pages. */
.topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Activity panel and run status shared by task applications (cClassTrib e CST, the converters).
   Opt in with class="with-activity-panel" on <body>; script: src/shared/activity-panel.ts. */
.with-activity-panel .run-status { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-12); font-variant-numeric: tabular-nums; }
.with-activity-panel .run-dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.with-activity-panel .run-status.is-running .run-dot { display: inline-block; animation: activity-pulse 1.6s infinite; }
.with-activity-panel .elapsed { color: var(--ink-muted); }
.with-activity-panel .elapsed:not(:empty)::before { content: "· "; }
@keyframes activity-pulse { 50% { opacity: .3; } }
/* Painel de Atividades steps, in chat and the task applications (src/shared/activity-steps.ts):
   one row per step with its status in words, the running step pulsing, a finished step's duration. */
:is(.conversation-panel, .activity-details) .step { display: grid; gap: 2px; margin-top: var(--space-2); padding-left: var(--space-3); border-left: 1px solid var(--line-strong); color: var(--ink); }
:is(.conversation-panel, .activity-details) .step-title { display: flex; align-items: baseline; gap: var(--space-2); margin: 0; font-size: var(--text-12); font-weight: var(--weight-medium); }
:is(.conversation-panel, .activity-details) .step-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
:is(.conversation-panel, .activity-details) .step-duration { flex-shrink: 0; color: var(--ink-muted); font-weight: var(--weight-regular); font-variant-numeric: tabular-nums; white-space: nowrap; }
:is(.conversation-panel, .activity-details) .step-state { margin: 0; color: var(--ink-muted); font-size: var(--text-11); line-height: 1.5; }
:is(.conversation-panel, .activity-details) .step[data-status="running"] .step-state::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--ink); vertical-align: middle; animation: activity-pulse 1.6s infinite; }
:is(.conversation-panel, .activity-details) .step[data-status="unsuccessful"] .step-state { color: var(--warn); }
:is(.conversation-panel, .activity-details) .step[data-status="failed"] { border-left-color: var(--danger); }
:is(.conversation-panel, .activity-details) .step[data-status="failed"] :is(.step-state, .step-title) { color: var(--danger); }
:is(.conversation-panel, .activity-details) :is(.step-context, .step-progress, .step-detail) { margin: 0; color: var(--ink-muted); font-size: var(--text-11); line-height: 1.5; overflow-wrap: anywhere; }
:is(.conversation-panel, .activity-details) .step-context { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
:is(.conversation-panel, .activity-details) .step-progress { color: var(--ink); font-variant-numeric: tabular-nums; }
:is(.conversation-panel, .activity-details) .step-sources { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
:is(.conversation-panel, .activity-details) .step-sources-title { margin: 0; color: var(--ink-muted); font: var(--weight-semibold) var(--text-11)/1.5 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
:is(.conversation-panel, .activity-details) .step-sources ul { display: grid; gap: var(--space-2); margin: var(--space-2) 0 0; padding: 0; list-style: none; }
:is(.conversation-panel, .activity-details) .step-sources a { color: var(--ink); font-size: var(--text-12); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .with-activity-panel .run-status.is-running .run-dot { animation: none; } }
.with-activity-panel .app.panel-open { grid-template-columns: 248px minmax(0, 1fr) 320px; }
.with-activity-panel .app.sidebar-collapsed.panel-open { grid-template-columns: 56px minmax(0, 1fr) 320px; }
.panel-toggle { margin-left: auto; flex-shrink: 0; }
.with-activity-panel .conversation-panel { grid-column: 3; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: var(--text-12); }
.with-activity-panel .conversation-panel-header { display: flex; align-items: center; flex-shrink: 0; gap: var(--space-2); min-height: 52px; padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4); border-bottom: 1px solid var(--line); }
.with-activity-panel .conversation-panel-header h2 { flex: 1; margin: 0; font: var(--weight-medium) var(--text-13)/1.5 var(--font-sans); }
.with-activity-panel .conversation-panel-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.with-activity-panel .panel-section { padding: var(--space-5) var(--space-4); border-bottom: 1px solid var(--line); }
.with-activity-panel .panel-section h3 { margin: 0 0 var(--space-3); color: var(--ink-muted); font: var(--weight-semibold) var(--text-11)/1.5 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.with-activity-panel .panel-section p { margin: 0; overflow-wrap: anywhere; color: var(--ink-muted); }
.with-activity-panel #panel-file { font-size: var(--text-12); font-variant-numeric: tabular-nums; }
.with-activity-panel .activity { margin: 0 0 var(--space-5); }
.with-activity-panel .activity > summary { font-weight: var(--weight-medium); }
.with-activity-panel .activity summary { cursor: pointer; overflow-wrap: anywhere; }
@media (max-width: 960px) {
 .with-activity-panel .app.panel-open, .with-activity-panel .app.sidebar-collapsed.panel-open { grid-template-columns: minmax(0, 1fr); }
 .with-activity-panel .conversation-panel { position: fixed; inset: 0; z-index: 6; border-left: 0; }
 .with-activity-panel .conversation-panel-header { min-height: 56px; }
 .with-activity-panel .conversation-panel-scroll { padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 600px) {
 .with-activity-panel :is(.panel-toggle, .conversation-panel .icon-button) { min-height: 44px; min-width: 44px; }
 .with-activity-panel .activity summary { min-height: 44px; }
}

/* Task applications (cClassTrib e CST, XML para Excel, SPED para Excel): shared text,
   buttons, status pills, view tabs and tables. Opt in with class="task-app" on the work
   area and its dialogs. Spec: docs/design/DESIGN_SYSTEM.md#components. */
.task-app p { margin: 0; }
.task-app h1 { margin: 0; font-size: var(--text-32); line-height: 1.2; letter-spacing: -.02em; }
.task-app h2 { margin: 0; font-size: var(--text-20); line-height: 1.4; }
.task-app h3 { margin: 0; font-size: var(--text-17); line-height: 1.4; }
.task-app .muted { color: var(--ink-muted); }
.task-app .eyebrow { margin: 0; color: var(--ink-muted); font: var(--weight-semibold) var(--text-11)/1.45 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; }
.task-app .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.task-app .visually-hidden, .task-app .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
/* Text actions explicitly use .button; variants are shared through buttons.css. */
.task-app :is(a, button, input, textarea, summary, [tabindex="0"]):focus-visible, .task-app .button:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* View tabs share the button toggle treatment on a Papel track. */
.task-app .view-tabs { display: flex; gap: var(--space-1); padding: var(--space-1); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }

/* Task work area: scrolling body, result heading and framed tables. The illustrated entry,
   coloured job header and floating dock are shared through journey.css and dock.css. */
.task-page { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; overflow-y: auto; color: var(--ink); font: var(--weight-regular) var(--text-14)/1.6 var(--font-sans); overflow-wrap: anywhere; }
.main-panel:has(> .task-page) { background: var(--surface); }
.task-page [data-icon] .icon { width: 18px; height: 18px; }
.task-page .filename { font-size: var(--text-13); font-variant-numeric: tabular-nums; }

.task-page .file-context, .task-page .file-state { font-size: var(--text-12); }

.task-page .task-messages { flex-shrink: 0; }
.task-page .task-messages:has(> :not([hidden]):not(:empty)) { padding: var(--space-3) var(--space-5); }
.task-page .task-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* Upload feedback and entry text used by every task dock. */

.task-page .lead { max-width: 640px; color: var(--ink-muted); font-size: var(--text-16); }
.task-page .entry-error { width: 100%; }
.task-page .entry-error .filename { font-size: var(--text-12); }
.task-page .entry-error .filename:empty { display: none; }
.task-page progress { width: 100%; height: 4px; appearance: none; border: 0; border-radius: var(--radius-sm); background: var(--line); overflow: hidden; }
.task-page progress::-webkit-progress-bar { background: var(--line); }
.task-page progress::-webkit-progress-value { background: var(--ink); }
.task-page progress::-moz-progress-bar { background: var(--ink); }
.task-page .upload-status { color: var(--ink-muted); font-size: var(--text-12); }
.task-page .upload-status:empty { display: none; }

/* Work view: a heading block (state, title, counts, view tabs, lead, current operation and the
   optional-input callout) over a framed table that shrinks to its rows and scrolls within the available area. */
.task-page .task-heading { flex-shrink: 0; display: grid; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.task-page .heading-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.task-page .heading-title { display: grid; gap: var(--space-1); min-width: 0; }
.task-page .result-counts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.task-page .result-counts:not(:has(> :not([hidden]))) { display: none; }
.task-page .result-line { font-size: var(--text-13); }
.task-page .result-line:empty { display: none; }
.task-page .heading-row .view-tabs { margin-left: auto; }
.task-page .option-callout { display: flex; align-items: center; gap: var(--space-4); justify-self: start; max-width: 560px; padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); }
.task-page .option-callout > div { min-width: 0; }
.task-page .callout-title { font-size: var(--text-13); font-weight: var(--weight-semibold); }
.task-page .callout-preview { font-size: var(--text-12); }
.task-page .option-callout button { flex-shrink: 0; }

@media (max-width: 720px) {

  .task-page .run-status .quiet { display: none; }
  .task-page .drop-word { display: none; }

  .task-page .task-heading { padding: var(--space-3); }
  .task-page .heading-row .view-tabs { width: 100%; margin-left: 0; }
  .task-page .heading-row .view-tabs button { flex: 1; }
}
@media (max-width: 600px) {

  .task-page h1 { font-size: var(--text-28); }
  .task-page .option-callout { flex-wrap: wrap; }

}
@media (max-height: 600px) {
  .task-page .task-heading { gap: var(--space-2); padding-block: var(--space-2); }

}

/* Ruled data tables (D41), shared with chat answers: a --line rule around every cell, a sunken
   head row at the cells' size. Answer tables fit their content; .dense tool tables fill the area. */
:is(.data-table, .answer .content table) :is(th, td) { padding: var(--space-2) var(--space-3); border: 1px solid var(--line); vertical-align: top; }
:is(.data-table, .answer .content table) th { text-align: left; }
:is(.data-table, .answer .content table) thead th { background: var(--surface-sunken); }
.data-table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.data-table.dense { width: 100%; font-size: var(--text-13); line-height: 1.45; }
.data-table .num { text-align: right; }
/* Task tables share a ruled frame inside the page gutter; long tables scroll within it. */
.task-page .table-frame { flex: 0 1 auto; min-height: 0; margin: var(--space-4) var(--space-5) var(--space-5); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.data-table.framed { border-collapse: separate; border-spacing: 0; }
.task-page .data-table.framed :is(th, td) { border-width: 0 1px 1px 0; }
.task-page .data-table.framed thead th { position: sticky; top: 0; z-index: 1; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); }
.data-table.framed :is(th, td):last-child { border-right: 0; }
.data-table.framed tbody tr:last-child > * { border-bottom: 0; }
@media (max-width: 720px) { .task-page .table-frame { margin-inline: var(--space-3); } }
.task-app .table-scroll { max-width: 100%; overflow: auto; }
@media (max-width: 600px) {
  :is(.data-table, .answer .content table) :is(th, td) { padding: var(--space-2); }
}

.panel-toggle.is-running::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: var(--space-2); border-radius: 50%; background: currentColor; animation: activity-pulse 1.6s infinite; }
@media (prefers-reduced-motion: reduce) { .panel-toggle.is-running::before { animation: none; } }

/* Answer/table copy controls shared by Chat and task answers. */
.copy-control { position: relative; width: var(--space-6); height: var(--space-6); color: var(--ink); }
@media (max-width: 600px) {
  .copy-control { min-width: 44px; min-height: 44px; }
}
.copy-answer { margin-top: var(--space-3); }

.content .table-actions { display: flex; margin: var(--space-2) 0 var(--space-4); }

.app-links .sidebar-label{white-space:normal;overflow:visible;text-overflow:clip;line-height:1.35}.sidebar .app-links{flex-shrink:0}.sidebar{min-height:0}.sidebar-nav{overflow-y:auto;min-height:0}

#declared-profile-settings { display:grid; gap:var(--space-3); }

/* Desktop account popover on every sidebar page (profile-menu.ts sets .account-menu). */
.sidebar.account-menu :is(#account-open, #account-control, .guest-card-row [data-guest-login]) { display:none; }
.sidebar.account-menu .profile-menu-toggle { flex-shrink:0; margin-left:auto; min-width:36px; min-height:36px; }
.sidebar-collapsed .sidebar.account-menu .profile-menu-toggle { margin-left:0; }
.profile-account-menu { position:fixed; inset:auto; margin:0; width:240px; max-width:calc(100vw - 24px); padding:var(--space-2); border:1px solid var(--line); border-radius:var(--radius-xl); background:var(--surface); color:var(--ink); box-shadow:var(--shadow-card); }
.profile-menu-heading { margin:var(--space-2) var(--space-3); font:var(--weight-medium) var(--text-12)/1.5 var(--font-sans); color:var(--ink-muted); }
.profile-menu-action { display:flex; align-items:center; width:100%; min-height:44px; gap:var(--space-3); padding:var(--space-3); text-align:left; justify-content:flex-start; border:0; border-radius:var(--radius-lg); color:var(--ink); background:transparent; font:var(--weight-medium) var(--text-13)/1.5 var(--font-sans); }
.profile-account-menu .profile-menu-action:hover:not(:disabled) { background:var(--neutral-wash); }

/* Shared optional application assistant. */
.application-assistant { position:fixed; inset:var(--space-4) var(--space-4) var(--space-4) auto; z-index:80; width:min(420px,calc(100vw - 32px)); overflow:auto; display:flex; flex-direction:column; gap:var(--space-3); padding:var(--space-4); border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--surface); color:var(--ink); font:var(--text-14)/1.6 var(--font-sans); }
.application-assistant[hidden] { display:none; }
.application-assistant h2 { font-size:var(--text-20); }
.application-assistant :is(label,textarea) { display:block; width:100%; }
.application-assistant textarea { min-height:6rem; margin-block:var(--space-2); border:1px solid var(--line-strong); border-radius:var(--radius-md); background:var(--surface); color:var(--ink); padding:var(--space-3); font:var(--text-14)/1.6 var(--font-sans); }
.application-assistant textarea:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
