/* src/client/styles.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  color: #e8eaf0;
  background: #1a1d24;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
}

#root {
  height: 100vh;
}

.muted {
  color: #9aa0ad;
}

a, a:visited {
  color: #8ab4f8;
}

a:hover {
  color: #aecbfa;
}

.error {
  color: #f28b82;
  margin: .75rem 0;
}

.centered {
  display: flex;
  justify-content: center;
  align-items:  center;
  height: 100vh;
  padding: 1.5rem;
}

.layout {
  display: flex;
  height: 100vh;
}

.sidebar {
  display: flex;
  overflow: hidden;
  background: #14161c;
  border-right: 1px solid #333a4a;
  flex-direction: column;
  flex-shrink: 0;
  gap: 1rem;
  width: 280px;
  padding: 1.25rem 1rem;
}

.sidebar-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: .5rem;
}

.sidebar h1 {
  color: #8ab4f8;
  font-size: 1.35rem;
}

.conversation-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.conversation-item {
  display: flex;
  cursor: pointer;
  border: 1px solid #0000;
  border-radius: 8px;
  align-items:  center;
  gap: .4rem;
  padding: .5rem .6rem;
}

.conversation-item:hover {
  background: #232733;
}

.conversation-item.active {
  background: #232733;
  border-color: #8ab4f8;
}

.conversation-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .15rem;
  min-width: 0;
}

.conversation-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .95rem;
}

.conversation-date {
  color: #9aa0ad;
  font-size: .75rem;
}

.conversation-child {
  color: #8ab4f8;
  white-space: nowrap;
  font-size: .75rem;
}

.conversation-child:before {
  content: "·";
  color: #9aa0ad;
  margin: 0 .3rem;
}

.conversation-title-input {
  color: #e8eaf0;
  background: #1a1d24;
  border: 1px solid #8ab4f8;
  border-radius: 6px;
  flex: 1;
  min-width: 0;
  padding: .3rem .4rem;
  font-size: .9rem;
}

.conversation-actions {
  display: flex;
  opacity: 0;
  gap: .15rem;
}

.conversation-item:hover .conversation-actions, .conversation-item.active .conversation-actions {
  opacity: 1;
}

.icon-button {
  color: #9aa0ad;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 6px;
  padding: .2rem .35rem;
  font-size: .9rem;
}

.icon-button:hover {
  color: #e8eaf0;
  background: #333a4a;
}

.icon-button.danger:hover {
  color: #f28b82;
}

.chatview {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.chat-header {
  display: flex;
  border-bottom: 1px solid #232733;
  justify-content: space-between;
  align-items:  center;
  gap: 1rem;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: .6rem 1.5rem;
}

.chat-header-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.web-search-toggle {
  display: flex;
  flex-shrink: 0;
  align-items:  center;
  gap: .6rem;
}

.web-search-toggle label {
  display: flex;
  cursor: pointer;
  align-items:  center;
  gap: .4rem;
  font-size: .9rem;
}

.web-search-toggle input[type="checkbox"] {
  accent-color: #8ab4f8;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.web-search-hint {
  font-size: .75rem;
}

.conv-info {
  display: flex;
  flex-shrink: 0;
}

.conv-info-button {
  color: #b6bcc9;
  cursor: pointer;
  display: flex;
  background: none;
  border: 1px solid #333a4a;
  border-radius: 999px;
  justify-content: center;
  align-items:  center;
  width: 26px;
  height: 26px;
  font-size: .95rem;
  line-height: 1;
}

.conv-info-button:hover, .conv-info-button[aria-expanded="true"] {
  color: #8ab4f8;
  border-color: #8ab4f8;
}

.conv-info-modal {
  position: relative;
  overflow-y: auto;
  text-align: left;
  cursor: default;
  background: #1e222b;
  border: 1px solid #333a4a;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  padding: 1.25rem;
  box-shadow: 0 8px 24px #00000073;
}

.conv-info-close {
  position: absolute;
  color: #b6bcc9;
  cursor: pointer;
  background: none;
  border: none;
  padding: .25rem;
  font-size: 1.1rem;
  line-height: 1;
  top: .75rem;
  right: .75rem;
}

.conv-info-close:hover {
  color: #e8eaf0;
}

.conv-info-title {
  color: #8ab4f8;
  margin-bottom: .75rem;
  font-size: 1rem;
}

.conv-info-voice {
  display: flex;
  background: #232733;
  border: 1px solid #333a4a;
  border-radius: 8px;
  flex-direction: column;
  gap: .15rem;
  margin-bottom: .75rem;
  padding: .6rem .75rem;
}

.conv-info-voice-label {
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .75rem;
}

.conv-info-voice-value {
  color: #e8eaf0;
  word-break: break-word;
  font-size: 1.25rem;
  font-weight: 600;
}

.conv-info-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .4rem .75rem;
  font-size: .85rem;
}

.conv-info-grid dt {
  color: #9aa0ad;
  white-space: nowrap;
}

.conv-info-grid dd {
  word-break: break-word;
}

.conv-info-grid dd code {
  background: #232733;
  border-radius: 4px;
  padding: .1rem .3rem;
  font-size: .8rem;
}

.conv-info-friendly {
  font-size: .8rem;
}

.conv-info-note {
  border-top: 1px solid #333a4a;
  margin-top: .85rem;
  padding-top: .6rem;
  font-size: .75rem;
}

.chat-scroll {
  overflow-y: auto;
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem;
}

.empty-state {
  display: flex;
  text-align: center;
  flex-direction: column;
  flex: 1;
  justify-content: center;
  align-items:  center;
  gap: .75rem;
  padding: 1.5rem;
}

.empty-title {
  color: #8ab4f8;
  font-size: 1.4rem;
}

.setup {
  display: flex;
  background: #232733;
  border: 1px solid #333a4a;
  border-radius: 12px;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
  max-width: 520px;
  padding: 1.5rem;
}

.setup h2 {
  font-size: 1.25rem;
}

.setup p {
  color: #b6bcc9;
  font-size: .9rem;
  line-height: 1.5;
}

.setup label {
  margin-top: .5rem;
  font-weight: 600;
}

.setup input {
  color: #e8eaf0;
  background: #1a1d24;
  border: 1px solid #3c4457;
  border-radius: 8px;
  padding: .6rem .75rem;
  font-size: 1rem;
}

.setup input:focus {
  outline: none;
  border-color: #8ab4f8;
}

.setup button {
  color: #1a1d24;
  cursor: pointer;
  background: #8ab4f8;
  border: none;
  border-radius: 8px;
  align-self:  flex-start;
  padding: .6rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
}

.setup button:hover:not(:disabled) {
  background: #a5c5fa;
}

.setup button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.banner {
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: .75rem 1rem;
  font-size: .9rem;
  line-height: 1.4;
}

.banner ol, .banner ul {
  margin: .4rem 0 0;
  padding-left: 1.4rem;
}

.banner li {
  margin-bottom: .35rem;
}

.banner-error {
  color: #f28b82;
  background: #3a2224;
  border: 1px solid #a04a4a;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.bubble {
  white-space: pre-wrap;
  border-radius: 14px;
  max-width: 85%;
  padding: .75rem 1rem;
  line-height: 1.5;
}

.bubble.user {
  background: #2f4b7c;
  border-bottom-right-radius: 4px;
  align-self:  flex-end;
}

.bubble.assistant {
  background: #232733;
  border: 1px solid #333a4a;
  border-bottom-left-radius: 4px;
  align-self:  flex-start;
}

.style-marker {
  display: inline-block;
  vertical-align: baseline;
  color: #9aa0ad;
  white-space: normal;
  background: #2c3242;
  border: 1px solid #3c4457;
  border-radius: 6px;
  margin: 0 .15rem;
  padding: 0 .35rem;
  font-size: .75em;
  font-style: italic;
  line-height: 1.6;
}

.style-marker:before {
  content: "🎭 ";
  font-style: normal;
}

.citations {
  display: flex;
  white-space: normal;
  border-top: 1px solid #333a4a;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  margin-top: .6rem;
  padding-top: .5rem;
  font-size: .78rem;
}

.citations-label {
  color: #9aa0ab;
}

.citation-link {
  color: #8ab4f8;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.citation-link:hover {
  text-decoration: underline;
}

.replay-button {
  display: block;
  color: #e8eaf0;
  cursor: pointer;
  background: #333a4a;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  margin-top: .6rem;
  font-size: .85rem;
}

.replay-button:hover {
  color: #8ab4f8;
  background: #3c4457;
}

.settings-page {
  display: flex;
  background: #1a1d24;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.settings-page-header {
  display: flex;
  align-items:  center;
  gap: 1rem;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: .75rem 1.5rem;
}

.settings-page-header h2 {
  color: #8ab4f8;
  font-size: 1.15rem;
}

.back-button {
  color: #e8eaf0;
  cursor: pointer;
  background: #232733;
  border: 1px solid #333a4a;
  border-radius: 8px;
  flex-shrink: 0;
  padding: .4rem .75rem;
  font-size: .9rem;
}

.back-button:hover {
  border-color: #8ab4f8;
}

.sidebar-settings {
  color: #e8eaf0;
  cursor: pointer;
  white-space: nowrap;
  background: #232733;
  border: 1px solid #333a4a;
  border-radius: 8px;
  flex-shrink: 0;
  width: 100%;
  padding: .55rem .75rem;
  font-size: .9rem;
}

.sidebar-settings:hover {
  border-color: #8ab4f8;
}

.sidebar-logout {
  color: #f0b0b0;
  cursor: pointer;
  white-space: nowrap;
  background: #232733;
  border: 1px solid #4a3336;
  border-radius: 8px;
  flex-shrink: 0;
  width: 100%;
  padding: .55rem .75rem;
  font-size: .9rem;
}

.sidebar-logout:hover {
  color: #f4c2c2;
  border-color: #e06666;
}

.sidebar-owner-filter {
  flex-shrink: 0;
  width: 100%;
  margin-bottom: .75rem;
}

.settings-tabs {
  display: flex;
  border-bottom: 1px solid #232733;
  gap: .25rem;
  padding: 0 1rem .75rem;
}

.settings-page-tabs {
  flex-wrap: wrap;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem .75rem;
}

.settings-page-content {
  overflow-y: auto;
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.settings-tab {
  color: #9aa0ad;
  cursor: pointer;
  background: none;
  border: 1px solid #0000;
  border-radius: 8px;
  padding: .35rem .6rem;
  font-size: .85rem;
}

.settings-tab:hover {
  color: #e8eaf0;
}

.settings-tab.active {
  color: #8ab4f8;
  background: #232733;
  border-color: #333a4a;
  font-weight: 600;
}

.settings-tabs.sub-tabs {
  padding: 0 0 .5rem;
}

.manager {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.entry-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.entry {
  display: flex;
  background: #1a1d24;
  border: 1px solid #333a4a;
  border-radius: 10px;
  flex-direction: column;
  gap: .35rem;
  padding: .65rem .75rem;
}

.entry-head {
  display: flex;
  align-items:  center;
  gap: .5rem;
}

.entry-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  font-size: .95rem;
  font-weight: 600;
}

.entry-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  font-size: .8rem;
}

.entry-sub code {
  color: #b6bcc9;
  word-break: break-all;
  background: #232733;
  border-radius: 5px;
  padding: .1rem .35rem;
}

.entry-validation {
  font-size: .8rem;
  line-height: 1.35;
}

.entry-validation.warning {
  color: #fdd663;
}

.entry-validation.error {
  color: #f28b82;
}

.ok-text {
  color: #81c995;
  font-size: .85rem;
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: .4rem;
  margin-top: .15rem;
}

.entry-actions button, .download-link {
  color: #e8eaf0;
  cursor: pointer;
  text-decoration: none;
  background: #232733;
  border: 1px solid #333a4a;
  border-radius: 7px;
  padding: .3rem .6rem;
  font-size: .8rem;
}

.entry-actions button:hover:not(:disabled), .download-link:hover {
  border-color: #8ab4f8;
}

.entry-actions button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.entry-actions .primary-button, .manager > .primary-button {
  color: #1a1d24;
  background: #8ab4f8;
  border: none;
  font-weight: 600;
}

.entry-actions .primary-button:hover:not(:disabled) {
  background: #a5c5fa;
  border: none;
}

.manager > .primary-button {
  cursor: pointer;
  border-radius: 8px;
  align-self:  flex-start;
  padding: .45rem .75rem;
  font-size: .85rem;
}

.manager > .primary-button:hover {
  background: #a5c5fa;
}

.entry-actions .danger-button {
  color: #f28b82;
}

.entry-actions .danger-button:hover:not(:disabled) {
  border-color: #a04a4a;
}

.entry-form {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.entry-form label {
  display: flex;
  color: #b6bcc9;
  flex-direction: column;
  gap: .25rem;
  font-size: .8rem;
  font-weight: 600;
}

.entry-form .field-hint {
  font-size: .75rem;
  font-weight: 400;
  line-height: 1.35;
}

.entry-form input, .entry-form select, .entry-form textarea {
  color: #e8eaf0;
  background: #232733;
  border: 1px solid #3c4457;
  border-radius: 8px;
  width: 100%;
  padding: .45rem .6rem;
  font-family: inherit;
  font-size: .9rem;
}

.entry-form input:focus, .entry-form select:focus, .entry-form textarea:focus {
  outline: none;
  border-color: #8ab4f8;
}

.entry-form textarea {
  resize: vertical;
  line-height: 1.45;
}

.type-badge {
  letter-spacing: .03em;
  border-radius: 6px;
  flex-shrink: 0;
  padding: .15rem .4rem;
  font-size: .7rem;
  font-weight: 700;
}

.type-badge.stt {
  color: #81c995;
  background: #1e3a2f;
}

.type-badge.llm {
  color: #8ab4f8;
  background: #1f3050;
}

.type-badge.tts {
  color: #d7aefb;
  background: #3d2c4d;
}

.type-badge.manual {
  color: #f0c674;
  background: #3f3520;
}

.memory-item {
  display: flex;
  background: #1a1d24;
  border: 1px solid #333a4a;
  border-radius: 10px;
  flex-direction: column;
  gap: .45rem;
  padding: .65rem .75rem;
}

.memory-item.inactive {
  opacity: .55;
}

.memory-item-header {
  display: flex;
  align-items:  center;
  gap: .5rem;
}

.memory-category {
  color: #b6bcc9;
  background: #232733;
  border-radius: 5px;
  padding: .1rem .35rem;
  font-size: .75rem;
}

.memory-active-toggle {
  display: flex;
  color: #b6bcc9;
  cursor: pointer;
  align-items:  center;
  gap: .3rem;
  margin-left: auto;
  font-size: .78rem;
}

.memory-content {
  overflow-wrap: anywhere;
  font-size: .9rem;
  line-height: 1.4;
}

.child-name {
  font-size: .95rem;
  font-weight: 600;
}

.memory-hint {
  display: block;
  color: #9aa3b2;
  margin-top: .35rem;
  font-size: .72rem;
}

.status-dot {
  cursor: help;
  border-radius: 50%;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
}

.status-dot.ok {
  background: #81c995;
}

.status-dot.warning {
  background: #fdd663;
}

.status-dot.error {
  background: #f28b82;
}

.status-dot.none {
  background: #3c4457;
}

.prompt-item {
  text-align: left;
  color: #e8eaf0;
  cursor: pointer;
  background: #1a1d24;
  border: 1px solid #333a4a;
  border-radius: 8px;
  width: 100%;
  padding: .5rem .65rem;
  font-size: .9rem;
}

.prompt-item:hover {
  border-color: #8ab4f8;
}

.prompt-item.active {
  background: #232733;
  border-color: #8ab4f8;
}

.generations h3 {
  color: #b6bcc9;
  margin-bottom: .5rem;
  font-size: .9rem;
}

.voice-input {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.dialog-backdrop {
  position: fixed;
  display: flex;
  z-index: 20;
  background: #0000008c;
  justify-content: center;
  align-items:  center;
  padding: 1.5rem;
  inset: 0;
}

.dialog {
  overflow-y: auto;
  display: flex;
  background: #1e222b;
  border: 1px solid #333a4a;
  border-radius: 12px;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  padding: 1.25rem;
}

.dialog h2 {
  color: #8ab4f8;
  font-size: 1.15rem;
}

.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.keyword-chip {
  display: inline-flex;
  background: #232733;
  border: 1px solid #333a4a;
  border-radius: 999px;
  align-items:  center;
  gap: .35rem;
  padding: .2rem .4rem .2rem .65rem;
  font-size: .85rem;
}

.keyword-chip button {
  color: #b6bcc9;
  cursor: pointer;
  background: none;
  border: none;
  padding: .15rem;
  font-size: .75rem;
  line-height: 1;
}

.keyword-chip button:hover {
  color: #f28b82;
}

.bubble.assistant.blocked {
  border-color: #7a6220;
}

.blocked-shield {
  margin-right: .4rem;
}

.costs-line {
  white-space: normal;
  border-top: 1px solid #333a4a;
  margin-top: .5rem;
  padding-top: .4rem;
  font-size: .75rem;
}

.chat-header-costs {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: .8rem;
}

.wizard-btn, .wizard-btn-primary {
  color: #e8eaf0;
  cursor: pointer;
  background: #232733;
  border: 1px solid #333a4a;
  border-radius: 6px;
  padding: .4rem .8rem;
  font-size: .85rem;
}

.wizard-btn:hover {
  border-color: #4a5a80;
}

.wizard-btn-primary {
  background: #3457a8;
  border-color: #3f66c0;
}

.wizard-btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.wizard-btn-danger {
  border-color: #7a3030;
}

.wizard-btn-danger:hover {
  color: #f28b82;
  border-color: #b04a4a;
}

.wizard-soundbite-manager {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 720px;
}

.wizard-card {
  background: #14161c;
  border: 1px solid #333a4a;
  border-radius: 8px;
  padding: 1rem;
}

.wizard-card h3 {
  margin-bottom: .75rem;
}

.wizard-field {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-bottom: .75rem;
}

.wizard-field span {
  color: #9aa0ad;
  font-size: .8rem;
}

.wizard-field input, .wizard-field textarea {
  color: #e8eaf0;
  background: #1a1d24;
  border: 1px solid #333a4a;
  border-radius: 6px;
  padding: .5rem;
  font-family: inherit;
  font-size: .9rem;
}

.wizard-form-actions {
  display: flex;
  gap: .6rem;
}

.wizard-soundbite-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.wizard-soundbite-item {
  display: flex;
  border: 1px solid #333a4a;
  border-radius: 6px;
  justify-content: space-between;
  align-items:  center;
  gap: .75rem;
  padding: .6rem .75rem;
}

.wizard-soundbite-info {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}

.wizard-soundbite-label {
  font-size: .9rem;
  font-weight: 600;
}

.wizard-soundbite-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 360px;
  font-size: .78rem;
}

.wizard-soundbite-actions {
  display: flex;
  flex-shrink: 0;
  align-items:  center;
  gap: .4rem;
}

.wizard-soundbite-sort {
  font-size: .72rem;
}

.entry-form label.checkbox-row {
  flex-direction: row;
  align-items:  center;
  gap: .5rem;
}

.entry-form label.checkbox-row input {
  width: auto;
}

.log-list {
  display: flex;
  list-style: none;
  flex-direction: column;
  gap: .7rem;
  margin: 0;
  padding: 0;
}

.log-entry {
  background: #1c2029;
  border: 1px solid #333a4a;
  border-radius: 8px;
  padding: .7rem .8rem;
}

.log-entry-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
}

.log-entry-kind {
  letter-spacing: .03em;
  text-transform: uppercase;
  background: #2b3242;
  border-radius: 5px;
  margin-right: .5rem;
  padding: .1rem .4rem;
  font-size: .7rem;
}

.log-entry-title {
  font-weight: 600;
}

.log-entry-badge {
  color: #7fc98f;
  white-space: nowrap;
  border: 1px solid #3f6a4a;
  border-radius: 5px;
  margin-left: .5rem;
  padding: .05rem .35rem;
  font-size: .68rem;
}

.log-entry-date {
  font-size: .75rem;
}

.log-entry-summary {
  color: #c3c9d6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  margin: .5rem 0;
  font-size: .85rem;
}

.log-entry-summary.expanded {
  -webkit-line-clamp: unset;
  display: block;
}

.tool-docs h3 {
  border-bottom: 1px solid #2c3242;
  margin: 1.4rem 0 .4rem;
  padding-bottom: .3rem;
}

.tool-docs-context ol, .tool-docs-notes ul {
  color: #c3c9d6;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin: .4rem 0 0;
  padding-left: 1.2rem;
  font-size: .85rem;
}

.tool-doc {
  background: #1c2029;
  border: 1px solid #333a4a;
  border-radius: 8px;
  margin-top: .6rem;
  padding: .7rem .8rem;
}

.tool-doc h4 {
  margin: 0 0 .35rem;
}

.tool-doc h4 code {
  color: #9fd0ff;
  font-size: .9rem;
}

.tool-doc-description {
  color: #c3c9d6;
  white-space: pre-wrap;
  margin: 0;
  font-size: .85rem;
}

.tool-doc-params {
  border-top: 1px solid #2c3242;
  margin: .6rem 0 0;
  padding-top: .5rem;
  font-size: .82rem;
}

.tool-doc-params > div + div {
  margin-top: .4rem;
}

.tool-doc-params dt code {
  color: #e8c07d;
}

.tool-doc-params dd {
  color: #b6bcc9;
  margin: .1rem 0 0 1rem;
}

.log-list + .danger-button {
  align-self:  flex-start;
}

.mode-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: .5rem;
}

.mode-tile {
  display: flex;
  color: #b6bcc9;
  cursor: pointer;
  background: #232733;
  border: 2px solid #333a4a;
  border-radius: 12px;
  flex-direction: column;
  align-items:  center;
  gap: .15rem;
  min-width: 64px;
  padding: .4rem .75rem;
}

.mode-tile:hover:not(.active):not(:disabled) {
  color: #e8eaf0;
  border-color: #4a5468;
}

.mode-tile:disabled {
  cursor: default;
  opacity: .6;
}

.mode-tile.active {
  color: #e8eaf0;
  opacity: 1;
  background: #1f3050;
  border-color: #8ab4f8;
}

.mode-tile-icon {
  font-size: 1.5rem;
  line-height: 1.2;
}

.mode-tile-name {
  white-space: nowrap;
  font-size: .75rem;
  font-weight: 600;
}

.mode-switcher-error {
  color: #f28b82;
  font-size: .8rem;
}

.mode-switcher-dropdown {
  flex-direction: column;
  align-items:  flex-end;
  gap: .25rem;
}

.mode-dropdown {
  color: #e8eaf0;
  cursor: pointer;
  background: #232733;
  border: 1px solid #333a4a;
  border-radius: 999px;
  max-width: 11rem;
  padding: .35rem .7rem;
  font-size: .85rem;
}

.mode-dropdown:hover:not(:disabled) {
  border-color: #4a5468;
}

.mode-dropdown:disabled {
  cursor: default;
  opacity: .6;
}

.mode-switcher-wizard {
  gap: .35rem;
  margin: .4rem 0;
}

.mode-switcher-wizard .mode-tile {
  border-width: 1px;
  border-radius: 999px;
  flex-direction: row;
  gap: .35rem;
  min-width: 0;
  padding: .3rem .6rem;
}

.mode-switcher-wizard .mode-tile-icon {
  font-size: 1rem;
}

.mode-global-prompt {
  border-bottom: 1px solid #333a4a;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

.mode-global-prompt h3, .manager > h3 {
  margin-bottom: .25rem;
}

.mode-item-icon {
  font-size: 1.1rem;
}

.mode-icon-input {
  max-width: 6rem;
}

.mode-skill-list {
  display: flex;
  border: 1px solid #333a4a;
  border-radius: 8px;
  flex-direction: column;
  gap: .35rem;
  padding: .6rem .75rem;
}

.mode-skill-list legend {
  color: #b6bcc9;
  padding: 0 .3rem;
  font-size: .85rem;
}

.mode-skill-item {
  display: flex;
  cursor: pointer;
  align-items:  center;
  gap: .5rem;
}

.stats-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: .9rem;
}

.stats-summary strong {
  color: #8ab4f8;
}

.stats-table-wrap {
  overflow-x: auto;
  border: 1px solid #333a4a;
  border-radius: 8px;
}

.stats-table {
  border-collapse: collapse;
  white-space: nowrap;
  width: 100%;
  font-size: .78rem;
}

.stats-table th, .stats-table td {
  text-align: right;
  border-bottom: 1px solid #2a3040;
  padding: .3rem .55rem;
}

.stats-table th:first-child, .stats-table td:first-child {
  text-align: left;
}

.stats-table th {
  color: #9aa3b5;
  position: sticky;
  background: #232733;
  font-weight: 600;
  top: 0;
}

.stats-table tbody tr:last-child td {
  border-bottom: none;
}

.stats-table tbody tr:hover td {
  background: #20242e;
}

.stats-group-row {
  cursor: pointer;
}

.stats-detail-row > td, .stats-table tbody tr.stats-detail-row:hover > td {
  background: #1a1d25;
  padding: .4rem .4rem .8rem 1.4rem;
}

.stats-turn-table {
  width: auto;
}

.live-badge {
  white-space: nowrap;
  color: #2f9e44;
  flex-shrink: 0;
  font-size: .8rem;
}

.live-badge.live-thinking {
  color: #e67700;
}

.live-badge.live-speaking {
  color: #1c7ed6;
}

.live-badge.live-user {
  color: #ae3ec9;
}

.live-dot {
  color: #2f9e44;
}

.bubble.assistant.draft {
  opacity: .6;
  border-style: dashed;
}

.live-tools {
  list-style: none;
  overflow-wrap: anywhere;
  margin: 0;
  padding: 0;
  font-family: ui-monospace, monospace;
  font-size: .8em;
}

.live-tool-failed {
  color: #c92a2a;
}

.chat-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.chat-body .wizard-controls {
  margin: 1rem 1rem 1rem 0;
}

@media (width <= 1100px) {
  .chat-body {
    overflow-y: auto;
    flex-direction: column;
  }

  .chat-scroll {
    overflow-y: visible;
    flex: none;
  }

  .chat-body .wizard-controls {
    overflow: visible;
    width: auto;
    margin: 0 1rem 1rem;
  }

  .wizard-controls-scroll {
    overflow-y: visible;
    margin-right: 0;
    padding-right: 0;
  }
}

.bubble.wizard-injected {
  border: 1px solid #6a5a20;
}

.bubble .wizard-badge {
  display: block;
  margin-bottom: .2rem;
}

.wizard-badge {
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #d9b64a;
  font-size: .68rem;
  font-weight: 600;
}

.wizard-controls {
  display: flex;
  overflow: hidden;
  background: #14161c;
  border: 1px solid #333a4a;
  border-radius: 8px;
  flex-direction: column;
  flex-shrink: 0;
  width: 380px;
  padding: 1rem;
}

.wizard-controls-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  margin-right: -.4rem;
  padding-right: .4rem;
}

.wizard-controls-fixed {
  border-top: 1px solid #2c3242;
  flex-shrink: 0;
  margin-top: .8rem;
  padding-top: .8rem;
}

.wizard-controls h3 {
  margin-bottom: .4rem;
}

.wizard-automation {
  background: #101820;
  border: 1px solid #333a4a;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: .6rem .8rem;
}

.wizard-automation.paused {
  background: #241f10;
  border-color: #8a7a2e;
}

.wizard-automation-toggle {
  display: flex;
  cursor: pointer;
  align-items:  center;
  gap: .5rem;
  font-weight: 600;
}

.wizard-automation .wizard-hint {
  margin: .35rem 0 0;
}

.wizard-hint {
  margin-bottom: .75rem;
  font-size: .8rem;
}

.wizard-soundbite-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1rem;
}

.wizard-soundbite-btn {
  display: flex;
  color: #e8eaf0;
  cursor: pointer;
  text-align: left;
  background: #232733;
  border: 1px solid #333a4a;
  border-radius: 8px;
  flex-direction: column;
  gap: .2rem;
  min-width: 140px;
  padding: .6rem .8rem;
}

.wizard-soundbite-btn.ready {
  border-color: #3f7a4a;
}

.wizard-soundbite-btn.preparing {
  opacity: .85;
}

.wizard-soundbite-btn:hover {
  border-color: #4a5a80;
}

.wizard-soundbite-btn-label {
  font-size: .9rem;
  font-weight: 600;
}

.wizard-soundbite-btn-state {
  color: #9aa0ad;
  font-size: .72rem;
}

.wizard-soundbite-btn.ready .wizard-soundbite-btn-state {
  color: #7ed08a;
}

.wizard-say {
  display: flex;
  align-items: stretch;
  gap: .6rem;
  margin-bottom: .5rem;
}

.wizard-say-input {
  resize: vertical;
  color: #e8eaf0;
  font: inherit;
  background: #232733;
  border: 1px solid #333a4a;
  border-radius: 8px;
  flex: 1;
  min-height: 2.5rem;
  padding: .5rem .6rem;
}

.wizard-say-btn {
  color: #cfe8f2;
  cursor: pointer;
  background: #1f2b33;
  border: 1px solid #3f6a7a;
  border-radius: 8px;
  flex-shrink: 0;
  padding: .5rem 1rem;
  font-weight: 600;
}

.wizard-say-btn:hover:not(:disabled) {
  border-color: #4a7f95;
}

.wizard-say-btn:disabled {
  opacity: .55;
  cursor: default;
}

.wizard-say-status {
  color: #7ed08a;
  margin-bottom: .75rem;
  font-size: .8rem;
}

.wizard-stop-btn {
  color: #f2b8b8;
  cursor: pointer;
  background: #3a2020;
  border: 1px solid #b04a4a;
  border-radius: 8px;
  width: 100%;
  padding: .75rem;
  font-size: 1rem;
  font-weight: 600;
}

.wizard-stop-btn:hover {
  background: #4a2626;
}

.wizard-stop-btn.speaking {
  color: #ffd6d6;
  animation: 1.2s ease-in-out infinite wizard-speaking-pulse;
  background: #5a2626;
  border-color: #d06060;
}

.wizard-stop-btn:disabled, .wizard-soundbite-btn:disabled {
  opacity: .5;
  cursor: default;
}

.wizard-session {
  display: flex;
  border-top: 1px solid #2c3242;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1.1rem;
  padding-top: .9rem;
}

.wizard-session-skill {
  display: flex;
  background: #232733;
  border: 1px solid #3c4457;
  border-radius: 8px;
  justify-content: space-between;
  align-items:  center;
  gap: .6rem;
  padding: .45rem .6rem;
  font-size: .82rem;
}

.wizard-session > button, .wizard-session-notes > li > button {
  align-self:  flex-start;
}

.wizard-session-skill button {
  flex-shrink: 0;
}

.wizard-session-notes {
  display: flex;
  list-style: none;
  flex-direction: column;
  gap: .6rem;
  margin: 0;
  padding: 0;
}

.wizard-session-notes li {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.wizard-session-note-head {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: .5rem;
}

.wizard-session-note-head code {
  color: #9fd0ff;
  font-size: .78rem;
}

.wizard-session-notes textarea {
  color: #e8eaf0;
  resize: vertical;
  background: #232733;
  border: 1px solid #3c4457;
  border-radius: 8px;
  width: 100%;
  padding: .4rem .55rem;
  font-family: inherit;
  font-size: .82rem;
}

@keyframes wizard-speaking-pulse {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: .45;
  }
}

.banner-warning {
  color: #fdd663;
  background: #3a3320;
  border: 1px solid #8a7a2e;
}

.chat-header-device {
  color: #8ab4f8;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: .8rem;
}

.wizard-device {
  margin: 0 0 .5rem;
  font-size: .85rem;
}

.device-owner-select {
  font-size: .85rem;
}

.message-feedback {
  white-space: normal;
  margin-top: .4rem;
}

.feedback-buttons {
  display: flex;
  gap: .25rem;
}

.feedback-button {
  cursor: pointer;
  opacity: .35;
  filter: grayscale(1);
  background: none;
  border: 1px solid #0000;
  border-radius: 6px;
  padding: 0 .3rem;
  font-size: .85rem;
  line-height: 1.6;
}

.bubble:hover .feedback-button {
  opacity: .7;
}

.feedback-button:focus-visible {
  opacity: .7;
}

.feedback-button:hover, .feedback-button.active {
  filter: none;
  opacity: 1 !important;
}

.feedback-button.active {
  background: #2c3242;
  border-color: #4a5468;
}

.feedback-comment {
  display: block;
  color: #d6dae3;
  font: inherit;
  text-align: left;
  white-space: pre-wrap;
  cursor: pointer;
  background: #1b1f29;
  border: 1px dashed #3c4457;
  border-radius: 8px;
  width: 100%;
  margin-top: .3rem;
  padding: .35rem .5rem;
  font-size: .82rem;
}

.feedback-editor textarea {
  color: inherit;
  font: inherit;
  resize: vertical;
  background: #1b1f29;
  border: 1px solid #3c4457;
  border-radius: 8px;
  width: 100%;
  margin-top: .3rem;
  padding: .4rem .5rem;
  font-size: .85rem;
}

.feedback-editor-actions {
  display: flex;
  gap: .4rem;
  margin-top: .3rem;
}

.feedback-save, .feedback-cancel {
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
  padding: .2rem .7rem;
  font-size: .8rem;
}

.feedback-save {
  color: #10131a;
  background: #8ab4f8;
  border: 1px solid #8ab4f8;
}

.feedback-save:disabled {
  opacity: .6;
  cursor: default;
}

.feedback-cancel {
  color: #c3c8d3;
  background: none;
  border: 1px solid #3c4457;
}

.side-marker {
  color: #e3b964;
  background: #2b2617;
  border: 1px solid #4a3f22;
  border-radius: 999px;
  align-self:  center;
  padding: .2rem .8rem;
  font-size: .78rem;
}

.chat-export {
  display: flex;
  flex-shrink: 0;
  align-items:  center;
  gap: .35rem;
  font-size: .8rem;
}

.chat-export a {
  color: #8ab4f8;
  text-decoration: none;
  border: 1px solid #333a4a;
  border-radius: 6px;
  padding: .1rem .45rem;
}

.chat-export a:hover {
  background: #232733;
}
