/* Design tokens: change the palette and typefaces here. */
:root {
  --paper: #f6f5f0;
  --surface: #fffefb;
  --ink: #25352d;
  --muted: #6a7067;
  --orange: #b84b2f;
  --orange-light: #fae9df;
  --sage: #dce5d9;
  --line: #dedfd4;
  --serif: Georgia,'Times New Roman',serif;
  --sans: -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  color-scheme: light;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,input,select,textarea {
  font: inherit;
}

button,a,input,select,textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

button,input,select,textarea {
  touch-action: manipulation;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}

[hidden] {
  display: none!important;
}

.icon-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: middle;
}

.icon.small {
  width: 16px;
  height: 16px;
}

.sr-only {
  position: absolute!important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  padding: 14px;
  background: var(--ink);
  color: white;
  transform: translateY(-180%);
  z-index: 100;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header and shared typography / controls. */
.site-header {
  max-width: 1320px;
  margin: auto;
  min-height: 104px;
  padding: 24px 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
  font-size: 26px;
  letter-spacing: -1.2px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 38px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
}

.brand-mark .icon {
  width: 25px;
  height: 25px;
}

.brand-light {
  font-weight: 400;
}

.brand-dot {
  color: var(--orange);
}

.desktop-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.desktop-nav button {
  border: 0;
  background: transparent;
  padding: 13px 17px;
  min-height: 44px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  border-radius: 30px;
}

.desktop-nav button[aria-current=page] {
  background: #e6e9df;
  color: var(--ink);
}

.profile-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 10px 14px;
  min-height: 44px;
  background: transparent;
  color: var(--ink);
  max-width: 230px;
  font-size: 14px;
  font-weight: 600;
}

.profile-switch span {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-switch>.icon:first-child {
  width: 18px;
  height: 18px;
}

.main-shell {
  max-width: 1216px;
  padding: 0 0 60px;
  margin: auto;
  min-height: 70vh;
}

.main-shell:focus {
  outline: 0;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  line-height: 1.6;
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 20px;
  text-transform: uppercase;
}

.eyebrow-line {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--muted);
  opacity: .7;
}

.tiny-spark {
  font-size: 20px;
  font-weight: 400;
  color: var(--orange);
}

h1,h2,h3,p {
  overflow-wrap: anywhere;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(42px,5.2vw,70px);
  font-weight: 400;
  letter-spacing: -2.8px;
  line-height: 1.08;
  margin: 0 0 22px;
}

h1 em {
  font-weight: 400;
  color: var(--orange);
}

h2 {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -.8px;
  font-weight: 400;
  margin: 0 0 16px;
}

h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 29px;
  letter-spacing: -.7px;
  margin: 0 0 12px;
}

.lede {
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 420px;
  margin: 0 0 26px;
}

.button {
  min-height: 46px;
  padding: 12px 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 650;
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1.35;
  transition: background .15s,transform .15s;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--ink);
  color: #fffefb;
}

.button.primary:hover {
  background: #394c3f;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.button.secondary:hover {
  background: #efefe8;
}

.button.large {
  padding: 15px 23px;
  min-height: 52px;
}

.button.text-button {
  background: none;
  color: var(--orange);
  padding-left: 0;
}

.button.danger {
  color: #a2372c;
  background: #faeee8;
  border-color: #ecd1c7;
}

.button.danger:hover {
  background: #f5ded3;
}

.button.full-width {
  width: 100%;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.small-note,.help-text {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.small-note {
  margin: 19px 0 0;
}

.help-text {
  display: block;
  margin: 12px 0 0;
}

.icon-button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  flex-shrink: 0;
}

/* First visit: introduction and locally drawn collection artwork. */
.welcome-view {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  column-gap: 65px;
  padding-top: 70px;
  align-items: center;
}

.welcome-copy {
  padding: 18px 0;
}

.welcome-copy h1 {
  font-size: clamp(44px,5.5vw,72px);
}

.collection-illustration {
  position: relative;
  height: 445px;
  border-radius: 48% 48% 12px 12px;
  background: #e8ece1;
  overflow: hidden;
}

.illustration-label {
  position: absolute;
  top: 42px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 9px;
  letter-spacing: 2.1px;
  color: #737e70;
}

.illustration-orbit {
  position: absolute;
  border: 1px solid #d3dccc;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  left: 50%;
  top: 40px;
  transform: translateX(-50%);
}

.orbit-two {
  width: 510px;
  height: 510px;
  top: 100px;
}

.illustration-card {
  position: absolute;
  box-shadow: 0 12px 30px #25352d1c;
  width: 154px;
  height: 235px;
  border-radius: 4px;
  padding: 18px;
  top: 103px;
  left: 46px;
  transform: rotate(-12deg);
  z-index: 2;
}

.illustration-card>span:first-child {
  font-size: 8px;
  letter-spacing: 1.8px;
}

.illustration-card strong {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  display: block;
  font-weight: 400;
}

.illustration-movie {
  background: #263d35;
  color: #f5ebd8;
}

.movie-art {
  height: 89px;
  margin: 12px 0 15px;
  position: relative;
  overflow: hidden;
  background: #8d9c6b;
  border-radius: 58% 58% 0 0;
}

.movie-art:before {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e6b983;
  top: 12px;
  right: 14px;
}

.movie-art>div {
  position: absolute;
  width: 130px;
  height: 80px;
  transform: rotate(-35deg);
  left: -10px;
  bottom: -37px;
  background: #b3bf90;
}

.art-stars {
  display: block;
  margin-top: 13px;
  font-size: 9px;
  letter-spacing: 3px;
  color: #d6b68e;
}

.illustration-book {
  background: #c45f43;
  color: #fff6df;
  transform: rotate(11deg);
  left: auto;
  right: 44px;
  top: 123px;
  z-index: 3;
}

.illustration-book strong {
  font-size: 30px;
  margin-top: 28px;
}

.book-lines {
  height: 34px;
  border-top: 1px solid #e1a17f;
  border-bottom: 1px solid #e1a17f;
  margin-top: 17px;
  position: relative;
}

.book-lines:after {
  content: '';
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  border-top: 1px solid #e1a17f;
}

.art-rule {
  display: block;
  width: 40px;
  height: 1px;
  background: #f5ceb0;
  margin-top: 20px;
}

.illustration-record {
  position: absolute;
  z-index: 4;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%) rotate(7deg);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle,#2a3630 0 2px,#37443c 3px 4px);
  box-shadow: 0 9px 20px #25352d26;
  display: grid;
  place-items: center;
}

.illustration-record>div {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background: #d9b85f;
  border: 13px solid #d9b85f;
  box-shadow: inset 0 0 0 3px var(--ink);
}

