/* =====================================================================
   Grid control panel - resident pages (sign-in, dashboard, avatars, security).
   Built on the VWS design system: tokens only, so every brand (theme.css)
   and both themes follow automatically. No inline styles anywhere (CSP).
   ===================================================================== */

body.resident {
  background:
    radial-gradient(1100px 520px at 12% -8%, var(--bg-glow-1), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, var(--bg-glow-2), transparent 60%),
    var(--bg);
}
.field-label { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-2); }
.rp-meta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--text-3); }
p.rp-meta { display: block; }

/* ---------- colour tones (stable per avatar / group, no inline styles) - */
.tone-0 { --tone-a: #6a8dff; --tone-b: #a855f7; }
.tone-1 { --tone-a: #22d3ee; --tone-b: #3b82f6; }
.tone-2 { --tone-a: #f472b6; --tone-b: #8b5cf6; }
.tone-3 { --tone-a: #34d399; --tone-b: #0ea5e9; }
.tone-4 { --tone-a: #fbbf24; --tone-b: #f97316; }
.tone-5 { --tone-a: #a78bfa; --tone-b: #ec4899; }
.tone-6 { --tone-a: #60a5fa; --tone-b: #14b8a6; }
.tone-7 { --tone-a: #fb7185; --tone-b: #f59e0b; }

/* ---------- shell --------------------------------------------------- */
.rp-app { --sidebar-w: 236px; --topbar-h: 64px; }
.rp-brand {
  grid-area: brand; display: flex; align-items: center; gap: 10px; padding: 0 16px; margin: 10px 10px 0;
  border-radius: var(--radius-lg); color: #fff; text-decoration: none;
  background: linear-gradient(135deg, color-mix(in oklab, var(--brand-ink, #0b1b4d) 92%, var(--accent)) 0%, color-mix(in oklab, var(--brand-ink, #0b1b4d) 70%, var(--accent)) 100%);
  box-shadow: var(--shadow-2);
}
.rp-brand:hover { text-decoration: none; }
.rp-mark { width: 42px; height: 42px; flex: none; object-fit: contain; }
.rp-logo { max-height: 40px; max-width: 100%; }
.rp-wordmark { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.rp-wordmark strong { font-family: var(--font-display, var(--font-sans)); font-size: 1.05rem; letter-spacing: .08em; font-weight: var(--fw-bold); white-space: nowrap; }
.rp-wordmark span { font-family: var(--font-display, var(--font-sans)); font-size: 0.7rem; font-weight: var(--fw-bold); letter-spacing: .34em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.rp-brand .rp-wordmark span { color: color-mix(in oklab, var(--accent) 80%, white); }

.rp-top { background: color-mix(in oklab, var(--bg) 82%, transparent); border-bottom: 0; gap: var(--sp-2); padding: 0 var(--sp-6); }
.rp-search {
  display: flex; align-items: center; gap: 10px; width: min(380px, 42vw); height: 40px; padding: 0 14px;
  border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface-1);
  color: var(--text-3); font: inherit; font-size: var(--fs-sm); cursor: text; box-shadow: var(--shadow-1);
}
.rp-search:hover { border-color: color-mix(in oklab, var(--accent) 45%, var(--border-strong)); }
.rp-search .kbd { margin-left: auto; }
.rp-topicon { width: 38px; height: 38px; color: var(--text-2); position: relative; }
.rp-topicon .icon { width: 20px; height: 20px; }

/* light / dark switch */
.rp-theme {
  position: relative; display: inline-flex; align-items: center; justify-content: space-between;
  width: 58px; height: 28px; padding: 0 7px; margin: 0 6px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--surface-2); cursor: pointer; color: var(--text-3);
}
.rp-theme-knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 2px 8px color-mix(in oklab, var(--accent) 45%, transparent);
  transition: transform var(--dur) var(--ease);
}
.rp-theme .icon { position: relative; z-index: 1; width: 12px; height: 12px; }
/* The knob sits on the theme in use: the sun (right) when light, the moon (left) when dark.
   Clicking the moon picks dark, the sun picks light (resident.js). */
.rp-theme-knob { transform: translateX(30px); }
.rp-theme-sun { color: #fff; }
:root[data-theme="dark"] .rp-theme-knob { transform: none; }
:root[data-theme="dark"] .rp-theme-moon { color: #fff; }
:root[data-theme="dark"] .rp-theme-sun { color: var(--text-3); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .rp-theme-knob { transform: none; }
  :root:not([data-theme]) .rp-theme-moon { color: #fff; }
  :root:not([data-theme]) .rp-theme-sun { color: var(--text-3); }
}

/* signed-in avatar chip */
.rp-me {
  display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; margin-left: 4px;
  border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-1);
  font: inherit; color: var(--text); cursor: pointer; box-shadow: var(--shadow-1);
}
.rp-me:hover { border-color: var(--border-strong); }
.rp-me-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.rp-me-text strong { font-size: var(--fs-sm); }
.rp-me-text span { font-size: var(--fs-2xs); color: var(--text-3); }
.rp-me-text span.on { color: var(--ok); }

.rp-face {
  position: relative; flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(140deg, var(--tone-a), var(--tone-b)); color: #fff;
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .03em;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}
.rp-face.sm { width: 24px; height: 24px; font-size: 9px; }
.rp-face.rp-group { border-radius: var(--radius-md); }
.rp-face .icon { color: #fff; }
/* Profile picture over the initials (helpers face() / portrait()); the online dot stays on top */
.rp-face > img[data-face] { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.rp-portrait > img[data-face] { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.rp-dot { position: absolute; z-index: 1; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--stale); border: 2px solid var(--surface-1); }
.rp-dot.on { background: var(--ok); }

.rp-menu { min-width: 260px; }
.rp-menu form { margin: 0; }
.rp-menu .rp-check { margin-left: auto; color: var(--accent-text); }

/* sidebar */
.rp-side { background: transparent; border-right: 0; padding: var(--sp-4) var(--sp-3); gap: 2px; }
.rp-side .nav-item { grid-template-columns: 22px 1fr auto; padding: 9px 12px; font-size: var(--fs-md); color: var(--text-2); }
.rp-side .nav-item .icon { width: 19px; height: 19px; }
.rp-side .nav-item[aria-current="page"] {
  color: #fff; background: linear-gradient(120deg, var(--accent), color-mix(in oklab, var(--accent) 70%, var(--accent-2)));
  box-shadow: 0 6px 18px color-mix(in oklab, var(--accent) 32%, transparent);
}
.rp-side .nav-item[aria-current="page"]::before { display: none; }
.rp-side .nav-item[aria-current="page"] .icon { color: #fff; }
.rp-sep { height: 1px; margin: var(--sp-3) var(--sp-2); background: var(--border); }
.rp-side-foot { display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-3); padding: var(--sp-4) 0 var(--sp-2); }
.rp-side-art { width: 100%; height: auto; opacity: .9; pointer-events: none; }
.rp-status {
  --c: var(--ok);
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 7px 14px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text);
  background: var(--surface-1); border: 1px solid color-mix(in oklab, var(--c) 35%, var(--border)); box-shadow: var(--shadow-1);
}
.rp-status .icon { color: var(--c); }
.rp-status.warn { --c: var(--warn); } .rp-status.err { --c: var(--err); } .rp-status.stale { --c: var(--stale); }

.rp-main { --main-pt: var(--sp-2); --main-px: var(--sp-6); }
.rp-flash { margin-bottom: var(--sp-4); }

/* ---------- dashboard grid --------------------------------------------- */
.rp-dash {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(12, minmax(0, 1fr)) minmax(240px, 300px);
  grid-auto-flow: row dense;
}
.rp-hero { grid-column: 1 / -1; }
.rp-kpi { grid-column: span 3; }
.rp-tools { grid-column: 13; grid-row: 2 / span 2; }
.rp-avatars, .rp-dest { grid-column: span 6; }
.rp-events, .rp-news, .rp-friends { grid-column: span 4; }
.rp-promo { grid-column: 13; }

.rp-dash > .card { border-radius: var(--radius-xl); box-shadow: var(--shadow-2); }
.rp-card-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-4) var(--sp-4) var(--sp-3); }
.rp-card-head h2 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.rp-card-head h2 .icon { width: 20px; height: 20px; color: var(--accent-text); }
.rp-card-head .chip { margin-left: auto; }
.rp-more { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--accent-text); white-space: nowrap; }

/* hero */
.rp-hero {
  position: relative; overflow: hidden; min-height: 196px; border-radius: var(--radius-xl);
  background: linear-gradient(120deg, var(--brand-ink, #0b1b4d), var(--accent)); box-shadow: var(--shadow-2); isolation: isolate;
}
.rp-hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.rp-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(6, 12, 40, .72) 0%, rgba(6, 12, 40, .45) 34%, rgba(6, 12, 40, 0) 62%);
}
.rp-hero-text { position: relative; padding: var(--sp-6) var(--sp-8); max-width: 640px; color: #fff; }
.rp-eyebrow { color: color-mix(in oklab, var(--accent) 70%, white); font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: .24em; text-transform: uppercase; opacity: .92; }
.rp-hero h1 { font-family: var(--font-display, var(--font-sans)); font-size: clamp(1.75rem, 3.2vw, 2.6rem); line-height: 1.08; font-weight: var(--fw-bold); margin: 6px 0 6px; letter-spacing: -.01em; text-shadow: 0 2px 18px rgba(0, 0, 0, .25); }
.rp-hero p { font-size: var(--fs-md); opacity: .95; }
.rp-hero-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-4); }
.rp-btn-glass, .rp-btn-outline { height: 40px; padding: 0 18px; border-radius: var(--radius-pill); font-size: var(--fs-sm); color: #fff; }
.rp-btn-glass { --btn-bg: color-mix(in oklab, var(--accent) 88%, transparent); --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, .35); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.rp-btn-glass:hover { --btn-bg: var(--accent-hover); }
.rp-btn-outline { --btn-bg: rgba(8, 14, 40, .25); --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, .7); backdrop-filter: blur(6px); }
.rp-btn-outline:hover { --btn-bg: rgba(255, 255, 255, .16); }

/* KPI tiles */
.rp-kpi {
  position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-4);
  color: var(--text); text-decoration: none; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.rp-kpi::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 130px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-softer), transparent); pointer-events: none;
}
.rp-kpi:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-3); }
.rp-kpi-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.rp-kpi-icon .icon { width: 22px; height: 22px; }
.tint-blue { color: var(--accent-text); background: var(--accent-soft); }
.tint-cyan { color: var(--accent-2); background: var(--accent-2-soft); }
.tint-violet { color: #8b5cf6; background: color-mix(in oklab, #8b5cf6 15%, transparent); }
.tint-gold { color: #d97706; background: color-mix(in oklab, #f59e0b 18%, transparent); }
.rp-kpi-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rp-kpi-label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.rp-kpi-value { font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-kpi-link { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--accent-text); }

/* resident tools */
.rp-tool-list { display: flex; flex-direction: column; gap: 8px; padding: 0 var(--sp-4) var(--sp-4); }
.rp-tool-list a {
  display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-medium); text-decoration: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.rp-tool-list a .icon { color: var(--text-2); }
.rp-tool-list a:hover { background: var(--accent-softer); border-color: color-mix(in oklab, var(--accent) 35%, var(--border)); transform: translateX(2px); }
.rp-tool-list a:hover .icon { color: var(--accent-text); }

/* tiles: avatars and destinations */
.rp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); padding: 0 var(--sp-4) var(--sp-4); }
.rp-span { grid-column: 1 / -1; }
.rp-avatar-tile, .rp-dest-tile, .rp-avatar-add {
  position: relative; overflow: hidden; aspect-ratio: 4 / 4.2; border-radius: var(--radius-lg); isolation: isolate;
}
.rp-portrait {
  position: absolute; inset: 0; z-index: -1; display: grid; place-items: center;
  background:
    radial-gradient(60% 50% at 50% 38%, rgba(255, 255, 255, .28), transparent 70%),
    linear-gradient(160deg, var(--tone-a), var(--tone-b));
}
.rp-portrait::before {          /* head-and-shoulders silhouette */
  content: ""; position: absolute; left: 50%; bottom: -6%; width: 78%; aspect-ratio: 1; transform: translateX(-50%);
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .34) 0 19%, transparent 19.5%),
              radial-gradient(ellipse 50% 38% at 50% 92%, rgba(255, 255, 255, .26) 0 99%, transparent 100%);
}
.rp-portrait span { position: relative; margin-bottom: 34%; font-size: 1.9rem; font-weight: var(--fw-bold); color: #fff; letter-spacing: .04em; text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.rp-avatar-tile.is-active { box-shadow: 0 0 0 2px var(--accent), 0 8px 24px color-mix(in oklab, var(--accent) 30%, transparent); }
.rp-tile-foot {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 4px; padding: 26px 10px 10px;
  background: linear-gradient(180deg, transparent, rgba(5, 10, 30, .78)); color: #fff;
}
.rp-tile-foot strong { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-presence { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 2px 8px; border-radius: var(--radius-pill); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); background: color-mix(in oklab, var(--stale) 20%, transparent); color: var(--text-2); }
.rp-tile-foot .rp-presence { background: rgba(255, 255, 255, .92); color: #3b4260; }
.rp-presence i { width: 7px; height: 7px; border-radius: 50%; background: var(--stale); }
.rp-presence.on i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 25%, transparent); }
.rp-presence.on { color: var(--ok); }
.rp-tile-foot .rp-presence.on { color: #047857; }
.rp-tile-gear { position: absolute; right: 8px; bottom: 10px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .16); }
.rp-tile-gear:hover { background: rgba(255, 255, 255, .3); }
.rp-avatar-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: var(--sp-3);
  border: 1.5px dashed var(--border-strong); color: var(--text-2); text-decoration: none; background: var(--surface-2);
}
.rp-avatar-add:hover { border-color: var(--accent); color: var(--accent-text); text-decoration: none; background: var(--accent-softer); }
.rp-avatar-add span { font-size: var(--fs-xs); color: var(--text-3); }

.rp-dest-tile { display: block; background: radial-gradient(circle at 30% 20%, color-mix(in oklab, var(--accent-2) 45%, transparent), transparent 60%), linear-gradient(150deg, color-mix(in oklab, var(--accent) 55%, #1b1d3a), #1b1d3a); color: #fff; text-decoration: none; }
.rp-dest-tile img { width: 100%; height: 100%; object-fit: cover; display: block; color: transparent; transition: transform var(--dur-slow) var(--ease); }
.rp-dest-tile:hover img { transform: scale(1.06); }
.rp-dest-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(5, 10, 30, .75)); }
.rp-dest-blank { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-3); }
.rp-dest-name { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 1; display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.rp-dest-live { position: absolute; top: 8px; left: 8px; z-index: 1; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); background: rgba(5, 10, 30, .6); }
.rp-dest-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* lists: events, news, friends */
.rp-list { list-style: none; margin: 0; padding: 0 var(--sp-4) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.rp-list .empty { padding: var(--sp-6) var(--sp-2); }
.rp-event { display: grid; grid-template-columns: 44px 58px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.rp-date { grid-row: span 2; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 48px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); line-height: 1; }
.rp-date span { font-size: var(--fs-2xs); font-weight: var(--fw-bold); color: var(--accent-text); text-transform: uppercase; letter-spacing: .06em; }
.rp-date strong { font-size: var(--fs-xl); font-weight: var(--fw-bold); margin-top: 3px; }
.rp-thumb { grid-row: span 2; display: grid; place-items: center; width: 58px; height: 44px; border-radius: var(--radius-md); color: rgba(255, 255, 255, .95); object-fit: cover; flex: none; }
.art-0 { background: radial-gradient(circle at 30% 80%, #f0abfc, transparent 55%), linear-gradient(135deg, #4c1d95, #db2777); }
.art-1 { background: radial-gradient(circle at 70% 20%, #fde68a, transparent 50%), linear-gradient(135deg, #0e7490, #6366f1); }
.art-2 { background: radial-gradient(circle at 50% 100%, #67e8f9, transparent 55%), linear-gradient(135deg, #1e3a8a, #7c3aed); }
.rp-event-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rp-event-text strong { font-size: var(--fs-sm); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-time { grid-column: 3; justify-self: start; }
.rp-news-item { display: flex; gap: var(--sp-3); align-items: flex-start; }
.rp-news-item .rp-thumb { width: 64px; height: 50px; }
.rp-news-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: var(--fs-xs); color: var(--text-2); }
.rp-news-text strong { font-size: var(--fs-sm); color: var(--text); }
.rp-news-text > span { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-people li { display: flex; align-items: center; gap: var(--sp-3); }
.rp-person { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; flex: 1; }
.rp-person strong { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rp-people .rp-presence { padding: 0; background: none; }

/* promotion */
.rp-promo {
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: flex-end; min-height: 230px;
  border-radius: var(--radius-xl); background: linear-gradient(160deg, #050b2e, #123a86); box-shadow: var(--shadow-2); color: #fff;
}
.rp-promo-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.rp-promo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(5, 11, 46, 0) 20%, rgba(5, 11, 46, .85) 100%); }
.rp-promo-text { padding: var(--sp-5); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.rp-promo h2 { font-size: 1.6rem; line-height: 1.1; font-weight: var(--fw-bold); }
.rp-promo p { font-size: var(--fs-sm); opacity: .9; margin-bottom: 6px; }

/* ---------- My Avatars page --------------------------------------------- */
.rp-avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); align-items: start; }
.rp-avatar-card { overflow: hidden; border-radius: var(--radius-xl); box-shadow: var(--shadow-2); display: flex; flex-direction: column; }
.rp-avatar-card-top { position: relative; height: 150px; isolation: isolate; }
.rp-avatar-card-top .rp-portrait span { margin-bottom: 18%; }
.rp-acting { position: absolute; top: 10px; left: 10px; background: rgba(255, 255, 255, .9); }
.rp-avatar-card-body { padding: var(--sp-4); display: flex; flex-direction: column; gap: 6px; }
.rp-avatar-card-body h2 { font-size: var(--fs-lg); }
.rp-facts { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 6px 10px; margin: 8px 0 0; font-size: var(--fs-sm); }
.rp-facts dt { color: var(--text-3); }
.rp-facts dd { margin: 0; overflow-wrap: anywhere; }
.rp-avatar-card-foot { margin-top: auto; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); }
.rp-avatar-card-foot form { margin: 0; }
.rp-link-card { padding: var(--sp-5); border-radius: var(--radius-xl); box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: var(--sp-3); border-style: dashed; }
.rp-link-card h2 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-lg); }
.rp-link-card h2 .icon { color: var(--accent-text); width: 20px; height: 20px; }

/* ---------- My Regions page -------------------------------------------- */
.rp-region-stats .chip { height: 26px; padding: 0 10px; font-size: var(--fs-xs); }
.rp-filter { margin-bottom: var(--sp-4); }
.rp-region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--sp-4); align-items: stretch; }
.rp-region { overflow: hidden; border-radius: var(--radius-xl); box-shadow: var(--shadow-2); display: flex; flex-direction: column; }
.rp-region[hidden] { display: none; }
.rp-region-map {
  position: relative; height: 180px; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, color-mix(in oklab, var(--accent-2) 40%, transparent), transparent 60%), linear-gradient(150deg, color-mix(in oklab, var(--accent) 50%, #1b1d3a), #1b1d3a);
}
.rp-region-map::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 10, 30, .35), transparent 35%, transparent 70%, rgba(5, 10, 30, .35)); pointer-events: none; }
.rp-cells { display: grid; width: 100%; }
.rp-cells.rp-whole { width: auto; height: 100%; aspect-ratio: 1; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.rp-cells.rp-whole .rp-cell { width: 100%; height: 100%; }
.rp-cols-1 { grid-template-columns: 1fr; } .rp-cols-2 { grid-template-columns: repeat(2, 1fr); } .rp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.rp-cols-4 { grid-template-columns: repeat(4, 1fr); } .rp-cols-5 { grid-template-columns: repeat(5, 1fr); } .rp-cols-6 { grid-template-columns: repeat(6, 1fr); }
.rp-cols-7 { grid-template-columns: repeat(7, 1fr); } .rp-cols-8 { grid-template-columns: repeat(8, 1fr); }
.rp-cell { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; color: transparent; }
.rp-region-status {
  position: absolute; top: 10px; right: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: var(--radius-pill); font-size: var(--fs-2xs); font-weight: var(--fw-bold); background: rgba(255, 255, 255, .92); color: #4a4541;
}
.rp-region-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--stale); }
.rp-region-status.on { color: #047857; } .rp-region-status.on i { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .25); }
.rp-region .rp-dest-live { top: 10px; left: 10px; color: #fff; }
.rp-region-body { padding: var(--sp-4); display: flex; flex-direction: column; gap: 8px; }
.rp-region-title { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.rp-region-title h2 { font-family: var(--font-display, var(--font-sans)); font-size: var(--fs-xl); margin-right: auto; }
.rp-sub { display: block; font-size: var(--fs-xs); color: var(--text-3); }
.rp-flags { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rp-flags li { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); }
.rp-flags li.on { color: var(--text-2); }
.rp-flags li.on .icon { color: var(--ok); }
.rp-restart { display: flex; gap: 10px; align-items: flex-start; margin-top: 4px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--accent-softer); border: 1px solid color-mix(in oklab, var(--accent) 22%, var(--border)); font-size: var(--fs-xs); color: var(--text-2); }
.rp-restart > .icon { color: var(--accent-text); margin-top: 2px; }
.rp-restart strong { display: block; font-size: var(--fs-sm); color: var(--text); margin-bottom: 2px; }
.rp-foot-note { display: flex; margin-top: var(--sp-4); }

/* ---------- Events & Calendar ------------------------------------------- */
.rp-ev-bar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.rp-seg { display: inline-flex; align-items: center; gap: 6px; height: calc(var(--control-h) - 4px); padding: 0 var(--sp-3); border-radius: var(--radius-sm); color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; text-decoration: none; }
.rp-seg:hover { color: var(--text); text-decoration: none; }
.rp-seg[aria-current="page"] { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-1); }
.rp-seg .count { font-size: var(--fs-2xs); color: var(--accent-text); font-weight: var(--fw-bold); }
.rp-ev-filter { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-left: auto; }
.rp-ev-filter .input-wrap { width: 220px; }
.rp-ev-filter .select { width: auto; min-width: 160px; }
.rp-agenda { border-radius: var(--radius-xl); box-shadow: var(--shadow-2); padding: var(--sp-2) var(--sp-4) var(--sp-4); }
.rp-day { font-size: var(--fs-sm); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--accent-text); margin: var(--sp-4) 0 var(--sp-2); }
.rp-ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rp-ev-row { display: grid; grid-template-columns: 64px 58px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--border); }
.rp-ev-row:first-child { border-top: 0; }
.rp-ev-row.is-live .rp-ev-time strong { color: var(--ok); }
.rp-ev-time { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.rp-ev-time strong { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.rp-ev-time span { font-size: var(--fs-2xs); color: var(--text-3); font-weight: var(--fw-semibold); }
.rp-ev-row .rp-thumb { width: 58px; height: 50px; }
.rp-ev-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: var(--text); text-decoration: none; }
.rp-ev-main:hover { text-decoration: none; }
.rp-ev-main:hover strong { color: var(--accent-text); }
.rp-ev-main strong { font-size: var(--fs-md); }
.rp-ev-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.rp-ev-actions { display: flex; gap: var(--sp-2); align-items: center; }
.rp-ev-actions form { margin: 0; }
.btn.rp-on { --btn-bg: var(--accent-soft); --btn-fg: var(--accent-text); --btn-bd: color-mix(in oklab, var(--accent) 40%, transparent); }
.rp-live { color: var(--ok); font-weight: var(--fw-bold); }
.rp-event-text { color: var(--text); text-decoration: none; }
.rp-event-text:hover strong { color: var(--accent-text); }
.rp-list .empty .btn { margin-top: 4px; }
.rp-flip { transform: rotate(180deg); }

/* month calendar */
.rp-cal { border-radius: var(--radius-xl); box-shadow: var(--shadow-2); overflow: hidden; margin-bottom: var(--sp-4); }
.rp-cal-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.rp-cal-head h2 { font-family: var(--font-display, var(--font-sans)); font-size: var(--fs-xl); min-width: 190px; text-align: center; }
.rp-cal-today { margin-left: auto; }
.rp-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.rp-cal-dow { padding: 8px; font-size: var(--fs-2xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-3); text-align: center; border-bottom: 1px solid var(--border); }
.rp-cal-day { min-height: 112px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rp-cal-day:nth-child(7n) { border-right: 0; }
.rp-cal-day.is-out { background: color-mix(in oklab, var(--surface-2) 55%, transparent); }
.rp-cal-day.is-out .rp-cal-num { color: var(--text-3); }
.rp-cal-num { font-size: var(--fs-xs); font-weight: var(--fw-semibold); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.rp-cal-day.is-today .rp-cal-num { background: var(--accent); color: var(--on-accent); }
.rp-cal-ev { display: block; padding: 2px 6px; border-radius: var(--radius-xs); font-size: var(--fs-2xs); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.rp-cal-ev:hover { text-decoration: none; filter: brightness(1.1); }
.rp-cal-more { font-size: var(--fs-2xs); color: var(--text-3); padding-left: 4px; }

/* event details */
.rp-event-page { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.rp-event-hero, .rp-event-info { border-radius: var(--radius-xl); box-shadow: var(--shadow-2); overflow: hidden; }
.rp-event-art { position: relative; height: 220px; display: grid; place-items: center; isolation: isolate; }
.rp-event-map { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; opacity: .4; color: transparent; }
.rp-event-badge { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 24px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); color: #fff; backdrop-filter: blur(6px); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.rp-event-badge .icon { width: 40px; height: 40px; }
.rp-event-art .rp-region-status { top: 12px; right: 12px; }
.rp-event-when { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5) 0; }
.rp-event-when > div { display: flex; flex-direction: column; gap: 2px; }
.rp-event-when strong { font-size: var(--fs-lg); }
.rp-event-when span { color: var(--text-2); font-size: var(--fs-sm); }
.rp-date.big { width: 60px; height: 64px; }
.rp-date.big strong { font-size: 1.7rem; }
.rp-event-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.rp-event-actions form { margin: 0; }
.rp-event-note { display: flex; gap: 6px; padding: 0 var(--sp-5) var(--sp-5); margin-top: calc(-1 * var(--sp-2)); }
.rp-desc { overflow-wrap: anywhere; line-height: var(--lh-normal); }
.rp-host { display: flex; align-items: center; gap: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.page-head .actions form { margin: 0; }

/* event form */
.rp-event-form { display: flex; flex-direction: column; gap: var(--sp-4); max-width: 860px; }
.rp-event-form > .card { border-radius: var(--radius-xl); box-shadow: var(--shadow-2); }
.rp-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-3); }
.rp-narrow { max-width: 260px; }
.rp-spot { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rp-spot[disabled] { opacity: .5; }
.rp-event-form .textarea { font-size: var(--fs-md); }
.rp-form-foot { display: flex; justify-content: flex-end; gap: var(--sp-2); position: sticky; bottom: 0; padding: var(--sp-3) 0; background: linear-gradient(180deg, transparent, var(--bg) 35%); }

@media (max-width: 1100px) { .rp-event-page { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .rp-ev-filter { margin-left: 0; width: 100%; }
  .rp-ev-filter .input-wrap { flex: 1 1 160px; width: auto; }
  .rp-cal-day { min-height: 70px; padding: 4px; }
  .rp-cal-ev b { display: none; }
}
@media (max-width: 600px) {
  .rp-ev-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .rp-ev-row .rp-thumb { display: none; }
  .rp-ev-time strong { font-size: var(--fs-lg); }
  .rp-ev-actions { flex-direction: column; }
  .rp-cal-day { min-height: 46px; align-items: center; }
  .rp-cal-ev, .rp-cal-more { display: none; }
  .rp-cal-day.has-events .rp-cal-num::after { content: ""; display: block; width: 5px; height: 5px; margin: 1px auto 0; border-radius: 50%; background: var(--accent); }
  .rp-cal-day.has-events .rp-cal-num { height: 30px; align-content: center; }
  .rp-cal-head h2 { min-width: 0; font-size: var(--fs-lg); }
  .rp-event-art { height: 160px; }
  .rp-event-actions .btn { flex: 1 1 auto; }
}

/* ---------- Security page ----------------------------------------------- */
.rp-sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--sp-4); align-items: start; }
.rp-sec-grid > .card, .rp-codes { border-radius: var(--radius-xl); box-shadow: var(--shadow-2); }
.rp-codes { margin-bottom: var(--sp-4); border-color: color-mix(in oklab, var(--ok) 40%, var(--border)); }
.rp-stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.rp-setup { display: flex; gap: var(--sp-5); align-items: flex-start; flex-wrap: wrap; }
.rp-qr { width: 176px; flex: none; padding: 8px; background: #fff; border-radius: var(--radius-md); border: 1px solid var(--border); }
.rp-qr svg { display: block; width: 100%; height: auto; }
.rp-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); flex: 1 1 220px; }
.rp-key { font-family: var(--font-mono); font-size: var(--fs-sm); padding: 2px 6px; border-radius: var(--radius-xs); background: var(--surface-2); overflow-wrap: anywhere; }
.rp-code-list { columns: 2; margin: var(--sp-3) 0; padding-left: 22px; font-family: var(--font-mono); font-size: var(--fs-md); line-height: 2; }
.rp-sessions li { display: flex; align-items: center; gap: var(--sp-3); }
.rp-sessions .rp-kpi-icon { width: 36px; height: 36px; }

/* ---------- forms ----------------------------------------------------- */
.rp-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.rp-form .input { height: 42px; font-size: var(--fs-md); }
.rp-inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; gap: var(--sp-3); }
.rp-inline .field { flex: 1 1 160px; }
.rp-inline .btn { height: 42px; }
.rp-code { font-family: var(--font-mono); letter-spacing: .18em; }
.rp-pass { position: relative; display: flex; align-items: center; }
.rp-pass .btn { position: absolute; right: 6px; }
.rp-pass .input { padding-right: 44px; }
.rp-wide { width: 100%; }
.rp-soon { border-radius: var(--radius-xl); box-shadow: var(--shadow-2); }

/* ---------- signed-out pages ------------------------------------------------ */
body.rp-auth { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); min-height: 100vh; background: var(--bg); }
.rp-auth-art { position: relative; overflow: hidden; background: linear-gradient(140deg, var(--brand-ink, #0b1b4d), var(--accent)); isolation: isolate; }
.rp-auth-art > img:first-child { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.rp-auth-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(5, 10, 30, .7), rgba(5, 10, 30, 0) 55%); }
.rp-auth-logo { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(70%, 520px); height: auto; filter: drop-shadow(0 10px 40px rgba(0, 0, 0, .5)); }
.rp-auth-art-text { position: absolute; left: var(--sp-10); right: var(--sp-10); bottom: var(--sp-10); color: #fff; display: flex; flex-direction: column; gap: 8px; }
.rp-auth-art-text strong { font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.15; max-width: 520px; }
.rp-auth-main { display: flex; flex-direction: column; justify-content: center; gap: var(--sp-6); padding: var(--sp-10) clamp(var(--sp-6), 5vw, var(--sp-12)); }
.rp-auth-brand { display: flex; align-items: center; gap: 12px; }
.rp-auth-brand .rp-wordmark { color: var(--text); }
.rp-auth-brand .rp-theme { margin-left: auto; }
.rp-auth-card { padding: var(--sp-8); border-radius: var(--radius-xl); box-shadow: var(--shadow-3); display: flex; flex-direction: column; gap: var(--sp-4); max-width: 460px; width: 100%; }
.rp-auth-title { font-size: var(--fs-2xl); font-weight: var(--fw-bold); }
.rp-auth-sub { color: var(--text-2); font-size: var(--fs-sm); margin-top: -8px; }
.rp-auth-note { display: flex; gap: 6px; align-items: center; font-size: var(--fs-xs); color: var(--text-3); }
.rp-auth-foot { font-size: var(--fs-xs); color: var(--text-3); }
.rp-auth-card .btn-lg { height: 46px; }

/* ---------- responsive ---------------------------------------------- */
@media (max-width: 1360px) {
  .rp-dash { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .rp-tools { grid-column: span 12; grid-row: auto; }
  .rp-tool-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rp-promo { grid-column: span 12; min-height: 180px; }
}
@media (max-width: 1100px) {
  .rp-kpi { grid-column: span 6; }
  .rp-avatars, .rp-dest { grid-column: span 12; }
  .rp-events, .rp-news, .rp-friends { grid-column: span 12; }
  .rp-tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-avatar-tile, .rp-dest-tile, .rp-avatar-add { aspect-ratio: 16 / 12; }
}
@media (max-width: 860px) {
  .rp-brand { margin: 0; border-radius: 0; height: 56px; }
  .rp-top { padding: 0 var(--sp-3); }
  .rp-search { width: auto; flex: 1; }
  .rp-search span:not(.kbd) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .rp-side.is-open { background: var(--surface-0); }
  .rp-main { --main-px: var(--sp-3); }
  .rp-hero-text { padding: var(--sp-5); }
  body.rp-auth { grid-template-columns: minmax(0, 1fr); }
  .rp-auth-art { min-height: 180px; }
  .rp-auth-art-text { left: var(--sp-5); right: var(--sp-5); bottom: var(--sp-5); }
  .rp-auth-main { padding: var(--sp-6) var(--sp-4); }
  .rp-auth-card { padding: var(--sp-5); }
}
@media (max-width: 600px) {
  .rp-region-grid { grid-template-columns: minmax(0, 1fr); }
  .rp-region-map { height: 150px; }
  .rp-dash { gap: var(--sp-3); }
  .rp-kpi { grid-column: span 6; flex-direction: column; gap: 8px; padding: var(--sp-3); }
  .rp-kpi-icon { width: 36px; height: 36px; }
  .rp-kpi-value { font-size: 1.35rem; }
  .rp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-tool-list { grid-template-columns: minmax(0, 1fr); }
  .rp-theme { width: 50px; margin: 0 2px; }
  .rp-theme-knob { transform: translateX(22px); }
  .rp-topicon { width: 34px; }
  .rp-search .icon + span { display: none; }
  .rp-search { flex: 0 0 auto; width: 40px; padding: 0; justify-content: center; }
  .rp-me { padding: 2px; border: 0; background: none; box-shadow: none; }
  .rp-hero h1 { font-family: var(--font-display, var(--font-sans)); font-size: 1.6rem; }
  .rp-hero-actions .btn { flex: 1 1 auto; }
  .rp-code-list { columns: 1; }
}

/* ---- staff: Destination Guide (2026-11-25) */
.rp-dest-table .input-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.rp-dest-table input[type="number"] { width: 84px; }
.rp-dest-table input[type="text"] { min-width: 200px; }
.rp-dest-table tr.rp-featured td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.rp-dest-table .muted { font-size: 12px; color: var(--text-3); }
.rp-dest-table .warn { color: var(--warn, #b45309); }
.rp-dest-help { font-size: 12px; margin: 12px 0 0; }

/* My Profile */
.rp-face.lg { width: 56px; height: 56px; font-size: var(--fs-md); flex: none; }
.rp-profile-pic { display: flex; align-items: center; gap: var(--sp-3); }
.rp-checks { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
.rp-checks legend { width: 100%; margin-bottom: var(--sp-2); }
.rp-form .switch { align-items: flex-start; }
.rp-form .switch input { flex: none; margin-top: 2px; }

/* My Regions: restart */
.rp-restart-form { display: inline-flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.rp-restart-form .select { height: 32px; padding-top: 0; padding-bottom: 0; font-size: var(--fs-sm); width: auto; }
.rp-restart-status { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-md); background: var(--surface-2); font-size: var(--fs-sm); }
.rp-restart-status.ok { background: var(--ok-soft, var(--surface-2)); color: var(--ok); }
.rp-restart-status.err { background: var(--err-soft); color: var(--err); }
.rp-restart-status .spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rp-spin .8s linear infinite; flex: none; }
.rp-restart-status.ok .spinner, .rp-restart-status.err .spinner { display: none; }
@keyframes rp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rp-restart-status .spinner { animation: none; } }

/* My Avatars: the big "Create a new Avatar" button above the cards */
.rp-avatars-create { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-5); }
.rp-avatars-create .btn-lg { min-height: 52px; padding: 0 var(--sp-6); font-size: var(--fs-md); }
.rp-avatars-new { margin: 0 0 var(--sp-3); }
/* "Create a new Avatar" popup: hidden parts stay hidden (.field and .modal-body set display) */
#rp-newavatar [hidden] { display: none !important; }
#rp-newavatar .rp-form-row + .hint { margin-top: calc(var(--sp-2) * -1); font-size: var(--fs-xs); color: var(--text-3); }
#rp-newavatar .error-text { color: var(--err); font-size: var(--fs-sm); margin: 0; }

/* ======================================================================
   Resident sections (2026-11-26): notifications, messages, friends & groups, inventory,
   transactions, billing, account, support, news, about. Tokens only (every brand, both themes).
   ====================================================================== */
.rp-main > .card, .rp-two > .card, .rp-two > .rp-stack > .card, .rp-main > div > .card { border-radius: var(--radius-xl); box-shadow: var(--shadow-2); }
.rp-main > .card + .card, .rp-main > .rp-two + .card, .rp-main > .card + .rp-two, .rp-main > .rp-two + .rp-two { margin-top: var(--sp-4); }
.rp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }
.rp-two-wide { grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); }
.rp-tabs { margin-bottom: var(--sp-4); flex-wrap: wrap; }
.rp-mini-search { margin-left: auto; width: 170px; }
.rp-mini-search .input { height: 32px; }
.rp-row-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.rp-prose { font-size: var(--fs-md); line-height: 1.6; overflow-wrap: anywhere; }
.rp-prose p { margin: 0 0 .8em; }
.rp-prose p:last-child { margin-bottom: 0; }
.rp-pager { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); }
.rp-pager .rp-meta { margin-right: auto; }
div.rp-pager { margin-top: var(--sp-4); }
.rp-topicon { position: relative; }
.rp-badge { position: absolute; top: 2px; right: 0; pointer-events: none; box-shadow: 0 0 0 2px var(--bg); }
.rp-kpis3, .rp-kpis4 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.rp-kpis4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: var(--sp-4); }
.rp-kpis3 > .rp-kpi, .rp-kpis4 > .rp-kpi { grid-column: auto; border-radius: var(--radius-xl); box-shadow: var(--shadow-2); }
.rp-kpis3 > .rp-kpi:hover, .rp-kpis4 > .rp-kpi:hover { transform: none; box-shadow: var(--shadow-2); }
.rp-danger-zone { border-color: color-mix(in oklab, var(--err) 35%, var(--border)); }
.rp-danger-zone .rp-card-head h2 .icon { color: var(--err); }
.rp-copyline { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 6px 6px 12px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); }
.rp-copyline code { font-family: var(--font-mono); font-size: var(--fs-sm); overflow-wrap: anywhere; flex: 1; }
.rp-low { color: var(--warn); }

