/* The Feed, the Profile, the Scorecard and the sign-in pages (feed.js, profile.js,
   scorecard.js, avatar.js, signin.js). The phone's look at phone width (under 768 px), two
   columns on a tablet (768 to 1099 px), a deliberate grid on a computer (1100 px and up).
   Colours only from base.css's tokens; the scorecard's tile tints are the phone's own
   (ScorecardView.swift), each a colour at 13% behind its icon. */

/* ------------------------------------------------------------------ shared pieces */

/* a grey bar where a word or a number will be; it shimmers unless motion is reduced */
.skel {
  display: block; height: 12px; border-radius: 6px; margin: 3px 0;
  background: linear-gradient(90deg, var(--card-2) 0%, #252c39 50%, var(--card-2) 100%);
  background-size: 200% 100%; animation: skel 1.3s ease-in-out infinite;
}
.skel.thin { height: 9px; }
.skel.tall { height: 20px; margin-bottom: 6px; }
.skel.w30 { width: 30%; } .skel.w40 { width: 40%; } .skel.w50 { width: 50%; } .skel.w60 { width: 60%; }
.skel.w70 { width: 70%; } .skel.w80 { width: 80%; }
.stat b .skel { width: 3.2em; height: 14px; margin: 3px 0 2px; }
.skel-round { background: linear-gradient(90deg, var(--card-2) 0%, #252c39 50%, var(--card-2) 100%); background-size: 200% 100%; animation: skel 1.3s ease-in-out infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel, .skel-round { animation: none; } }

/* ------------------------------------------------------------------ the Feed */

.view.feed-view { max-width: 760px; }
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.feed-title { min-width: 0; }
.feed-title h1 { margin: 0; font-size: 26px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-title p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.feed-title h1 .skel { height: 22px; width: 180px; }
.feed-title p .skel { width: 120px; }
/* the phone has no title over its Feed: the filter is the first thing */
@media (max-width: 767px) {
  .feed-title { display: none; }
  .feed-head { margin-bottom: 10px; }
  .feed-head:not(:has(.hill-pick)) { display: none; }
}

/* the hill filter: one button; a menu on a computer, the native picker on a touch screen */
.hill-pick { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hp-wrap { position: relative; min-width: 0; }
.hp-btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  min-height: 40px; padding: 0 12px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line); color: var(--text-2);
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.hp-wrap.set .hp-btn { color: var(--text); border-color: rgba(255, 90, 42, 0.45); }
.hp-btn .ic:first-child { color: var(--text-2); }
.hp-btn .ic:last-child { color: var(--text-3); transition: transform 0.15s ease-out; }
.hp-btn[aria-expanded="true"] .ic:last-child { transform: rotate(180deg); }
.hp-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hp-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; }
.hp-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
  width: max-content; min-width: 260px; max-width: min(380px, calc(100vw - 32px)); max-height: min(420px, 60vh); overflow-y: auto;
  padding: 6px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  animation: hp-in 0.15s ease-out; transform-origin: top right;
}
@keyframes hp-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.hp-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 0 10px;
  border: 0; border-radius: 9px; background: none; color: var(--text); font-size: 14px; text-align: left; cursor: pointer;
}
.hp-opt .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-check { width: 16px; color: var(--accent); visibility: hidden; display: inline-flex; }
.hp-opt.on .hp-check { visibility: visible; }
.hp-opt.on { font-weight: 600; }
.hp-n { color: var(--text-3); font-size: 13px; }
.hp-opt:focus-visible, .hp-opt:hover { background: var(--card-2); outline: none; }
.hp-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.hp-clear { font-size: 14px; font-weight: 500; white-space: nowrap; }
/* a mouse gets the menu; a finger gets the platform's own picker */
@media (hover: hover) and (pointer: fine) { .hp-native { display: none; } }
@media not ((hover: hover) and (pointer: fine)) { .hp-menu { display: none !important; } }
@media (max-width: 767px) {
  .feed-head .hill-pick { width: 100%; justify-content: space-between; }
  .hp-wrap { flex: 0 1 auto; }
  .hp-btn { min-height: 44px; }
  .hp-menu { left: 0; right: auto; transform-origin: top left; }
}

/* the sample days' banner, at the head of the demo's Feed as on the phone */
.feed-demo {
  display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  padding: 14px; margin: 0 0 12px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid rgba(255, 90, 42, 0.3);
}
.feed-demo-text { flex: 1 1 280px; min-width: 0; }
.feed-demo-text b { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; }
.feed-demo-text b .ic { color: var(--accent); }
.feed-demo-text p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.4; }
.feed-demo .row-btns { margin: 0; }

