/* ============================================================
   .rights.shock — app-specific styles
   Loads AFTER shock.css + suite-app.css. Only the bits the shared
   app shell doesn't already provide: the asset-rights ledger table,
   computed status chips, the risk dashboard banner, the honesty note
   and the inspector record view.

   Responsive: Desktop (widescreen left-rail + table), Tablet (side panel + cards),
   Mobile (<768px: collapsed rail, vertical card list, full-width forms).
   ============================================================ */

/* ---------- honesty / engine note ---------- */
.rg-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-left: 3px solid var(--info);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.45;
}
.rg-note b { color: var(--text); font-weight: 600; }
.rg-note__icon { color: var(--info); flex-shrink: 0; margin-top: 1px; }

/* ---------- status chips (computed) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.chip--ok       { color: var(--pick);   border-color: rgba(63,185,80,.4);  background: rgba(63,185,80,.10); }
.chip--expiring { color: var(--unsure); border-color: rgba(217,166,10,.4); background: rgba(217,166,10,.10); }
.chip--risk     { color: var(--reject); border-color: rgba(200,7,10,.45);  background: rgba(200,7,10,.12); }
.chip--ai       { color: var(--info);   border-color: rgba(74,143,255,.45); background: rgba(74,143,255,.12); }
.chip--flat     { color: var(--dim);    border-color: var(--app-line);     background: var(--app-surface2); }
.chip--flat::before { display: none; }

/* ---------- risk dashboard banner ---------- */
.rg-dash {
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.rg-dash__row { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }
.rg-dash__stat { display: flex; flex-direction: column; gap: 2px; }
.rg-dash__num { font-family: var(--font-mono); font-size: 26px; font-weight: 600; line-height: 1; }
.rg-dash__num.is-risk     { color: var(--reject); }
.rg-dash__num.is-expiring { color: var(--unsure); }
.rg-dash__num.is-unrel    { color: var(--reject); }
.rg-dash__num.is-ai       { color: var(--info); }
.rg-dash__num.is-ok       { color: var(--pick); }
.rg-dash__lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.rg-dash__sep { width: 1px; align-self: stretch; background: var(--app-line); }
.rg-dash__spacer { flex: 1 1 auto; }
.rg-dash__bar { width: 100%; height: 8px; background: var(--app-surface2); border-radius: 4px; overflow: hidden; margin-top: 12px; display: flex; }
.rg-dash__seg { height: 100%; transition: width .3s var(--ease); }
.rg-dash__seg.s-ok   { background: var(--pick); }
.rg-dash__seg.s-exp  { background: var(--unsure); }
.rg-dash__seg.s-risk { background: var(--reject); }

/* ---------- accessibility: focus indicators ---------- */
button:focus-visible,
input:focus-visible,
[role="button"]:focus-visible,
.folder-item:focus-visible,
a:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

input:invalid:focus-visible {
  outline-color: var(--reject);
}

/* ---------- motion: easing curves and timing ---------- */
:root {
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 100ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* ---------- motion: modal & dialog animations ---------- */
@keyframes dlg-enter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dlg {
  animation: dlg-enter var(--duration-normal) var(--ease-out-quart);
}

/* ---------- motion: status chip fade-in ---------- */
@keyframes chip-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.chip {
  animation: chip-enter var(--duration-fast) ease-out;
}

/* ---------- motion: button feedback ---------- */
button {
  transition: background-color var(--duration-fast) var(--ease-out-quart),
              color var(--duration-fast) var(--ease-out-quart),
              border-color var(--duration-fast) var(--ease-out-quart),
              transform var(--duration-fast) var(--ease-out-quart),
              box-shadow var(--duration-fast) var(--ease-out-quart);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

/* ---------- motion: input focus transitions ---------- */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  transition: border-color var(--duration-fast) var(--ease-out-quart),
              box-shadow var(--duration-fast) var(--ease-out-quart);
}

/* ---------- motion: folder item hover ---------- */
.folder-item {
  transition: background-color var(--duration-fast) var(--ease-out-quart),
              border-color var(--duration-fast) var(--ease-out-quart),
              color var(--duration-fast) var(--ease-out-quart);
}

.folder-item:hover {
  background-color: var(--app-surface2);
}

/* ---------- motion: table row hover ---------- */
.rg-table tbody tr {
  transition: background-color var(--duration-fast) var(--ease-out-quart);
}

.rg-table tbody tr:hover {
  background-color: var(--app-surface2);
}

/* ---------- motion: filter state transitions ---------- */
.app-filter label {
  transition: color var(--duration-fast) var(--ease-out-quart);
}

/* ---------- motion: risk bar animations ---------- */
.rg-dash__seg {
  transition: width var(--duration-normal) var(--ease-out-quart),
              background-color var(--duration-normal) var(--ease-out-quart);
}

/* ---------- motion: tab indicator ---------- */
.app-tab {
  transition: color var(--duration-normal) var(--ease-out-quart),
              border-color var(--duration-normal) var(--ease-out-quart);
}

/* ---------- accessibility: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- hardening: text overflow & truncation ---------- */
/* Filenames in tables and cards */
.rg-table tbody td:first-child,
.rg-card__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Long folder names: allow wrapping */
.folder-name {
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0; /* Allow shrinking in flex container */
}

/* Prevent flex items from pushing past container */
.rg-table tbody tr > * {
  min-width: 0;
}

.folder-item > * {
  min-width: 0;
}

/* ---------- hardening: error states ---------- */
.input-error {
  border-color: var(--reject) !important;
  background-color: rgba(200, 7, 10, 0.05) !important;
}

.error-message {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--reject);
  font-weight: 500;
}

/* Form validation */
input:invalid {
  border-color: var(--reject);
  background-color: rgba(200, 7, 10, 0.05);
}

input:invalid::placeholder {
  color: var(--reject);
  opacity: 0.6;
}

/* ---------- hardening: loading states ---------- */
@keyframes spinner {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--app-line);
  border-top-color: var(--info);
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--dim);
}