/* notifications */
.rp-notif-list { list-style: none; margin: 0; padding: var(--sp-2); display: flex; flex-direction: column; }
.rp-notif { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--radius-md); }
.rp-notif + .rp-notif { border-top: 1px solid var(--border); }
.rp-notif.is-unread { background: var(--accent-softer); }
.rp-notif-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--accent-text); background: var(--accent-soft); }
.rp-notif-icon.kind-payment { color: #d97706; background: color-mix(in oklab, #f59e0b 18%, transparent); }
.rp-notif-icon.kind-group_notice { color: var(--accent-2); background: var(--accent-2-soft); }
.rp-notif-icon.kind-support, .rp-notif-icon.kind-account { color: #8b5cf6; background: color-mix(in oklab, #8b5cf6 15%, transparent); }
.rp-notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; color: var(--text-2); font-size: var(--fs-sm); text-decoration: none; }
.rp-notif-text strong { color: var(--text); }
.rp-notif-text:hover { text-decoration: none; }
.rp-notif-text:hover strong { color: var(--accent-text); }
.rp-unread-dot { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--accent); }

/* messages */
.rp-compose { margin-bottom: var(--sp-4); border-radius: var(--radius-xl); box-shadow: var(--shadow-2); }
.rp-msg-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: var(--sp-4); align-items: start; }
.rp-msg-layout > .card { border-radius: var(--radius-xl); box-shadow: var(--shadow-2); }
.rp-convo-list { list-style: none; margin: 0; padding: 0 var(--sp-2) var(--sp-2); }
.rp-convo { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--radius-md); color: var(--text-2); text-decoration: none; }
.rp-convo:hover { background: var(--surface-2); text-decoration: none; }
.rp-convo.is-unread strong { color: var(--accent-text); }
.rp-convo-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-size: var(--fs-sm); }
.rp-convo-text strong { color: var(--text); }
.rp-convo-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-convo-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.rp-waiting { padding: 0; }
.rp-waiting li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.rp-waiting p { margin: 4px 0 0; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.rp-people-pick { position: relative; }
.rp-pick-list { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px; list-style: none; border-radius: var(--radius-md); background: var(--surface-1); border: 1px solid var(--border-strong); box-shadow: var(--shadow-3); max-height: 280px; overflow: auto; }
.rp-pick-list li { padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: var(--fs-sm); }
.rp-pick-list li[role="option"]:hover, .rp-pick-list li.is-active { background: var(--accent-soft); }
.rp-thread-title { display: flex; align-items: center; gap: var(--sp-3); }
.rp-thread { border-radius: var(--radius-xl); box-shadow: var(--shadow-2); display: flex; flex-direction: column; }
.rp-bubbles { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); max-height: min(62vh, 640px); overflow-y: auto; }
.rp-bubble { align-self: flex-start; max-width: min(78%, 640px); display: flex; flex-direction: column; gap: 4px; }
.rp-bubble-text { padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-md); line-height: 1.5; overflow-wrap: anywhere; }
.rp-bubble-text p { margin: 0 0 .5em; }
.rp-bubble-text p:last-child { margin: 0; }
.rp-bubble.mine { align-self: flex-end; align-items: flex-end; }
.rp-bubble.mine .rp-bubble-text { background: var(--accent); border-color: transparent; color: var(--on-accent); border-radius: 16px 16px 4px 16px; }
.rp-bubble.mine .rp-bubble-text a { color: inherit; text-decoration: underline; }
.rp-bubble.is-note .rp-bubble-text { background: color-mix(in oklab, var(--warn) 14%, var(--surface-1)); border: 1px dashed color-mix(in oklab, var(--warn) 55%, var(--border)); color: var(--text); }
.rp-bubble-who { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); }
.rp-day-sep { display: flex; justify-content: center; }
.rp-day-sep span { font-size: var(--fs-2xs); color: var(--text-3); padding: 2px 10px; border-radius: var(--radius-pill); background: var(--surface-2); }
.rp-reply { display: flex; gap: var(--sp-2); align-items: flex-end; padding: var(--sp-3) var(--sp-4) var(--sp-4); border-top: 1px solid var(--border); }
.rp-reply .textarea { flex: 1; min-height: 46px; resize: vertical; font-size: var(--fs-md); }
.rp-reply-big { flex-direction: column; align-items: stretch; }
.rp-reply-big .rp-form-foot { position: static; background: none; padding: 0; align-items: center; flex-wrap: wrap; }
.rp-reply-big .rp-form-foot .check { margin-right: auto; }

