[hidden] {
  display: none !important;
}

:root {
  color-scheme: dark;
  --bg: #050806;
  --panel: rgba(12, 18, 14, .76);
  --panel-strong: rgba(13, 21, 16, .94);
  --line: rgba(205, 239, 211, .14);
  --line-strong: rgba(205, 239, 211, .28);
  --text: #eef7ef;
  --muted: rgba(226, 239, 228, .6);
  --soft: rgba(200, 241, 207, .08);
  --green: #c9f4d0;
  --danger: #f4caca;
  --radius: 20px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 25% 0%, rgba(93, 157, 104, .12), transparent 36rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button { cursor: pointer; }

.ambient {
  position: fixed;
  z-index: -3;
  width: 42rem;
  height: 42rem;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .13;
  pointer-events: none;
}

.ambient-a {
  top: -20rem;
  left: -10rem;
  background: #b8f2c4;
}

.ambient-b {
  right: -18rem;
  bottom: -24rem;
  background: #7fb590;
}

.grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .13;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.topbar,
.dashboard-head,
.panel-tools,
.editor-actions,
.top-actions {
  display: flex;
  align-items: center;
}

.topbar {
  min-height: 82px;
  justify-content: space-between;
  gap: 20px;
}

.topbar h1,
.dashboard-head h2,
.login-card h2,
.editor-panel h3 {
  margin: 0;
}

.topbar h1 {
  margin-top: 5px;
  font-size: clamp(1.4rem, 3vw, 2.25rem);
  letter-spacing: -.04em;
}

.eyebrow {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .69rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.glass-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(20, 29, 22, .78), rgba(7, 11, 9, .82));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
  backdrop-filter: blur(18px);
}

.login-wrap {
  min-height: calc(100vh - 150px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
}

.lock-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: var(--soft);
  font-weight: 900;
  letter-spacing: .08em;
}

.login-card h2 {
  margin-top: 8px;
  font-size: 2rem;
}

.login-card p,
.dashboard-head p,
.empty-editor p {
  color: var(--muted);
  line-height: 1.6;
}

form label,
.search-label {
  display: grid;
  gap: 8px;
}

.login-card form {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

label > span {
  color: rgba(235, 246, 237, .8);
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .04em;
}

input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgba(1, 4, 2, .52);
  color: var(--text);
  padding: 0 13px;
  transition: border-color .15s ease, background .15s ease;
}

input:focus {
  border-color: rgba(204, 246, 213, .42);
  background: rgba(8, 13, 10, .82);
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-weight: 800;
  letter-spacing: .025em;
}

.primary-button {
  border-color: rgba(205, 239, 211, .28);
  background: #d8f4dd;
  color: #071009;
}

.ghost-button {
  padding: 0 14px;
  background: rgba(255,255,255,.035);
  color: var(--text);
}

.danger-button {
  padding: 0 14px;
  background: rgba(244, 202, 202, .06);
  color: var(--danger);
  border-color: rgba(244, 202, 202, .18);
}

.form-status {
  min-height: 20px;
  color: var(--muted);
  font-size: .78rem;
}

.form-status.error {
  color: #f2b9b9;
}

.form-status.success {
  color: #c9f4d0;
}

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

.dashboard-head {
  justify-content: space-between;
  gap: 22px;
  padding: 24px 26px;
}

.dashboard-head h2 {
  margin-top: 6px;
  font-size: 1.65rem;
}

.dashboard-head p {
  margin: 6px 0 0;
}

.live-pill {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: 700 .66rem/1 ui-monospace, monospace;
  letter-spacing: .08em;
}

.workspace {
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, .75fr);
  gap: 18px;
}

.song-panel,
.editor-panel {
  min-height: 0;
  overflow: hidden;
}

