:root {
  color-scheme: light;
  --bg: #f6f8f5;
  --panel: #ffffff;
  --panel-soft: #edf2ee;
  --ink: #151817;
  --muted: #5f6865;
  --line: #d8dfda;
  --accent: #1d6d5d;
  --accent-deep: #174f58;
  --accent-ink: #ffffff;
  --link: #245c9f;
  --success: #2f7d4c;
  --danger: #9b2f2f;
  --warm: #a65c3d;
  --shadow: 0 14px 32px rgba(29, 44, 39, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(246, 248, 245, 0) 280px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
select,
label,
.chip,
.song-card,
.result-card,
.link-chip,
.section-tag {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
}

.app-shell {
  min-height: 100vh;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(216, 223, 218, 0.78);
  background: rgba(246, 248, 245, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  font-size: 22px;
  font-weight: 820;
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar-title strong,
.topbar-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-title span {
  color: var(--muted);
  font-size: 12px;
}

.content {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 16px 14px 28px;
}

.content.narrow {
  max-width: 620px;
}

.release-kicker {
  display: grid;
  gap: 4px;
  margin: 4px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.release-kicker span {
  color: var(--warm);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.release-kicker strong {
  max-width: 32rem;
  font-size: clamp(24px, 7vw, 40px);
  line-height: 1.05;
}

.icon-button,
.text-button,
.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 13px;
  font-weight: 650;
}

.icon-button {
  width: 42px;
  padding: 0;
}

.primary-button {
  width: 100%;
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: var(--accent-ink);
}

.secondary-button {
  background: var(--panel-soft);
}

.danger-button {
  border-color: rgba(155, 47, 47, 0.25);
  color: var(--danger);
}

.text-button {
  background: transparent;
}

.primary-button:disabled,
.secondary-button:disabled,
.text-button:disabled {
  opacity: 0.5;
}

.field-group {
  display: grid;
  gap: 8px;
  margin-bottom: 15px;
}

.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 12px;
  outline: none;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 91, 0.14);
}

.textarea {
  min-height: 108px;
  resize: vertical;
}

.toggle-row,
.inline-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row {
  justify-content: space-between;
}

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 28px;
}

.toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.toggle-track {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #c7c2b6;
  transition: background 160ms ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 160ms ease;
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.query-preview,
.service-status,
.notice,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.query-preview strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin-top: 4px;
  word-break: break-word;
}

.account-button,
.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.account-button img {
  width: 22px;
  height: 22px;
  border-radius: 999px;
}

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

.account-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.account-header {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.account-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--panel-soft);
  object-fit: cover;
}

.account-avatar.empty {
  display: grid;
  place-content: center;
  color: var(--accent-deep);
  font-weight: 820;
}

.account-identity {
  min-width: 0;
}

.account-identity strong,
.account-identity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-identity span {
  color: var(--muted);
  font-size: 13px;
}

.account-actions {
  display: grid;
  gap: 8px;
}

.status-list {
  display: grid;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  color: var(--muted);
  font-size: 13px;
}

.status-list .status-row + .status-row {
  border-top: 1px solid var(--line);
}

.status-row strong {
  color: var(--ink);
  text-align: right;
}

.feature-row {
  min-height: auto;
}

.service-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.service-status span,
.service-status strong {
  min-width: 0;
}

.service-status strong {
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

.service-status.live {
  border-color: rgba(47, 125, 76, 0.25);
  background: rgba(47, 125, 76, 0.08);
  color: var(--success);
}

.results-list,
.song-list {
  display: grid;
  gap: 12px;
}

.result-card,
.song-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
  box-shadow: var(--shadow);
}

.result-card {
  grid-template-columns: 96px minmax(0, 1fr);
}

.thumb {
  width: 96px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: var(--panel-soft);
  object-fit: cover;
}

.thumb-placeholder {
  display: grid;
  place-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.result-main,
.song-main {
  min-width: 0;
}

.result-title,
.song-title {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
}

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

.result-actions,
.song-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.chip-row,
.link-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip,
.link-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.status-pill.purchase {
  border-color: rgba(47, 125, 76, 0.25);
  background: rgba(47, 125, 76, 0.1);
  color: var(--success);
}

.video-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
  aspect-ratio: 16 / 9;
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.sample-video {
  display: grid;
  place-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 18px;
  background: #171717;
  color: #fff;
  text-align: center;
}

.sample-video span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
}

.writing-grid {
  display: grid;
  gap: 14px;
}

.track-panel {
  display: grid;
  gap: 10px;
}

.document-toolbar {
  position: sticky;
  top: 58px;
  z-index: 5;
  display: grid;
  gap: 8px;
  padding: 10px 0;
  background: var(--bg);
}

.section-blocks {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.section-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.section-block:last-child {
  border-bottom: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-tag {
  max-width: 180px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lyric-input {
  width: 100%;
  min-height: 130px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  resize: vertical;
  outline: none;
  line-height: 1.6;
}

.saved-state {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 20;
  max-width: min(340px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
}

@media (min-width: 720px) {
  .content {
    padding: 22px 22px 36px;
  }

  .results-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .writing-grid {
    grid-template-columns: 320px minmax(0, 1fr);
    align-items: start;
  }

  .track-panel {
    position: sticky;
    top: 78px;
  }

  .document-toolbar {
    top: 58px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }
}
