:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f6f7f4;
  color: #1d2521;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
a {
  font: inherit;
}

.app-shell {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.topbar,
.toolbar,
.detail-header,
.session-actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow,
.muted,
.user-label,
.playlist-meta,
.result-grid dt {
  color: #5c6a62;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 4rem;
  line-height: 0.95;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.55rem;
}

h3 {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.session-actions {
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-panel,
.panel {
  border: 1px solid #d8ded7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgb(29 37 33 / 8%);
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}

.auth-panel p {
  max-width: 560px;
  margin-bottom: 0;
  color: #405047;
}

.workspace {
  display: grid;
  gap: 18px;
}

.toolbar {
  justify-content: space-between;
  gap: 16px;
}

.toolbar p {
  margin-bottom: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.playlist-list {
  display: grid;
  gap: 10px;
}

.playlist-item {
  width: 100%;
  min-height: 72px;
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid #dbe2dd;
  border-radius: 8px;
  background: #fbfcfb;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.playlist-item:hover,
.playlist-item:focus-visible {
  border-color: #146b57;
  outline: none;
}

.playlist-item[aria-selected="true"] {
  border-color: #146b57;
  background: #eef8f4;
}

.playlist-item:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.playlist-title {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.playlist-meta {
  font-size: 0.88rem;
}

.detail-header {
  justify-content: space-between;
  gap: 14px;
}

.metric-grid,
.result-grid {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

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

.result-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.metric-grid div,
.result-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e6df;
  border-radius: 8px;
  background: #f8faf7;
}

dt {
  margin-bottom: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 750;
}

.confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  color: #334139;
}

.confirm-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #146b57;
}

.primary-button,
.secondary-button,
.icon-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  background: #146b57;
  color: #ffffff;
  font-weight: 750;
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #9aaaa1;
}

.secondary-button,
.icon-button {
  min-height: 40px;
  border: 1px solid #cfd7d1;
  background: #ffffff;
  color: #213229;
}

.secondary-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.secondary-button {
  padding: 0 14px;
}

.status-banner,
.run-result {
  border-radius: 8px;
  padding: 13px 14px;
}

.status-banner {
  border: 1px solid #cfd7d1;
  background: #ffffff;
}

.status-banner.error,
.run-result.error {
  border-color: #e3b4ad;
  background: #fff4f2;
  color: #7d2019;
}

.status-banner.success,
.run-result.success {
  border-color: #b9dec7;
  background: #f0fbf4;
  color: #185c33;
}

.run-result {
  margin-top: 18px;
  border: 1px solid #dce3dd;
  background: #fbfcfb;
}

.run-result h4 {
  margin: 0 0 12px;
  font-size: 1rem;
}

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

@media (max-width: 780px) {
  .app-shell {
    width: min(100vw - 20px, 560px);
    padding-top: 20px;
  }

  .topbar,
  .auth-panel,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .auth-panel {
    align-items: flex-start;
  }

  h1 {
    font-size: 2.35rem;
  }

  .content-grid {
    display: grid;
  }

  .auth-panel {
    display: grid;
  }

  .metric-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }
}