/* friends & groups */
.rp-friend-list li { align-items: flex-start; }
.rp-rights { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.rp-rights .chip { font-size: var(--fs-2xs); }
.rp-notice-list { list-style: none; margin: 0; padding: 0 var(--sp-4) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.rp-notice-list details, .rp-faq details { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-1); }
.rp-notice-list summary { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3); cursor: pointer; list-style: none; }
.rp-notice-list summary::-webkit-details-marker, .rp-faq summary::-webkit-details-marker { display: none; }
.rp-notice-list details[open] summary { border-bottom: 1px solid var(--border); }
.rp-notice-list details > .rp-prose, .rp-notice-list details > p { padding: var(--sp-3); margin: 0; }
.rp-role > div { display: flex; flex-direction: column; gap: 2px; }

/* inventory */
.rp-inv { border-radius: var(--radius-xl); box-shadow: var(--shadow-2); }
.rp-inv-search { margin: 0 0 var(--sp-4); }
.rp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: var(--sp-4) var(--sp-4) var(--sp-2); font-size: var(--fs-sm); }
.rp-crumbs .icon { color: var(--text-3); }
.rp-inv-list { list-style: none; margin: 0; padding: 0 var(--sp-2) var(--sp-3); }
.rp-inv-row { display: block; border-radius: var(--radius-md); }
.rp-inv-row.is-folder, .rp-inv-row summary { display: flex; align-items: center; gap: var(--sp-3); padding: 9px var(--sp-3); color: var(--text-2); text-decoration: none; cursor: pointer; list-style: none; border-radius: var(--radius-md); }
.rp-inv-row summary::-webkit-details-marker { display: none; }
.rp-inv-row.is-folder:hover, .rp-inv-row summary:hover { background: var(--surface-2); text-decoration: none; }
.rp-inv-row[open] { background: var(--surface-2); }
.rp-inv-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); }
.rp-inv-row.is-folder .rp-inv-icon { color: var(--accent-text); background: var(--accent-soft); }
.rp-inv-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rp-inv-name strong { color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-perm { display: inline-flex; gap: 2px; flex: none; }
.rp-perm i { font-style: normal; font-size: 10px; font-weight: var(--fw-bold); width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; color: var(--text-3); background: var(--surface-3); text-decoration: line-through; }
.rp-perm i.on { color: var(--ok); background: color-mix(in oklab, var(--ok) 16%, transparent); text-decoration: none; }
.rp-inv-detail { padding: 0 var(--sp-3) var(--sp-3) calc(32px + var(--sp-3) * 2); margin: 0; font-size: var(--fs-sm); }

/* transactions */
.rp-tx-filter { margin: 0 0 var(--sp-4); }
.rp-seg-radio { display: inline-flex; cursor: pointer; position: relative; }
.rp-seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.rp-seg-radio span { display: inline-flex; align-items: center; height: calc(var(--control-h) - 4px); padding: 0 var(--sp-3); border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-medium); }
.rp-seg-radio input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-1); }
.rp-seg-radio input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.rp-date-field .input { width: 150px; }
.rp-tx-table { --table-max-h: none; }
.rp-tx-table td { vertical-align: top; }
.rp-tx-table td > .rp-meta, .rp-tx-desc { display: block; }
.rp-tx-desc { font-size: var(--fs-xs); color: var(--text-2); margin-top: 2px; max-width: 60ch; }
.rp-amount { font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.rp-amount.in { color: var(--ok); }

/* billing */
.rp-bill-row { display: flex; align-items: center; gap: var(--sp-3); }
.rp-bill-row .rp-person { text-decoration: none; }
.rp-service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-3); padding: 0 var(--sp-4) var(--sp-4); }
.rp-service { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-4); border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-1); color: var(--text); text-decoration: none; transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.rp-service:hover { text-decoration: none; transform: translateY(-2px); border-color: color-mix(in oklab, var(--accent) 45%, var(--border)); }
.rp-service .rp-kpi-icon { width: 40px; height: 40px; margin-bottom: 4px; }

