/* The hub, in the look of the danna app. A purple frame around a white panel holds the side list and the page. Buttons, fields,
   cards, chips, the search (the app's palette) and the account menu take the app's sizes, radii, shadows and type, in Classic and
   in Playful. The app's tokens are set here for the hub, so the site's own buttons keep their look on the other pages. */

body[data-page='hub'] {
  --radius: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 51, 0.05);
  --shadow: 0 10px 24px -14px rgba(15, 27, 51, 0.22), 0 1px 2px rgba(15, 27, 51, 0.05);
  --shadow-lift: 0 18px 36px -18px rgba(15, 27, 51, 0.3);
  --primary-100: #e1dbf8;
  --hb-frame-a: #2a1c8c;
  --hb-frame-b: #3a2693;
  --hb-frame-c: #5337d2;
  --hb-glow: rgba(138, 109, 255, 0.45);
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 520px at 92% -14%, var(--hb-glow), transparent 62%),
    linear-gradient(180deg, var(--hb-frame-a) 0%, var(--hb-frame-b) 46%, var(--hb-frame-c) 100%);
  color: var(--ink);
  font-family: var(--font);
}

:root[data-look='playful'] body[data-page='hub'] {
  --radius: 16px;
  --shadow-sm: 0 2px 0 var(--line-2);
  --shadow: 0 4px 0 var(--line-2);
  --shadow-lift: 0 6px 0 var(--line-2), 0 18px 30px -18px rgba(29, 26, 61, 0.35);
  --primary-100: #dcd2ff;
  --hb-frame-a: #3d24b5;
  --hb-frame-b: #4f2fd6;
  --hb-frame-c: #6a4bef;
  --hb-glow: rgba(155, 134, 255, 0.5);
}

.hb-svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- The title bar, on the purple frame: the wordmark, the search, the language and the account ---------- */
.hb-top {
  position: relative;
  z-index: 30;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 20px;
}

.hb-top .wordmark {
  color: #ffffff;
}

.hb-top__spacer {
  flex: 1;
  min-width: 24px;
}

body[data-page='hub'] .btn.hb-top__btn {
  color: #ffffff;
}

body[data-page='hub'] .btn.hb-top__btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

body[data-page='hub'] .menu-anchor {
  position: relative;
}

.hb-me {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary);
  cursor: pointer;
  transition: box-shadow 0.2s var(--ease);
}

.hb-me:hover {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.hb-me__face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 14px/1 var(--font);
  color: var(--primary);
}

.hb-me__face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s;
}

.hb-me__face img.is-loaded {
  opacity: 1;
}

/* The account menu: the app's menu, with the look and the sign-out in it */
body[data-page='hub'] .menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: 240px;
  padding: 6px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
}

body[data-page='hub'] .menu__head {
  display: flex;
  flex-direction: column;
  padding: 8px 10px 10px;
}

body[data-page='hub'] .menu__name {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}

body[data-page='hub'] .menu__mail {
  overflow: hidden;
  font-size: 12.5px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page='hub'] .menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font: 560 14px/1.2 var(--font);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

body[data-page='hub'] .menu__item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

body[data-page='hub'] .menu__item svg {
  width: 17px;
  height: 17px;
  flex: none;
}

body[data-page='hub'] .menu__item--danger {
  color: #c2332d;
}

body[data-page='hub'] .menu__sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

body[data-page='hub'] .hb-check {
  margin-left: auto;
  color: var(--primary);
  visibility: hidden;
}

body[data-page='hub'] .menu__item[aria-pressed='true'] .hb-check {
  visibility: visible;
}

:root[data-look='playful'] body[data-page='hub'] .menu {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--line-2);
}

/* ---------- The search: the app's palette, opened from the search button, Ctrl+K or / ---------- */
body[data-page='hub'] .palette-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 64px 24px 24px;
  background: rgba(15, 27, 51, 0.28);
}

body[data-page='hub'] .palette {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(640px, 100%);
  max-height: calc(100vh - 88px);
  padding: 14px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lift);
}

body[data-page='hub'] .palette__body {
  min-height: 0;
  overflow-y: auto;
}

