.rp {
  --rp-ink: var(--ink, #1b3433);
  --rp-teal: var(--teal, #08796f);
  --rp-muted: #526a60;
  --rp-line: #d5e2dc;
  --rp-soft: #e7f2ec;
  color: var(--rp-ink);
  line-height: 1.5;
}
.rp h1, .rp h2, .rp h3, .rp p { margin: 0; }
.rp h2 { font-size: 1.18rem; line-height: 1.22; letter-spacing: -.035em; }
.rp h3 { font-size: 1rem; line-height: 1.3; }
.rp textarea { font: inherit; }
.rp :focus-visible { outline: 3px solid #258c82; outline-offset: 3px; }
.rp-top { border-bottom: 1px solid var(--rp-line); }
.rp-topinner {
  max-width: 1140px;
  min-height: 68px;
  margin: 0 auto;
  padding: 10px clamp(16px, 4vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rp-brand {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  letter-spacing: -.035em;
}
.rp-brand img { width: 34px; height: 34px; }
.rp-link, .rp-source {
  color: var(--rp-teal);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: .9rem;
}
.rp-link { min-height: 44px; border: 0; background: none; padding: 6px 0; text-align: left; font-weight: 600; cursor: pointer; }
.rp-source { display: inline-block; margin-top: 4px; }
.rp-body { width: min(calc(100% - 36px), 680px); margin: auto; padding: clamp(22px, 5.2vw, 54px) 0 34px; }
.rp-result {
  padding: clamp(25px, 5vw, 43px) clamp(14px, 4vw, 34px) 24px;
  border: 1px solid var(--rp-line);
  border-radius: 24px;
  background: linear-gradient(135deg, #eff7f0, #f4fbf9 75%);
  text-align: center;
}
.rp-identity, .rp-about, .rp-next-date { color: var(--rp-muted); }
.rp-identity { font-size: .87rem; }
.rp-result h1 { margin-top: 12px; font-size: clamp(1.2rem, 3vw, 1.55rem); font-weight: 600; letter-spacing: -.045em; }
.rp .rp-percent {
  margin: 1px 0 9px;
  color: var(--rp-teal);
  font-size: clamp(4rem, 11vw, 6.3rem);
  line-height: 1.04;
  letter-spacing: -.085em;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
}
.rp .rp-percent.rp-unscored { font-size: clamp(2.2rem, 7vw, 3.5rem); letter-spacing: -.06em; }
.rp-confidence { display: inline-flex; align-items:center; gap:3px; padding: 0 3px 0 11px; background: #daece2; color: #275c4a; border-radius: 24px; font-size: .8rem; font-weight: 700; }
.rp-confidence-help { display:grid; place-items:center; width:32px; height:32px; border:0; border-radius:50%; background:transparent; color:inherit; font-size:1rem; cursor:pointer; }
.rp-tip { position:fixed; inset:auto; width:min(290px,calc(100vw - 20px)); box-sizing:border-box; margin:0; padding:12px 14px; border:1px solid var(--rp-line); border-radius:12px; color:var(--rp-ink); background:white; box-shadow:0 4px 18px #193f3020; font-size:.87rem; text-align:left; }
.rp .rp-about { max-width: 36ch; margin: 11px auto 0; font-size: .94rem; }
.rp-main-actions { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; margin-top: 21px; }
.rp .rp-next-date { font-size: .82rem; margin-top: 12px; }
.rp-button {
  display: inline-flex;
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 45px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  text-decoration: none;
  font-size: .94rem;
  font-weight: 700;
  cursor: pointer;
}
.rp-primary { background: var(--rp-teal); color: #fff; }
.rp-primary:hover { background: #05655c; }
.rp-secondary { border-color: #bfdbd0; background: #f3f9f6; color: #116c62; }
.rp-secondary:hover { background: #e5f2eb; }
.rp-card { margin-top: 15px; padding: clamp(16px, 4vw, 25px); border: 1px solid var(--rp-line); border-radius: 17px; background: #fff; }
.rp-card > .rp-muted { margin-top: 6px; }
.rp-muted, .rp-focus p, .rp-access { color: var(--rp-muted); font-size: .9rem; }
.rp-card .rp-button { margin-top: 15px; }
.rp-card-actions { display: flex; align-items: center; column-gap: 16px; flex-wrap: wrap; margin-top: 15px; }
.rp-card-actions .rp-button, .rp-card-actions .rp-source { margin-top: 0; }
.rp-card-actions .rp-source, .rp-focus .rp-source { display: inline-flex; align-items: center; min-height: 44px; }
.rp-changes .rp-link, .rp-nutrition .rp-link { margin-top: 3px; }
.rp .rp-label { color: var(--rp-muted); font-size: .82rem; font-weight: 700; }
.rp-programtitle { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px 16px; margin: 4px 0 12px; }
.rp-programtitle h2 { font-size: clamp(1.75rem, 5.6vw, 2.4rem); line-height: 1.1; letter-spacing: -.065em; }
.rp-programtitle p { font-size: .83rem; color: var(--rp-muted); }
.rp-programtitle strong { color: var(--rp-ink); }
.rp-focus { padding-top: 12px; border-top: 1px solid var(--rp-line); }
.rp-focus h3 { color: var(--rp-muted); font-size: .83rem; }
.rp-focus h3 + p { color: var(--rp-ink); font-size: 1rem; margin: 4px 0; }
.rp .rp-access { margin-top: 10px; }
.rp-calories { margin-top: 4px !important; color: var(--rp-teal); font-size: 1rem; }
.rp-calories strong { font-size: clamp(1.74rem, 5.4vw, 2.25rem); letter-spacing: -.055em; }
.rp-lines { list-style: none; margin: 6px 0 0; padding: 0; }
.rp-lines li { border-bottom: 1px solid var(--rp-line); padding: 10px 0; }
.rp-lines li:last-child { border-bottom: 0; }
.rp-reading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.rp-reading > :last-child { text-align: right; }
.rp-readings { display: inline-flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.rp-readings small, .rp-reading-meta { color: var(--rp-muted); font-size: .8rem; }
.rp-compare-values { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; margin-top: 2px; font-size: .91rem; }
.rp-compare-values .rp-readings { align-items: flex-start; }
.rp-changes .rp-lines .rp-muted { font-size: .8rem; }
.rp-details { margin-top: 15px; border: 1px solid var(--rp-line); border-radius: 15px; background: #fff; }
.rp-details summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 17px; font-weight: 700; list-style: none; cursor: pointer; }
.rp-details summary::-webkit-details-marker { display: none; }
.rp-details summary::after { content: '+'; font-size: 1.25rem; line-height: 1; color: var(--rp-teal); }
.rp-details[open] summary::after { content: '−'; }
.rp-explain { color: var(--rp-muted); font-size: .91rem; padding: 1px 17px 15px; }
.rp-explain h3 { margin: 14px 0 4px; color: var(--rp-ink); }
.rp-explain .rp-reading { color: var(--rp-ink); }
.rp-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 22px; margin-top: 7px; }
.rp-status { font-size: .87rem; color: var(--rp-teal); text-align: center; }
.rp-status textarea { display: block; width: 100%; min-height: 8rem; padding: 9px; border: 1px solid var(--rp-line); border-radius: 8px; }
.rp-footer { text-align: center; font-size: .8rem; color: var(--rp-muted); margin-top: 7px; }
.rp-history-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.rp-history h1, .rp-empty h1 { font-size: clamp(1.9rem, 6vw, 2.68rem); line-height: 1.02; letter-spacing: -.065em; }
.rp-history-card label { display: block; margin: 14px 0 4px; font-size: .88rem; font-weight: 600; }
.rp-history-card select { width: 100%; min-height: 44px; padding: 7px 10px; border: 1px solid var(--rp-line); border-radius: 8px; background: #f6faf7; }
.rp-chart { margin: 14px 0 4px; padding: 10px 12px; border: 1px solid var(--rp-line); border-radius: 9px; background: #f7fbf8; color: var(--rp-muted); }
.rp-chart figcaption, .rp-chart-dates { font-size: .82rem; }
.rp-chart svg { display: block; width: 100%; max-height: 145px; overflow: visible; }
.rp-chart text { fill: currentColor; font-size: 12px; }
.rp-chart-grid { stroke: #cbddd3; stroke-width: 1; }
.rp-chart-line { stroke: var(--rp-teal); stroke-width: 2.25; stroke-linecap: round; }
.rp-chart-point { fill: var(--rp-teal); stroke: var(--rp-teal); stroke-width: 1.5; }
.rp-chart-open { fill: #f7fbf8; }
.rp-chart-dates { display: flex; justify-content: space-between; gap: 8px; }
.rp-history-note { min-height: 24px; align-items: center; }
.rp-history-note:empty, .rp-history-note:has(> div:empty):not(:has(button)) { display: none; }
.rp-history-note span { display: block; font-size: .8rem; }
.rp-history-note .rp-link { min-height: 36px; }
.rp-history-card .rp-link { flex: 0 0 auto; }
@media (max-width: 480px) {
  .rp-topinner { min-height: 61px; }
  .rp-body { width: calc(100% - 28px); }
  .rp-result { border-radius: 19px; }
  .rp-main-actions .rp-button { flex: 1 1 auto; }
}
@media (max-width: 345px) {
  .rp-main-actions { display: grid; }
  .rp .rp-percent { font-size: clamp(3rem, 16vw, 4rem); }
}
