:root {
  --bg: #0F0F1A;
  --bg2: #1A1A2E;
  --bg3: #252542;
  --ink: #EAEAF0;
  --muted: #8888A0;
  --rule: #2E2E4A;
  --accent: #FF6B4A;
  --accent2: #4ECDC4;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* 移动端触控优化：防止误触发系统手势 */
  touch-action: manipulation;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

header h1 {
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.multi-device-link {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 18px;
  background: var(--bg3);
  color: var(--accent2);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid var(--rule);
  transition: all 0.2s;
}

.multi-device-link:hover {
  background: var(--accent2);
  color: var(--bg);
  border-color: var(--accent2);
}

.accessibility-link {
  border-color: #4fc3f7;
  color: #4fc3f7;
}

.accessibility-link:hover {
  background: #4fc3f7;
  color: #000;
  border-color: #4fc3f7;
}

.main-layout {
  display: grid;
  grid-template-columns: 1fr 280px 380px;
  gap: 20px;
}

@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 1fr 1fr;
  }
  .avatar-section {
    order: 3;
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* 视频区域 */
.video-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg2);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--rule);
}

.video-wrapper video,
.video-wrapper canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-wrapper canvas {
  z-index: 2;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  z-index: 10;
  gap: 16px;
}

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

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-primary,
.btn-secondary {
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary:hover:not(:disabled) {
  background: #ff8566;
}

.btn-secondary {
  background: var(--bg3);
  color: var(--ink);
  border: 1px solid var(--rule);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--rule);
}

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

.status {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 24px;
}

/* 隐私保护模式开关 */
.privacy-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  padding: 12px;
  background: var(--bg2);
  border-radius: 8px;
  border: 1px solid var(--rule);
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg3);
  border-radius: 26px;
  transition: background 0.3s;
  border: 1px solid var(--rule);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: var(--ink);
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.toggle-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.toggle-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

/* 隐私模式激活时隐藏视频 */
.video-wrapper.privacy-active video,
.video-wrapper.privacy-active canvas {
  opacity: 0;
  visibility: hidden;
}

.video-wrapper.privacy-active {
  background: var(--bg3);
}

.video-wrapper.privacy-active::after {
  content: '隐私保护模式已启用';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1rem;
  z-index: 1;
}

/* 数据面板 */
.data-panel {
  background: var(--bg2);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--rule);
  height: fit-content;
}

.data-panel h2 {
  font-size: 1.2rem;
  color: var(--accent2);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.param-group {
  margin-bottom: 20px;
}

.param-group h3 {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.param-row {
  display: grid;
  grid-template-columns: 80px 1fr 50px;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.param-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

.param-bar {
  height: 8px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
}

.param-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px;
  transition: width 0.1s ease-out;
}

.param-value {
  font-size: 0.8rem;
  color: var(--accent2);
  font-family: 'Courier New', monospace;
  text-align: right;
}

.fps-counter {
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

.fps-counter span {
  color: var(--accent);
  font-weight: 700;
}

/* 调试小人区域 */
.avatar-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.avatar-section h2 {
  font-size: 1.2rem;
  color: var(--accent2);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

/* 尺寸稳定：明确 min/max，避免内部渲染导致外层在球体/鲸鱼切换时尺寸闪烁 */
.avatar-wrapper {
  position: relative;
  width: 100%;
  min-height: 240px;
  min-width: 240px;
  max-height: 640px;
  aspect-ratio: 1;
  background: var(--bg2);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--rule);
  display: block;
}

.avatar-wrapper canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.avatar-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.avatar-controls.model-params {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--bg2);
  border-radius: 10px;
  border: 1px solid var(--rule);
}

.model-param-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.model-param-row label {
  font-size: 0.8rem;
  color: var(--ink);
  opacity: 0.8;
  display: flex;
  justify-content: space-between;
}

.model-param-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin: 0;
}

.btn-small {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg3);
  color: var(--ink);
  border: 1px solid var(--rule);
  transition: all 0.2s;
}

.btn-small:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.control-label {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--ink2);
  text-align: center;
  padding-top: 4px;
}

/* 镜像开关 */
.mirror-toggle,
.app-mode-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  padding: 10px;
  background: var(--bg2);
  border-radius: 8px;
  border: 1px solid var(--rule);
}

