:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-muted: #f7f7f8;
  --text: #101014;
  --text-muted: #67676f;
  --border: #dddddf;
  --border-soft: #e8e8ea;
  --accent: #673de6;
  --accent-soft: #eee9ff;
  --code-text: #1f2430;
  --code-inline: #22242c;
  --code-surface: #f6f7f9;
  --sidebar-width: 238px;
  --topbar-height: 62px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow: 0 12px 34px rgba(19, 18, 30, 0.12);
  --sidebar-collapsed-width: 64px;
  --assistant-offcanvas-width: 440px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: var(--topbar-height) minmax(0, 1fr);
  margin-right: 0;
  transition:
    grid-template-columns 200ms cubic-bezier(0.4, 0, 0.2, 1),
    margin-right 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* The assistant drawer pushes the application aside instead of covering it. */
body.assistant-offcanvas-open .app-shell {
  margin-right: var(--assistant-offcanvas-width);
}

/* Restored on page load: show the drawer in place, without sliding it in. */
body.assistant-offcanvas-restoring .app-shell,
body.assistant-offcanvas-restoring .assistant-offcanvas,
body.assistant-offcanvas-restoring .assistant-offcanvas-backdrop {
  transition: none !important;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.topbar {
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
}

.brand {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}

.brand-mark {
  font-weight: 800;
  font-size: 25px;
  letter-spacing: -4px;
  transform: skewY(-8deg);
}

.referral-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 14px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
}

html.dark .referral-pill {
  color: #a885ff;
  border-color: var(--accent-soft);
}