.feed-grid { display: grid; gap: 12px; align-items: start; }
.feed-more { height: 1px; }
.feed-view .day-card { padding: 14px; border-radius: 16px; }
.day-card .who { margin-bottom: 10px; }
.day-card .who .grow b, .day-card .who .grow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-card .title h2 { overflow-wrap: anywhere; }
.day-card .stats { gap: 6px 8px; margin-top: 10px; }
.day-card .stat b { font-size: 15px; }
.day-card .card-img {
  position: relative; margin-top: 12px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: linear-gradient(90deg, var(--card-2) 0%, #222937 50%, var(--card-2) 100%); background-size: 200% 100%;
  animation: skel 1.6s ease-in-out infinite;
}
.day-card .card-img.loaded, .day-card .card-img.broken { animation: none; background: var(--card-2); }
.day-card .card-img img { transition: opacity 0.25s ease-out, transform 0.3s ease-out; }
.day-card .card-img.broken { display: none; }
@media (prefers-reduced-motion: reduce) { .day-card .card-img { animation: none; } }
.day-card.skeleton { pointer-events: none; }
.day-card.skeleton .who .grow { display: grid; gap: 4px; }
.day-card.skeleton .stat { display: grid; gap: 4px; }
.day-card.skeleton .card-img { animation: skel 1.6s ease-in-out infinite; }

a.card.day-card { transition: border-color 0.15s, transform 0.15s ease-out, box-shadow 0.15s; -webkit-tap-highlight-color: transparent; }
a.card.day-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) {
  a.card.day-card:hover { border-color: #3a4456; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); }
  a.card.day-card:hover .card-img img.in { transform: scale(1.02); }
  a.card.day-card:hover .title h2 { color: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  a.card.day-card:hover { transform: none; }
  a.card.day-card:hover .card-img img.in { transform: none; }
}

/* a rider with no days yet */
.feed-empty { max-width: 520px; margin: 24px auto; text-align: center; display: grid; justify-items: center; gap: 12px; }
.feed-empty h1 { margin: 4px 0 0; font-size: 24px; }
.feed-empty > p { margin: 0; color: var(--text-2); max-width: 30em; }
.fe-steps { display: grid; gap: 10px; width: 100%; margin: 8px 0 4px; text-align: left; }
.fe-step {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none !important;
  transition: border-color 0.15s;
}
.fe-step b { display: block; font-size: 16px; }
.fe-step .grow span { display: block; color: var(--text-2); font-size: 13px; margin-top: 2px; }
.fe-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.fe-go { color: var(--text-3); transform: rotate(180deg); display: inline-flex; }
@media (hover: hover) { .fe-step:hover { border-color: #3a4456; } }

@media (min-width: 768px) {
  .view.feed-view { max-width: 1000px; }
  .feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .feed-head { margin-bottom: 16px; }
  .feed-demo { margin-bottom: 16px; }
}
@media (min-width: 1100px) {
  .view.feed-view { max-width: 1280px; }
  .feed-title h1 { font-size: 30px; }
}
@media (min-width: 1360px) {
  .feed-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}

/* ------------------------------------------------------------------ the Profile */

.view.profile-view { max-width: 760px; }
.pv-seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; margin: 0 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.pv-seg a {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px;
  border-radius: 9px; color: var(--text-2); font-size: 14px; font-weight: 600; text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
}
.pv-seg a.on { background: var(--card-2); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
@media (hover: hover) { .pv-seg a:not(.on):hover { color: var(--text); } }
.pv-seg a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.pv-cols { display: grid; gap: 18px; }
.pv-side, .pv-main { display: grid; gap: 18px; align-content: start; min-width: 0; }

/* the hero card: the phone's ProfileHeaderCard */
.hero {
  position: relative; display: grid; justify-items: center; gap: 12px; text-align: center;
  padding: 24px 16px 16px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 90, 42, 0.28) 0%, var(--card) 72%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.hero-photo {
  position: relative; width: 102px; height: 102px; padding: 5px; border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--accent); border: 0; background: none; color: inherit; font: inherit;
}
button.hero-photo { cursor: pointer; }
button.hero-photo:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.hero-photo .ph {
  width: 92px; height: 92px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), rgba(255, 90, 42, 0.6));
  color: #fff; font-size: 32px; font-weight: 700; letter-spacing: 0.02em;
}
.hero-photo .ph img { width: 100%; height: 100%; object-fit: cover; }
.hero-cam {
  position: absolute; right: 2px; bottom: 2px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center; border: 2px solid var(--card);
}
.hero-photo.busy .ph::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%; background: rgba(0, 0, 0, 0.45);
}
.hero-photo.busy .hero-cam .ic { animation: spin 0.9s linear infinite; }
@media (hover: hover) { button.hero-photo:hover .ph { filter: brightness(1.08); } }
.hero h1 { margin: 0; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.hero-place { margin: 2px 0 0; color: var(--text-2); font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hero-chips span { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-chips .demo-chip { background: var(--accent-soft); color: var(--accent); display: inline-flex; gap: 4px; align-items: center; }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%;
  padding: 12px 0; border-radius: 14px; background: rgba(0, 0, 0, 0.25);
}
.hero-stats div { display: grid; gap: 3px; justify-items: center; min-width: 0; padding: 0 4px; }
.hero-stats div + div { border-left: 1px solid rgba(255, 255, 255, 0.08); }
.hero-stats b { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hero-stats span { font-size: 10px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.hero-msg { margin: 0; font-size: 13px; color: var(--bad); }
.hero-score {
  display: flex; align-items: center; gap: 8px; width: 100%; justify-content: center;
  min-height: 40px; border-radius: 12px; color: var(--text); font-weight: 600; font-size: 14px;
  background: rgba(255, 255, 255, 0.06); text-decoration: none !important; transition: background 0.15s;
}
.hero-score .ic { color: var(--accent); }
@media (hover: hover) { .hero-score:hover { background: rgba(255, 255, 255, 0.1); } }

/* a settings group: the phone's inset-grouped List section */
.grp h3 { margin: 0 0 6px 16px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.grp-box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.grp-foot { margin: 6px 16px 0; font-size: 12px; color: var(--text-3); line-height: 1.4; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 14px;
  background: none; border: 0; color: var(--text); font-size: 16px; text-align: left; text-decoration: none !important; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background 0.12s;
}
.row + .row, .row + .row-static, .row-static + .row, .row-static + .row-static { box-shadow: inset 56px 1px 0 -55px var(--line); border-top: 1px solid var(--line); }
.grp-box > :first-child { border-top: 0 !important; }
div.row, .row-static { cursor: default; }
.row-static { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 52px; }
.row .grow b, .row-static .grow b { display: block; font-weight: 500; font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
.row .grow span, .row-static .grow span { display: block; font-size: 13px; color: var(--text-2); margin-top: 1px; }
.row .end, .row-static .end { color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; font-size: 15px; flex: none; }
.row.danger .grow b { color: var(--bad); }
.row:disabled { opacity: 0.5; cursor: default; }
@media (hover: hover) { a.row:hover, button.row:not(:disabled):hover { background: rgba(255, 255, 255, 0.04); } }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tile-ic { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.tile-ic.blue { background: linear-gradient(180deg, #4da3ff, #2f7fe0); }
.tile-ic.teal { background: linear-gradient(180deg, #3dd9d6, #22aab0); }
.tile-ic.gray { background: linear-gradient(180deg, #8e95a3, #6c7483); }
.tile-ic.indigo { background: linear-gradient(180deg, #7b7cff, #5856d6); }
.tile-ic.red { background: linear-gradient(180deg, #ff6b5a, #e5352b); }
.tile-ic.orange { background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.tile-ic.green { background: linear-gradient(180deg, #3dd98c, #22b26c); }
.tile-ic.quiet { background: rgba(255, 255, 255, 0.07); color: var(--text-2); }
.tile-ic.round { border-radius: 50%; width: 40px; height: 40px; }
.row .end .flip-ic { transform: rotate(180deg); }
.chip-current { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(61, 217, 140, 0.18); color: var(--good); }
.ok-tick { color: var(--good); display: inline-flex; }

/* notifications */
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.notice + .notice { border-top: 1px solid var(--line); }
.notice .grow > b { display: block; font-size: 15px; font-weight: 600; }
.notice .grow > span { display: block; font-size: 13px; color: var(--text-2); margin-top: 2px; }
.notice .row-btns { margin-top: 10px; gap: 8px; }
.notice.read .grow > b { font-weight: 400; }
.notice .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; }
.notice .when { font-size: 12px; color: var(--text-3); margin-top: 3px; display: block; }
.grp .msg { margin: 6px 16px 0; }

/* units: the phone's segmented picker */
.seg-u { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); }
.seg-u button { border: 0; background: none; color: var(--text-2); padding: 6px 12px; min-height: 32px; border-radius: 7px; font-size: 14px; cursor: pointer; }
.seg-u button.on { background: var(--card-2); color: var(--text); font-weight: 600; }
.seg-u button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.admin-sel { position: relative; display: inline-flex; align-items: center; }
.admin-sel select {
  appearance: none; -webkit-appearance: none; min-height: 36px; padding: 0 30px 0 12px; border-radius: 9px;
  background: var(--bg); border: 1px solid var(--line); color: var(--text); font-size: 15px; max-width: 52vw; cursor: pointer;
}
.admin-sel .ic { position: absolute; right: 10px; pointer-events: none; color: var(--text-3); }
.admin-sel select option { background: var(--card); }

.pv-foot { display: grid; justify-items: center; gap: 4px; padding: 10px 0 4px; color: var(--text-3); font-size: 12px; text-align: center; }
.pv-foot img { opacity: 0.8; margin-bottom: 4px; }
.pv-foot b { color: var(--text-2); font-size: 13px; }
.pv-foot a { color: var(--text-3); }

.pv-skel .hero { min-height: 300px; }
.pv-skel .grp-box { height: 160px; }

@media (min-width: 768px) {
  .view.profile-view { max-width: 680px; }
}
@media (min-width: 1100px) {
  .view.profile-view { max-width: 1080px; }
  .pv-seg { max-width: 360px; }
  .pv-cols { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
  .pv-side { position: sticky; top: 80px; }
}

/* sheets of the Profile: export and delete */
.pv-sheet-lead { margin: 0 0 14px; color: var(--text-2); }
.gone { display: grid; gap: 14px; padding: 16px; border-radius: 14px; background: var(--card); margin: 4px 0 14px; }
.gone div { display: flex; gap: 12px; align-items: flex-start; }
.gone .ic { color: var(--bad); margin-top: 2px; }
.gone b { display: block; font-size: 15px; }
.gone span { display: block; font-size: 13px; color: var(--text-2); }
.big-ic { display: inline-grid; place-items: center; margin-bottom: 8px; }
.big-ic.bad { color: var(--bad); }
.big-ic.good { color: var(--good); }
.del-input { font-family: var(--mono); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.export-prog { display: grid; gap: 8px; margin: 14px 0 4px; }
.export-prog .prog { height: 8px; background: var(--card-2); border-radius: 4px; overflow: hidden; }
.export-prog .prog i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 0.25s ease-out; }
.export-prog p { margin: 0; font-size: 14px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.btn .spinner.sm { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
.btn-block { width: 100%; }
.linkish { background: none; border: 0; padding: 6px 0; color: var(--accent); font-size: 14px; font-weight: 500; cursor: pointer; }

/* the photo crop: the phone's AvatarCropView */
.crop-sheet .crop-stage { position: relative; display: flex; justify-content: center; margin: 4px 0 12px; touch-action: none; }
.crop-sheet .crop-stage canvas { border-radius: 14px; cursor: grab; max-width: 100%; touch-action: none; }
.crop-sheet .crop-stage canvas:active { cursor: grabbing; }
.crop-sheet .crop-stage canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crop-tools { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.crop-tools input[type="range"] { flex: 1; accent-color: var(--accent); min-height: 32px; }
.crop-tools button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card-2); color: var(--text); display: grid; place-items: center; cursor: pointer; flex: none; }
.crop-tools button:disabled { opacity: 0.4; cursor: default; }
@media (hover: hover) { .crop-tools button:not(:disabled):hover { background: #262e3c; } }
.crop-sheet .row-btns { display: grid; grid-template-columns: 1fr 1fr; }
.photo-view { display: grid; place-items: center; }
.photo-view img { width: min(100%, 512px); aspect-ratio: 1; object-fit: cover; border-radius: 50%; }

/* ------------------------------------------------------------------ the Scorecard */

.view.score-view { max-width: 560px; }
.score-view .pv-seg { margin-bottom: 10px; }
.sc { display: grid; gap: 8px; }
.sc-card, .sc-a, .sc-b { display: grid; gap: 8px; align-content: start; min-width: 0; }
.sc-banner {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 92px; padding: 0 16px; border-radius: 14px; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, rgb(255, 89, 41) 0%, rgb(115, 26, 13) 100%);
}
.sc-banner .y { font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: -0.01em; }
.sc-banner .k { font-size: 11px; font-weight: 700; letter-spacing: 0.23em; opacity: 0.85; margin-top: 4px; }
.sc-banner .n { font-size: 15px; font-weight: 600; margin-top: 4px; }
.sc-banner img { height: 50px; width: auto; opacity: 0.9; filter: brightness(0) invert(1); }
.sc-h { margin: 2px 0 -3px; line-height: 14px; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); }
.sc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sc-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sc-tile {
  --c: 255, 90, 42;
  display: grid; gap: 1px; align-content: start; min-width: 0; padding: 7px 10px; border-radius: 12px;
  background: rgba(var(--c), 0.13);
}
.sc-tile .ic { color: rgb(var(--c)); }
.sc-tile b { font-size: 17px; font-weight: 700; line-height: 1.2; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-tile span { font-size: 9px; line-height: 12px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.sc-tile { border: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.sc-crown {
  display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 199, 51, 0.28) 0%, rgba(255, 107, 41, 0.10) 100%);
}
.sc-crown .ic { color: rgb(255, 199, 51); flex: none; }
.sc-crown b { display: block; font-size: 27px; font-weight: 900; line-height: 1.1; }
.sc-crown span { display: block; font-size: 10px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; overflow-wrap: anywhere; }
.sc-years { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.sc-years::-webkit-scrollbar { display: none; }
.sc-years a { flex: none; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none !important; }
.sc-years a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sc-mark { display: none; }
.sc-banner { grid-column: 1 / -1; }
.sc-empty { text-align: center; padding: 56px 12px; color: var(--text-2); display: grid; justify-items: center; gap: 10px; }
.sc-empty .ic { color: var(--text-3); }
.sc-empty h2 { margin: 0; color: var(--text); font-size: 20px; }
.sc-empty p { margin: 0; max-width: 28em; }

/* a computer: the card as something to share, framed, with the site's name under it */
@media (min-width: 768px) {
  .view.score-view { max-width: 640px; }
  .sc-card { padding: 18px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); gap: 10px; }
  .sc-banner { height: 112px; padding: 0 22px; }
  .sc-banner .y { font-size: 42px; }
  .sc-grid, .sc-grid.two { gap: 10px; }
  .sc-tile { padding: 12px 14px; gap: 3px; }
  .score-view .pv-seg { margin-bottom: 14px; }
  .sc-tile b { font-size: 20px; }
  .sc-tile span { font-size: 10px; }
  .sc-card .sc-a, .sc-card .sc-b { gap: 10px; }
  .sc-tile .ic { width: 18px; height: 18px; }
  .sc-mark { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; color: var(--text-3); font-size: 13px; font-weight: 600; }
  .sc-mark img { height: 16px; width: auto; }
}

/* ------------------------------------------------------------------ sign in and create */

.signin { padding-top: max(40px, env(safe-area-inset-top)); }
.signin h1 { letter-spacing: -0.01em; }
.signin > .muted { line-height: 1.45; }
.signin .form { border-radius: 18px; padding: 20px; }
.signin .form .btn { min-height: 48px; }
.signin .btn-google { gap: 10px; }
.signin .btn-google:disabled { background: #fff; color: #1f1f1f; }
.signin .field { margin: 12px 0 10px; }
.signin .field input { min-height: 48px; }
.signin .field input:focus-visible { outline: 2px solid rgba(255, 90, 42, 0.6); border-color: transparent; }
.signin .check {
  padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  transition: border-color 0.15s, background 0.15s;
}
.signin .check:has(input:checked) { border-color: rgba(255, 90, 42, 0.55); background: var(--accent-soft); }
.signin .check input { flex: none; }
.signin .gated { transition: opacity 0.2s ease-out; }
.signin .gated.off { opacity: 0.4; }
.signin .msg { display: flex; gap: 8px; align-items: flex-start; text-align: left; line-height: 1.4; }
.signin .msg .ic { flex: none; margin-top: 1px; }
.signin .msg.busy { color: var(--text-2); }
.signin .code-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.signin .code-links button { background: none; border: 0; padding: 8px 0; color: var(--accent); font-size: 14px; font-weight: 500; cursor: pointer; }
.signin .code-links button:disabled { color: var(--text-3); cursor: default; }
.signin .sent-to { margin: 0 0 4px; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.signin .sent-to b { color: var(--text); overflow-wrap: anywhere; }
.signin #code { text-align: center; }
.signin .switch a, .signin .mini-links a { padding: 6px 2px; }
@media (hover: hover) { .signin .mini-links a:hover { color: var(--text-2); } }
@media (min-width: 768px) {
  .signin { padding-top: 64px; }
  .signin .form { padding: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }
}

/* a computer: the card turns landscape, bests on the left and the year on the right, so the
   whole of it is on screen at once, like the phone's */
@media (min-width: 1100px) {
  .view.score-view { max-width: 1040px; }
  .score-view .pv-seg { margin-left: auto; margin-right: auto; }
  .score-view .sc-years { justify-content: center; }
  .sc-card { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); column-gap: 18px; padding: 22px; }
  .sc-banner { grid-column: 1; grid-row: 1; height: auto; min-height: 150px; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; }
  .sc-banner .y { font-size: 52px; }
  .sc-banner img { position: absolute; right: 22px; bottom: 18px; height: 72px; }
  .sc-a { grid-column: 1; grid-row: 2; }
  .sc-b { grid-column: 2; grid-row: 1 / span 2; }
  .sc-mark { grid-row: 3; }
}

/* the scorecard's way in from the hero card: the segmented control already offers it above a
   phone's hero, a computer's left column has room for it */
.hero .hero-score { display: none; }
@media (min-width: 1100px) { .hero .hero-score { display: flex; } }
.signin .msg:empty { display: none; }
/* the dimmed block is dim enough: its disabled buttons do not dim again inside it */
.signin .gated.off .btn:disabled { opacity: 1; }