.app-mode-toggle {
  background: linear-gradient(135deg, rgba(255, 107, 74, 0.12), rgba(255, 140, 100, 0.08));
  border-color: rgba(255, 107, 74, 0.25);
}

.app-mode-toggle .toggle-label {
  color: #ff8f70;
  font-weight: 600;
}

/* 应用模式：全屏居中，保持 1:1 长宽比 */
body.app-mode .main-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0;
  gap: 0;
}

body.app-mode .video-section,
body.app-mode .data-panel {
  display: none;
}

body.app-mode .avatar-section {
  grid-column: auto;
  max-width: none;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

body.app-mode .avatar-section h2,
body.app-mode .avatar-controls,
body.app-mode .mirror-toggle,
body.app-mode .app-mode-toggle,
body.app-mode .model-import {
  display: none;
}

/* 应用模式退出按钮 */
.exit-app-btn {
  display: none;
}

body.app-mode .exit-app-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: rgba(255, 107, 74, 0.85);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
  margin-top: 8px;
}

body.app-mode .exit-app-btn:hover {
  background: rgba(255, 107, 74, 1);
  transform: scale(1.02);
}

body.app-mode .avatar-wrapper {
  width: min(90vw, 90vh);
  height: min(90vw, 90vh);
  max-width: 600px;
  max-height: 600px;
  aspect-ratio: 1;
}

/* 灵敏度控制 */
.sensitivity-group {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-top: 8px;
}

.sensitivity-row {
  display: grid;
  grid-template-columns: 70px 1fr 45px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sensitivity-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

.sensitivity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.sensitivity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--ink);
  transition: transform 0.15s;
}

.sensitivity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.sensitivity-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--ink);
}

.sensitivity-value {
  font-size: 0.75rem;
  color: var(--accent);
  font-family: 'Courier New', monospace;
  text-align: right;
}

/* 校准 */
.calib-group {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-top: 8px;
}

.calib-desc {
  font-size: 0.8rem;
  color: var(--ink-2);
  margin: 0 0 10px 0;
  line-height: 1.5;
}

#calibBtn {
  width: 100%;
}

#calibBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 性能模式 */
.perf-group {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-top: 8px;
}

.perf-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.perf-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: all 0.2s;
}

.perf-option:hover {
  border-color: var(--accent);
}

.perf-option input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.perf-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 40px;
}

.perf-desc {
  font-size: 0.75rem;
  color: var(--muted);
}

