* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0; padding: 24px; background: #f5f5f7; color: #1d1d1f;
  max-width: 920px; margin-inline: auto;
}
h1 { margin-top: 0; }
.card {
  background: #fff; border-radius: 12px; padding: 20px;
  margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.info { display: flex; gap: 12px; margin: 6px 0; align-items: baseline; }
.label { font-weight: 600; min-width: 80px; color: #6e6e73; }
.value, .status { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.status { padding: 2px 8px; border-radius: 999px; background: #eef; }
.status.ok { background: #d6f3d6; color: #0a6b0a; }
.status.err { background: #f8d7d7; color: #a40000; }
.form-group { margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
label { font-size: 13px; color: #6e6e73; }
textarea, input[type=text], input:not([type]) {
  font-family: inherit; font-size: 14px; padding: 8px;
  border: 1px solid #d2d2d7; border-radius: 8px; width: 100%;
}
button {
  background: #0071e3; color: white; border: 0; padding: 8px 16px;
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
button:hover { background: #0077ed; }
button.danger { background: #c1272d; }
.output pre {
  background: #f0f0f2; padding: 10px; border-radius: 8px;
  font-size: 12px; white-space: pre-wrap; word-break: break-word; margin: 0;
}
.transcript { border: 1px solid #d2d2d7; border-radius: 8px; padding: 12px; height: 360px; overflow: auto; background: #fafafa; }
.bubble { padding: 8px 12px; margin: 6px 0; border-radius: 12px; max-width: 80%; }
.bubble.user { background: #0071e3; color: white; margin-left: auto; }
.bubble.assistant { background: #e8e8ed; color: #1d1d1f; }
.bubble .footer { font-size: 11px; color: #6e6e73; margin-top: 4px; }
.cite { display: inline-block; font-size: 11px; background: #fff; border: 1px solid #d2d2d7; border-radius: 999px; padding: 1px 8px; margin: 2px 4px 0 0; }
details > summary { cursor: pointer; margin-bottom: 8px; }
.bubble .text { white-space: pre-wrap; }

.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs button { background: #ddd; color: #333; }
.tabs button.active { background: #0071e3; color: #fff; }

/* Admin > Sessions */
.sess-filters { flex-direction: row; flex-wrap: wrap; align-items: end; gap: 12px; }
.sess-filters label { display: flex; flex-direction: column; gap: 2px; }
.sess-filters label.checkbox { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
.sess-filters input, .sess-filters select { min-width: 140px; }

.sess-list table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sess-list th, .sess-list td { padding: 6px 8px; text-align: left; border-bottom: 1px solid #e8e8ed; }
.sess-list th { background: #f5f5f7; font-weight: 600; color: #6e6e73; position: sticky; top: 0; }
.sess-list tr.row { cursor: pointer; }
.sess-list tr.row:hover { background: #eaf2ff; }
.sess-list tr.row.selected { background: #d4e6ff; }
.sess-list .empty { color: #6e6e73; padding: 12px; }
.sess-list .id-cell { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: #444; }

.sess-detail { margin-top: 18px; padding-top: 12px; border-top: 2px solid #e8e8ed; }
.sess-detail h3 { margin: 0 0 8px; font-size: 14px; }
.sess-detail .meta { font-size: 12px; color: #6e6e73; margin-bottom: 12px; }
.sess-detail .msg { padding: 8px 10px; border-radius: 8px; margin: 6px 0; background: #fafafa; border: 1px solid #e8e8ed; }
.sess-detail .msg.blocked { background: #fff4f4; border-color: #f3b6b6; }
.sess-detail .msg .head { display: flex; gap: 10px; align-items: center; font-size: 11px; color: #6e6e73; flex-wrap: wrap; }
.sess-detail .msg .role { font-weight: 600; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: #e8e8ed; color: #333; }
.sess-detail .msg .role.user { background: #0071e3; color: #fff; }
.sess-detail .msg .role.assistant { background: #34c759; color: #fff; }
.sess-detail .msg .content { white-space: pre-wrap; font-size: 13px; margin-top: 6px; }

/* Tiny copy chip */
.id-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: #444; background: #f5f5f7; padding: 1px 6px; border-radius: 4px; cursor: pointer; border: 1px solid transparent; }
.id-chip:hover { border-color: #0071e3; background: #fff; }
.id-chip.copied { background: #d6f3d6; color: #0a6b0a; }

/* Status / blocked badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.status-active { background: #d6f3d6; color: #0a6b0a; }
.badge.status-archived { background: #e8e8ed; color: #555; }
.badge.blocked { background: #f8d7d7; color: #a40000; }
.badge.blocked-zero { background: #f0f0f2; color: #8e8e93; }
.badge.reason { background: #ffe8a3; color: #6e4e00; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
