/* Review page layout: artifact iframe (left) + comment rail (right). */

:root {
  --rail-w: 360px;
  --border: #e3e3e6;
  --muted: #6b7280;
  --accent: #2563eb;
  --danger: #dc2626;
  --hl: #fde68a;
  --hl-flash: #fbbf24;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1f2937;
  background: #f3f4f6;
}

#review {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#artifact-pane {
  flex: 1 1 auto;
  min-width: 0;
  background: #fff;
  border-right: 1px solid var(--border);
}

#artifact {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

#rail {
  flex: 0 0 var(--rail-w);
  width: var(--rail-w);
  height: 100%;
  overflow-y: auto;
  background: #fafafa;
  padding: 16px;
}

.rail-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.rail-title { font-size: 16px; font-weight: 600; }
.rail-identity { font-size: 12px; color: var(--muted); }
.rail-note {
  font-size: 12px;
  color: var(--muted);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 12px;
}
.rail-empty { color: var(--muted); font-size: 13px; padding: 20px 4px; }

/* Comment cards */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.card.resolved { opacity: 0.6; }
.card.resolved .card-body { text-decoration: line-through; }
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: var(--accent); }

.card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.card-author { font-weight: 600; font-size: 13px; }
.card-time { font-size: 11px; color: var(--muted); }
.card-pin { cursor: pointer; color: var(--accent); font-size: 13px; }
.card-orphan {
  font-size: 10px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px; padding: 0 4px;
}
.card-body { font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.card-edited { font-size: 10px; color: var(--muted); margin-top: 2px; }

.card-actions { display: flex; gap: 12px; margin-top: 8px; }
.replies { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--border); }
.reply { margin-top: 8px; }

.card-flash, .bhume-card-flash { animation: cardflash 1.2s ease; }
@keyframes cardflash { 0% { background: #fef9c3; } 100% { background: #fff; } }

/* Buttons */
.btn {
  font: inherit;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}
.btn.ghost { background: #fff; color: var(--muted); border-color: var(--border); }
.btn:disabled { opacity: 0.6; cursor: default; }
.link {
  font: inherit; font-size: 12px;
  background: none; border: 0; color: var(--accent);
  cursor: pointer; padding: 0;
}
.link.danger { color: var(--danger); }

/* Composer */
.composer {
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.composer-quote {
  font-size: 12px; color: var(--muted); font-style: italic;
  border-left: 3px solid var(--hl); padding-left: 8px;
}
.composer input, .composer textarea {
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  width: 100%;
}
.composer-body { min-height: 64px; resize: vertical; }
.composer-err { color: var(--danger); font-size: 12px; min-height: 1em; }
.composer-actions { display: flex; gap: 8px; }
.rail-foot { margin-top: 8px; }

/* Selection FAB (lives in the wrapper, positioned over the iframe) */
.sel-fab {
  position: absolute;
  z-index: 9999;
  font: inherit; font-size: 12px;
  background: #111827; color: #fff;
  border: 0; border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Highlights inside the artifact iframe are styled by the iframe's own CSS,
   which it can't set (inert). We inject a highlight class; browsers render
   <mark> yellow by default, and we nudge it here for the wrapper's own marks.
   The iframe marks inherit UA <mark> styling. */
mark.bhume-hl { background: var(--hl); }
mark.bhume-hl-flash { background: var(--hl-flash); }
