/* CROC Chat — Tactile 3D Skeuomorphic Base & Components */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  scrollbar-gutter: stable;
  background: var(--bg-canvas-grad);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

input, textarea, select, pre, code, .selectable {
  user-select: text;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  outline: none;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  user-select: none;
  transition: opacity 160ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)),
              background-color 160ms var(--ease-fluid, cubic-bezier(0.22, 1, 0.36, 1));
}

button:active:not(:disabled) {
  opacity: 0.85;
  transition-duration: 0ms;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

a {
  color: var(--accent);
  text-decoration: none;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.26); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.44); }

/* Icons */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
}
.icon svg { width: 100%; height: 100%; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 21px; height: 21px; }

/* Unified Squircle & Pill Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 560;
  letter-spacing: -0.01em;
  border: none;
  background: var(--bg-raised);
  color: var(--text-primary);
  box-shadow: var(--shadow-1);
  white-space: nowrap;
}
[data-theme="dark"] .btn {
  background: var(--bg-raised);
  box-shadow: var(--shadow-1);
}
.btn:hover:not(:disabled) {
  background: var(--bg-elevated);
}
[data-theme="dark"] .btn:hover:not(:disabled) {
  background: var(--neutral-4);
}
.btn:active:not(:disabled) {
  background: var(--bg-active);
  opacity: 0.85;
  transition-duration: 0ms;
}

.btn-primary {
  background: var(--cta-bg);
  border: none;
  color: var(--cta-text);
  box-shadow: var(--shadow-2);
}
[data-theme="dark"] .btn-primary {
  background: var(--cta-bg);
  color: var(--cta-text);
  box-shadow: var(--shadow-2);
}
.btn-primary:hover:not(:disabled) {
  background: var(--cta-hover);
}
[data-theme="dark"] .btn-primary:hover:not(:disabled) {
  background: var(--cta-hover);
}
.btn-primary:active:not(:disabled) {
  background: var(--cta-press);
  opacity: 0.85;
  transition-duration: 0ms;
}

/* Apple macOS / iOS Frosted Vibrancy Right-Click Context Menu */
.context-menu {
  position: fixed;
  min-width: 232px;
  padding: 8px;
  border-radius: 26px;
  background: var(--bg-surface-solid);
  border: none;
  box-shadow: none;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: popIn 160ms var(--ease-spring);
}
[data-theme="dark"] .context-menu {
  box-shadow: none;
}
.context-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 14px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
}
.context-menu-item:hover {
  background: var(--accent);
  color: #ffffff;
}
.context-menu-item:hover .context-menu-kbd {
  color: rgba(255, 255, 255, 0.82);
}
.context-menu-sep {
  height: 6px;
  background: transparent;
  margin: 2px 6px;
}
.context-menu-kbd {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-secondary);
}
[data-theme="dark"] .btn-ghost {
  background: transparent;
  box-shadow: none;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  box-shadow: none;
}

.btn-danger {
  background: #c93b3b;
  border: none;
  color: #fdf8f8;
  box-shadow: 0 3px 10px rgba(191, 53, 53, 0.22);
}
.btn-danger:hover:not(:disabled) {
  background: #d94b4b;
}
.btn-sm {
  height: 32px;
  padding: 0 13px;
  font-size: 14px;
  border-radius: 9999px;
}
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border: none;
}
.btn-icon:hover:not(:disabled) {
  background: var(--bg-active);
  color: var(--text-primary);
  box-shadow: var(--shadow-1);
}

/* Soft Borderless Pill/Squircle Inputs & Selectors */
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-input);
  border: none;
  border-radius: 18px;
  padding: 9px 15px;
  font-size: 15px;
  color: var(--text-primary);
  box-shadow: var(--bevel-inset), var(--shadow-1);
  transition: transform 160ms var(--ease-fluid), opacity 160ms ease;
}
[data-theme="dark"] .input,
[data-theme="dark"] .select,
[data-theme="dark"] .textarea {
  background: var(--bg-input);
  box-shadow: var(--bevel-inset), var(--shadow-1);
}
.input:hover, .textarea:hover {
  background: var(--bg-elevated);
}
.input:focus, .select:focus, .textarea:focus {
  background: var(--bg-surface);
  box-shadow: var(--focus-ring-shadow), var(--shadow-2);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.55; border-radius: 22px; }