.loading-bar {
  width: 100%;
  height: 2px;
  background: var(--app-line);
  border-radius: 1px;
  overflow: hidden;
  margin: 8px 0;
}

.loading-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: 30%;
  background: var(--info);
  animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(400%); }
  100% { transform: translateX(400%); }
}

/* ---------- hardening: success states ---------- */
.success-message {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--pick);
  font-weight: 500;
}

.toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  padding: 12px 16px;
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  z-index: 1000;
  animation: toast-enter var(--duration-normal) var(--ease-out-quart);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.is-success {
  border-color: var(--pick);
  background: rgba(63, 185, 80, 0.1);
  color: var(--pick);
}

.toast.is-error {
  border-color: var(--reject);
  background: rgba(200, 7, 10, 0.1);
  color: var(--reject);
}

/* ---------- hardening: disabled states ---------- */
button:disabled,
input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- responsive: mobile layout <768px ---------- */
@media (max-width: 767px) {
  /* Stack the app body vertically */
  .app-body-grid {
    grid-template-columns: 1fr;
  }

  /* Left rail: hide by default, or show as overlay/collapsed */
  .app-rail {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    z-index: 100;
    background: var(--app-surface);
    border-right: 1px solid var(--app-line);
    overflow-y: auto;
    padding-top: 60px; /* below topbar */
  }

  /* Show rail when active or via hamburger toggle */
  .app-rail.is-open {
    display: flex;
    flex-direction: column;
  }

  /* Backdrop when rail is open */
  .app-body-grid.rail-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
  }

  /* Main content takes full width on mobile */
  .app-main {
    grid-column: 1;
  }

  /* Table: reflow to card layout on mobile */
  .rg-table-wrap {
    display: none;
  }

  /* Card layout for assets (replace table) */
  .rg-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .rg-card {
    background: var(--app-surface);
    border: 1px solid var(--app-line);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .rg-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
  }

  .rg-card__title {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    word-break: break-word;
  }

  .rg-card__chip {
    flex-shrink: 0;
  }

  .rg-card__meta {
    font-size: 12px;
    color: var(--dim);
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  /* Increase touch targets on mobile */
  button {
    min-height: 44px;
    min-width: 44px;
  }

  .app-rail__item {
    padding: 12px 14px;
  }

  .folder-item {
    padding: 10px 12px;
  }

  /* Stack form fields vertically in dialogs */
  .dlg-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }

  .dlg-form-group label {
    font-size: 12px;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .dlg-form-group input,
  .dlg-form-group textarea,
  .dlg-form-group select {
    padding: 10px 12px;
    font-size: 14px;
  }

  /* Modal: full-width on mobile */
  .dlg {
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Reduce padding in dialogs */
  .dlg-body {
    padding: 12px;
  }

  /* Monospace text: bump to 13px for legibility on mobile */
  .rg-table tbody td,
  .chip {
    font-size: 12px;
  }

  /* Risk dashboard: stack stats vertically */
  .rg-dash__row {
    flex-direction: column;
    gap: 12px;
  }

  .rg-dash__sep {
    display: none;
  }

  /* Filter: stack vertically */
  .app-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .app-filter label {
    padding: 8px 0;
    font-size: 13px;
  }
}

/* ---------- responsive: tablet layout 768px-1024px ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
  .app-rail {
    max-width: 240px;
  }

  .rg-table {
    font-size: 12px;
  }

  .rg-table th {
    padding: 8px;
  }

  .rg-table tbody td {
    padding: 8px;
  }
}

/* ---------- accessibility: enhance contrast on monospace ---------- */
@media (prefers-contrast) {
  .chip,
  .rg-table tbody td {
    font-weight: 500;
  }

  .chip--unsure {
    color: #f5c40b;
  }

  .chip--expiring {
    color: #f5c40b;
  }
}

/* risk list (specific issues) */
.rg-risks { margin-top: 14px; border-top: 1px solid var(--app-line); padding-top: 12px; }
.rg-risks__head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-bottom: 8px;
}
.rg-risks__list { display: flex; flex-direction: column; gap: 5px; max-height: 168px; overflow-y: auto; }
.rg-risk {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; color: var(--dim); line-height: 1.4;
  padding: 4px 8px; border-radius: var(--radius); cursor: pointer;
  background: var(--app-surface2); border: 1px solid var(--app-line);
}
.rg-risk:hover { border-color: var(--line2); color: var(--text); }
.rg-risk__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; align-self: center; }
.rg-risk__dot.d-risk { background: var(--reject); }
.rg-risk__dot.d-exp  { background: var(--unsure); }
.rg-risk__file { font-family: var(--font-mono); color: var(--text); font-size: 12px; }
.rg-risks__none { font-size: 13px; color: var(--pick); padding: 4px 0; }