body[data-page='hub'] .palette__hint {
  margin: 0;
  padding: 14px 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

body[data-page='hub'] .palette__list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body[data-page='hub'] .palette__group {
  padding: 10px 10px 4px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

body[data-page='hub'] .palette__item {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
}

body[data-page='hub'] .palette__item.is-active {
  background: var(--primary-50);
}

body[data-page='hub'] .palette__title {
  overflow: hidden;
  font-weight: 650;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page='hub'] .palette__detail {
  overflow: hidden;
  font-size: 13px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page='hub'] .palette__foot {
  margin: 0;
  padding: 0 4px;
  font-size: 12.5px;
  color: var(--muted);
}

body[data-page='hub'] .search-field {
  position: relative;
  display: block;
}

body[data-page='hub'] .search-field > svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

body[data-page='hub'] .search-field .input {
  padding-left: 42px;
  padding-right: 44px;
}

body[data-page='hub'] .search-field input[type='search']::-webkit-search-cancel-button {
  display: none;
  -webkit-appearance: none;
}

/* ---------- Buttons: the app's sizes, radii and colours ---------- */
body[data-page='hub'] .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 620 15px/1 var(--font);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s var(--ease),
    background-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

body[data-page='hub'] .btn:hover {
  transform: none;
}

body[data-page='hub'] .btn:active:not(:disabled) {
  transform: scale(0.98);
}

body[data-page='hub'] .btn:disabled {
  opacity: 0.45;
  cursor: progress;
}

body[data-page='hub'] .btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

body[data-page='hub'] .btn svg {
  width: 18px;
  height: 18px;
}

body[data-page='hub'] .btn--primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 18px -10px rgba(83, 55, 210, 0.85);
}

body[data-page='hub'] .btn--primary:hover:not(:disabled) {
  background: var(--primary-600);
}

body[data-page='hub'] .btn--ghost {
  background: var(--canvas);
  color: var(--ink);
  border-color: var(--line-2);
  box-shadow: none;
}

body[data-page='hub'] .btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: #bcc6d8;
}

body[data-page='hub'] .btn--danger {
  background: var(--canvas);
  color: #c2332d;
  border-color: #f1cdc9;
  box-shadow: none;
}

body[data-page='hub'] .btn--danger:hover:not(:disabled) {
  background: #fdf0ef;
}

body[data-page='hub'] .btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  box-shadow: none;
}

body[data-page='hub'] .btn--icon:hover:not(:disabled) {
  background: var(--surface-2);
}

body[data-page='hub'] .btn--icon svg {
  width: 20px;
  height: 20px;
}

/* Playful: the same buttons, with a thinner edge underneath */
:root[data-look='playful'] body[data-page='hub'] .btn {
  height: 48px;
  border-radius: var(--radius);
  font-weight: 800;
}

:root[data-look='playful'] body[data-page='hub'] .btn--icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

:root[data-look='playful'] body[data-page='hub'] .btn--primary {
  box-shadow: 0 2px 0 var(--primary-700);
}

:root[data-look='playful'] body[data-page='hub'] .btn--ghost {
  border-width: 2px;
  box-shadow: 0 2px 0 var(--line-2);
}

:root[data-look='playful'] body[data-page='hub'] .btn--danger {
  border-width: 2px;
  box-shadow: 0 2px 0 #f0c3c0;
}

:root[data-look='playful'] body[data-page='hub'] .btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: none;
}

/* ---------- Fields: the app's inputs and labels ---------- */
body[data-page='hub'] .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body[data-page='hub'] .field__label {
  font: 620 13px/1.3 var(--font);
  color: var(--ink-2);
}

body[data-page='hub'] .field__hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

body[data-page='hub'] .field__error {
  font: 560 12.5px/1.4 var(--font);
  color: #c2332d;
}

body[data-page='hub'] .field__error:empty {
  display: none;
}

body[data-page='hub'] .input,
body[data-page='hub'] .field__input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  box-shadow: none;
  transition:
    border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}

body[data-page='hub'] .input:focus,
body[data-page='hub'] .field__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(83, 55, 210, 0.14);
}

body[data-page='hub'] .field__input--secret {
  padding-right: 46px;
}

body[data-page='hub'] .field.is-invalid .field__input {
  border-color: #d9363e;
  background: #fdf0ef;
}

