:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --sidebar-w: 272px;
  --header-h: 56px;

  --high: #dc2626;
  --high-bg: #fef2f2;
  --high-border: #fca5a5;
  --medium: #ea580c;
  --medium-bg: #fff7ed;
  --medium-border: #fdba74;
  --low: #ca8a04;
  --low-bg: #fefce8;
  --low-border: #fde047;
  --none: #94a3b8;
  --none-bg: #f8fafc;
  --none-border: #e2e8f0;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Header ── */
.app-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-brand { display: flex; align-items: baseline; gap: 8px; }

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
}

.brand-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 7px;
  border-radius: 99px;
}

/* ── Layout ── */
.app-layout {
  display: flex;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Sidebar search ── */
.sidebar-search {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.search-type-selector {
  margin-bottom: 8px;
}

.search-type-select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.12s;
}

.search-type-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.08);
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.12s, box-shadow 0.12s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.08);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  color: var(--text-muted);
  padding: 0 2px;
}

.search-clear-btn:hover { color: var(--text); }

.search-input:not(:placeholder-shown) { padding-right: 28px; }

.status-filter-row {
  margin-top: 8px;
}

.status-filter-select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.12s;
}

.status-filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.08);
}

.casetype-filter-row {
  margin-top: 8px;
}

.casetype-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.casetype-filter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #888);
}

.casetype-exclude-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
}

.casetype-filter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 120px;
  overflow-y: auto;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.casetype-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 8px;
  right: 8px;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
}

.search-suggestions.hidden {
  display: none;
}

.search-suggestion-item {
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  font-family: 'SF Mono', 'Fira Code', monospace;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

.search-suggestion-item:hover {
  background: var(--bg);
}

.suggestion-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
}

.suggestion-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.sidebar-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.history-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
  border: 1px solid transparent;
  margin-bottom: 3px;
}

.history-item:hover { background: var(--bg); }

.history-item.active {
  background: var(--primary-light);
  border-color: #c7d2fe;
}

