/* Photo Re-styler (boards RestyleMain, RestyleBatch). Names use .rs-*; colours come from the app's tokens. */

.restyle-page { padding: 12px 16px 16px; min-height: calc(100vh - 64px); box-sizing: border-box; }
.restyle-page[hidden] { display: none; }
.rs-app { display: flex; flex-direction: column; gap: 10px; color: var(--text); font-family: var(--font-ui, system-ui, sans-serif); }
.rs-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rs-title { margin: 0; font-size: 20px; font-weight: 700; }
.rs-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.rs-modes { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); }
.rs-mode { padding: 6px 14px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.rs-mode[aria-selected="true"] { background: var(--surface-1); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.rs-body { display: grid; grid-template-columns: 270px minmax(0, 1fr) 320px; gap: 10px; align-items: start; }
.rs-left, .rs-right { display: flex; flex-direction: column; gap: 10px; }
.rs-card { padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-1); }
.rs-h2 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.rs-h3 { margin: 12px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.rs-hint { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.rs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rs-row { display: flex; align-items: center; gap: 8px; }
.rs-wrap { flex-wrap: wrap; }
.rs-between { justify-content: space-between; }
.rs-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.rs-btn:hover { border-color: var(--border-strong); }
.rs-btn:disabled { opacity: .5; cursor: default; }
.rs-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); font-weight: 600; }
.rs-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; }
.rs-input { padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-4, var(--surface-2)); color: var(--text); font: inherit; font-size: 13px; }

/* photos */
.rs-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 18px 10px; border: 1.5px dashed var(--border-strong, var(--border)); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; text-align: center; }
.rs-drop strong { font-size: 14px; }
.rs-drop span { font-size: 12px; color: var(--muted); }
.rs-dragging .rs-drop { border-color: var(--accent); background: var(--accent-soft-bg); }
.rs-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 260px; overflow: auto; }
.rs-item { display: grid; grid-template-columns: 44px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 4px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.rs-item[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft-bg); }
.rs-item img { grid-row: 1 / 3; width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.rs-item-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-item .rs-hint { margin: 0; font-size: 11px; }
.rs-x { grid-row: 1 / 3; grid-column: 3; border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.rs-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.rs-thumb { padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); cursor: pointer; aspect-ratio: 1; overflow: hidden; }
.rs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-thumbs > p { grid-column: 1 / -1; }

/* compare */
.rs-compare { display: flex; flex-direction: column; gap: 8px; }
.rs-stage-wrap { position: relative; display: flex; align-items: center; justify-content: center; min-height: 420px; border-radius: 12px; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface-1) 0 50%) 0 0 / 20px 20px; overflow: hidden; }
.rs-stage { position: relative; display: inline-block; max-width: 100%; touch-action: none; cursor: ew-resize; user-select: none; }
.rs-stage[hidden] { display: none; }
.rs-stage canvas { display: block; max-width: 100%; max-height: 70vh; height: auto; }
.rs-before { position: absolute; inset: 0; width: 100%; height: 100%; }
.rs-handle { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.rs-knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #333; font-size: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.rs-tag { position: absolute; top: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; pointer-events: none; }
.rs-tag-before { left: 8px; } .rs-tag-after { right: 8px; }
.rs-empty { text-align: center; color: var(--muted); }
.rs-empty[hidden] { display: none; }
.rs-split { flex: 1; }
.rs-chip { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft-bg); font-size: 12px; white-space: nowrap; }
.rs-chip:empty { display: none; }

/* styles */
.rs-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rs-style { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.rs-style strong { font-size: 13px; }
.rs-style .rs-hint { margin: 0; font-size: 11px; }
.rs-style[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rs-style.is-locked { opacity: .6; cursor: not-allowed; }
.rs-badge { position: absolute; top: 6px; inset-inline-end: 6px; padding: 1px 7px; border-radius: 999px; background: var(--surface-inset, #E6E1D6); font-size: 10.5px; font-weight: 600; }
.rs-swatch { width: 100%; height: 30px; border-radius: 7px; margin-bottom: 4px; }
.rs-swatch-vector { background: linear-gradient(135deg, #2F8F83 0 33%, #E8A23A 33% 66%, #2B2A33 66%); }
.rs-swatch-illustration { background: linear-gradient(90deg, #F2D27A, #C9563C 50%, #5B3A1E); }
.rs-swatch-cartoon { background: repeating-linear-gradient(90deg, #E8A23A 0 14px, #2B2A33 14px 16px); }
.rs-swatch-pixel { background: conic-gradient(#41A6F6 25%, #EF7D57 0 50%, #38B764 0 75%, #FFCD75 0) 0 0 / 15px 15px; }
.rs-swatch-3d { background: radial-gradient(circle at 35% 35%, #fff, #9aa0a6 60%, #5f6368); }

/* options */
.rs-options { display: flex; flex-direction: column; gap: 10px; }
.rs-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.rs-label { font-size: 12.5px; }
.rs-ar { margin: 0 6px; font-size: 11.5px; color: var(--muted); }
.rs-out { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rs-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.rs-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.rs-seg button { padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.rs-seg button[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft-bg); font-weight: 600; }
.rs-seg button:disabled { opacity: .5; cursor: not-allowed; }
.rs-color { margin-top: 8px; font-size: 12.5px; }
.rs-color[hidden] { display: none; }
.rs-color input { width: 32px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; }
.rs-name { font-size: 12px; overflow-wrap: anywhere; }
input[type="range"]:disabled { opacity: .4; }

/* batch + video */
.rs-batch, .rs-video { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 10px; align-items: start; }
.rs-batch[hidden], .rs-video[hidden], .rs-body[hidden] { display: none; }
.rs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rs-tile { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 12px; }
.rs-tile img, .rs-tile canvas { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface-1); border-radius: 6px; }
.rs-tile .rs-hint { margin: 0; }
.rs-bar { height: 6px; border-radius: 999px; background: var(--surface-inset, #E6E1D6); overflow: hidden; }
.rs-bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.rs-video-stage { display: flex; align-items: center; justify-content: center; min-height: 320px; border-radius: 12px; background: #111; overflow: hidden; }
.rs-video-stage video, .rs-video-stage canvas { max-width: 100%; max-height: 60vh; }

@media (max-width: 1200px) { .rs-body { grid-template-columns: 240px minmax(0, 1fr); } .rs-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }
@media (max-width: 760px) { .rs-body, .rs-batch, .rs-video { grid-template-columns: 1fr; } }

/* Home card icon: the same tinted tile as the other tools. */
.home-card-icon-restyle { border-radius: var(--radius-lg); background: var(--danger-soft); color: var(--danger); }
.home-card-icon-restyle svg { width: 28px; height: 28px; }