body[data-page='hub'] .field__wrap {
  position: relative;
}

body[data-page='hub'] .field__toggle {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 4px;
  display: grid;
  place-items: center;
  width: 36px;
  margin: auto 0;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

body[data-page='hub'] .field__toggle:hover {
  background: var(--surface-2);
  color: var(--ink);
}

body[data-page='hub'] .field__toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body[data-page='hub'] .field__toggle .icon-off {
  display: none;
}

body[data-page='hub'] .field__toggle[aria-pressed='true'] .icon-on {
  display: none;
}

body[data-page='hub'] .field__toggle[aria-pressed='true'] .icon-off {
  display: block;
}

/* ---------- The side list and the white panel ---------- */
/* The white panel fills the frame below the title bar. The purple frame stays around it, and only the page inside scrolls. */
.hb-panel {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 16px 16px;
  border-radius: 22px;
  background: var(--canvas);
  box-shadow: 0 34px 60px -40px rgba(10, 4, 40, 0.75);
  overflow: hidden;
}

/* The side column is as tall as the panel. Its list stays in view while the page scrolls. */
.hb-side {
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  border-radius: 22px 0 0 22px;
  background: var(--surface-2);
}

.hb-nav {
  position: sticky;
  top: 0;
  display: grid;
  gap: 4px;
  padding: 22px 14px;
}

.hb-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font: 560 14px/1.2 var(--font);
  text-decoration: none;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.hb-nav a .hb-svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.hb-nav a:hover {
  background: var(--canvas);
  color: var(--ink);
}

.hb-nav a[aria-current='true'] {
  background: var(--primary-50);
  color: var(--primary-700);
}

.hb-main {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 32px clamp(20px, 3.4vw, 44px) 80px;
}

.hb-banner {
  height: 150px;
  margin-bottom: 24px;
  border-radius: var(--radius);
  background:
    var(--hb-banner) center / cover no-repeat,
    var(--surface-2);
}

/* ---------- Sections and the page head ---------- */
.hb-section {
  display: grid;
  gap: 16px;
  min-width: 0;
  scroll-margin-top: 24px;
}

.hb-section + .hb-section {
  margin-top: 48px;
}

.hb-section__title {
  margin: 0;
  font: 700 20px/1.25 var(--font);
  letter-spacing: -0.015em;
  color: var(--ink);
}

.hb-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.hb-hero__text {
  flex: 1;
  min-width: 0;
}

.hb-name {
  margin: 0;
  font: 750 32px/1.2 var(--font);
  letter-spacing: -0.02em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.hb-meta {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.hb-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
}

.hb-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s;
}

.hb-avatar img.is-loaded {
  opacity: 1;
}

.hb-avatar__initial {
  font: 700 28px/1 var(--font);
  color: #ffffff;
}

.hb-chips {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  gap: 8px;
}

.hb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font: 600 12.5px/1 var(--font);
  white-space: nowrap;
}

.hb-chips .hb-chip:first-child {
  border-color: var(--primary-100);
  background: var(--primary-50);
  color: var(--primary-700);
}

.hb-chip--good {
  border-color: transparent;
  background: #d9f5ec;
  color: #0f7a62;
}

.hb-chip--warn {
  border-color: transparent;
  background: #fff3d6;
  color: #8a4b00;
}

.hb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.hb-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.hb-hint {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.hb-stack {
  display: grid;
  gap: 10px;
}

.hb-stack .btn {
  width: 100%;
}

/* ---------- Cards, the summary and the tiles (the app's card) ---------- */
.hb-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: var(--shadow-sm);
}

.hb-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}

.hb-card__title {
  margin: 0;
  font: 650 16px/1.35 var(--font);
  color: var(--ink);
}

.hb-card__note {
  font-size: 12.5px;
  color: var(--muted);
}

.hb-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.hb-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.hb-cell {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: var(--shadow-sm);
}

.hb-cell__label {
  font: 600 13px/1.3 var(--font);
  color: var(--muted);
}

.hb-cell__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}