/* account */
.rp-pref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-4); }
.rp-pref-grid fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

/* support */
.rp-faq { display: flex; flex-direction: column; gap: var(--sp-2); padding: 0 var(--sp-4) var(--sp-4); }
.rp-faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); cursor: pointer; font-weight: var(--fw-semibold); list-style: none; }
.rp-faq summary .icon { transition: transform var(--dur) var(--ease); color: var(--text-3); flex: none; }
.rp-faq details[open] summary .icon { transform: rotate(180deg); }
.rp-faq details > .rp-prose { padding: 0 var(--sp-4) var(--sp-4); color: var(--text-2); }
#rp-newticket { margin-bottom: var(--sp-4); border-radius: var(--radius-xl); box-shadow: var(--shadow-2); }

/* news */
.rp-news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.rp-news-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-xl); box-shadow: var(--shadow-2); color: var(--text-2); text-decoration: none; transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.rp-news-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-3); }
.rp-news-card img, .rp-news-art { width: 100%; height: 150px; object-fit: cover; display: grid; place-items: center; color: rgba(255, 255, 255, .95); }
.rp-news-art .icon { width: 40px; height: 40px; }
.rp-news-card-body { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-4); font-size: var(--fs-sm); flex: 1; }
.rp-news-card-body strong { font-size: var(--fs-lg); color: var(--text); line-height: 1.3; }
.rp-news-card-body .rp-kpi-link { margin-top: auto; padding-top: var(--sp-2); }
a.rp-news-text { text-decoration: none; }
a.rp-news-text:hover strong { color: var(--accent-text); }
.rp-article { overflow: hidden; }
.rp-article-art { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.rp-article h1 { font-size: 1.9rem; line-height: 1.2; margin: var(--sp-2) 0 var(--sp-3); }
.rp-lead { font-size: var(--fs-lg); color: var(--text-2); }

/* about */
.rp-about-hero { min-height: 200px; border-radius: var(--radius-xl); }

@media (max-width: 1100px) {
  .rp-two-wide, .rp-msg-layout { grid-template-columns: minmax(0, 1fr); }
  .rp-kpis4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .rp-two { grid-template-columns: minmax(0, 1fr); }
  .rp-kpis3 { grid-template-columns: minmax(0, 1fr); }
  .rp-bubble { max-width: 92%; }
  .rp-date-field { flex: 1 1 130px; }
  .rp-date-field .input { width: 100%; }
}
@media (max-width: 600px) {
  .rp-kpis4 { grid-template-columns: minmax(0, 1fr); }
  .rp-mini-search { width: 120px; }
  .rp-inv-row summary .rp-meta { display: none; }
  .rp-inv-detail { padding-left: var(--sp-3); }
  .rp-reply { padding: var(--sp-3); }
}
/* buttons at the end of a form inside a card: no sticky page footer band */
.card-body.rp-form > .rp-form-foot { position: static; background: none; padding: 0; flex-wrap: wrap; align-items: center; }
.card-body.rp-form > .rp-form-foot > .rp-meta { order: -1; margin-right: auto; }
.rp-perm i.rp-perm-x { margin-left: 3px; }
.rp-perm i.rp-perm-x.on { color: var(--accent-2); background: var(--accent-2-soft); }

/* My Estates + the "Showing" avatar picker */
.rp-est-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: var(--sp-4); align-items: start; }
.rp-estate { border-radius: var(--radius-xl); box-shadow: var(--shadow-2); }
.rp-est-regions { padding: 0; }
.rp-est-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-est-flags .chip { font-size: var(--fs-2xs); }
.rp-est-list { border: 1px solid var(--border); border-radius: var(--radius-md); }
.rp-est-list summary { display: flex; align-items: center; gap: 8px; padding: 10px var(--sp-3); cursor: pointer; list-style: none; font-size: var(--fs-sm); }
.rp-est-list summary::-webkit-details-marker { display: none; }
.rp-est-list summary .chip { margin-left: auto; }
.rp-est-caret { transition: transform var(--dur) var(--ease); color: var(--text-3); }
.rp-est-list[open] .rp-est-caret { transform: rotate(180deg); }
.rp-est-list > .rp-list { padding: 0 var(--sp-3) var(--sp-3); }
.rp-est-list > p { margin: 0; padding: 0 var(--sp-3) var(--sp-3); }
.rp-avpick { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 3px 4px 3px 10px; border-radius: var(--radius-pill); background: var(--surface-1); border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--border)); box-shadow: var(--shadow-1); }
.rp-avpick-label { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--accent-text); }
.rp-avpick .select { height: 32px; border: 0; background-color: transparent; font-weight: var(--fw-semibold); max-width: 220px; }
.page-head .actions { flex-wrap: wrap; }
@media (max-width: 600px) { .rp-est-grid { grid-template-columns: minmax(0, 1fr); } .rp-avpick { width: 100%; } .rp-avpick .select { flex: 1; max-width: none; } }

