/* GAM visual compatibility layer.
   Functional layout comes from the current L.Studio client; this file keeps
   the scale, palette and visual rhythm of the downloaded gam.letopis.ai UI. */
:root {
  --ink: #2b2b2b;
  --ink-soft: #565656;
  --muted: #8a8378;
  --muted-2: #aaa197;
  --paper: #fff;
  --shell: #fdf3ea;
  --shell-strong: #f6e9dc;
  --surface: #fefaf7;
  --line: #eee2d5;
  --line-strong: #dfd0c1;
  --accent: #ff621b;
  --accent-dark: #e65312;
  --accent-soft: #fdebe2;
  --peach: #fff0df;
  --violet: #eee9ff;
  --teal: #dff5f1;
  --blue: #e5f0ff;
  --shadow-sm: 0 5px 18px -16px rgba(62, 39, 25, .32);
  --shadow: 0 18px 48px -34px rgba(62, 39, 25, .36);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar: 256px;
}

body { color: var(--ink); background: var(--shell); font-size: 14px; }

.sidebar {
  width: var(--sidebar);
  padding: 12px;
  background: var(--shell);
}
.sidebar-head { padding: 4px 8px 14px; }
.brand-mark { width: 28px; height: 28px; border-radius: 6px; font-size: 14px; box-shadow: none; }
.brand b { font-size: 14px; font-weight: 650; }
.brand small { font-size: 8px; }
.workspace-switch {
  margin: 4px 0 15px;
  border-color: var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255,255,255,.58);
}
.nav { gap: 2px; }
.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 480;
}
.nav-item svg { color: var(--ink-soft); }
.nav-item:hover { background: var(--shell-strong); }
.nav-item.active { border: 0; background: var(--accent-soft); box-shadow: none; }
.side-status, .user-card {
  min-height: 42px;
  border-color: var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
}
.side-status:hover, .user-card:hover { background: #f8efe4; }

.main-panel {
  margin: 0 8px 8px 0;
  border-color: var(--line);
  border-radius: 12px;
  background: #fff;
}

.home-view { background: #fff; }
.home-inner { width: min(820px, calc(100% - 48px)); padding: 96px 0 72px; }
.home-inner > .eyebrow, .home-inner > .welcome-sub { display: none; }
.welcome,
.main-panel .welcome {
  margin: 0 0 40px;
  font: 400 30px/1.2 Georgia, "Times New Roman", serif;
  letter-spacing: .01em;
}
.prompt-box {
  max-width: 820px;
  min-height: 148px;
  margin-bottom: 54px;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 12px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.prompt-box:focus-within, .prompt-box.dragover { box-shadow: 0 0 0 3px rgba(255,98,27,.12); }
.prompt-box textarea,
.main-panel .prompt-box textarea {
  min-height: 72px;
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, sans-serif;
}
.home-section { max-width: 820px; }
.home-section + .home-section { margin-top: 44px; }
.section-heading { margin-bottom: 12px; }
.section-heading h2, .main-panel .section-heading h2 { font-size: 16px; }
.tool-grid { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tool-card, .tool-card:nth-child(4), .tool-card:nth-child(5),
.tool-card:nth-child(6), .tool-card:nth-child(7) {
  display: grid;
  min-height: 72px;
  grid-template-columns: 44px minmax(0,1fr) auto;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 16px;
  box-shadow: none;
}
.tool-card:last-child { border-bottom: 0; }
.tool-card:hover { border-color: var(--line); background: #fefaf7; box-shadow: none; transform: none; }
.tool-card .tool-icon { width: 40px; height: 40px; border-radius: 10px; }
.tool-copy { padding: 0; }
.tool-copy b, .main-panel .tool-copy b { font-size: 13px; font-weight: 650; }
.tool-copy small, .main-panel .tool-copy small { margin-top: 2px; font-size: 11px; }
.tool-badge { position: static; justify-self: end; }
.tool-arrow { position: static; }
.recent-list { border-radius: 12px; }
.recent-row { min-height: 60px; padding: 9px 13px; }
.recent-copy b, .main-panel .recent-copy b { font-size: 12px; }

.standard-view { padding: 56px clamp(24px, 5vw, 72px) 60px; }
.page-top { max-width: 920px; margin-right: auto; margin-left: auto; }
.page-top h1, .main-panel .page-top h1 { font-size: 30px; }
.page-top p:last-child, .main-panel .page-top p:last-child { font-size: 12px; }
.projects-toolbar, .projects-table, .projects-breadcrumb { max-width: 920px; }
.projects-table { border-radius: 12px; }
.project-row { min-height: 56px; }

.agents-view { padding-top: 72px; }
.agents-hero {
  display: flex;
  max-width: 920px;
  min-height: 178px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin: 0 auto 30px;
  border-radius: 18px;
  padding: 28px 34px;
  background: #ffe0d1;
}
.agents-hero .eyebrow { display: none; }
.agents-hero > div { max-width: 620px; }
.agents-hero h1, .main-panel .agents-hero h1 { margin: 0 0 8px; font-size: 32px; }
.agents-hero p:last-child, .main-panel .agents-hero p:last-child {
  margin: 0;
  color: #6f584c;
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, sans-serif;
}
.agents-hero-icon { display: grid; width: 84px; height: 84px; place-items: center; color: var(--accent); }
.agents-hero-icon svg { width: 72px; height: 72px; }
.agents-heading, .agents-grid { max-width: 920px; }
.agents-grid { gap: 12px; }
.agent-card { border-radius: 12px; padding: 18px; }
.agent-card h3, .main-panel .agent-card h3 { font-size: 15px; }
.agent-card p, .main-panel .agent-card p { font-size: 12px; }

.chat-header { min-height: 56px; gap: 8px; padding: 7px clamp(14px,2vw,28px); }
.chat-header > #chatAgentIcon, .chat-title .eyebrow, .chat-title small { display: none; }
.chat-header-actions .context-pill { display: none; }
.chat-title h1, .main-panel .chat-title h1 { font-size: 18px; }
.chat-messages { width: min(820px, calc(100% - 40px)); padding: 24px 0 154px; }
.message-content, .main-panel .message-content { font-size: 14px; }
.chat-composer { width: min(900px, calc(100% - 32px)); margin-bottom: 14px; border-radius: 16px; padding: 12px; }
.chat-composer textarea, .main-panel .chat-composer textarea { min-height: 52px; font-size: 14px; }

/* Custom agent picker: native select popups ignore the GAM theme on Linux. */
.composer-agent-choice {
  position: relative;
  max-width: 230px;
  height: 34px;
  border: 0;
  padding: 0;
  background: transparent;
}
.chat-agent-picker-button {
  display: inline-flex;
  width: 100%;
  height: 34px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px 0 9px;
  color: var(--ink);
  background: #fff;
  font: 650 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.chat-agent-picker-button:hover { border-color: var(--line-strong); background: #fefaf7; }
.chat-agent-picker-button:focus-visible {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,98,27,.11);
}
.chat-agent-picker-button #chatAgentPickerLabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-agent-picker-button .chevron {
  position: static;
  width: 12px;
  height: 12px;
  margin-left: auto;
  transition: transform .15s ease;
}
.chat-agent-picker-button svg,
.chat-agent-menu svg { position: static; right: auto; }
.chat-agent-picker-button[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.chat-agent-menu {
  position: absolute;
  z-index: 80;
  bottom: calc(100% + 8px);
  left: 0;
  width: min(310px, calc(100vw - 54px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 5px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 45px -22px rgba(62,39,25,.38);
}
.chat-agent-menu > button {
  display: grid;
  width: 100%;
  grid-template-columns: 32px minmax(0,1fr) 16px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 9px;
  padding: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.chat-agent-menu > button:hover,
.chat-agent-menu > button.active { background: var(--surface); }
.agent-menu-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
}
.agent-menu-icon.violet { color: #6d54c7; background: var(--violet); }
.agent-menu-icon.teal { color: #197d74; background: var(--teal); }
.agent-menu-icon svg { width: 14px; height: 14px; }
.chat-agent-menu b { display: block; font-size: 12px; font-weight: 650; }
.chat-agent-menu small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.25; }
.agent-menu-check { width: 14px; height: 14px; color: var(--accent); opacity: 0; }
.chat-agent-menu > button.active .agent-menu-check { opacity: 1; }

/* The chooser appears for a new or clearly changed task. Document
   continuations retain the successful agent for the current project. */
.turn-agent-hint {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.composer-turn-hint { margin-right: auto; }
.turn-agent-inline {
  position: absolute;
  z-index: 6;
  bottom: var(--turn-chooser-bottom, 160px);
  left: 50%;
  width: min(820px, calc(100% - 30px));
  max-height: min(350px, calc(100% - var(--turn-chooser-bottom, 160px) - 54px));
  transform: translateX(-50%);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px;
  background: rgba(255,255,255,.99);
  box-shadow: 0 18px 50px -34px rgba(58,34,20,.55);
}
.turn-agent-inline.is-hidden { display: none; }
.turn-agent-card { width: 100%; max-width: none; }
.turn-agent-card .modal-head { margin-bottom: 5px; }
.turn-agent-card .modal-head .eyebrow { display: none; }
.turn-agent-card .modal-head h2 { font-size: 20px; }
.turn-chooser-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.turn-chooser-summary > p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
.chooser-mode-switch { flex: none; }
.turn-agent-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(152px, 168px);
  gap: 8px;
  margin-top: 9px;
  padding: 1px 1px 5px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}
.turn-agent-row {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px;
  background: #fff;
  scroll-snap-align: start;
}
.turn-agent-row:hover { border-color: var(--line-strong); background: #fffdfb; }
.turn-agent-row .agent-menu-icon { width: 28px; height: 28px; border-radius: 8px; }
.turn-agent-row .agent-menu-icon svg { width: 13px; height: 13px; }
.turn-agent-copy b { display: block; font-size: 12px; }
.turn-agent-copy { min-width: 0; }
.turn-agent-copy small { display: -webkit-box; min-height: 27px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 8.5px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.turn-agent-actions { display: flex; width: 100%; align-items: center; gap: 5px; margin-top: auto; }
.turn-agent-actions .button { flex: 1; justify-content: center; }
.turn-agent-actions .button.small { min-height: 28px; padding: 5px 7px; font-size: 9px; }
.turn-agent-info { color: var(--ink-soft); }
.turn-agent-info:hover, .turn-agent-info:focus-visible { color: var(--accent-dark); background: var(--accent-soft); }
.turn-mode-switch { display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.turn-mode-switch button { border: 0; padding: 5px 7px; color: var(--ink-soft); background: #fff; font: 650 9px/1 Inter, ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.turn-mode-switch button + button { border-left: 1px solid var(--line); }
.turn-mode-switch button.active { color: var(--accent-dark); background: var(--accent-soft); }
.turn-mode-switch button:focus-visible, .turn-agent-submit:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--accent); outline-offset: -2px; }
.turn-agent-kind { display: inline-flex; min-height: 20px; align-items: center; border-radius: 7px; padding: 0 6px; color: var(--muted); background: var(--surface); font-size: 8px; font-weight: 750; }
.agent-card[role="button"] { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.agent-card[role="button"]:hover, .agent-card[role="button"]:focus-visible { border-color: var(--line-strong); outline: 0; box-shadow: 0 18px 42px -34px rgba(58,34,20,.5); transform: translateY(-1px); }
.agent-info-dialog { padding: 20px; }
.agent-info-card { display: flex; width: min(1180px, 100%); height: min(760px, calc(100vh - 40px)); max-height: none; flex-direction: column; overflow: hidden; padding: 28px 32px; }
.agent-info-card #agentInfoSubtitle { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 500; }
.agent-info-content { display: grid; min-height: 0; flex: 1; grid-template-columns: minmax(0, 2fr) minmax(220px, .75fr); gap: clamp(28px, 6vw, 82px); overflow: auto; border-top: 1px solid var(--line); padding-top: clamp(34px, 7vh, 74px); }
.agent-info-content h3 { margin: 0 0 12px; font-size: 17px; }
.agent-info-content p, .agent-info-content li { color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.agent-info-content p { margin: 0; }
.agent-info-main { max-width: 760px; }
.agent-info-main section + section { margin-top: 28px; }
.agent-info-main ul { margin: 0; padding-left: 22px; }
.agent-info-details ul { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.agent-info-details li { border-bottom: 1px solid var(--line); padding-bottom: 11px; }
.message-foot { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.message-foot .message-meta { margin-top: 0; }
.message-copy { display: inline-grid; width: 23px; height: 23px; place-items: center; border: 0; border-radius: 6px; color: var(--muted); background: transparent; opacity: .65; cursor: pointer; }
.message-copy:hover, .message-copy:focus-visible { color: var(--accent-dark); background: var(--accent-soft); opacity: 1; outline: 0; }
.message-copy svg { width: 13px; height: 13px; }
.message-pending { color: var(--muted); font-size: 11px; }
.recognition-status { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 6px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.recognition-status.processing { color: #9a6513; background: #fff6df; }
.recognition-status.ready { color: var(--gam-success, #197d74); background: var(--teal); }
.recognition-status.unrecognized { color: #a23b2b; background: #fff0ed; }
.recognition-status.unrecognized::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.board-card-status.unrecognized { color: #a23b2b; font-weight: 750; }
.selected-artifact .recognition-status { margin-left: 2px; }
.file-drop.selected { border-color: #7dbb98; background: #effaf3; box-shadow: 0 0 0 3px rgba(66,154,102,.11); }
.file-drop.selected .drop-icon { color: #197d74; background: #dff5e8; }
.voice-button.recording { color: #fff; background: #b94632; }
.voice-button.recording:hover { color: #fff; background: #9f3424; }
.voice-state { display: flex; align-items: center; gap: 7px; margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.voice-state.recording { color: #a23b2b; }
.voice-state.transcribing { color: #8b651d; }
.voice-state.error { color: #a23b2b; }
.voice-state i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: thinking-pulse 1.15s ease-in-out infinite; }
.voice-discard { color: #a23b2b; }
.local-audio { display: block; width: min(100%, 300px); height: 32px; margin-top: 8px; }

.board-chat-dock { width: min(452px, calc(100% - 32px)); }
.board-chat-dock.expanded { width: min(704px, calc(100% - 32px)); }
.board-chat-window-actions { top: 7px; right: 8px; }
.board-chat-window-actions button { width: 28px; height: 28px; }
.board-chat-dock .chat-header { min-height: 50px; padding: 7px 70px 7px 12px; }
.board-chat-dock .chat-messages { padding-top: 15px; }
.board-chat-dock .chat-composer { width: calc(100% - 18px); margin-bottom: 8px; padding: 9px 9px 7px; }
.board-chat-dock .composer-toolbar { min-height: 31px; gap: 5px; margin-top: 3px; }
.board-chat-dock .composer-turn-hint { display: none; }
.board-chat-dock .composer-toolbar .icon-button { width: 30px; height: 30px; }
.board-chat-dock .composer-toolbar .send-button { width: 34px; height: 34px; }
.board-chat-dock .turn-agent-inline { bottom: var(--turn-chooser-bottom, 112px); width: calc(100% - 14px); max-height: calc(100% - var(--turn-chooser-bottom, 112px) - 52px); padding: 9px; }
.board-chat-dock .turn-agent-list { grid-auto-columns: minmax(126px, calc((100% - 16px) / 3)); }
.board-chat-launcher {
  height: 42px; gap: 7px; border: 1px solid rgba(255,255,255,.35); padding: 0 15px;
  box-shadow: 0 12px 28px -16px rgba(216,75,28,.9); transition: transform .15s ease, box-shadow .15s ease;
}
.board-chat-launcher:hover { transform: translateY(-1px); box-shadow: 0 16px 32px -16px rgba(216,75,28,.95); }
.board-chat-launcher:focus-visible { outline: 3px solid rgba(255,98,27,.2); outline-offset: 2px; }

.board-toolbar {
  position: absolute; z-index: 24; bottom: 14px; left: 50%; display: flex; height: 46px; align-items: center; gap: 3px;
  transform: translateX(-50%); border: 1px solid var(--line); border-radius: 999px; padding: 4px;
  background: rgba(255,255,255,.97); box-shadow: 0 10px 28px -18px rgba(52,31,20,.46);
}
.board-tool { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 50%; color: var(--ink-soft); background: transparent; cursor: pointer; }
.board-tool svg { width: 16px; height: 16px; }
.board-tool:hover:not(:disabled) { color: var(--accent); background: var(--surface); }
.board-tool.active { color: #fff; background: var(--accent); }
.board-tool:disabled { opacity: .35; cursor: default; }

@media (max-width: 620px) {
  .turn-agent-inline { width: calc(100% - 20px); max-height: min(470px, 62%); padding: 11px; }
  .turn-agent-list { grid-auto-columns: minmax(148px, 48%); }
  .turn-chooser-summary > p { display: none; }
  .agent-info-dialog { padding: 8px; }
  .agent-info-card { height: calc(100vh - 16px); padding: 20px; }
  .agent-info-content { grid-template-columns: 1fr; gap: 28px; padding-top: 26px; }
  .composer-turn-hint { max-width: 150px; font-size: 10px; }
  .chat-header-actions .context-pill { display: none; }
  .board-toolbar { bottom: 10px; height: 42px; }
  .board-tool { width: 32px; height: 32px; }
  .board-chat-dock .turn-agent-list { grid-auto-columns: minmax(148px, 48%); }
}

.board-viewport { background-color: #fff; background-image: none; }
.board-card { border-radius: 12px; box-shadow: 0 12px 34px -28px rgba(16,24,40,.32); }
.board-card:hover { border-color: var(--line-strong); }
.board-card.has-recent-edits { box-shadow: 0 14px 38px -28px rgba(151,108,27,.42); }
.board-topbar { top: 9px; right: 12px; left: 12px; }
.board-chat-dock { border-color: var(--line); border-radius: 12px; box-shadow: 0 18px 52px -36px rgba(65,37,20,.45); }
.board-controls, .board-chat-launcher { border-color: var(--line); }

.chat-questionnaire.carousel { border-color: var(--line); border-radius: 12px; background: #fff; }
.chat-questionnaire.carousel .question-option { border-radius: 9px; }
.focus-card, .modal-card { border-radius: 14px; }
.focus-body { padding-top: 24px; }

@media (max-width: 760px) {
  .main-panel { margin: 0; border: 0; border-radius: 0; }
  .home-inner { width: min(100% - 28px, 820px); padding: 48px 0 56px; }
  .welcome, .main-panel .welcome { margin-bottom: 28px; font-size: 27px; }
  .prompt-box { min-height: 136px; margin-bottom: 38px; }
  .agents-hero { min-height: 0; border-radius: 14px; padding: 22px; }
  .agents-hero-icon { display: none; }
  .composer-agent-choice { max-width: 190px; }

  /* Keep both edge actions reachable when a project has a long name. */
  .board-topbar {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    justify-content: stretch;
    gap: 6px;
  }
  .board-topbar > .icon-button:first-child,
  .board-topbar > .button:last-child {
    position: static;
  }
  .board-topbar > .button:last-child {
    min-width: 0;
    margin-left: 0;
    white-space: nowrap;
  }
  .board-title {
    width: 100%;
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
  }
  .board-title span { overflow: hidden; }

  /* Preserve the document identity when all export actions are present.
     The title and close control own the first row; actions wrap below. */
  .focus-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px 10px;
  }
  .focus-head > div:nth-child(2) { grid-column: 1; grid-row: 1; width: 100%; min-width: 0; }
  .focus-head > .focus-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .focus-head > .icon-button:last-child { grid-column: 2; grid-row: 1; }
  .focus-head h2 { font-size: 17px; }
}

/* Board chat layout V2 -----------------------------------------------------
   Scoped to the board dock: chat state, event handlers and the full-screen
   chat route keep using the same DOM and behavior. */
.board-chat-dock.chat-layout-v2 {
  width: min(500px, calc(100% - 32px));
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 20px 58px -40px rgba(65,37,20,.48);
}
.board-chat-dock.chat-layout-v2.expanded { width: min(720px, calc(100% - 32px)); }
.board-chat-dock.chat-layout-v2 .chat-surface { background: #fff; }
.board-chat-dock.chat-layout-v2 .chat-header {
  min-height: 44px;
  padding: 6px 66px 6px 14px;
  border-bottom-color: rgba(231,218,209,.76);
}
.board-chat-dock.chat-layout-v2 .chat-title h1,
.board-chat-dock.chat-layout-v2 .main-panel .chat-title h1 {
  font-size: 17px;
  line-height: 1.2;
}
.board-chat-dock.chat-layout-v2 .board-chat-window-actions { top: 5px; right: 6px; gap: 1px; }
.board-chat-dock.chat-layout-v2 .board-chat-window-actions button { width: 30px; height: 30px; border-radius: 8px; }
.board-chat-dock.chat-layout-v2 .chat-messages {
  width: calc(100% - 34px);
  padding: 20px 0 142px;
}
.board-chat-dock.chat-layout-v2 .chat-surface.chooser-open .chat-welcome { display: none; }

/* The chooser is a content plane instead of a modal nested in another panel.
   Its dynamic bottom value still protects it from a growing composer. */
.board-chat-dock.chat-layout-v2 .turn-agent-inline {
  top: 44px;
  right: 0;
  bottom: var(--turn-chooser-bottom, 132px);
  left: 0;
  width: 100%;
  max-height: none;
  transform: none;
  overflow: hidden auto;
  border: 0;
  border-radius: 0;
  padding: 20px 16px 16px;
  background: #fff;
  box-shadow: none;
}
.board-chat-dock.chat-layout-v2 .turn-agent-card { display: flex; min-height: 100%; flex-direction: column; }
.board-chat-dock.chat-layout-v2 .turn-agent-card .modal-head { min-height: 28px; margin-bottom: 7px; }
.board-chat-dock.chat-layout-v2 .turn-agent-card .modal-head h2 {
  margin: 0;
  font: 500 19px/1.22 Georgia, "Times New Roman", serif;
}
.board-chat-dock.chat-layout-v2 .turn-agent-card .modal-head .icon-button { width: 28px; height: 28px; }
.board-chat-dock.chat-layout-v2 .turn-chooser-summary { min-height: 28px; gap: 14px; }
.board-chat-dock.chat-layout-v2 .turn-chooser-summary > p {
  max-width: 290px;
  color: #806d62;
  font-size: 10.5px;
  line-height: 1.45;
}
.board-chat-dock.chat-layout-v2 .chooser-mode-switch { border-radius: 999px; }
.board-chat-dock.chat-layout-v2 .turn-mode-switch button { min-height: 26px; padding: 5px 10px; font-size: 9.5px; }
.board-chat-dock.chat-layout-v2 .turn-agent-list {
  grid-auto-columns: 190px;
  gap: 12px;
  margin-top: 14px;
  padding: 1px 1px 10px;
  scrollbar-color: #d8cdc6 transparent;
  scrollbar-width: thin;
}
.board-chat-dock.chat-layout-v2 .turn-agent-list::-webkit-scrollbar { height: 5px; }
.board-chat-dock.chat-layout-v2 .turn-agent-list::-webkit-scrollbar-track { background: transparent; }
.board-chat-dock.chat-layout-v2 .turn-agent-list::-webkit-scrollbar-thumb { border-radius: 999px; background: #d8cdc6; }
.board-chat-dock.chat-layout-v2 .turn-agent-row {
  min-height: 198px;
  gap: 9px;
  border-color: #ebe3dd;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}
.board-chat-dock.chat-layout-v2 .turn-agent-row:hover { border-color: #d9c9be; background: #fff; }
.board-chat-dock.chat-layout-v2 .turn-agent-row .agent-menu-icon { width: 34px; height: 34px; border-radius: 10px; }
.board-chat-dock.chat-layout-v2 .turn-agent-row .agent-menu-icon svg { width: 15px; height: 15px; }
.board-chat-dock.chat-layout-v2 .turn-agent-copy b { font-size: 13px; line-height: 1.3; }
.board-chat-dock.chat-layout-v2 .turn-agent-copy small {
  min-height: 45px;
  margin-top: 5px;
  font-size: 10.5px;
  line-height: 1.45;
  -webkit-line-clamp: 3;
}
.board-chat-dock.chat-layout-v2 .turn-agent-kind { display: none; }
.board-chat-dock.chat-layout-v2 .turn-agent-actions { gap: 7px; margin-top: auto; }
.board-chat-dock.chat-layout-v2 .turn-agent-actions .button.small {
  min-height: 32px;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 10.5px;
}

/* Attachments stay on one horizontal rail so chips do not consume half of
   the composer height. */
.board-chat-dock.chat-layout-v2 .chat-composer {
  width: calc(100% - 20px);
  margin: 0 10px 8px;
  border-radius: 14px;
  padding: 9px 10px 7px;
  box-shadow: 0 13px 34px -28px rgba(74,43,26,.5);
}
.board-chat-dock.chat-layout-v2 .chat-composer .file-chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.board-chat-dock.chat-layout-v2 .chat-composer .file-chips::-webkit-scrollbar { display: none; }
.board-chat-dock.chat-layout-v2 .chat-composer .file-chips:not(:empty) { padding: 3px 0 6px; }
.board-chat-dock.chat-layout-v2 .chat-composer .file-chip {
  min-height: 29px;
  max-width: 250px;
  flex: 0 0 auto;
  padding: 4px 7px 4px 9px;
  font-size: 10px;
}
.board-chat-dock.chat-layout-v2 .chat-composer textarea,
.board-chat-dock.chat-layout-v2 .main-panel .chat-composer textarea {
  min-height: 42px;
  max-height: 118px;
  padding: 4px 3px;
  font-size: 13.5px;
  line-height: 1.48;
}
.board-chat-dock.chat-layout-v2 .composer-toolbar { min-height: 32px; margin-top: 2px; }
.board-chat-dock.chat-layout-v2 .composer-toolbar .icon-button { width: 30px; height: 30px; }
.board-chat-dock.chat-layout-v2 .composer-toolbar .send-button { width: 34px; height: 34px; }

@media (max-width: 760px) {
  .board-chat-dock.chat-layout-v2,
  .board-chat-dock.chat-layout-v2.expanded { width: auto; }
  .board-chat-dock.chat-layout-v2 .turn-agent-inline { padding: 16px 12px 12px; }
  .board-chat-dock.chat-layout-v2 .turn-agent-list { grid-auto-columns: 190px; }
  .board-chat-dock.chat-layout-v2 .turn-agent-row { min-height: 190px; padding: 12px; }
}