.hb-cell__value {
  font: 750 26px/1.05 var(--font);
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.hb-cell__sub {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.hb-cell .hb-bar {
  margin-top: 4px;
}

.hb-cell .ring {
  flex: none;
  width: 48px;
  height: 48px;
}

.hb-cell .flame {
  flex: none;
  width: 24px;
  height: 24px;
}

.hb-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.hb-tiles--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hb-tile {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: var(--shadow-sm);
}

/* The app's icon tile: a purple square with the icon in it */
.hb-tile__ico,
.hb-badge__ico,
.hb-ico {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--primary-50);
  color: var(--primary);
}

.hb-tile__ico svg,
.hb-badge__ico svg,
.hb-ico svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hb-tile__value {
  font: 750 22px/1.1 var(--font);
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.hb-tile__label {
  font: 560 13px/1.35 var(--font);
  color: var(--muted);
}

.hb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hb-grid--chart {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}

/* ---------- Lists, the chart, the skills and the bars ---------- */
.hb-list {
  display: grid;
  gap: 2px;
}

.hb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 9px 2px;
}

.hb-row + .hb-row {
  border-top: 1px solid var(--line);
}

.hb-row__main {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.hb-row__title,
.hb-row__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hb-row__title {
  font: 600 14px/1.3 var(--font);
  color: var(--ink);
}

.hb-row__meta {
  font-size: 12.5px;
  color: var(--muted);
}

.hb-row__end {
  font: 600 13px/1.2 var(--font);
  color: var(--ink-2);
  white-space: nowrap;
}

.hb-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.hb-ico svg {
  width: 17px;
  height: 17px;
}

.hb-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-pill);
  background: var(--primary-50);
  color: var(--primary-700);
  font: 600 12.5px/1 var(--font);
  white-space: nowrap;
}

.hb-pill--warn {
  border-color: transparent;
  background: #fff3d6;
  color: #8a4b00;
}

.hb-pill--good {
  border-color: transparent;
  background: #d9f5ec;
  color: #0f7a62;
}

.hb-bar {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}

.hb-bar__fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7b5cff, var(--primary));
  transition: width 1s var(--ease);
}

.hb-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 6px;
  height: 190px;
  align-items: stretch;
}

.hb-chart__col {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  min-width: 0;
}

.hb-chart__bar {
  align-self: end;
  width: 100%;
  height: 0;
  min-height: 3px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #8a6dff, var(--primary));
  transition: height 0.9s var(--ease);
}

.hb-chart__bar--empty {
  background: var(--line);
}

.hb-chart__day {
  font: 600 11px/1 var(--font);
  color: var(--muted);
  text-align: center;
}

.hb-skills {
  display: grid;
  gap: 14px;
}

.hb-skill__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font: 600 13.5px/1.2 var(--font);
  color: var(--ink-2);
}

.hb-skill__head [data-count] {
  color: var(--ink);
}

.hb-details {
  display: grid;
  margin: 0;
}

.hb-details > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.hb-details dt {
  font-size: 13.5px;
  font-weight: 560;
  color: var(--muted);
}

.hb-details dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.hb-plan-note {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.hb-badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.hb-badge {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: var(--shadow-sm);
}

.hb-badge__name {
  font: 650 14px/1.3 var(--font);
  color: var(--ink);
}

.hb-badge__text {
  font: 500 12.5px/1.45 var(--font);
  color: var(--muted);
}

.hb-badge .hb-bar {
  height: 6px;
}

.hb-badge--locked {
  opacity: 0.7;
}

.hb-badge--locked .hb-badge__ico {
  background: #e4e8f0;
  color: #5d6880;
}

/* ---------- Decks ---------- */
.hb-decks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.hb-deck {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 96px;
}

.hb-deck__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: 650 15px/1.3 var(--font);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.hb-deck__title::before {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--deck, var(--primary));
}

.hb-deck__desc {
  min-height: 1.4em;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.hb-deck__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Friends and the league ---------- */
.hb-league {
  display: grid;
  gap: 4px;
}

.hb-rank {
  display: grid;
  grid-template-columns: 24px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--radius);
}

.hb-rank.is-me {
  background: var(--primary-50);
}

.hb-rank__no {
  font: 650 14px/1 var(--font);
  color: var(--muted);
}

.hb-rank__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 14px/1.3 var(--font);
  color: var(--ink);
}

.hb-rank__bar {
  margin-top: 6px;
}

