* {
    box-sizing: border-box;
}

:root {
    --pink: #ed145b;
    --pink-dark: #8e123f;
    --ink: #25131b;
    --muted: #76656d;
    --line: #f2d3df;
    --soft: #fff3f7;
    --surface: rgba(255, 255, 255, .88);
}

html,
body {
    margin: 0;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    background:
        radial-gradient(circle at top left, rgba(237, 20, 91, .13), transparent 34rem),
        linear-gradient(180deg, #fff, #fff7fa 52%, #fff);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    min-height: 100vh;
    padding-bottom: 126px;
}

.app-topbar {
    align-items: center;
    backdrop-filter: blur(18px);
    background-color: rgba(255, 255, 255, .86);
    border-bottom: 1px solid rgba(242, 211, 223, .8);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: max(14px, env(safe-area-inset-top)) 18px 14px;
    position: sticky;
    top: 0;
    z-index: 8;
}

.brand {
    align-items: center;
    color: var(--ink);
    display: inline-flex;
    gap: 10px;
    text-decoration: none;
}

.brand span {
    align-items: center;
    background: linear-gradient(135deg, var(--pink), #ff75a5);
    border-radius: 14px;
    color: #fff;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.brand strong {
    font-size: 18px;
}

.top-actions,
.hero-actions,
.panel-head {
    align-items: center;
    display: flex;
    gap: 10px;
}

.top-actions {
    flex-shrink: 0;
}

.icon-button,
.ghost-button,
.hero-actions button,
.panel-head button,
.entry-form button,
.approval-card button,
.login-card button,
.track-action,
.entry-delete {
    align-items: center;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    font-weight: 800;
    gap: 8px;
    justify-content: center;
}

.icon-button,
.track-action,
.entry-delete {
    background-color: var(--soft);
    color: var(--pink);
    height: 42px;
    width: 42px;
}

.ghost-button {
    background-color: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    min-height: 42px;
    padding: 0 16px;
}

.ghost-button.light {
    background-color: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .34);
    color: #fff;
}

main {
    margin: 0 auto;
    max-width: 1120px;
    padding: 18px;
}

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

.login-card,
.panel,
.hero-card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 22px 60px rgba(82, 9, 38, .08);
}

.login-card {
    max-width: 460px;
    padding: 30px;
    width: 100%;
}

.app-kicker {
    color: var(--pink);
    display: block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

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

h1 {
    font-size: clamp(30px, 7vw, 48px);
    line-height: 1.04;
    margin-bottom: 12px;
}

h2 {
    font-size: clamp(23px, 5vw, 32px);
    line-height: 1.08;
    margin-bottom: 0;
}

p,
small,
.hint {
    color: var(--muted);
}

.login-card form,
.entry-form {
    display: grid;
    gap: 12px;
}

.login-card form {
    margin: 24px 0 18px;
}

label {
    color: var(--ink);
    display: grid;
    font-size: 13px;
    font-weight: 800;
    gap: 7px;
}

input,
select {
    background-color: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    min-height: 48px;
    outline: 0;
    padding: 0 14px;
    width: 100%;
}

input:focus,
select:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 4px rgba(237, 20, 91, .1);
}

