.dashboard, .account-panel {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  --dash-green: #217941;
  --dash-amber: #8c5700;
  container-type: inline-size;
}
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 10px;
}
.dashboard .section-title { margin-inline-start: 0; }
.dash-tile, .archive-panel, .profile-card {
  background: var(--surface);
  color: var(--ink);
  border-radius: 19px;
}
.dash-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-row: span 3;
  grid-template-rows: subgrid;
  justify-items: center;
  padding: 14px 4px;
  align-content: start;
  text-align: center;
}
.dash-tile:only-child { grid-column: 1 / -1; }
.dash-grid:not(:has(:nth-child(3))) { grid-template-columns: 1fr; }
.dash-symbol {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
}
.dash-symbol svg { width: 20px; height: 20px; stroke-width: 2; }
.symbol-all { background: #007aff; }
.symbol-saved { background: #00a683; }
.symbol-updates { background: #6359df; }
.dash-tile strong { font-size: clamp(1.3rem, 6.8cqi, 1.9rem); line-height: 1.12; letter-spacing: -.04em; }
.dash-caption { align-self: start; color: var(--muted); font-size: .8125rem; line-height: 1.2; font-weight: 500; }
.dash-note { color: var(--muted); font-size: .8125rem; margin: 9px 6px 0; }
.archive-panel { padding: 16px; }
.archive-total, .archive-format { display: flex; align-items: center; gap: 8px; }
.archive-total { justify-content: space-between; }
.archive-total strong { font-size: 1.375rem; letter-spacing: -.035em; }
.archive-total span { text-align: right; }
.archive-total span, .archive-count, .account-label small { color: var(--muted); font-size: .875rem; }
.archive-bar {
  margin: 12px 0 14px;
  display: flex;
  gap: 1px;
  height: 15px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--subtle);
}
.archive-formats { display: grid; gap: 10px; }
.archive-format { font-size: .9375rem; }
.format-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.archive-size { text-align: right; min-width: 5em; }
.archive-count { text-align: right; margin-left: auto; }
.archive-controls { display: flex; flex-wrap: wrap; gap: 0 12px; margin: -4px 0 8px; }
.archive-picker {
  flex: 1 1 205px;
  display: flex;
  background: var(--subtle);
  border-radius: 22px;
  margin: 5px 0;
}
.archive-picker button {
  color: var(--ink);
  font-size: .875rem;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 6px;
  margin-block: -4px;
  position: relative;
  isolation: isolate;
}
.archive-picker button[aria-pressed="true"] { font-weight: 600; }
.archive-picker button[aria-pressed="true"]::before {
  content: '';
  position: absolute;
  inset: 7px 3px;
  background: var(--segment, var(--surface));
  z-index: -1;
  border-radius: 18px;
  box-shadow: 0 1px 4px #0002;
}
.account-panel { margin: 0 0 18px; }
.account-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.account-header .section-title { margin: 8px 0; }
.profile-add { font-size: .9375rem; text-align: right; gap: 6px; font-weight: 500; }
.profile-add svg { width: 19px; height: 19px; }
.profile-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.profile-card {
  position: relative; min-width: 0; display: grid;
  grid-template-columns: auto minmax(0, 1fr); min-height: 108px;
  border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line);
}
.profile-card.is-primary { box-shadow: inset 0 0 0 1.5px var(--accent); }
.profile-card.is-inactive { box-shadow: inset 0 0 0 1px var(--line); }
.is-inactive .account-toggle { opacity: .5; }
.profile-more {
  grid-area: 1 / 1; align-self: center; width: 44px; height: 44px; color: var(--blue);
}
.profile-more svg { width: 18px; height: 18px; stroke-width: 2.5; transform: rotate(90deg); }
.account-menu { background: var(--surface); border-radius: 18px; margin-bottom: 12px; }
.account-menu button { width: 100%; min-height: 50px; padding: 6px 14px; }
.account-menu button + button { border-top: .5px solid var(--line); }
.account-toggle {
  grid-area: 1 / 2; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; padding: 12px; text-align: start; color: var(--ink); column-gap: 12px;
}
.profile-card:has(.profile-more) .account-toggle { padding-inline-start: 0; }
.account-toggle .account-label { align-content: center; gap: 5px; }
.account-toggle .account-label strong { font-size: .9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-toggle .account-label small { font-size: .75rem; }
.account-toggle:active { opacity: .6; }
.account-toggle:disabled:not([aria-checked="false"]) { opacity: 1; }
.sync-outline {
  pointer-events: none; position: absolute; inset: 0; width: 100%; height: 100%;
  fill: none; stroke: var(--accent); stroke-width: 2px;
}
.sync-outline rect {
  width: calc(100% - 2px); height: calc(100% - 2px);
  stroke-dasharray: 24 76; stroke-linecap: round;
  animation: purchases 2.4s linear infinite;
}
.profile-card.is-syncing { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.account-label .sync-state { color: var(--blue); }
@keyframes purchases { to { stroke-dashoffset: -100; } }
@media (prefers-reduced-motion: reduce) {
  .sync-outline rect { animation: none; stroke-dasharray: none; }
}
.profile-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  color: var(--muted);
  background: var(--subtle);
  border-radius: 50%;
  font-size: 1.125rem;
  font-weight: 500;
  overflow: hidden;
}
.profile-avatar canvas { display: block; width: 100%; height: 100%; }
.account-label { display: grid; gap: 3px; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.account-label strong { font-weight: 600; }
.account-label small { line-height: 1.25; }
.account-toggle .account-label small:not(.sync-state) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-badges {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end;
  align-self: center; gap: 6px; min-height: 84px;
}
.profile-badges span {
  font-size: .6875rem; font-weight: 600; color: var(--muted); line-height: 16px;
  display: grid; place-items: center; min-height: 24px; min-width: 38px;
  padding: 0 10px; border-radius: 18px; white-space: nowrap;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.profile-badges .profile-primary { color: var(--blue); }
.profile-badges .profile-primary, .profile-badges span:last-child { min-width: 74px; padding-inline: 12px; }
.profile-badges .profile-authenticated { color: var(--dash-green); }
.profile-badges .profile-signedOut { color: var(--red); }
.profile-badges .profile-expired, .profile-badges .profile-unknown { color: var(--dash-amber); }
.profile-confirm { display: flex; align-items: center; gap: 12px; margin: 12px 0 20px; color: var(--ink); }
.account-switch {
  width: 50px;
  height: 30px;
  flex: none;
  border-radius: 16px;
  background: color-mix(in srgb, var(--muted) 30%, var(--surface));
  display: flex;
  align-items: center;
  padding: 2px;
}
.account-switch::after {
  content: '';
  width: 26px;
  height: 26px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 4px #0003;
}
@media (prefers-color-scheme: dark) {
  .account-panel { --dash-green: #50dc80; --dash-amber: #ffd15f; }
}
@container (max-width: 20.5rem) {
  .account-toggle { column-gap: 7px; }
  .account-toggle .profile-avatar { width: 36px; height: 36px; }
  .dash-grid { grid-template-columns: 1fr; gap: 8px; }
  .dash-tile { grid-row: auto; grid-template-rows: auto; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; text-align: left; padding: 11px 14px; gap: 12px; }
  .dash-caption { grid-area: 1 / 2; place-self: center start; font-size: .9375rem; }
  .dash-tile strong { grid-area: 1 / 3; }
  .profile-add { font-size: .875rem; }
}
@container (min-width: 32.5rem) {
  .dash-caption { font-size: .9375rem; }
}
.account-toggle, .profile-more { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
