:root {
  --bg-base: #f4f1e9;
  --bg-surface: #eeeadf;
  --text-primary: #25251f;
  --text-secondary: #6e6b63;
  --accent: #c4452b;
}

/* F-01: Base */
*, *::before, *::after {
  box-sizing: border-box;
}

body, html {
  margin: 0;
  padding: 0;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

#react-entry-point,
._dash-loading {
  background-color: var(--bg-base);
}

/* F-03 / F-04: Dash tab container overrides */
.dash-tabs {
  border-bottom: 1px solid #333 !important;
}

.dash-tab {
  background-color: var(--bg-base) !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  color: var(--text-secondary) !important;
  padding: 10px 20px !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: color 0.15s ease !important;
}

.dash-tab:hover {
  color: var(--text-primary) !important;
}

.dash-tab--selected {
  background-color: var(--bg-base) !important;
  border-bottom: 2px solid var(--accent) !important;
  color: var(--text-primary) !important;
}

/* F-02: Artist card grid */
.artist-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 20px 0;
}

.artist-card {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background-color: var(--bg-surface);
  background-size: cover;
  background-position: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.artist-card:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* Missing/expired artwork: an intentional tile with the artist initial,
   rather than a bare dark box. */
.artist-card--placeholder {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.artist-card__initial {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.22);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  user-select: none;
}

.artist-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 8px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
}

.artist-card__rank {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  margin-right: 5px;
}

.artist-card__name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* F-06: Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid #2a2a2a;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header__identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.app-header__name {
  font-weight: 600;
  font-size: 0.9rem;
}

.app-header__logout {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #444;
  padding: 5px 14px;
  border-radius: 50px;
  letter-spacing: 0.03em;
  transition: color 0.15s, border-color 0.15s;
}

.app-header__logout:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

/* KK: About tab — constrained, readable prose */
.about {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 4px 64px;
}

.about__section {
  margin-bottom: 32px;
}

.about__h2 {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.about__p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 12px;
}

.about__list {
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 20px;
}

.about__list li {
  margin-bottom: 8px;
}

.about__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.about__link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--accent);
  padding: 8px 16px;
  border-radius: 50px;
  transition: background-color 0.15s, color 0.15s;
}

.about__link:hover {
  background-color: var(--accent);
  color: #000;
}

/* II-04: discreet owner login on the public portfolio header */
.app-header__connect {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--accent);
  padding: 5px 14px;
  border-radius: 50px;
  letter-spacing: 0.03em;
  transition: background-color 0.15s, color 0.15s;
}

.app-header__connect:hover {
  background-color: var(--accent);
  color: #000;
}

/* F-07: Login page */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--bg-base);
  text-align: center;
  gap: 0;
}

.login-page__title {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.login-page__subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0 0 40px;
}

.login-page__btn {
  background-color: var(--accent);
  color: #000000;
  padding: 14px 36px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.1s ease, background-color 0.15s ease;
  display: inline-block;
}

.login-page__btn:hover {
  background-color: #a73520;
  transform: scale(1.03);
}

/* F-05: Genre chart container */
.genre-chart {
  padding: 8px 0;
}

/* Loading spinner overlay */
._dash-loading-callback {
  background-color: transparent !important;
}

/* --- Rustling --- */

/* FF-02: keep Rustle mode card-shaped and centered on desktop */
#rustle-wrap {
  max-width: 480px;
  margin: 0 auto;
}

/* FF-01: cap the crate so it stays card-shaped on wide viewports */
.rustle-stack {
  max-width: min(92vw, 400px);
}

@media (max-width: 480px) {
  .rustle-stack {
    max-width: 100%;
  }
  .mode-tab {
    font-size: 0.8rem !important;
    padding: 9px 0 !important;
  }
  .rustle-counter-chip {
    top: 64px;
    right: 10px;
  }
}

/* Mode switcher: pill tabs, green rounded outline marks the mode */
.mode-tabs {
  display: flex !important;
  gap: 12px;
  border: none !important;
  margin: 16px 0 8px;
}

.mode-tab {
  background-color: transparent !important;
  border: 1px solid #333 !important;
  border-radius: 50px !important;
  color: var(--text-secondary) !important;
  padding: 10px 0 !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: color 0.15s ease, border-color 0.15s ease !important;
}

.mode-tab:hover {
  color: var(--text-primary) !important;
}

.mode-tab--selected {
  background-color: rgba(196, 69, 43, 0.08) !important;
  border: 2px solid var(--accent) !important;
  color: var(--text-primary) !important;
}

