/* Open Chumpy — styles dialog desktop */
#openchumpy-dialog {
  width: 90vw; max-width: 90vw; max-height: 90vh; overflow: hidden;
  border-radius: 12px; border: 1px solid #2a3140; background: #0d1117; color: #d5dbe6;
  padding: 20px;
}
#openchumpy-dialog[open] {
  display: flex; flex-direction: column;
  position: relative;
}
.oc-layout {
  display: flex; gap: 0; flex: 1; min-height: 0; align-items: stretch;
}
.oc-left {
  flex: 0 0 420px; display: flex; flex-direction: column; gap: 4px; padding-right: 8px;
  overflow-y: auto; min-width: 280px; max-width: 80%;
}
.oc-resizer {
  flex: 0 0 6px; cursor: col-resize; background: #2a3140; border-radius: 3px;
  margin: 0 4px; transition: background 0.15s;
}
.oc-resizer:hover, .oc-resizer.active { background: #00F5FF; }
.oc-right {
  flex: 1; display: flex; flex-direction: column; min-width: 0; padding-left: 8px;
  min-height: 0;  /* permet au chat-log de scroller */
}
.oc-icon-btn {
  width: 32px; height: 32px; border-radius: 8px; flex: 0 0 auto;
  border: 1px solid #2a3140; background: #21262d; color: #d5dbe6;
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
#openchumpy-dialog .hist-dialog-head { gap: 8px; }
#openchumpy-dialog .hist-dialog-head h2 { flex: 1; margin: 0; display: flex; align-items: baseline; gap: 10px; }
.oc-title-st {
  font-size: 13px; font-weight: 500; color: #d29922; letter-spacing: 0;
}
.oc-title-st:empty { display: none; }
#oc-status.oc-st-wait { color: #d29922; }
#oc-settings {
  position: absolute; inset: 0; z-index: 6;
  background: #0d1117; overflow-y: auto; padding: 20px;
}
#oc-settings[hidden] { display: none; }
.oc-settings-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.oc-settings-head h3 { flex: 1; margin: 0; font-size: 16px; color: #d5dbe6; }
.oc-check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.oc-check input { width: auto; }
.oc-btn-danger {
  border: 1px solid #f85149; color: #f85149; background: transparent;
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font: inherit;
}
.oc-btn-link {
  border: 1px solid #2a6db5; color: #2a6db5; background: transparent;
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font: inherit; margin-left: 8px;
}
.msg .ts { font-size: 10px; color: #8b949e; margin-left: 6px; font-weight: 400; }
.oc-obs-eye {
  display: inline-block; margin-left: 6px; font-size: 13px;
  vertical-align: middle; line-height: 1; opacity: 0.9;
}
.oc-obs-eye.pending { opacity: 0.35; animation: oc-obs-pulse 1.1s ease-in-out infinite; }
.oc-obs-eye.ok { opacity: 1; }
.oc-obs-eye.error { filter: grayscale(1); opacity: 0.55; }
@keyframes oc-obs-pulse { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.95; } }
.msg details.think { margin-top: 6px; font-size: 12px; color: #8b949e; }
.msg details.think summary { cursor: pointer; color: #7ee787; }
#openchumpy-dialog h2 { margin: 0 0 12px; font-size: 18px; }
#openchumpy-dialog h3 { font-size: 13px; color: #8b949e; margin: 16px 0 8px; }
.oc-section { margin-bottom: 16px; }
#oc-stats { font-size: 13px; margin-bottom: 8px; }
#oc-heatmap { border: 1px solid #2a3140; margin-bottom: 8px; }
#oc-tree3d-canvas { border: 1px solid #2a3140; margin-bottom: 8px; background: #0a0e14; cursor: grab; }
#oc-tree3d-canvas:active { cursor: grabbing; }
#oc-inspector {
  width: min(92vw, 960px); max-height: 90vh; overflow: auto;
  border-radius: 12px; border: 1px solid #2a3140; background: #0d1117; color: #d5dbe6;
  padding: 16px;
}
#oc-inspector select, #oc-inspector option {
  background: #0d1117; color: #d5dbe6; border: 1px solid #2a3140;
}
#oc-inspector-canvas { background: #0a0e14; display: block; }
#oc-chat-log { font-size: 14px; line-height: 1.5; flex: 1; overflow-y: auto; min-height: 0; }
#oc-chat-log .msg { margin: 6px 0; padding: 10px 14px; border-radius: 8px; max-width: 90%; }
#oc-chat-log .msg.user { background: #1a3a5c; margin-left: auto; text-align: right; }
#oc-chat-log .msg.assistant { background: #21262d; }
#oc-chat-form textarea {
  resize: none; background: #0d1117; color: #d5dbe6;
  border: 1px solid #2a3140; border-radius: 8px; padding: 8px 12px; font: inherit;
  overflow-y: auto;
}
#oc-chat-form button {
  border: 1px solid #00F5FF; color: #00F5FF; background: transparent;
  border-radius: 8px; padding: 8px 16px; cursor: pointer; font: inherit;
}
.oc-section label { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; font-size: 13px; }
.oc-section select, .oc-section input {
  background: #0d1117; color: #d5dbe6; border: 1px solid #2a3140; border-radius: 6px; padding: 4px 8px; font: inherit;
}
#oc-cmp-btn {
  border: 1px solid #2a3140; background: #21262d; color: #d5dbe6;
  border-radius: 6px; padding: 4px 12px; cursor: pointer; font: inherit;
}
.oc-cmp-result { margin-top: 10px; }
.oc-cmp-empty { color: #8b949e; font-size: 13px; }
.oc-cmp-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 14px; font-weight: 600;
}
.oc-cmp-header .vs { color: #8b949e; font-weight: 400; }
.oc-cmp-score {
  display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px;
}
.oc-cmp-score .pct {
  font-size: 28px; font-weight: 700; line-height: 1;
}
.oc-cmp-score .label { font-size: 12px; color: #8b949e; }
.oc-cmp-bar {
  display: flex; align-items: center; gap: 8px; margin: 6px 0;
  font-size: 12px;
}
.oc-cmp-bar .name { flex: 0 0 90px; color: #8b949e; }
.oc-cmp-bar .track {
  flex: 1; height: 10px; background: #21262d; border-radius: 5px; overflow: hidden;
}
.oc-cmp-bar .fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; }
.oc-cmp-bar .val { flex: 0 0 50px; text-align: right; font-variant-numeric: tabular-nums; color: #d5dbe6; }
.oc-cmp-desc { font-size: 11px; color: #8b949e; margin-top: 8px; line-height: 1.5; }

.oc-influence .oc-block { margin: 10px 0 14px; }
.oc-influence .oc-block-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; font-weight: 600; color: #d5dbe6;
}
.oc-influence .oc-block-head span { color: #00F5FF; font-variant-numeric: tabular-nums; }
.oc-influence input[type="range"] { width: 100%; margin: 6px 0 4px; }
.oc-influence select {
  width: 100%; margin: 6px 0 4px;
  background: #0d1117; color: #d5dbe6; border: 1px solid #2a3140;
  border-radius: 6px; padding: 6px 8px; font: inherit;
}
.oc-help {
  margin: 0; font-size: 12px; line-height: 1.45; color: #8b949e;
}
.oc-influence input[type="range"] {
  background: #0d1117; accent-color: #00F5FF;
}

/* Dialog nouvelle session */
#oc-session-dialog {
  border-radius: 12px; border: 1px solid #2a3140; background: #0d1117; color: #d5dbe6;
  padding: 0; max-width: 460px;
}
#oc-session-dialog .hist-dialog-head {
  display: flex; align-items: center; gap: 8px; padding: 16px 16px 8px;
}
#oc-session-dialog .hist-dialog-head h3 { flex: 1; margin: 0; font-size: 16px; }
#oc-session-dialog .hist-dialog-head button {
  background: none; border: none; color: #8b949e; font-size: 20px; cursor: pointer;
}
#oc-session-dialog select {
  background: #0d1117; color: #d5dbe6; border: 1px solid #2a3140; border-radius: 6px; padding: 4px 8px; font: inherit;
}
#oc-session-dialog input[type="checkbox"] { width: auto; accent-color: #d29922; }

