/* agent.css — styling for the /agent chat dashboard. Presentational only. */

:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2933;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --sidebar-bg: #f9fafb;
  --danger: #dc2626;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
}

/* ---------------------------------------------------------------------- */
/* Header                                                                  */
/* ---------------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.topbar-brand-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.topbar-brand img {
  display: block;
  border-radius: 6px;
}

.brand-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.instance-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: default;
}

.logout-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.logout-link:hover {
  background: var(--bg);
  color: var(--text);
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-link:hover {
  background: var(--bg);
  color: var(--text);
}

.instance-select {
  width: 100%;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  margin-bottom: var(--space-2);
}

/* ---------------------------------------------------------------------- */
/* Landing page (/)                                                        */
/* ---------------------------------------------------------------------- */

.landing-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
}

.landing-cards {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}

.setup-wizard {
  max-width: 560px;
  margin: 2rem auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4, 2rem);
  text-align: left;
}

.setup-wizard h1 {
  font-size: 1.25rem;
  margin-top: 0;
}

.setup-wizard h2 {
  font-size: 1rem;
  margin-top: 2rem;
}

.setup-wizard ol {
  padding-left: 1.25rem;
  color: var(--text-secondary, #555);
}

.setup-wizard label {
  display: block;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.setup-wizard input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 6px);
  box-sizing: border-box;
}

.landing-card {
  display: block;
  width: 260px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
  padding: var(--space-3);
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.landing-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.1);
  transform: translateY(-2px);
}

.landing-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

.landing-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.landing-card-login .landing-card-desc {
  margin-bottom: var(--space-2);
}

/* ---------------------------------------------------------------------- */
/* Shell / sidebar                                                         */
/* ---------------------------------------------------------------------- */

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

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: var(--space-2);
  overflow-y: auto;
  box-sizing: border-box;
}

.btn {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  background: var(--text-faint);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-secondary:disabled {
  color: var(--text-faint);
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
  display: block;
  margin-bottom: var(--space-2);
}

.convo-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.convo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.15s ease;
}

.convo-item:hover {
  background: var(--accent-soft);
}

.convo-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.convo-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.convo-delete {
  border: none;
  background: transparent;
  color: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.convo-item:hover .convo-delete {
  color: var(--text-faint);
}

.convo-delete:hover {
  background: #fee2e2;
  color: var(--danger) !important;
}

.convo-empty {
  font-size: 0.8rem;
  color: var(--text-faint);
  padding: 8px 10px;
}

/* ---------------------------------------------------------------------- */
/* Main / chat card                                                        */
/* ---------------------------------------------------------------------- */

.main {
  flex: 1;
  padding: var(--space-3);
  overflow-y: auto;
  min-width: 0;
}

.chat-card {
  max-width: 820px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 2 * var(--space-3) - 65px);
}

.controls-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.auto-approve-field {
  justify-content: center;
}

.auto-approve-field.hidden {
  display: none;
}

.auto-approve-field span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
}

.auto-approve-field input {
  margin: 0;
}

.select {
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 26px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.active-convo {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.running-total {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.mode-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.mode-option:first-child {
  border-radius: calc(var(--radius-sm) - 1px) 0 0 calc(var(--radius-sm) - 1px);
}

.mode-option:last-child {
  border-radius: 0 calc(var(--radius-sm) - 1px) calc(var(--radius-sm) - 1px) 0;
}

.mode-option {
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--card);
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-option + .mode-option {
  border-left: 1px solid var(--border);
}

.mode-option.active {
  background: var(--accent);
  color: #fff;
}

.mode-option,
.has-tooltip {
  position: relative;
}

.mode-option::after,
.mode-option::before,
.has-tooltip::after,
.has-tooltip::before {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transition-delay: 0s;
  pointer-events: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
}

.mode-option::after,
.has-tooltip::after {
  content: attr(data-tooltip);
  transform: translate(-50%, 4px);
  width: max-content;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #1f2933;
  color: #f3f4f6;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.mode-option::before,
.has-tooltip::before {
  content: "";
  bottom: 100%;
  transform: translate(-50%, -2px);
  border: 5px solid transparent;
  border-top-color: #1f2933;
}

.mode-option:hover::after,
.mode-option:hover::before,
.mode-option:focus-visible::after,
.mode-option:focus-visible::before,
.has-tooltip:hover::after,
.has-tooltip:hover::before,
.has-tooltip:focus-visible::after,
.has-tooltip:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0.35s;
}

/* ---------------------------------------------------------------------- */
/* Skills dropdown + global settings modal                                 */
/* ---------------------------------------------------------------------- */

.skills-dropdown-wrap {
  position: relative;
}

.skills-toggle-btn {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.skills-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: 340px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.12);
  padding: 8px;
  box-sizing: border-box;
}

.skills-menu.hidden {
  display: none;
}

.skills-search-input {
  width: 100%;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  margin-bottom: 6px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.skills-category-list {
  overflow-y: auto;
  min-height: 0;
}

.skills-category + .skills-category {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 4px;
}

.skills-category > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 6px 4px;
  list-style: none;
}

.skills-category > summary::-webkit-details-marker {
  display: none;
}

.skills-category > summary::before {
  content: '▸';
  font-size: 0.7rem;
  color: var(--text-faint);
  transition: transform 0.1s ease;
}

.skills-category[open] > summary::before {
  transform: rotate(90deg);
}

.skills-category-count {
  color: var(--text-faint);
  font-weight: 500;
}

.skills-category-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.skills-empty-state {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 12px 4px;
  text-align: center;
}

.skills-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.skills-menu-item:hover {
  background: var(--accent-soft);
}

.skills-menu-item input {
  margin-top: 3px;
}

.skills-menu-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.skills-menu-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.settings-gear-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.settings-gear-btn:hover {
  background: var(--bg);
}

.settings-dropdown-wrap {
  position: relative;
}

.settings-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
}

.settings-dropdown-menu.hidden {
  display: none;
}

.settings-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text);
  background: none;
  border: none;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-sizing: border-box;
}

