/* Inter and Google Material Icons are served locally, including their licenses. */
@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/InterVariable.woff2') format('woff2');
}
@font-face {
    font-family: 'Material Icons Outlined';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('../fonts/MaterialIconsOutlined-Regular.otf') format('opentype');
}
:root {
    color-scheme: dark;
    --bg: #141218;
    --surface: #1d1b20;
    --surface-raised: #2b2930;
    --line: #49454f;
    --text: #e6e0e9;
    --muted: #cac4d0;
    --primary: #d0bcff;
    --primary-ink: #381e72;
    --mint: #b4d9c2;
    --outline: #938f99;
    --primary-container: #4f378b;
    --on-primary-container: #eaddff;
    --radius: 16px;
    --workspace-inset: 32px;
    --workspace-min-height: 560px;
    --state-hover: rgba(230, 224, 233, 0.08);
    --state-pressed: rgba(230, 224, 233, 0.12);
    --divider: rgba(167, 171, 192, 0.12);
    --mint-ink: #163e32;
    --mint-container: #263a33;
    --info-container: #303847;
    --success-line: #51675c;
    --success-bg: #1c3029;
    --success-text: #c3eedb;
    --error-bg: #38232d;
    --error-line: #724857;
    --error-text: #ffc2cb;
    --warning-bg: #322d24;
    --warning-line: #695c41;
    --warning-text: #f5ddb3;
    --scrollbar: #9384b0;
    --row-hover: rgba(199, 184, 255, 0.035);
    --loader-track: #423b56;
    --scrobbler: #ffc28f;
    --scrobbler-ink: #42230d;
    --scrobbler-container: #5f3c22;
    --on-scrobbler-container: #ffdcc2;
    --scrobbler-mark: #3c2c22;
    --scrobbler-hover: #ffd3ad;
    --scrobbler-track: #65452f;
    --calendar-empty: #303447;
    --calendar-1: #38574d;
    --calendar-2: #538c73;
    --calendar-3: #75b595;
    --calendar-4: #a8e5cb;
    --calendar-outside: #242633;
    --badge-bg: #2d2840;
    --chart-fill: rgba(208, 188, 255, 0.1);
    --tooltip-bg: #49454f;
    --tooltip-text: #ffffff;
    --calendar-cell: 24px;
    font-family:
        Inter,
        'Segoe UI',
        system-ui,
        -apple-system,
        sans-serif;
    font-synthesis: none;
}
:root[data-theme='light'] {
    color-scheme: light;
    --bg: #fdf7ff;
    --surface: #f7f2fa;
    --surface-raised: #ece6f0;
    --line: #cac4d0;
    --text: #1d1b20;
    --muted: #49454f;
    --primary: #6750a4;
    --primary-ink: #ffffff;
    --mint: #28634c;
    --outline: #79747e;
    --primary-container: #eaddff;
    --on-primary-container: #21005d;
    --state-hover: rgba(29, 27, 32, 0.08);
    --state-pressed: rgba(29, 27, 32, 0.12);
    --divider: rgba(73, 69, 79, 0.2);
    --mint-ink: #ffffff;
    --mint-container: #ccebd9;
    --info-container: #e0e5f2;
    --success-line: #608773;
    --success-bg: #d5eddf;
    --success-text: #123c29;
    --error-bg: #ffdadf;
    --error-line: #a94c60;
    --error-text: #7d1830;
    --warning-bg: #ffedcf;
    --warning-line: #92703b;
    --warning-text: #61430f;
    --scrollbar: #786993;
    --row-hover: rgba(103, 80, 164, 0.06);
    --loader-track: #ded4ed;
    --scrobbler: #875021;
    --scrobbler-ink: #ffffff;
    --scrobbler-container: #ffdcc2;
    --on-scrobbler-container: #311300;
    --scrobbler-mark: #ffebdc;
    --scrobbler-hover: #77431a;
    --scrobbler-track: #e9c7aa;
    --calendar-empty: #ded9e5;
    --calendar-1: #c3e2d0;
    --calendar-2: #83b99c;
    --calendar-3: #438264;
    --calendar-4: #1b5b3e;
    --calendar-outside: #efeaf3;
    --badge-bg: #eaddff;
    --chart-fill: rgba(103, 80, 164, 0.12);
    --tooltip-bg: #322f38;
    --tooltip-text: #ffffff;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    scrollbar-color: var(--scrollbar) var(--surface);
}
::selection {
    color: var(--on-primary-container);
    background: var(--primary-container);
}
input {
    caret-color: var(--primary);
}
button,
input,
select {
    font: inherit;
}
button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}
button {
    cursor: pointer;
}
button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
a {
    color: inherit;
    text-decoration: none;
}
button,
input,
select {
    min-height: 44px;
}
input,
select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 56px;
    color: var(--text);
    background: transparent;
    border: 1px solid var(--outline);
    border-radius: 4px;
    padding: 14px 16px;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}
