/* Map the canonical valbum system to the existing native-module application. */
body {
  font-family: var(--vb-font);
  font-size: var(--vb-type-body-size);
  line-height: var(--vb-type-body-line);
  background: var(--vb-background);
  color: var(--vb-text);
}
.shell {
  width: 100%;
  max-width: calc(var(--vb-container) + 2 * var(--vb-content-margin));
  padding-inline: var(--vb-content-margin);
}
.masthead {
  min-height: 64px;
  height: auto;
  padding-block: 0;
  margin-bottom: 32px;
  gap: 8px;
  border-color: var(--vb-border);
}
.brand {
  min-height: 44px;
  gap: 8px;
  min-width: 0;
}
.brand-lockup {
  display: block;
  box-sizing: content-box;
  width: calc(var(--brand-h, 20px) * 7.695660881);
  height: calc(var(--brand-h, 20px) * 2);
  padding: calc(var(--brand-h, 20px) * 0.5);
  object-fit: contain;
}
.brand-lockup.full {
  height: calc(var(--brand-h, 50px) * 2.372016021);
}
.brand-lockup.vertical.full {
  width: calc(var(--brand-h, 50px) * 5.245660881);
  height: calc(var(--brand-h, 50px) * 4.61);
}
.brand-showcase {
  display: flex;
  justify-content: center;
}
.brand-showcase .brand-compact {
  display: none;
}
@media (max-width: 359px) {
  .brand-showcase .vertical.full {
    display: none;
  }
  .brand-showcase .brand-compact {
    display: block;
  }
}
.version {
  position: static;
  font-size: 12px;
  margin: 0;
  letter-spacing: 0;
  color: var(--vb-muted);
}
.brand-mark {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cover {
  background: var(--vb-surface);
  border-radius: 0;
}
.cover:after {
  box-shadow: none;
}
.cover-placeholder {
  background: var(--vb-surface);
  padding: 24%;
}
.cover-placeholder .brand-mark {
  opacity: 0.5;
}
.album-grid {
  grid-template-columns: repeat(var(--vb-album-columns), minmax(0, 1fr));
  gap: 24px var(--vb-album-gap);
}

.album-card {
  background: var(--vb-surface);
  border-radius: 0;
  box-shadow: none;
  position: relative;
}

.album-card:hover .cover img {
  transform: none;
}
.card-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.card-artist {
  font-size: 13px;
  line-height: 1.5;
}
.card-year {
  font-size: 12px;
  line-height: 1.5;
}
.card-score {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
h1,
.page-heading h1,
.album-hero h1 {
  font-family: var(--vb-font);
  font-size: var(--vb-type-heading-1-size);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
h2,
.section-heading h2 {
  font-family: var(--vb-font);
  font-size: var(--vb-type-heading-2-size);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
}
.page-heading {
  align-items: flex-start;
  gap: 12px;
}
.small,
.artist,
.album-meta,
.rating-subtitle,
.track-artist,
.ranking-meta,
.result-artist {
  font-size: 13px;
  line-height: 1.5;
}
.tiny,
.eyebrow,
.nav-item,
.page-footer,
.history-version,
.result-brand,
.step-line,
.data-counts {
  font-size: 12px;
  line-height: 1.5;
}
.button {
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
  box-shadow: none;
}
.button.secondary,
.button.danger {
  background: var(--vb-surface);
  color: var(--vb-text);
  border-color: var(--vb-control-border);
}
.button:disabled {
  background: var(--vb-disabled);
  color: var(--vb-on-disabled);
  opacity: 1;
}
.icon-button,
.text-button,
.back-button,
.artist-link,
.artist-suggestion,
.history-row {
  min-height: 44px;
}
.text-button,
.back-button {
  font-size: 14px;
}
.search-box {
  min-height: 48px;
  border: 1px solid var(--vb-control-border);
  border-radius: 4px;
  padding: 12px 16px;
  background: var(--vb-surface);
}
.search-box input {
  font-size: 16px;
  line-height: 1.5;
  background: var(--vb-surface);
  color: var(--vb-text);
}
.region-control select,
.sort-select {
  min-height: 44px;
  font-size: 13px;
  max-width: 100%;
  border-color: var(--vb-control-border);
}
.bottom-nav {
  width: min(calc(var(--vb-container) + 2 * var(--vb-content-margin)), 100%);
  min-height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px));
  background: var(--vb-surface);
  border-color: var(--vb-border);
}
.nav-item {
  min-height: 56px;
  padding: 4px;
  letter-spacing: 0;
}
.valbum-ui .nav-item {
  font-size: 12px;
  line-height: 1.5;
}
.valbum-ui .button,
.valbum-ui .text-button,
.valbum-ui .back-button {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
}
.valbum-ui .region-control select,
.valbum-ui .sort-select {
  font-size: 13px;
}
.notice,
.notice.error,
.result-paper,
.modal {
  background: var(--vb-surface);
  color: var(--vb-text);
  box-shadow: none;
}
.valbum-ui #toast {
  box-shadow: none;
}
.notice.error {
  border: 2px solid var(--vb-control-border);
}
.modal {
  border: 1px solid var(--vb-control-border);
  border-radius: 12px;
}
.notice {
  border-radius: 8px;
}
.sticky-action {
  background: var(--vb-surface);
}
.result-paper {
  padding: 16px;
  border-radius: 8px;
}
.result-brand {
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  letter-spacing: 0;
}
.result-score {
  letter-spacing: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.score-logo {
  display: block;
  width: 160px;
  height: 160px;
  color: var(--vb-primary);
}
.score-logo img,
.score-logo svg {
  display: block;
  width: 100%;
  height: 100%;
}
.album-latest .score-logo {
  width: 100px;
  height: 100px;
}
.album-latest {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.result-score small {
  margin: 0;
  font-size: 13px;
}
.ranking-score,
.history-score {
  font-variant-numeric: tabular-nums;
  font-family: var(--vb-font);
  white-space: nowrap;
}
.ranking-row {
  gap: 12px;
  padding-block: 16px;
}
.ranking-title,
.track-title {
  overflow-wrap: anywhere;
}
.grade-picker:not(.readonly) .grade-button {
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 4px;
}
.grade-picker:not(.readonly) .grade-button[aria-pressed="true"] {
  border-color: transparent;
  background: transparent;
  color: #000000;
}
.grade-picker:not(.readonly) .grade-button .grade-icon {
  width: 24px;
  height: 24px;
}
.macro-button {
  min-width: 44px;
  min-height: 44px;
  border: 2px solid transparent;
  border-radius: 4px;
}
.macro-button[aria-pressed="true"] {
  border-color: var(--vb-selected);
  background: var(--vb-selected);
  color: var(--vb-on-selected);
}
.segmented button {
  min-height: 44px;
}
.skeleton {
  background: var(--vb-hover);
  animation: none;
}


.brand-footer {
  margin-top: 24px;
}
:is(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--vb-focus);
  outline-offset: 3px;
}
@media (hover: hover) {
  .button:not(:disabled):hover {
    opacity: 0.94;
  }
  .artist-link:hover,
  .text-button:hover {
    text-decoration: underline;
  }
}
@media (max-width: 359px) {
  .track-row.editable {
    grid-template-columns: 22px minmax(0, 1fr);
  }
  .track-row.editable .grade-picker {
    grid-column: 2;
    justify-content: flex-start;
  }
  .rating-title {
    font-size: 22px;
  }
  .ranking-row {
    grid-template-columns: 24px 40px minmax(0, 1fr) auto;
  }
  .ranking-score {
    font-size: 16px;
  }
  .result-paper {
    padding: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Song ratings keep the confirmed black outline/solid silhouettes in every view. */
.grade-icon {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}
.grade-button[aria-pressed="true"] .grade-icon {
  transform: none;
}

.poster-options { margin-top: 24px; }
.poster-options label { display: block; font-size: 14px; margin-bottom: 8px; }
.poster-options input { width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid var(--vb-control-border); border-radius: 4px; color: var(--vb-text); background: var(--vb-surface); font: inherit; font-size: 16px; }
.poster-preview { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: contain; }

.current-user { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--vb-muted); }
.shell { background: var(--vb-background); }
.v5-section { margin-top: var(--vb-space-32); }
.section-title-link { font: inherit; color: inherit; background: transparent; border: 0; padding: 0; text-align: left; min-height: 44px; }
.recent-searches { display: flex; gap: var(--vb-space-16); flex-wrap: wrap; }
.recent-searches button { min-height: 44px; overflow-wrap: anywhere; }
.v5-empty { padding-block: var(--vb-space-32); font-size: 14px; }
.v5-stats > button { background: transparent; border: 0; text-align: left; min-height: 64px; color: var(--vb-text); }
.picks-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--vb-space-12); }
.pick-slot { min-width: 0; }
.pick-slot .album-card { width: 100%; }
.pick-slot .card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: var(--vb-space-8); }
.pick-rank { display: block; font-size: 13px; margin-bottom: var(--vb-space-8); color: var(--vb-muted); }
.pick-add { width: 100%; aspect-ratio: 1; border: 1px solid var(--vb-control-border); border-radius: 0; background: transparent; color: var(--vb-text); font: inherit; font-size: 13px; min-height: 44px; }
.pick-controls { display: flex; flex-wrap: wrap; }
.pick-controls button { flex: 1; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--vb-text); font: inherit; font-size: 12px; }
.album-strip { display: flex; overflow-x: auto; gap: var(--vb-space-12); padding-bottom: var(--vb-space-16); scroll-snap-type: x proximity; }
.strip-item { flex: 0 0 calc((100% - 24px) / 3.1); min-width: 0; scroll-snap-align: start; }
.strip-item .album-card { width: 100%; }
.ratings-list .ranking-row { grid-template-columns: 24px 76px minmax(0, 1fr) auto; padding-block: var(--vb-space-16); gap: var(--vb-space-12); }
.ratings-list .ranking-row .cover { width: 76px; height: 76px; }
.ranking-copy { min-width: 0; text-align: left; overflow-wrap: anywhere; }
.ranking-copy strong { font-weight: 500; font-size: 14px; display: block; }
.ranking-meta { display: block; }
.weeks-featured { min-height: 108px; grid-template-columns: 24px 80px minmax(0, 1fr) auto; }
.weeks-featured .cover { width: 80px; height: 80px; }
.weeks-list small { font-size: 12px; font-weight: 400; }
.track-total { margin-block: var(--vb-space-32); }
.track-total strong { font-size: 40px; font-weight: 500; }
.track-statistics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--vb-space-24); }
.track-statistics > div { display: flex; align-items: center; gap: var(--vb-space-12); padding-block: var(--vb-space-16); border-bottom: 1px solid var(--vb-border); }
.track-statistics strong { margin-left: auto; }
.year-filter { display: flex; gap: var(--vb-space-12); align-items: center; margin-block: var(--vb-space-16); }
.settings-section > label { display: block; margin-top: var(--vb-space-16); margin-bottom: var(--vb-space-8); }
.settings-section > input, .settings-section > select { font: inherit; font-size: 16px; width: 100%; min-height: 48px; padding: 12px 16px; color: var(--vb-text); background: var(--vb-surface); border: 1px solid var(--vb-control-border); border-radius: 4px; }
@media (min-width: 768px) { .strip-item { flex-basis: calc((100% - 48px) / 5.1); } }
@media (max-width: 359px) { .ratings-list .ranking-row { grid-template-columns: 20px 72px minmax(0, 1fr) auto; gap: 8px; } .ratings-list .ranking-row .cover { width: 72px; height: 72px; } .current-user { max-width: 64px; } }

