/* Ride rewards (ui/ride-rewards.mjs): the /rewards/ page, the header "我的积分" entry and its dialog.
   Same terminal look as the ladder: near-black panels, hairlines, neon green, monospaced figures.
   Loaded after styles.css (and header-nav.css where the entry sits in the header). Every rule is scoped
   to .rr* / .rrp*, so linking this file changes nothing else on a page. No looping motion except the
   ready-to-claim glow, the refresh spinner and the busy sweep; all of them stop under reduced motion. */

.rr { --rr-r: 6px; position: relative; display: grid; gap: 12px; min-width: 0; color: var(--ink); font: 14px/1.6 var(--sans); }
.rr p { margin: 0; }
.rr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.rr-icon { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---- preview marker: the striped warning of .banner.demo, inside the component itself ---- */
.rr-preview-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 7px 10px;
  border: 1px solid rgba(242, 193, 78, .35); border-radius: var(--rr-r); color: var(--warn); font-size: 12.5px;
  background: repeating-linear-gradient(135deg, rgba(242, 193, 78, .08) 0 10px, rgba(242, 193, 78, .03) 10px 20px); }
.rr-preview-tag b { padding: 0 6px; border: 1px solid currentColor; border-radius: 3px; font: 700 10.5px/1.6 var(--mono); letter-spacing: .12em; }

/* ---- controls ---- */
.rr-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--ink-2); cursor: pointer;
  font: 500 12px/1 var(--mono); white-space: nowrap; transition: color .15s, border-color .15s, background-color .15s; }
.rr-ghost:hover { color: var(--ink); border-color: #2f5a42; background: rgba(57, 255, 136, .04); }
.rr-ghost[aria-disabled="true"] { opacity: .55; cursor: default; }
.rr-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 0;
  border-radius: 5px; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none;
  font: 700 14px/1 var(--sans); letter-spacing: .03em; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 0 0 1px rgba(57, 255, 136, .45), 0 6px 20px -8px rgba(57, 255, 136, .6);
  transition: background-color .15s, box-shadow .15s; }
