:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --bg-soft: #fafbfc;
  --card: rgba(255, 255, 255, 0.82);
  --card-solid: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --muted-strong: #4b5563;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.12);
  --accent: #6ea8ff;
  --accent-strong: #3f83f8;
  --accent-soft: rgba(110, 168, 255, 0.12);
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.04);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(110, 168, 255, 0.12), transparent 22rem),
    linear-gradient(180deg, #fbfcfd 0%, var(--bg) 58%, #f2f4f7 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.drawer-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 420ms var(--ease-out-expo);
}

.app-shell:has(.sidebar.expanded) {
  grid-template-columns: 300px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.35rem 1rem 1rem;
  border-right: 1px solid var(--border);
  background: rgba(250, 251, 252, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow-y: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.9rem;
}

.sidebar-top {
  display: grid;
  gap: 0.3rem;
  justify-items: center;
  margin-bottom: 0.35rem;
}

.sidebar.expanded .sidebar-top {
  justify-items: start;
}

.sidebar-title {
  margin: 0;
  font-size: 2rem;
  line-height: 0.98;
  letter-spacing: -0.05em;
  transition: opacity 260ms var(--ease-out-expo), transform 260ms var(--ease-out-expo);
}

.sidebar:not(.expanded) .sidebar-title,
.sidebar:not(.expanded) .sidebar-top .eyebrow {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}

.sidebar-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1rem;
}

.sidebar-home {
  display: grid;
  justify-items: center;
}

.sidebar-home-button {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 0;
  color: var(--muted-strong);
  box-shadow: none;
  transition: transform 220ms var(--ease-out-expo), background 220ms var(--ease-out-expo), color 220ms var(--ease-out-expo);
}

.sidebar.expanded .sidebar-home-button {
  width: 100%;
  height: auto;
  justify-content: flex-start;
  gap: 0.7rem;
  padding: 0.78rem 0.9rem;
}

.sidebar-home-button.active {
  background: rgba(110, 168, 255, 0.12);
  color: #205ec9;
}

.sidebar-home-button:hover {
  background: rgba(15, 23, 42, 0.04);
}

.sidebar-home-icon {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
}

.sidebar-home-label {
  display: none;
  font-weight: 600;
}

.sidebar.expanded .sidebar-home-label {
  display: inline;
}

.main-content {
  padding: 1.75rem 1.9rem 2rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 0.35rem;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.topbar-hint {
  margin-bottom: 1.9rem;
  line-height: 1.45;
}

.view-block {
  min-width: 0;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 2.45rem;
  letter-spacing: -0.05em;
  line-height: 1;
}

h3 {
  margin-bottom: 0;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.hint,
.empty-state,
.artist-meta,
.stat-delta,
.watched-artist-meta {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.56rem 0.92rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--muted-strong);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
}

.status-pill.connected {
  background: var(--accent-soft);
  color: #205ec9;
  border-color: rgba(110, 168, 255, 0.18);
}

.icon-button,
.button,
.mini-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 0.72rem 1.02rem;
  cursor: pointer;
  transition: transform 220ms var(--ease-out-expo), border-color 220ms var(--ease-out-expo), background 220ms var(--ease-out-expo), box-shadow 220ms var(--ease-out-expo), opacity 220ms var(--ease-out-expo);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  font-weight: 600;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 1.4rem;
}

.mini-button {
  padding: 0.38rem 0.58rem;
  font-size: 0.78rem;
}

.button:hover,
.mini-button:hover,
.icon-button:hover,
.sidebar-item-main:hover,
.dashboard-card-hit:hover {
  transform: translateY(-1px);
  border-color: rgba(63, 131, 248, 0.16);
  box-shadow: var(--shadow-soft);
}

.button-primary {
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
  border-color: rgba(110, 168, 255, 0.24);
  color: #235ec2;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.sidebar-list {
  display: grid;
  gap: 0.9rem;
  align-content: start;
  justify-items: center;
}

.sidebar-item {
  display: grid;
  gap: 0.45rem;
  justify-items: center;
}

.sidebar-item.active .sidebar-item-main {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.sidebar-item-main {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  text-align: left;
  border: 0;
  border-radius: 24px;
  background: transparent;
  padding: 0;
  box-shadow: none;
  transition: transform 260ms var(--ease-out-expo), opacity 260ms var(--ease-out-expo), background 260ms var(--ease-out-expo);
}

.sidebar.expanded .sidebar-item-main {
  width: 100%;
  justify-content: flex-start;
  padding: 0.58rem 0.72rem;
  border-radius: 18px;
}

.sidebar.expanded .sidebar-item.active .sidebar-item-main {
  background: rgba(110, 168, 255, 0.12);
}

.sidebar-item-copy {
  display: none;
  gap: 0.15rem;
}

.sidebar.expanded .sidebar-item-copy {
  display: grid;
}

.sidebar-item-tools {
  display: none;
  gap: 0.35rem;
  padding-left: 0;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 220ms var(--ease-out-expo), transform 220ms var(--ease-out-expo);
}

.sidebar.expanded .sidebar-item.manage-mode .sidebar-item-tools {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.watched-artist-image,
.artist-image,
.dashboard-card-image,
.artist-hero-image {
  object-fit: cover;
  background: #eef1f5;
}

.watched-artist-image,
.artist-image,
.dashboard-card-image {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  transition: transform 280ms var(--ease-out-expo), box-shadow 280ms var(--ease-out-expo);
}

.sidebar-item.active .watched-artist-image {
  box-shadow: 0 0 0 3px rgba(110, 168, 255, 0.16);
}

.artist-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}

.dashboard-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  transition: transform 280ms var(--ease-out-expo), box-shadow 280ms var(--ease-out-expo), border-color 280ms var(--ease-out-expo);
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  border-color: rgba(63, 131, 248, 0.14);
}