input::placeholder {
    color: var(--muted);
}
/* Native date controls must shrink with the field, including Safari on iOS. */
input[type='date'] {
    appearance: none;
    -webkit-appearance: none;
    min-inline-size: 0;
    height: 56px;
}
input[type='date']::-webkit-date-and-time-value {
    min-width: 0;
    text-align: left;
}
input[type='date']::-webkit-datetime-edit {
    min-width: 0;
    padding: 0;
}
input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
    outline: none;
}
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}
h1,
h2,
h3,
h4,
p {
    margin: 0;
}
h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.02em;
    font-weight: 500;
    line-height: 1.3;
}
h3 {
    font-size: 1.3rem;
    letter-spacing: -0.01em;
    font-weight: 500;
    line-height: 1.4;
}
h4 {
    font-size: 1.5rem;
    overflow-wrap: anywhere;
}
ul,
ol {
    padding: 0;
    margin: 0;
    list-style: none;
}
.hidden,
[hidden] {
    display: none !important;
}
.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;
}
.material-icons-outlined {
    font-family: 'Material Icons Outlined';
    font-weight: 400;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    overflow-wrap: normal;
    direction: ltr;
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    user-select: none;
}
.muted {
    color: var(--muted);
}
.app-shell {
    width: 100%;
    max-width: 1440px;
    margin: auto;
    padding: 0 48px;
}
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0;
    border-bottom: 1px solid var(--divider);
    gap: 16px;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 48px;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--outline);
    border-radius: 100px;
    color: var(--primary);
    background: transparent;
    font-size: 0.875rem;
}
.theme-toggle:hover {
    background: var(--state-hover);
}
.theme-toggle:active {
    background: var(--state-pressed);
}
@media (max-width: 600px) {
    .theme-label {
        display: none;
    }
    .theme-toggle {
        padding: 10px;
    }
}
.brand {
    display: flex;
    min-width: 0;
    gap: 12px;
    align-items: center;
    line-height: 1.3;
    font-size: 0.95rem;
    font-weight: 650;
}
.brand > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    background: var(--primary-container);
    color: var(--on-primary-container);
    border-radius: 12px;
}
.brand-mark .icon {
    width: 26px;
    height: 26px;
    font-size: 26px;
}
.brand-subtitle {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    margin-top: 3px;
}
.hero {
    text-align: center;
    padding: 40px 12px 32px;
}
.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    font-weight: 500;
}
.hero-description {
    color: var(--muted);
    margin-top: 24px;
    font-size: 1rem;
    line-height: 1.8;
    max-width: 70ch;
    margin-inline: auto;
}
.workspace {
    min-width: 0;
}
.workspace-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.tabs {
    display: flex;
    min-width: 0;
    border-bottom: 1px solid var(--line);
}
.tab {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 16px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    transition:
        background 0.2s,
        color 0.2s;
}
.tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: transparent;
}
.tab:hover {
    background: var(--state-hover);
    color: var(--text);
}
.tab:active {
    background: var(--state-pressed);
}
.tab.is-active {
    color: var(--primary);
}
.tab.is-active::after {
    background: currentColor;
}
.tab .icon {
    font-size: 24px;
}
.mobile-nav-toggle,
.mobile-current-tab,
.mobile-nav-drawer,
.mobile-nav-backdrop {
    display: none;
}
@media (max-width: 767px) {
    .site-header {
        position: sticky;
        top: 0;
        z-index: 5;
        background: var(--bg);
    }
    .mobile-nav-toggle {
        display: grid;
        place-items: center;
        flex-shrink: 0;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        color: var(--primary);
        background: transparent;
    }
    .mobile-nav-toggle:hover {
        background: var(--state-hover);
    }
    .mobile-current-tab {
        display: block;
        color: var(--primary);
        font-weight: 600;
        font-size: 0.875rem;
    }
    .mobile-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 19;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        visibility: hidden;
        transition:
            opacity 240ms ease,
            visibility 240ms;
    }
    .mobile-nav-drawer {
        display: block;
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 20;
        width: min(320px, 85vw);
        height: 100dvh;
        padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
        overflow-y: auto;
        background: var(--surface);
        border-radius: 0 24px 24px 0;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.3);
        visibility: hidden;
        transform: translateX(-100%);
        transition:
            transform 240ms cubic-bezier(0.2, 0, 0, 1),
            visibility 240ms;
    }
    .mobile-nav-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 24px;
    }
    .mobile-nav-heading h2 {
        font-size: 1.125rem;
    }
    .mobile-nav-drawer .tabs {
        flex-direction: column;
        width: 100%;
        border: 0;
        gap: 8px;
    }
    .mobile-nav-drawer .tab {
        flex: none;
        flex-direction: row;
        justify-content: flex-start;
        gap: 16px;
        padding: 16px;
        border-radius: 28px;
        font-size: 0.875rem;
    }
    .mobile-nav-drawer .tab.is-active {
        color: var(--on-primary-container);
        background: var(--primary-container);
    }
    .mobile-nav-drawer .tab::after {
        display: none;
    }
    body.nav-open {
        overflow: hidden;
    }
    .nav-open .mobile-nav-drawer {
        transform: translateX(0);
        visibility: visible;
        transition-property: transform;
    }
    .nav-open .mobile-nav-backdrop {
        opacity: 1;
        visibility: visible;
    }
}
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-width: 0;
}
.workspace-surface {
    width: 100%;
    min-height: var(--workspace-min-height);
    padding: var(--workspace-inset);
}
.workspace-intro {
    display: grid;
    gap: 12px;
    margin-bottom: 32px;
}
.workspace-intro > p {
    max-width: 70ch;
    color: var(--muted);
    font-size: 0.875rem;
}
.upload-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: var(--workspace-inset);
    border: 1px solid var(--line);
    transition:
        background 0.2s,
        border-color 0.2s;
}
.upload-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    border: 1px dashed var(--outline);
    border-radius: 12px;
}
.upload-panel.drag-over {
    border-color: var(--mint);
    background: var(--surface-raised);
}
.upload-art {
    width: 124px;
    height: 108px;
    position: relative;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
}
.upload-art > .icon {
    width: 88px;
    height: 88px;
    font-size: 40px;
    color: var(--on-primary-container);
    border-radius: 28px;
    background: var(--primary-container);
}
.file-tag {
    position: absolute;
    right: -3px;
    bottom: 0;
    background: var(--mint);
    color: var(--mint-ink);
    padding: 3px 10px;
    border-radius: 7px;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 100px;
    min-height: 48px;
    max-width: 100%;
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    transition:
        background 0.2s,
        box-shadow 0.2s;
}
.button:hover:not(:disabled) {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.button-primary {
    background: var(--primary);
    color: var(--primary-ink);
}
.button-primary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--primary), white 8%);
}
.button-secondary {
    background: transparent;
    border-color: var(--outline);
    color: var(--primary);
}
.button-secondary:hover:not(:disabled) {
    background: var(--state-hover);
}
.button .icon {
    width: 20px;
    height: 20px;
    font-size: 20px;
}
.button:active:not(:disabled) {
    box-shadow: inset 0 0 0 100px var(--state-pressed);
}
.upload-panel .button {
    margin-top: 0;
}
.upload-help,
.upload-guide {
    margin-top: 18px;
    font-size: 0.875rem;
    max-width: 65ch;
}
.upload-guide summary {
    color: var(--primary);
    cursor: pointer;
    min-height: 44px;
    padding: 10px 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.upload-guide p {
    margin-top: 8px;
    color: var(--muted);
}
footer {
    margin-top: 32px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 0 30px;
    border-top: 1px solid var(--divider);
    font-size: 0.875rem;
    color: var(--muted);
}
.message {
    padding: 14px 18px;
    border: 1px solid var(--success-line);
    border-radius: 12px;
    background: var(--success-bg);
    color: var(--success-text);
    font-size: 0.875rem;
    margin: 0 0 20px;
    overflow-wrap: anywhere;
}
.message[data-kind='error'] {
    background: var(--error-bg);
    border-color: var(--error-line);
    color: var(--error-text);
}
.message[data-kind='warning'] {
    background: var(--warning-bg);
    border-color: var(--warning-line);
    color: var(--warning-text);
}
#app-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 8px 8px 18px;
}
#app-message-text {
    min-width: 0;
}
.message-dismiss {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    padding: 10px;
    border: 0;
    border-radius: 50%;
    color: inherit;
    background: transparent;
}
.message-dismiss:hover {
    background: var(--state-hover);
}
.message-dismiss:active {
    background: var(--state-pressed);
}
.dashboard {
    display: grid;
    gap: 24px;
}
.dashboard-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 4px 0;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.history-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}
.action-label-compact {
    display: none;
}
.scroll-hint,
.mobile-calendar-help {
    display: none;
}
.chart-scroll {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar) var(--surface);
    padding-bottom: 8px;
}
.records-disclosure > summary {
    cursor: pointer;
    padding: 12px 0;
    min-height: 48px;
    color: var(--primary);
    font-weight: 600;
}
.records-disclosure[open] > summary {
    margin-bottom: 12px;
}
.dashboard-heading .muted {
    font-size: 0.875rem;
    margin-top: 8px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.stat-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
}
.stat-label {
    text-transform: uppercase;
    font-size: 0.875rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    color: var(--muted);
}
.stat-card strong {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    letter-spacing: -0.03em;
    line-height: 1.3;
    color: var(--primary);
    margin: 12px 0 8px;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}
