/* JOR unified comments — shared docked panel.
   One stream, sliced by tag (target). Panel docks right and PUSHES the page
   (body shrinks) so nothing is obscured. See COMMENT_SYSTEM_SPEC.md. */

:root { --jorc-w: 380px; --jorc-accent: #4a7c6f; --jorc-ink: #1a1a1a; }

/* Push + (only if needed) scale the page when open so nothing is ever
   obscured. comments.js sets body width/transform per surface: surfaces that
   reflow into the narrower space just push; wide fixed-layout surfaces (e.g.
   the Database) scale down slightly to fit. The panel + launcher live on
   <html>, not <body>, so the body transform never scales them. */
html.jorc-open body { transform-origin: top left; }

/* ---- launcher pill (bottom-right) ---- */
.jorc-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 9000;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--jorc-ink); color: #fff; border: none; cursor: pointer;
  font-family: "Georgia", serif; font-size: 13px; font-weight: bold;
  letter-spacing: 0.02em; padding: 11px 18px; border-radius: 24px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.22); transition: transform .12s, background .12s, opacity .2s;
}
.jorc-launch:hover { background: #000; transform: translateY(-1px); }
.jorc-launch svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 2; }
.jorc-launch .jorc-badge {
  background: var(--jorc-accent); color: #fff; border-radius: 999px;
  font-size: 11px; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: bold;
}
.jorc-launch .jorc-badge:empty, .jorc-launch .jorc-badge[data-n="0"] { display: none; }
html.jorc-open .jorc-launch { opacity: 0; pointer-events: none; }

/* ---- panel ---- */
.jorc-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--jorc-w); z-index: 9001;
  background: #fff; border-left: 1px solid #ddd; box-shadow: -4px 0 18px rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1);
  font-family: "Georgia", serif;
}
html.jorc-open .jorc-panel { transform: translateX(0); }

.jorc-head { padding: 16px 18px 12px; border-bottom: 1px solid #eee; flex-shrink: 0; }
.jorc-head-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.jorc-title { font-size: 15px; font-weight: bold; color: var(--jorc-ink); letter-spacing: 0.02em; }
.jorc-title .jorc-sub { display: block; font-size: 10px; font-weight: normal; color: #999;
  letter-spacing: 0.1em; text-transform: uppercase; margin-top: 2px; }
.jorc-close { background: none; border: none; cursor: pointer; color: #888; font-size: 22px;
  line-height: 1; padding: 2px 6px; border-radius: 6px; }
.jorc-close:hover { color: #1a1a1a; background: #f2f2f2; }
.jorc-channel { margin-top: 12px; width: 100%; font-family: "Georgia", serif; font-size: 12px;
  color: #333; padding: 7px 9px; border: 1px solid #ddd; border-radius: 7px; background: #fafafa; }

/* ---- stream ---- */
.jorc-stream { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.jorc-empty { color: #aaa; font-style: italic; font-size: 13px; text-align: center; padding: 30px 10px; }
.jorc-state { color: #999; font-size: 12px; text-align: center; padding: 18px; }

.jorc-cmt { display: flex; flex-direction: column; gap: 5px; }
.jorc-cmt-head { display: flex; align-items: baseline; gap: 8px; }
.jorc-av { width: 26px; height: 26px; border-radius: 50%; background: #ece7f1; color: var(--jorc-accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; flex-shrink: 0; }
.jorc-who { font-size: 12.5px; font-weight: bold; color: #1a1a1a; }
.jorc-when { font-size: 10.5px; color: #aaa; margin-left: auto; white-space: nowrap; }
.jorc-body { font-size: 13.5px; line-height: 1.5; color: #2b2b2b; white-space: pre-wrap; word-wrap: break-word; padding-left: 34px; }
.jorc-cmt-actions { padding-left: 34px; display: flex; gap: 14px; }
.jorc-cmt-actions button { background: none; border: none; cursor: pointer; color: #999;
  font-family: "Georgia", serif; font-size: 11px; padding: 0; }
.jorc-cmt-actions button:hover { color: var(--jorc-accent); text-decoration: underline; }
.jorc-cmt-actions .jorc-del:hover { color: #b3261e; }
.jorc-att { padding-left: 34px; display: flex; flex-wrap: wrap; gap: 6px; }
.jorc-att a { display: block; }
.jorc-att img { max-width: 100px; max-height: 80px; border-radius: 6px; border: 1px solid #eee; display: block; }

/* replies indented under parent */
.jorc-replies { margin: 6px 0 0 22px; padding-left: 12px; border-left: 2px solid #f0eef3;
  display: flex; flex-direction: column; gap: 12px; }
.jorc-replies .jorc-body, .jorc-replies .jorc-cmt-actions, .jorc-replies .jorc-att { padding-left: 30px; }
.jorc-replies .jorc-av { width: 22px; height: 22px; font-size: 10.5px; }

/* inline reply box */
.jorc-replybox { padding-left: 34px; margin-top: 4px; display: none; }
.jorc-replybox.open { display: block; }
.jorc-replybox textarea { width: 100%; min-height: 48px; }

/* ---- composer ---- */
.jorc-compose { border-top: 1px solid #eee; padding: 12px 16px 14px; flex-shrink: 0; background: #fcfcfc; }
.jorc-compose textarea, .jorc-replybox textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 60px;
  font-family: "Georgia", serif; font-size: 13px; line-height: 1.45; color: #1a1a1a;
  padding: 9px 11px; border: 1px solid #ddd; border-radius: 8px; background: #fff; }
.jorc-compose textarea:focus, .jorc-replybox textarea:focus { outline: none; border-color: var(--jorc-accent); }
.jorc-compose-row { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.jorc-compose-row .jorc-hint { margin-right: auto; font-size: 10.5px; color: #bbb; }
.jorc-btn { background: var(--jorc-ink); color: #fff; border: 1px solid var(--jorc-ink); cursor: pointer;
  font-family: "Georgia", serif; font-size: 12px; font-weight: bold; padding: 7px 16px; border-radius: 7px; }
.jorc-btn:hover { background: #000; }
.jorc-btn:disabled { opacity: 0.45; cursor: default; }
.jorc-btn.ghost { background: #fff; color: #555; border-color: #ccc; }
.jorc-btn.ghost:hover { background: #f4f4f4; color: #1a1a1a; }
.jorc-signin-note { font-size: 12.5px; color: #777; text-align: center; }
.jorc-signin-note button { background: none; border: none; color: var(--jorc-accent); cursor: pointer;
  font-family: "Georgia", serif; font-size: 12.5px; font-weight: bold; text-decoration: underline; padding: 0; }

@media (max-width: 760px) {
  :root { --jorc-w: 320px; }
}