.song-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.panel-tools {
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.search-label {
  width: min(560px, 100%);
}

.search-label input {
  height: 42px;
}

.count {
  color: var(--muted);
  font: 600 .72rem/1 ui-monospace, monospace;
  white-space: nowrap;
}

.song-list {
  height: 620px;
  overflow: auto;
  padding: 9px;
}

.song-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(120px, .45fr) minmax(220px, 1.4fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.song-row:hover,
.song-row.active {
  border-color: var(--line);
  background: rgba(205, 239, 211, .045);
}

.song-era {
  color: var(--muted);
  font: 600 .68rem/1.3 ui-monospace, monospace;
}

.song-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.link-state {
  min-width: 54px;
  color: rgba(210, 239, 215, .55);
  font: 700 .62rem/1 ui-monospace, monospace;
  text-align: right;
}

.link-state.has-link {
  color: var(--green);
}

.editor-panel {
  padding: 24px;
}

.empty-editor {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.5rem;
}

.empty-editor h3 {
  margin-top: 18px;
}

.empty-editor p {
  max-width: 270px;
  margin: 7px auto 0;
}

#linkForm {
  display: grid;
  gap: 18px;
}

#selectedSongName {
  margin-top: -6px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.selected-era {
  margin-top: -10px;
  color: var(--muted);
  font: 600 .72rem/1.4 ui-monospace, monospace;
}

.editor-actions {
  gap: 10px;
}

.editor-actions .primary-button {
  flex: 1;
}

.security-note {
  padding: 13px;
  border: 1px solid rgba(205, 239, 211, .09);
  border-radius: 12px;
  background: rgba(205, 239, 211, .03);
  color: rgba(226, 239, 228, .48);
  font-size: .72rem;
  line-height: 1.55;
}

.security-note code {
  color: rgba(226, 239, 228, .75);
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .song-list {
    height: 480px;
  }

  .editor-panel {
    min-height: 380px;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    gap: 6px;
  }

  .dashboard-head {
    align-items: flex-start;
  }

  .song-row {
    grid-template-columns: 82px minmax(0, 1fr) auto;
    gap: 9px;
    padding-inline: 9px;
  }

  .panel-tools {
    align-items: flex-end;
  }

  .login-card {
    padding: 24px;
  }
}


.editor-panel {
  scroll-margin-top: 18px;
}

.editor-panel.is-selected {
  border-color: rgba(205, 239, 211, .25);
}

.song-row {
  cursor: pointer;
}


.upload-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px 0;
  color: rgba(226, 239, 228, .38);
  font: 700 .61rem/1 ui-monospace, monospace;
  letter-spacing: .12em;
}

.upload-divider::before,
.upload-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.upload-divider span {
  padding: 0 12px;
}

.audio-upload-box {
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid rgba(205, 239, 211, .11);
  border-radius: 14px;
  background: rgba(205, 239, 211, .025);
}

.audio-upload-box input[type="file"] {
  height: auto;
  min-height: 46px;
  padding: 10px;
  color: var(--muted);
}

.audio-upload-box input[type="file"]::file-selector-button {
  min-height: 28px;
  margin-right: 10px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(205, 239, 211, .07);
  color: var(--text);
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}

.upload-button {
  min-height: 44px;
  border: 1px solid rgba(205, 239, 211, .27);
  border-radius: 12px;
  background: rgba(205, 239, 211, .085);
  color: #eaf7ec;
  font-weight: 850;
  letter-spacing: .025em;
}

.upload-button:hover:not(:disabled) {
  background: rgba(205, 239, 211, .13);
  border-color: rgba(205, 239, 211, .4);
}

.upload-button:disabled {
  cursor: wait;
  opacity: .55;
}

.upload-hint {
  color: rgba(226, 239, 228, .42);
  font-size: .69rem;
  line-height: 1.5;
}


.selected-song-id {
  margin-top: -12px;
  color: rgba(226, 239, 228, .32);
  font: 600 .58rem/1.2 ui-monospace, monospace;
  letter-spacing: .08em;
}


.song-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.linked-songs-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(205, 239, 211, .035);
  color: rgba(235, 246, 237, .72);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .025em;
  white-space: nowrap;
}

.linked-songs-button span {
  min-width: 22px;
  display: inline-grid;
  place-items: center;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(205, 239, 211, .075);
  color: rgba(235, 246, 237, .92);
  font: 700 .61rem/1 ui-monospace, monospace;
}

.linked-songs-button:hover,
.linked-songs-button:focus-visible,
.linked-songs-button.active {
  border-color: rgba(205, 239, 211, .3);
  background: rgba(205, 239, 211, .09);
  color: #eff8f0;
}

.linked-songs-button.active span {
  background: rgba(205, 239, 211, .14);
}

@media (max-width: 700px) {
  .panel-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .song-filter-actions {
    justify-content: space-between;
  }
}


/* TEAM ACCOUNTS -------------------------------------------------------- */
.account-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(205, 239, 211, .1);
  border-radius: 999px;
  color: rgba(226, 239, 228, .58);
  font: 700 .61rem/1 ui-monospace, monospace;
  letter-spacing: .05em;
  white-space: nowrap;
}

.team-open-button {
  border-color: rgba(205, 239, 211, .23);
}

body.team-modal-open {
  overflow: hidden;
}

