.panel,
.notice,
.empty-state,
.message-card,
.catalog-item {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dfe7f2;
  box-shadow: 0 18px 40px rgba(35, 52, 82, 0.06);
}

.panel { padding: 18px; }

.header-actions,
.section-head,
.button-row,
.mini-info,
.bind-row,
.composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-copy {
  display: grid;
  gap: 4px;
}

.hero-line {
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: #182236;
}

.section-head.compact { align-items: flex-start; }
.notice, .empty-state, .catalog-item { padding: 14px; }
.notice {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 250, 0.96));
  border-color: rgba(214, 228, 223, 0.96);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.05);
  color: #355650;
  flex: 0 0 auto;
}
.notice.error {
  background: linear-gradient(180deg, rgba(255, 250, 250, 0.98), rgba(255, 244, 244, 0.96));
  border-color: rgba(248, 113, 113, 0.24);
  color: #972f2f;
}
.toast-notice {
  animation: notice-fade 2.4s ease forwards;
}
.empty-state { background: #f8fbff; border-style: dashed; }

.content-area {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.chat-panel {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.bind-entry {
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed #cfdced;
  background: #f8fbff;
}

.bind-entry-copy {
  display: grid;
  gap: 6px;
}

.bind-row input { flex: 1 1 auto; }
.bind-row button { flex: 0 0 auto; min-width: 96px; }

.inline-hint {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fbff;
  border: 1px solid #e3ebf5;
}
.inline-hint.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
  color: #972f2f;
}
.settings-actions { justify-content: flex-start; }

.settings-input-label {
  width: 100%;
  display: grid;
  gap: 8px;
}

.settings-input-label-text {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: #5f738e;
}

.workspace-directory-card {
  display: grid;
  gap: 12px;
}

.workspace-directory-panel {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid #d8e1ef;
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 12px 28px rgba(35, 52, 82, 0.05);
}

.workspace-directory-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #60728c;
}

.workspace-directory-path {
  color: #1f2f49;
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
}

.workspace-directory-hint {
  color: #667794;
  font-size: 13px;
  line-height: 1.6;
}

.workspace-directory-draft-row,
.workspace-directory-inline-actions,
.workspace-directory-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.workspace-directory-draft-row {
  justify-content: space-between;
}

.workspace-directory-draft-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 123, 255, 0.08);
  color: #0f67de;
  font-size: 12px;
  font-weight: 700;
}

.workspace-directory-inline-actions button {
  min-height: 36px;
  padding: 8px 14px;
}

.workspace-directory-inline-button {
  box-shadow: inset 0 0 0 1px #d8e1ef;
}
.field-label { color: #53637f; font-size: 13px; }

.scroll-panel,
.page-stack {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.message-list {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.scroll-panel {
  align-content: start;
}

.message-card { padding: 16px; }
.message-card.user { background: transparent; }
.message-card.assistant { background: transparent; }
.message-card.streaming { border-color: #b7e4d5; }
.message-card.error { border-color: rgba(239, 68, 68, 0.24); }
.message-card p {
  white-space: pre-wrap;
  line-height: 1.7;
  margin-top: 6px;
}

.thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  color: #46607f;
}

.thinking-spinner {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(59, 130, 246, 0.18);
  border-top-color: var(--color-secondary-500);
  animation: spinner-rotate 0.8s linear infinite;
}

.thinking-label {
  font-size: 14px;
  font-weight: 600;
}

.message-cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: var(--space-1);
  border-radius: var(--radius-full);
  background: var(--color-secondary-500);
  vertical-align: text-bottom;
  animation: cursor-blink 1s steps(1, end) infinite;
}

.message-trace {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.trace-inline-toggle {
  width: fit-content;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4f6f98;
  font-size: 13px;
  line-height: 1.6;
}

.message-trace-content {
  display: grid;
  gap: 8px;
}

.message-trace-line {
  margin: 0;
  color: #667794;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.message-trace-line.success {
  color: #0f7f59;
}

.message-trace-line.error {
  color: #972f2f;
}

.message-trace-time {
  display: inline-block;
  min-width: 56px;
  margin-right: 8px;
  color: #8ca0ba;
  font-variant-numeric: tabular-nums;
}

.message-trace-text {
  color: inherit;
}

.message-trace-detail {
  display: block;
  padding-left: 64px;
  color: inherit;
}

.nav-item-icon svg,
.message-action-icon svg,
.composer-submit svg,
.attachment-trigger svg,
.markdown-code-copy svg {
  width: 18px;
  height: 18px;
}

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

.message-plain-text,
.markdown-body {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.82;
}

.markdown-body {
  display: grid;
  gap: 14px;
}

.markdown-body > * {
  margin: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: #10233d;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.markdown-body h1 {
  font-size: 28px;
  line-height: 1.24;
}

.markdown-body h2 {
  font-size: 23px;
  line-height: 1.28;
}

.markdown-body h3 {
  font-size: 19px;
  line-height: 1.34;
}

.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-size: 16px;
  line-height: 1.42;
}

.markdown-paragraph {
  color: #20344d;
}

.markdown-list {
  display: grid;
  gap: 8px;
  padding-left: 22px;
  color: #20344d;
}

.markdown-list li {
  padding-left: 4px;
  line-height: 1.78;
}

.markdown-quote {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-left: 3px solid #7cb7ff;
  border-radius: 0 18px 18px 0;
  background: linear-gradient(180deg, rgba(241, 247, 255, 0.96), rgba(248, 251, 255, 0.94));
  color: #35506f;
}

.markdown-rule {
  border: 0;
  border-top: 1px solid rgba(200, 214, 232, 0.92);
  margin: 4px 0;
}

.markdown-inline-code {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  background: #eef4fb;
  color: #11407e;
  font-size: 0.92em;
  line-height: 1.6;
}

.markdown-link {
  color: #0f67de;
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 103, 222, 0.22);
}

.markdown-link:hover {
  color: #0c58bf;
  border-bottom-color: rgba(12, 88, 191, 0.38);
}

.markdown-code-block {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #f8fafc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.markdown-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.markdown-code-copy {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  background: #e2e8f0;
  color: #4b6484;
  box-shadow: inset 0 0 0 1px #d8e1ef;
}

.markdown-code-copy.copied {
  background: #ecfdf3;
  color: #169b58;
  box-shadow: inset 0 0 0 1px rgba(22, 155, 88, 0.16);
}

.markdown-code-pre {
  margin: 0;
  padding: 16px 18px 18px;
  overflow: auto;
  color: #18314e;
  font-size: 13px;
  line-height: 1.75;
}

.message-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-start;
  opacity: 0;
  transition: opacity 150ms ease;
}