.stat-card:nth-child(2) strong {
    color: var(--mint);
}
.stat-caption {
    color: var(--muted);
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}
.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}
.insight-panel,
.songs-panel {
    padding: 26px;
}
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.section-icon {
    color: var(--primary);
    background: var(--primary-container);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    padding: 9px;
}
.streak-symbol {
    display: grid;
    place-items: center;
    background: var(--mint-container);
    color: var(--mint);
    font-size: 24px;
    padding: 0;
}
.section-description {
    font-size: 0.875rem;
    margin-top: -10px;
    margin-bottom: 18px;
}
.chart-container {
    position: relative;
    height: 316px;
    min-width: 0;
}
canvas {
    max-width: 100%;
}
.streak-list {
    display: grid;
    gap: 10px;
}
.streak-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--surface-raised);
    border-radius: 12px;
}
.rank {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--info-container);
    color: var(--mint);
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 650;
}
.streak-info {
    min-width: 0;
    flex: 1;
}
.streak-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.streak-dates {
    display: block;
    font-size: 0.875rem;
    color: var(--muted);
}
.streak-length {
    color: var(--mint);
    white-space: nowrap;
    font-weight: 650;
    font-size: 1rem;
}
.streak-length small {
    font-weight: 400;
    font-size: 0.875rem;
}
.empty-state {
    padding: 36px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
}
.limit-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.875rem;
    flex-shrink: 0;
}
.limit-label select {
    width: auto;
    min-height: 48px;
    padding: 8px 12px;
    font-size: 0.875rem;
}
.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    scrollbar-color: var(--scrollbar) var(--surface);
    scrollbar-width: thin;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}