.team-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.team-modal[hidden] {
  display: none !important;
}

.team-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 3, 1, .76);
  backdrop-filter: blur(12px);
}

.team-dialog {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  overflow: auto;
  padding: 25px;
  background:
    radial-gradient(circle at 5% 0%, rgba(163, 211, 172, .08), transparent 33rem),
    rgba(7, 12, 9, .97);
}

.team-dialog-head,
.team-members-head,
.team-member-name-row,
.team-member-actions {
  display: flex;
  align-items: center;
}

.team-dialog-head {
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.team-dialog-head h2 {
  margin: 5px 0 0;
  font-size: 1.8rem;
}

.team-dialog-head p {
  margin: 7px 0 0;
  color: var(--muted);
}

.team-close-button {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 1.35rem;
}

.team-layout {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.55fr);
  gap: 18px;
  margin-top: 20px;
}

.team-create-card,
.team-members-card {
  padding: 18px;
  border: 1px solid rgba(205, 239, 211, .1);
  border-radius: 16px;
  background: rgba(205, 239, 211, .02);
}

.team-create-card {
  display: grid;
  align-content: start;
  gap: 16px;
}

.permission-fieldset {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.permission-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
}

.permission-option {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px !important;
  padding: 8px;
  border-radius: 10px;
}

.permission-option:hover {
  background: rgba(205, 239, 211, .035);
}

.permission-option input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.permission-option > span {
  display: grid;
  gap: 2px;
}

.permission-option strong {
  color: var(--text);
  font-size: .76rem;
}

.permission-option small {
  color: rgba(226,239,228,.48);
  font-size: .67rem;
  line-height: 1.4;
}

.permission-manager {
  border: 1px solid rgba(240, 215, 169, .09);
}

.team-members-card {
  min-width: 0;
}

.team-members-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.team-members-head h3 {
  margin: 5px 0 0;
  font-size: 1.15rem;
}

.team-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding-right: 3px;
}

.team-member {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  border: 1px solid rgba(205,239,211,.09);
  border-radius: 13px;
  background: rgba(255,255,255,.018);
}

.team-member.disabled {
  opacity: .58;
}

.team-member-name-row {
  gap: 7px;
  flex-wrap: wrap;
}

.team-member-name-row strong {
  font-size: .88rem;
}

.team-role,
.team-state {
  padding: 4px 6px;
  border-radius: 999px;
  font: 800 .53rem/1 ui-monospace, monospace;
  letter-spacing: .06em;
}

.team-role {
  border: 1px solid rgba(205,239,211,.11);
  color: rgba(226,239,228,.55);
}

.team-role.owner {
  border-color: rgba(219,235,192,.2);
  color: #dcebc9;
}

.team-state.active {
  background: rgba(164,230,175,.08);
  color: #b9ebc2;
}

.team-state.disabled {
  background: rgba(242,190,190,.07);
  color: #e7baba;
}

.team-permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.team-permission-tags span {
  padding: 4px 6px;
  border-radius: 7px;
  background: rgba(205,239,211,.045);
  color: rgba(226,239,228,.5);
  font: 650 .57rem/1 ui-monospace, monospace;
}

.team-member-actions {
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 330px;
}

.team-action {
  min-height: 31px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  color: rgba(235,246,237,.72);
  font-size: .64rem;
  font-weight: 800;
}

.team-action:hover {
  border-color: rgba(205,239,211,.27);
  color: #f1f8f2;
}

.team-action.danger-soft,
.team-action.remove {
  border-color: rgba(241,190,190,.13);
  color: rgba(241,196,196,.8);
}

.team-action.remove:hover {
  background: rgba(240,165,165,.07);
  border-color: rgba(241,190,190,.26);
}

.team-protected {
  color: rgba(226,239,228,.34);
  font: 700 .58rem/1 ui-monospace, monospace;
  letter-spacing: .06em;
}

.team-security-note {
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px solid rgba(205,239,211,.08);
  border-radius: 11px;
  background: rgba(205,239,211,.02);
  color: rgba(226,239,228,.44);
  font-size: .7rem;
  line-height: 1.5;
}

input:disabled,
button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .team-layout {
    grid-template-columns: 1fr;
  }

  .team-member {
    grid-template-columns: 1fr;
  }

  .team-member-actions {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 620px) {
  .team-modal {
    padding: 9px;
  }

  .team-dialog {
    max-height: calc(100vh - 18px);
    padding: 16px;
  }

  .team-dialog-head {
    align-items: flex-start;
  }

  .account-badge {
    display: none;
  }
}