/* Rename a region / estate */
.rp-rename { border: 1px dashed var(--border-strong); border-radius: var(--radius-md); padding: 0 var(--sp-3); }
.rp-rename summary { display: flex; align-items: center; gap: 6px; padding: 9px 0; cursor: pointer; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2); list-style: none; }
.rp-rename summary::-webkit-details-marker { display: none; }
.rp-rename[open] { padding-bottom: var(--sp-3); }
.rp-rename .rp-inline .btn { height: 36px; }
.rp-rename .input { height: 36px; }
.rp-rename > .rp-meta { margin-top: 6px; }

/* My Estates: new estate, settings, list editing, delete (2026-11-26) */
.rp-est-new { margin-bottom: var(--sp-4); }
.rp-est-new > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: var(--sp-3); }
.rp-est-new > summary::-webkit-details-marker { display: none; }
.rp-est-new > summary h2 { margin-right: auto; }
.rp-est-new[open] > summary .rp-est-caret { transform: rotate(180deg); }
.rp-est-new-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3) var(--sp-4); }
.rp-est-add { display: flex; padding: 0 var(--sp-3) var(--sp-2); }
.rp-est-add .field { flex: 1 1 200px; min-width: 0; }
.rp-est-add .input, .rp-est-add .select { height: 36px; }
.rp-est-add .btn { height: 36px; }
.rp-est-list > .rp-meta:last-child { padding-top: 0; }
.rp-people li { position: relative; }
.rp-est-x { margin-left: auto; }
.rp-est-delete { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding-top: var(--sp-2); border-top: 1px solid var(--border); }
.rp-danger-text { color: var(--err); }
.rp-danger-text:hover { background: color-mix(in srgb, var(--err) 12%, transparent); }
.rp-rename .rp-checks { margin-bottom: var(--sp-2); }