/* Dialog de comparaison */
#oc-cmp-dialog {
  border-radius: 12px; border: 1px solid #2a3140; background: #0d1117; color: #d5dbe6;
  padding: 0; max-width: 900px; width: 90vw; max-height: 90vh; overflow: hidden;
}
#oc-cmp-dialog[open] { display: flex; flex-direction: column; position: relative; }
#oc-cmp-dialog .hist-dialog-head {
  display: flex; align-items: center; gap: 8px; padding: 16px 16px 8px; flex-shrink: 0;
}
#oc-cmp-dialog .hist-dialog-head h2 { flex: 1; margin: 0; font-size: 18px; }
#oc-cmp-dialog .hist-dialog-head button {
  background: none; border: none; color: #8b949e; font-size: 20px; cursor: pointer;
}
#oc-cmp-content { padding: 0 16px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.oc-cmp-score-section {
  display: flex; gap: 20px; margin-bottom: 16px; flex-wrap: wrap;
}
.oc-cmp-score-section .score-block { flex: 1; min-width: 200px; }
.oc-cmp-toggles {
  display: flex; gap: 12px; align-items: center; margin-bottom: 8px; flex-wrap: wrap;
}
.oc-cmp-toggle {
  display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px;
  padding: 4px 10px; border-radius: 6px; border: 1px solid #2a3140; background: #21262d;
  opacity: 0.5; transition: opacity 0.2s, border-color 0.2s;
}
.oc-cmp-toggle.active { opacity: 1; }
.oc-cmp-toggle#oc-cmp-tog-a.active { border-color: #00F5FF; }
.oc-cmp-toggle#oc-cmp-tog-b.active { border-color: #db6d28; }
.oc-cmp-toggle .dot {
  width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto;
}
.oc-cmp-toggle input { display: none; }
.oc-cmp-canvas-wrap {
  position: relative; border: 1px solid #2a3140; border-radius: 8px; overflow: hidden;
  background: #0a0e14;
}
#oc-cmp-canvas { display: block; width: 100%; }
.oc-cmp-legend { font-size: 11px; color: #8b949e; margin-top: 8px; line-height: 1.5; }