.illustration-record>span {
  position: absolute;
  color: #ddd7b9;
  bottom: 21px;
  font-size: 5px;
  letter-spacing: 1.2px;
}

.illustration-spark {
  position: absolute;
  left: 37px;
  bottom: 49px;
  color: var(--orange);
  font-size: 43px;
}

.illustration-caption {
  position: absolute;
  bottom: 14px;
  right: 20px;
  font-size: 10px;
  color: #6e7d6b;
  letter-spacing: .3px;
}

.returning-profiles {
  grid-column: 1/-1;
  padding-top: 32px;
  width: 100%;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
}

.profile-grid:empty {
  display: none;
}

/* The collection: category filters, item cards, and empty state. */
.library-hero {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 60px;
  padding: 55px 0 45px;
  align-items: center;
}

.hero-copy h1 {
  margin-bottom: 14px;
}

.hero-copy .lede {
  margin-bottom: 22px;
}

.collection-note {
  position: relative;
  background: var(--sage);
  border-radius: 12px;
  padding: 27px 30px 23px;
  overflow: hidden;
}

.collection-note>p {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.9px;
  margin: 0 0 22px;
}

.note-spark {
  font-size: 42px;
  line-height: 1;
  color: #67826a;
}

.collection-note .note-spark {
  position: absolute;
  top: 28px;
  right: 28px;
  font-size: 45px;
}

.hero-stats {
  display: flex;
  gap: 30px;
  padding-top: 18px;
  border-top: 1px solid #bdccb7;
}

.hero-stats>div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-stats strong {
  font-size: 25px;
  font-weight: 500;
  font-family: var(--serif);
}

.hero-stats span {
  font-size: 10px;
  color: #5a6e58;
  letter-spacing: .25px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 31px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: 28px;
}

.section-heading>p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.category-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 10px 17px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.category-chip .icon {
  width: 18px;
  height: 18px;
}

.category-chip[aria-pressed=true] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.category-chip:hover {
  border-color: #98a58d;
}

.library-toolbar {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 25px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  max-width: 430px;
  width: 100%;
  color: var(--muted);
}

.search-field .icon {
  width: 18px;
  height: 18px;
}

.search-field input {
  border: 0!important;
  outline-offset: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  min-height: 45px;
  padding: 11px 0;
  font-size: 14px;
}

.toolbar-selects {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.toolbar-selects select {
  min-height: 46px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 30px 10px 12px;
  font-size: 12px;
  color: var(--ink);
  max-width: 200px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 22px;
}

.media-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
  text-align: left;
  color: var(--ink);
  font-family: var(--sans);
  padding: 0;
  width: 100%;
  transition: transform .2s,box-shadow .2s;
}

.media-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px #25352d0c;
}

.cover-art {
  position: relative;
  min-height: 155px;
  background: #dce5d9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
  color: #556d54;
  font-family: var(--serif);
  font-size: 48px;
  letter-spacing: -2px;
}

.cover-art:after {
  content: '';
  position: absolute;
  inset: 16px;
  border: 1px solid currentColor;
  opacity: .18;
  border-radius: 4px;
  pointer-events: none;
}

.cover-art .icon {
  width: 48px;
  height: 48px;
  stroke-width: 1.1;
}

.cover-screen {
  background: #e0e8df;
  color: #52715e;
}

.cover-books {
  background: #eee4d2;
  color: #8a7044;
}

.cover-games {
  background: #e4dfed;
  color: #77618c;
}

.cover-music {
  background: #f1dfd8;
  color: #a96854;
}

.cover-title {
  font-family: var(--serif);
  font-size: 34px;
  text-align: center;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}

.card-body {
  padding: 19px 21px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.card-title {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -.4px;
  font-weight: 400;
  margin: 0;
}

.card-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  margin: 0;
}

.card-notes {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 5px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  flex-wrap: wrap;
}

.rating-display {
  font-size: 12px;
  color: #a96c24;
  letter-spacing: 1px;
  font-weight: 600;
}

.status-badge {
  font-size: 10px;
  border-radius: 4px;
  padding: 5px 8px;
  background: #edf0e8;
  color: #5d7053;
  line-height: 1.5;
}

.genre-tag {
  display: inline-block;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
  color: var(--muted);
  margin: 0 4px 4px 0;
}

.empty-state {
  border: 1px dashed #bec8b6;
  border-radius: 12px;
  background: #eff1e8;
  min-height: 280px;
  padding: 48px;
  display: flex;
  gap: 40px;
  align-items: center;
  justify-content: center;
}

.empty-state>div:last-child {
  max-width: 440px;
}

.empty-state .eyebrow {
  font-size: 9px;
  color: #73836c;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 31px;
  max-width: 380px;
}

.empty-state p:not(.eyebrow) {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0 0 20px;
}

.empty-art {
  position: relative;
  width: 125px;
  height: 140px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transform: rotate(-7deg);
  background: #dce5d4;
  border-radius: 6px;
  color: #7d9070;
  border: 1px solid #b7c6ab;
}

.empty-art .icon {
  width: 59px;
  height: 59px;
  stroke-width: 1.1;
}

.empty-art>span {
  position: absolute;
  right: -14px;
  bottom: -16px;
  font-size: 49px;
  color: var(--orange);
}

.collection-footnote {
  text-align: center;
  font-size: 11px;
  color: #8a8e81;
  margin: 34px 0 0;
}

.collection-footnote>span {
  color: var(--orange);
  padding-right: 7px;
}

/* Taste summaries and profile settings. */
.page-intro {
  padding: 58px 0 26px;
}

.page-intro .lede {
  max-width: 510px;
}

.taste-summary {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 18px;
}

.taste-stat {
  padding: 25px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.taste-stat strong {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  display: block;
  margin-bottom: 8px;
}

.taste-stat p,.taste-stat span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.taste-details {
  margin: 25px 0;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 18px;
}

.taste-details>section,.taste-note {
  background: #e9ede2;
  border-radius: 12px;
  padding: 27px;
}

.taste-details h2 {
  font-size: 25px;
}

.taste-details p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

.taste-genres {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.taste-genres .genre-tag {
  background: var(--paper);
  padding: 9px 12px;
  border-radius: 30px;
  color: var(--ink);
  font-size: 12px;
}

.taste-invitation {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 25px;
  margin-top: 25px;
}

.taste-invitation>div {
  flex: 1;
}

.taste-invitation h2 {
  font-size: 25px;
  margin-bottom: 8px;
}

.taste-invitation p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
  max-width: 550px;
}

.taste-invitation .button {
  flex-shrink: 0;
}

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

.settings-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px;
}

.settings-card .eyebrow {
  font-size: 9px;
  margin-bottom: 14px;
}

.settings-card h2 {
  font-size: 27px;
  margin-bottom: 18px;
}