.message-card:hover .message-card-actions {
  opacity: 1;
}

.message-action-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #5f7773;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

.message-action-icon:hover {
  background: #f4fbfa;
}

.message-action-icon.copied {
  background: #ecfdf3;
  color: #16a34a;
}

.composer-shell {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--color-border-light);
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.98),
    rgba(248, 250, 252, 0.96)
  );
  flex: 0 0 auto;
  box-shadow: var(--shadow-sm);
}

.composer-field {
  display: grid;
  gap: 10px;
}

.composer-shell.dragging {
  border-color: rgba(139, 92, 246, 0.36);
  background: var(--color-primary-50);
}

.composer-skill-badge {
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d7e4f2;
  background: #f3f8ff;
  color: #1f5f9c;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-field textarea {
  min-height: 88px;
}

.composer-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.composer-left-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.attachment-trigger {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f1f8f6;
  color: #466560;
  box-shadow: inset 0 0 0 1px rgba(214, 228, 223, 0.96);
}

.attachment-trigger.icon-only {
  width: 38px;
  min-width: 38px;
  padding: 0;
  color: var(--ui-color-primary-strong);
  background: #edf8f6;
  box-shadow: inset 0 0 0 1px rgba(191, 216, 209, 0.96);
}

.composer-attachment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.composer-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: #f1f5f9;
  color: #1e293b;
}

.composer-attachment-chip-label {
  font-size: 13px;
  line-height: 1.4;
}

.composer-attachment-remove {
  min-width: 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #5f7773;
  box-shadow: inset 0 0 0 1px rgba(214, 228, 223, 0.96);
}

.composer-drop-indicator {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(109, 93, 252, 0.42);
  border-radius: 18px;
  background: #F0F7FF;
  color: var(--ui-color-primary-strong);
  font-size: 13px;
  font-weight: 600;
}

.composer-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.composer-submit-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: #ffffff;
  animation: spinner-rotate 0.8s linear infinite;
}

.composer-left-tools-expert {
  min-height: 38px;
}

.composer-mode-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f2f6fb;
  color: #5f7188;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.skill-trigger,
.skill-chip {
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
}

.skill-trigger {
  width: 38px;
  padding: 0;
  background: rgba(255, 255, 255, 0.94);
  color: #284843;
  font-size: 16px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(214, 228, 223, 0.96);
}

.skill-trigger.text-trigger {
  width: auto;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.skill-chip {
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.18);
  color: var(--ui-color-primary-strong);
}

.composer-shell .skill-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 12;
  width: min(320px, calc(100vw - 96px));
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid #dbe5f1;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(35, 52, 82, 0.14);
}

.composer-shell .skill-menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 4px;
  padding: 10px 12px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
}

.composer-shell .skill-menu-item strong {
  color: #20304b;
}

.composer-shell .skill-menu-item span {
  color: #667794;
  font-size: 12px;
  line-height: 1.6;
}

.composer-shell .skill-menu-item.active {
  border-color: rgba(13, 148, 136, 0.18);
  background: rgba(237, 248, 246, 0.96);
}