/* V5.1.4: canonical assets and existing tokens, compact mobile-first layouts. */
.valbum-ui .shell { padding-top:env(safe-area-inset-top, 0px); }
.valbum-ui .masthead { margin-bottom:20px; }
.valbum-ui .brand { flex:1; min-width:0; gap:0; overflow:hidden; }
.valbum-ui .brand .brand-lockup { flex:none; }
.valbum-ui .current-user { max-width:none; min-width:0; font:500 26.5px/1.5 var(--vb-font); color:var(--vb-text); letter-spacing:0; margin-left:-10px; }
.valbum-ui .current-user:not(:empty)::before { content:"."; }
.valbum-ui .settings-button { flex:none; }
.valbum-ui[data-page="home"] .shell { padding-left:max(20px, env(safe-area-inset-left, 0px)); padding-right:max(20px, env(safe-area-inset-right, 0px)); }
.home-slogan { font-size:20px; margin:0 0 20px; font-weight:500; }
.home-layout .v5-stats { margin:0; padding-block:0 20px; }
.home-layout .v5-section { margin-top:20px; }
.home-layout .section-heading { gap:8px; margin:0 0 8px; align-items:center; }
.home-layout .section-heading h2 { font-size:15px; min-width:0; }
.home-layout .section-heading > .text-button { flex:none; font-size:12px; }
.home-layout .picks-slots, .home-layout .home-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; overflow:visible; padding:0; }
.home-layout .strip-item { min-width:0; }
.home-layout .pick-rank { text-align:center; }
.home-layout .home-album { display:flex; flex-direction:column; align-items:center; width:100%; gap:4px; }
.home-layout .home-album .cover { width:100%; height:auto; aspect-ratio:1; }
.home-layout .home-score { display:block; width:56px; height:56px; margin:0 auto; }
.home-layout .home-score img, .home-layout .home-score svg { width:100%; height:100%; }
.home-layout .unfinished-label { display:block; text-align:center; padding-top:8px; }
.valbum-ui .track-heading { margin:0 0 8px; }
.valbum-ui .track-heading p { margin:0; }
.valbum-ui .rating-title { font:500 26px/1.25 var(--vb-font); overflow-wrap:anywhere; }
.valbum-ui .track-row.editable .track-title { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal; }
.valbum-ui .track-row.editable .track-copy { min-width:0; }
.valbum-ui .recall .grade-picker { display:grid; grid-template-columns:repeat(4,44px); justify-content:center; gap:12px; }
.valbum-ui .recall .grade-button, .valbum-ui .recall .grade-placeholder { width:44px; height:44px; }
.valbum-ui .recall .grade-button .grade-icon { width:28px; height:28px; }
.valbum-ui .sticky-action { bottom:calc(var(--vb-nav-height) + env(safe-area-inset-bottom, 0px)); padding-block:8px; margin-top:20px; }
.valbum-ui .sticky-action .button { min-height:48px; }
@media(max-width:359px) { .valbum-ui .brand .brand-lockup { --brand-h:20px; } .valbum-ui .current-user { font-size:26.5px; } }

/* Read-only permanent rating snapshots; retain Album Detail's existing body. */
.rating-history { margin-top:32px; border-top:1px solid var(--vb-border); padding-top:20px; }
.rating-history h2 { font-size:14px; letter-spacing:0.08em; }
.history-entry { border-bottom:1px solid var(--vb-border); padding:16px 0; }
.history-entry summary { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; cursor:pointer; min-height:44px; overflow-wrap:anywhere; }
.history-entry summary time { grid-column:1; color:var(--vb-muted); font-size:12px; }
.history-entry summary strong { grid-column:2; grid-row:1 / 3; align-self:center; font-size:24px; }
.history-breakdown { font-size:13px; overflow-wrap:anywhere; }