/* EE-03: missing-art placeholder */
.rustle-card__art--placeholder {
  background: repeating-linear-gradient(
    45deg, #2a2a2a, #2a2a2a 12px, #303030 12px, #303030 24px
  );
}

/* BB: recent-search chips */
.rustle-recents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  max-width: 420px;
}

.rustle-recents__chip {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid #333;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.rustle-recents__chip:hover {
  border-color: var(--accent);
}

.rustle-recents__clear {
  background: none;
  color: var(--text-secondary);
  border: none;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

/* EE-01: zero-results state */
.rustle-no-results {
  color: var(--text-secondary);
  margin-top: 16px;
}

/* EE-05 / EE-06: error / offline toast */
.rustle-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  padding: 10px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.rustle-toast--error {
  background-color: #e22134;
  color: #fff;
}

.rustle-toast--offline {
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid #444;
}

/* JJ: read-only sandbox sign-in hint */
.rustle-toast--info {
  background-color: var(--bg-surface);
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* JJ: Spotify embed mini-player under the sandbox card stack */
.rustle-embed {
  display: block;
  margin: 12px auto 0;
  max-width: 480px;
  border-radius: 12px;
}

/* W-01: gesture surface — stop the browser from scrolling or
   selecting while a card is being dragged */
[data-rustle-card-area="true"] {
  position: relative; /* anchors the .rustle-unlock overlay */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

[data-rustle-card-area="true"] img {
  -webkit-user-drag: none;
}

/* V-01: crate-of-records stack */
.rustle-stack {
  position: relative;
  perspective: 1200px;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 3 / 4;
  margin: 32px auto 0;
}

.rustle-stack__card {
  position: absolute;
  inset: 0;
  transform-origin: top center;
  transition: transform 240ms ease, opacity 240ms ease;
}

/* V-02: top card centered, next three peek behind with progressive
   lift, shrink, and a small forward tilt */
.rustle-stack__card--0 {
  z-index: 4;
  animation: rustle-promote 240ms ease;
}

.rustle-stack__card--1 {
  z-index: 3;
  transform: translateY(-14px) scale(0.95) rotateX(4deg);
}

.rustle-stack__card--2 {
  z-index: 2;
  transform: translateY(-28px) scale(0.9) rotateX(6deg);
}

.rustle-stack__card--3 {
  z-index: 1;
  transform: translateY(-42px) scale(0.85) rotateX(8deg);
}

/* V-04: next card slides up into the top slot */
@keyframes rustle-promote {
  from {
    transform: translateY(-14px) scale(0.95) rotateX(4deg);
  }
  to {
    transform: translateY(0) scale(1) rotateX(0);
  }
}

/* V-03: top card exits in the gesture direction */
.rustle-card--exiting {
  transition: transform 240ms ease, opacity 240ms ease;
  opacity: 0 !important;
  pointer-events: none;
}

.rustle-card--exiting-left {
  transform: translateX(-120%) rotate(-8deg) !important;
}

.rustle-card--exiting-right {
  transform: translateX(120%) rotate(8deg) !important;
}

.rustle-card--exiting-up {
  transform: translateY(-120%) !important;
}

.rustle-card--exiting-down {
  transform: translateY(120%) !important;
}

/* Card chrome */
.rustle-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--bg-surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.rustle-card__art {
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: cover;
  background-color: #2a2a2a;
}

.rustle-card__title {
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Target picker */
.rustle-picker__title {
  margin: 24px 0 12px;
}

.rustle-picker__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}

.rustle-picker__btn {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.rustle-picker__btn:hover {
  border-color: var(--accent);
}

.rustle-picker__btn--create {
  color: var(--text-secondary);
  border-style: dashed;
}

/* CC-02: create-new form */
.rustle-picker__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  max-width: 420px;
}

.rustle-picker__btn--confirm {
  background-color: var(--accent);
  color: #000;
  border-color: var(--accent);
  text-align: center;
  flex: 1;
}

/* Z-02: already-added badge */
.rustle-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.75);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* X-04: no-preview pill */
.rustle-card__no-preview {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.75);
  color: var(--text-secondary);
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Z-03: shake on a duplicate commit */
.rustle-card--shake {
  animation: rustle-shake 200ms ease;
}

@keyframes rustle-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* Z-04: added stamp — scale in, fade out over ~600ms */
.added-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 30;
  border: 4px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
  animation: rustle-stamp 600ms ease forwards;
}

@keyframes rustle-stamp {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-12deg) scale(1.6);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-12deg) scale(1);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-12deg) scale(1);
  }
}

