/* Shared button variants; public-page dimensions are preserved. */
.rm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3);
  font-family: var(--font-sans); font-weight: 700; text-decoration: none; white-space: nowrap;
  border-radius: var(--radius-pill); border: 1.5px solid transparent; cursor: pointer;
  transition: filter .15s, background-color .15s;
}
.rm-btn-sm { font-size: 14px; line-height: 20px; padding: 8px var(--space-4); }
.rm-btn-md { font-size: 16px; line-height: 24px; padding: 12px var(--space-6); }
.rm-btn-lg { font-size: 18px; line-height: 24px; padding: 16px var(--space-8); }
.rm-btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-cta); }
.rm-btn-secondary { background: var(--secondary); color: var(--on-secondary); }
[data-theme="night"] .rm-btn-secondary { border-color: var(--ink-muted); }
.rm-btn-quiet { background: transparent; color: var(--ink); border-color: var(--ink-muted); }
.rm-btn:hover { filter: brightness(.94); }
.rm-btn-quiet:hover { filter: none; background: var(--surface-muted); }
.rm-btn:active { transform: scale(.98); }
.rm-btn:disabled { opacity: .4; cursor: progress; filter: none; }

:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Legacy hooks keep their JS meaning; the rm-btn variants provide their shared appearance. */
:is(body.shell, .signin-dialog, .folder-dialog) .rm-btn { border-radius: var(--radius-pill); font-weight: 700; }
:is(body.shell, .signin-dialog, .folder-dialog) .rm-btn-primary { background: var(--primary); color: var(--on-primary); border-color: transparent; box-shadow: var(--shadow-cta); }
:is(body.shell, .signin-dialog, .folder-dialog) .rm-btn-secondary { background: var(--secondary); color: var(--on-secondary); border-color: transparent; }
:is(body.shell, .signin-dialog, .folder-dialog) .rm-btn-quiet { background: transparent; color: var(--ink); border: 1.5px solid var(--ink-muted); }
[data-theme="night"] :is(body.shell, .signin-dialog, .folder-dialog) .rm-btn-secondary { border: 1.5px solid var(--ink-muted); }
:is(body.shell, .signin-dialog, .folder-dialog) .rm-btn-quiet:hover { background: var(--surface-muted); }
:is(body.shell, .signin-dialog, .folder-dialog) .rm-btn.danger { background: var(--surface-muted); color: var(--error); border: 1.5px solid var(--error); box-shadow: none; }
:is(body.shell, .signin-dialog, .folder-dialog) .rm-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
:is(body.shell, .signin-dialog, .folder-dialog) .rm-btn:disabled { opacity: .4; }

/* Selected controls retain the same keyboard focus as unselected controls. */
:is(body.shell, .signin-dialog, .folder-dialog) :focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Let op, as in the design system's MapPin: a loose triangle, white with an ink edge and an ink "!" by day, the
   inverse at night (31 Oct 2026). Its shape tells it from a favourite, not its colour. Markup:
   <svg class="rm-warn" viewBox="0 0 40 37"><path d="M20 5 35 31H5z"/><path class="mark" d="M20 14v7M20 25.5v.1"/></svg> */
.rm-warn { display: block; overflow: visible; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.rm-warn path { fill: var(--pin-fill); stroke: var(--pin-ink); stroke-width: 2; stroke-linejoin: round; }
.rm-warn path.mark { fill: none; stroke-width: 3; stroke-linecap: round; }

/* ---------- The design system's controls (Segmented, Pills, a switch, Rating, cards), as RMSegmented and the
   others in the app's Components.swift. New pages build from these; older pages keep .seg in panel.css. ---------- */
.rm-eyebrow { margin: 0; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.rm-card { background: var(--surface-raised); border-radius: var(--radius-lg); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.rm-card > h2 { margin: 0; }
.rm-seg { display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--surface-muted); }
.rm-seg button { flex: 1; min-width: 0; min-height: 36px; padding: 4px 10px; border: 0; border-radius: var(--radius-pill); background: transparent;
  font: 600 14px/1.15 var(--font-sans); color: var(--ink); white-space: nowrap; cursor: pointer; }
.rm-seg button[aria-pressed="true"] { background: var(--surface-raised); box-shadow: 0 1px 3px rgba(31,41,51,.12); }
.rm-seg button:disabled { opacity: .4; cursor: progress; }
.rm-pills { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.rm-pill { min-height: 36px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface-raised);
  color: var(--ink); font: 600 14px var(--font-sans); cursor: pointer; white-space: nowrap; }
.rm-pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
/* A setting that is only a switch: its name, the explanation small under it, the switch on the right. */
.rm-toggle { display: flex; align-items: flex-start; gap: var(--space-4); padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.rm-toggle > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rm-toggle strong { font-weight: 600; }
.rm-toggle small { font-size: 14px; line-height: 1.45; color: var(--ink-muted); }
.rm-switch { appearance: none; flex: none; position: relative; width: 48px; height: 28px; margin: 0; border-radius: 99px; background: var(--surface-muted);
  box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: background-color .15s; }
.rm-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 99px; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.rm-switch:checked { background: var(--secondary); }
[data-theme="night"] .rm-switch:checked { background: var(--primary); }
.rm-switch:checked::after { transform: translateX(20px); }
.rm-switch:disabled { opacity: .4; cursor: progress; }
/* Rating: five stars, filled orange or grey, as in the app; the word beside them. */
.rm-rating { display: flex; align-items: center; gap: var(--space-4); }
.rm-stars { display: flex; gap: 4px; }
.rm-star { width: 40px; height: 40px; padding: 4px; border: 0; background: none; color: var(--rating-empty); cursor: pointer; border-radius: var(--radius-sm); }
.rm-star svg { display: block; width: 100%; height: 100%; }
.rm-star.on { color: var(--rating); }
.rm-rating-word { font-weight: 600; }
.rm-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.rm-field textarea, .rm-field input { padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted);
  font: 400 15px/1.45 var(--font-sans); color: var(--ink); resize: vertical; }
.rm-field textarea:focus, .rm-field input:focus { outline: none; border-color: var(--ink); }
.rm-btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
:is(body.shell, .signin-dialog, .folder-dialog) .rm-btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.rm-btn-danger:hover { filter: none; background: color-mix(in srgb, var(--danger) 8%, transparent); }
.rm-saved { font-size: 13px; color: var(--ink-muted); }
/* An achievement badge as in the app (AchievementBadge): an orange ring on a light orange fill. */
.rm-badge { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 15%, var(--surface-raised)); box-shadow: inset 0 0 0 2px var(--primary);
  color: var(--ink); font: 800 15px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.rm-badge.off { background: var(--surface-muted); box-shadow: inset 0 0 0 2px var(--line); color: var(--ink-muted); }
.rm-card p { margin: 0; }
.rm-saved:empty { display: none; }