th {
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    background: var(--surface-raised);
    white-space: nowrap;
}
th,
td {
    padding: 14px 18px;
}
td {
    border-top: 1px solid var(--line);
}
td:first-child {
    color: var(--muted);
    width: 45px;
    font-variant-numeric: tabular-nums;
}
.song-title {
    font-weight: 600;
    min-width: 170px;
    max-width: 350px;
    overflow-wrap: anywhere;
}
.song-artist {
    color: var(--muted);
    min-width: 130px;
    max-width: 250px;
    overflow-wrap: anywhere;
}
.numeric {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.song-plays {
    color: var(--primary);
    font-weight: 650;
}
tbody tr:hover {
    background: var(--row-hover);
}
.history-search-form {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) auto;
    align-items: end;
    gap: 16px;
}
.history-query-field {
    position: relative;
}
.history-type-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 56px;
    padding: 14px 12px 14px 16px;
    border: 1px solid var(--outline);
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    text-align: left;
}
.history-type-trigger:hover {
    background: var(--state-hover);
}
.history-type-trigger[aria-expanded='true'] {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}
.history-type-trigger[aria-expanded='true'] .icon {
    transform: rotate(180deg);
}
.history-type-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 4;
    margin: 4px 0 0;
    padding: 8px 0;
    list-style: none;
    border-radius: 4px;
    background: var(--surface-raised);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.history-type-menu [role='option'] {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 16px;
    cursor: pointer;
}
.history-type-menu [aria-selected='true'] {
    color: var(--on-primary-container);
    background: var(--primary-container);
}
.history-type-menu [role='option']:hover,
.history-type-menu .is-active {
    box-shadow: inset 0 0 0 100px var(--state-hover);
}
.material-select {
    display: block;
    width: 100%;
    min-width: 0;
}
.material-select-trigger > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}
.material-select-trigger .icon {
    flex-shrink: 0;
}
.material-select-menu {
    position: fixed;
    right: auto;
    z-index: 30;
    margin: 0;
    overflow-y: auto;
}
.material-select-menu [aria-disabled='true'] {
    opacity: 0.55;
    cursor: default;
}
.limit-label .material-select {
    width: auto;
}
.limit-label .material-select-trigger {
    min-height: 48px;
    padding: 8px 12px;
    font-size: 0.875rem;
    gap: 8px;
}
.history-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 3;
    max-height: 360px;
    overflow-y: auto;
    background: var(--surface-raised);
    border: 1px solid var(--outline);
    border-radius: 4px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.history-suggestion {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    min-height: 48px;
    overflow-wrap: anywhere;
    cursor: pointer;
    font-size: 0.875rem;
}
.history-suggestion span {
    font-size: 0.875rem;
}
.history-suggestion:hover,
.history-suggestion[aria-selected='true'] {
    background: var(--primary-container);
    border-radius: 4px;
}
.history-results {
    margin-top: 28px;
}
.history-results .section-heading {
    margin-bottom: 12px;
}
.history-results h3,
.history-results p {
    overflow-wrap: anywhere;
}
.history-table-wrapper {
    border: 1px solid var(--line);
    border-radius: 8px;
}
.history-table {
    table-layout: fixed;
}
.history-col-date {
    width: 106px;
}
.history-col-time {
    width: 86px;
}
.history-col-played {
    width: 88px;
}
.history-col-platform {
    width: 124px;
}
.history-col-source {
    width: 92px;
}
.history-col-details {
    width: 100px;
}
.history-table th,
.history-table td {
    padding: 14px 10px;
    vertical-align: top;
    overflow-wrap: anywhere;
}
.history-table th {
    white-space: normal;
    overflow-wrap: normal;
}
.history-table td > * {
    min-width: 0;
}
.history-table td:first-child,
.history-table td:nth-child(2) {
    white-space: nowrap;
}
.history-table .history-details-cell {
    padding-block: 4px;
}
.history-details-toggle {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 4px;
    min-height: 44px;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--primary);
}
.history-details-toggle .icon {
    font-size: 20px;
}
.history-details-toggle:hover {
    background: var(--state-hover);
}
.history-table .history-details-row > td {
    width: auto;
    padding: 20px 24px 24px;
    white-space: normal;
    background: var(--surface-raised);
    color: var(--text);
}
.history-details-panel h4 {
    margin: 0 0 16px;
    font-size: 0.875rem;
    font-weight: 600;
}
.history-metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 16px 24px;
    margin: 0;
    font-size: 0.875rem;
}
.history-metadata > div {
    min-width: 0;
    overflow-wrap: anywhere;
}
.history-metadata dt {
    color: var(--muted);
}
.history-metadata dd {
    margin: 4px 0 0;
    font-size: 1rem;
}
.history-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}
.history-pagination p {
    font-size: 0.875rem;
    text-align: center;
}
@media (max-width: 1100px) {
    .history-table colgroup {
        display: none;
    }
    .history-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .history-table,
    .history-table tbody,
    .history-table tr {
        display: block;
        width: 100%;
    }
    .history-table tr {
        padding: 12px 16px;
    }
    .history-table tr + tr {
        border-top: 1px solid var(--line);
    }
    .history-table td {
        display: grid;
        width: 100%;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 12px;
        border: 0;
        padding: 6px 0;
    }
    .history-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 500;
    }
    .history-table td:first-child,
    .history-table td:nth-child(2) {
        white-space: normal;
    }
    .history-table .history-details-row {
        padding: 0;
    }
    .history-table .history-details-row > td {
        display: block;
        padding: 20px 16px;
    }
    .history-table .history-details-row > td::before {
        content: none;
    }
}
@media (max-width: 600px) {
    .history-metadata {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.field {
    position: relative;
    min-width: 0;
    max-width: 100%;
    padding-top: 8px;
}
.field label {
    position: absolute;
    top: 0;
    left: 12px;
    max-width: calc(100% - 24px);
    padding: 0 4px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 16px;
    font-weight: 500;
}
.field:focus-within label {
    color: var(--primary);
}
.field input {
    width: 100%;
}
.field .date-input {
    padding-right: 56px;
}
.field .date-native {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 48px;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}
.date-calendar {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 48px;
    height: 56px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
}
.date-calendar:hover {
    color: var(--primary);
    background: var(--state-hover);
}
.field select {
    width: 100%;
}
.platforms-toggle {
    margin-top: 20px;
}
.habits-grid {
    align-items: stretch;
}
.habits-grid:has(#platforms-toggle[aria-expanded='true']) {
    align-items: start;
}
.form-help {
    font-size: 0.875rem;
    margin: 16px 0 24px;
}
.form-actions {
    display: flex;
    gap: 12px;
}
.form-actions .button {
    flex: 1;
}
.lb-loading {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    font-size: 0.875rem;
}
.loading-panel {
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: center;
    padding: 70px 24px;
    gap: 20px;
}
.loading-panel .muted {
    font-size: 0.875rem;
}
.loader {
    display: block;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 3px solid var(--loader-track);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.skip-link {
    position: fixed;
    top: 8px;
    left: 12px;
    background: var(--primary);
    color: var(--primary-ink);
    padding: 12px;
    z-index: 10;
    transform: translateY(-150%);
}
.skip-link:focus {
    transform: translateY(0);
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
@media (max-width: 900px) {
    .insights-grid {
        grid-template-columns: 1fr;
    }
    .chart-container {
        height: 340px;
    }
}
@media (max-width: 600px) {
    :root {
        --workspace-inset: 20px;
    }
    .app-shell {
        padding: 0 18px;
    }
    .site-header {
        padding: 20px 0;
    }
    .hero {
        padding: 42px 0 32px;
    }
    .hero-description {
        font-size: 0.9rem;
        margin-top: 18px;
    }
    .workspace-bar {
        margin-bottom: 18px;
    }
    .tabs {
        width: 100%;
    }
    .tab {
        flex: 1;
        padding: 10px 8px;
        font-size: 0.875rem;
        flex-direction: column;
        gap: 4px;
    }
    .history-search-form {
        grid-template-columns: 1fr;
    }
    .history-pagination {
        flex-wrap: wrap;
    }
    .history-pagination p {
        order: -1;
        flex-basis: 100%;
    }
    .upload-content {
        padding: 24px 16px;
    }
    .upload-art {
        margin-bottom: 20px;
    }
    .dashboard {
        gap: 18px;
    }
    .dashboard-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
    .history-actions {
        gap: 4px;
        width: 100%;
        max-width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--scrollbar) var(--surface);
        padding: 4px;
    }
    .history-actions .button {
        flex: 1 0 auto;
        gap: 6px;
        padding: 10px 8px;
        white-space: nowrap;
    }
    .history-actions .action-label {
        display: none;
    }
    .action-label-compact {
        display: inline;
    }
    .scroll-hint {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-top: 4px;
        color: var(--muted);
        font-size: 0.875rem;
    }
    .scroll-hint .icon {
        width: 20px;
        height: 20px;
        font-size: 20px;
    }
    .mobile-calendar-help {
        display: block;
        margin-top: 8px;
    }
    .chart-scroll .trend-chart,
    .chart-scroll .chart-container {
        min-width: 560px;
    }
    .chart-scroll .rhythm-chart {
        min-width: 420px;
    }
    .chart-scroll .rhythm-chart:has(#hoursChart) {
        min-width: 640px;
    }
    .stats-grid {
        gap: 10px;
        grid-template-columns: 1fr;
    }
    .stat-card {
        padding: 18px 20px;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 8px 14px;
    }
    .stat-card strong {
        grid-row: 1/3;
        grid-column: 2;
        max-width: 165px;
        margin: 0;
        text-align: right;
        font-size: 1.9rem;
    }
    .stat-caption {
        grid-row: 2;
        grid-column: 1;
    }
    .insight-panel,
    .songs-panel {
        padding: 20px 16px;
        border-radius: 18px;
    }
    .section-heading {
        gap: 10px;
    }
    h3 {
        font-size: 1.15rem;
    }
    .chart-container {
        height: 320px;
    }
    .songs-panel .section-heading {
        flex-wrap: wrap;
    }
    .limit-label {
        margin-left: auto;
    }
    .streak-item {
        gap: 8px;
        padding: 10px;
    }
    .rank {
        width: 24px;
        height: 24px;
    }
    .streak-dates {
        font-size: 0.875rem;
    }
    .streak-length {
        font-size: 0.9rem;
    }
    th,
    td {
        padding: 12px;
    }
    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .form-actions {
        flex-direction: column;
    }
    footer {
        flex-direction: column;
        gap: 6px;
        font-size: 0.875rem;
    }
}
/* ListenBrainz keeps its own orange accent within the shared component system. */
#tab-lb-btn.is-active {
    color: var(--scrobbler);
}
.lb-panel {
    --primary: var(--scrobbler);
    --primary-ink: var(--scrobbler-ink);
    --primary-container: var(--scrobbler-container);
    --on-primary-container: var(--on-scrobbler-container);
}
.lb-panel .button-primary:hover:not(:disabled) {
    background: var(--scrobbler-hover);
}
.lb-panel .loader {
    border-color: var(--scrobbler-track);
    border-top-color: var(--scrobbler);
}
.lb-panel :focus-visible {
    outline-color: var(--scrobbler);
}
.filter-panel {
    padding: 20px 24px;
    border-radius: 18px;
}
.filter-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: 16px;
}
.filter-controls select {
    width: 100%;
}
.filter-controls .button {
    white-space: nowrap;
}
.filter-note {
    font-size: 0.875rem;
    margin-top: 14px;
}
.filter-error {
    color: var(--error-text);
}
.custom-dates {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: 16px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.analysis-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: -4px;
}
.analysis-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 30px;
    color: var(--muted);
    font-size: 0.875rem;
}
.analysis-links a:hover {
    color: var(--primary);
    border-color: var(--primary);
}
.facts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.fact-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
}
.fact-card strong {
    color: var(--mint);
    font-size: 1.3rem;
    line-height: 1.35;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
}
.fact-card .stat-label {
    font-size: 0.875rem;
    min-height: 20px;
}
.fact-card .stat-caption {
    line-height: 1.5;
}
.small-copy {
    font-size: 0.875rem;
    text-align: right;
}
.trend-chart {
    height: 260px;
    position: relative;
    min-width: 0;
}
.rhythm-chart {
    height: 210px;
    position: relative;
    min-width: 0;
}
.timeline-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-top: 20px;
    color: var(--muted);
    font-size: 0.875rem;
}
.timeline-highlights span {
    padding-left: 12px;
    border-left: 2px solid var(--primary);
}
.chart-fallback {
    font-size: 0.875rem;
    color: var(--muted);
    max-height: 260px;
    overflow: auto;
}
.calendar-scroll {
    --calendar-label-width: max(29px, 3ch);
    font-size: 0.875rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar) var(--surface);
    padding: 6px;
    margin: 0 -6px;
}
.calendar-months {
    display: grid;
    gap: 0;
    font-size: 0.875rem;
    color: var(--muted);
    margin-left: calc(var(--calendar-label-width) + 8px);
    margin-bottom: 8px;
    width: max-content;
}
.calendar-months span {
    white-space: nowrap;
}
.calendar-body {
    display: flex;
    gap: 8px;
    width: max-content;
}
.calendar-weekdays {
    display: grid;
    grid-template-rows: repeat(7, var(--calendar-cell));
    gap: 0;
    flex-shrink: 0;
    width: var(--calendar-label-width);
    font-size: 0.875rem;
    color: var(--muted);
    line-height: var(--calendar-cell);
}
.activity-calendar {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(7, var(--calendar-cell));
    gap: 0;
    width: max-content;
}
.calendar-day {
    width: var(--calendar-cell);
    height: var(--calendar-cell);
    min-height: 0;
    border: 2px solid transparent;
    padding: 0;
    border-radius: 4px;
    background: var(--calendar-empty);
    background-clip: padding-box;
}
.calendar-day[data-level='1'],
.calendar-legend i[data-level='1'] {
    background: var(--calendar-1);
}
.calendar-day[data-level='2'],
.calendar-legend i[data-level='2'] {
    background: var(--calendar-2);
}
.calendar-day[data-level='3'],
.calendar-legend i[data-level='3'] {
    background: var(--calendar-3);
}
.calendar-day[data-level='4'],
.calendar-legend i[data-level='4'] {
    background: var(--calendar-4);
}
.calendar-day[data-level='outside'] {
    background: var(--calendar-outside);
}
.calendar-day[data-level] {
    background-clip: padding-box;
}
@media (min-width: 1200px) {
    .calendar-panel {
        padding: 20px 16px;
    }
}
.calendar-day:hover,
.calendar-day.is-selected {
    box-shadow: 0 0 0 2px var(--primary);
}
.calendar-legend {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 16px;
    font-size: 0.875rem;
    color: var(--muted);
}
.calendar-legend i {
    display: block;
    width: 13px;
    height: 13px;
    border-radius: 3px;
    background: var(--calendar-empty);
}
.calendar-legend span {
    margin: 0 4px;
}
.day-detail {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 18px;
    min-height: 68px;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}