/* ---------- ledger table ---------- */
.rg-table-wrap { border: 1px solid var(--app-line); border-radius: 8px; overflow: hidden; }
.rg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rg-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--app-surface);
  text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600;
  padding: 9px 12px;
  border-bottom: 1px solid var(--app-line);
  white-space: nowrap;
}
.rg-table tbody tr {
  border-bottom: 1px solid var(--app-line);
  cursor: pointer;
  transition: background .12s;
}
.rg-table tbody tr:last-child { border-bottom: none; }
.rg-table tbody tr:hover { background: var(--app-surface2); }
.rg-table tbody tr.is-selected { background: var(--app-surface2); box-shadow: inset 3px 0 0 var(--info); }
.rg-table td { padding: 9px 12px; vertical-align: middle; color: var(--text); }
.rg-table td .sub { color: var(--faint); font-size: 11px; }
.rg-cell-file { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rg-thumb {
  width: 40px; height: 30px; border-radius: 4px; object-fit: cover;
  background: var(--app-surface2); flex-shrink: 0; display: block;
}
.rg-thumb--ph {
  display: flex; align-items: center; justify-content: center; color: var(--faint);
  border: 1px solid var(--app-line);
}
.rg-cell-file__name { min-width: 0; }
.rg-cell-file__name b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.rg-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.rg-table .col-date { font-family: var(--font-mono); font-size: 12px; color: var(--dim); white-space: nowrap; }

/* ---------- inspector record ---------- */
.insp-thumb { width: 100%; border-radius: 6px; border: 1px solid var(--app-line); margin-bottom: 14px; display: block; }
.insp-nothumb {
  width: 100%; aspect-ratio: 3/2; border-radius: 6px; border: 1px dashed var(--app-line);
  display: flex; align-items: center; justify-content: center; color: var(--faint); margin-bottom: 14px;
}
.insp-name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 8px; line-height: 1.25; word-break: break-word; }
.insp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.insp-kv { font-family: var(--font-mono); font-size: 12px; color: var(--dim); margin-bottom: 14px; }
.insp-kv div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--app-line); }
.insp-kv .k { color: var(--faint); flex-shrink: 0; }
.insp-kv .v { color: var(--text); text-align: right; word-break: break-word; }
.insp-flags { background: var(--app-surface2); border: 1px solid var(--app-line); border-radius: 5px; padding: 10px 12px; font-size: 13px; color: var(--dim); margin-bottom: 14px; line-height: 1.5; }
.insp-flags b { color: var(--text); }
.insp-flags .flag-line { display: flex; gap: 8px; align-items: baseline; }
.insp-flags .flag-line + .flag-line { margin-top: 6px; }
.insp-flags .flag-line .d { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; align-self: center; }
.insp-flags .d-risk { background: var(--reject); }
.insp-flags .d-exp  { background: var(--unsure); }
.insp-flags .d-ai   { background: var(--info); }
.insp-notes { background: var(--app-surface2); border: 1px solid var(--app-line); border-radius: 5px; padding: 10px 12px; font-size: 13px; color: var(--dim); margin-bottom: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }

/* ---------- empty ledger ---------- */
.rg-empty { padding: 20px 0; display: flex; justify-content: center; }
.rg-empty__card {
  width: min(520px, 100%);
  text-align: center;
  border: 1px dashed var(--app-line);
  border-radius: 10px;
  padding: 44px 34px;
  background: var(--app-surface);
}
.rg-empty__card svg { color: var(--faint); margin-bottom: 14px; }
.rg-empty__card h2 { font-size: 20px; margin-bottom: 8px; }
.rg-empty__card p { color: var(--dim); font-size: 13px; margin-bottom: 20px; line-height: 1.5; }
.rg-empty__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- dialog form: two-column rows + checkbox row ---------- */
.rg-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rg-form-row .app-field { margin-bottom: 14px; }
.rg-check {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--text); margin-bottom: 14px;
  text-transform: none; letter-spacing: 0;
}
.rg-check input[type=checkbox] { accent-color: var(--red); width: 16px; height: 16px; }
.rf-preview {
  margin-top: 10px;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--app-line);
}
.app-dialog__panel--wide { width: min(620px, 100%); }
.rg-import-hint { font-size: 12px; color: var(--faint); margin-top: -6px; margin-bottom: 12px; line-height: 1.45; }

/* ---------- engine badge: connected state ---------- */
.app-engine--on { color: var(--pick); }
.app-engine--on .app-engine__dot { background: var(--pick); box-shadow: 0 0 0 3px rgba(63,185,80,.15); }

/* ---------- structured license windows (dialog repeater) ---------- */
.rg-lic-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.rg-lic-row { display: grid; grid-template-columns: 1.2fr 1fr auto auto auto; gap: 8px; align-items: center; }
.rg-lic-row input { min-width: 0; }
.rg-lic-row input[type=date] { font-family: var(--font-mono); font-size: 12px; }
.rg-lic-del { padding: 4px 9px; }
@media (max-width: 560px) { .rg-lic-row { grid-template-columns: 1fr 1fr; } }