.hi-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.hi-id {
  font-size: 11px;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hi-status {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
  background: #e2e8f0;
  color: #475569;
}
.hi-status-processed     { background: #dcfce7; color: #166534; }
.hi-status-waiting       { background: #fef9c3; color: #854d0e; }
.hi-status-waiting_bulk  { background: #fef9c3; color: #854d0e; }
.hi-status-processing    { background: #dbeafe; color: #1e40af; }
.hi-status-no_content    { background: #f1f5f9; color: #64748b; }
.hi-status-errored       { background: #fee2e2; color: #991b1b; }
.hi-status-incomplete    { background: #f3e8ff; color: #6b21a8; }
.hi-status-deleted       { background: #f1f5f9; color: #94a3b8; }
.hi-status-overwritten   { background: #f1f5f9; color: #94a3b8; }

.hi-name {
  font-size: 13px;
  color: var(--text);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hi-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

/* ── Pagination controls ── */
.history-controls {
  padding: 12px 8px 8px;
  border-top: 1px solid var(--border);
}

.hc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hc-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.hc-btn:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text);
}

.hc-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hc-info {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  flex: 0.5;
}

/* ── Main content ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Inference-disabled banner ── */
.inference-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--medium-bg);
  border: 1px solid var(--medium-border);
  color: var(--medium);
  font-size: 13px;
  line-height: 1.45;
}

.inference-banner svg { flex: 0 0 auto; margin-top: 1px; }
.inference-banner strong { display: block; color: var(--text); font-weight: 700; }
.inference-banner span { color: var(--text-muted); }

/* Agent could not read the page: the result rests on the client's context alone. */
.extraction-failed-banner {
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--medium-bg);
  border: 1px solid var(--medium-border);
  font-size: 13px;
}
.extraction-failed-banner strong { display: block; color: var(--text); font-weight: 700; }
.extraction-failed-banner span { color: var(--text-muted); }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

/* ── Form ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.label-hint {
  font-weight: 400;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: #b0bec5; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ── Image input ── */
.image-input-area {
  position: relative;
}

.image-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.image-drop-label {
  display: block;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.image-input-area:hover .image-drop-label,
.image-input-area:focus-within .image-drop-label {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.image-drop-label.hidden { display: none; }

.image-preview-wrap {
  position: relative;
  display: inline-block;
}

.image-preview-wrap.hidden { display: none; }

.image-input-preview {
  display: block;
  max-width: 100%;
  max-height: 200px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.image-clear-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.image-clear-btn:hover { background: rgba(0,0,0,0.75); }

/* ── Buttons ── */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.12s, opacity 0.12s;
}

.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 7px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: background 0.12s;
}
.btn-icon:hover { background: var(--bg); }

/* ── Result ── */
.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: nowrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.result-id {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.3px;
}

/* Left column shrinks so long URLs wrap instead of overflowing the card. */
.result-header-main { flex: 1 1 auto; min-width: 0; }

.result-meta { display: flex; flex-direction: column; gap: 3px; text-align: left; min-width: 0; }

.meta-row {
  font-size: 12.5px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta-row strong { color: var(--text); font-weight: 600; }

.meta-row a { color: var(--primary); text-decoration: none; }
.meta-row a:hover { text-decoration: underline; }

.meta-row-image { flex-direction: column; align-items: flex-start; gap: 6px; }
.evidence-thumb {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-top: 4px;
  cursor: zoom-in;
}

.img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
}
.img-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 4px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.7);
}

.relevant-content-block { margin-top: 16px; margin-bottom: 16px; }
.relevant-content-block > summary { margin-bottom: 8px; }
.relevant-content-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--bg-card, #f8f8f8);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px;
  margin: 0;
}

/* ── Page description ── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-label-row .section-label { margin-bottom: 0; }
/* Keeps the title and anything qualifying it (primary issue, feedback button)
   together on the left, so space-between only pushes the toggle to the right. */
.section-label-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.v-toggle-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
}
.v-toggle-btn:hover { border-color: var(--primary); color: var(--primary); }

.page-desc {
  background: var(--bg);
  border-left: 3px solid var(--primary);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 24px;
}

/* ── Violations ── */
.violations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 9px;
}

.v-card {
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid;
  transition: transform 0.1s;
}

.v-card:hover { transform: translateY(-1px); }

.v-card.sev-high   { background: var(--high-bg);   border-color: var(--high-border); }
.v-card.sev-medium { background: var(--medium-bg); border-color: var(--medium-border); }
.v-card.sev-low    { background: var(--low-bg);    border-color: var(--low-border); }
.v-card.sev-none   { background: var(--none-bg);   border-color: var(--none-border); }

.v-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: capitalize;
  line-height: 1.3;
  margin-bottom: 5px;
}

.v-sev {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.sev-high   .v-sev { color: var(--high); }
.sev-medium .v-sev { color: var(--medium); }
.sev-low    .v-sev { color: var(--low); }
.sev-none   .v-sev { color: var(--none); }

/* ── Badges (sidebar) ── */
.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-high   { background: var(--high-bg);   color: var(--high); }
.badge-medium { background: var(--medium-bg); color: var(--medium); }
.badge-low    { background: var(--low-bg);    color: var(--low); }

/* ── Pending state ── */
.pending-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 0 8px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.pending-text    { font-size: 13px; color: var(--text-muted); }
.pending-id      { font-size: 11px; font-family: monospace; color: var(--primary); margin-top: 2px; }
.pending-elapsed { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-family: monospace; }
.pending-detail  { font-size: 12px; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }

/* ── Error ── */
.error-box {
  padding: 14px 16px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 13px;
}

/* ── Empty / misc ── */
.empty-msg {
  text-align: center;
  padding: 32px 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.hidden { display: none !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Actionable badge ── */
.actionable-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 99px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  align-self: flex-start;
}
.actionable-yes { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.actionable-no  { background: var(--none-bg); color: var(--text-muted); border: 1px solid var(--none-border); }

/* ── Analysis section header row ── */
.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.analysis-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.analysis-model {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
}

/* ── Case assessment summary bar ── */
.ca-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.ca-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.ca-chip-primary {
  background: var(--primary-light);
  border-color: #c7d2fe;
  color: var(--primary);
}

/* Inferred region == OTHER: agent inferred a region outside our legal coverage.
   Muted/dashed so it reads as "no covered jurisdiction", not a normal region. */
.ca-chip-other {
  border-style: dashed;
  font-style: italic;
}

/* What kind of legal subject the client is — drives the eligibility gate. */
.ca-chip-subject {
  background: var(--bg);
  border-color: var(--border);
}

.ca-chip-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
  margin-right: 5px;
}

/* ── Primary rationale ── */
.ca-rationale {
  margin: 0 0 4px;
  padding: 12px 16px;
  background: var(--bg);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
}

.ca-subject-rationale {
  margin-bottom: 14px;
  font-size: 12.5px;
}

/* Which rights the subject-type classification removed — stated with its cause. */
.ca-gated-summary {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

/* ── Rich violation grid ── */
.violations-grid-rich {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.v-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.v-card-actionable {
  box-shadow: 0 0 0 2px currentColor;
}
.sev-high.v-card-actionable   { box-shadow: 0 0 0 2px var(--high); }
.sev-medium.v-card-actionable { box-shadow: 0 0 0 2px var(--medium); }

.v-act-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-left: 4px;
  vertical-align: middle;
}

.v-rationale {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* Per-right "+ Feedback" footer inside a violation card (agent v0.9+). */
.v-card-fb {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}
.v-card-fb .fb-jump-btn {
  padding: 2px 8px;
  font-size: 11px;
}

/* Eligibility gate: right forced to NONE because of the client's subject_type.
   Dashed to read as "removed", not "scored NONE". The note is always visible —
   unlike .v-rationale, the Show/Hide toggle must not be able to conceal it. */
.v-card-gated {
  border-style: dashed;
  opacity: 0.85;
}
.v-gate-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}
.v-gate-pill {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  margin-right: 6px;
  border-radius: 99px;
  background: var(--none-bg);
  border: 1px solid var(--none-border);
  color: var(--text-muted);
  vertical-align: 1px;
}

/* ── Legal bases ── */
.lb-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lb-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.lb-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.lb-violation {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: capitalize;
}

.lb-notice-type {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid #c7d2fe;
  text-transform: capitalize;
}

/* Union of cited-law jurisdictions, shown as a sub-label on the Legal Bases
   header (not the RegionInference output, so no feedback button). */
.lb-jurisdiction {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.lb-laws {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

/* No statutes cited — the notice rests on platform policy alone. */
.lb-no-laws {
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
  margin: 4px 0 12px;
}

/* Law citations are now self-contained, long, and possibly non-Latin, so each
   renders as a full-width block row rather than an inline pill. */
.law-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 4px;
  border: 1px solid;
  border-left-width: 3px;
}

.law-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
  color: inherit;
}
a.law-name { text-decoration: none; }
a.law-name:hover { text-decoration: underline; }

.law-meta {
  flex: 0 0 auto;
  white-space: nowrap;
}

.law-rel-high   { background: var(--high-bg);   border-color: var(--high-border);   color: var(--high); }
.law-rel-medium { background: var(--medium-bg); border-color: var(--medium-border); color: var(--medium); }
.law-rel-low    { background: var(--none-bg);   border-color: var(--none-border);   color: var(--text-muted); }

.law-juris {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.65;
  margin-left: 5px;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
  padding: 0 3px;
}

.law-rel-text {
  font-size: 0.65rem;
  font-weight: 500;
  font-style: italic;
  opacity: 0.6;
  margin-left: 5px;
}

.lb-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.lb-policies {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.policy-clause {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}

.policy-source {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.policy-text {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
}

.policy-source-url {
  display: inline-block;
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--primary);
  text-decoration: none;
}
.policy-source-url:hover { text-decoration: underline; }

.lb-submission {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lb-sub-label {
  font-weight: 600;
  color: var(--text-muted);
}

.lb-submission a { color: var(--primary); text-decoration: none; word-break: break-all; }
.lb-submission a:hover { text-decoration: underline; }

.lb-reasoning {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.lb-reasoning-summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.lb-reasoning-summary::before {
  content: '▶';
  font-size: 9px;
  transition: transform 0.15s;
}
details[open] > .lb-reasoning-summary::before {
  transform: rotate(90deg);
}
.lb-reasoning-body {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ── Takedown notices ── */
.notices-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notice-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.notice-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.notice-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}


.nmi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.nmi-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-transform: capitalize;
}

.notice-channel {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.notice-channel a { color: var(--primary); text-decoration: none; word-break: break-all; }
.notice-channel a:hover { text-decoration: underline; }

.notice-draft-details {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.notice-draft-summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.notice-draft-summary::-webkit-details-marker { display: none; }
.notice-draft-summary::before {
  content: '▶';
  font-size: 9px;
  transition: transform 0.15s;
}
details[open] .notice-draft-summary::before { transform: rotate(90deg); }

.notice-draft-content {
  position: relative;
  margin-top: 10px;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.12s;
  z-index: 1;
}
.copy-btn:hover { background: var(--primary-light); color: var(--primary); }

.notice-draft-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 16px 16px 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  margin: 0;
  max-height: 420px;
  overflow-y: auto;
}

/* ── Evidence to request from the client (agent v0.10) ── */
.ce-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ce-sub {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

/* The merged checklist leads the block: it is the list an operator works from when
   they phone the client, and the per-right lists below are the detail behind it. */
.ce-sub:first-child {
  background: var(--surface);
  border-color: #c7d2fe;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.07);
}

.ce-sub-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ce-sub-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* Sub-labels that qualify the block: how stable it is, and whether the rights in it
   are being filed on. Both change how the operator should use the list. */
.ce-sub-hint {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--none-bg);
  border: 1px solid var(--none-border);
}

.ce-sub-header .fb-jump-btn { margin-left: auto; }

/* An empty checklist / a null advice object is a state worth explaining, never a
   blank space that reads as "the client has nothing to send". */
.ce-empty {
  font-size: 12px;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-muted);
}

.ce-check-list,
.ce-right-list,
.ce-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ce-check-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 12px 14px;
}

/* `condition` and `item` are two different kinds of thing, so they get two columns
   and two labels — collapsing to one on narrow screens, never into one blob. */
.ce-ask {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .ce-ask { grid-template-columns: 1fr; }
}

.ce-ask-item,
.ce-ask-cond {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ce-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.ce-ask-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ce-cond-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ce-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.ce-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  text-transform: capitalize;
}

.ce-tag-verb {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
  margin-right: 5px;
}

/* Solid: a notice is going out for this right now, so chasing the document improves
   a filing already in flight. */
.ce-tag-strengthens {
  background: var(--primary-light);
  border: 1px solid #c7d2fe;
  color: var(--primary);
}

/* Dashed and muted: the right was declined, nothing is being filed on it, and this
   is the softer of the two tags — it also moves between runs of the same case. */
.ce-tag-unlocks {
  background: var(--none-bg);
  border: 1px dashed var(--none-border);
  color: var(--text-muted);
}

.ce-right-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

/* A declined right is not a filing in flight — it reads as the quieter of the two. */
.ce-right-card--declined { background: var(--bg); }

.ce-right-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ce-right-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  text-transform: capitalize;
}

.ce-right-header .fb-jump-btn { margin-left: auto; }

.ce-rationale {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* `items: []` is a real answer — nothing the client could supply would change this
   right — so it is stated, not rendered as missing data. */
.ce-no-items {
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
}

.ce-right-card .ce-ask {
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.ce-right-card .ce-items > .ce-ask:first-child {
  padding-top: 0;
  border-top: none;
}

/* The only cross-right comparison in the response: which declined right is closest
   to flipping. Nothing else in the payload sees them all at once. */
.ce-advice-analysis {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.ce-advice-analysis--lead { border-color: #c7d2fe; }

.ce-advice-analysis-text {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
  margin-top: 4px;
}

/* ── Agent version badge ── */
.result-id-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}


.version-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.version-select-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Static chip (single version) and dropdown (multiple) share one look. */
.version-value,
.version-select {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.version-select {
  cursor: pointer;
}

/* ── Feedback panel ── */
.feedback-panel {
  width: 360px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* No padding-top: the sticky bar supplies its own, so it can pin flush to the
     scrollport edge with nothing scrolling through above it. */
  padding: 0 16px 20px;
  gap: 14px;
}

.feedback-panel.hidden {
  display: none !important;
}

.fb-no-trace {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

.fb-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fb-item-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.fb-rationale.hidden { display: none; }

.fb-row-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.fb-dim-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fb-dim-combo {
  position: relative;
}

.fb-dim-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  box-sizing: border-box;
}

.fb-dim-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.08);
}

.fb-dim-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 200;
  max-height: 180px;
  overflow-y: auto;
}

.fb-dim-dropdown.hidden { display: none; }

.fb-dim-option {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-family: inherit;
}

.fb-dim-option:last-child { border-bottom: none; }

.fb-dim-option:hover,
.fb-dim-option.fb-dim-option--active {
  background: var(--primary-light);
  color: var(--primary);
}

.fb-value-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.fb-val-btn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}

.fb-val-btn + .fb-val-btn {
  border-left: 1px solid var(--border);
}

.fb-val-pass.active {
  background: #dcfce7;
  color: #166534;
}

.fb-val-fail.active {
  background: var(--high-bg);
  color: var(--high);
}

.fb-remove-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  width: 24px;
  height: 24px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, color 0.1s;
}

.fb-remove-btn:hover {
  background: var(--high-bg);
  color: var(--high);
  border-color: var(--high-border);
}

.fb-rationale {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  min-height: 48px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.fb-rationale:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.08);
}

.fb-rationale::placeholder { color: #b0bec5; }

.fb-add-btn {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background 0.12s, border-color 0.12s;
}

.fb-add-btn:hover {
  background: var(--primary-light);
  border-color: #c7d2fe;
}

.fb-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.fb-submit-btn {
  width: 100%;
  justify-content: center;
}

.fb-status {
  font-size: 12px;
  line-height: 1.5;
  border-radius: 6px;
  padding: 0;
  min-height: 0;
}

.fb-status:not(:empty) {
  padding: 8px 10px;
}

.fb-status-ok {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

.fb-status-error {
  background: var(--high-bg);
  color: var(--high);
  border: 1px solid var(--high-border);
}

/* ── Feedback history ── */
.fb-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fb-assessment {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.fb-assessment-header {
  display: flex;
  align-items: center;
  gap: 7px;
}

.fb-delete-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  width: 20px;
  height: 20px;
  font-size: 13px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  flex-shrink: 0;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.fb-delete-btn:hover {
  background: var(--high-bg);
  color: var(--high);
  border-color: var(--high-border);
}

.fb-hist-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.fb-hist-value {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.fb-hist-pass {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.fb-hist-fail {
  background: var(--high-bg);
  color: var(--high);
  border: 1px solid var(--high-border);
}

.fb-hist-rationale {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Header link ── */
.header-link {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 7px;
}
.header-link:hover { background: var(--primary-light); }

/* ── Secondary button ── */
.btn-secondary {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--bg); }

/* ── Rubrics page ── */
.rubrics-page {
  max-width: 760px;
  margin: 24px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.rubrics-intro {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}
/* ── Rubrics page: help callout ── */
.help-callout {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  margin-bottom: 18px;
  font-size: 12.5px;
}
.help-callout > summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
}
.help-callout > summary::-webkit-details-marker { display: none; }
.help-callout > summary::before { content: '▸ '; }
.help-callout[open] > summary::before { content: '▾ '; }
.help-body {
  padding: 0 14px 14px;
  color: var(--text);
  line-height: 1.6;
}
.help-body ul, .help-body ol { margin: 6px 0 10px 18px; }
.help-body li { margin-bottom: 5px; }
.help-rules { font-weight: 600; margin-top: 4px; }
.help-example {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.help-ex-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--text-muted);
}
.help-ex-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 5px;
  padding: 1px 6px;
  margin-right: 8px;
}
.help-ex-good { background: #dcfce7; color: #166534; }
.help-ex-bad  { background: var(--high-bg); color: var(--high); }

.rubric-form .form-group { margin-bottom: 14px; }
.rubric-form .form-actions { display: flex; gap: 10px; }
.rubric-form #rubric-status:not(:empty) { margin-top: 12px; }

.rubric-list { display: flex; flex-direction: column; gap: 10px; }
.rubric-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}
.rubric-item-main { flex: 1; min-width: 0; }
.rubric-item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.rubric-version {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}
.rubric-item-rationale {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}
.rubric-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Feedback panel: rubric rows ── */
.fb-dim-label {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.fb-pass-all-btn,
.fb-add-dim-btn {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}
.fb-pass-all-btn:hover,
.fb-add-dim-btn:hover { background: var(--primary-light); }

.fb-all-done {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
}

.fb-add-dim-btn { width: 100%; padding: 5px 12px; }

.fb-hist-tag {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

/* Sticky action bar: progress, bulk pass, and the single submit for the whole case.
   Negative margins cancel the panel padding so it spans the panel edge to edge. */
.fb-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Sticky offsets apply to the margin box, so a negative top margin would pin the
     bar that far below the scrollport edge and leave a gap to scroll through. Only
     the horizontal margins cancel the panel padding, letting it span edge to edge. */
  margin: 0 -16px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.fb-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fb-progress {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.fb-submit-btn[disabled] { opacity: 0.45; cursor: default; }

/* One section per step, all on one scroll: no picker, no per-step submit. */
.fb-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fb-step {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface, #fff);
}
.fb-step-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
}
.fb-step-summary::-webkit-details-marker { display: none; }
.fb-step-summary:hover { background: var(--bg); }
.fb-step-label { min-width: 0; overflow-wrap: anywhere; }
.fb-step--done > .fb-step-summary .fb-step-label {
  color: var(--text-muted);
  font-weight: 500;
}
.fb-step--flash { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.fb-step-check { color: #16a34a; font-weight: 700; }
.fb-step-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: 5px;
  padding: 1px 6px;
}
.fb-step-body {
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Collapsed history: submitted verdicts are reference, not the working surface. */
.fb-history-wrap {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.fb-history-summary {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 10px;
}

/* "+ Feedback" buttons attached to each result section. */
.fb-jump-btn {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 7px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
}
.fb-jump-btn:hover { background: var(--primary-light); border-style: solid; }
.section-with-fb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.section-with-fb .relevant-content-block { flex: 1; }
.notice-fb-row { display: flex; justify-content: flex-end; margin-bottom: 6px; }

/* The span chip gets its own line: since v0.9 split the rights into one span each,
   its label and the dimension name are both long and won't share a 360px row. */
.fb-hist-span-row {
  display: flex;
}
.fb-hist-span {
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 4px;
  padding: 1px 6px;
  line-height: 1.5;
}
.rubric-item-span code {
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 4px;
  padding: 1px 5px;
}
.rubric-item-span { margin: 2px 0; }
.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.form-hint code {
  background: var(--bg);
  border-radius: 4px;
  padding: 0 3px;
}

/* ── Review subset ── */
.review-subset-filter-row {
  margin-top: 8px;
}

.review-subset-filter-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
}

/* Right-side column in the result header: version selector stacked above pin button */
.result-header-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  flex-shrink: 0;
}

.review-subset-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--bg, #f8fafc);
  color: var(--text-muted, #888);
  cursor: pointer;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.review-subset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light, #eef2ff);
}
.review-subset-btn--active {
  background: var(--primary-light, #eef2ff);
  border-color: var(--primary);
  color: var(--primary);
}
.review-subset-btn--active:hover {
  background: #e0e7ff;
}

.hi-pin-badge {
  font-size: 10px;
  margin-left: 4px;
  vertical-align: middle;
  opacity: 0.75;
}

/* ── Platform rules (agent v0.11) ── */
/* Removal odds pill; borrows the law-rel-* colour classes for its severity. */
.pr-removal {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 99px;
  border: 1px solid;
}
.pr-author { margin-bottom: 12px; }
.pr-evidence {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
}
.pr-evidence .nmi-label { margin-right: 4px; }
/* The client's description restated, not a quote from the content. */
.pr-evidence--client { font-style: italic; color: var(--text-muted); }
/* Free text in the policy's own wording: don't title-case it like other notice values. */
.nmi-value.pr-reason { text-transform: none; }