/* Custom Apple Frosted Capsule Popover Dropdown (with Haptic Press) */
.croc-dd {
  position: relative;
  display: inline-flex;
}
.croc-dd-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 36px;
  padding: 0 15px;
  border-radius: 9999px;
  background: var(--bg-raised);
  border: none;
  box-shadow: var(--shadow-1);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  user-select: none;
  transition: background-color 160ms var(--ease-fluid), opacity 160ms ease;
}
[data-theme="dark"] .croc-dd-trigger {
  background: var(--bg-raised);
  border: none;
  box-shadow: var(--shadow-1);
}
.croc-dd-trigger:hover {
  background: var(--bg-elevated);
}
.croc-dd-trigger:active {
  background: var(--bg-active);
  opacity: 0.85;
  transition-duration: 0ms;
}
.croc-dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 204px;
  padding: 8px;
  border-radius: 24px;
  background: var(--bg-surface-solid);
  border: none;
  box-shadow: none;
  z-index: 950;
  display: none;
  flex-direction: column;
  gap: 3px;
  animation: popIn 150ms var(--ease-spring);
}
.croc-dd.open .croc-dd-menu { display: flex; }
.croc-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 550;
  color: var(--text-primary);
  text-align: left;
  transition: background-color 140ms ease, color 140ms ease;
}
.croc-dd-item:hover {
  background: var(--accent);
  color: #ffffff;
}
.croc-dd-item.active {
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.croc-dd-item.active:hover {
  background: var(--accent);
  color: #ffffff;
}
[data-theme="dark"] .croc-dd-item.active { color: var(--accent-text); }

/* Non-Blocking Apple Dynamic Island Pill (Warm Stone Glass) */
.floating-island {
  position: fixed;
  top: 8px;
  left: calc(var(--nav-rail-w) + (100vw - var(--nav-rail-w)) / 2);
  transform: translateX(-50%);
  z-index: 65;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  background: var(--bg-popover);
  border: none;
  box-shadow: var(--shadow-2), var(--bevel-top);
  transition: transform 200ms var(--ease-spring), opacity 200ms ease;
  opacity: 0.92;
}
[data-theme="dark"] .floating-island {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.44), var(--bevel-top);
}
.floating-island:hover {
  opacity: 1;
  box-shadow: 0 10px 28px rgba(20, 22, 26, 0.14);
}
.floating-island-sep {
  width: 1px;
  height: 16px;
  background: var(--border-subtle);
}

/* Floating Squircle Cards (Shadow & Tonal Separation, Zero Borders) */
.card {
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-2);
  transition: transform 220ms var(--ease-spring), opacity 180ms var(--ease-fluid);
}
.card-interactive {
  transform-style: preserve-3d;
}
/* Progressive Enhancement: Continuous-Curvature Superellipse Squircles */
@supports (corner-shape: superellipse(1.6)) {
  .sidebar-nav-capsule,
  .comm-chat-header,
  .nav-overflow-menu,
  .comm-subfilter-menu,
  .context-menu,
  .croc-dd-menu,
  .ds-dialog,
  .ds-popover,
  .ds-cmd,
  .card,
  .ds-card,
  .kpi-card,
  .drawer-panel,
  .msg-bubble,
  .organic-plate,
  .pk-card,
  .pk-emblem {
    corner-shape: superellipse(1.6);
  }
}
.card-interactive:hover {
  background: var(--bg-elevated);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

/* Clean Pills & Badges (Zero Borders) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  border: none;
  white-space: nowrap;
}
.badge-neutral {
  background: var(--bg-recessed);
  color: var(--text-secondary);
}
.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.badge-cyan {
  background: var(--accent-soft);
  color: var(--accent);
}
.badge-unread {
  background: var(--bg-sunken);
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 680;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  justify-content: center;
}
[data-theme="dark"] .badge-unread {
  background: var(--neutral-4);
  color: var(--text-primary);
  box-shadow: none;
}

/* L7：侧边栏行部门家族左缘（设计稿 §2.4）。只定左缘色，不碰底色/字色；
   未知部门不加 class（无缘色）。 */
.comm-channel-row--dept-stone { border-left: 2.5px solid var(--dept-stone); }
.comm-channel-row--dept-teal { border-left: 2.5px solid var(--dept-teal); }
.comm-channel-row--dept-slate { border-left: 2.5px solid var(--dept-slate); }
.comm-channel-row--dept-olive { border-left: 2.5px solid var(--dept-olive); }
.comm-channel-row--dept-sand { border-left: 2.5px solid var(--dept-sand); }
.comm-channel-row--dept-clay { border-left: 2.5px solid var(--dept-clay); }

/* Status Dots */
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-working { color: var(--text-secondary); background: var(--bg-elevated); border-color: var(--border-subtle); }
.status-dot.status-working { background: var(--st-working); box-shadow: none; }
.status-thinking { color: var(--text-secondary); background: var(--bg-elevated); border-color: var(--border-subtle); }
.status-dot.status-thinking { background: var(--st-thinking); }
.status-idle { color: var(--text-secondary); background: var(--bg-elevated); border-color: var(--border-subtle); }
.status-dot.status-idle { background: var(--st-idle); }
.status-waiting { color: var(--st-waiting); background: var(--st-waiting-bg); border-color: rgba(217,119,6,0.28); }
.status-dot.status-waiting { background: var(--st-waiting); }
.status-delayed { color: var(--st-delayed); background: var(--st-delayed-bg); border-color: rgba(234,88,12,0.28); }
.status-dot.status-delayed { background: var(--st-delayed); }
.status-blocked { color: var(--st-blocked); background: var(--st-blocked-bg); border-color: rgba(220,38,38,0.28); }
.status-dot.status-blocked { background: var(--st-blocked); }
.status-error { color: var(--st-error); background: var(--st-error-bg); border-color: rgba(225,29,72,0.3); }
.status-dot.status-error { background: var(--st-error); }
.status-offline { color: var(--st-offline); background: var(--st-offline-bg); border-color: rgba(148,163,184,0.25); }
.status-dot.status-offline { background: var(--st-offline); }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.26); opacity: 0.65; }
}