/* ---------- upcoming reminders (dashboard) ---------- */
.rg-up__list { display: flex; flex-direction: column; gap: 5px; max-height: 168px; overflow-y: auto; }
.rg-up {
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center;
  font-size: 12.5px; color: var(--dim); padding: 4px 8px; border-radius: var(--radius);
  background: var(--app-surface2); border: 1px solid var(--app-line); cursor: pointer;
}
.rg-up:hover { border-color: var(--line2); color: var(--text); }
.rg-up__when { font-family: var(--font-mono); font-size: 12px; color: var(--text); white-space: nowrap; }
.rg-up__days { font-family: var(--font-mono); font-size: 11px; color: var(--faint); white-space: nowrap; }
.rg-up__days.is-soon { color: var(--unsure); }
.rg-up__k { font-size: 12px; }
.rg-up__k--expiry { color: var(--unsure); }
.rg-up__k--embargo { color: var(--info); }
.rg-up__k--license { color: var(--dim); }
.rg-up__file { font-family: var(--font-mono); font-size: 11px; color: var(--faint); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

/* ---------- monitor tab ---------- */
.rg-mon__head { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.rg-mon__intro h3 { font-size: 15px; margin: 0 0 4px; }
.rg-mon__intro p { font-size: 12.5px; color: var(--dim); margin: 0; line-height: 1.5; max-width: 60ch; }
.rg-mon__intro b { color: var(--text); font-weight: 600; }
.rg-mon__stat { text-align: center; flex-shrink: 0; }
.rg-mon__num { display: block; font-family: var(--font-mono); font-size: 26px; font-weight: 600; color: var(--reject); line-height: 1; }
.rg-mon__lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.rg-mon__empty { border: 1px dashed var(--app-line); border-radius: 8px; padding: 30px; text-align: center; color: var(--faint); font-size: 13px; }
.rg-mon__empty b { color: var(--dim); }
.rg-mon__list { display: flex; flex-direction: column; gap: 12px; }
.rg-mgroup { border: 1px solid var(--app-line); border-radius: 8px; overflow: hidden; }
.rg-mgroup__file { font-family: var(--font-mono); font-size: 12px; color: var(--text); background: var(--app-surface); padding: 8px 12px; border-bottom: 1px solid var(--app-line); cursor: pointer; }
.rg-mgroup__file:hover { color: var(--info); }
.rg-mrow { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--app-line); font-size: 13px; }
.rg-mrow:last-child { border-bottom: none; }
.rg-mrow__badge { font-family: var(--font-mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--app-line); flex-shrink: 0; }
.rg-mrow__url { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-mrow__url:hover { text-decoration: underline; }
.rg-mrow__conf { font-family: var(--font-mono); font-size: 11px; color: var(--faint); flex-shrink: 0; }
.rg-mrow__note { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.rg-mrow__acts { display: flex; gap: 6px; align-items: center; margin-left: auto; flex-shrink: 0; }
.rg-mrow__status { font-size: 11px; padding: 3px 6px; }

/* match status colors (shared by monitor rows + inspector) */
.b-candidate .rg-mrow__badge, .b-candidate.insp-match .insp-match__badge, .rg-mrow__badge.b-candidate { color: var(--info); border-color: rgba(74,143,255,.4); background: rgba(74,143,255,.1); }
.b-open      .rg-mrow__badge, .b-open.insp-match      .insp-match__badge, .rg-mrow__badge.b-open      { color: var(--reject); border-color: rgba(200,7,10,.4); background: rgba(200,7,10,.1); }
.b-licensed  .rg-mrow__badge, .b-licensed.insp-match  .insp-match__badge, .rg-mrow__badge.b-licensed  { color: var(--pick); border-color: rgba(63,185,80,.4); background: rgba(63,185,80,.1); }
.b-takedown  .rg-mrow__badge, .b-takedown.insp-match  .insp-match__badge, .rg-mrow__badge.b-takedown  { color: var(--unsure); border-color: rgba(217,166,10,.4); background: rgba(217,166,10,.1); }
.b-cleared   .rg-mrow__badge, .b-cleared.insp-match   .insp-match__badge, .rg-mrow__badge.b-cleared   { color: var(--faint); border-color: var(--app-line); background: var(--app-surface2); }

/* ---------- inspector: license windows ---------- */
.insp-lics { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.insp-lic { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 6px 10px; border-radius: 5px; background: var(--app-surface2); border: 1px solid var(--app-line); border-left: 3px solid var(--app-line); }
.insp-lic.is-soon { border-left-color: var(--unsure); }
.insp-lic.is-over { border-left-color: var(--reject); }
.insp-lic__ch { color: var(--text); font-weight: 600; }
.insp-lic__dt { font-family: var(--font-mono); color: var(--dim); white-space: nowrap; }
.insp-lic__dt em { color: var(--faint); font-style: normal; }

/* ---------- inspector: monitoring ---------- */
.insp-mon { background: var(--app-surface2); border: 1px solid var(--app-line); border-radius: 5px; padding: 10px 12px; margin-bottom: 14px; }
.insp-mon__links { display: flex; gap: 6px; flex-wrap: wrap; }
.insp-mon__hint { font-size: 11px; color: var(--faint); margin: 8px 0 0; line-height: 1.45; }
.insp-mon__acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.insp-matches { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.insp-match { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.insp-match__badge { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--app-line); flex-shrink: 0; }
.insp-match a { color: var(--dim); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-match a:hover { color: var(--text); text-decoration: underline; }
.insp-match__none { font-size: 12px; color: var(--faint); }

/* ---------- GPU-accelerated rendering ---------- */
.insp-thumb { max-width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--app-line); margin-bottom: 14px; display: block; }
canvas.insp-thumb { background: var(--app-surface2); image-rendering: crisp-edges; }

/* GPU monitor canvas rendering */
.rg-mon__gpu-canvas { width: 100%; height: auto; border: 1px solid var(--app-line); border-radius: 8px; margin-bottom: 14px; display: block; image-rendering: auto; }

/* ---------- folders module (left sidebar) ---------- */
.app-rail__title-btn {
  background: none; border: none; color: var(--faint); cursor: pointer; font-size: 14px; font-weight: 600;
  padding: 0 6px; margin-left: auto; flex-shrink: 0; transition: color .15s;
}
.app-rail__title-btn:hover { color: var(--text); }

.folder-list {
  display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto;
  padding: 4px 8px; font-size: 13px;
}

.folder-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px;
  cursor: pointer; transition: background .12s; position: relative; user-select: none;
}
.folder-item:hover { background: var(--app-surface2); }
.folder-item.active { background: rgba(74,143,255,.15); border-left: 3px solid var(--info); padding-left: 5px; }

.folder-item i {
  font-size: 14px; color: var(--faint); flex-shrink: 0;
}
.folder-item.active i { color: var(--info); }

.folder-name {
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text); font-weight: 500;
}
.folder-item.active .folder-name { color: var(--text); }

.folder-count {
  font-size: 10px; font-family: var(--font-mono); color: var(--faint); flex-shrink: 0;
  min-width: 20px; text-align: right;
}

.folder-actions {
  display: none; flex-shrink: 0; gap: 4px; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
}
.folder-item:hover .folder-actions { display: flex; }

.folder-rename-btn, .folder-del-btn {
  background: none; border: none; color: var(--faint); cursor: pointer; font-size: 12px;
  padding: 2px 4px; transition: color .12s;
}
.folder-rename-btn:hover { color: var(--info); }
.folder-del-btn:hover { color: var(--reject); }

.folder-item.is-subfolder { padding-left: 24px; }

/* folder add/rename dialog */
.folder-dlg-input {
  width: 100%; padding: 8px; font-size: 13px; border: 1px solid var(--app-line);
  border-radius: 4px; background: var(--app-surface); color: var(--text); font-family: inherit;
}
.folder-dlg-input:focus { outline: none; border-color: var(--info); }