.referral-pill i {
  font-size: 18px;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-switcher { position: relative; }
.app-switcher-panel {
  position: absolute; top: 48px; right: 0; width: min(420px, calc(100vw - 36px));
  max-height: calc(100dvh - 90px); overflow-y: auto; padding: 18px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  color: var(--text); box-shadow: var(--shadow); z-index: 70;
}
.app-switcher-panel[hidden], .app-switcher-retry[hidden] { display: none; }
.app-switcher-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.app-switcher-heading strong { font-size: 15px; }
.app-switcher-heading a { font-size: 11px; color: var(--accent); }
.app-switcher-search { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; background: var(--surface-muted); color: var(--text); font-size: 12px; }
.app-switcher-status { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.app-switcher-status:empty { margin: 12px 0; }
.app-switcher-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.app-switcher-link { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 13px 5px; border: 1px solid transparent; border-radius: 9px; text-align: center; }
.app-switcher-link:hover, .app-switcher-link[aria-current=page] { background: var(--accent-soft); border-color: var(--border-soft); }
.app-switcher-link span { font-size: 11px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.app-switcher-link small { font-size: 8px; color: var(--text-muted); }
.app-switcher-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; font-size: 19px; color: #896cb6; background: #f0eafa; }
.app-switcher-icon-monitoring { color: #6684b9; background: #eaf0fc; }
.app-switcher-icon-integrations { color: #b2814b; background: #fcf0e4; }
.app-switcher-icon-infrastructure { color: #5a9673; background: #e5f1e9; }
.app-switcher-retry { background: var(--surface-muted); color: var(--text); border: 1px solid var(--border); padding: 8px 12px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.app-switcher :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media(max-width: 680px) { .app-switcher-panel { position: fixed; top: 68px; right: 18px; } }

.ask-ai-button,
.icon-button {
  display: inline-grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
}

.ask-ai-button {
  grid-auto-flow: column;
  font: inherit;
  gap: 8px;
  min-height: 36px;
  padding: 0 15px;
  border-color: #9754ff;
  border-radius: 999px;
  font-weight: 600;
  color: var(--text);
}

html.dark .ask-ai-button {
  border-color: #a885ff;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--text);
}

.topbar-nav-button {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.topbar-nav-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.topbar-nav-button.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.topbar-nav-button i {
  font-size: 15px;
  line-height: 1;
}

.topbar-dark-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
}

.topbar-dark-mode-toggle i {
  font-size: 15px;
  line-height: 1;
}

.topbar-dark-mode-toggle i.bi-sun-fill {
  color: #f5a623;
}

.topbar-dark-mode-toggle i.bi-moon-stars-fill {
  color: #8f8fb3;
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: padding 200ms cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-collapsed .sidebar {
  padding: 10px 6px 16px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.nav-link {
  min-height: 35px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

@media (min-width: 681px) {
  .sidebar-collapsed .nav-link span,
  .sidebar-collapsed .nav-link .nav-trailing,
  .sidebar-collapsed .nav-link .nav-badge {
    display: none;
  }

  .sidebar-collapsed .nav-link {
    grid-template-columns: 1fr;
    justify-content: center;
    padding: 6px;
  }

  .sidebar-collapsed .nav-link i:first-child {
    margin: 0 auto;
    font-size: 20px;
  }
}

.nav-link:hover {
  background: var(--surface-muted);
}

.nav-link.active {
  background: #ededee;
  color: var(--accent);
  font-weight: 650;
}

.nav-link i:first-child {
  font-size: 16px;
  color: var(--text-muted);
}

.nav-trailing {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-section {
  margin-top: 4px;
  width: 100%;
}

.nav-section-heading {
  width: 100%;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0.5rem 12px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
  box-sizing: border-box;
}

.section-icon {
  font-size: 16px;
  color: var(--text-muted);
  display: block;
}

@media (min-width: 681px) {
  .sidebar-collapsed .nav-section-heading {
    display: none;
  }
}

.nav-section-heading:hover {
  background: rgba(0, 0, 0, 0.04);
}

.nav-section-items {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 180ms ease;
}

.nav-section-items-wrapper {
  overflow: hidden;
  min-height: 0;
}

.nav-section.collapsed .nav-section-items {
  grid-template-rows: 0fr;
}

@media (min-width: 681px) {
  .sidebar-collapsed .nav-section.collapsed .nav-section-items {
    grid-template-rows: 1fr;
  }
}

@media (min-width: 681px) and (max-width: 980px) {
  .nav-section.collapsed .nav-section-items,
  .nav-section .nav-section-items {
    grid-template-rows: 1fr;
  }
}

.nav-section-chevron {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 11px;
  transition: transform 180ms ease;
}

.nav-section.collapsed .nav-section-chevron {
  transform: rotate(-90deg);
}

.nav-badge {
  margin-left: auto;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #ebe4ff;
  color: #673de6;
  font-size: 0.68rem;
  font-weight: 600;
}

.main-content {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding: 64px 48px 72px;
  overflow-x: hidden;
  overflow-y: auto;
  height: calc(100vh - var(--topbar-height));
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.main-content::-webkit-scrollbar {
  display: none;
}

.main-content:has(.chat-container) {
  padding: 0;
}

.main-content:has(.settings-header) {
  padding-top: 32px;
}

.page-container {
  width: min(100%, 1010px);
  margin: 0 auto;
}

.page-container.wide,
.page-container.page-container-wide,
.page-container.wide-container,
.page-container-wide {
  width: min(100%, 1400px);
  max-width: 1400px;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 200px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  align-items: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chat-history::-webkit-scrollbar {
  display: none;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
  opacity: 0.3;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-4px);
    opacity: 0.8;
  }
}

.chat-history > * {
  width: min(100%, 768px);
  padding-inline: 24px;
}

.user-prompt-bubble {
  margin-top: 3rem;
  margin-left: auto;
  font-size: 1rem;
  line-height: 1.6;
  text-align: left;
  align-self: flex-end;
  color: var(--text);
  background: white;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  max-width: 80%;
  width: fit-content;
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-history > .ai-response-wrapper:first-child .user-prompt-bubble {
  margin-top: 0;
}

html.dark .user-prompt-bubble {
  background: var(--surface);
  border-color: var(--border-soft);
}

.ai-response {
  margin-top: 1.5rem;
  padding: 1.5rem;
  text-align: left;
  background: white;
  width: 100%;
  max-width: 100%;
  min-height: auto;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ai-content-container {
  flex: 1;
  min-width: 0;
}

.ai-content p,
.ai-content-static p {
  margin: 0 0 1rem;
}

.ai-content p:last-child,
.ai-content-static p:last-child {
  margin-bottom: 0;
}

.ai-content pre,
.ai-content-static pre {
  background: #0d1117;
  color: #e6edf3;
  padding: 16px;
  margin: 0;
  overflow-x: auto;
  border: none;
}

.code-block-container {
  margin: 1.5rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.code-block-header {
  background: #21262d;
  color: #8b949e;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-family: var(--font-main);
  border: none;
}

.copy-button {
  background: transparent;
  border: none;
  color: #8b949e;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  transition: color 0.2s;
  padding: 4px;
  border-radius: 4px;
}

.copy-button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.copy-button.copied {
  color: #3fb950;
}

.ai-content code,
.ai-content-static code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9rem;
}

.ai-content :not(pre) > code,
.ai-content-static :not(pre) > code {
  background: var(--surface-muted);
  color: var(--code-inline);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.85em;
}

.ai-content pre code,
.ai-content-static pre code {
  color: inherit;
  background: transparent;
}

.ai-response-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 2rem;
}

.hero {
  text-align: center;
  margin-bottom: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding-bottom: 40px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(27px, 2.4vw, 38px);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.ai-prompt {
  width: 100%;
  max-width: 1010px;
  min-height: 52px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.ask-footer {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  padding: 24px 40px 32px;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  z-index: 40;
  transition: left 200ms cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-collapsed .ask-footer {
  left: var(--sidebar-collapsed-width);
}

/* Empty chat state: center hero + input vertically until a chat starts */
.chat-container.chat-empty {
  justify-content: center;
}

.chat-container.chat-empty .chat-history {
  flex: 0 0 auto;
  overflow: visible;
  padding: 0;
}

.chat-container.chat-empty .ask-footer {
  position: static;
  background: none;
  padding: 32px 40px 0;
}

.chat-container.chat-empty .ai-prompt {
  max-width: 768px;
}

@media (max-width: 980px) {
  .ask-footer {
    padding-inline: 28px;
  }
}

@media (max-width: 680px) {
  .ask-footer {
    left: 0;
    padding: 16px;
  }
}

.ai-prompt textarea {
  flex: 1;
  min-height: 24px;
  max-height: 120px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  padding: 4px 0;
}

.ai-prompt textarea::placeholder {
  color: #686872;
  opacity: 1;
}

.prompt-submit {
  align-self: center;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--text);
  cursor: pointer;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(290px, 1fr);
  gap: 12px;
}

.dashboard-grid > .card {
  margin-bottom: 0;
}

.card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  margin-bottom: 20px;
}

.card-wide {
  grid-column: 1 / -1;
  min-height: 220px;
}

.card h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 500;
}

.card p {
  max-width: 500px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.card-button {
  position: absolute;
  left: 24px;
  bottom: 22px;
  min-height: 32px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
}

.card-button.primary {
  color: #fff;
  background: #141416;
  border-color: #141416;
}

.card-visual {
  position: absolute;
  right: 24px;
  bottom: -12px;
  width: min(45%, 390px);
  height: 160px;
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(120deg, rgba(255, 151, 76, 0.95), rgba(136, 42, 215, 0.55)),
    #efefef;
  transform: rotate(-2deg);
  box-shadow: 0 12px 30px rgba(38, 18, 83, 0.18);
}

.card-visual::after {
  content: 'TOUCH UP';
  position: absolute;
  right: 18px;
  top: 18px;
  width: 150px;
  height: 116px;
  display: grid;
  place-items: center;
  padding: 12px;
  color: #111;
  background: repeating-linear-gradient(
    100deg,
    #d9ff53 0 28px,
    #f4b8ff 28px 64px
  );
  font-weight: 800;
  font-size: 26px;
  line-height: 0.9;
  text-align: center;
}

.mini-chat {
  position: absolute;
  right: 22px;
  bottom: 42px;
  width: 200px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid #dfd9ff;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(92, 64, 190, 0.12);
  font-size: 10px;
  line-height: 1.4;
}

.feedback-card {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  width: 320px;
  padding: 16px 20px 18px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.06);
}

.feedback-card p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.4;
}

.feedback-stars {
  display: flex;
  justify-content: center;
  gap: 16px;
  color: var(--accent);
  font-size: 20px;
}

.account-menu {
  position: fixed;
  z-index: 60;
  top: 68px;
  right: 18px;
  width: 272px;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: 0.18s ease;
}

.account-menu-open .account-menu {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.account-header {
  padding: 16px 18px 10px;
}

.account-header strong {
  display: block;
  font-size: 14px;
}

.account-header span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 10px;
}

.account-menu-group {
  padding: 6px 7px;
  border-top: 1px solid var(--border-soft);
}

.account-menu-group a,
.dark-mode-row {
  min-height: 39px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

.account-menu-group a i,
.dark-mode-row i {
  font-size: 18px;
  color: var(--text-muted);
}

.account-menu-group a:hover {
  background: var(--surface-muted);
}

.account-menu-group small {
  color: var(--text-muted);
}

.menu-trailing {
  color: var(--text-muted);
}

.account-menu-last {
  padding-bottom: 10px;
}

.dark-mode-row {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

.dark-mode-row span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dark-mode-row input {
  appearance: none;
  width: 34px;
  height: 20px;
  padding: 2px;
  border-radius: 999px;
  background: #cfd0d3;
  cursor: pointer;
  transition: 0.2s ease;
}

.dark-mode-row input::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: 0.2s ease;
}

.dark-mode-row input:checked {
  background: var(--accent);
}

.dark-mode-row input:checked::before {
  transform: translateX(14px);
}

html.dark {
  --bg: #151518;
  --surface: #202025;
  --surface-muted: #2a2a30;
  --text: #f4f4f5;
  --text-muted: #aaaab1;
  --border: #37373e;
  --border-soft: #303037;
  --accent-soft: #2e2548;
  --code-text: #e6e8ef;
  --code-inline: #e6e8ef;
  --code-surface: #17171b;
}

html.dark .nav-link.active {
  background: var(--accent-soft);
  color: #a885ff;
}

html.dark .nav-link.active i {
  color: #a885ff !important;
}

html.dark .prompt-submit {
  background: var(--surface-muted);
  color: var(--text-muted);
}

html.dark .ai-prompt textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

html.dark .dark-mode-row input {
  background: #3f3f46;
}

html.dark .nav-link i:first-child {
  color: var(--text-muted);
}

html.dark .nav-section-heading {
  color: var(--text-muted);
}

html.dark .mini-chat {
  border-color: var(--border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

html.dark .quick-chip {
  border-color: var(--border);
}

html.dark .card {
  border-color: var(--border);
}

html.dark .topbar {
  border-color: var(--border);
}

html.dark .sidebar {
  border-color: var(--border);
}

html.dark .account-menu {
  border-color: var(--border);
}

html.dark .feedback-card {
  border-color: var(--border);
}

html.dark .account-menu-group a:hover {
  background: var(--surface-muted);
}

html.dark .account-menu-group a i,
html.dark .dark-mode-row i {
  color: var(--text-muted);
}

html.dark .account-menu-group a:hover i,
html.dark .dark-mode-row:hover i {
  color: var(--text);
}

html.dark .ai-response {
  background: var(--surface);
  border-color: var(--border-soft);
}

html.dark .ai-prompt {
  border-color: var(--border);
}

html.dark .card-button {
  background: var(--surface-muted);
  border-color: var(--border);
}

html.dark .card-button.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

html.dark .quick-chip {
  background: var(--surface-muted);
}

html.dark .quick-chip:hover {
  background: var(--surface);
  border-color: var(--accent);
}

html.dark .card p {
  color: var(--text-muted);
}

html.dark .card-visual {
  background:
    linear-gradient(120deg, rgba(255, 151, 76, 0.8), rgba(136, 42, 215, 0.4)),
    #1a1a1e;
}

html.dark .card-visual::after {
  background: repeating-linear-gradient(
    100deg,
    #b2d640 0 28px,
    #c392cc 28px 64px
  );
  color: #000;
}

@media (min-width: 681px) and (max-width: 980px) {
  :root {
    --sidebar-width: 82px;
  }

  .nav-link {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 8px;
  }

  .nav-link span,
  .nav-section-heading span,
  .nav-trailing {
    display: none;
  }

  .nav-section-heading {
    justify-content: center;
    padding: 0.5rem 0;
  }
}

@media (max-width: 980px) {
  .main-content {
    padding-inline: 28px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .card-wide {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  :root {
    --topbar-height: 58px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    z-index: 40;
    width: 100%;
    height: calc(100vh - var(--topbar-height));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 10px 16px 20px;
  }

  .app-shell.sidebar-collapsed .sidebar {
    transform: translateX(0);
  }

  .sidebar-nav {
    padding-top: 10px;
  }

  .sidebar .nav-link {
    grid-template-columns: 24px 1fr auto;
    justify-items: start;
    padding: 12px 16px;
    font-size: 15px;
  }

  .sidebar .nav-link span,
  .sidebar .nav-section-heading span,
  .sidebar .nav-trailing {
    display: inline;
  }

  .sidebar .nav-section-heading {
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 13px;
    width: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: auto;
    gap: 12px;
  }

  .sidebar .section-icon {
    display: block;
    margin: 0;
  }

  .sidebar .nav-section-heading::before {
    display: none;
  }

  .sidebar .nav-section-chevron {
    display: block;
  }

  .sidebar-collapsed .main-content,
  .sidebar-collapsed .feedback-card {
    display: none;
  }

  .main-content {
    grid-column: 1;
    padding: 40px 16px 90px;
    height: calc(100vh - var(--topbar-height));
  }

  .main-content:has(.chat-container) {
    padding: 0;
  }

  .chat-history {
    padding: 40px 16px 140px;
  }

  .referral-pill span,
  .ask-ai-button span {
    display: none;
  }

  .referral-pill {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .ask-ai-button {
    width: 38px;
    padding: 0;
  }

  .hero {
    margin-bottom: 34px;
  }

  .card {
    min-height: 230px;
  }

  .card-visual {
    width: 58%;
    opacity: 0.65;
  }

  .feedback-card {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .account-menu {
    right: 10px;
    width: min(292px, calc(100vw - 20px));
  }
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.form-group textarea {
  min-height: 110px;
  resize: vertical;
  font-family: inherit;
}

.form-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-hint a {
  color: var(--accent);
  font-weight: 500;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
}

/* Settings pages */
.settings-header {
  margin-bottom: 28px;
}

.settings-header h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 600;
}

.settings-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.settings-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.settings-back:hover {
  color: var(--accent);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.settings-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.settings-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(19, 18, 30, 0.08);
  transform: translateY(-1px);
}

.settings-card.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.settings-card-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
  font-size: 20px;
}

.settings-card-body {
  min-width: 0;
}

.settings-card-body h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.settings-card-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-card-arrow {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 14px;
}

.settings-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 8px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.settings-panel {
  width: 100%;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.settings-panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}

.settings-panel-header h2 {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 600;
}

.settings-panel-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.settings-save {
  min-height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--accent);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 150ms ease;
}

.settings-save:hover {
  background: #5a32d0;
}

.settings-panel-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 11px;
  color: #fff;
  background: var(--accent);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: background 150ms ease;
}

.settings-panel-action:hover {
  background: #5a32d0;
  color: #fff;
}

html.dark .settings-card,
html.dark .settings-panel {
  background: #26262c;
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

html.dark .settings-card:hover {
  border-color: #a885ff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

html.dark .settings-card-body h2,
html.dark .settings-panel-header h2,
html.dark .settings-header h1 {
  color: #ffffff;
}

html.dark .settings-card-body p,
html.dark .settings-panel-header p,
html.dark .settings-header p,
html.dark .form-hint {
  color: #c2c2cc;
}

html.dark .settings-card-icon {
  color: #b99bff;
  background: #35295c;
}

html.dark .settings-badge {
  color: #b99bff;
  background: #35295c;
}

html.dark .settings-card-arrow {
  color: #c2c2cc;
}

html.dark .settings-back {
  color: #c2c2cc;
}

html.dark .settings-back:hover {
  color: #b99bff;
}

html.dark .settings-panel-header,
html.dark .form-actions {
  border-color: var(--border);
}

html.dark .form-hint a {
  color: #b99bff;
}

html.dark .settings-save {
  background: #7c4dff;
}

html.dark .settings-save:hover {
  background: #8f66ff;
}

html.dark .settings-panel-action {
  background: #7c4dff;
}

html.dark .settings-panel-action:hover {
  background: #8f66ff;
}

/* Account sharing */
.sharing-members-panel {
  margin-top: 20px;
}

.sharing-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sharing-member {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}

.sharing-member:last-child {
  border-bottom: 0;
}

.sharing-member-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sharing-member-name {
  font-size: 14px;
  font-weight: 600;
}

.sharing-member-email {
  color: var(--text-muted);
  font-size: 13px;
}

.sharing-member .settings-badge {
  margin-left: auto;
}

.sharing-member-action {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.sharing-member-action:hover {
  background: var(--accent);
  color: #ffffff;
}

.sharing-empty {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

html.dark .sharing-member {
  border-color: var(--border);
}

html.dark .sharing-member-name {
  color: #ffffff;
}

html.dark .sharing-member-email,
html.dark .sharing-empty {
  color: #c2c2cc;
}

html.dark .sharing-member-action {
  color: #b99bff;
  background: #35295c;
}

html.dark .sharing-member-action:hover {
  background: #7c4dff;
  color: #ffffff;
}

/* ==========================================================================
   Data catalog pages (tables, modals, toasts)
   ========================================================================== */

.main-content:has(.catalog-page) {
  padding: 0;
  overflow-y: auto;
}

.catalog-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 18px 24px 32px;
}

.dc-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}

.dc-back-link:hover {
  color: var(--accent);
}

.catalog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.catalog-header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.catalog-header p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.dc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.dc-button.sm {
  min-height: 28px;
  padding: 0 10px;
  font-size: 13px;
}

.dc-button:hover {
  background: var(--surface-muted);
}

.dc-button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.dc-button.primary:hover {
  filter: brightness(1.06);
}

.dc-button.danger {
  background: #d64545;
  border-color: #d64545;
  color: #ffffff;
}

.dc-button.danger:hover {
  filter: brightness(1.06);
}

.dc-button.ghost {
  background: transparent;
}

.dc-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease,
    border-color 150ms ease;
}

.dc-icon-button:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.dc-icon-button.danger:hover {
  color: #d64545;
  border-color: #d64545;
}

.dc-cell-editable {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dc-cell-editable .edit-name-btn {
  opacity: 0;
  transition: opacity 0.2s;
}

.dc-cell-editable:hover .edit-name-btn {
  opacity: 1;
}

.dc-cell-editable input[type='text'] {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
}

.dc-cell-editable input[type='text']:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dc-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.dc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

/* --- Schema catalog components ------------------------------------------- */

.dc-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.dc-breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.dc-breadcrumbs a:hover {
  color: var(--text);
}

.dc-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.dc-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.dc-stat-value {
  font-size: 24px;
  font-weight: 600;
}

.dc-stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.dc-stat-value.danger {
  color: #e05656;
}

.dc-stat-value.warning {
  color: #d9a13a;
}

.dc-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 20px;
}

.dc-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.dc-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent, #4f7cff);
}

.dc-details {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 10px 18px;
  margin: 0;
  padding: 18px 20px;
  font-size: 14px;
}

.dc-details dt {
  color: var(--text-muted);
}

.dc-details dd {
  margin: 0;
}

.dc-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 18px 20px;
}

.dc-form-grid .dc-field.full {
  grid-column: 1 / -1;
}

.dc-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-soft);
}

.dc-inline-form {
  display: inline;
}

.dc-tree,
.dc-tree ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
}

.dc-tree {
  padding: 12px 20px 18px;
}

.dc-tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.dc-tree-node:hover {
  background: var(--surface-muted);
}

.dc-tree-node.file {
  font-weight: 600;
}

.dc-tree-node.active {
  background: var(--surface-muted);
}

.dc-tree-node a {
  color: inherit;
  text-decoration: none;
}

.dc-reorder-list {
  margin: 0;
  padding: 12px 20px 18px 40px;
}

.dc-reorder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

.dc-source {
  display: flex;
  flex-direction: column;
}

.dc-source-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.dc-source .dc-code {
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.55;
  background: var(--code-surface, var(--surface-muted));
  color: var(--code-text, #1f2430);
}

.dc-designer {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(260px, 1.4fr) minmax(
      260px,
      1.4fr
    );
  gap: 16px;
  align-items: start;
}

.dc-designer .dc-card {
  margin-bottom: 0;
}

.dc-designer .dc-card + .dc-card {
  margin-top: 0;
}

.dc-diagram {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.dc-diagram-node {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.dc-diagram-node header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-soft);
}

.dc-diagram-node ul {
  list-style: none;
  margin: 0;
  padding: 8px 14px 12px;
  font-size: 13px;
}

.dc-diagram-node li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.dc-diagram-keys {
  min-width: 34px;
  color: var(--text-muted);
}

.dc-diagram-field {
  flex: 1;
}

.dc-issue-list {
  list-style: none;
  margin: 0;
  padding: 12px 20px 18px;
  font-size: 14px;
}

.dc-issue-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.dc-list {
  margin: 0;
  padding: 14px 20px 18px 38px;
  font-size: 14px;
  line-height: 1.6;
}

.dc-list li + li {
  margin-top: 4px;
}

.dc-diff code {
  font-size: 12px;
  white-space: pre-wrap;
}

.dc-diff tr.changed {
  background: rgba(214, 69, 69, 0.08);
}

@media (max-width: 1100px) {
  .dc-designer {
    grid-template-columns: 1fr;
  }

  .dc-details {
    grid-template-columns: 1fr;
  }
}

.dc-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.dc-card-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.dc-card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dc-header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
}

.dc-header-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dc-header-form select {
  width: auto;
}

.dc-table-top-actions {
  position: absolute;
  top: 10px;
  right: 20px;
  z-index: 10;
}

.dc-header-search {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  min-width: 280px;
}

.dc-header-search i {
  position: absolute;
  left: 10px;
  pointer-events: none;
  font-size: 14px;
}

.dc-header-search input {
  width: 100%;
  padding: 6px 10px 6px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  transition:
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}

.dc-header-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.dc-card-body {
  padding: 18px 20px;
}

.dc-status-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dc-status-body > p {
  margin: 0;
  flex: 1 1 320px;
  font-size: 14px;
  line-height: 1.5;
}

.dc-status-body > .dc-inline-form {
  flex: 0 0 auto;
}

.dc-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dc-quick-actions .dc-button {
  white-space: nowrap;
}

.dc-card-footnote {
  padding: 0 20px 18px;
  font-size: 0.85rem;
}

.dc-filters {
  display: flex;
  align-items: flex-end;
  gap: 14px 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
}

.dc-card-body > .dc-filters,
.dc-modal-body > .dc-filters {
  padding: 0;
}

.dc-card > .dc-filters + * {
  border-top: 1px solid var(--border-soft);
}

.dc-filters > .dc-field {
  min-width: 220px;
  flex: 1 1 220px;
}

.dc-filters > .dc-field:last-child {
  flex: 0 0 auto;
  min-width: 0;
  margin-left: auto;
}

.dc-filters > .dc-field:last-child .dc-button {
  width: auto;
  white-space: nowrap;
}

.dc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.dc-field.full {
  flex-basis: 100%;
}

.dc-field[hidden],
.dc-modal-body [hidden] {
  display: none !important;
}

.dc-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.dc-field input:not([type='checkbox']):not([type='radio']):not([type='file']),
.dc-field select,
.dc-field textarea,
.dc-input:not([type='checkbox']):not([type='radio']):not([type='file']),
.dc-select,
.dc-textarea,
table.dc-table td > input:not([type='checkbox']):not([type='radio']),
table.dc-table td > select,
.dc-header-form select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.dc-field select:not([multiple]),
.dc-select:not([multiple]),
select.dc-input:not([multiple]),
table.dc-table td > select:not([multiple]),
.dc-card select.dataTable-selector,
.dc-card select.datatable-selector,
.dc-header-form select:not([multiple]),
.datatable-dropdown label > select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2367676f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  padding-right: 32px;
  -moz-padding-start: 12px;
  text-indent: 0;
}

html.dark .dc-field select:not([multiple]),
html.dark .dc-select:not([multiple]),
html.dark select.dc-input:not([multiple]),
html.dark table.dc-table td > select:not([multiple]),
html.dark .dc-card select.dataTable-selector,
html.dark .dc-card select.datatable-selector,
html.dark .dc-header-form select:not([multiple]),
html.dark .datatable-dropdown label > select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23aaaab1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}

.dc-field textarea,
.dc-textarea,
textarea.dc-input {
  resize: vertical;
  min-height: 76px;
}

.dc-field select[multiple],
.dc-select[multiple],
select.dc-input[multiple] {
  padding: 6px;
  min-height: 120px;
}

.dc-field select[multiple] option,
.dc-select[multiple] option,
select.dc-input[multiple] option {
  padding: 4px 6px;
  border-radius: 4px;
}

.dc-field select:disabled,
.dc-field input:disabled,
.dc-field textarea:disabled,
.dc-select:disabled,
.dc-input:disabled,
.dc-textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dc-field input:focus,
.dc-field select:focus,
.dc-field textarea:focus,
.dc-input:focus,
.dc-select:focus,
.dc-textarea:focus,
table.dc-table td > input:focus,
table.dc-table td > select:focus,
.dc-header-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dc-field-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.dc-overview-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.dc-overview-columns > .dc-card {
  min-width: 0;
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .dc-overview-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Builder layouts --------------------------------------------------------- */

.dc-columns {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr) minmax(0, 320px);
  gap: 18px;
  align-items: start;
}

.dc-columns > .dc-card {
  min-width: 0;
  margin-bottom: 0;
}

@media (max-width: 1280px) {
  .dc-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dc-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Two pane builder: a field picker and the live preview. Both cards stretch to
   the same height so their headers and bottom edges line up. */

.dc-builder {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  /* One fixed row height keeps both cards exactly the same size, whatever
     amount of content they hold. */
  height: clamp(420px, calc(100vh - 280px), 760px);
  grid-auto-rows: 100%;
}

.dc-builder-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

/* The global `.dc-card + .dc-card` spacing pushes the second grid item down,
   which made the preview card shorter than the field picker. */
.dc-builder > .dc-card {
  margin-bottom: 0;
}

.dc-builder > .dc-card + .dc-card {
  margin-top: 0;
}

.dc-builder-panel > .dc-empty {
  flex: 1 1 auto;
  min-height: 0;
}

.dc-builder-panel > .dc-card-header {
  flex: 0 0 auto;
  min-height: 56px;
}

.dc-builder-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}

.dc-builder-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.dc-builder-flags {
  padding: 14px 20px 0;
}

.dc-builder-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 12px 20px 0;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .dc-builder {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    grid-auto-rows: auto;
  }

  .dc-builder-panel {
    min-height: 0;
    max-height: none;
    height: auto;
  }
}

/* Draggable preview headers */

.dc-draggable-head {
  cursor: grab;
  user-select: none;
  white-space: nowrap;
}

.dc-draggable-head > * {
  vertical-align: middle;
}

.dc-head-grip {
  color: var(--text-muted);
  margin-right: 4px;
}

.dc-head-label {
  margin-right: 4px;
}

.dc-head-settings {
  border: none;
  background: none;
  padding: 0 2px;
  margin-left: 4px;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.dc-draggable-head:hover .dc-head-settings,
.dc-head-settings:focus-visible {
  opacity: 1;
}

.dc-head-settings:hover {
  color: var(--accent);
}

.dc-draggable-head.dragging {
  opacity: 0.4;
}

.dc-draggable-head.drop-target {
  box-shadow: inset 2px 0 0 var(--accent);
}

.dc-drag-col {
  width: 32px;
  text-align: center;
}

.dc-drag-handle {
  cursor: grab;
  color: var(--text-muted);
}

.dc-table tbody tr.dragging {
  opacity: 0.4;
}

.dc-table tbody tr.drop-target {
  box-shadow: inset 0 2px 0 var(--accent);
}

.dc-table tbody tr.dc-pinned-row {
  background: var(--surface-muted, rgba(148, 163, 184, 0.08));
}

.dc-input-suffix-group,
.dc-input-prefix-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.dc-input-suffix-group:focus-within,
.dc-input-prefix-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

table.dc-table td > .dc-input-suffix-group input,
.dc-field .dc-input-suffix-group input,
table.dc-table td > .dc-input-prefix-group input,
.dc-field .dc-input-prefix-group input {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
}

.dc-input-suffix-group input:focus,
.dc-input-prefix-group input:focus {
  outline: none;
  box-shadow: none;
}

.dc-input-suffix,
.dc-input-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--text-muted);
  background: var(--surface-muted, rgba(148, 163, 184, 0.12));
  font-size: 14px;
  white-space: nowrap;
  user-select: none;
}

.dc-input-suffix {
  border-left: 1px solid var(--border);
}

.dc-input-prefix {
  border-right: 1px solid var(--border);
}

button.dc-chip {
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

button.dc-chip:hover {
  border-color: var(--accent);
}

/* Offcanvas ---------------------------------------------------------------- */

.dc-offcanvas-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 60;
}

.dc-offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.16);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  visibility: hidden;
  z-index: 61;
}

.dc-offcanvas.open {
  transform: translateX(0);
  visibility: visible;
}

.dc-offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.dc-offcanvas-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.dc-offcanvas-body {
  flex: 1 1 auto;
  overflow-y: auto;
}

.dc-offcanvas-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}

.dc-draggable-panel > .dc-field-group-summary {
  cursor: grab;
}

.dc-draggable-panel.dragging {
  opacity: 0.4;
}

.dc-draggable-panel.drop-target {
  box-shadow: inset 0 2px 0 var(--accent);
}

body.dc-offcanvas-open {
  overflow: hidden;
}

.dc-card > .dc-section-title,
.dc-builder-body > .dc-section-title {
  margin: 0;
  padding: 16px 20px 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.dc-picker-list {
  list-style: none;
  margin: 0;
  padding: 14px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dc-picker-list > li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dc-section-note {
  margin: 0;
  padding: 6px 20px 14px;
  font-size: 14px;
}

.dc-form-footer > input {
  flex: 1 1 auto;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.dc-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.dc-picker-row .dc-button {
  flex: 0 0 auto;
}

.dc-field-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.dc-field-group:last-child {
  border-bottom: none;
}

.dc-field-group-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* `.dc-field` grows by default so it can share a row inside `.dc-form-grid`.
   In a vertical stack that growth stretches every field over the free height,
   which leaves large gaps between the label, type and format inputs. */
.dc-field-group-body > .dc-field,
.dc-field-group > .dc-field {
  flex: 0 0 auto;
  min-width: 0;
}

.dc-field-group > h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.dc-field-group .dc-checkbox-grid {
  max-height: none;
  overflow: visible;
}

.dc-field-group-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.dc-field-group-spacer {
  flex: 1 1 auto;
}

/* Collapsible column / field panels */

details.dc-field-group {
  display: block;
  padding: 0;
}

details.dc-field-group > .dc-field-group-body,
details.dc-field-group > .dc-field-group-actions {
  padding: 0 20px;
}

details.dc-field-group > .dc-field-group-actions {
  padding-bottom: 16px;
}

details.dc-field-group > .dc-field-group-body {
  padding-top: 4px;
  padding-bottom: 14px;
}

.dc-field-group-summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 10px;
  padding: 12px 20px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
}

.dc-field-group-summary::-webkit-details-marker {
  display: none;
}

.dc-field-group-summary:hover {
  background: var(--surface-muted);
}

.dc-field-group-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
  font-weight: 600;
}

.dc-field-group-name .dc-muted {
  font-weight: 400;
  font-size: 12px;
}

.dc-field-group-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  margin-left: auto;
}

/* Field picker search */

.dc-picker-search {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 0;
  color: var(--text-muted);
}

.dc-picker-search input {
  flex: 0 1 240px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.dc-picker-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.dc-picker-label .dc-muted {
  font-size: 12px;
}

/* Table preview frame */

.dc-preview-frame {
  margin: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.dc-preview-toolbar,
.dc-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-muted);
  font-size: 13px;
}

.dc-preview-toolbar {
  border-bottom: 1px solid var(--border-soft);
}

.dc-preview-footer {
  border-top: 1px solid var(--border-soft);
}

.dc-preview-title {
  font-weight: 600;
}

.dc-preview-search,
.dc-preview-pager {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
}

.dc-preview-frame .dc-table-wrapper {
  padding: 0;
  border: none;
}

.dc-preview-check {
  width: 34px;
}

/* Flags and chips */

.dc-flag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.dc-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dc-flag.on {
  color: var(--text);
}

.dc-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 20px 16px;
}

.dc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 12px;
}

.dc-chip.warning {
  border-color: var(--warning, #d08700);
  color: var(--warning, #d08700);
}

/* Form builder canvas */

/* The form preview is as tall as the sections it holds, so this variant lets
   the row grow instead of clipping it. Only the field picker keeps a cap. */
.dc-builder-form {
  height: auto;
  grid-auto-rows: auto;
  align-items: start;
}

.dc-builder-form > .dc-builder-panel {
  height: auto;
  overflow: visible;
}

.dc-builder-form > .dc-builder-panel:first-child {
  position: sticky;
  top: 16px;
  max-height: clamp(420px, calc(100vh - 140px), 760px);
  overflow: hidden;
}

.dc-builder-form > .dc-builder-panel:first-child .dc-builder-scroll {
  overflow-y: auto;
}

.dc-builder-form .dc-builder-body {
  overflow: visible;
}

.dc-form-canvas {
  padding: 12px 16px 4px;
}

.dc-canvas-section {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.dc-canvas-section > .dc-section-title {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}

.dc-canvas-section + .dc-canvas-section {
  margin-top: 12px;
}

.dc-canvas-grid {
  display: grid;
  grid-template-columns: repeat(var(--dc-canvas-columns, 1), minmax(0, 1fr));
  gap: 12px;
  padding: 4px 4px 16px;
}

.dc-canvas-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: grab;
}

.dc-canvas-field.is-hidden {
  opacity: 0.6;
  border-style: dashed;
}

.dc-canvas-field.dragging {
  opacity: 0.4;
}

.dc-canvas-field.drop-target {
  border-color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}

.dc-canvas-field-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.dc-canvas-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-required {
  color: var(--danger, #c0392b);
  margin-left: 2px;
}

.dc-canvas-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  font-size: 13px;
}

.dc-canvas-control.is-readonly {
  border-style: dashed;
}

.dc-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.dc-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.dc-checkbox input {
  accent-color: var(--accent);
}

.dc-field input[type='checkbox'],
.dc-field input[type='radio'],
table.dc-table input[type='checkbox'],
table.dc-table input[type='radio'] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

/* Toggle switch -------------------------------------------------------------- */

.dc-toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  vertical-align: middle;
}

.dc-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dc-toggle-switch .dc-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.15s ease;
}

.dc-toggle-switch .dc-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.dc-toggle-switch input:checked + .dc-toggle-slider {
  background: var(--accent);
}

.dc-toggle-switch input:checked + .dc-toggle-slider::before {
  transform: translateX(16px);
}

.dc-toggle-switch input:disabled + .dc-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

table.dc-table tbody tr.dc-row-saving {
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.dc-field input[type='number'],
.dc-input[type='number'] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.dc-field input::placeholder,
.dc-input::placeholder,
table.dc-table td > input::placeholder,
.dc-field textarea::placeholder,
.dc-textarea::placeholder,
textarea.dc-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

/* Tables ------------------------------------------------------------------ */

.dc-table-wrapper {
  position: relative;
  padding: 14px 18px 18px;
}

table.dc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.dc-table th {
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

table.dc-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

table.dc-table td > *,
table.dc-table td .dc-actions {
  vertical-align: middle;
}

table.dc-table tbody tr:last-child td {
  border-bottom: none;
}

table.dc-table tbody tr:hover {
  background: var(--surface-muted);
}

.dc-table .text-end {
  text-align: right;
}

.dc-cell-title {
  font-weight: 600;
  color: var(--text);
}

.dc-cell-title:hover {
  color: var(--accent);
}

.dc-cell-sub {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.dc-muted {
  color: var(--text-muted);
}

.dc-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text);
}

/* Inline code inside table cells keeps the accent tint, but darker so it stays
   readable against the surface. */
td .dc-code,
th .dc-code,
.dc-cell-sub .dc-code {
  color: var(--code-inline, #1f2937);
}

pre.dc-code,
.dc-source .dc-code,
.dc-designer-source .dc-code,
.dc-assistant-drawer .dc-code,
code.language-prisma {
  color: var(--code-text, #1f2430);
}

.dc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.dc-badge.accent {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.dc-badge.success {
  background: rgba(34, 145, 89, 0.12);
  border-color: transparent;
  color: #1f8a55;
}

.dc-badge.info {
  background: rgba(43, 118, 209, 0.12);
  border-color: transparent;
  color: #2b76d1;
}

.dc-badge.warning {
  background: rgba(214, 148, 24, 0.16);
  border-color: transparent;
  color: #a86f0d;
}

.dc-badge.danger {
  background: rgba(214, 69, 69, 0.14);
  border-color: transparent;
  color: #c23b3b;
}

.dc-empty {
  padding: 54px 20px;
  text-align: center;
  color: var(--text-muted);
}

.dc-empty i {
  font-size: 34px;
  display: block;
  margin-bottom: 12px;
}

.dc-empty .dc-link-button,
.dc-empty a {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.dc-empty .dc-link-button:hover,
.dc-empty a:hover {
  color: var(--accent-hover, var(--accent));
  text-decoration: none;
}

/* Simple-DataTables theming ----------------------------------------------- */

.dataTable-wrapper .dataTable-top,
.datatable-wrapper .datatable-top,
.dataTable-wrapper .dataTable-bottom,
.datatable-wrapper .datatable-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 0 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.dataTable-wrapper .dataTable-bottom,
.datatable-wrapper .datatable-bottom {
  padding: 14px 0 0;
}

.datatable-wrapper.no-header .datatable-container,
.datatable-wrapper.no-footer .datatable-container {
  border-top-color: var(--border-soft);
  border-bottom-color: var(--border-soft);
}

.datatable-table > thead > tr > th,
table.dc-table > thead > tr > th {
  border-bottom: 1px solid var(--border-soft);
}

.datatable-table > tfoot > tr > th,
table.dc-table > tfoot > tr > th {
  border-top: 1px solid var(--border-soft);
}

.datatable-table > tbody > tr > td,
.datatable-table > thead > tr > th,
.datatable-table > tfoot > tr > th {
  vertical-align: middle;
}

.datatable-sorter::before {
  border-top-color: var(--text-muted);
}

.datatable-sorter::after {
  border-bottom-color: var(--text-muted);
}

.dataTable-input,
.datatable-input,
.dataTable-selector,
.datatable-selector {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

.dc-card select.dataTable-selector,
.dc-card select.datatable-selector,
.datatable-dropdown label > select {
  box-sizing: border-box;
  width: auto;
  min-width: 86px;
  max-width: none;
  height: auto;
  line-height: 1.3;
  padding: 8px 32px 8px 12px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  text-overflow: ellipsis;
  box-shadow: none;
}

.datatable-dropdown label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.dc-field select option,
.dataTable-selector option,
.datatable-selector option {
  background-color: var(--surface);
  color: var(--text);
}

.dc-field select option:checked,
.dataTable-selector option:checked,
.datatable-selector option:checked {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.dc-field select,
.dataTable-selector,
.datatable-selector {
  color-scheme: light;
}

html.dark .dc-field select,
html.dark .dataTable-selector,
html.dark .datatable-selector {
  color-scheme: dark;
}

.dataTable-input:focus,
.datatable-input:focus,
.dataTable-selector:focus,
.datatable-selector:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dataTable-pagination ul,
.datatable-pagination ul {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dataTable-pagination a,
.datatable-pagination a,
.dataTable-pagination button,
.datatable-pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.dataTable-pagination a:hover,
.datatable-pagination a:hover,
.dataTable-pagination button:hover,
.datatable-pagination button:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.dataTable-pagination .active a,
.datatable-pagination .datatable-active a,
.dataTable-pagination .active button,
.datatable-pagination .datatable-active button {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

table.dc-table thead th a {
  color: inherit;
  font: inherit;
  text-decoration: none;
}

/* Modals ------------------------------------------------------------------ */

.dc-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  background: rgba(16, 16, 20, 0.45);
  backdrop-filter: blur(2px);
}

.dc-modal.open {
  display: flex;
}

.dc-modal-dialog {
  width: 100%;
  max-width: 520px;
  margin: auto;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dc-modal-dialog.large {
  max-width: 780px;
}

.dc-modal-dialog > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.dc-modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.dc-modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.dc-modal-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.dc-modal-close:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.dc-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.dc-modal-body .dc-field {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
}

.dc-modal-body p {
  margin: 0;
  font-size: 14px;
}

.schema-display {
  background: var(--code-surface);
  color: var(--code-text);
  padding: 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
    'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--border-soft);
}

.schema-display code {
  color: inherit;
  font-family: inherit;
  background: transparent !important;
  padding: 0 !important;
}

/* Prisma Syntax Highlighting - Optimized for dark mode visibility */
.schema-display .hljs-keyword,
.schema-display .token.keyword {
  color: #c678dd;
}
.schema-display .hljs-title,
.schema-display .token.class-name {
  color: #e5c07b;
}
.schema-display .hljs-title.class_,
.schema-display .hljs-title.function_,
.schema-display .token.function {
  color: #61afef;
}
.schema-display .hljs-string,
.schema-display .token.string {
  color: #98c379;
}
.schema-display .hljs-comment,
.schema-display .token.comment {
  color: #7f848e;
}
.schema-display .hljs-attr,
.schema-display .token.operator {
  color: #d19a66;
}
.schema-display .hljs-bullet,
.schema-display .token.punctuation {
  color: #abb2bf;
}
.schema-display .hljs-built_in,
.schema-display .token.builtin {
  color: #56b6c2;
}

html.dark .schema-display .hljs-keyword,
html.dark .schema-display .token.keyword {
  color: #d55fde;
}
html.dark .schema-display .hljs-title,
html.dark .schema-display .token.class-name {
  color: #e5c07b;
}
html.dark .schema-display .hljs-title.class_,
html.dark .schema-display .hljs-title.function_,
html.dark .schema-display .token.function {
  color: #61afef;
}
html.dark .schema-display .hljs-string,
html.dark .schema-display .token.string {
  color: #98c379;
}
html.dark .schema-display .hljs-comment,
html.dark .schema-display .token.comment {
  color: #5c6370;
}
html.dark .schema-display .hljs-attr,
html.dark .schema-display .token.operator {
  color: #d19a66;
}
html.dark .schema-display .hljs-bullet,
html.dark .schema-display .token.punctuation {
  color: #abb2bf;
}
html.dark .schema-display .hljs-built_in,
html.dark .schema-display .token.builtin {
  color: #56b6c2;
}

.dc-modal-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-muted);
}

.dc-warning {
  color: #c23b3b;
  font-size: 13px;
}

body.dc-modal-open {
  overflow: hidden;
}

/* Toasts ------------------------------------------------------------------ */

.dc-toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
}

.dc-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.dc-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.dc-toast.success {
  border-left-color: #1f8a55;
}

.dc-toast.success i {
  color: #1f8a55;
}

.dc-toast.error {
  border-left-color: #c23b3b;
}

.dc-toast.error i {
  color: #c23b3b;
}

.dc-toast.info i {
  color: var(--accent);
}

.dc-toast-message {
  flex: 1;
  line-height: 1.35;
}

.dc-toast-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
}

/* Collection pages share the same controls as the data catalog. */
.dc-page-header,
.dc-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.dc-section-header { margin: 24px 0 12px; }
.dc-section-title { margin: 0; font-size: 18px; font-weight: 600; }
.dc-col-drag { width: 36px; }
.dc-col-id { width: 60px; color: var(--text-muted); }
.dc-col-actions { width: 1%; white-space: nowrap; }
.dc-drag-handle { cursor: grab; color: var(--text-muted); touch-action: none; }
.dc-drag-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dc-alert { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.dc-alert.error { color: #c23b3b; border-color: currentColor; }
.dc-modal-body .dc-modal-footer { padding: 16px 0 0; }
.dc-modal-body .dc-field { margin-bottom: 16px; }
.dc-col-actions .dc-button + form { margin-left: 4px; }
.dc-empty-state-content { padding: 36px 20px; text-align: center; white-space: normal; }
.dc-empty-state-content > i { display: block; margin-bottom: 14px; color: var(--text-muted); font-size: 30px; }
.dc-empty-state-content h3 { margin: 0 0 8px; color: var(--text); font-size: 17px; font-weight: 600; }
.dc-empty-state-content p { max-width: 440px; margin: 0 auto; color: var(--text-muted); line-height: 1.6; }
.dc-empty-state-actions { display: flex; justify-content: center; margin-top: 20px; }

@media (max-width: 680px) {
  .dc-page-header .dc-header-actions { width: 100%; }
  .dc-page-header .dc-header-actions .dc-button { flex: 1; }
}

.dc-designer-tree,
.dc-designer-editor,
.dc-designer-source {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 140px);
  overflow: auto;
}

.dc-designer-source .dc-code {
  max-height: none;
}

.dc-tree-file + .dc-tree-file {
  margin-top: 10px;
}

.dc-tree-file > ul {
  padding-left: 14px;
  border-left: 1px solid var(--border-soft);
  margin-left: 10px;
}

code.language-prisma {
  font-family: var(
    --font-mono,
    ui-monospace,
    SFMono-Regular,
    'SF Mono',
    Menlo,
    Consolas,
    monospace
  );
  color: inherit;
  background: transparent;
}

@media (max-width: 680px) {
  .catalog-page {
    padding: 20px 16px 32px;
  }

  .dc-table-wrapper {
    position: relative;
    overflow-x: auto;
  }
}

@media (max-width: 1100px) {
  .dc-designer-tree,
  .dc-designer-editor,
  .dc-designer-source {
    position: static;
    max-height: none;
  }
}

/* Assistant ---------------------------------------------------------------- */

.dc-assistant-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: var(--surface);
}

.dc-assistant-context-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.dc-assistant-scope {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.75;
}

.dc-assistant-state {
  text-transform: lowercase;
  opacity: 0.6;
}

.dc-assistant-card {
  align-self: stretch;
  margin: 4px 0;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent, #4f6bed);
  border-radius: 10px;
  background: var(--surface-muted, rgba(0, 0, 0, 0.03));
  font-size: 13px;
}

.dc-assistant-card.failure {
  border-left-color: #d9534f;
}

.dc-assistant-card.running {
  border-left-color: #9aa0a6;
}

.dc-assistant-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.dc-assistant-card-goal {
  margin: 0 0 6px;
  font-weight: 500;
}

.dc-assistant-card-steps {
  margin: 0 0 6px;
  padding-left: 18px;
}

.dc-assistant-card-steps li.destructive {
  color: #d9534f;
}

.dc-assistant-card-warning {
  margin: 0 0 6px;
  color: #d9534f;
}

.dc-assistant-card-text {
  margin: 0 0 10px;
  opacity: 0.8;
}

.dc-assistant-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dc-assistant-card-actions button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.dc-assistant-strip-end {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dc-assistant-new {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 12px;
  padding: 3px 9px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.dc-assistant-new:hover {
  background: var(--surface-muted, rgba(0, 0, 0, 0.04));
}

.dc-assistant-brave {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 12px;
  padding: 3px 9px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.75;
}

.dc-assistant-brave:hover {
  opacity: 1;
  background: var(--surface-muted, rgba(0, 0, 0, 0.04));
}

.dc-assistant-brave.active {
  opacity: 1;
  border-color: #f0a020;
  background: rgba(240, 160, 32, 0.14);
  color: #b26b00;
}

.dc-assistant-thread {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dc-assistant-scroll-bottom {
  position: absolute;
  right: 16px;
  bottom: 12px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface);
  color: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  opacity: 0.9;
}

.dc-assistant-scroll-bottom:hover {
  opacity: 1;
  background: var(--surface-muted, rgba(0, 0, 0, 0.04));
}

.dc-assistant-scroll-bottom[hidden] {
  display: none;
}

.dc-assistant-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  min-height: 240px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dc-assistant-messages::-webkit-scrollbar {
  display: none;
}

.dc-assistant-welcome {
  margin: auto 0;
  text-align: center;
  opacity: 0.85;
}

.dc-assistant-welcome i {
  font-size: 26px;
  opacity: 0.5;
}

.dc-assistant-welcome p {
  margin: 8px 0 14px;
  font-size: 14px;
}

.dc-assistant-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dc-assistant-suggestion {
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.dc-assistant-suggestion:hover {
  background: var(--surface-muted, rgba(0, 0, 0, 0.04));
}

.dc-assistant-message {
  display: flex;
  max-width: 100%;
}

.dc-assistant-message.user {
  justify-content: flex-end;
}

.dc-assistant-bubble {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface-muted, rgba(0, 0, 0, 0.04));
}

.dc-assistant-message.user .dc-assistant-bubble {
  background: var(--accent, #2563eb);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.dc-assistant-message.assistant .dc-assistant-bubble {
  border-bottom-left-radius: 4px;
}

/* Links returned by the assistant stay readable inside both bubble colours. */
.dc-assistant-bubble .dc-assistant-link {
  color: var(--accent, #2563eb);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.dc-assistant-bubble .dc-assistant-link:hover {
  text-decoration-thickness: 2px;
}

.dc-assistant-message.user .dc-assistant-bubble .dc-assistant-link {
  color: #fff;
}

.dc-assistant-typing {
  display: inline-block;
  width: 28px;
  height: 8px;
  background:
    radial-gradient(circle 3px at 4px 4px, currentColor 99%, transparent) 0
      0/12px 100% no-repeat,
    radial-gradient(circle 3px at 4px 4px, currentColor 99%, transparent) 10px
      0/12px 100% no-repeat,
    radial-gradient(circle 3px at 4px 4px, currentColor 99%, transparent) 20px
      0/12px 100% no-repeat;
  opacity: 0.45;
  animation: dc-assistant-typing 1.2s ease-in-out infinite;
}

@keyframes dc-assistant-typing {
  50% {
    opacity: 0.15;
  }
}

.dc-assistant-drawers {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-soft);
  max-height: 45%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dc-assistant-drawers::-webkit-scrollbar {
  display: none;
}

.dc-assistant-drawer + .dc-assistant-drawer {
  border-top: 1px solid var(--border-soft);
}

.dc-assistant-drawer > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.dc-assistant-drawer > summary::-webkit-details-marker {
  display: none;
}

.dc-assistant-drawer[hidden] {
  display: none;
}

.dc-assistant-drawer .dc-code {
  margin: 0 16px 12px;
  padding: 12px 14px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--code-surface, var(--surface-muted));
  color: var(--code-text, #1f2430);
  line-height: 1.5;
}

.dc-assistant-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.dc-assistant-composer textarea {
  flex: 1;
  font: inherit;
  font-size: 14px;
  resize: none;
  max-height: 160px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dc-assistant-composer textarea::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.dc-assistant-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: var(--accent, #2563eb);
  color: #fff;
}

.dc-assistant-send:hover {
  filter: brightness(1.05);
}

.dc-assistant-operation {
  padding: 4px 16px 12px;
}

.dc-assistant-operation header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.dc-assistant-steps {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dc-assistant-steps li {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.dc-assistant-step-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
  min-width: 84px;
}

.dc-assistant-steps li.completed .dc-assistant-step-status {
  color: var(--success, #2f855a);
}

.dc-assistant-steps li.failed .dc-assistant-step-status {
  color: var(--danger, #c53030);
}

.dc-assistant-activity {
  list-style: none;
  margin: 0;
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  max-height: 220px;
  overflow-y: auto;
}

.dc-assistant-activity-item {
  display: flex;
  gap: 8px;
}

.dc-assistant-activity-icon {
  width: 16px;
  text-align: center;
}

.dc-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.assistant-page .dc-assistant-chat {
  max-width: 860px;
  margin: 0 auto;
  height: min(70vh, 720px);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

/* Assistant offcanvas ------------------------------------------------------ */

/* The drawer pushes the shell aside, so no backdrop is needed on wide screens. */
.assistant-offcanvas-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(15, 15, 20, 0.35);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 200ms ease,
    visibility 200ms ease;
}

.assistant-offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  width: var(--assistant-offcanvas-width);
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 40px rgba(15, 15, 20, 0.18);
  transform: translateX(100%);
  visibility: hidden;
  transition:
    transform 240ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 240ms;
}

body.assistant-offcanvas-open .assistant-offcanvas {
  transform: translateX(0);
  visibility: visible;
}

/* The header lines up with the application topbar. */
.assistant-offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  flex: 0 0 var(--topbar-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}

.assistant-offcanvas-header strong {
  display: block;
  font-size: 15px;
}

.assistant-offcanvas-header span {
  font-size: 12px;
  opacity: 0.65;
}

.assistant-offcanvas-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assistant-offcanvas-header-actions .icon-button {
  width: 32px;
  height: 32px;
  font-size: 15px;
}

.assistant-offcanvas-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.assistant-offcanvas-body > .dc-empty {
  margin: auto;
}

/* Narrow screens have no room to push, so the drawer overlays again. */
@media (max-width: 1100px) {
  body.assistant-offcanvas-open .app-shell {
    margin-right: 0;
  }

  body.assistant-offcanvas-open .assistant-offcanvas-backdrop {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 680px) {
  :root {
    --assistant-offcanvas-width: 100vw;
  }
}