.settings-card>p:not(.eyebrow):not(.help-text) {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0 0 20px;
}

.settings-card label {
  font-size: 12px;
  font-weight: 600;
}

.input-action {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.input-action input {
  width: 0;
  flex: 1;
}

.settings-card .button {
  font-size: 12px;
}

.installation-card {
  background: #e8ede1;
}

.settings-card-icon {
  position: absolute;
  right: 30px;
  top: 26px;
  color: #6b8161;
}

.settings-card details summary {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.7;
  list-style: none;
  min-height: 44px;
  font-weight: 600;
}

.settings-card details summary::-webkit-details-marker {
  display: none;
}

.settings-card details[open] summary .icon {
  transform: rotate(180deg);
}

.settings-card ol {
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.8;
  color: #576450;
}

.settings-card ol li {
  padding: 5px 0;
}

.quiet-card {
  background: transparent;
}

.site-footer {
  max-width: 1216px;
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 24px 0 35px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 10px;
  color: #818778;
  letter-spacing: .3px;
}

.site-footer>span:first-child {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: -.5px;
  color: #66705f;
}

.mobile-nav {
  display: none;
}

.profile-choice {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 80px;
  padding: 16px;
  color: var(--ink);
  width: 100%;
}

.profile-choice:hover {
  background: #ecefe5;
  border-color: #b8c6ac;
}

.profile-avatar {
  display: grid;
  place-items: center;
  background: var(--sage);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 23px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.profile-name {
  font-weight: 600;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.profile-meta {
  font-size: 11px;
  color: var(--muted);
}

.profile-list {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.storage-warning {
  padding: 24px;
  border-radius: 10px;
  background: #fae6dc;
  border: 1px solid #e9bcab;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.7;
}

.storage-warning h2 {
  font-size: 24px;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 15px 22px;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 6px 25px #0002;
  z-index: 100;
  text-align: center;
}

/* Native dialogs and accessible form controls. */
dialog {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  width: calc(100% - 32px);
  max-width: 480px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 25px 100px #10281e2b;
}

dialog::backdrop {
  background: #17271f70;
  backdrop-filter: blur(4px);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dialog-heading .eyebrow {
  font-size: 8px;
  margin: 0 0 12px;
  letter-spacing: 1.6px;
}

.dialog-heading h2 {
  font-size: 30px;
  margin: 0;
  line-height: 1.1;
}

.dialog-intro {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  margin: 18px 0 23px;
}

dialog label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

dialog input:not([type=radio]),dialog select,dialog textarea,.settings-card input {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px 13px;
  min-height: 46px;
  font-size: 16px;
  color: var(--ink);
}

dialog input:not([type=radio]),dialog select,dialog textarea {
  width: 100%;
  margin-top: 7px;
}

dialog input::placeholder,dialog textarea::placeholder {
  color: #989d91;
  opacity: 1;
}

dialog textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.item-dialog {
  max-width: 640px;
}

.item-dialog .dialog-heading {
  margin-bottom: 25px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.span-two {
  grid-column: 1/-1;
}

.optional {
  font-weight: 400;
  font-size: 11px;
  color: #858c7d;
  padding-left: 6px;
}

.rating-field {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.rating-field legend {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.rating-options {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 8px;
}

.rating-option {
  position: relative;
  display: block;
  cursor: pointer;
  min-width: 0;
}

.rating-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
}

.rating-option>span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #91967f;
  font-size: 20px;
  background: var(--surface);
}

.rating-option b {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.rating-option input:checked+span {
  background: #f2dfc5;
  border-color: #c28b43;
  color: #9e6b23;
}

.rating-option input:checked+span b {
  color: #78511b;
}

.rating-option input:focus-visible+span {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.rating-explanation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}

.rating-explanation p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.rating-clear {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-size: 11px;
  font-weight: 400;
  min-height: 36px;
  white-space: nowrap;
}

.rating-clear input {
  accent-color: var(--ink);
  width: 15px;
  height: 15px;
}

.action-spacer {
  flex: 1;
}

/* Responsive layouts: desktop through small phones. */
@media (min-width: 1450px) {
  .main-shell,.site-footer {
    max-width: 1216px;
  }
  .site-header {
    max-width: 1320px;
  }
}

@media (max-width: 1320px) {
  .main-shell,.site-footer {
    margin-left: 52px;
    margin-right: 52px;
  }
  .site-header {
    padding-left: 52px;
    padding-right: 52px;
  }
  .welcome-view {
    column-gap: 35px;
  }
  .illustration-card {
    left: 26px;
  }
  .illustration-book {
    left: auto;
    right: 27px;
  }
}

@media (max-width: 1050px) {
  .main-shell,.site-footer {
    margin-left: 35px;
    margin-right: 35px;
  }
  .site-header {
    padding-left: 35px;
    padding-right: 35px;
  }
  .library-hero {
    grid-template-columns: 1fr 300px;
    gap: 30px;
  }
  .collection-note {
    padding: 25px;
  }
  .desktop-nav {
    gap: 0;
  }
  .desktop-nav button {
    padding: 12px;
  }
  .welcome-view {
    column-gap: 28px;
  }
  .collection-illustration {
    height: 400px;
  }
  .illustration-card {
    width: 140px;
    height: 220px;
    left: 20px;
  }
  .illustration-book {
    left: auto;
    right: 21px;
    top: 115px;
  }
  .illustration-record {
    bottom: 26px;
  }
  .illustration-caption {
    bottom: 4px;
  }
  .media-grid {
    gap: 16px;
  }
  .card-body {
    padding: 17px;
  }
  .settings-card {
    padding: 25px;
  }
  .taste-invitation {
    flex-wrap: wrap;
  }
  .taste-invitation .button {
    margin-left: 67px;
  }
}

@media (max-width: 800px) {
  .site-header {
    min-height: 84px;
    padding: 18px 24px;
  }
  .main-shell,.site-footer {
    margin-left: 24px;
    margin-right: 24px;
  }
  .brand {
    font-size: 24px;
  }
  .brand-mark {
    width: 33px;
    height: 35px;
  }
  .desktop-nav {
    display: none;
  }
  .profile-switch {
    font-size: 12px;
    gap: 7px;
    max-width: 185px;
  }
  .profile-switch span {
    max-width: 105px;
  }
  .welcome-view {
    padding-top: 43px;
    gap: 30px;
    grid-template-columns: 1fr .85fr;
  }
  .welcome-copy h1 {
    font-size: 49px;
    letter-spacing: -2px;
  }
  .welcome-copy .lede {
    font-size: 14px;
  }
  .collection-illustration {
    height: 330px;
  }
  .illustration-label {
    top: 30px;
    font-size: 7px;
    letter-spacing: 1px;
  }
  .illustration-card {
    width: 110px;
    height: 178px;
    padding: 13px;
    top: 79px;
    left: 12px;
  }
  .illustration-card>span:first-child {
    font-size: 6px;
  }
  .illustration-card strong {
    font-size: 19px;
  }
  .movie-art {
    height: 64px;
    margin: 10px 0;
  }
  .illustration-book {
    left: auto;
    right: 12px;
    top: 95px;
  }
  .illustration-book strong {
    font-size: 23px;
    margin-top: 16px;
  }
  .book-lines {
    margin-top: 10px;
    height: 25px;
  }
  .book-lines:after {
    top: 11px;
  }
  .art-stars {
    font-size: 7px;
    margin-top: 9px;
  }
  .art-rule {
    margin-top: 14px;
  }
  .illustration-record {
    width: 90px;
    height: 90px;
    bottom: 18px;
  }
  .illustration-record>div {
    width: 28px;
    height: 28px;
    border-width: 9px;
  }
  .illustration-record>span {
    bottom: 14px;
    font-size: 4px;
  }
  .illustration-spark {
    font-size: 33px;
    left: 17px;
    bottom: 28px;
  }
  .illustration-caption {
    display: none;
  }
  .illustration-orbit {
    width: 280px;
    height: 280px;
    top: 30px;
  }
  .orbit-two {
    width: 370px;
    height: 370px;
    top: 70px;
  }
  .library-hero {
    grid-template-columns: 1fr 240px;
    gap: 25px;
    padding-top: 39px;
  }
  .hero-copy h1 {
    font-size: 49px;
  }
  .hero-copy .lede {
    font-size: 14px;
  }
  .collection-note {
    padding: 22px;
  }
  .collection-note>p {
    font-size: 26px;
  }
  .collection-note .note-spark {
    font-size: 34px;
    right: 17px;
    top: 17px;
  }
  .hero-stats {
    gap: 24px;
  }
  .hero-stats span {
    font-size: 9px;
  }
  .media-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .toolbar-selects select {
    max-width: 160px;
    padding-right: 21px;
  }
  .library-toolbar {
    gap: 10px;
  }
  .category-list {
    gap: 7px;
  }
  .category-chip {
    padding: 10px 14px;
    font-size: 11px;
  }
  .category-chip .icon {
    width: 17px;
    height: 17px;
  }
  .settings-grid {
    gap: 16px;
  }
  .settings-card {
    padding: 22px;
  }
  .input-action {
    flex-direction: column;
  }
  .input-action input {
    width: 100%;
    flex: auto;
  }
  .settings-card .button-row {
    flex-direction: column;
  }
  .taste-stat {
    padding: 20px;
  }
  .profile-grid {
    grid-template-columns: repeat(2,1fr);
  }
  .main-shell {
    padding-bottom: 45px;
  }
  .mobile-nav:not([hidden]) {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    justify-content: space-around;
    gap: 6px;
    padding: 9px 20px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #f6f5f0f5;
    backdrop-filter: blur(12px);
  }
  .mobile-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: 0;
    color: #8a8e80;
    min-width: 75px;
    min-height: 48px;
    border-radius: 8px;
    font-size: 10px;
  }
  .mobile-nav button[aria-current=page] {
    color: var(--ink);
    background: #e9ede2;
  }
  .mobile-nav .icon {
    width: 21px;
    height: 21px;
  }
  .site-footer {
    margin-bottom: calc(78px + env(safe-area-inset-bottom));
    padding: 23px 0;
  }
  .toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 600px) {
  .site-header {
    padding: 16px 20px;
    min-height: 77px;
    gap: 12px;
  }
  .brand {
    font-size: 23px;
    gap: 8px;
  }
  .brand-mark {
    width: 31px;
    height: 33px;
    border-radius: 8px;
  }
  .brand-mark .icon {
    width: 23px;
    height: 23px;
  }
  .profile-switch {
    padding: 9px 11px;
    font-size: 11px;
    max-width: 157px;
  }
  .profile-switch span {
    max-width: 80px;
  }
  .profile-switch>.icon:first-child {
    width: 17px;
    height: 17px;
  }
  .profile-switch .small {
    width: 13px;
    height: 13px;
  }
  .main-shell,.site-footer {
    margin-left: 20px;
    margin-right: 20px;
  }
  .welcome-view {
    display: flex;
    flex-direction: column;
    padding-top: 27px;
    gap: 20px;
    align-items: stretch;
  }
  .welcome-copy {
    padding: 0;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 1.6px;
    margin-bottom: 18px;
  }
  .welcome-copy h1 {
    font-size: 48px;
    line-height: 1.05;
    letter-spacing: -2px;
    margin-bottom: 20px;
  }
  .welcome-copy .lede {
    font-size: 14px;
    max-width: 335px;
    line-height: 1.75;
    margin-bottom: 22px;
  }
  .welcome-copy .button {
    min-height: 49px;
    font-size: 13px;
    padding: 13px 20px;
  }
  .small-note {
    font-size: 11px;
    line-height: 1.7;
    margin-top: 14px;
  }
  .collection-illustration {
    height: 270px;
    border-radius: 120px 120px 10px 10px;
    margin: 5px 10px 0;
  }
  .illustration-label {
    top: 23px;
    font-size: 7px;
    letter-spacing: 1.8px;
  }
  .illustration-card {
    width: 116px;
    height: 181px;
    top: 59px;
    left: calc(50% - 125px);
  }
  .illustration-book {
    left: auto;
    right: calc(50% - 125px);
    top: 72px;
  }
  .illustration-record {
    width: 85px;
    height: 85px;
    bottom: 10px;
  }
  .illustration-spark {
    font-size: 28px;
    left: 23px;
    bottom: 24px;
  }
  .returning-profiles {
    padding-top: 0;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .library-hero {
    display: block;
    padding: 31px 0 25px;
  }
  .hero-copy .eyebrow {
    font-size: 8px;
    gap: 8px;
    margin-bottom: 15px;
  }
  .hero-copy h1 {
    font-size: 47px;
    letter-spacing: -2px;
    margin-bottom: 12px;
  }
  .hero-copy .lede {
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 20px;
  }
  .hero-copy .button {
    font-size: 12px;
    min-height: 45px;
    padding: 11px 16px;
  }
  .collection-note {
    margin-top: 25px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    border-radius: 9px;
  }
  .collection-note>p {
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -.5px;
    margin: 0;
    flex: 1;
  }
  .collection-note .note-spark {
    display: none;
  }
  .hero-stats {
    padding: 0 0 0 20px;
    border-top: 0;
    border-left: 1px solid #bdccb7;
    gap: 17px;
  }
  .hero-stats strong {
    font-size: 25px;
  }
  .hero-stats span {
    font-size: 8px;
    line-height: 1.5;
  }
  .section-heading {
    padding-top: 25px;
    margin-bottom: 18px;
    gap: 10px;
  }
  .section-heading h2 {
    font-size: 26px;
  }
  .section-heading>p {
    font-size: 10px;
  }
  .category-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-right: -20px;
    margin-bottom: 16px;
    padding: 0 20px 4px 0;
    gap: 7px;
  }
  .category-list::-webkit-scrollbar {
    display: none;
  }
  .category-chip {
    font-size: 11px;
    min-height: 44px;
    padding: 10px 14px;
  }
  .library-toolbar {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 19px;
  }
  .search-field {
    max-width: none;
    background: var(--surface);
    min-height: 46px;
    padding: 0 12px;
  }
  .search-field input {
    font-size: 16px;
    min-height: 46px;
  }
  .toolbar-selects {
    width: 100%;
    gap: 10px;
  }
  .toolbar-selects>label {
    flex: 1;
    min-width: 0;
  }
  .toolbar-selects select {
    width: 100%;
    max-width: none;
    min-height: 44px;
    font-size: 12px;
    background: transparent;
    padding: 11px 27px 11px 12px;
  }
  .media-grid {
    gap: 14px;
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .cover-art {
    min-height: 122px;
    padding: 16px;
    font-size: 38px;
  }
  .cover-art:after {
    inset: 11px;
  }
  .cover-art .icon {
    width: 39px;
    height: 39px;
  }
  .card-body {
    padding: 13px;
    gap: 7px;
  }
  .card-title {
    font-size: 20px;
    letter-spacing: -.4px;
  }
  .card-meta {
    font-size: 10px;
    line-height: 1.6;
  }
  .card-notes {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }
  .card-footer {
    gap: 7px;
    padding-top: 4px;
    align-items: flex-start;
    flex-direction: column;
  }
  .rating-display {
    font-size: 11px;
    letter-spacing: .5px;
  }
  .status-badge {
    font-size: 9px;
    padding: 4px 6px;
  }
  .genre-tag {
    font-size: 9px;
    padding: 3px 5px;
    margin-right: 2px;
  }
  .empty-state {
    padding: 33px 23px;
    display: block;
    text-align: center;
    min-height: 0;
  }
  .empty-art {
    width: 73px;
    height: 89px;
    margin: 0 auto 26px;
  }
  .empty-art .icon {
    width: 39px;
    height: 39px;
  }
  .empty-art>span {
    font-size: 33px;
    right: -12px;
    bottom: -12px;
  }
  .empty-state .eyebrow {
    justify-content: center;
    font-size: 8px;
  }
  .empty-state h3 {
    font-size: 28px;
    line-height: 1.12;
    margin-bottom: 12px;
    max-width: none;
  }
  .empty-state p:not(.eyebrow) {
    font-size: 12px;
    line-height: 1.8;
    max-width: 280px;
    margin: 0 auto 21px;
  }
  .empty-state .button {
    font-size: 12px;
  }
  .collection-footnote {
    font-size: 9px;
    line-height: 1.8;
    margin: 24px 10px 0;
  }
  .site-footer {
    font-size: 9px;
    align-items: center;
    padding: 20px 0;
  }
  .site-footer>span:first-child {
    font-size: 15px;
  }
  .page-intro {
    padding: 32px 0 18px;
  }
  .page-intro h1 {
    font-size: 46px;
    letter-spacing: -2px;
  }
  .page-intro .lede {
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 14px;
  }
  .taste-summary {
    gap: 8px;
  }
  .taste-stat {
    padding: 15px 11px;
    border-radius: 8px;
  }
  .taste-stat strong {
    font-size: 30px;
  }
  .taste-stat p,.taste-stat span {
    font-size: 10px;
    line-height: 1.6;
  }
  .taste-details {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 16px 0;
  }
  .taste-details>section,.taste-note {
    padding: 22px;
  }
  .taste-details h2 {
    font-size: 25px;
  }
  .taste-details p {
    font-size: 12px;
  }
  .taste-invitation {
    gap: 15px;
    padding: 22px;
    align-items: flex-start;
  }
  .taste-invitation>.note-spark {
    font-size: 30px;
  }
  .taste-invitation>div {
    flex-basis: calc(100% - 45px);
  }
  .taste-invitation h2 {
    font-size: 24px;
  }
  .taste-invitation p {
    font-size: 12px;
  }
  .taste-invitation .button {
    margin: 0;
    width: 100%;
    font-size: 12px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .settings-card {
    padding: 24px;
  }
  .settings-card h2 {
    font-size: 27px;
  }
  .settings-card .eyebrow {
    font-size: 8px;
  }
  .settings-card>p:not(.eyebrow):not(.help-text) {
    font-size: 12px;
  }
  .settings-card .help-text {
    font-size: 11px;
  }
  .input-action {
    flex-direction: row;
  }
  .input-action input {
    width: 0;
    min-width: 0;
    flex: 1;
  }
  .settings-card .button-row {
    flex-direction: row;
  }
  .settings-card .button {
    font-size: 12px;
    padding: 12px 14px;
  }
  .settings-card details summary {
    font-size: 12px;
  }
  .settings-card ol {
    font-size: 12px;
  }
  .storage-warning {
    padding: 20px;
    font-size: 12px;
  }
  .storage-warning h2 {
    font-size: 25px;
  }
  dialog {
    padding: 24px 20px;
    border-radius: 14px;
    width: calc(100% - 24px);
    max-height: calc(100dvh - 32px);
    margin: auto;
  }
  .dialog-heading h2 {
    font-size: 28px;
  }
  .dialog-heading .eyebrow {
    font-size: 7px;
    letter-spacing: 1.2px;
    margin-bottom: 11px;
  }
  .dialog-heading .icon-button {
    min-width: 38px;
    min-height: 44px;
    width: 38px;
    border: 0;
  }
  .dialog-intro {
    font-size: 12px;
    line-height: 1.8;
  }
  .dialog-actions {
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 23px;
    padding-top: 19px;
  }
  .dialog-actions .button {
    font-size: 12px;
    padding: 12px 15px;
    min-height: 46px;
  }
  .form-grid {
    gap: 17px 13px;
  }
  .form-grid label {
    font-size: 11px;
  }
  .optional {
    font-size: 10px;
    padding-left: 3px;
  }
  .rating-options {
    gap: 6px;
  }
  .rating-option>span {
    gap: 6px;
    min-height: 46px;
    font-size: 20px;
  }
  .rating-option b {
    font-size: 11px;
  }
  .rating-explanation p {
    font-size: 10px;
  }
  .rating-clear {
    font-size: 10px;
  }
  .item-actions .action-spacer {
    display: none;
  }
  .item-actions #delete-item {
    margin-right: auto;
  }
  .item-actions {
    gap: 6px;
  }
  .item-actions .button {
    padding: 12px 11px;
    font-size: 11px;
  }
  .profile-choice {
    min-height: 75px;
    padding: 14px;
  }
  .profile-avatar {
    width: 42px;
    height: 42px;
    font-size: 23px;
  }
  .profile-name {
    font-size: 13px;
  }
  .profile-meta {
    font-size: 10px;
  }
  .help-text {
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .main-shell,.site-footer {
    margin-left: 16px;
    margin-right: 16px;
  }
  .site-header {
    padding: 15px 16px;
  }
  .brand {
    font-size: 21px;
  }
  .profile-switch {
    max-width: 138px;
    gap: 5px;
    padding: 9px;
  }
  .profile-switch span {
    max-width: 67px;
  }
  .welcome-copy h1 {
    font-size: 43px;
  }
  .hero-copy h1 {
    font-size: 42px;
  }
  .collection-note {
    padding: 17px;
  }
  .collection-note>p {
    font-size: 18px;
  }
  .hero-stats {
    padding-left: 14px;
    gap: 12px;
  }
  .hero-stats span {
    font-size: 7px;
  }
  .media-grid {
    gap: 10px;
  }
  .card-body {
    padding: 11px;
  }
  .card-title {
    font-size: 19px;
  }
  .settings-card {
    padding: 20px;
  }
  .input-action {
    flex-direction: column;
  }
  .input-action input {
    width: 100%;
    flex: auto;
  }
  .item-actions {
    justify-content: space-between;
  }
  .item-actions #delete-item {
    flex-basis: 100%;
    margin: 0;
  }
  .rating-option>span {
    gap: 4px;
  }
  .settings-card .button-row {
    flex-direction: column;
  }
}

/* Honor the device preference for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *,*:before,*:after {
    scroll-behavior: auto!important;
    transition: none!important;
    animation: none!important;
  }
}

/* Collection artwork uses only local CSS: no stock images or invented ratings. */
.restore-button {
  display: flex!important;
  margin-top: 9px;
  font-size: 12px!important;
  min-height: 44px!important;
  padding-top: 8px!important;
  padding-bottom: 8px!important;
}

.restore-button+.small-note {
  margin-top: 8px;
}

.avatar-1 {
  background: #efdacb;
}

.avatar-2 {
  background: #e1d9e8;
}

.avatar-3 {
  background: #e8e0b9;
}

.profile-choice>.profile-copy {
  flex: 1;
}

.profile-choice>span:last-child:not(.profile-copy) {
  color: #7d8875;
}

.cover-art {
  display: block;
  min-height: 195px;
  padding: 22px;
}

.cover-eyebrow {
  position: absolute;
  top: 18px;
  left: 22px;
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.7px;
  line-height: 1.5;
}

.cover-mark {
  position: absolute;
  right: 22px;
  top: 31px;
  font-family: var(--serif);
  font-size: 62px;
  line-height: 1;
  opacity: .35;
  font-weight: 400;
  letter-spacing: -6px;
}

.cover-title {
  position: absolute;
  bottom: 39px;
  left: 22px;
  right: 22px;
  max-height: 2.3em;
  overflow: hidden;
  text-align: left;
  font-size: 29px;
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -.6px;
}

.cover-type {
  position: absolute;
  left: 22px;
  bottom: 19px;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 1.8px;
  line-height: 1.5;
  text-transform: uppercase;
}

.status-badge {
  width: fit-content;
}

.status-planned {
  background: #ede8dd;
  color: #78654b;
}

.status-in-progress {
  background: #e4e8ed;
  color: #53677c;
}

.status-finished {
  background: #e5ebdd;
  color: #597345;
}

.status-dropped {
  background: #eee7e3;
  color: #806c63;
}

.card-genres {
  line-height: 1.3;
}

.text-button:not(.button) {
  border: 0;
  background: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.text-button:not(.button):hover {
  color: var(--orange);
}

.card-footer {
  padding-top: 2px;
}

.favorite-list {
  list-style: none;
  margin: 0 0 25px;
  padding: 0;
}

.favorite-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  font-size: 13px;
  border-bottom: 1px solid #cfd7c6;
  padding: 13px 0;
  line-height: 1.6;
}

.favorite-list li>span:first-child {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.favorite-list li>span:last-child {
  color: #9b783e;
  font-size: 11px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.favorite-list small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.taste-details>.taste-note {
  grid-column: 1/-1;
}

.taste-note>h3 {
  font-size: 26px;
}

.taste-note>.muted {
  max-width: 700px;
  margin-top: 22px;
  font-size: 12px;
}

@media (max-width: 600px) {
  .toolbar-selects select {
    font-size: 16px;
  }
  .cover-art {
    min-height: 158px;
    padding: 16px;
  }
  .cover-eyebrow {
    left: 14px;
    top: 14px;
    font-size: 6px;
    letter-spacing: 1.1px;
  }
  .cover-mark {
    right: 15px;
    top: 34px;
    font-size: 47px;
  }
  .cover-title {
    left: 14px;
    right: 14px;
    bottom: 34px;
    font-size: 23px;
    max-height: 2.2em;
  }
  .cover-type {
    left: 14px;
    bottom: 16px;
    font-size: 7px;
    letter-spacing: 1.4px;
  }
  .card-footer .text-button {
    font-size: 10px;
    min-height: 44px;
  }
  .card-footer {
    gap: 0;
  }
  .favorite-list li {
    font-size: 12px;
  }
  .favorite-list li>span:last-child {
    font-size: 10px;
  }
  .restore-button {
    margin-top: 5px;
  }
  .restore-button+.small-note {
    margin-top: 4px;
  }
  .welcome-copy>.small-note {
    max-width: 300px;
  }
}

/* Keep artwork icons proportional and horizontal category scrolling inside the page. */
.cover-mark .icon {
  width: 1em;
  height: 1em;
  stroke-width: 1.1;
}

@media (max-width: 360px) {
  .category-list {
    margin-right: -16px;
    padding-right: 16px;
  }
}

@media (max-width: 360px) {
  .toolbar-selects {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Appearance controls are shared by every local profile in this browser. */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}

.theme-toggle:hover {
  background: #e6e9df;
}

.theme-toggle .icon {
  width: 20px;
  height: 20px;
}

.header-actions .profile-switch {
  min-width: 44px;
}

.header-actions .profile-switch span {
  min-width: 0;
}

.appearance-card select {
  display: block;
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  padding: 12px 13px;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

/* Dark mode uses layered charcoal and green, rather than reversing the page. */
:root[data-theme="dark"] {
  --paper: #141b18;
  --surface: #1d2721;
  --ink: #ecece0;
  --muted: #aab4a5;
  --orange: #ef9b77;
  --orange-light: #3a2a22;
  --sage: #28382c;
  --line: #3b483e;
  --action: #c7d8af;
  --action-ink: #1b261e;
  color-scheme: dark;
}

[data-theme="dark"] .skip-link,
[data-theme="dark"] .button.primary {
  background: var(--action);
  color: var(--action-ink);
}

[data-theme="dark"] .button.primary:hover {
  background: #d9e6c7;
}

[data-theme="dark"] .button.secondary:hover,
[data-theme="dark"] .theme-toggle:hover {
  background: #2b372e;
}

[data-theme="dark"] .brand-mark {
  background: #b6cba4;
  color: #172018;
}

[data-theme="dark"] .desktop-nav button[aria-current="page"] {
  background: #2b392e;
}

[data-theme="dark"] .category-chip[aria-pressed="true"] {
  background: var(--action);
  border-color: var(--action);
  color: var(--action-ink);
}

[data-theme="dark"] .category-chip:hover {
  border-color: #a4b295;
}

[data-theme="dark"] .search-field input {
  color: var(--ink);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #8e9a8a;
  opacity: 1;
}

[data-theme="dark"] select option {
  background: var(--surface);
  color: var(--ink);
}

[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--ink);
}

[data-theme="dark"] .media-card:hover {
  box-shadow: 0 8px 25px #0000002b;
}

[data-theme="dark"] .cover-art,
[data-theme="dark"] .cover-screen {
  background: #24372f;
  color: #bdcfbb;
}

[data-theme="dark"] .cover-books {
  background: #3c3425;
  color: #e0c89a;
}

[data-theme="dark"] .cover-games {
  background: #342c3e;
  color: #cfc0e0;
}

[data-theme="dark"] .cover-music {
  background: #3b2c28;
  color: #e7b39c;
}

[data-theme="dark"] .rating-display,
[data-theme="dark"] .favorite-list li>span:last-child {
  color: #e0b66b;
}

[data-theme="dark"] .status-badge,
[data-theme="dark"] .status-planned {
  background: #3b3527;
  color: #e0cb95;
}

[data-theme="dark"] .status-in-progress {
  background: #293744;
  color: #b7cee7;
}

[data-theme="dark"] .status-finished {
  background: #2c3e28;
  color: #c5dab0;
}

[data-theme="dark"] .status-dropped {
  background: #3d302c;
  color: #dcb8a5;
}

[data-theme="dark"] .empty-state {
  background: #1d2a21;
  border-color: #52674b;
}

[data-theme="dark"] .empty-state .eyebrow {
  color: #b2c6a2;
}

[data-theme="dark"] .empty-art {
  background: #2c3e2d;
  border-color: #52674b;
  color: #b2c6a2;
}

[data-theme="dark"] .note-spark {
  color: #a5bf97;
}

[data-theme="dark"] .hero-stats {
  border-color: #52634b;
}

[data-theme="dark"] .hero-stats span {
  color: #bac8b2;
}

[data-theme="dark"] .collection-footnote,
[data-theme="dark"] .site-footer,
[data-theme="dark"] .site-footer>span:first-child {
  color: #a2b099;
}

[data-theme="dark"] .taste-details>section,
[data-theme="dark"] .taste-note,
[data-theme="dark"] .installation-card {
  background: #223026;
}

[data-theme="dark"] .favorite-list li {
  border-color: var(--line);
}

[data-theme="dark"] .settings-card-icon {
  color: #b2c6a2;
}

[data-theme="dark"] .settings-card ol {
  color: #b7c6b2;
}

[data-theme="dark"] .profile-choice:hover {
  background: #2b392e;
  border-color: #617356;
}

[data-theme="dark"] .profile-avatar {
  background: #344735;
  color: #d9e5ce;
}

[data-theme="dark"] .avatar-1 {
  background: #4a372a;
  color: #eac6a7;
}

[data-theme="dark"] .avatar-2 {
  background: #3d3247;
  color: #d7c4e5;
}

[data-theme="dark"] .avatar-3 {
  background: #45402a;
  color: #e1d4a0;
}

[data-theme="dark"] .profile-choice>span:last-child:not(.profile-copy) {
  color: #b8c9a9;
}

[data-theme="dark"] .optional {
  color: #a0ad98;
}

[data-theme="dark"] .rating-option>span {
  color: #b3bea5;
}

[data-theme="dark"] .rating-option input:checked+span {
  background: #4b3d23;
  border-color: #c4a259;
  color: #f0d39b;
}

[data-theme="dark"] .rating-option input:checked+span b {
  color: #f1dcae;
}

[data-theme="dark"] .rating-clear input {
  accent-color: var(--action);
}

[data-theme="dark"] .button.danger {
  background: #412b27;
  border-color: #805044;
  color: #f3b5a0;
}

[data-theme="dark"] .button.danger:hover {
  background: #52342e;
}

[data-theme="dark"] .storage-warning {
  background: #3f2d24;
  border-color: #916344;
}

[data-theme="dark"] .toast {
  background: var(--action);
  color: var(--action-ink);
  box-shadow: 0 6px 25px #0000004d;
}

[data-theme="dark"] dialog {
  box-shadow: 0 25px 100px #00000066;
}

[data-theme="dark"] dialog::backdrop {
  background: #030906a6;
}

/* The welcome artwork keeps its paper-and-record character at a softer brightness. */
[data-theme="dark"] .collection-illustration {
  background: #213026;
}

[data-theme="dark"] .illustration-label,
[data-theme="dark"] .illustration-caption {
  color: #b0c0a5;
}

[data-theme="dark"] .illustration-orbit {
  border-color: #354a37;
}

[data-theme="dark"] .illustration-card {
  box-shadow: 0 12px 30px #00000040;
}

[data-theme="dark"] .illustration-movie {
  background: #304a3e;
  color: #e4e7cd;
}

[data-theme="dark"] .movie-art {
  background: #68794f;
}

[data-theme="dark"] .movie-art:before {
  background: #d0a56e;
}

[data-theme="dark"] .movie-art>div {
  background: #94a373;
}

[data-theme="dark"] .illustration-book {
  background: #975038;
  color: #f3d9b7;
}

[data-theme="dark"] .book-lines,
[data-theme="dark"] .book-lines:after {
  border-color: #c2835b;
}

[data-theme="dark"] .art-rule {
  background: #d6a37b;
}

[data-theme="dark"] .illustration-record>div {
  background: #bfa15a;
  border-color: #bfa15a;
  box-shadow: inset 0 0 0 3px #25352d;
}

@media (max-width: 800px) {
  .header-actions {
    gap: 8px;
  }

  [data-theme="dark"] .mobile-nav:not([hidden]) {
    background: #18211cf5;
  }

  [data-theme="dark"] .mobile-nav button {
    color: #a4b19b;
  }

  [data-theme="dark"] .mobile-nav button[aria-current="page"] {
    background: #2b392e;
    color: var(--ink);
  }
}

@media (max-width: 600px) {
  .site-header {
    gap: 10px;
  }

  .header-actions {
    flex-shrink: 0;
  }

  .header-actions .profile-switch {
    max-width: 132px;
    padding-left: 9px;
    padding-right: 9px;
    gap: 6px;
  }

  .header-actions .profile-switch span {
    max-width: 60px;
  }
}

@media (max-width: 360px) {
  .site-header {
    gap: 8px;
  }

  .brand {
    font-size: 22px;
    gap: 0;
  }

  .brand-mark {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .profile-switch {
    max-width: 112px;
    gap: 5px;
  }

  .header-actions .profile-switch span {
    max-width: 42px;
  }
}

/* Keep field and button boundaries visible against the darker surfaces. */
[data-theme="dark"] .search-field,
[data-theme="dark"] .toolbar-selects select,
[data-theme="dark"] dialog input:not([type="radio"]),
[data-theme="dark"] dialog select,
[data-theme="dark"] dialog textarea,
[data-theme="dark"] .settings-card input,
[data-theme="dark"] .appearance-card select,
[data-theme="dark"] .category-chip:not([aria-pressed="true"]),
[data-theme="dark"] .button.secondary,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .profile-switch,
[data-theme="dark"] .icon-button,
[data-theme="dark"] .rating-option>span {
  border-color: #65755f;
}

/* A long profile name should truncate without squeezing the section label. */
.hero-copy .eyebrow {
  white-space: nowrap;
}

.hero-copy .eyebrow-line {
  flex-shrink: 0;
}

#library-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Catalog matches stay inside the editor and never replace a personal opinion. */
.catalog-lookup { border: 1px solid var(--line); padding: 16px; border-radius: 10px; min-width: 0; }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.catalog-heading strong { font-size: 14px; }
.catalog-heading .button { font-size: 12px; padding: 9px 12px; }
.catalog-results { max-height: 270px; overflow-y: auto; display: grid; gap: 8px; margin-top: 10px; }
.catalog-result { text-align: left; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); min-height: 64px; overflow-wrap: anywhere; }
.catalog-result:hover { border-color: var(--orange); }
.catalog-result strong, .catalog-result span, .catalog-result small { display: block; }
.catalog-result span { font-size: 12px; margin-top: 4px; color: var(--muted); }
.catalog-result small { color: var(--muted); font-size: 10px; margin-top: 6px; }
.catalog-selected { display: flex; gap: 14px; padding-top: 14px; font-size: 12px; line-height: 1.6; }
.catalog-selected img { width: 64px; max-height: 100px; object-fit: contain; align-self: flex-start; }
.catalog-selected p { max-height: 100px; overflow-y: auto; }
.catalog-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface); z-index: 1; }
.artwork-credit { display: block; margin-top: 6px; font-size: 11px; }
.catalog-details { min-width: 0; padding: 14px 0; border-top: 1px solid var(--line); }
.catalog-details summary { min-height: 44px; cursor: pointer; font-size: 13px; font-weight: 600; }
.catalog-details #catalog-facts p { margin: 4px 0; }

/* Tap-first taste setup: preferences are private to each local profile. */
.taste-onboarding { display: flex; align-items: center; justify-content: space-between; gap: 24px; border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin: 0 0 32px; background: var(--surface); }
.taste-onboarding .eyebrow { margin-bottom: 8px; }
.taste-onboarding h2 { font-size: 27px; margin-bottom: 8px; }
.taste-onboarding p:not(.eyebrow) { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.7; }
.taste-onboarding .button { flex-shrink: 0; }
.taste-setup-dialog { max-width: 650px; }
.taste-setup-dialog progress { width: 100%; height: 7px; accent-color: var(--orange); margin: 0 0 24px; }
.taste-setup-dialog #taste-step-body section { margin: 24px 0; }
.taste-setup-dialog h3 { font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.taste-choices { display: flex; flex-wrap: wrap; gap: 9px; }
.taste-choice { min-height: 46px; padding: 11px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; color: var(--ink); font-size: 14px; }
.taste-choice[aria-pressed="true"] { background: var(--action); color: var(--action-ink); border-color: var(--action); }
.media-choices .taste-choice { flex: 1 1 40%; border-radius: 10px; min-height: 70px; }
#taste-profile-summary { margin: 28px 0; }
#taste-preferences p, #taste-step-body>p { font-size: 14px; line-height: 1.8; }
[data-theme="dark"] .taste-choice:not([aria-pressed="true"]) { border-color: #65755f; }
@media(max-width:600px) {
  .taste-onboarding { flex-direction: column; align-items: stretch; padding: 20px; gap: 18px; }
  .taste-onboarding h2 { font-size: 25px; }
  .taste-choice { font-size: 13px; padding: 10px 13px; }
  .taste-setup-dialog .dialog-actions .button { flex: 1 1 auto; }
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .button { margin: 0; }
.taste-category-tabs { padding-bottom: 16px; border-bottom: 1px solid var(--line); }

/* Rapid history entry shares the catalog but never guesses enjoyment. */
.history-dialog { max-width: 680px; }
.history-search { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; }
.history-search label { font-size: 13px; font-weight: 600; }
.history-search input, .history-search select { display: block; margin-top: 8px; }
.history-search .button-row { grid-column: 1 / -1; }
.history-results { display: grid; gap: 12px; margin: 18px 0; }
.history-result { display: flex; gap: 15px; border: 1px solid var(--line); padding: 15px; border-radius: 10px; }
.history-result-art { position: relative; width: 64px; min-height: 86px; flex-shrink: 0; }
.history-result-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.history-result-copy { min-width: 0; }
.history-result h3, .history-last h3 { font-size: 23px; margin: 0 0 8px; }
.history-result p, .history-result small { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 4px 0; }
.history-result .button { display: block; margin-top: 10px; }
.history-confirmation { font-size: 13px; line-height: 1.7; color: var(--ink); }
.history-last { padding: 16px; border-radius: 10px; background: var(--sage); margin-top: 16px; }
.history-last #history-undo { margin-top: 12px; }
.taste-history-button { margin-bottom: 20px; }
@media(max-width:600px) {
  .history-search { grid-template-columns: 1fr; }
  .history-result-art { width: 48px; min-height: 68px; }
  .history-result { padding: 12px; gap: 10px; }
  .history-result h3 { font-size: 21px; }
}