.dashboard-card-hit {
  width: 100%;
  display: grid;
  gap: 0.95rem;
  border: 0;
  background: transparent;
  padding: 1.2rem 1.2rem 1.15rem;
  text-align: left;
}

.dashboard-card-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dashboard-card-copy {
  display: grid;
  gap: 0.16rem;
}

.dashboard-card-meta {
  color: var(--muted);
}

.dashboard-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  background: #f6f8fb;
  border: 1px solid var(--border);
  color: var(--muted-strong);
  font-size: 0.82rem;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(17, 24, 39, 0.12);
  display: grid;
  justify-content: end;
  animation: fadeOverlay 260ms var(--ease-out-expo);
}

.drawer-panel {
  width: min(540px, 100vw);
  height: 100vh;
  background: rgba(251, 252, 253, 0.96);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 50px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1.45rem;
  overflow-y: auto;
  animation: slideInDrawer 420ms var(--ease-out-expo);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.stack,
.artist-results,
.summary-grid,
.history-grid {
  display: grid;
  gap: 0.95rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  font-size: 0.92rem;
  font-weight: 600;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.92rem 1rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
}

input:focus {
  outline: 3px solid rgba(110, 168, 255, 0.14);
  border-color: rgba(63, 131, 248, 0.28);
}

.search-row,
.artist-actions {
  display: flex;
  gap: 0.75rem;
}

.search-row input {
  flex: 1 1 18rem;
}

.artist-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
  transition: transform 240ms var(--ease-out-expo), box-shadow 240ms var(--ease-out-expo), border-color 240ms var(--ease-out-expo);
}

.artist-option:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(63, 131, 248, 0.14);
}

.artist-copy {
  display: grid;
  gap: 0.18rem;
}

.artist-header,
.summary-grid,
.history-grid {
  margin-bottom: 1.15rem;
}

.artist-hero {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  padding: 1.3rem;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.artist-hero-image {
  width: 96px;
  height: 96px;
  border-radius: 50%;
}

.artist-hero-copy {
  display: grid;
  gap: 0.35rem;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.9rem;
}

.history-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.stat-card,
.history-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.05rem;
  display: grid;
  gap: 0.35rem;
  box-shadow: var(--shadow-soft);
  transition: transform 240ms var(--ease-out-expo), box-shadow 240ms var(--ease-out-expo);
}

.stat-card:hover,
.history-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.results {
  overflow-x: auto;
  border-radius: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
}

th,
td {
  text-align: left;
  padding: 1rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.9);
  font-weight: 700;
}

tbody tr:hover {
  background: rgba(248, 250, 252, 0.82);
}

.profile-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.profile-link::after {
  content: "↗";
  font-size: 0.78rem;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 220ms var(--ease-out-expo), transform 220ms var(--ease-out-expo);
}

.profile-link:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-footer {
  position: sticky;
  bottom: 0;
  padding-top: 0.8rem;
  background: linear-gradient(180deg, rgba(250, 251, 252, 0), rgba(250, 251, 252, 0.92) 24%, rgba(250, 251, 252, 0.98) 100%);
}

.sidebar-footer-actions {
  display: grid;
  gap: 0.65rem;
  justify-items: center;
}

.sidebar-footer-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  position: relative;
}

.sidebar-footer-button::before {
  content: "⋯";
  color: var(--text);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.sidebar-footer .icon-button {
  display: inline-grid;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar.expanded .sidebar-footer .icon-button,
.sidebar.expanded .sidebar-footer-button {
  width: 100%;
  height: auto;
  justify-self: stretch;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  color: var(--text);
  padding: 0.72rem 1rem;
}

.sidebar.expanded .sidebar-footer-button::before {
  display: none;
}

@keyframes slideInDrawer {
  from {
    transform: translateX(28px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOverlay {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.score {
  display: grid;
  gap: 0.35rem;
  min-width: 120px;
}

.score-meter {
  width: 100%;
  height: 0.5rem;
  border-radius: 999px;
  background: #edf1f5;
  overflow: hidden;
}

.score-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #b8d3ff 0%, #6ea8ff 100%);
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .app-shell:has(.sidebar.expanded) {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 1rem;
  }
}

@media (max-width: 720px) {
  .topbar,
  .artist-hero,
  .artist-option {
    display: grid;
    grid-template-columns: 1fr;
  }

  h2 {
    font-size: 1.9rem;
  }
}