.hb-rank__xp {
  font: 700 14px/1 var(--font);
  color: var(--ink);
  white-space: nowrap;
}

.hb-face {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font: 700 14px/1 var(--font);
}

.hb-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s;
}

.hb-face img.is-loaded {
  opacity: 1;
}

/* ---------- The look choice: two cards, the chosen one ringed ---------- */
.hb-looks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hb-look {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.hb-look[aria-pressed='true'] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.hb-look__name {
  font: 650 15px/1.3 var(--font);
}

.hb-look__hint {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- The apps: danna and botdanna, the same card ---------- */
.hb-app {
  align-content: start;
}

.hb-app__mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.hb-app__mark img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.hb-app__text {
  display: grid;
  gap: 4px;
}

.hb-app__name {
  margin: 0;
  font: 700 18px/1.25 var(--font);
  letter-spacing: -0.015em;
  color: var(--ink);
}

.hb-app__version {
  margin: 0;
  font: 600 12.5px/1.2 var(--font);
  color: var(--muted);
}

.hb-app .btn {
  justify-self: start;
}

/* ---------- Toasts, loading and the motion ---------- */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast-region .toast {
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  font: 600 14px/1.4 var(--font);
  box-shadow: var(--shadow-lift);
  animation: hb-toast 3.6s ease both;
}

.toast-region .toast[data-tone='error'] {
  background: #c2332d;
}

.hb-skel {
  min-height: 84px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--canvas) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: hb-shimmer 1.4s linear infinite;
}

.hb-skel--line {
  display: inline-block;
  width: 13em;
  min-height: 0;
  height: 0.9em;
  border-radius: 6px;
}

.hb-skel--cell,
.hb-skel--tile {
  min-height: 100px;
}

/* The streak's flame: its colour grows with the days, as in the app */
.flame {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #e8733a;
}

.flame.is-active {
  fill: currentColor;
  fill-opacity: 0.22;
}

.flame--ruby {
  color: #b8123a;
}

.flame--sapphire {
  color: #1566d6;
}

.flame--amethyst {
  color: #7b3fe4;
}

.flame:not(.is-active) {
  opacity: 0.5;
}

/* The ring of today's goal */
.ring__track {
  fill: none;
  stroke: var(--line);
  stroke-width: 6;
}

.ring__bar {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-box: fill-box;
  transform-origin: center;
  transition: stroke-dashoffset 1s var(--ease);
}

.ring__text {
  fill: var(--ink);
  font: 700 12px/1 var(--font);
}

html.js .hb-reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease);
}

html.js .hb-reveal.is-in {
  opacity: 1;
  transform: none;
}

.hb-flash {
  animation: hb-flash 1.4s ease;
}

@keyframes hb-shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes hb-flash {
  0%,
  100% {
    box-shadow: var(--shadow-sm);
  }
  30% {
    box-shadow: 0 0 0 5px var(--primary-50), var(--shadow-sm);
  }
}

@keyframes hb-toast {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  8%,
  88% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
  }
}

/* ---------- Narrow screens: the side list becomes a row of tabs, the page one column ---------- */
@media (max-width: 1080px) {
  .hb-grid--chart {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .hb-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    margin: 0 10px 10px;
    border-radius: 18px;
  }

  .hb-side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    background: var(--canvas);
  }

  .hb-nav {
    position: static;
    display: flex;
    gap: 6px;
    padding: 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hb-nav::-webkit-scrollbar {
    display: none;
  }

  .hb-nav a {
    flex: none;
    white-space: nowrap;
  }

  .hb-main {
    padding: 22px 16px 72px;
  }

  .hb-name {
    font-size: 26px;
  }

  .hb-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hb-strip > :last-child:nth-child(odd) {
    grid-column: span 2;
  }

  .hb-tiles,
  .hb-tiles--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .hb-top {
    gap: 6px;
    padding: 0 14px;
  }

  .hb-grid,
  .hb-looks {
    grid-template-columns: minmax(0, 1fr);
  }

  .hb-details > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .hb-chart {
    gap: 4px;
  }

  .hb-chart__day {
    font-size: 10px;
  }

  .hb-card {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html.js .hb-reveal {
    opacity: 1;
    transform: none;
  }
}