.login-card button,
.hero-actions button,
.panel-head button,
.approval-card button,
.entry-form button {
    background: linear-gradient(135deg, var(--pink), #ff4385);
    box-shadow: 0 12px 28px rgba(237, 20, 91, .22);
    color: #fff;
    min-height: 48px;
    padding: 0 18px;
}

.app-view {
    display: grid;
    gap: 18px;
}

.hero-card {
    background: linear-gradient(135deg, rgba(99, 24, 53, .96), rgba(237, 20, 91, .7));
    color: #fff;
    display: grid;
    gap: 20px;
    grid-template-columns: 280px minmax(0, 1fr);
    overflow: hidden;
    padding: 18px;
}

.hero-card img {
    aspect-ratio: 4 / 3;
    border-radius: 18px;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.hero-card > div {
    align-self: center;
}

.hero-card p,
.hero-card .app-kicker {
    color: rgba(255, 255, 255, .86);
}

.hero-card h1 {
    color: #fff;
}

.app-tabs,
.playlist-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.app-tabs {
    position: sticky;
    top: 72px;
    z-index: 7;
}

.app-tabs button,
.playlist-chip {
    background-color: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    color: var(--ink);
    display: inline-flex;
    flex: 0 0 auto;
    font-weight: 900;
    gap: 9px;
    min-height: 52px;
    padding: 0 16px;
}

.app-tabs button {
    align-items: center;
}

.app-tabs button.active,
.playlist-chip.active {
    background: linear-gradient(135deg, var(--pink), #ff4385);
    border-color: transparent;
    color: #fff;
}

.panel {
    display: none;
    padding: 20px;
}

.panel.active {
    display: grid;
    gap: 18px;
}

.panel-head {
    justify-content: space-between;
}

.panel-head input {
    max-width: 320px;
}

.track-list,
.entry-list {
    display: grid;
    gap: 10px;
}

.track-row,
.entry-row {
    align-items: center;
    background-color: #fff;
    border: 1px solid rgba(242, 211, 223, .88);
    border-radius: 18px;
    display: grid;
    gap: 12px;
    min-width: 0;
}

.track-row {
    grid-template-columns: 52px minmax(0, 1fr) auto auto auto;
    padding: 10px;
}

.track-row.active {
    border-color: var(--pink);
    box-shadow: inset 0 0 0 1px rgba(237, 20, 91, .12);
}

.track-cover {
    border-radius: 14px;
    height: 52px;
    object-fit: cover;
    width: 52px;
}

.track-copy {
    background: transparent;
    border: 0;
    color: inherit;
    min-width: 0;
    padding: 0;
    text-align: left;
}

.track-copy strong,
.track-copy small,
.track-copy em,
.player-copy strong,
.player-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-copy em {
    color: var(--pink);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    margin-top: 4px;
}

.playlist-chip small {
    color: inherit;
    font-size: 12px;
    opacity: .72;
}

.track-action.active {
    background-color: var(--pink);
    color: #fff;
}

.track-status {
    color: #17a46d;
    font-size: 12px;
    font-weight: 900;
}

.approval-card {
    background: linear-gradient(135deg, #fff6fa, #fff);
    border: 1px solid var(--line);
    border-radius: 18px;
    display: grid;
    gap: 10px;
    padding: 16px;
}

.approval-card button {
    justify-self: start;
}

.entry-form {
    grid-template-columns: minmax(0, 1fr) minmax(140px, 210px) 48px;
}

.entry-row {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 310px) 42px;
    padding: 14px;
}

.entry-row strong {
    display: block;
}

.entry-row small {
    color: var(--muted);
}

.toast {
    background-color: var(--ink);
    border-radius: 16px;
    bottom: 142px;
    color: #fff;
    left: 18px;
    padding: 14px 16px;
    position: fixed;
    right: 18px;
    text-align: center;
    z-index: 30;
}

.mini-player {
    align-items: center;
    background: linear-gradient(135deg, #8e123f, var(--pink), #ff4385);
    border-radius: 22px 22px 0 0;
    bottom: 0;
    box-shadow: 0 -16px 48px rgba(147, 13, 64, .28);
    color: #fff;
    display: grid;
    gap: 10px;
    grid-template-columns: 58px minmax(0, 1fr) 40px 52px 40px 40px 40px;
    left: 0;
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    z-index: 20;
}

.mini-player img {
    border-radius: 14px;
    height: 58px;
    object-fit: cover;
    width: 58px;
}

.player-copy span {
    background-color: rgba(255, 255, 255, .18);
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 900;
    margin-top: 5px;
    padding: 3px 8px;
}

.mini-player button {
    align-items: center;
    background-color: rgba(255, 255, 255, .12);
    border: 0;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.mini-player .play-button {
    background-color: #fff;
    color: var(--pink);
    height: 52px;
    width: 52px;
}

.player-progress {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
}

.player-progress span {
    color: rgba(255, 255, 255, .9);
    font-size: 12px;
    text-align: center;
}

.player-progress input {
    accent-color: #fff;
    min-height: auto;
    padding: 0;
}

.lyrics-dialog {
    border: 0;
    border-radius: 22px;
    max-height: min(720px, calc(100vh - 40px));
    max-width: 620px;
    padding: 24px;
    width: calc(100% - 30px);
}

.lyrics-dialog::backdrop {
    background-color: rgba(45, 10, 25, .42);
}

.lyrics-dialog button {
    background-color: var(--soft);
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--pink);
    height: 40px;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 40px;
}

.lyrics-dialog pre {
    color: var(--ink);
    font-family: inherit;
    line-height: 1.65;
    max-height: 58vh;
    overflow: auto;
    white-space: pre-wrap;
}

[hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    main {
        padding: 12px;
    }

    .app-shell {
        padding-bottom: 190px;
    }

    .hero-card {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .hero-card img {
        max-height: 220px;
    }

    .hero-actions,
    .panel-head {
        align-items: stretch;
        display: grid;
    }

    .panel-head input {
        max-width: none;
    }

    .panel {
        padding: 14px;
    }

    .track-row {
        grid-template-columns: 48px minmax(0, 1fr) 40px 40px;
    }

    .track-row .track-action[data-download-track],
    .track-row .track-status {
        grid-column: auto;
    }

    .track-cover {
        height: 48px;
        width: 48px;
    }

    .entry-form,
    .entry-row {
        grid-template-columns: 1fr;
    }

    .entry-delete {
        justify-self: start;
    }

    .mini-player {
        grid-template-columns: 52px minmax(0, 1fr) 36px 48px 36px 36px 36px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .mini-player img {
        height: 52px;
        width: 52px;
    }

    .mini-player button {
        height: 36px;
        width: 36px;
    }

    .mini-player .play-button {
        height: 48px;
        width: 48px;
    }
}

@media (max-width: 430px) {
    .brand strong {
        font-size: 15px;
    }

    .ghost-button {
        padding: 0 12px;
    }

    .app-tabs {
        top: 68px;
    }

    .app-tabs button span {
        display: none;
    }

    .track-row {
        grid-template-columns: 46px minmax(0, 1fr) 38px 38px;
        gap: 8px;
        padding: 8px;
    }

    .track-action {
        height: 38px;
        width: 38px;
    }

    .mini-player {
        grid-template-columns: 48px minmax(0, 1fr) 34px 46px 34px;
    }

    .mini-player button[data-current-favorite],
    .mini-player button[data-current-lyrics] {
        grid-row: 2;
    }

    .player-progress {
        grid-column: 1 / -1;
    }
}
