/* css/comments-panel.css
 *
 * Wave 16.F Phase 1 — comments-panel layout. PROTOTYPE.
 *
 * Lives inside the builder's left rail alongside the AI assistant.
 * Tab-style toggle switches which view is visible; only one panel
 * occupies the rail at a time so we don't fight for vertical space.
 *
 * Keep this stylesheet self-contained (no overrides into builder.css)
 * so the rail panel can be lifted into /use.html later with one CSS
 * include and no cascade surprises.
 */

.rail-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
  border-bottom: 1px solid #e6e6ea;
  background: #fafafa;
}
.rail-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  color: #6c6f76;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  position: relative;
  top: 1px;
}
.rail-tab:hover { color: #2b2e34; }
.rail-tab[aria-selected="true"] {
  background: #fff;
  color: #2b2e34;
  border: 1px solid #e6e6ea;
  border-bottom-color: #fff;
}
.rail-tab:focus-visible {
  outline: 2px solid #f4a833;
  outline-offset: 2px;
}

/* Tab panels share the same container; visibility toggled via hidden attr. */
.rail-panel[hidden] { display: none !important; }

.comments-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
}

.comments-panel-header {
  padding: 12px 14px 8px;
  border-bottom: 1px solid #f1f1f4;
}
.comments-panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #2b2e34;
}
.comments-panel-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: #8d9098;
}

.comments-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 12px;
  margin: 0;
  list-style: none;
  /* Min height so the empty state has room to breathe even on small
     viewports; max so the composer is always reachable. */
  min-height: 160px;
  max-height: calc(100vh - 320px);
}

.comments-empty {
  text-align: center;
  padding: 28px 12px;
  color: #8d9098;
  font-size: 13px;
}
.comments-empty-emoji {
  font-size: 36px;
  margin-bottom: 8px;
  display: block;
  aria-hidden: true;
}

.comments-item {
  padding: 10px 0;
  border-bottom: 1px solid #f3f3f6;
}
.comments-item:last-child { border-bottom: 0; }

.comments-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.comments-item-author {
  font-weight: 600;
  font-size: 13px;
  color: #2b2e34;
  /* Long usernames don't blow out the row. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.comments-item-author--anon {
  color: #6c6f76;
  font-style: italic;
}
.comments-item-time {
  flex: 0 0 auto;
  font-size: 11px;
  color: #8d9098;
  font-variant-numeric: tabular-nums;
}
.comments-item-body {
  font-size: 13px;
  color: #2b2e34;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.comments-composer {
  border-top: 1px solid #e6e6ea;
  padding: 10px 12px 12px;
  background: #fafafa;
}
.comments-composer-textarea {
  width: 100%;
  min-height: 64px;
  max-height: 200px;
  border: 1px solid #d8d8de;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  resize: vertical;
  background: #fff;
  color: #2b2e34;
}
.comments-composer-textarea:focus {
  outline: 2px solid #f4a833;
  outline-offset: 1px;
  border-color: #f4a833;
}
.comments-composer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 8px;
}
.comments-composer-counter {
  font-size: 11px;
  color: #8d9098;
  font-variant-numeric: tabular-nums;
}
.comments-composer-counter--warn { color: #c97a1a; }
.comments-composer-counter--err  { color: #c84c3a; }
.comments-composer-submit {
  appearance: none;
  border: 0;
  background: #f4a833;
  color: #2b2e34;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.comments-composer-submit[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.comments-composer-submit:focus-visible {
  outline: 2px solid #2b2e34;
  outline-offset: 2px;
}
.comments-composer-msg {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6c6f76;
  min-height: 16px;
}
.comments-composer-msg--err { color: #c84c3a; }
