/* ==========================================================================
   DRS Wiki — comment overlay styling
   Matches Direction C: teal accents, 8px radii, Inter UI, amber for open items
   ========================================================================== */

.drs-comment-ui { font-family: "Inter", -apple-system, system-ui, sans-serif; }

/* ---------- floating button ---------------------------------------------- */
.drs-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: flex; align-items: center; gap: .45rem;
  padding: .5rem .85rem;
  border: 1px solid #d8dbd8; border-radius: 999px;
  background: #fff; color: #33403b;
  font-size: .68rem; font-weight: 600; letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.10);
  transition: background .15s, color .15s, border-color .15s;
}
.drs-fab:hover { border-color: #0d9488; color: #0d9488; }
.drs-fab__icon { font-size: .85rem; line-height: 1; }
.drs-fab__count {
  display: none; align-items: center; justify-content: center;
  min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem;
  border-radius: 999px; background: #d97706; color: #fff;
  font-size: .58rem; font-weight: 800;
}
body.drs-commenting .drs-fab { background: #0d9488; color: #fff; border-color: #0d9488; }
body.drs-commenting .drs-fab:hover { color: #fff; }

/* ---------- hover affordance --------------------------------------------- */
body.drs-commenting .md-content__inner :is(p, li, h1, h2, h3, h4, blockquote, td, th, pre) {
  cursor: text; border-radius: 4px;
  box-shadow: 0 0 0 0 rgba(13,148,136,0);
  transition: background .12s, box-shadow .12s;
}
body.drs-commenting .md-content__inner :is(p, li, h2, h3, h4, blockquote, pre):hover {
  background: #f2faf8;
  box-shadow: 0 0 0 4px #f2faf8;
}

/* blocks that already carry an open comment */
.md-content__inner .drs-has-comment {
  background: #fffbeb;
  box-shadow: 0 0 0 4px #fffbeb, inset 2px 0 0 #d97706;
  border-radius: 4px;
}
.md-content__inner .drs-flash {
  animation: drs-flash 1.6s ease-out;
}
@keyframes drs-flash {
  0%, 40% { background: #fde9a8; box-shadow: 0 0 0 6px #fde9a8; }
  100%    { background: transparent; box-shadow: none; }
}

/* ---------- composer ------------------------------------------------------ */
.drs-composer {
  position: absolute; z-index: 60; width: 380px; max-width: calc(100vw - 24px);
  background: #fff; border: 1px solid #e2e0da; border-radius: 10px;
  padding: .7rem .75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.08), 0 16px 40px rgba(0,0,0,.16);
}
.drs-composer__quote {
  font-size: .62rem; line-height: 1.5; color: #7d8783;
  border-left: 2px solid #0d9488; padding-left: .5rem; margin-bottom: .55rem;
}
.drs-composer__input {
  width: 100%; box-sizing: border-box; resize: vertical;
  border: 1px solid #e2e0da; border-radius: 8px; padding: .45rem .55rem;
  font: inherit; font-size: .72rem; line-height: 1.55; color: #22302b;
  background: #fbfbf9;
}
.drs-composer__input:focus { outline: none; border-color: #0d9488; background: #fff; }
.drs-composer__row { display: flex; justify-content: flex-end; gap: .4rem; margin-top: .5rem; }

.drs-btn {
  border: 1px solid #0d9488; background: #0d9488; color: #fff;
  border-radius: 8px; padding: .32rem .7rem;
  font-size: .64rem; font-weight: 650; cursor: pointer;
}
.drs-btn:hover { background: #0b7268; border-color: #0b7268; }
.drs-btn--ghost { background: #fff; color: #6b7671; border-color: #e2e0da; }
.drs-btn--ghost:hover { background: #f6f6f3; color: #33403b; }

/* ---------- side panel ---------------------------------------------------- */
.drs-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 340px; z-index: 50;
  background: #fff; border-left: 1px solid #e8e6e1;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .18s ease-out;
  box-shadow: -8px 0 32px rgba(0,0,0,.10);
}
body.drs-commenting .drs-panel { transform: translateX(0); }
body.drs-commenting .md-main { padding-right: 340px; }

.drs-panel__head {
  display: flex; align-items: center; gap: .5rem;
  padding: .7rem .85rem .5rem; border-bottom: 1px solid #e8e6e1;
}
.drs-panel__title {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: .95rem; color: #14312b; flex: 1;
}
.drs-panel__status { font-size: .53rem; letter-spacing: .02em; }
.drs-panel__status.is-on  { color: #0d9488; }
.drs-panel__status.is-off { color: #b45309; }
.drs-panel__x {
  border: none; background: none; font-size: 1.1rem; line-height: 1;
  color: #98a29e; cursor: pointer; padding: 0 .1rem;
}
.drs-panel__x:hover { color: #33403b; }

.drs-panel__scope {
  padding: .5rem .85rem; font-size: .6rem; color: #7d8783;
  border-bottom: 1px solid #f0eee9;
}
.drs-panel__list { flex: 1; overflow-y: auto; padding: .6rem .7rem; }
.drs-panel__foot {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .85rem; border-top: 1px solid #e8e6e1;
}
.drs-panel__hint { font-size: .55rem; color: #a0a8a4; }

.drs-empty { font-size: .62rem; line-height: 1.6; color: #a0a8a4; padding: .8rem .3rem; }

.drs-card {
  border: 1px solid #e8e6e1; border-radius: 8px; padding: .5rem .6rem;
  margin-bottom: .5rem; background: #fffdf7;
}
.drs-card.is-resolved { background: #f7f9f8; opacity: .62; }
.drs-card__quote {
  font-size: .57rem; line-height: 1.45; color: #8a938f;
  border-left: 2px solid #d97706; padding-left: .4rem; margin-bottom: .35rem;
}
.drs-card.is-resolved .drs-card__quote { border-left-color: #0d9488; }
.drs-card__body { font-size: .66rem; line-height: 1.55; color: #22302b; white-space: pre-wrap; }
.drs-card__meta {
  display: flex; align-items: center; gap: .45rem;
  margin-top: .4rem; font-size: .53rem; color: #a0a8a4;
}
.drs-card__act {
  margin-left: auto; border: 1px solid #e2e0da; background: #fff;
  border-radius: 6px; padding: .12rem .38rem;
  font-size: .53rem; color: #6b7671; cursor: pointer;
}
.drs-card__act:hover { border-color: #0d9488; color: #0d9488; }
.drs-card__meta .drs-card__act + .drs-card__act { margin-left: 0; }

/* ---------- dark mode ----------------------------------------------------- */
[data-md-color-scheme="slate"] .drs-fab { background: #16302b; color: #c2cfcb; border-color: #233833; }
[data-md-color-scheme="slate"] .drs-panel { background: #10201d; border-left-color: #233833; }
[data-md-color-scheme="slate"] .drs-panel__title { color: #e8f0ed; }
[data-md-color-scheme="slate"] .drs-card { background: #162622; border-color: #233833; }
[data-md-color-scheme="slate"] .drs-card__body { color: #c2cfcb; }
[data-md-color-scheme="slate"] .drs-composer { background: #162622; border-color: #233833; }
[data-md-color-scheme="slate"] .drs-composer__input { background: #10201d; border-color: #233833; color: #e8f0ed; }

@media print { .drs-comment-ui { display: none !important; } }