/* Swiss / Anthropic Ink-on-Porcelain Minimalist Avatars */
.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 28%;
  overflow: hidden;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: transform 180ms var(--ease-spring), opacity 160ms ease;
}
.avatar:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.09);
}
.avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}
.avatar-round { border-radius: 28%; }
.avatar-status {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2.5px solid var(--bg-surface-solid);
}

/* Pill Segmented Control (Zero Borders) */
.segmented {
  display: inline-flex;
  padding: 4px;
  background: var(--bg-recessed);
  border: none;
  border-radius: 9999px;
  box-shadow: var(--bevel-inset);
  gap: 3px;
}
.segmented button {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.segmented button.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-1);
}

/* Floating Pill Tabs (Zero Borders) */
.tabs {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-height: 44px;
  padding: 4px;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow-x: auto;
  max-width: 100%;
  width: fit-content;
}
.tabs::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: 9999px;
  background: var(--bg-recessed);
  box-shadow: var(--bevel-inset);
}
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 580;
  color: var(--text-secondary);
  border-radius: 9999px;
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.tab:hover {
  color: var(--text-primary);
  background: rgba(20, 22, 26, 0.04);
}
[data-theme="dark"] .tab:hover {
  background: rgba(255, 255, 255, 0.06);
}
.tab.active {
  color: var(--text-primary);
  background: var(--bg-surface);
  box-shadow: var(--shadow-1);
}
[data-theme="dark"] .tab.active {
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.36), var(--bevel-top);
}
.tab.active::after {
  display: none;
}

/* Progress Bar (Recessed Track + 3D Fill) */
.progress {
  height: 7px;
  border-radius: 99px;
  background: var(--bg-recessed);
  box-shadow: var(--bevel-inset);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--croc-gradient);
  transition: width 320ms var(--ease-spring);
}

