/* RedactSnap workspace styles (built on .yc-* UI kit in ../styles.css) */

@media (min-width: 1080px) {
  .container:has(#redactsnap-app) {
    max-width: 1120px;
  }
}

.rs-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.rs-file-row[hidden],
.rs-split[hidden] {
  display: none;
}

.rs-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.rs-file-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.rs-file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.rs-file-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.rs-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
  align-items: start;
  gap: 18px;
}

.rs-stage {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f4f4f5;
  overflow: hidden;
  min-width: 0;
}

.rs-stage-head,
.rs-stage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: var(--card);
}

.rs-stage-head {
  border-bottom: 1px solid var(--border);
}

.rs-stage-foot {
  border-top: 1px solid var(--border);
}

.rs-page-nav,
.rs-stage-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.rs-page-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  padding: 0 4px;
}

.rs-page-meta,
.rs-status {
  font-size: 12px;
  color: var(--muted);
}

.rs-status[data-tone="ok"] {
  color: var(--emerald-fg);
  font-weight: 600;
}

.rs-status[data-tone="error"] {
  color: #991b1b;
  font-weight: 600;
}

.rs-canvas-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 280px;
  background: #e4e4e7;
  overflow: hidden;
  touch-action: pan-y;
  cursor: crosshair;
  line-height: 0;
}

.rs-canvas-wrap.is-ready {
  min-height: 0;
}

.rs-canvas-wrap .rs-loader {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  line-height: 1.45;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: #fafafa;
}

.rs-canvas-wrap .rs-loader[hidden] {
  display: none;
}

.rs-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

.rs-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.rs-layer-masks,
.rs-layer-words {
  pointer-events: none;
}

.rs-mask {
  position: absolute;
  display: block;
}

.rs-word {
  position: absolute;
  display: block;
  pointer-events: auto;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.rs-word:hover,
.rs-word:focus-visible {
  background: rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 0 1px var(--emerald) inset;
  outline: none;
}

.rs-word.is-picked {
  background: rgba(9, 9, 11, 0.14);
  box-shadow: 0 0 0 1px var(--text) inset;
}

.rs-marquee {
  position: absolute;
  pointer-events: none;
  border: 1.5px dashed var(--emerald);
  background: rgba(16, 185, 129, 0.16);
}

.rs-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.rs-panel-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 14px;
}

.rs-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.rs-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.rs-field:first-child {
  margin-top: 0;
}

.rs-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.rs-options-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.rs-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.rs-color-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid #d4d4d8;
  cursor: pointer;
  padding: 0;
}

.rs-color-dot.is-active {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--text);
  border-color: var(--text);
}

.rs-detector-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rs-more-rules {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.rs-more-rules summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.rs-more-rules summary:hover {
  color: var(--text);
}

.rs-inline {
  display: flex;
  gap: 6px;
}

.rs-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  background: #ffffff;
  color: var(--text);
}

.rs-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.rs-chip-rem {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f4f4f5;
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text);
}

.rs-chip-rem button {
  border: 0;
  background: none;
  padding: 0 2px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}

.rs-check {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  cursor: pointer;
}

.rs-check input {
  margin-top: 2px;
  accent-color: var(--text);
}

.rs-group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rs-group-item {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
  background: #fafafa;
}

.rs-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rs-group-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.rs-masked-list {
  list-style: none;
  margin: 5px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rs-masked-list li {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.rs-empty,
.rs-gate-note,
.rs-progress {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.rs-gate {
  margin-top: 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rs-burn-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rs-burn-bar .yc-btn {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
}

.rs-result {
  border-color: #a7f3d0;
  background: var(--emerald-bg);
}

.rs-leak-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  border-radius: 8px;
  background: var(--emerald-fg);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.rs-leak-badge.is-bad {
  background: #991b1b;
}

.rs-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.rs-badge-list li {
  padding: 3px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #a7f3d0;
  color: var(--emerald-fg);
  font-size: 11.5px;
  font-weight: 600;
}

.rs-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.rs-compare figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.rs-compare figcaption {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}

.rs-compare img {
  display: block;
  width: 100%;
  height: auto;
}

.rs-result-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rs-pro-list {
  margin: 10px 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}

.rs-modal-note {
  font-size: 12.5px;
  color: var(--emerald-fg);
  background: var(--emerald-bg);
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
}

.rs-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.rs-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rs-faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 15px 18px;
}

.rs-faq-item h3 {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 600;
}

.rs-faq-item p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.rs-related {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rs-related a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 12.5px;
  color: var(--muted);
}

.rs-related a:hover {
  border-color: #a1a1aa;
  color: var(--text);
}

@media (max-width: 920px) {
  .rs-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .yc-workspace {
    padding: 14px;
  }
  .rs-options-row {
    grid-template-columns: 1fr;
  }
  .rs-compare {
    grid-template-columns: 1fr;
  }
}