.settings-dropdown-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  width: 400px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(16, 24, 40, 0.2);
  padding: var(--space-2);
  box-sizing: border-box;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.settings-skills-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
  min-height: 0;
  overflow: hidden;
}

.modal-footer {
  margin-top: var(--space-2);
}

.modal-footer .btn {
  width: 100%;
}

/* ---------------------------------------------------------------------- */
/* Charts (Data Visualization skill)                                       */
/* ---------------------------------------------------------------------- */

.chart-card {
  margin-top: 10px;
  padding: var(--space-2);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-width: 420px;
  width: 100%;
}

.chart-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.chart-canvas {
  max-width: 100%;
}

/* ---------------------------------------------------------------------- */
/* Messages                                                                 */
/* ---------------------------------------------------------------------- */

.messages {
  flex: 1;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow-y: auto;
}

.messages:empty::before {
  content: "Ask something about your ServiceNow instance to get started.";
  color: var(--text-faint);
  font-size: 0.9rem;
}

.message-row {
  display: flex;
  width: 100%;
}

/* Wraps the bubble + usage-line so they stack vertically inside the row
   (the row itself is flex for left/right alignment, not for stacking). */
.message-col {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.message-row.user .message-col {
  align-items: flex-end;
}

.message-row.assistant .message-col {
  align-items: flex-start;
}

.message-col .bubble {
  max-width: 100%;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
}

.bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  line-height: 1.55;
  font-size: 0.92rem;
  word-wrap: break-word;
}

.message-row.user .bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}

.message-row.assistant .bubble {
  background: #f4f5f7;
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.message-row.error .bubble {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.bubble p {
  margin: 0.4em 0;
}

.bubble p:first-child {
  margin-top: 0;
}

.bubble p:last-child {
  margin-bottom: 0;
}

.bubble ul,
.bubble ol {
  margin: 0.4em 0;
  padding-left: 1.4em;
}

.bubble li {
  margin: 0.15em 0;
}

.bubble code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

.message-row.user .bubble code {
  background: rgba(255, 255, 255, 0.2);
}

.bubble pre {
  background: #1f2933;
  color: #e5e7eb;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0.5em 0;
}

.bubble pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.bubble.pending {
  color: var(--text-faint);
  font-style: italic;
}

.usage-line {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 4px;
}

.message-row.user .usage-line {
  text-align: right;
}

.tool-action {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--accent-soft);
  border: 1px solid #e0e3fb;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin: 4px 0;
  align-self: flex-start;
  max-width: 75%;
}

.tool-action summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
}

.tool-action summary::-webkit-details-marker {
  display: none;
}

.tool-action .icon {
  flex-shrink: 0;
}

.tool-action-detail {
  margin: 6px 0 0;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}

.tool-action-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tool-source-link {
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--card);
  border: 1px solid #e0e3fb;
  border-radius: 999px;
  padding: 3px 9px;
  text-decoration: none;
}

.tool-source-link:hover {
  background: var(--accent-soft);
  text-decoration: underline;
}

/* ---------------------------------------------------------------------- */
/* Composer                                                                 */
/* ---------------------------------------------------------------------- */

.composer {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border);
}

.prompt-input {
  flex: 1;
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  resize: vertical;
  min-height: 44px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.prompt-input::placeholder {
  color: var(--text-faint);
}

.prompt-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.send-btn {
  padding: 10px 20px;
}

/* ---------------------------------------------------------------------- */
/* Confirm panel (Develop-mode pending write actions)                      */
/* ---------------------------------------------------------------------- */

.confirm-panel {
  width: 300px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-left: 1px solid var(--border);
  padding: var(--space-2);
  overflow-y: auto;
  box-sizing: border-box;
}

.confirm-panel.hidden {
  display: none;
}

.confirm-panel-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.confirm-panel-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 0 8px;
  cursor: pointer;
}

.confirm-panel-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.confirm-panel-tab-count {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}

.confirm-panel-tab-count.hidden {
  display: none;
}

.confirm-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.confirm-list.hidden {
  display: none;
}

.confirm-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2);
}

.confirm-desc {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 8px;
}

.confirm-raw {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
}

.confirm-btn-row {
  display: flex;
  gap: 8px;
}

.confirm-btn-row .btn {
  flex: 1;
}

.confirm-result-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 8px;
}

.confirm-card-error .confirm-result-text {
  color: var(--danger);
}

.confirm-dismiss {
  width: 100%;
  margin-top: 4px;
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */

@media (max-width: 720px) {
  .shell {
    flex-direction: column;
  }

  .sidebar {
    width: auto;
    max-height: 180px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .main {
    padding: var(--space-2);
  }

  .chat-card {
    min-height: 0;
  }

  .bubble {
    max-width: 90%;
  }

  .controls-row {
    gap: var(--space-1);
  }

  .active-convo {
    margin-left: 0;
    width: 100%;
  }

  .confirm-panel {
    width: auto;
    max-height: 260px;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .landing-cards {
    flex-direction: column;
    align-items: stretch;
  }

  .landing-card {
    width: auto;
  }

  .setup-wizard {
    margin: 1rem;
    padding: var(--space-3);
  }

  .admin-main table {
    display: block;
    overflow-x: auto;
  }
}