/* My Regions: Allow HyperGrid Visitors (whole instance) */
.rp-hg { display: flex; flex-direction: column; gap: 4px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-md); }
.rp-hg .switch { font-weight: var(--fw-semibold); }

/* Reserved last names (My Avatars): the owner's own tokens */
.rp-names { margin-top: var(--sp-6, 24px); }
.rp-name-block + .rp-name-block { margin-top: var(--sp-5, 20px); padding-top: var(--sp-5, 20px); border-top: 1px solid var(--border); }
.rp-name-block h3 { margin: 0 0 var(--sp-3, 12px); }
.rp-form.rp-inline { display: flex; flex-wrap: wrap; gap: var(--sp-3, 12px); align-items: flex-end; margin-bottom: var(--sp-3, 12px); }
.rp-form.rp-inline .field { flex: 1 1 220px; margin: 0; }
.rp-token { font-size: 1.1em; letter-spacing: .06em; user-select: all; }
/* ------------------------------------------------------------------ My Storage, Premium, staff storage */
.rp-row { display: flex; align-items: center; gap: var(--sp-2); }
.rp-wrap { flex-wrap: wrap; }
.rp-row .grow { flex: 1 1 160px; min-width: 0; }
.rp-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); align-items: end; }
.input-sm, .select-sm { height: var(--control-h-sm); font-size: var(--fs-xs); padding-top: 0; padding-bottom: 0; }
.rp-locked:not(section) { opacity: .55; filter: saturate(.4); }
section.rp-locked > .rp-card-head, section.rp-locked > .card-body > :not(.rp-lock-note) { opacity: .55; filter: saturate(.4); }
.rp-locked :is(button, input, select) { cursor: not-allowed; }
.rp-lock-note { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--accent-text); margin: 0; }
.rp-lock-note a { color: inherit; font-weight: var(--fw-semibold); }
.rp-premium-hero { display: grid; grid-template-columns: 96px 1fr; gap: var(--sp-5); padding: var(--sp-5); margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface-1)), var(--surface-1) 60%); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.rp-premium-hero h2 { font-size: var(--fs-xl); font-weight: var(--fw-semibold); margin: 0; }
.rp-premium-art { width: 96px; height: 96px; border-radius: var(--radius-lg); display: grid; place-items: center; background: var(--brand-gradient); color: var(--on-accent); box-shadow: var(--shadow-md); }
.rp-premium-art .icon { width: 48px; height: 48px; }
.rp-usecases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-3); }
.rp-usecases li { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: var(--fs-sm); color: var(--text-2); }
.rp-usecases li > .icon { flex: none; width: 20px; height: 20px; color: var(--accent-text); margin-top: 2px; }
.rp-usecases strong { color: var(--text-1); }
.rp-usage strong { font-size: var(--fs-2xl, 1.6rem); font-weight: var(--fw-semibold); }
progress.rp-progress { appearance: none; -webkit-appearance: none; width: 100%; height: 8px; border: 0; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
progress.rp-progress::-webkit-progress-bar { background: var(--surface-3); border-radius: var(--radius-pill); }
progress.rp-progress::-webkit-progress-value { background: var(--brand-gradient); border-radius: var(--radius-pill); transition: width var(--dur-slow) var(--ease); }
progress.rp-progress::-moz-progress-bar { background: var(--brand-gradient); border-radius: var(--radius-pill); }
progress.rp-progress.warn::-webkit-progress-value { background: var(--warn); } progress.rp-progress.warn::-moz-progress-bar { background: var(--warn); }
progress.rp-progress.err::-webkit-progress-value { background: var(--err); } progress.rp-progress.err::-moz-progress-bar { background: var(--err); }
.rp-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.rp-kind { position: relative; cursor: pointer; }
.rp-kind input { position: absolute; opacity: 0; inset: 0; cursor: inherit; }
.rp-kind > span { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); height: 100%; transition: all var(--dur-fast) var(--ease); }
.rp-kind > span .icon { width: 20px; height: 20px; color: var(--accent-text); }
.rp-kind input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.rp-kind input:focus-visible + span { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
/* upload drop zone (the invisible file input covers it, so click / keyboard / drop all work natively) */
.rp-drop { position: relative; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); border: 1.5px dashed var(--border-strong, var(--border));
           border-radius: var(--radius-lg, 12px); background: var(--surface-2); transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.rp-drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rp-drop-input:disabled { cursor: not-allowed; }
.rp-drop-icon { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text, var(--accent)); }
.rp-drop-icon .icon { width: 20px; height: 20px; }
.rp-drop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rp-drop-text strong { overflow-wrap: anywhere; }
.rp-drop-browse { pointer-events: none; flex: none; }
.rp-drop:hover, .rp-drop.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); }
.rp-drop:focus-within { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.rp-drop.has-file { border-style: solid; border-color: var(--accent); }
.rp-drop.has-file .rp-drop-icon { background: var(--accent); color: var(--on-accent, #fff); }
.rp-drop.is-disabled { opacity: .6; }
.rp-drop.is-disabled:hover { border-color: var(--border-strong, var(--border)); background: var(--surface-2); }
.rp-upload-go { display: flex; justify-content: flex-end; }
@media (max-width: 520px) { .rp-drop-browse { display: none; } .rp-upload-go .btn { width: 100%; justify-content: center; } }
.rp-upload-progress { display: grid; grid-template-columns: 1fr auto; gap: 4px var(--sp-2); align-items: center; }
.rp-upload-progress progress { grid-column: 1 / -1; }
/* My uploads: one row per file. Name, facts and the reason a file was refused on the left; actions on the right,
   moving under the file when the card is narrow. Rows grow with their content, so nothing overlaps. */
.rp-uploads { list-style: none; margin: 0; padding: 0; }
.rp-up { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-2) var(--sp-3); align-items: center;
         padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); }
.rp-up-icon { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); }
.rp-up-icon .icon { width: 18px; height: 18px; }
.rp-up-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rp-up-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: var(--fs-xs); color: var(--text-2); }
.rp-up-details { white-space: normal; overflow-wrap: anywhere; }
.rp-fname { overflow-wrap: anywhere; }
.rp-file-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.rp-file-actions > .inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.rp-install { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.rp-install .check { white-space: nowrap; }
.rp-up-card { container-type: inline-size; }
.rp-up-cards { display: grid; gap: var(--sp-4); }
.rp-up-empty { display: flex; align-items: center; gap: 8px; margin: 0; padding: var(--sp-3) var(--sp-4) var(--sp-4); color: var(--text-2); font-size: var(--fs-sm); }
.rp-oar-size { font-weight: 600; }
@container (max-width: 760px) { .rp-up { grid-template-columns: auto minmax(0, 1fr); } .rp-up .rp-file-actions, .rp-up .rp-install { grid-column: 2; justify-content: flex-start; } }

.rp-make-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.rp-make-row:last-of-type { border-bottom: 0; }
.rp-make-row .rp-person { flex: 1 1 200px; display: flex; flex-direction: column; }
.rp-make-row .rp-person strong { display: inline-flex; align-items: center; gap: 6px; }
.rp-make-row .inline-form { display: inline-flex; gap: 6px; align-items: center; }
.rp-instance { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-3); background: var(--surface-2); }
.rp-instance-head { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.rp-instance-head strong { display: inline-flex; align-items: center; gap: 6px; }
.rp-points { padding: 0; }
.rp-points .rp-bill-row { flex-wrap: wrap; }
.rp-points .rp-person { flex: 1 1 200px; display: flex; flex-direction: column; }
.rp-confirm-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rp-feature-row { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.rp-feature-row:last-child { border-bottom: 0; }
.rp-limit-label { align-self: center; font-size: var(--fs-sm); }
@media (max-width: 720px) {
  .rp-kinds, .rp-three { grid-template-columns: 1fr; }
  .rp-premium-hero { grid-template-columns: 1fr; }
  .rp-premium-art { width: 64px; height: 64px; }
  .rp-file-actions { justify-content: flex-start; }
}
.rp-feature-row > .select { flex: none; width: 170px; }
.rp-feature-row > span:first-child { flex: 1; }
.rp-row > .input, .rp-row > .select, .rp-install > .select, .rp-make-row .select { width: auto; flex: 0 1 auto; }
.rp-row > .input.grow, .rp-row > .select.grow { flex: 1 1 160px; }
.rp-row > input[type="file"].input { flex: 1 1 200px; min-width: 0; }
.rp-row > label { white-space: nowrap; }
.rp-upload-progress[hidden] { display: none; }
.rp-meta[hidden], [data-storage-live][hidden] { display: none; }

/* Staff: storage files (the grid's whole bucket) */
.fx-total { font-size: var(--fs-lg, 1.25rem); }
.fx-meters { display: grid; gap: 6px; }
.fx-meters .meter-row { grid-template-columns: 140px minmax(0, 1fr) 80px; }
.fx-top { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm); }
.fx-top li { display: flex; align-items: center; gap: 6px; }
.fx-head { flex-wrap: wrap; gap: var(--sp-2); }
.fx-path { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; font-size: var(--fs-sm); }
.fx-path a { color: var(--text-2); text-decoration: none; }
.fx-path a:hover { color: var(--text); text-decoration: underline; }
.fx-list { list-style: none; margin: 0; padding: 0; }
.fx-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: var(--sp-3); align-items: center; padding: 10px var(--sp-4); border-top: 1px solid var(--border); }
.fx-name { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
a.fx-name:hover strong { text-decoration: underline; }
.fx-icon { width: 32px; height: 32px; flex: none; border-radius: var(--radius-md); background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); }
.fx-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fx-text strong { overflow-wrap: anywhere; }
.fx-facts { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); white-space: nowrap; }
.fx-up .fx-name { color: var(--text-2); font-size: var(--fs-sm); }
.fx-delete { border-top: 1px solid var(--border); }
.fx-delete-folder { background: color-mix(in srgb, var(--err) 5%, transparent); }
@media (max-width: 640px) { .fx-row { grid-template-columns: 22px minmax(0, 1fr) auto; } .fx-row .fx-facts { grid-column: 2; } }