/* Z-06: session add counter */
.rustle-counter-chip {
  position: fixed;
  top: 76px;
  right: 16px;
  z-index: 200;
  background-color: var(--accent);
  color: #000;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
}

.rustle-counter-chip--hidden {
  display: none;
}

/* X-05: tap-to-start audio unlock overlay */
.rustle-unlock {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
}

.rustle-unlock__btn {
  background-color: var(--accent);
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Search bar */
.rustle-search {
  margin-top: 20px;
}

.rustle-search__input {
  width: 100%;
  max-width: 420px;
  height: 48px;
  padding: 0 20px;
  border-radius: 50px;
  border: 1px solid #333;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.rustle-search__input:focus,
.rustle-search__input:focus-visible {
  border-color: var(--accent);
  outline: none;
}

/* ===================================================================
 * Rate feature — sub-tabs, 1-10 tap scale, and the rated-songs table
 * =================================================================== */

.rate-tabs {
  display: flex !important;
  gap: 12px;
  border: none !important;
  margin: 8px 0 4px;
}

.rate-tab {
  background-color: transparent !important;
  border: 1px solid #333 !important;
  border-radius: 50px !important;
  color: var(--text-secondary) !important;
  padding: 8px 0 !important;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
}

.rate-tab--selected {
  background-color: rgba(196, 69, 43, 0.08) !important;
  border: 2px solid var(--accent) !important;
  color: var(--text-primary) !important;
}

.rate-card__subtitle {
  padding: 0 14px 12px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 1-10 tap scale */
.rate-scale {
  max-width: 360px;
  margin: 16px auto 0;
  text-align: center;
}

.rate-scale__label {
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.rate-scale__row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.rate-scale__btn {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 0;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.rate-scale__btn:hover {
  border-color: var(--accent);
}

.rate-scale__btn--active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* Rated-songs table */
.rate-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.rate-table__row td {
  padding: 10px 12px;
  border-bottom: 1px solid #262626;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.rate-table__score {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.rate-table__head th {
  padding: 0 0 8px;
  text-align: left;
}

.rate-table__sort {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 6px 8px;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.rate-table__sort--active {
  color: var(--accent);
}

.rate-empty {
  padding: 48px 0;
  text-align: center;
}

.rate-empty__msg {
  color: var(--text-secondary);
}

/* --- Music Network Visualization (/network) --- */
.network-page {
  color: var(--text, #25251f);
}
.network-title {
  margin: 8px 0 4px;
}
.network-blurb {
  color: var(--text-secondary, #6e6b63);
  max-width: 720px;
  line-height: 1.5;
}
.network-stats {
  color: var(--accent, #c4452b);
  font-size: 0.85rem;
  margin: 4px 0 12px;
}
.network-layout-toggle {
  margin-bottom: 12px;
  color: var(--text-secondary, #6e6b63);
  font-size: 0.9rem;
}
.network-layout-toggle label {
  margin-right: 16px;
  cursor: pointer;
  color: var(--text-secondary, #6e6b63);
}
.network-layout-toggle input {
  accent-color: var(--accent, #c4452b);
  margin-right: 6px;
}

/* rc-slider (ERA range + MIN SHARED SESSIONS) on the dark theme */
/* Dash 4.x slider (filled range + thumbs) -> Spotify green */
.network-filter .dash-slider-range {
  background-color: var(--accent, #c4452b) !important;
}
.network-filter .dash-slider-thumb {
  background-color: var(--accent, #c4452b) !important;
  border-color: var(--accent, #c4452b) !important;
}
.network-filter .rc-slider-mark-text {
  color: var(--text-secondary, #6e6b63);
}
/* the value tooltips that were rendering as white boxes */
.rc-slider-tooltip-inner {
  background-color: #eeeadf !important;
  color: #25251f !important;
  border: 1px solid #d2cec3;
  box-shadow: none !important;
}
.rc-slider-tooltip-arrow {
  border-top-color: #eeeadf !important;
  border-bottom-color: #eeeadf !important;
}

/* Dash editable slider value inputs (min/max boxes beside the track) */
.network-filter input.dash-input-container,
.network-filter .dash-range-slider-input,
.network-filter .dash-slider-input {
  background-color: #eeeadf !important;
  color: #25251f !important;
  border: 1px solid #d2cec3 !important;
  border-radius: 4px;
}

/* Dash 4.x dropdown (button + menu) */
button.dash-dropdown,
.network-dropdown.dash-dropdown {
  background-color: #eeeadf !important;
  color: #25251f !important;
  border: 1px solid #d2cec3 !important;
}
.network-dropdown .dash-dropdown-value,
.network-dropdown .dash-dropdown-placeholder {
  color: #25251f !important;
}
/* Opened menu (Radix portal): content, search field, options */
.dash-dropdown-content,
.dash-dropdown-options {
  background-color: #eeeadf !important;
  color: #25251f !important;
  border: 1px solid #d2cec3 !important;
}
.dash-dropdown-search-container {
  background-color: #eeeadf !important;
  border-bottom: 1px solid #d2cec3 !important;
}
.dash-dropdown-search {
  background-color: #eeeadf !important;
  color: #25251f !important;
}
.dash-dropdown-search::placeholder {
  color: #8a8a8a !important;
}
.dash-dropdown-search-icon {
  color: #8a8a8a !important;
}
.dash-dropdown-option,
.dash-dropdown-option .dash-options-list-option-text {
  color: #25251f !important;
}
.dash-dropdown-option:hover,
.dash-dropdown-option[aria-selected="true"] {
  background-color: #d2cec3 !important;
}
.network-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.network-focus {
  flex: 1 1 320px;
  max-width: 420px;
}
.network-canvas-wrap {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
#network-graph {
  flex: 1 1 auto;
  background: #eeeadf;
  border: 1px solid #d2cec3;
  border-radius: 8px;
}
.network-side-panel {
  flex: 0 0 240px;
  background: #eeeadf;
  border: 1px solid #d2cec3;
  border-radius: 8px;
  padding: 16px;
  min-height: 200px;
}
.network-side-hint {
  color: var(--text-secondary, #6e6b63);
  font-size: 0.9rem;
}
.network-side-name {
  margin: 0 0 4px;
  color: var(--accent, #c4452b);
}
.network-side-instrument,
.network-side-genre,
.network-side-era,
.network-side-degree {
  margin: 2px 0;
  color: var(--text-secondary, #6e6b63);
  font-size: 0.9rem;
}

/* Genre color legend */
.network-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 4px 0 12px;
}
.network-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.network-legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.network-legend-lbl {
  color: var(--text-secondary, #6e6b63);
  font-size: 0.78rem;
}

@media (max-width: 640px) {
  .network-canvas-wrap {
    flex-direction: column;
  }
  .network-side-panel {
    flex-basis: auto;
  }
}

/* Network filters */
.network-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 8px 0 12px;
}
.network-filter {
  flex: 1 1 220px;
  min-width: 200px;
}
.network-filter-lbl {
  display: block;
  color: var(--text-secondary, #6e6b63);
  font-size: 0.8rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.network-dropdown .Select-control,
.network-dropdown .Select-menu-outer {
  background: #eeeadf;
  border-color: #d2cec3;
  color: #25251f;
}

/* McCoy listening journal: paper, ink, and record-sleeve typography. */
:root {
  --rule: #d2cec3;
  --ink: #25251f;
  --serif: Georgia, 'Times New Roman', serif;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
::selection { background: #c4452b; color: #fff9ee; }
a { color: var(--accent); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.app-header {
  position: relative;
  min-height: 92px;
  padding: 20px max(32px, calc((100vw - 1280px) / 2));
  background: var(--bg-base);
  border-bottom: 1px solid var(--rule);
  gap: 20px;
}
.app-header__identity { gap: 32px; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -2px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: var(--bg-base);
  border-radius: 50%;
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  padding-right: 4px;
  line-height: 1;
}
.brand-caption, .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1.5px;
  line-height: 1.5;
}
.brand-caption { color: var(--text-secondary); }
.app-header__connect, .app-header__logout {
  border: 1px solid var(--ink);
  color: var(--ink);
  border-radius: 0;
  padding: 11px 17px;
  font-size: 12px;
  letter-spacing: 0;
}
.app-header__connect:hover, .app-header__logout:hover {
  background: var(--ink);
  color: var(--bg-base);
  border-color: var(--ink);
}
.journal-main {
  max-width: 1344px;
  margin: 0 auto;
  padding: 0 32px 24px;
}

/* Dash sets tab colors inline; these shared overrides are intentional. */
.tab, .dash-tab, .mode-tab {
  background: transparent !important;
  color: var(--text-secondary) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--rule) !important;
  padding: 17px 20px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  border-radius: 0 !important;
  transition: color 150ms, background 150ms !important;
}
.tab:hover, .mode-tab:hover { color: var(--accent) !important; }
.tab--selected, .dash-tab--selected, .mode-tab--selected {
  color: var(--accent) !important;
  border-bottom: 2px solid var(--accent) !important;
}
#public-tabs { max-width: 540px; }
#public-tabs .tab { text-align: left; padding-left: 0 !important; }
#public-mode-tabs, #mode-tabs {
  max-width: 490px;
  margin: 0 0 20px;
}
#public-content-tabs, #content-tabs { max-width: 250px; }
#public-time-tabs, #time-window-tabs {
  max-width: 340px;
  margin-top: 18px;
  margin-left: auto;
}
#public-time-tabs .tab, #time-window-tabs .tab {
  padding: 9px 16px !important;
  border: 1px solid var(--rule) !important;
  font-family: var(--mono);
  font-size: 10px !important;
}
#public-time-tabs .tab--selected,
#time-window-tabs .tab--selected {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  color: var(--bg-base) !important;
}

.listening-intro {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  align-items: center;
  gap: 70px;
  padding: 58px 0 64px;
}
.eyebrow { margin: 0 0 22px; color: var(--accent); }
.listening-intro h1 {
  margin: 0;
  font-size: clamp(58px, 6.5vw, 94px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -5px;
}
.listening-intro h1 em {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--accent);
}
.intro-description {
  max-width: 345px;
  margin: 26px 0 24px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}
.intro-link {
  display: inline-flex;
  gap: 32px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.intro-link:hover { color: var(--accent); border-color: var(--accent); }
.intro-link span { font-size: 18px; line-height: 12px; }
.record-sleeve {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1.12;
  justify-self: end;
  overflow: hidden;
  background: #c4452b;
  color: #fff2d9;
  padding: 22px;
  box-shadow: 9px 9px 0 #e4dfd2;
  transform: rotate(3deg);
}
.sleeve-top, .sleeve-bottom {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
}
.sleeve-top { border-bottom: 1px solid #e9a28d; padding-bottom: 12px; }
.sleeve-bottom {
  position: absolute;
  display: flex;
  justify-content: space-between;
  bottom: 19px;
  left: 22px;
  right: 22px;
}
.vinyl {
  display: grid;
  place-items: center;
  position: absolute;
  width: 84%;
  aspect-ratio: 1;
  left: 8%;
  top: 17%;
  border-radius: 50%;
  background:
    conic-gradient(from 30deg, #0000, #ffffff15, #0000 35%,
      #0000 55%, #ffffff18, #0000 85%),
    repeating-radial-gradient(circle, #22221e 0 2px, #34332c 3px 4px);
  box-shadow: 0 4px 10px #401d2250;
}
.vinyl-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e7ddb9;
  color: #292923;
  transform: rotate(-18deg);
}
.vinyl-label span {
  font: italic 72px/0.9 var(--serif);
  letter-spacing: -8px;
  padding-right: 10px;
}
.vinyl-label small { font: 6px var(--mono); margin-top: 12px; }
.collection-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--ink);
  padding-top: 30px;
  margin-bottom: 25px;
  scroll-margin-top: 25px;
}
.collection-heading .eyebrow { margin-bottom: 8px; }
.collection-heading h2 {
  margin: 0;
  font: 44px/1.15 var(--serif);
  letter-spacing: -1.5px;
}
.collection-heading > p {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0 0 5px;
}
.listening-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  border-bottom: 1px solid var(--rule);
  padding: 24px 0;
  margin-bottom: 6px;
}
.listening-summary > div {
  display: flex;
  align-items: baseline;
  gap: 13px;
  padding: 0 24px;
  border-left: 1px solid var(--rule);
}
.listening-summary > div:first-child { padding-left: 0; border: 0; }
.listening-summary strong { font: 32px var(--serif); }
.listening-summary > div:last-child strong {
  font-size: 24px;
  text-transform: capitalize;
}
.listening-summary span { color: var(--text-secondary); font-size: 10px; }

.artist-grid { gap: 24px 18px; padding: 24px 0; }
.artist-card {
  border-radius: 0;
  aspect-ratio: 0.77;
  background-color: #353c37;
  border-bottom: 1px solid var(--rule);
  transition: transform 180ms ease;
}
.artist-card:hover {
  transform: translateY(-5px);
  box-shadow: none;
}
.artist-card--placeholder { background: #d1d5c7; }
.artist-card--placeholder:nth-child(5n + 2) { background: #d9ae8e; }
.artist-card--placeholder:nth-child(5n + 3) { background: #b6c6cc; }
.artist-card--placeholder:nth-child(5n + 4) { background: #c3bbd1; }
.artist-card--placeholder:nth-child(5n + 5) { background: #dcc979; }
.artist-card--placeholder::before {
  content: '';
  position: absolute;
  width: 110%;
  aspect-ratio: 1;
  top: -15%;
  right: -35%;
  border: 1px solid #25251f35;
  border-radius: 50%;
  box-shadow: 0 0 0 12px #25251f08, 0 0 0 26px #25251f08;
}
.artist-card__initial {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(64px, 9vw, 130px);
  color: #25251fc9;
  top: 37%;
}
.artist-card__genre {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  color: #fff;
  text-shadow: 0 1px 4px #000;
  text-transform: uppercase;
  font: 8px/1.5 var(--mono);
  letter-spacing: 0.5px;
}
.artist-card--placeholder .artist-card__genre {
  color: var(--ink);
  text-shadow: none;
}
.artist-card__overlay {
  min-height: 66px;
  padding: 13px 0 8px;
  background: var(--bg-base);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.artist-card__rank {
  margin: 0;
  font: 10px var(--mono);
  color: var(--accent);
}
.artist-card__name {
  font-size: 13px;
  font-weight: 500;
  white-space: normal;
  line-height: 1.4;
}
.data-caption {
  color: var(--text-secondary);
  font: 10px/1.8 var(--mono);
  border-left: 2px solid var(--accent);
  padding-left: 12px;
  margin: 4px 0 45px;
  max-width: 720px;
}
.journal-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 55px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
  color: var(--text-secondary);
  font: 10px/1.6 var(--mono);
}
.about { padding-top: 50px; }
.about__h2 { font: 30px var(--serif); }
.about__link { border-radius: 0; }
#public-rustle { padding: 30px 0; }
.rustle-search input, .rustle-picker input {
  background: var(--bg-surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 13px;
}
.rustle-card {
  border-radius: 2px;
  box-shadow: 0 12px 25px #25251f20;
  border: 1px solid var(--rule);
}
.rustle-card__art--placeholder {
  background: repeating-radial-gradient(
    circle, #343b35 0 4px, #52584a 5px 6px
  );
}
.rustle-card__no-preview { color: #fff; }
.network-side-panel, #network-graph {
  background: var(--bg-surface);
  border-color: var(--rule);
  border-radius: 0;
}
.network-dropdown, .network-filter { color: var(--ink); }

@media (min-width: 801px) {
  #public-stats-artists { margin-top: -53px; }
  #public-time-tabs { position: relative; z-index: 1; }
}
@media (max-width: 1000px) {
  .brand-caption { display: none; }
  .listening-intro { gap: 35px; }
  .listening-summary > div { flex-direction: column; gap: 5px; }
  .artist-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .app-header { padding: 18px 20px; min-height: 76px; }
  .wordmark { font-size: 28px; }
  .app-header__connect { padding: 10px; font-size: 10px; }
  .journal-main { padding: 0 20px 12px; }
  .listening-intro {
    grid-template-columns: 1fr;
    padding: 40px 0;
    gap: 38px;
  }
  .listening-intro h1 { font-size: 66px; letter-spacing: -3px; }
  .record-sleeve { max-width: 320px; justify-self: center; }
  .collection-heading { align-items: start; flex-direction: column; }
  .collection-heading h2 { font-size: 38px; }
  .collection-heading > p { margin-top: -10px; }
  .tab, .mode-tab { padding: 13px 9px !important; }
  #public-tabs .tab { font-size: 10px !important; }
  #public-time-tabs, #time-window-tabs { margin-left: 0; }
  .listening-summary { grid-template-columns: 1fr 1fr 1.3fr; }
  .listening-summary > div { padding: 0 12px; }
  .listening-summary > div:last-child strong { font-size: 20px; }
  .artist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .artist-card__initial { font-size: 100px; }
  .journal-footer { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.login-page__btn, .rustle-unlock__btn,
.rustle-picker__btn--confirm, .rate-scale__btn--active {
  color: #fff9ee;
}
.rustle-search__input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

#public-time-tabs .tab, #time-window-tabs .tab {
  white-space: nowrap;
  min-width: 90px;
}
@media (max-width: 700px) {
  #public-mode-tabs .tab { font-size: 11px !important; }
  .app-header__identity { gap: 8px; min-width: 0; }
  .app-header__name {
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