/* 模型导入 */
.model-import {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.model-import h3 {
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
  color: var(--ink);
}

.model-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.model-tab {
  flex: 1;
  padding: 0.5rem 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--bg2);
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.model-tab.active {
  background: linear-gradient(135deg, rgba(255, 107, 74, 0.2), rgba(255, 140, 100, 0.1));
  border-color: rgba(255, 107, 74, 0.4);
  color: var(--accent2);
}

.model-tab:hover:not(.active) {
  border-color: var(--accent);
  color: var(--ink);
}

.live2d-import {
  animation: fadeIn 0.3s ease;
}

.import-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.import-input {
  display: none;
}

.import-btn {
  display: block;
  width: 100%;
  padding: 0.6rem;
  background: var(--bg3);
  border: 1.5px dashed var(--rule);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.import-btn:hover {
  border-color: var(--accent);
  color: var(--accent2);
  background: rgba(255, 107, 74, 0.08);
}

.model-status {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--accent);
  min-height: 1.2rem;
}

/* 形象版本选择 */
.avatar-version-select {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.avatar-version-select label {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.avatar-version-select select {
  flex: 1;
  padding: 0.4rem 0.6rem;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
}

.avatar-version-select select:focus {
  outline: none;
  border-color: var(--accent);
}

body.app-mode .avatar-version-select {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 帮助按钮 */
.help-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  line-height: 1;
}

.help-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(78, 205, 196, 0.1);
}

/* 上传行 */
.upload-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.folder-upload-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.folder-or {
  font-size: 0.75rem;
  color: var(--muted);
}

.import-btn-secondary {
  background: var(--bg2);
  border-color: var(--rule);
  color: var(--ink);
}

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

/* 帮助弹窗 */
.help-modal.hidden {
  display: none;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.help-modal-content {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  color: var(--ink);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.help-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.help-modal-close:hover {
  color: var(--ink);
}

.help-modal-content h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.help-modal-content p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 8px;
}

.help-modal-content .privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(78, 205, 196, 0.15);
  border: 1px solid rgba(78, 205, 196, 0.3);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 12px;
}

/* 扩展功能开关 */
.feature-group {
  margin-top: 1rem;
}

.feature-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.feature-toggle-row .toggle-hint {
  font-size: 0.7rem;
  color: var(--muted);
}

/* 字幕显示（浮动） */
.subtitle-display {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
  z-index: 100;
  backdrop-filter: blur(8px);
  line-height: 1.5;
  display: none;
}

.subtitle-display.active {
  display: block;
}

/* 头像下方字幕区 */
.subtitle-below-avatar {
  width: 100%;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  color: #ddd;
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.4;
  display: none;
  border: 1px solid var(--rule);
}

.subtitle-below-avatar.active {
  display: block;
}

/* 功能按钮 */
.feature-btn {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--accent2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.feature-btn:hover {
  background: rgba(78, 205, 196, 0.15);
  border-color: var(--accent2);
}

/* 变声控制面板 */
.voice-changer-panel {
  padding: 0.75rem;
  background: var(--bg3);
  border-radius: 8px;
  margin: 0.5rem 0 0.75rem 0;
}

.voice-changer-panel.hidden {
  display: none;
}

.vc-control-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.vc-control-row:last-child {
  margin-bottom: 0;
}

.vc-control-row label {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.vc-control-row select {
  flex: 1;
  padding: 0.35rem 0.5rem;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.8rem;
  font-family: inherit;
}

.paragraph-controls {
  display: none;
}

.paragraph-controls.active {
  display: flex;
}

.paragraph-record-btn {
  flex: 1;
  padding: 0.6rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.paragraph-record-btn:hover {
  background: #ff8566;
}

.paragraph-record-btn.recording {
  background: #e74c3c;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 变声调试面板 */
.vc-debug-panel {
  padding: 0.5rem 0.75rem;
  background: var(--bg3);
  border-radius: 6px;
  margin: 0.5rem 0 0.75rem 0;
  font-size: 0.7rem;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  line-height: 1.5;
  color: var(--muted);
  max-height: 200px;
  overflow-y: auto;
}

.vc-debug-row {
  display: flex;
  justify-content: space-between;
  padding: 1px 0;
}

.vc-debug-label {
  color: var(--muted);
}

.vc-debug-value {
  font-weight: 500;
}

.vc-debug-value.ok {
  color: #4caf50;
}

.vc-debug-value.fail {
  color: #e74c3c;
}

.vc-debug-error .vc-debug-value {
  color: #e74c3c;
}

/* 移动端触控优化 */
@media (max-width: 768px) {
  .sensitivity-slider {
    /* 增大触控区域 */
    min-height: 36px;
    padding: 8px 0;
  }

  .sensitivity-slider::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }

  .sensitivity-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }

  /* 防止滑块与浏览器手势冲突 */
  .sensitivity-group {
    touch-action: pan-y;
  }

  /* 按钮增大触控区域 */
  .btn-primary,
  .btn-secondary,
  .btn-small {
    min-height: 44px;
    padding: 10px 16px;
  }

  /* 防止页面滚动时误触 */
  .toggle-switch {
    touch-action: manipulation;
  }
}

/* ==================== Live2D Cubism 诊断面板 ==================== */

.cubism-diag {
  margin-top: 16px;
  padding: 12px;
  background: var(--bg3);
  border-radius: 8px;
  border: 1px solid var(--rule);
}

.cubism-diag h3 {
  font-size: 0.85rem;
  color: var(--accent2);
  margin-bottom: 10px;
  font-weight: 600;
}

.cubism-diag-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cubism-diag-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 3px 0;
  border-bottom: 1px solid rgba(46, 46, 74, 0.5);
}

.cubism-diag-row:last-child {
  border-bottom: none;
}

.cubism-diag-label {
  font-size: 0.7rem;
  color: var(--muted);
  min-width: 80px;
  flex-shrink: 0;
}

.cubism-diag-value {
  font-size: 0.75rem;
  color: var(--ink);
  text-align: right;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  word-break: break-all;
}

.cubism-diag-error .cubism-diag-value {
  color: #e74c3c;
}

@media (max-width: 768px) {
  .cubism-diag {
    padding: 8px;
  }

  .cubism-diag-label {
    min-width: 60px;
    font-size: 0.65rem;
  }

  .cubism-diag-value {
    font-size: 0.7rem;
  }
}
