/* ============================================================
   Channel audit (آنالیز کانال)
   Built on the panel tokens in app.css: --bg, --surface, --border,
   --accent, --up, --down, --radius, --font.
   ============================================================ */

/* ── Page frame ─────────────────────────────────────────────────── */
.audit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: var(--gap);
  align-items: start;
}
.audit-layout > * { min-width: 0; }

.audit-side {
  display: grid;
  gap: var(--gap);
  min-width: 0;
}

.audit-report {
  display: grid;
  gap: var(--gap);
  margin-top: var(--gap);
  min-width: 0;
}
.audit-report > * { min-width: 0; }

/* ── Upload ─────────────────────────────────────────────────────── */
.audit-upload .card__head { margin-bottom: 10px; }

.audit-name { margin-bottom: 14px; }
.audit-name small { line-height: 1.6; }

.audit-profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.audit-profile-row .field { margin: 0; }
.audit-profile-row .btn { min-height: 44px; white-space: nowrap; }
.audit-profile-dialog { width: min(780px, calc(100vw - 24px)); }
.audit-profile-dialog .params { gap: 10px; }
.audit-profile-dialog textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  font: inherit;
}

.audit-exec-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: 14px;
  align-items: start;
  margin-top: 10px;
}
.audit-exec-stats {
  display: grid;
  gap: 7px;
}
.audit-exec-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12.5px;
}
.audit-exec-stat span { color: var(--muted-2); }
.audit-exec-stat strong { color: var(--text); font-weight: 600; text-align: end; }
@media (max-width: 860px) {
  .audit-exec-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .audit-profile-row { grid-template-columns: minmax(0, 1fr); }
  .audit-profile-row .btn { width: 100%; }
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 150px;
  margin-top: 14px;
  padding: 24px 18px;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(240px 130px at 50% 0%, rgba(124, 58, 237, 0.14), transparent 72%),
    rgba(255, 255, 255, 0.014);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.dropzone strong { font-size: 15px; color: var(--text); }
.dropzone__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--accent-strong);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 19px;
  line-height: 1;
}
.dropzone--over {
  border-color: var(--accent);
  background:
    radial-gradient(240px 130px at 50% 0%, rgba(124, 58, 237, 0.26), transparent 72%),
    rgba(183, 156, 255, 0.06);
  transform: translateY(-1px);
}
.dropzone:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.file-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  font-size: 12.5px;
}
.file-row__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-row__size {
  flex: 0 0 auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  direction: ltr;
}
.file-row .link { flex: 0 0 auto; min-height: 32px; }

/* ── Progress ───────────────────────────────────────────────────── */
.audit-progress { margin-top: 14px; }

.audit-progress .progress {
  position: relative;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
}
.audit-progress .progress > span {
  display: block;
  width: 2%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.4s ease;
}
.audit-progress p { margin-top: 8px; }

/* ── Tags & chips ───────────────────────────────────────────────── */
.audit-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.audit-tag--ok {
  color: var(--up);
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(52, 211, 153, 0.08);
}
.audit-tag--warn {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(251, 191, 36, 0.08);
}
.audit-tag--bad {
  color: var(--down);
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.08);
}

.audit-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.audit-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.audit-chip > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-chip__meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.audit-chip:hover { border-color: var(--border-strong); color: var(--text); }
.audit-chip.is-active {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: var(--text);
}
.audit-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── KPI strip ──────────────────────────────────────────────────── */
.audit-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.audit-kpi {
  min-height: 108px;
  padding: 16px;
  border-radius: var(--radius-sm);
}
.audit-kpi .kpi__value { font-size: clamp(1.15rem, 1.7vw, 1.5rem); }
.audit-kpi .muted { line-height: 1.5; }

/* ── Recommendation hero ────────────────────────────────────────── */
.audit-hero {
  overflow: hidden;
  background:
    radial-gradient(560px 260px at 100% 0%, rgba(96, 37, 191, 0.24), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 46%),
    var(--surface);
  border-color: var(--accent-strong);
}
.audit-hero__top { max-width: 62ch; }
.audit-hero__kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.audit-hero__top h2 {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1.25;
  margin-bottom: 8px;
}
.audit-hero__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 20px;
}
.audit-hero__grid > div { min-width: 0; }
.audit-hero__grid h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.audit-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  line-height: 1.75;
}
.audit-list > li {
  position: relative;
  padding-inline-start: 18px;
  color: var(--muted-2);
}
.audit-list > li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  inset-block-start: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.audit-list--num { counter-reset: audit-step; }
.audit-list--num > li { padding-inline-start: 28px; }
.audit-list--num > li::before {
  counter-increment: audit-step;
  content: counter(audit-step);
  inset-block-start: 0.1em;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-strong);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
}
.audit-list--plain > li::before {
  background: var(--muted);
  opacity: 0.55;
}

