/* Re:Vault — settings & policy pages. Inherits tokens from theme.css. */
html, body.rv-page { height: auto; overflow: auto; background: var(--bg); }
body.rv-page { display: flex; flex-direction: column; min-height: 100vh; color: var(--fg-2); }

.rv-page-head { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.rv-page-brand { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; text-decoration: none; }
.rv-page-brand svg { width: 22px; height: 22px; }
.rv-page-title { font-size: 16px; color: var(--muted-2); font-weight: 500; }
.rv-page-foot { padding: 20px 22px 40px; color: var(--muted); font-size: 12px; }
.rv-page-foot a { color: var(--muted-2); }

.rv-set { width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 22px 60px; }
.rv-section { margin-top: 28px; }
.rv-section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent); margin-bottom: 8px; padding-left: 2px; }
.rv-section-body { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.rv-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.rv-row:first-child { border-top: 0; }
/* labeled sub-group divider inside a section body */
.rv-group { padding: 13px 16px 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); border-top: 1px solid var(--line); }
.rv-group:first-child { border-top: 0; }
.rv-group + .rv-row { border-top: 0; }
.rv-row-text { flex: 1; min-width: 0; }
.rv-row-label { color: var(--fg); font-size: 14px; }
.rv-row-desc { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.rv-row-control { flex: none; display: flex; align-items: center; gap: 8px; }

/* controls */
.rv-switch { width: 42px; height: 24px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface-2); position: relative; transition: background 0.15s, border-color 0.15s; }
.rv-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted-2); transition: transform 0.15s, background 0.15s; }
.rv-switch[data-on="1"] { background: var(--accent); border-color: var(--accent); }
.rv-switch[data-on="1"]::after { transform: translateX(18px); background: #1a1500; }
.rv-select, .rv-input { height: 34px; min-width: 170px; max-width: 220px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: var(--radius); padding: 0 10px; font: inherit; font-size: 13px; outline: none; }
.rv-input { user-select: text; -webkit-user-select: text; }
.rv-select:focus, .rv-input:focus { border-color: var(--accent); }
.rv-color { display: flex; align-items: center; gap: 6px; }
.rv-color input[type="color"] { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: none; cursor: pointer; }
.rv-swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.18); cursor: pointer; }
.rv-locked { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* prose (policy pages) */
.rv-prose { width: 100%; max-width: 720px; margin: 0 auto; padding: 16px 22px 64px; color: var(--fg-2); line-height: 1.65; }
.rv-prose h1 { color: var(--fg); font-size: 26px; margin: 18px 0 8px; }
.rv-prose h2 { color: var(--fg); font-size: 18px; margin: 26px 0 8px; }
.rv-prose p, .rv-prose li { font-size: 14px; }
.rv-prose ul { padding-left: 22px; margin: 8px 0; }
.rv-prose a { color: var(--accent); }
.rv-prose .rv-updated { color: var(--muted); font-size: 12px; }

/* range slider with live value readout */
.rv-range { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.rv-range input[type="range"] { flex: 1; accent-color: var(--accent); height: 22px; cursor: pointer; }
.rv-range-val { flex: none; min-width: 42px; text-align: right; color: var(--fg-2); font-size: 12px; font-variant-numeric: tabular-nums; }

/* bundles (one-click looks) */
.rv-bundles { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.rv-bundle-wrap { position: relative; }
.rv-bundle { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background-size: cover; background-position: center; color: #fff; padding: 0; transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease; }
.rv-bundle:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.rv-bundle.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.rv-bundle-accent { position: absolute; top: 7px; left: 7px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.85); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.rv-bundle-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 8px; font-size: 11px; font-weight: 600; text-align: left; background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0)); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
/* delete is a real, focusable sibling button — hidden (and click-through) until the
   tile is hovered or focused, so it's never an invisible touch hotspot */
.rv-bundle-del { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.55); color: #fff; opacity: 0; pointer-events: none; transition: opacity 0.12s ease, background 0.12s ease; }
.rv-bundle-del svg { width: 12px; height: 12px; }
.rv-bundle-wrap:hover .rv-bundle-del, .rv-bundle-wrap:focus-within .rv-bundle-del { opacity: 1; pointer-events: auto; }
.rv-bundle-del:hover, .rv-bundle-del:focus-visible { background: var(--danger); }
/* shuffle tile — a dashed action tile (not a .rv-bundle, so it's skipped by active-sync) */
.rv-bundle-shuffle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; aspect-ratio: 4 / 3; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--muted-2); font-size: 11px; font-weight: 600; transition: border-color 0.12s ease, transform 0.12s ease, color 0.12s ease; }
.rv-bundle-shuffle svg { width: 22px; height: 22px; }
.rv-bundle-shuffle:hover { border-color: var(--accent-2); color: var(--fg-2); transform: translateY(-2px); }

/* wallpaper picker */
.rv-row-block { flex-direction: column; align-items: stretch; gap: 12px; }
.rv-walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.rv-wall { position: relative; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background-color: var(--surface-2); background-size: cover; background-position: center; color: var(--fg); padding: 0; transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease; }
.rv-wall:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.rv-wall.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.rv-wall.none { background-image: repeating-linear-gradient(45deg, var(--surface) 0 8px, var(--surface-2) 8px 16px); }
.rv-wall.action { display: flex; align-items: center; justify-content: center; }
.rv-wall-cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 5px; padding: 5px 8px; font-size: 11px; color: #fff; background: linear-gradient(to top, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0)); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.rv-wall.action .rv-wall-cap, .rv-wall.none .rv-wall-cap { position: static; justify-content: center; flex-direction: column; gap: 6px; padding: 0; background: none; color: var(--muted-2); text-shadow: none; width: 100%; height: 100%; }
.rv-wall-cap svg { width: 15px; height: 15px; flex: none; }
.rv-wall.action .rv-wall-cap svg, .rv-wall.none .rv-wall-cap svg { width: 22px; height: 22px; }
.rv-wall-check { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: var(--accent); color: #1a1500; opacity: 0; transform: scale(0.6); transition: opacity 0.12s ease, transform 0.12s ease; }
.rv-wall.active .rv-wall-check { opacity: 1; transform: scale(1); }

/* multi-toggle (start-shortcut visibility) */
.rv-multi { display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 8px 18px; }
.rv-multi-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rv-multi-item span { color: var(--fg-2); font-size: 13px; }

/* help page: keyboard shortcuts */
kbd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--radius-sm); padding: 1px 6px; color: var(--fg); }
.rv-help-note { color: var(--muted); font-size: 12px; font-style: italic; margin: 6px 0; }
.rv-keys { width: 100%; border-collapse: collapse; margin: 10px 0 18px; }
.rv-keys td { padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
.rv-keys td:first-child { white-space: nowrap; width: 1%; }
.rv-keys td:last-child { color: var(--fg-2); }
.rv-prose h3 { color: var(--fg); font-size: 15px; margin: 18px 0 6px; }

@media (max-width: 560px) {
	.rv-row { flex-direction: column; align-items: stretch; gap: 10px; }
	.rv-row-control { justify-content: flex-start; }
	.rv-select, .rv-input { max-width: none; width: 100%; }
	.rv-multi { grid-template-columns: 1fr; }
}
