/* 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-ink); 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-strong); 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: var(--on-accent); }
.rv-select, .rv-input { height: 34px; min-width: 170px; max-width: 220px; border: 1px solid var(--line-strong); 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; flex-wrap: wrap; 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: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.18); cursor: pointer; }
.rv-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
.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-ink); }
.rv-prose .rv-updated { color: var(--muted); font-size: 12px; }
.rv-prose .rv-version { color: var(--muted); font-size: 12.5px; margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); }
.rv-prose .rv-version strong { color: var(--fg-2); }
.rv-prose .rv-version code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; color: var(--fg-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }

/* 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; }

/* one-click looks: each tile is a small start page in that look (shared/look-preview.js) */
.rv-looks { display: flex; flex-direction: column; gap: 18px; }
.rv-looks-h { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; }
.rv-bundles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.rv-bundle-wrap { position: relative; }
.rv-bundle { position: relative; display: flex; flex-direction: column; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); color: var(--fg); padding: 0; text-align: left; transition: border-color 0.12s ease, transform 0.12s ease; }
.rv-bundle:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.rv-bundle.active { border-color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent-ink); }
.rv-bundle-cap { display: flex; align-items: center; gap: 8px; padding: 7px 9px; font-size: 12px; font-weight: 600; border-top: 1px solid var(--line); }
.rv-bundle-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-bundle-accent { flex: none; width: 12px; height: 12px; border-radius: 3px; box-shadow: 0 0 0 1px var(--line-strong); }
.rv-bundle-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; display: none; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-ink); color: var(--bg); box-shadow: 0 0 0 2px var(--surface); }
.rv-bundle-check svg { width: 12px; height: 12px; }
.rv-bundle.active .rv-bundle-check { display: flex; }
/* 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; left: 5px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.6); 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; }
@media (hover: none), (any-pointer: coarse) { .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%; height: 100%; min-height: 96px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--muted-2); font-size: 12px; 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); }
.rv-bundle-wrap:has(.rv-bundle-shuffle) { display: flex; }
.rv-looks-more { display: none; margin-top: 10px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: transparent; color: var(--fg-2); font: inherit; font-size: 13px; }
.rv-looks-more:hover { border-color: var(--accent-2); color: var(--fg); }
@media (max-width: 599px) {
	.rv-bundles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.rv-looks-collapsible:not(.open) .rv-bundle-wrap:nth-child(n + 5) { display: none; }
	.rv-looks-more { display: inline-flex; align-items: center; }
}

/* 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: var(--on-accent); 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; }

/* school bell: active-day chips */
.rv-days { display: flex; gap: 6px; flex-wrap: wrap; }
.rv-day { width: 32px; height: 32px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); color: var(--muted-2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease; }
.rv-day:hover { border-color: var(--accent-2); color: var(--fg-2); }
.rv-day[data-on="1"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* school bell: schedule editor + music: playlist */
.rv-sched, .rv-tracks { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.rv-sched-list, .rv-tracks-list { display: flex; flex-direction: column; gap: 8px; }
.rv-sched-empty { color: var(--muted); font-size: 13px; padding: 4px 2px; }
.rv-sched-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-sched-row .rv-sched-time { min-width: 0; width: 130px; flex: none; }
.rv-sched-row .rv-sched-label { min-width: 120px; flex: 1 1 160px; max-width: none; }
.rv-sched-del { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.rv-sched-del:hover { color: var(--danger); border-color: var(--danger); }
.rv-sched-add { align-self: flex-start; }
.rv-track-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.rv-track-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; 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; }
}

/* Account section */
.rv-account { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; }
.rv-account-note { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0; }
.rv-account-who { display: flex; align-items: center; gap: 12px; }
.rv-account-av { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 18px; display: flex; align-items: center; justify-content: center; flex: none; }
.rv-account-meta { display: flex; flex-direction: column; }
.rv-account-name { font-size: 15px; font-weight: 600; color: var(--fg); }
.rv-account-email { font-size: 12.5px; color: var(--muted); }
.rv-account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.rv-account-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--surface-2); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; font-size: 13.5px; z-index: 60; box-shadow: 0 6px 20px rgba(0,0,0,0.4); }

.rv-select:focus-visible, .rv-input:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }

/* Narrow screens: control groups (colour swatches) wrap instead of running off the edge. */
@media (max-width: 560px) { .rv-row-control { max-width: 100%; flex-wrap: wrap; min-width: 0; } }
.rv-set-jump { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 18px; }
.rv-set-jump a { display: inline-flex; align-items: center; min-height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius-pill, 14px); color: var(--fg-2); font-size: 12.5px; text-decoration: none; background: var(--surface); }
.rv-set-jump a:hover { border-color: var(--accent-2); color: var(--fg); }

/* privacy card (Settings, Privacy & data) */
.rv-privcard { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.rv-privcard-title { margin: 0; color: var(--fg); font-size: 14px; font-weight: 600; }
.rv-privcard-list { margin: 8px 0 8px; padding-left: 18px; color: var(--fg-2); font-size: 13px; line-height: 1.5; }
.rv-privcard-list li + li { margin-top: 3px; }
.rv-privcard-link { color: var(--accent-ink); font-size: 13px; }

/* trust strip on /privacy (base styles in theme.css) */
.rv-prose .rv-trust { margin: 4px 0 18px; text-align: left; font-size: 12.5px; }
.rv-prose .rv-trust a { color: var(--muted-2); }
.rv-prose table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 13px; line-height: 1.45; }
.rv-prose th, .rv-prose td { text-align: left; vertical-align: top; padding: 8px 10px; border-top: 1px solid var(--line); }
.rv-prose th { color: var(--fg); font-weight: 600; background: var(--surface); }
.rv-prose .rv-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rv-prose .rv-part { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }
.rv-prose h3 { color: var(--fg); font-size: 15px; margin: 20px 0 6px; }
@media (max-width: 640px) {
	.rv-prose table, .rv-prose tbody, .rv-prose tr, .rv-prose td { display: block; width: 100%; }
	.rv-prose thead { display: none; }
	.rv-prose tr { border-top: 1px solid var(--line); padding: 8px 0; }
	.rv-prose td { border: 0; padding: 3px 0; }
	.rv-prose td::before { content: attr(data-l) ": "; color: var(--fg); font-weight: 600; }
	.rv-prose td:first-child { color: var(--fg); font-weight: 600; }
	.rv-prose td:first-child::before { content: none; }
}

/* Account: ways to sign in, recent sign-ins, delete */
.rv-ways { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.rv-ways-h { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: var(--fg); }
.rv-ways-list { display: flex; flex-direction: column; gap: 6px; }
.rv-ways-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.rv-way { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.rv-way-text { flex: 1 1 180px; min-width: 0; }
.rv-way-name { font-size: 14px; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.rv-way-detail { font-size: 12.5px; color: var(--muted); }
.rv-way-acts { display: flex; gap: 6px; }
.rv-way-ev { padding: 6px 12px; }
.rv-way-confirm { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; }
.rv-way-check { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--fg-2); }
.rv-ways-nudge { color: var(--fg-2); }