.day-detail strong {
    color: var(--mint);
}
.day-detail p {
    font-size: 0.875rem;
    margin-top: 6px;
}
.day-songs {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.875rem;
}
.ranked-list {
    display: grid;
    gap: 8px;
}
.ranked-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    min-width: 0;
    font-size: 0.875rem;
}
.ranked-item:last-child {
    border-bottom: 0;
}
.ranked-info {
    min-width: 0;
    flex: 1;
}
.ranked-info strong,
.ranked-info span {
    display: block;
    overflow-wrap: anywhere;
}
.ranked-info span {
    font-size: 0.875rem;
    margin-top: 4px;
}
.ranked-value {
    color: var(--primary);
    font-size: 0.875rem;
    flex-shrink: 0;
    white-space: nowrap;
}
.count-badge {
    display: inline-flex;
    padding: 4px 10px;
    background: var(--badge-bg);
    color: var(--primary);
    border-radius: 8px;
    font-size: 0.875rem;
}
.discovery-link {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    color: var(--text);
    text-align: left;
    padding: 0;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}
.discovery-link:hover {
    color: var(--primary);
}
.discovery-date {
    font-size: 0.875rem;
    flex-shrink: 0;
}
.year-recaps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 14px;
}
.year-card {
    padding: 20px;
    border-radius: 14px;
    background: var(--surface-raised);
    min-width: 0;
    font-size: 0.875rem;
}
.year-card p {
    overflow-wrap: anywhere;
    margin-top: 8px;
}
.year-card .muted {
    font-size: 0.875rem;
}
.year-number {
    font-size: 1.75rem;
    color: var(--primary);
    line-height: 1.2;
    letter-spacing: -0.03em;
}
.year-link {
    border: 0;
    background: transparent;
    color: var(--mint);
    font-size: 0.875rem;
    text-align: left;
    padding: 12px 0 0;
    margin-top: 6px;
}
.habit-list {
    display: grid;
    gap: 16px;
}
.habit-item {
    display: grid;
    grid-template-columns: minmax(80px, 1fr) minmax(0, 1.4fr);
    gap: 4px 16px;
    font-size: 0.875rem;
    min-width: 0;
}
.habit-item > span {
    grid-row: 1/3;
}
.habit-item strong {
    overflow-wrap: anywhere;
    font-weight: 600;
}
.habit-item small {
    grid-column: 2;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}