/* Rich Media Attachments in Chat */
.media-image-card {
  margin-top: 8px;
  border-radius: var(--radius-md);
  overflow: visible;
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-raised-sm);
  max-width: 340px;
  cursor: zoom-in;
  background: var(--bg-surface-solid);
  transition: transform var(--t-med) var(--ease-spring), box-shadow var(--t-med);
}
.media-image-card:hover {
  box-shadow: var(--shadow-raised-lg);
}
.media-image-card img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius-md);
}
.media-caption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Sleek Compact Voice Pill + Inline Speech-to-Text */
.voice-wrap {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 310px;
}
.media-audio-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-raised-sm);
  min-width: 224px;
  color: var(--text-primary);
}
.audio-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--croc-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-accent);
  flex-shrink: 0;
}
.audio-bars {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 20px;
  flex: 1;
}
.audio-bar {
  width: 2.5px;
  border-radius: 3px;
  background: var(--border-strong);
  transition: background 180ms;
}
.audio-bar.active { background: var(--accent); }
.media-audio-card.playing .audio-bar {
  animation: waveBounce 0.85s infinite ease-in-out alternate;
}
@keyframes waveBounce {
  from { transform: scaleY(0.5); }
  to { transform: scaleY(1.18); }
}
.voice-dur {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.voice-transcribe-btn {
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  background: var(--bg-recessed);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.voice-transcribe-btn:hover,
.voice-transcribe-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-deep);
}
[data-theme="dark"] .voice-transcribe-btn.active { color: var(--accent-text); }
.voice-transcript {
  display: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-recessed);
  border: 1px solid var(--border-subtle);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
}
.voice-wrap.show-transcript .voice-transcript {
  display: block;
  animation: fadeIn 160ms ease;
}

.media-video-card {
  margin-top: 8px;
  border-radius: var(--radius-md);
  overflow: visible;
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-raised);
  max-width: 360px;
  background: #0d1117;
  color: #fff;
}
.media-video-card video {
  display: block;
  width: 100%;
  max-height: 220px;
  background: #000;
  border-radius: var(--radius-md);
}

/* Rich Link Preview Card */
.link-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-raised);
  overflow: visible;
  max-width: 420px;
  margin-top: 10px;
  transition: transform var(--t-med) var(--ease-spring), box-shadow var(--t-med);
}
.link-card:hover {
  box-shadow: var(--shadow-raised-lg);
}
.link-card-cover {
  position: relative;
  height: 136px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.link-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; color: var(--text-primary); }
.link-card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-muted); }

/* Empty / Error / Skeleton */
.state-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 56px 24px; gap: 14px; height: 100%; min-height: 300px;
}
.state-icon {
  width: 58px; height: 58px; border-radius: 18px;
  background: var(--bg-surface); border: 1px solid var(--border-default);
  box-shadow: var(--shadow-raised);
  display: flex; align-items: center; justify-content: center; color: var(--accent);
}
.skeleton {
  background: var(--bg-recessed);
  opacity: 0.72;
  border-radius: var(--radius-md);
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.48);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  animation: fadeIn 150ms ease;
}
.modal-dialog {
  width: 100%; max-width: 560px; max-height: 86vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised-lg);
  display: flex; flex-direction: column; overflow: visible;
  animation: popIn 200ms var(--ease-spring);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-subtle);
}
.modal-body { padding: 20px; overflow-y: auto; scrollbar-gutter: stable; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border-subtle);
  background: var(--bg-recessed);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* Toast */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 1200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--radius-md);
  background: var(--bg-surface-solid); border: none;
  box-shadow: none; font-size: 15px; font-weight: 550;
  color: var(--text-primary); min-width: 240px; max-width: 380px;
  animation: popIn 200ms var(--ease-spring);
}

/* Markdown & Diff */
.md-body { line-height: 1.75; color: var(--text-primary); font-size: 14.5px; }
.md-body h1 { font-size: 24px; font-weight: 750; margin: 4px 0 16px; letter-spacing: -0.025em; }
.md-body h2 { font-size: 17px; font-weight: 650; margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border-subtle); }
.md-body h3 { font-size: 15px; font-weight: 650; margin: 16px 0 8px; }
.md-body p { margin-bottom: 12px; color: var(--text-secondary); }
.md-body ul, .md-body ol { margin: 8px 0 14px 22px; color: var(--text-secondary); }
.md-body li { margin-bottom: 6px; }
.md-body code { font-family: var(--font-mono); font-size: 12.5px; padding: 2px 6px; border-radius: 6px; background: var(--bg-recessed); color: var(--accent-deep); }
.md-body pre { background: var(--bg-recessed); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 14px; overflow-x: auto; margin: 12px 0; }
.md-body pre code { background: none; padding: 0; color: var(--text-primary); }
.md-body blockquote { border-left: 3.5px solid var(--accent); padding: 8px 14px; margin: 12px 0; background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.diff-line { font-family: var(--font-mono); font-size: 12.5px; padding: 3px 12px; white-space: pre-wrap; }
.diff-add { background: var(--info-soft); color: var(--info-text); }
.diff-del { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
.diff-ctx { color: var(--text-muted); }

/* Utilities */
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 14px; }
.gap-4 { gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
