/* Boards use AIDA's existing surfaces and type, independent of the last workflow. */
html:not([data-boards-beta="ready"]) [data-boards-beta-nav],
html:not([data-boards-beta="ready"]) .boards-generation-action { display: none !important; }
.aida-tools-nav-section { display: grid; gap: 5px; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--workspace-line-soft); }
#boardsNav { grid-template-columns: 22px minmax(0, 1fr) auto; }
#boardsNew, .aida-nav-item.boards-list-item { display: flex; width: 100%; }
#boardsNew { white-space: nowrap; }
.boards-beta-badge { display: inline-flex; margin-left: auto; padding: 3px 7px; border: 1px solid var(--workspace-line-soft); border-radius: 6px; color: var(--workspace-muted); font-size: 10px; font-weight: 500; letter-spacing: .02em; }
.boards-sidebar { display: none; }
.boards-open .boards-sidebar { display: block; }
#boardsSidebar { padding-left: 0; }
#boardsNew { min-height: 40px; margin-top: 16px; padding: 0 8px; gap: 10px; }
#boardsList, #boardsSharedList { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin-top: 16px; padding-left: 0; }
#boardsList .boards-list-item, #boardsSharedList .boards-list-item { min-width: 0; min-height: 40px; margin: 0; padding: 0 10px; border: 1px solid transparent; font-size: 13px; font-weight: 400; }
.boards-open .aida-sidebar-nav > :not(.aida-tools-nav-section) { display: none !important; }
.boards-list-item { width: 100%; text-align: left; gap: 8px; }
.boards-list-item > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boards-list-item small { flex-shrink: 0; color: var(--workspace-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
#boardsList .boards-list-item.is-active, #boardsSharedList .boards-list-item.is-active { border-color: var(--workspace-line-soft); background: hsl(0 0% 100% / .05); color: var(--workspace-text); }
.boards-shared-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--workspace-line-soft); }
.boards-shared-section h2 { margin: 0 8px; font-size: 12px; line-height: 1.5; font-weight: 500; color: var(--workspace-muted); }
#boardsSharedList { margin-top: 8px; }
.boards-nav-badges { display: flex; align-items: center; gap: 6px; }
.boards-nav-badges .boards-beta-badge { margin: 0; }
.boards-unread-count { min-width: 20px; padding: 2px 5px; border-radius: 7px; background: #dae5df; color: #202925; font-size: 11px; text-align: center; }
.boards-unread-dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: #dae5df; }
.boards-notification { margin: 8px 0 0; padding: 12px; border: 1px solid var(--workspace-line-soft); border-radius: 12px; background: hsl(0 0% 100% / .025); }
.boards-notification p { margin: 0 0 8px; color: var(--workspace-text); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.boards-notification button { padding: 5px 0; border: 0; background: transparent; color: var(--workspace-text); font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.boards-notification button:focus-visible { outline: 2px solid var(--workspace-text); outline-offset: 3px; }
.boards-notification[hidden], .boards-unread-count[hidden] { display: none !important; }
.boards-sharing-status { margin-right: auto; }
.boards-sharing-status:empty { display: none; }
#boardsNav[aria-pressed="true"] { background: transparent; color: var(--workspace-text); }
.boards-open .app-shell .aida-nav-item:hover .aida-nav-icon { color: var(--workspace-text); }
.boards-open .aida-account-avatar { background: hsl(0 0% 100% / .04); border-color: var(--workspace-line); color: var(--workspace-text); }
.boards-open .app-shell .workspace { display: block; height: 100dvh; min-height: 0; }
.boards-open .app-shell .workspace {
  background: linear-gradient(180deg, #14171a, var(--workspace-bg)) padding-box,
    linear-gradient(135deg, hsl(0 0% 100% / .16), hsl(0 0% 100% / .06)) border-box;
  transition: none;
}
.boards-open .app-shell .workspace::before { background: none; transition: none; }
.boards-open .app-shell .workspace::after { background-position: center top; }
/* A chat preview cannot cover the board; its state is kept for the return to chat. */
.boards-open .app-shell .artifact-panel { display: none !important; }
.boards-open .app-shell.artifact-panel-open .workspace-sidebar-toggle { opacity: 1; pointer-events: auto; }
.boards-open .app-shell .workspace-sidebar-toggle,
.boards-open .app-shell .workspace-sidebar-toggle:hover { border-color: var(--workspace-line); background: var(--workspace-bg-soft); box-shadow: 8px 0 24px hsl(0 0% 0% / .22); }
.boards-open .app-shell .workspace-sidebar-toggle span { background: var(--workspace-text); box-shadow: none; }
.boards-open .app-shell .workspace-sidebar-toggle:focus-visible { outline: 2px solid var(--workspace-text); outline-offset: 2px; }
.boards-open .workspace > :not(#boardsWorkspace) { display: none !important; }
.boards-open .app-shell .workspace > #boardsWorkspace:not([hidden]) { display: flex !important; }
.boards-workspace { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 24px 24px 14px; gap: 16px; color: var(--workspace-text); }
.boards-workspace[hidden] { display: none; }
.boards-workspace [hidden], .boards-dialog [hidden] { display: none !important; }
.boards-workspace, .boards-sidebar, .boards-dialog { font-family: var(--font); }
.boards-workspace button, .boards-sidebar button, .boards-dialog button { font-family: var(--font); }
.boards-toolbar, .boards-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.boards-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); align-items: center; gap: 12px; min-height: 44px; }
.boards-header #boardsBack { justify-self: start; }
.boards-header #boardsRename { justify-self: end; }
.boards-header h1 { min-width: 0; margin: 0; color: var(--workspace-text); text-align: center; font-family: "Aida Agents Serif", serif; font-size: 26px; font-style: italic; font-weight: 400; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boards-header h1 .boards-beta-badge { margin-left: 6px; vertical-align: middle; }
.boards-workspace .quiet-button {
  min-height: 40px; padding: 8px 14px; gap: 8px;
  border: 1px solid var(--workspace-line-soft); border-radius: 12px;
  background: linear-gradient(180deg, hsl(0 0% 100% / .055), hsl(0 0% 100% / .025));
  color: var(--workspace-text); font-size: 13px; font-weight: 500; line-height: 1.2;
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / .025);
  cursor: pointer; white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms cubic-bezier(0.2, 0, 0, 1);
}
.boards-workspace .quiet-button:hover:not(:disabled) { border-color: var(--workspace-line); background: hsl(0 0% 100% / .085); }
.boards-workspace .quiet-button:active:not(:disabled) { transform: scale(.96); }
.boards-workspace #boardsBack, .boards-workspace #boardsRename { border-color: transparent; background: transparent; box-shadow: none; color: var(--workspace-muted); }
.boards-workspace #boardsBack:hover, .boards-workspace #boardsRename:hover { color: var(--workspace-text); background: hsl(0 0% 100% / .04); }
.boards-workspace #boardsUpload { border-color: var(--workspace-line); background: hsl(0 0% 100% / .085); }
.boards-workspace #boardsUpload:hover:not(:disabled) { background: hsl(0 0% 100% / .12); }
.boards-workspace button:disabled, .boards-sidebar button:disabled { opacity: .4; cursor: default; }
.boards-workspace button:focus-visible, .boards-sidebar button:focus-visible, .boards-workspace input:focus-visible, .boards-workspace select:focus-visible, .boards-canvas:focus-visible { outline: 2px solid var(--workspace-text); outline-offset: 3px; }
.boards-count, .boards-zoom-controls, .boards-footer { color: var(--workspace-muted, #adb9b1); font-size: 12px; font-variant-numeric: tabular-nums; }
.boards-count { margin-left: 4px; }
.boards-zoom-controls { display: flex; align-items: center; gap: 0; margin-left: auto; padding: 3px; border: 1px solid var(--workspace-line-soft); border-radius: 14px; background: hsl(0 0% 100% / .025); }
.boards-zoom-controls .quiet-button { min-height: 32px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; }
.boards-zoom-controls #boardsZoomOut, .boards-zoom-controls #boardsZoomIn { width: 32px; padding: 0; font-size: 18px; font-weight: 400; }
#boardsZoomLabel { width: 50px; text-align: center; }
#boardsCopy { min-width: 112px; }
.boards-zoom-controls #boardsFit { margin-left: 4px; border-left: 1px solid var(--workspace-line-soft); border-radius: 0 10px 10px 0; }
.boards-canvas-wrap { position: relative; flex: 1; min-height: 180px; overflow: hidden; border: 1px solid var(--workspace-line-soft); border-radius: 16px; background: var(--workspace-bg); }
.boards-canvas { position: absolute; inset: 0; touch-action: none; background-image: radial-gradient(rgba(210,225,216,.14) .75px, transparent .75px); background-size: 24px 24px; }
.boards-canvas.is-dragover { box-shadow: inset 0 0 0 2px var(--workspace-text); }
.boards-empty { position: absolute; top: 50%; left: 50%; width: min(420px, 85%); transform: translate(-50%, -50%); text-align: center; pointer-events: none; color: var(--workspace-muted, #adb9b1); }
.boards-empty strong { color: var(--workspace-text, #e2e8e4); font-size: 19px; font-weight: 500; }
.boards-empty p { font-size: 13px; line-height: 1.65; }
.boards-dialog option { background: #22282b; color: #e2e8e4; }
.boards-footer { min-height: 24px; }
#boardsMessage { flex-basis: 100%; margin: 0; }
#boardsMessage:empty { display: none; }
.boards-footer .is-error { color: #e6a8a8; }
.boards-element-list button { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.boards-element-list button:focus-visible { z-index: 6; top: 8px; left: 8px; width: auto; max-width: calc(100% - 16px); height: auto; padding: 8px 12px; clip-path: none; background: var(--workspace-bg-soft); color: var(--workspace-text); border: 1px solid var(--workspace-line); border-radius: 10px; overflow: hidden; text-overflow: ellipsis; }
.boards-context { position: absolute; z-index: 4; display: flex; align-items: center; gap: 3px; max-width: calc(100% - 16px); padding: 4px; border: 1px solid var(--workspace-line); border-radius: 14px; background: var(--workspace-bg-soft); box-shadow: 0 4px 16px hsl(0 0% 0% / .24); }
.boards-context button, .boards-text-editor-actions button { min-height: 32px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--workspace-text); font-size: 12px; white-space: nowrap; cursor: pointer; }
.boards-context button:hover, .boards-text-editor-actions button:hover { background: rgba(255,255,255,.08); }
.boards-text-editor { position: absolute; z-index: 5; padding: 8px; border: 1px solid var(--workspace-line); border-radius: 18px; background: var(--workspace-bg-soft); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.boards-text-input { display: block; width: 100%; max-height: min(300px, 40dvh); min-height: 75px; resize: vertical; padding: 4px; border: 0; border-radius: 4px; background: transparent; color: var(--workspace-text); font-family: var(--font); line-height: 1.5; overflow-wrap: break-word; }
.boards-text-editor-actions { display: flex; justify-content: flex-end; gap: 5px; padding-top: 6px; }
/* Native dialog supplies focus trapping; its panel shares the transfer window styles. */
.boards-dialog { width: min(460px, calc(100% - 48px)); max-width: none; max-height: calc(100% - 48px); margin: auto; padding: 0; border: 0; border-radius: 18px; background: transparent; backdrop-filter: none; }
.boards-dialog:not([open]) { display: none; }
.boards-dialog[open] { display: block; }
.boards-dialog::backdrop { background: rgba(3,8,8,.72); backdrop-filter: blur(12px); }
.boards-dialog .transfer-dialog-field input { padding-inline: 12px; }
.boards-dialog .transfer-dialog-close:disabled { cursor: wait; opacity: .55; }
.boards-dialog .transfer-dialog-error:empty { display: none; }
.boards-share-board-name { max-width: 310px; margin: 6px 0 0; color: var(--workspace-muted); font-size: 13px; overflow-wrap: anywhere; }
.boards-share-feedback { margin: 0; color: var(--workspace-text); font-size: 12px; line-height: 1.5; }
.boards-share-feedback:empty { display: none; }
.boards-members-section { padding-top: 16px; border-top: 1px solid var(--workspace-line-soft); }
.boards-members-section h3 { margin: 0 0 10px; font-size: 13px; font-weight: 500; }
#boardsMembersList { max-height: 230px; overflow-y: auto; }
.boards-member-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 13px; }
.boards-member-row > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.boards-member-remove { flex-shrink: 0; min-height: 36px; padding: 6px 8px; border: 1px solid var(--workspace-line-soft); border-radius: 10px; background: transparent; color: var(--workspace-muted); font: inherit; font-size: 12px; cursor: pointer; }
.boards-member-remove:hover { color: var(--workspace-text); background: hsl(0 0% 100% / .04); }
.boards-share-empty { color: var(--workspace-muted); font-size: 12px; line-height: 1.5; }
.boards-dialog button:focus-visible, .boards-dialog select:focus-visible { outline: 2px solid var(--workspace-text); outline-offset: 3px; }
@media (max-width: 620px) {
  .boards-dialog { width: calc(100% - 24px); max-height: calc(100% - 24px); margin: auto auto 12px; border-radius: 18px 18px 12px 12px; }
  .boards-dialog .transfer-dialog-field input { font-size: 16px; }
}
@media (max-width: 760px) {
  .boards-workspace { padding: 24px 28px 12px; gap: 12px; }
  .boards-header { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .boards-header h1 { grid-column: 1 / -1; grid-row: 1; font-size: 24px; }
  .boards-header #boardsBack { grid-column: 1; grid-row: 2; }
  .boards-header #boardsRename { grid-column: 2; grid-row: 2; }
  .boards-toolbar { gap: 8px; }
  .boards-workspace .quiet-button { min-height: 44px; padding-inline: 10px; font-size: 12px; }
  .boards-zoom-controls .quiet-button { min-height: 36px; }
  .boards-toolbar > .quiet-button { flex: 1 1 auto; }
  .boards-zoom-controls { margin-left: 0; }
  .boards-canvas-wrap { min-height: 140px; }
}

/* Local masks reuse the same outline icon language as the AIDA navigation. */
#boardsBack::before, #boardsRename::before, #boardsUpload::before,
#boardsAddText::before, #boardsFit::before, #boardsNew::before, #boardsShare::before {
  content: ""; display: block; width: 16px; height: 16px; flex: 0 0 16px;
  background: currentColor; mask: var(--boards-icon) center / contain no-repeat;
}
#boardsBack { --boards-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m10 5-7 7 7 7M3 12h18'/%3E%3C/svg%3E"); }
#boardsRename { --boards-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 5 4 4M4 20l4-1L20 7a2.8 2.8 0 0 0-4-4L4 15z'/%3E%3C/svg%3E"); }
#boardsUpload { --boards-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='8' cy='8' r='1.5'/%3E%3Cpath d='m3 17 5-5 4 4 4-6 5 7'/%3E%3C/svg%3E"); }
#boardsAddText { --boards-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7V4h16v3M12 4v16M8 20h8'/%3E%3C/svg%3E"); }
#boardsFit { --boards-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H3v5M16 3h5v5M3 16v5h5M21 16v5h-5'/%3E%3C/svg%3E"); }
#boardsNew { --boards-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
#boardsShare { --boards-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Cpath d='M3 20v-2a6 6 0 0 1 12 0v2M17 5a3 3 0 0 1 0 6M21 20v-2a6 6 0 0 0-3-5'/%3E%3C/svg%3E"); }
@media (prefers-reduced-motion: reduce) {
  .boards-workspace .quiet-button { transition: none; }
  .boards-workspace .quiet-button:active:not(:disabled), .boards-dialog .transfer-dialog-button:hover:not(:disabled) { transform: none; }
}