.platform-list {
    display: grid;
    gap: 18px;
}
.platform-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.875rem;
}
.platform-label > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}
.platform-label > .muted {
    flex-shrink: 0;
}
.platform-bar {
    height: 6px;
    background: var(--surface-raised);
    border-radius: 6px;
    margin-top: 8px;
    overflow: hidden;
}
.platform-bar span {
    display: block;
    background: var(--primary);
    height: 100%;
    border-radius: 6px;
}
.songs-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}
.songs-tools .button {
    font-size: 0.875rem;
    padding: 8px 12px;
}
.artist-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
}
.artist-link {
    display: block;
    font-size: 0.875rem;
    margin: 0;
    padding: 6px 10px;
    min-height: 44px;
    border: 1px solid var(--line);
    color: var(--muted);
    width: auto;
    max-width: 180px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    background: var(--surface-raised);
    border-radius: 10px;
}
.artist-link:hover {
    color: var(--primary);
    border-color: var(--primary);
}
#overview-stats,
#listening-rhythm,
#library-insights,
#top-songs-section,
#view-explore {
    scroll-margin-top: 24px;
}
@media (max-width: 900px) {
    .facts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 600px) {
    .filter-panel {
        padding: 18px 16px;
    }
    .filter-controls {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .filter-controls .button {
        grid-column: 1/-1;
        justify-self: start;
        min-height: 44px;
        padding: 8px 12px;
    }
    .filter-controls .field label {
        font-size: 0.875rem;
    }
    .filter-controls select {
        font-size: 0.875rem;
        padding: 10px;
    }
    .custom-dates {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .custom-dates .button {
        justify-self: start;
    }
    .facts-grid {
        gap: 10px;
    }
    .fact-card {
        padding: 16px 12px;
    }
    .fact-card strong {
        font-size: 1.15rem;
    }
    .fact-card .stat-label {
        font-size: 0.875rem;
        min-height: 28px;
    }
    .fact-card .stat-caption {
        font-size: 0.875rem;
    }
    .analysis-links a {
        font-size: 0.875rem;
        padding: 6px 12px;
    }
    .timeline-highlights {
        flex-direction: column;
        gap: 10px;
        font-size: 0.875rem;
    }
    .trend-chart {
        height: 220px;
    }
    .rhythm-chart {
        height: 200px;
    }
    .calendar-panel .section-heading {
        flex-wrap: wrap;
    }
    .calendar-panel .limit-label {
        margin-left: auto;
    }
    .ranked-item {
        gap: 8px;
    }
    .ranked-value {
        font-size: 0.875rem;
    }
    .discovery-date {
        font-size: 0.875rem;
    }
    .platform-label {
        flex-wrap: wrap;
        gap: 4px;
    }
    .platform-label > .muted {
        flex-shrink: 1;
    }
    .songs-tools {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    .songs-tools .limit-label {
        margin-left: 0;
    }
    .artist-link {
        max-width: 135px;
    }
    .small-copy {
        font-size: 0.875rem;
    }
    .habit-item {
        gap: 4px 10px;
    }
    .year-card {
        padding: 16px;
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

@media (pointer: coarse) {
    :root {
        --calendar-cell: 44px;
    }
}

.scrobbler-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;
}
.scrobbl-connection {
    min-width: 0;
    padding-right: 24px;
    border-right: 1px solid var(--line);
}
.scrobbler-import {
    min-width: 0;
}
.scrobbl-connection .workspace-intro {
    margin-bottom: 28px;
}
.scrobbl-connection .workspace-intro > p {
    max-width: 70ch;
    line-height: 1.65;
}
.scrobbl-connection .form-help {
    max-width: 96ch;
}
.scrobbl-connection .form-actions {
    gap: 12px;
}
.scrobbl-connection .form-actions .button-primary {
    flex: 1.2;
}
.scrobbl-connection .form-actions .button-secondary {
    flex: 0.9;
}
.scrobbl-options {
    display: grid;
    grid-template-columns: auto minmax(160px, 220px);
    align-items: center;
    gap: 16px 24px;
    justify-content: start;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--divider);
}
.scrobbl-auto-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}
.scrobbl-auto-label input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}
.scrobbl-options .field {
    width: 100%;
}
#scrobbl-interval:disabled {
    color: var(--muted);
}
#scrobbl-status {
    overflow-wrap: anywhere;
    margin-top: 20px;
}
#scrobbl-status[data-status='error'] {
    font-weight: 600;
}

@media (max-width: 600px) {
    .scrobbl-options {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        margin-top: 24px;
        padding-top: 18px;
    }
    .scrobbl-options .field {
        max-width: 100%;
    }
    .scrobbl-connection .form-actions {
        gap: 8px;
    }
}

@media (max-width: 1100px) {
    .scrobbler-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }
    .scrobbl-connection {
        padding: 0 0 28px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 767px) {
    input,
    .history-type-trigger {
        font-size: 1rem;
    }
    #overview-stats,
    #listening-rhythm,
    #library-insights,
    #top-songs-section,
    #view-explore {
        scroll-margin-top: 112px;
    }
}