.audit-callout {
  display: grid;
  gap: 4px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--accent-strong);
  border-inline-start-width: 3px;
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
  font-size: 13.5px;
}
.audit-callout strong { color: var(--accent); font-size: 11.5px; letter-spacing: 0.04em; }
.audit-callout > span { color: var(--muted-2); }
.audit-callout--warn {
  margin: 12px 0;
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.06);
}
.audit-callout--warn strong { color: var(--warn); }
.audit-hero .disclaimer { margin-top: 16px; }

/* ── Inline help ────────────────────────────────────────────────── */
.audit-help {
  margin: 0 0 10px;
  color: var(--muted-2);
  font-size: 12.5px;
}
.audit-help summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 4px 0;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.audit-help summary::-webkit-details-marker { display: none; }
.audit-help summary::before {
  content: "؟";
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid var(--accent-strong);
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: 11px;
  line-height: 1;
}
.audit-help p {
  margin: 2px 0 0;
  line-height: 1.9;
}
.audit-help strong { color: var(--text); font-weight: 700; }

/* ── Patterns ───────────────────────────────────────────────────── */
.audit-patterns__list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.audit-pattern {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
}
.audit-pattern__name { color: var(--text); font-size: 13.5px; }
.audit-pattern__meta { color: var(--muted-2); font-size: 12.5px; }
.audit-pattern__halves { color: var(--muted); font-size: 11.5px; }
.audit-pattern--bad { border-color: rgba(251, 113, 133, 0.3); }
.audit-style {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 4px;
}
.audit-tech-group td {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.audit-patterns h3 {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* ── Money / compounding ───────────────────────────────────────── */
.audit-money { display: grid; gap: 12px; }
.audit-money__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: end;
}
.audit-money__out { display: grid; gap: 3px; min-width: 0; }
.audit-money__out strong {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: start;
}
.audit-money__out strong.up { color: var(--up); }
.audit-money__out strong.down { color: var(--down); }
.audit-money__out .small { font-variant-numeric: tabular-nums; }
.audit-money > p { margin: 0; line-height: 1.7; }

/* ── Policy picker + outcome chips ─────────────────────────────── */
.audit-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.audit-pick select {
  width: auto;
  min-width: 180px;
  max-width: 260px;
  min-height: 42px;
  padding: 8px 10px;
  font-size: 12.5px;
}
.audit-hit {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.audit-hit--ok {
  color: var(--up);
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(52, 211, 153, 0.08);
}
.audit-hit--bad {
  color: var(--down);
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.08);
}
.audit-hit--warn {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(251, 191, 36, 0.08);
}
.audit-hit--none,
.audit-hit--muted { color: var(--muted); }
.audit-hit-cell { white-space: nowrap; }

/* Numeric cells keep their LTR digits but line up under the RTL header. */
#page-audit .table td.num { text-align: right; }
#page-audit .table td.audit-hit-cell { text-align: right; }

/* ── Charts ─────────────────────────────────────────────────────── */
.audit-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  min-width: 0;
}
.audit-two > * { min-width: 0; }
.audit-two h3 {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.audit-two h3:first-child { margin-top: 0; }
.audit-two ul + h3 { margin-top: 20px; }

.audit-canvas-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    var(--surface-2);
  padding: 6px;
  overflow: hidden;
}
.audit-canvas {
  display: block;
  width: 100%;
  min-width: 0;
}

.audit-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 12px;
}
.audit-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.dot-key {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: 0 0 auto;
}
.dot-key--up { background: var(--up); }
.dot-key--muted { background: var(--muted); }

/* ── Tables ─────────────────────────────────────────────────────── */
.table--compact { min-width: 560px; font-size: 12.5px; }
.table--compact th,
.table--compact td { padding: 10px 9px; }
.table--compact thead th {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
}
.table-wrap--tall {
  max-height: 540px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.table tbody tr.is-best {
  background: rgba(52, 211, 153, 0.055);
}
.table tbody tr.is-bad {
  background: rgba(251, 113, 133, 0.055);
}
.table tbody tr.is-warn {
  background: rgba(251, 191, 36, 0.055);
}
.table tbody tr[data-msg] { cursor: pointer; }
.table tbody tr[data-msg]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}
.cell-actions .link { min-height: 32px; }

.dir {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.dir--buy {
  color: var(--up);
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(52, 211, 153, 0.08);
}
.dir--sell {
  color: var(--down);
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.08);
}

/* ── Narrative ──────────────────────────────────────────────────── */
.audit-prose {
  max-width: 78ch;
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1.9;
}
.audit-prose h3 {
  margin: 20px 0 8px;
  color: var(--text);
  font-size: 14.5px;
}
.audit-prose h3:first-child { margin-top: 0; }
.audit-prose p { margin: 0 0 10px; }
.audit-prose ul { margin: 0 0 12px; }
.audit-prose code {
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--surface-3);
  direction: ltr;
  unicode-bidi: isolate;
}