/* Load an OAR: options under the file (spans the whole row) */
.rp-oar-load { grid-column: 1 / -1; display: grid; gap: var(--sp-3); margin-top: var(--sp-2); padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--radius-lg, 12px); background: var(--surface-2); }
.rp-oar-load[hidden] { display: none; }
.rp-oar-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-4); align-items: start; }
.rp-oar-fields { display: grid; gap: var(--sp-3); min-width: 0; }
.rp-oar-fields > p { margin: 0; }
.rp-oar-mode { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.rp-oar-mode legend { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 4px; }
.rp-oar-mode .check { align-items: flex-start; }
.rp-oar-merge-opts { display: grid; gap: 6px; padding-left: 26px; }
.rp-oar-merge-opts[hidden] { display: none; }
.rp-oar-place { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
.rp-oar-place .input { width: 100%; }
.rp-oar-preview { display: grid; gap: var(--sp-2); align-content: start; }
/* the region's map tiles with the footprint drawn over them (north up) */
.rp-oar-pick { position: relative; width: 100%; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-3); box-shadow: 0 0 0 1px var(--border); }
.rp-oar-pick .rp-cells { position: absolute; inset: 0; width: 100%; height: 100%; gap: 0; }
.rp-oar-pick .rp-cell { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.rp-oar-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.rp-oar-map-region { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rp-oar-map-oar { fill: color-mix(in srgb, var(--accent) 38%, transparent); stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.rp-oar-map-oar.is-bad { fill: color-mix(in srgb, var(--err) 35%, transparent); stroke: var(--err); }
.rp-oar-map-ghost { fill: rgba(255, 255, 255, .28); stroke: #fff; stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease); }
.rp-oar-map-ghost.is-on { opacity: 1; }
.rp-oar-map-ghost.is-bad { fill: color-mix(in srgb, var(--err) 30%, transparent); stroke: var(--err); }
.rp-oar-map-sw { fill: #fff; stroke: rgba(0, 0, 0, .6); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rp-oar-hint { display: flex; align-items: center; gap: 6px; margin: 0; }
.rp-cols-9 { grid-template-columns: repeat(9, 1fr); } .rp-cols-10 { grid-template-columns: repeat(10, 1fr); } .rp-cols-11 { grid-template-columns: repeat(11, 1fr); } .rp-cols-12 { grid-template-columns: repeat(12, 1fr); }
.rp-cols-13 { grid-template-columns: repeat(13, 1fr); } .rp-cols-14 { grid-template-columns: repeat(14, 1fr); } .rp-cols-15 { grid-template-columns: repeat(15, 1fr); } .rp-cols-16 { grid-template-columns: repeat(16, 1fr); }
.rp-oar-check { margin: 0; font-size: var(--fs-sm); }
.rp-oar-check.is-ok { color: var(--ok-text, var(--ok, #2e9e6a)); }
.rp-oar-check.is-bad { color: var(--err-text, var(--err)); }
.rp-oar-actions { justify-content: flex-end; }
@container (max-width: 760px) { .rp-oar-grid { grid-template-columns: 1fr; } .rp-oar-preview { max-width: 240px; } .rp-oar-place { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rp-dl-actions { display: inline-flex; align-items: center; gap: 4px; flex: none; margin-left: auto; }
.rp-dl-actions > .inline-form { display: inline-flex; margin: 0; }
.rp-avail-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rp-avail { font-size: var(--fs-xs); }

/* My Storage: one even gap between every section (cards, two-column rows and the three upload cards) */
[data-storage] { display: grid; gap: var(--sp-4); }
[data-storage] > * { margin-top: 0; margin-bottom: 0; min-width: 0; }
[data-storage] .rp-up-cards { gap: var(--sp-4); }
.fx-pw { width: 200px; max-width: 100%; }