.rr-primary:hover { background: #63ffa3; color: var(--accent-ink); text-decoration: none; }
.rr-primary[aria-disabled="true"] { opacity: .7; cursor: progress; }
.rr-danger { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 12px;
  border: 1px solid rgba(255, 122, 107, .6); border-radius: 5px; background: rgba(255, 122, 107, .1); color: #ffb1a7; cursor: pointer;
  font: 650 12.5px/1 var(--sans); white-space: nowrap; }
.rr-danger:hover { background: rgba(255, 122, 107, .18); color: #ffd2cc; }
.rr-danger[aria-disabled="true"] { opacity: .65; cursor: progress; }
.rr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rr-link { font: 12px/1.4 var(--mono); }

/* ---- header of the component: one-line rule and a refresh that only reads the server ---- */
.rr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rr-intro { min-width: 0; color: var(--ink-2); font-size: 13.5px; }
.rr-refresh { flex: none; }
.rr-refresh[data-busy="true"] .rr-icon, .rr-check[aria-disabled="true"] .rr-icon { animation: rr-spin .9s linear infinite; }
@keyframes rr-spin { to { transform: rotate(360deg); } }

.rr-account { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--rr-r); background: var(--panel); }
.rr-account-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-label { margin-right: 8px; color: var(--ink-3); font: 500 11px/1 var(--mono); letter-spacing: .06em; }
.rr-account-name { font-weight: 650; }
.rr-balance { white-space: nowrap; }
.rr-balance-num { color: var(--ink); font: 700 20px/1 var(--mono); font-variant-numeric: tabular-nums; }
.rr-balance small { margin-left: 6px; color: var(--ink-3); font-size: 11px; }

.rr-alert:empty { display: none; }

/* ---- cards ---- */
.rr-card { position: relative; display: grid; gap: 10px; min-width: 0; padding: 14px 16px 16px; border: 1px solid var(--line);
  border-radius: var(--rr-r); background: linear-gradient(180deg, rgba(57, 255, 136, .03), transparent 110px), var(--panel); }
.rr-card :is(h2, h3, h4, h5, h6) { margin: 0; color: var(--ink); font: 650 15px/1.3 var(--sans); letter-spacing: .02em; }
.rr-card :is(h2, h3, h4, h5, h6):focus:not(:focus-visible) { outline: none; }
.rr-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rr-kicker { color: var(--accent-2); font: 11px/1.5 var(--mono); }
.rr-kicker::before { content: "$ "; color: var(--ink-3); }
.rr-day { color: var(--ink-3); font: 11px/1.6 var(--mono); text-align: right; white-space: nowrap; }
.rr-login p, .rr-down p { color: var(--ink-2); font-size: 13.5px; }

/* ---- today: the readout, a 30-segment meter (one per minute), and its scale ---- */
.rr-readout { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.rr-time { color: var(--ink); font: 700 44px/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rr-of { color: var(--ink-3); font: 500 15px/1 var(--mono); font-variant-numeric: tabular-nums; }
.rr-chip { align-self: center; margin-left: auto; padding: 3px 9px; border: 1px solid rgba(57, 255, 136, .55); border-radius: 99px;
  background: rgba(57, 255, 136, .07); color: var(--accent); font: 600 11px/1.3 var(--mono); letter-spacing: .08em; }
.rr-ride[data-reached="true"] .rr-time { color: var(--accent); text-shadow: 0 0 18px var(--glow); }
.rr-meter { --rr-p: 0%; --rr-seg: 30; position: relative; height: 12px; overflow: hidden; border-radius: 2px; background: #12291c;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(100% / var(--rr-seg) - 2px), transparent 0 calc(100% / var(--rr-seg)));
  mask: repeating-linear-gradient(90deg, #000 0 calc(100% / var(--rr-seg) - 2px), transparent 0 calc(100% / var(--rr-seg))); }
.rr-meter-fill { position: absolute; inset: 0 auto 0 0; width: var(--rr-p); background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width .5s cubic-bezier(.2, .7, .2, 1); }
/* Unknown is not zero: the track fades and no fill is drawn. */
.rr-meter[data-unknown="true"] { opacity: .4; }
.rr-meter[data-unknown="true"] .rr-meter-fill { display: none; }
.rr-scale { display: flex; justify-content: space-between; margin-top: -5px; color: var(--ink-3); font: 10px/1 var(--mono); font-variant-numeric: tabular-nums; }
.rr-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; color: var(--ink-2); font: 12px/1.6 var(--mono); }
.rr-left { color: var(--ink); font-variant-numeric: tabular-nums; }
.rr-ride[data-reached="true"] .rr-left { color: var(--accent); }
.rr-cumulative { color: var(--ink-3); }
.rr-datatime { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rr[data-state="loading"] .rr-time { color: transparent; border-radius: 4px; animation: rr-shimmer 1.4s linear infinite;
  background: linear-gradient(90deg, var(--line-soft) 30%, #18392a 50%, var(--line-soft) 70%) 0 0 / 300% 100%; }
@keyframes rr-shimmer { to { background-position: -150% 0; } }

/* ---- claim ---- */
.rr-claim { display: grid; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.rr-claim[hidden] { display: none; }
.rr-claim-msg:empty { display: none; }
.rr-claim-btn { position: relative; width: 100%; min-height: 44px; overflow: hidden; padding: 0 16px; border: 1px solid transparent; border-radius: 6px;
  cursor: pointer; font: 700 15px/1 var(--sans); letter-spacing: .04em; transition: background-color .15s, color .15s, box-shadow .15s; }
.rr-claim-btn[data-state="ready"] { background: var(--accent); color: var(--accent-ink); animation: rr-ready 2.6s ease-in-out infinite;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 0 0 1px rgba(57, 255, 136, .45), 0 8px 26px -10px rgba(57, 255, 136, .75); }
.rr-claim-btn[data-state="ready"]:hover { background: #63ffa3; }
.rr-claim-btn[data-state="locked"] { border-color: var(--line); background: var(--panel-2); color: var(--ink-3); cursor: not-allowed; }
.rr-claim-btn[data-state="busy"] { border-color: rgba(57, 255, 136, .45); background: rgba(57, 255, 136, .1); color: var(--accent); cursor: progress; }
.rr-claim-btn[data-state="busy"]::after { content: ""; position: absolute; inset: 0; animation: rr-sweep 1.2s linear infinite;
  background: linear-gradient(90deg, transparent, rgba(57, 255, 136, .22), transparent) -100% 0 / 50% 100% no-repeat; }
.rr-claim-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@keyframes rr-ready { 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 0 0 1px rgba(57, 255, 136, .6), 0 0 26px rgba(57, 255, 136, .45); } }
@keyframes rr-sweep { to { background-position: 200% 0; } }
.rr-claim-note { color: var(--ink-3); font: 12px/1.5 var(--mono); text-align: center; }
.rr-check { justify-self: start; }

.rr-box { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-left-width: 2px; border-radius: 4px;
  background: var(--panel-2); color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.rr-box-title { color: var(--ink); font-weight: 650; }
.rr-box .rr-actions { margin-top: 6px; }
.rr-box[data-tone="warn"] { border-color: rgba(242, 193, 78, .4); border-left-color: var(--warn); background: rgba(242, 193, 78, .05); }
.rr-box[data-tone="warn"] .rr-box-title { color: var(--warn); }
.rr-box[data-tone="down"] { border-color: rgba(255, 122, 107, .4); border-left-color: var(--down); background: rgba(255, 122, 107, .05); color: #f2c4bd; }

/* Credited: a small ledger slip the user can check against the Radar account. */
.rr-receipt { position: relative; display: grid; gap: 8px; padding: 12px 14px; border: 1px solid rgba(57, 255, 136, .42); border-radius: 6px;
  background: linear-gradient(180deg, rgba(57, 255, 136, .09), rgba(57, 255, 136, .02)); }
.rr-receipt[data-fresh] { animation: rr-credit .55s ease-out both; }
.rr-receipt:focus { outline: none; }
.rr-receipt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rr-receipt-title { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 650; }
.rr-receipt-title .rr-icon { width: 16px; height: 16px; stroke-width: 2; }
.rr-plus { font: 700 26px/1 var(--mono); text-shadow: 0 0 16px var(--glow); }
.rr-receipt dl { display: grid; gap: 4px; margin: 0; font: 12px/1.5 var(--mono); }
.rr-receipt dl > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rr-receipt dt { flex: none; min-width: 5.5em; color: var(--ink-3); }
.rr-receipt dd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.rr-receipt code { overflow-wrap: anywhere; }
.rr-copy { min-height: 24px; padding: 0 7px; font-size: 11px; }
.rr-copy .rr-icon { width: 12px; height: 12px; }
@keyframes rr-credit { from { opacity: 0; transform: translateY(4px); box-shadow: 0 0 0 0 rgba(57, 255, 136, .5); }
  60% { box-shadow: 0 0 0 7px rgba(57, 255, 136, 0); } to { opacity: 1; transform: none; } }

/* ---- disclosures: timing rules, where the deviceId is ---- */
.rr :is(.rr-rules, .rr-where) { padding-top: 6px; border-top: 1px solid var(--line-soft); }
.rr :is(.rr-rules, .rr-where) > summary { display: flex; align-items: center; gap: 8px; min-height: 30px; color: var(--ink-2); cursor: pointer;
  font-size: 12.5px; list-style: none; }
.rr :is(.rr-rules, .rr-where) > summary::-webkit-details-marker { display: none; }
.rr :is(.rr-rules, .rr-where) > summary::before { content: ""; flex: none; width: 6px; height: 6px; margin: 0 2px 0 1px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.rr :is(.rr-rules, .rr-where)[open] > summary::before { transform: rotate(45deg); }
.rr :is(.rr-rules, .rr-where) > summary:hover { color: var(--ink); }
.rr-rules ul, .rr-path { margin: 4px 0 4px; padding-left: 20px; color: var(--ink-2); font-size: 13px; line-height: 1.7; }
.rr-rules li::marker, .rr-path li::marker { color: var(--accent-2); font-family: var(--mono); }
.rr-snippet { margin: 6px 0; padding: 10px 12px; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 4px;
  background: #030504; color: var(--ink-2); font: 12px/1.6 var(--mono); white-space: pre; }
.rr-snippet mark { padding: 1px 2px; border-radius: 2px; background: rgba(57, 255, 136, .12); outline: 1px solid rgba(57, 255, 136, .35); color: var(--ink); }
.rr-snippet mark b { color: var(--accent); font-weight: 600; }
.rr-dim { color: var(--ink-3); }
.rr-warn { color: var(--warn); font-size: 12.5px; line-height: 1.55; }

/* ---- devices ---- */
.rr-dev-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rr-count { color: var(--ink-3); font: 11px/1 var(--mono); white-space: nowrap; }
.rr-add[hidden] { display: none; }
.rr-device-list { display: grid; margin: 0; padding: 0; list-style: none; }
.rr-device-list:empty { display: none; }
.rr-device { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 10px 0;
  border-top: 1px solid var(--line-soft); }
.rr-device:first-child { padding-top: 2px; border-top: 0; }
.rr-dot { width: 8px; height: 8px; border: 1px solid var(--ink-3); border-radius: 50%; }
.rr-device[data-online="on"] .rr-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.rr-device[data-online="unknown"] .rr-dot { border-style: dashed; }
.rr-device-main { display: grid; min-width: 0; }
.rr-device-name { overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.rr-device-meta { display: flex; flex-wrap: wrap; gap: 0 10px; color: var(--ink-3); font: 11px/1.6 var(--mono); }
.rr-device[data-online="on"] .rr-online { color: var(--accent); }
.rr-confirm { grid-column: 1 / -1; display: grid; gap: 6px; padding: 10px 12px; border: 1px solid rgba(255, 122, 107, .4); border-left: 2px solid var(--down);
  border-radius: 4px; background: rgba(255, 122, 107, .05); color: var(--ink-2); font-size: 13px; }
.rr-confirm .rr-box-title { color: var(--ink); }

/* ---- bind form ---- */
.rr-form-wrap { display: grid; gap: 12px; }
.rr-first { color: var(--ink-2); font-size: 13px; }
.rr-form { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--rr-r); background: rgba(5, 8, 6, .55); }
.rr-form-title { font-size: 13.5px; font-weight: 650; }
.rr-field { display: grid; gap: 5px; }
.rr-field label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 600; }
.rr-step { color: var(--accent); font: 600 12px/1 var(--mono); }
.rr-input { width: 100%; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg); color: var(--ink); font: 13.5px/1 var(--mono); letter-spacing: .02em; }
.rr-input::placeholder { color: var(--ink-3); opacity: .6; }
.rr-input:hover { border-color: #2f5a42; }
.rr-input:focus-visible { border-color: transparent; outline: 2px solid var(--accent); outline-offset: 0; }
.rr-input[aria-invalid="true"] { border-color: var(--down); }
.rr-input:disabled { opacity: .55; }
.rr-input-code { letter-spacing: .14em; }
.rr-hint { color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.rr-field-err, .rr-form-msg { color: #ff9d91; font-size: 12.5px; line-height: 1.5; }
.rr-field-err:empty, .rr-form-msg:empty { display: none; }

/* ---- header entry: sized like the effect chips, accent like Join's outline ---- */
.rr-launch { position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none; height: var(--hn-tool, 28px); padding: 0 10px;
  border: 1px solid rgba(57, 255, 136, .38); border-radius: 5px; background: rgba(57, 255, 136, .06); color: var(--accent); cursor: pointer;
  font: 600 12px/1 var(--sans); letter-spacing: .02em; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.rr-launch:hover { border-color: rgba(57, 255, 136, .65); background: rgba(57, 255, 136, .12); }
.rr-launch .rr-icon { width: 14px; height: 14px; }
.rr-launch-dot { position: absolute; top: -3px; right: -3px; display: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--bg), 0 0 8px var(--accent); }
.rr-launch[data-eligible="true"] .rr-launch-dot { display: block; animation: rr-dot 2s ease-in-out infinite; }
@keyframes rr-dot { 50% { opacity: .45; } }
.rr-launch-short { display: none; }
/* In the site header: as tall as Join (a primary action, not a tool chip). On phones the action row already
   holds Join, both effect menus and the language link, so the visible label shortens to "积分"; the
   accessible name stays the full "我的积分". */
header.nav .rr-launch { height: var(--hn-h, 34px); }
@media (max-width: 599.98px) {
  header.nav .rr-launch { padding: 0 9px; gap: 5px; }
  header.nav .rr-launch-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  header.nav .rr-launch-short { display: inline; }
}

/* ---- dialog: centred on desktop, a full-height bottom sheet on phones ---- */
.rr-dialog { width: min(480px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 40px); padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 100px #0009; }
.rr-dialog[open] { display: flex; flex-direction: column; animation: rr-rise .18s ease-out; }
.rr-dialog::backdrop { background: #000b; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
body:has(.rr-dialog[open]) { overflow: hidden; }
.rr-dialog-head { position: relative; display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.rr-dialog-head h2 { margin: 0; font: 650 16px/1.3 var(--sans); letter-spacing: .02em; }
.rr-dialog-close { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 4px;
  background: transparent; color: var(--ink-2); cursor: pointer; font: 24px/1 var(--sans); }
.rr-dialog-close:hover { border-color: var(--accent-2); color: var(--accent); }
.rr-grab { display: none; }
.rr-dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 18px; }
@keyframes rr-rise { from { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes rr-sheet { from { transform: translateY(100%); } }
@media (max-width: 599.98px) {
  .rr-dialog { width: 100%; max-width: 100%; height: calc(100dvh - max(env(safe-area-inset-top), 10px)); max-height: none; margin: auto 0 0;
    border-width: 1px 0 0; border-radius: 14px 14px 0 0; }
  .rr-dialog[open] { animation: rr-sheet .24s cubic-bezier(.2, .8, .2, 1); }
  .rr-grab { position: absolute; top: 6px; left: 50%; display: block; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line); }
  .rr-dialog-head { padding: 16px 12px 10px var(--gutter, 16px); }
  .rr-dialog-close { width: 44px; height: 44px; }
  .rr-dialog-body { padding: 12px var(--gutter, 16px) calc(20px + env(safe-area-inset-bottom)); }
}

/* ---- standalone page /rewards/ ---- */
/* The heading shares the content column: 600px, or 600 + 340 with the preview controls beside it. */
.rr-page { max-width: 600px; margin: 0 auto; padding: 26px 0 48px; }
.rr-page:has(.rr-page-grid[data-preview]) { max-width: 960px; }
.rr-page-head { margin: 0 0 16px; }
.rr-page-head h1 { font-size: clamp(26px, 3vw, 36px); }
.rr-page-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 20px; }
.rr-page-grid[data-preview] { grid-template-columns: minmax(0, 600px) minmax(280px, 1fr); }
@media (max-width: 959.98px) {
  .rr-page:has(.rr-page-grid[data-preview]) { max-width: 600px; }
  .rr-page-grid[data-preview] { grid-template-columns: minmax(0, 1fr); }
}

/* ---- preview control panel (rewards/preview.mjs) ---- */
.rrp { display: grid; gap: 14px; min-width: 0; padding: 14px; border: 1px dashed rgba(242, 193, 78, .45); border-radius: 6px;
  background: rgba(242, 193, 78, .025); color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }
@media (min-width: 960px) { .rrp { position: sticky; top: 76px; max-height: calc(100dvh - 92px); overflow-y: auto; overscroll-behavior: contain; } }
.rrp p { margin: 0; }
.rrp h2 { margin: 0; color: var(--warn); font: 650 14px/1.3 var(--sans); }
.rrp fieldset { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.rrp legend { margin-bottom: 6px; padding: 0; color: var(--ink-3); font: 11px/1.2 var(--mono); letter-spacing: .08em; }
.rrp-row { display: flex; flex-wrap: wrap; gap: 6px; }
.rrp button { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); color: var(--ink-2);
  cursor: pointer; font: 12px/1.2 var(--sans); }
.rrp button:hover { border-color: #2f5a42; color: var(--ink); }
.rrp button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.rrp select { min-height: 30px; max-width: 100%; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); color: var(--ink); }
.rrp-note { color: var(--ink-3); font-size: 12px; }
.rrp-device { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 4px; background: #030504; }
.rrp-device dl { display: grid; gap: 4px; margin: 0; }
.rrp-device dl > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rrp-device dt { min-width: 5em; color: var(--ink-3); font: 11px/1.4 var(--mono); }
.rrp-device dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; margin: 0; }
.rrp-device code { color: var(--ink); font: 12px/1.4 var(--mono); overflow-wrap: anywhere; }
.rrp-device .rrp-code { color: var(--accent); font: 700 16px/1.2 var(--mono); letter-spacing: .14em; }
.rrp-log, .rrp-ledger { display: grid; gap: 2px; max-height: 168px; margin: 0; padding: 0; overflow: auto; list-style: none; color: var(--ink-3); font: 11px/1.5 var(--mono); }
.rrp-log li b { color: var(--ink-2); font-weight: 600; }
.rrp-log li[data-tone="err"] { color: #ff9d91; }
.rrp-ledger li { display: flex; justify-content: space-between; gap: 8px; }
.rrp-ledger li span:last-child { color: var(--accent); }
.rrp-ledger:empty::before { content: "—"; }
.rrp-jump { display: inline-block; margin-left: 4px; color: var(--warn); }

/* ---- touch, small screens, reduced motion, forced colours ---- */
@media (pointer: coarse) {
  .rr :is(.rr-ghost, .rr-primary, .rr-danger, .rr-claim-btn), .rrp :is(button, select) { min-height: 44px; }
  .rr :is(.rr-rules, .rr-where) > summary { min-height: 44px; }
  .rr-input { height: 44px; font-size: 16px; }
  .rr-launch { min-width: 44px; }
}
@media (max-width: 599.98px) {
  .rr-input { font-size: 16px; }
  .rr-time { font-size: 38px; }
  .rr-card { padding: 12px 12px 14px; }
  .rr-head { align-items: flex-start; }
  .rr-day { white-space: normal; }
  .rr-datatime { margin-left: 0; }
  .rr-page { padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.rr, .rr-dialog, .rr-launch, .rrp), :is(.rr, .rr-dialog, .rr-launch, .rrp) *,
  :is(.rr, .rr-dialog, .rr-launch, .rrp) *::before, :is(.rr, .rr-dialog, .rr-launch, .rrp) *::after { animation: none !important; transition: none !important; }
  .rr-claim-btn[data-state="busy"]::after { display: none; }
}
@media (forced-colors: active) {
  .rr-meter { forced-color-adjust: none; background: GrayText; }
  .rr-meter-fill { background: Highlight; }
  .rr-claim-btn[data-state="locked"], .rr [aria-disabled="true"] { color: GrayText; }
  .rr-dot { forced-color-adjust: none; border-color: CanvasText; }
  .rr-device[data-online="on"] .rr-dot { background: Highlight; }
}

/* Codex: native-device approval uses the existing CC card and action styles. */
.rr-pending{border-color:#6b5b2c}.rr-pending>p{margin:12px 0}.rr-pending-item{padding:14px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}.rr-pending-item>code{display:block;margin:6px 0;color:var(--muted)}

.rr-history-list{list-style:none;padding:0}.rr-history-list li{display:flex;flex-wrap:wrap;gap:8px;padding:12px 0;border-top:1px solid var(--line)}.rr-history-list code{flex-basis:100%;overflow-wrap:anywhere;color:var(--muted)}.rr-history-list time{color:var(--muted);font-size:12px}

/* My riding: the same quiet green panels and compact type as the live ladder. */
.rr-launch-avatar { width:24px; height:24px; border-radius:50%; display:inline-flex; flex:none; overflow:hidden; }
.rr-launch-avatar[hidden] { display:none; }
header.nav .rr-launch { max-width:190px; min-width:0; }
header.nav .rr-launch :is(.rr-launch-label,.rr-launch-short) { max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.my-activity-summary { padding:18px 20px; margin-bottom:16px; border:1px solid var(--line,#264a35); border-radius:10px; background:linear-gradient(135deg,#10261a,#0a130e); }
.my-activity-summary[hidden] { display:none; }
.my-activity-summary h3 { margin:0 0 10px; font:650 14px/1.5 var(--sans); color:var(--accent,#39ff88); }
.my-activity-copy { margin:0 0 8px; color:var(--ink,#e4f5e9); font-size:15px; }
.my-activity-totals { margin:0 0 16px; font:13px/1.6 var(--mono); }
.my-activity-message { margin:12px 0 0; color:var(--ink-3,#93ad9c); font-size:12px; line-height:1.6; }
.my-activity-summary .rr-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.my-activity-summary button { min-height:40px; }
.my-activity-summary .rr-link { margin-left:auto; font-size:12px; }
.account-me-tag { display:inline-flex; align-items:center; margin-left:5px; padding:1px 4px; border:1px solid #39ff8866; border-radius:3px; color:var(--accent,#39ff88); font:600 10px/1.3 var(--sans); vertical-align:middle; }
.account-name-wrap { display:inline-flex; align-items:center; min-width:0; max-width:100%; gap:3px; flex:0 1 auto; grid-area:1/2; }
.account-name-wrap > .name { min-width:0; }
.account-me-opener { flex:none; display:inline-flex; align-items:center; justify-content:center; min-width:32px; min-height:32px; padding:0; border:0; background:transparent; color:inherit; cursor:pointer; }
.account-me-opener .account-me-tag { margin-left:0; }
.account-me-opener:focus-visible { outline:2px solid var(--accent,#39ff88); outline-offset:1px; border-radius:5px; }
@media(pointer:coarse) { .account-me-opener { min-width:44px; min-height:44px; } }
.ladder tr.is-account-me { box-shadow:inset 2px 0 var(--accent,#39ff88); }
.pw-card-head .my-devices-link { grid-column:1/-1; justify-self:start; font-size:12px; }
.rr-device-speed { color:var(--accent,#39ff88); font-family:var(--mono); white-space:nowrap; }
@media(max-width:720px) {
  header.nav .rr-launch { max-width:150px; min-height:44px; }
  header.nav .rr-launch :is(.rr-launch-label,.rr-launch-short) { max-width:88px; }
  .my-activity-summary { padding:16px; }
  .my-activity-summary button { min-height:44px; }
  .my-activity-summary .rr-link { width:100%; margin:4px 0 0; }
}