/* ── Signal chart dialog ────────────────────────────────────────── */
.audit-dialog {
  width: min(1280px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(600px 260px at 100% 0%, rgba(96, 37, 191, 0.18), transparent 70%),
    var(--surface);
  color: var(--text);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95);
}
.audit-dialog::backdrop {
  background: rgba(4, 4, 7, 0.72);
  backdrop-filter: blur(6px);
}
.audit-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.audit-dialog__head h2 { font-size: 1.1rem; }
.audit-dialog__head .link { min-height: 44px; }
.audit-dialog__actions { display: flex; align-items: center; gap: 6px; }
#auditChartInfo { margin-bottom: 14px; line-height: 1.8; }

.audit-chart {
  width: 100%;
  min-width: 0;
  height: 560px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
}
.audit-chart-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 4px 0 12px;
  color: var(--muted-2);
  font-size: 12.5px;
}
.audit-chart-tools label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  cursor: pointer;
}
.audit-chart-tools input {
  width: 17px;
  height: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .audit-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .audit-layout { grid-template-columns: minmax(0, 1fr); }
  .audit-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .audit-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .audit-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-chart { height: 420px; }
  .table-wrap--tall { max-height: 460px; }
  .audit-money__form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-money__out { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .audit-report .col-side { display: none; }
  .table--compact { min-width: 0; }
  .table--compact th, .table--compact td { padding: 9px 6px; font-size: 12px; }
  .table--compact th { font-size: 11px; }
}
@media (max-width: 560px) {
  .audit-kpis { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .audit-money__form { grid-template-columns: minmax(0, 1fr); }
  .audit-kpi { min-height: 96px; padding: 14px; }
  .dropzone { min-height: 132px; padding: 20px 14px; }
  .audit-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 24px);
    padding: 14px;
    border-radius: var(--radius-sm);
  }
  .audit-chart { height: 360px; }
  .audit-hero__top h2 { font-size: 1.35rem; }
  .audit-list { font-size: 13px; }
  .file-row { flex-wrap: wrap; }
  .file-row__name { flex-basis: 100%; }
}

@media (hover: none) {
  .dropzone:hover { border-color: var(--border-strong); transform: none; }
  .audit-chip:hover { border-color: var(--border); }
}

/* ── signal lab ─────────────────────────────────────────────────── */
.field--check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}
.field--check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
}
.field--check > span {
  color: var(--muted-2);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.6;
}
.sl-action {
  margin: 12px 0 4px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.8;
}
.sl-points {
  display: inline-block;
  min-width: 42px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sl-points--ok {
  color: var(--up);
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(52, 211, 153, 0.08);
}
.sl-points--bad {
  color: var(--down);
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.08);
}
.sl-points--muted { color: var(--muted); }
.sl-outcome {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}
.sl-outcome > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.sl-outcome strong { font-size: 13.5px; line-height: 1.6; }
.sl-outcome__r { font-size: 15px !important; }
.sl-details {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.sl-details summary {
  display: flex;
  align-items: center;
  min-height: 36px;
  color: var(--muted-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.sl-details summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#page-signal .audit-chart { height: 460px; }
#page-signal .table td.num { text-align: right; }
#page-signal .audit-list { margin-top: 10px; }
#slText {
  width: 100%;
  min-height: 84px;
  padding: 11px 13px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  line-height: 1.8;
  resize: vertical;
}
#slText:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.sl-details--flush { margin-top: 0; padding-top: 0; border-top: 0; }
.sl-text { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; }
.sl-review-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sl-review-nav .btn {
  flex: 1 1 0;
  min-height: 44px;
}
#slCounter {
  min-width: 84px;
  text-align: center;
  white-space: nowrap;
}
.sl-review-progress {
  height: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}
.sl-review-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}
#slReviewProgress { margin-top: -6px; }
.sl-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}
.sl-grade--a {
  color: var(--up);
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(52, 211, 153, 0.08);
}
.sl-grade--b {
  color: var(--accent);
  border-color: var(--accent-strong);
  background: var(--accent-soft);
}
.sl-grade--c {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(251, 191, 36, 0.08);
}
.sl-grade--d {
  color: var(--down);
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.08);
}
.sl-cal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.sl-crit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.sl-crit h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 13px;
}
.sl-crit .table { margin-top: 6px; }
.sl-cal-grid h3 {
  margin: 4px 0 8px;
  color: var(--muted-2);
  font-size: 12.5px;
}
.sl-cal-conclusion {
  margin: 12px 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.8;
}
.sl-cal-conclusion.is-ok {
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(52, 211, 153, 0.06);
}
.sl-cal-conclusion.is-warn {
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(251, 191, 36, 0.06);
}
.sl-reviewed {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 12.5px;
  cursor: pointer;
}
.sl-reviewed input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
}
.sl-rating {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border: 1px solid var(--accent-strong);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}
@media (max-width: 900px) {
  .sl-cal-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Pattern scanner styles live in patterns.css (obsidian & gold theme). */
@media (max-width: 767px) {
  #page-signal .audit-chart { height: 360px; }
  .sl-outcome { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .sl-outcome { grid-template-columns: minmax(0, 1fr); }
}