.catalog-item {

  text-align: left;
  display: grid;
  gap: 8px;
}
.catalog-item.static { cursor: default; }
.catalog-item:hover { transform: translateY(-1px); }
.catalog-item.static:hover { transform: none; }

.form-grid.single { grid-template-columns: 1fr; }
.mini-info {
  padding: 14px 16px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid #e3ebf5;
}
.mini-info strong {
  max-width: 68%;
  text-align: right;
  line-height: 1.6;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(239, 247, 245, 0.98);
  color: #4f6965;
  box-shadow: inset 0 0 0 1px rgba(214, 228, 223, 0.92);
}
.status-chip.positive { background: rgba(16, 185, 129, 0.12); color: #0f7f59; }
.status-chip.warning { background: rgba(245, 158, 11, 0.14); color: #b46f0a; }

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--revamp-border);
  background: rgba(255, 255, 255, 0.78);
}

.tab-trigger {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--revamp-text-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.tab-trigger:hover:not(:disabled) {
  color: var(--revamp-blue-strong);
  background: var(--revamp-surface-soft);
}

.tab-trigger.active {
  color: var(--revamp-blue-strong);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(35, 52, 82, 0.08), inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(13, 148, 136, 0.18);
  outline-offset: 2px;
}

@keyframes notice-fade {
  0%, 78% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes cursor-blink {
  0%, 50% {
    opacity: 1;
  }
  50.1%, 100% {
    opacity: 0;
  }
}

@keyframes spinner-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .hero-line { font-size: 21px; }
  .composer-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .composer-left-tools {
    width: 100%;
  }
  .composer-shell .skill-menu {
    width: min(100%, 320px);
  }
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .sidebar {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--color-border-light);
  }
  .main-shell {
    height: 100%;
  }
  .nav-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .main-shell, .sidebar { padding: var(--space-4); }
  .startup-overlay { padding: 18px; }
  .startup-overlay-panel { width: 100%; }
  .startup-overlay-copy { gap: 14px; margin-top: 6px; }
  .startup-overlay-brand-line { flex-direction: column; gap: 14px; }
  .startup-overlay-brand-copy { justify-items: center; text-align: center; }
  .startup-overlay-mark-shell { width: 56px; height: 56px; }
  .startup-overlay-logo { width: 48px; height: 48px; }
  .startup-overlay-copy h1 { font-size: clamp(42px, 14vw, 60px); }
  .startup-overlay-tagline { font-size: 13px; letter-spacing: 0.24em; }
  .startup-overlay-body { width: 100%; margin-top: 28px; }
  .startup-overlay-status { width: 100%; }
  .header-actions,
  .button-row,
  .mini-info,
  .bind-row {
    align-items: stretch;
    flex-direction: column;
  }
  .nav-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-item { justify-content: center; }
  .hero-line { font-size: 18px; }
  .chat-panel { padding: 16px; }
}

@media (max-width: 860px) {
  .workspace-directory-draft-row {
    align-items: stretch;
    flex-direction: column;
  }
}



.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: color 0.2s, background-color 0.2s;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.button-primary {
  background-color: #2563eb;
  color: white;
}

.button-primary:hover:not(:disabled) {
  background-color: #1d4ed8;
}

.button-secondary {
  background-color: #e5e7eb;
  color: #111827;
}

.button-secondary:hover:not(:disabled) {
  background-color: #d1d5db;
}

.button-ghost {
  background-color: transparent;
  color: #111827;
}

.button-ghost:hover:not(:disabled) {
  background-color: #f3f4f6;
}

.button-sm {
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
}

.button-md {
  height: 2.5rem;
  padding: 0 1rem;
  font-size: 1rem;
}

.button-lg {
  height: 3rem;
  padding: 0 1.5rem;
  font-size: 1.125rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--revamp-text-muted);
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.icon-button svg {
  width: 1em;
  height: 1em;
}

.icon-button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.icon-button-sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.875rem;
}

.icon-button-md {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1rem;
}

.icon-button-ghost:hover:not(:disabled),
.icon-button-subtle {
  border-color: var(--revamp-border);
  background: var(--revamp-surface-soft);
  color: var(--revamp-blue);
}

.icon-button-subtle:hover:not(:disabled) {
  background: var(--revamp-blue-soft);
  color: var(--revamp-blue-strong);
}

.icon-button-danger:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(254, 242, 242, 0.96);
  color: #dc2626;
}

.panel {
  background-color: white;
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.panel-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  padding: 0.75rem 1rem;
}

.panel-body {
  padding: 1rem;
}

.panel-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding: 0.75rem 1rem;
  background-color: #f9fafb;
}

.scroll-area {
  position: relative;
  overflow: hidden;
}

.scroll-area-content {
  height: 100%;
  width: 100%;
  overflow-y: auto;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

