/* Review comments layer — dark/gold to match the deck chrome. */
:root {
  --cmt-gold: #D4A574;
  --cmt-panel: #15110D;
  --cmt-panel-2: #1E1810;
  --cmt-line: rgba(212, 165, 116, 0.32);
}

.cmt-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}
body:not(.cmt-on) .cmt-layer { display: none; }

.cmt-rail {
  position: absolute;
  top: 52px;
  right: min(6vw, 84px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.cmt-pin {
  pointer-events: auto;
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50% 50% 50% 3px;
  background: var(--cmt-gold);
  color: #16110B;
  border: 1px solid #16110B;
  font-family: var(--font-display, sans-serif);
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  transition: transform 0.12s ease, background 0.12s ease;
}
.cmt-pin:hover { transform: scale(1.14); }
.cmt-pin.is-active { background: #fff; transform: scale(1.14); }
.cmt-pin.is-dismissed {
  background: transparent;
  color: var(--gray-mid, #999);
  border: 1px dashed var(--gray-mid, #999);
  box-shadow: none;
}
.cmt-pin.is-lost { background: var(--error, #D4645C); color: #fff; }
.cmt-pin .cmt-pin-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: #16110B;
  color: var(--cmt-gold);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cmt-rail .cmt-pin { position: relative; margin: 0; }

.cmt-hl {
  position: absolute;
  pointer-events: none;
  background: rgba(212, 165, 116, 0.13);
  border-bottom: 2px solid rgba(212, 165, 116, 0.75);
  border-radius: 2px;
}
.cmt-hl.is-active { background: rgba(212, 165, 116, 0.3); }
.cmt-hl.is-dismissed { background: rgba(153, 153, 153, 0.1); border-bottom-color: rgba(153, 153, 153, 0.5); }

/* Toolbar */
.cmt-toolbar {
  position: fixed;
  bottom: 22px;
  left: 26px;
  z-index: 60;
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--font-display, sans-serif);
}
.cmt-btn {
  background: var(--black-soft, #1A1A1A);
  color: var(--gray, #D1D1D1);
  border: 1px solid rgba(212, 165, 116, 0.25);
  border-radius: 8px;
  height: 42px;
  padding: 0 13px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.cmt-btn:hover { background: #241C14; color: #fff; }
.cmt-btn.is-on { color: var(--cmt-gold); border-color: var(--cmt-gold); }
.cmt-btn.is-off { color: var(--gray-dark, #868686); }
.cmt-btn b {
  font-weight: 800;
  font-size: 11px;
  background: rgba(212, 165, 116, 0.16);
  color: var(--cmt-gold);
  border-radius: 9px;
  padding: 2px 6px;
}
.cmt-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--error, #D4645C);
  display: none;
}
.cmt-btn.is-dirty .cmt-dot { display: block; }
.cmt-btn.cmt-failed { color: var(--error, #D4645C); border-color: var(--error, #D4645C); }

.cmt-help {
  position: fixed;
  bottom: 74px;
  left: 26px;
  z-index: 60;
  width: 330px;
  background: var(--cmt-panel);
  border: 1px solid var(--cmt-line);
  border-radius: 12px;
  padding: 16px 18px;
  font-family: var(--font-display, sans-serif);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--gray, #D1D1D1);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
}
.cmt-help h5 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cmt-gold);
  margin-bottom: 9px;
}
.cmt-help kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: #262019;
  border: 1px solid #3A3026;
  border-radius: 4px;
  padding: 1px 5px;
  color: #fff;
}
.cmt-help .cmt-help-row { margin-bottom: 5px; }
.cmt-help .cmt-link {
  background: none;
  border: 0;
  padding: 0;
  margin-top: 10px;
  color: var(--gray-dark, #868686);
  font-family: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.cmt-help .cmt-link:hover { color: var(--error, #D4645C); }

/* Popover */
.cmt-popover {
  position: absolute;
  z-index: 70;
  width: 348px;
  max-width: calc(100vw - 24px);
  background: var(--cmt-panel);
  border: 1px solid var(--cmt-line);
  border-radius: 12px;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.68);
  font-family: var(--font-display, sans-serif);
  color: var(--white, #fff);
  overflow: hidden;
}
.cmt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-dark, #868686);
}
.cmt-head .cmt-num { color: var(--cmt-gold); }
.cmt-head .cmt-chip {
  border: 1px solid var(--gray-700, #404040);
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
}
.cmt-head .cmt-chip.is-dismissed { border-color: var(--gray-mid, #999); color: var(--gray-mid, #999); }
.cmt-head .cmt-x {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--gray-dark, #868686);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.cmt-head .cmt-x:hover { color: #fff; }

.cmt-body { max-height: 52vh; overflow-y: auto; padding: 4px 0; }
.cmt-msg { padding: 11px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.cmt-msg:last-child { border-bottom: 0; }
.cmt-msg.is-reply { padding-left: 26px; border-left: 2px solid rgba(212, 165, 116, 0.28); margin-left: 12px; }
.cmt-meta { font-size: 10.5px; letter-spacing: 0.05em; color: var(--gray-dark, #868686); margin-bottom: 5px; }
.cmt-meta .cmt-author { color: var(--cmt-gold); font-weight: 700; }
.cmt-text { font-size: 13.5px; line-height: 1.55; color: var(--gray-100, #F5F5F5); white-space: pre-wrap; word-wrap: break-word; }
.cmt-quote {
  font-family: var(--font-body, Georgia, serif);
  font-style: italic;
  font-size: 12px;
  line-height: 1.45;
  color: var(--gray-mid, #999);
  border-left: 2px solid rgba(212, 165, 116, 0.4);
  padding-left: 9px;
  margin: 0 14px 8px;
}
.cmt-popover.is-dismissed .cmt-text { color: var(--gray-mid, #999); }

.cmt-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 13px; border-top: 1px solid rgba(255, 255, 255, 0.07); background: var(--cmt-panel-2); }
.cmt-act {
  background: none;
  border: 1px solid var(--gray-700, #404040);
  border-radius: 6px;
  color: var(--gray, #D1D1D1);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
}
.cmt-act:hover { border-color: var(--cmt-gold); color: var(--cmt-gold); }
.cmt-act.is-primary { background: var(--cmt-gold); border-color: var(--cmt-gold); color: #16110B; }
.cmt-act.is-primary:hover { background: #E4BC90; color: #16110B; }
.cmt-act.is-danger { color: var(--error, #D4645C); border-color: rgba(212, 100, 92, 0.5); }
.cmt-act.is-danger:hover { background: var(--error, #D4645C); color: #fff; border-color: var(--error, #D4645C); }

.cmt-form { padding: 12px 13px; border-top: 1px solid rgba(255, 255, 255, 0.07); background: var(--cmt-panel-2); }
.cmt-form textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  background: #0F0C08;
  border: 1px solid var(--gray-700, #404040);
  border-radius: 7px;
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 9px 10px;
}
.cmt-form textarea:focus { outline: none; border-color: var(--cmt-gold); }
.cmt-form-row { display: flex; gap: 6px; align-items: center; margin-top: 9px; }
.cmt-form input.cmt-author-input {
  flex: 0 0 118px;
  background: #0F0C08;
  border: 1px solid var(--gray-700, #404040);
  border-radius: 6px;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  padding: 7px 8px;
}
.cmt-form input.cmt-author-input:focus { outline: none; border-color: var(--cmt-gold); }
.cmt-form-row .cmt-spacer { flex: 1; }
.cmt-hint { font-size: 10.5px; color: var(--gray-dark, #868686); margin-top: 8px; letter-spacing: 0.03em; }

.cmt-empty { padding: 16px 14px; font-size: 12.5px; color: var(--gray-dark, #868686); }

@media (max-width: 900px) {
  .cmt-toolbar { left: 12px; bottom: 12px; gap: 6px; }
  .cmt-btn { height: 38px; padding: 0 10px; font-size: 11.5px; }
  .cmt-help { left: 12px; bottom: 60px; width: calc(100vw - 24px); }
}
