/* palette:start (generated from src/palette.py, do not edit by hand) */
:root {
    --very-dark-purple: #2d162c;
    --dark-purple: #412752;
    --purple: #683a68;
    --light-purple: #9775a6;
    --text: #f5eac2;
    --bg: #2c1f33;
}
/* palette:end */

:root {
    --color-bg: var(--bg);
    --color-text: var(--text);
    --color-surface: var(--dark-purple);
    --color-border: var(--light-purple);
    --color-nav-bg: var(--very-dark-purple);
    --color-accent: var(--purple);
    --color-accent-soft: var(--light-purple);
    --color-selected: var(--dark-purple);

    --cover-saturate: 80%;
    --cover-brightness: 200%;
    --cover-hue: -20deg;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}

@font-face {
    font-family: "Director";
    src: url("/static/fonts/degheest/Director-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-display: optional;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: "Director", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--color-text); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--color-accent); }

.shell { display: flex; flex-direction: column; align-items: stretch; min-height: 100vh; }
.sidebar-divider { border: none; border-top: 1px solid var(--color-border); margin: 6px 10px; }
.content-column { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content {
    padding: clamp(6px, 2.5vw, 16px);
    container-type: inline-size;
}

.mobile-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--color-nav-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 10px 14px;
}
.preview-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    background: var(--color-nav-bg);
    border-top: 1px solid var(--color-border);
    padding: 8px 14px;
}
.preview-bar[hidden] {
    display: none;
}
.preview-bar-info {
    display: none;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    max-width: 240px;
    flex-shrink: 0;
    font-size: 13px;
}
.preview-bar-track { font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.preview-bar-sep { color: var(--color-text); opacity: 0.6; flex-shrink: 0; }
.preview-bar-artist {
    color: var(--color-text);
    opacity: 0.7;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.preview-bar-progress {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 4px;
    padding: 10px 0;
    box-sizing: content-box;
    background-clip: content-box;
    border-radius: 2px;
    background-color: var(--color-surface);
    cursor: pointer;
}
.preview-bar-progress::before {
    content: "";
    position: absolute;
    inset: 10px 0;
    border-radius: 2px;
    border: 1px solid var(--color-border);
}
.preview-bar-progress-fill {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 0;
    width: 0%;
    background: var(--color-text);
    pointer-events: none;
}
.preview-btn.preview-bar-toggle .preview-icon {
    font-size: 13px;
    margin-left: 0;
}
.preview-bar-volume {
    flex-shrink: 0;
    width: 70px;
    accent-color: var(--color-accent);
    cursor: pointer;
}
body.preview-bar-visible .content { padding-bottom: 52px; }

.quick-search { position: relative; flex: 1; min-width: 0; }
.quick-search-input {
    width: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}
.quick-search-input:focus { border-color: var(--color-accent); }
.profile-switcher {
    flex: none;
    max-width: 40vw;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    padding: 8px 10px;
    font-size: 14px;
}
.quick-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    margin-top: 4px;
    padding: 6px;
    background: var(--color-nav-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.quick-search-results:not(:empty) { display: block; }

.qs-tabs {
    display: flex;
    gap: 4px;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
}
.qs-tab {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--color-text);
    opacity: 0.7;
    cursor: pointer;
}
.qs-tab.active { opacity: 1; background: var(--color-surface); border-color: var(--color-accent); }
.qs-column[hidden] { display: none; }
.qs-column-title {
    display: none;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text);
    opacity: 0.55;
    margin-bottom: 4px;
}

.hamburger-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
}
.hamburger-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--color-text);
}

.drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 29;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.mobile-drawer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    width: 240px;
    max-width: 80vw;
    overflow-y: auto;
    scrollbar-gutter: stable;
    background: var(--color-nav-bg);
    border-right: 1px solid var(--color-border);
    padding: 16px 12px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer .brand { font-weight: 600; font-size: 16px; padding: 6px 10px 14px; }
.mobile-drawer a:not(.brand) { font-size: 14px; padding: 10px 10px; border-radius: 6px; }
.mobile-drawer a:not(.brand):hover { background: var(--color-surface); text-decoration: none; }
.mobile-drawer .sidebar-bottom {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

h1 { font-size: 24px; font-weight: 600; margin-bottom: 4px; color: var(--color-text); }
h2 { font-size: 18px; font-weight: 600; margin: 20px 0 10px; color: var(--color-text); }

.section-header { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
.section-header h2 { margin: 0; }

.widget-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    margin-top: 16px;
    overflow-x: clip;
}

.widget {
    flex: none;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
}
.widget:has(.carousel) { width: 100%; max-width: 100%; }
.widget .word-cloud.carousel { --wc-scale: 0.55; }

.widget-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.widget-header h2 { margin: 0; }
.widget blockquote { margin-bottom: 0; }
.widget .carousel { margin-top: 0; }

.word-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 10px 20px;
}
.word-cloud-tag { font-weight: 600; line-height: 1.3; white-space: nowrap; }
a.word-cloud-tag { text-decoration: none; border-bottom: 2px solid transparent; }
a.word-cloud-tag:hover { border-bottom-color: currentColor; }
a.word-cloud-tag.active { border-bottom-color: currentColor; }

.page-header-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    min-width: 0;
}
.date-filter { order: 1; }
.ml-genre-cloud { order: 2; min-width: 0; }
.word-cloud.carousel {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: 100%;
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
}
.ml-genre-cloud .word-cloud.carousel { gap: 2px 10px; margin-top: 0; }
.ml-genre-cloud .word-cloud-tag { font-weight: 500; }

p { margin-bottom: 12px; }
ul { margin-bottom: 12px; padding-left: 20px; }
li { margin-bottom: 4px; }

blockquote {
    width: fit-content;
    max-width: 100%;
    margin-bottom: 12px;
    padding: 10px 16px;
    border-left: 4px solid var(--color-accent);
    background: var(--color-surface);
    border-radius: 0 8px 8px 0;
}

.subtitle { color: var(--color-text); opacity: 0.7; font-size: 14px; }
.subtitle a { text-decoration: underline; }

.divider { border: none; border-top: 1px solid var(--color-border); margin: 20px 0; }

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    margin: 0 -10px;
    border-radius: 4px;
    font-size: 14px;
    min-width: 0;
    min-height: 44px;
}
.row:hover { background: var(--color-selected); }
.row .left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}
.row .row-primary {
    display: inline-block;
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.row .row-secondary {
    display: none;
    flex-shrink: 0;
    max-width: 40%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.row .note {
    color: var(--color-text);
    opacity: 0.7;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 36px;
    text-align: right;
}

.row-bar-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.row-bar {
    position: relative;
    width: 80px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 4px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    overflow: hidden;
}
.row-bar-fill {
    position: absolute;
    inset: 0;
    height: 100%;
    background: var(--color-accent);
}
.row-bar-label {
    font-size: 12px;
    color: var(--color-text);
    opacity: 0.85;
    min-width: 42px;
    text-align: right;
    flex-shrink: 0;
}
.row .sep { display: none; color: var(--color-text); opacity: 0.7; flex-shrink: 0; }

.row-thumb {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    flex-shrink: 0;
    filter: saturate(var(--cover-saturate)) brightness(var(--cover-brightness)) hue-rotate(var(--cover-hue));
}

.preview-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
}
.preview-btn:hover { border-color: var(--color-accent); }
.preview-icon {
    font-size: 9px;
    line-height: 1;
    margin-left: 1px;
}
.preview-btn.playing .preview-icon { margin-left: 0; }

.card-cover-wrap { position: relative; }
.card-play-btn {
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 5;
    background: rgba(44, 31, 51, 0.75);
}

.hero-image {
    width: var(--hero-size);
    height: var(--hero-size);
    border-radius: 8px;
    object-fit: cover;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: block;
    margin-bottom: 12px;
    filter: saturate(var(--cover-saturate)) brightness(var(--cover-brightness)) hue-rotate(var(--cover-hue));
}

.hero-image-raw { filter: none; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(100px, 26cqw, 160px), 1fr));
    gap: clamp(10px, 3cqw, 20px);
    margin-top: 16px;
    overflow-x: clip;
    overflow-y: visible;
}

.grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(clamp(72px, 20cqw, 90px), 1fr));
    gap: clamp(8px, 2cqw, 12px);
}
.grid-compact .card-title, .grid-compact .card-secondary { font-size: 12px; }

.carousel {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: clamp(100px, 26vw, 160px);
    gap: clamp(10px, 3vw, 20px);
    margin-top: 16px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > .card { scroll-snap-align: start; }
.carousel img, .carousel a { -webkit-user-drag: none; }
.carousel.carousel-dragging { cursor: grabbing; scroll-snap-type: none; }
.carousel.carousel-dragging, .carousel.carousel-dragging * { user-select: none; }
.carousel-compact { grid-auto-columns: clamp(72px, 20vw, 90px); }
.carousel-compact .card-title, .carousel-compact .card-secondary { font-size: 12px; }

.card { display: flex; flex-direction: column; min-width: 0; position: relative; }

[data-tooltip] { position: relative; }

[data-tooltip]::after, [data-tooltip]::before {
    z-index: 20;
    position: absolute;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    bottom: 100%;
    width: max-content;
    max-width: 220px;
    margin-bottom: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-accent);
    background: var(--color-nav-bg);
    color: var(--color-text);
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    transform: translate(calc(-50% + var(--tooltip-shift, 0px)), 4px);
}

[data-tooltip]::before {
    content: "";
    bottom: 100%;
    width: 10px;
    height: 10px;
    margin-bottom: 8px;
    background: var(--color-nav-bg);
    border-right: 1px solid var(--color-accent);
    border-bottom: 1px solid var(--color-accent);
    transform: translate(-50%, 4px) rotate(45deg);
}

[data-tooltip]:hover::after, [data-tooltip]:hover::before,
[data-tooltip].tooltip-active::after, [data-tooltip].tooltip-active::before {
    opacity: 1;
    transform: translate(-50%, 0) rotate(45deg);
}

[data-tooltip]:hover::after, [data-tooltip].tooltip-active::after {
    transform: translate(calc(-50% + var(--tooltip-shift, 0px)), 0);
}

.tooltip-below[data-tooltip]::after { bottom: auto; top: 100%; margin-bottom: 0; margin-top: 13px; }
.tooltip-below[data-tooltip]::before { bottom: auto; top: 100%; margin-bottom: 0; margin-top: 8px; transform: translate(-50%, -4px) rotate(45deg); }
.tooltip-below[data-tooltip]:hover::before, .tooltip-below[data-tooltip].tooltip-active::before {
    transform: translate(-50%, 0) rotate(45deg);
}

.card-cover { display: block; border-radius: 8px; overflow: hidden; }

.card-info-btn {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: rgba(44, 31, 51, 0.75);
    color: var(--color-text);
    font-size: 12px;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
}
@media (hover: none) {
    .card-info-btn { display: flex; }
}

.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 11px;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
}
.info-btn:hover { border-color: var(--color-accent); }

.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: transform 0.15s ease;
    filter: saturate(var(--cover-saturate)) brightness(var(--cover-brightness)) hue-rotate(var(--cover-hue));
}

.card-thumb-empty { aspect-ratio: 1 / 1; }

.card-thumb-raw { filter: none; }

.card-cover:hover .card-thumb { transform: scale(1.03); }

.card-title {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-title:hover { text-decoration: underline; }

.card-secondary {
    display: block;
    font-size: 13px;
    color: var(--color-text);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-secondary:hover { text-decoration: underline; }

.card-note {
    display: block;
    font-size: 12px;
    color: var(--color-text);
    opacity: 0.55;
}

.search-form { display: flex; gap: 8px; margin: 20px 0; }
.search-form input {
    flex: 1;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
}
.search-form input:focus { border-color: var(--color-accent); }
.search-form button {
    background: var(--color-accent-soft);
    color: var(--color-text);
    border: none;
    border-radius: 6px;
    padding: clamp(8px, 2cqw, 10px) 16px;
    font-size: 14px;
    cursor: pointer;
}
.search-form button:hover { background: var(--color-accent); }

.btn {
    display: inline-block;
    background: var(--color-accent-soft);
    color: var(--color-text);
    border: none;
    border-radius: 6px;
    padding: clamp(8px, 2cqw, 10px) 16px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--color-accent); }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header h1 { margin-bottom: 0; flex-shrink: 0; }

.list-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.list-title-row h2 { margin-bottom: 0; white-space: nowrap; }
.list-title-row .btn { flex-shrink: 0; white-space: nowrap; }

.description-form { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; max-width: 480px; }
.description-input {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--color-text);
    font-size: 14px;
    font-family: inherit;
}
.description-input:focus { outline: none; border-color: var(--color-accent); }
.description-form .btn { align-self: flex-start; }

.date-filter { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.date-filter-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; flex: 1 1 calc(50% - 6px); min-width: 140px; }
.date-filter-field span { color: var(--color-text); opacity: 0.7; }
.date-filter-field input {
    width: 100%;
    box-sizing: border-box;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 6px 8px;
    color: var(--color-text);
    font-size: 14px;
    font-family: inherit;
}
.date-filter-field input:focus { outline: none; border-color: var(--color-accent); }
input[type="date"] { color-scheme: dark; }

.ml-tabs { display: flex; align-items: flex-end; gap: 4px; margin: 16px 0 0; flex-wrap: wrap; }
.ml-tab {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 10px 16px;
    margin-bottom: -1px;
    font-size: 14px;
    color: var(--color-text);
    opacity: 0.65;
    cursor: pointer;
    position: relative;
}
.ml-tab.active {
    opacity: 1;
    background: var(--color-surface);
    border-color: var(--color-border);
    z-index: 1;
}
.ml-tab-count { display: none; }
.ml-tab.active .ml-tab-count { display: inline; }
.ml-columns { border-top: 1px solid var(--color-border); background: var(--color-surface); padding: 16px; border-radius: 0 8px 8px 8px; }
.ml-column[hidden] { display: none; }
.ml-column-title { display: none; }
.ml-column-header {
    display: flex;
    justify-content: space-between;
    padding: 4px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--color-border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text);
    opacity: 0.5;
}

.heatmap-wrap {
    height: clamp(120px, 30cqw, 160px);
    background: var(--color-bg); border: 1px solid var(--color-border); padding: 6px 10px 6px 6px; border-radius: 6px; width: 100%; overflow: auto;
    scrollbar-gutter: stable;
}
.heatmap-years-overview,
.heatmap-wrap {
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) var(--color-surface);
}
.heatmap-years-overview::-webkit-scrollbar,
.heatmap-wrap::-webkit-scrollbar {
    width: 6px;
}
.heatmap-years-overview::-webkit-scrollbar-track,
.heatmap-wrap::-webkit-scrollbar-track {
    background: var(--color-surface);
    border-radius: 4px;
}
.heatmap-years-overview::-webkit-scrollbar-thumb,
.heatmap-wrap::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 4px;
}
.heatmap-wrap table { border-collapse: separate; border-spacing: clamp(1px, 0.2cqw, 2px); table-layout: fixed; width: 100%; height: 100%; }
.heatmap-wrap th, .heatmap-wrap td { width: auto; }
.heatmap-wrap th:first-child, .heatmap-wrap td:first-child { width: 16px; }
.heatmap-wrap th { font-size: clamp(8px, 0.7cqw, 10px); color: var(--color-text); opacity: 0.7; text-align: center; }
.hm-day-label { font-size: clamp(8px, 0.7cqw, 10px); color: var(--color-text); opacity: 0.7; padding-right: 3px; }
.hm-day-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    font-size: clamp(7px, 0.65cqw, 9px);
    color: var(--color-text);
    text-decoration: none;
}
.hm-day-cell:hover { opacity: 0.8; text-decoration: none; }
.hm-day-empty { display: block; width: 100%; height: 100%; }

.heatmap-years-overview {
    height: var(--hero-size);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-gutter: stable;
}
.hm-year-row {
    display: flex;
    align-items: stretch;
    flex: 1 1 0;
    min-height: 12px;
    gap: 8px;
}
.hm-year-row-label {
    width: 3.2ch;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text);
    opacity: 0.8;
}
.hm-year-row-selected .hm-year-row-label { opacity: 1; text-decoration: underline; }
.hm-months-header {
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    background: var(--color-bg);
    padding-bottom: 2px;
}
.hm-months-header-strip { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; }
.hm-months-header-strip span {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    font-size: 10px;
    color: var(--color-text);
    opacity: 0.5;
}
.hm-month-abbr { display: none; }
.hm-months-strip { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; }
.hm-month-chip {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    border-radius: 2px;
}
.hm-month-chip:hover { opacity: 0.8; }

.info { color: var(--color-text); opacity: 0.7; font-size: 14px; padding: 12px 0; }

.infinite-scroll-trigger {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: var(--color-text);
    opacity: 0.7;
    font-size: 14px;
    font-family: inherit;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
}
.infinite-scroll-trigger:hover { opacity: 1; text-decoration: underline; }

.detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 20px;
    margin-top: 16px;
}
.panel {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 8px;
    container-type: inline-size;
}
.detail-header-top {
    display: grid;
    grid-template-areas: "title title" "hero heatmap";
    grid-template-columns: auto 1fr;
    gap: 10px 12px;
    margin-bottom: 12px;
    --hero-size: clamp(120px, 30cqw, 160px);
}
.detail-header-title { grid-area: title; min-width: 0; text-align: center; }
.detail-header-title .description-form { margin-left: auto; margin-right: auto; align-items: center; }
.detail-header-title .description-form .btn { align-self: center; }
.detail-header h1 { margin-top: 4px; overflow-wrap: break-word; word-break: break-word; }
.detail-title-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.detail-title-row h1 { min-width: 0; }
.detail-play-btn { width: 32px; height: 32px; flex-shrink: 0; }
.detail-play-btn .preview-icon { font-size: 12px; }
.hero-image { grid-area: hero; }
.detail-header-heatmap { grid-area: heatmap; min-width: 0; }
.detail-filter-clear { color: var(--color-text); font-weight: 600; }
.detail-filter-clear-x { opacity: 0.7; }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }

.theme-grid { margin-top: 16px; }
.theme-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}
.theme-label { flex: 1; font-size: 14px; }
.theme-swatch {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: none;
    cursor: pointer;
}
.theme-hex {
    width: 90px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    padding: 6px 8px;
    font-size: 13px;
    font-family: monospace;
}
.theme-hex:focus { outline: none; border-color: var(--color-accent); }
.theme-clear {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}
.theme-clear:hover { background: var(--color-surface); }
.theme-range { flex-shrink: 0; }
.theme-range-value {
    display: inline-block;
    min-width: 64px;
    text-align: right;
    font-family: monospace;
    font-size: 13px;
    flex-shrink: 0;
}

.account-sections { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.account-sections .widget { max-width: none; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
}
.status-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
    flex-shrink: 0;
}
.status-badge.connected::before { background: var(--color-accent); }

.account-stat-list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.account-stat-list li { display: flex; flex-direction: column; gap: 2px; }
.account-stat-list .label { opacity: 0.7; }

.account-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.admin-users-wrap { overflow-x: auto; margin: 12px 0; }
.admin-users { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.admin-users th {
    text-align: left;
    color: var(--color-text);
    opacity: 0.7;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 8px 16px 8px 0;
    border-bottom: 1px solid var(--color-border);
}
.admin-users td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.admin-users tr:last-child td { border-bottom: none; }
.admin-users .btn { padding: 4px 10px; font-size: 12px; }
.admin-users .role-tag {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    opacity: 0.85;
}

.error { color: var(--color-accent); margin: 8px 0; }

.tag-pill {
    display: inline-block;
    font-size: 12px;
    padding: 3px 10px;
    margin: 2px 4px 2px 0;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    opacity: 0.75;
}
.tag-pill:hover { opacity: 1; }
.tag-pill.active { opacity: 1; border-color: var(--color-accent); color: var(--color-accent); }

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.photo-tile { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 6px; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-embed { display: block; max-width: 100%; height: auto; border-radius: 8px; margin: 12px 0; }

.file-drop {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0;
    padding: 12px;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
}
.file-drop input[type="file"] { color: var(--color-text); font-size: 13px; max-width: 100%; }

.form-field { display: block; margin: 12px 0; }
.form-field .subtitle { display: block; margin-bottom: 4px; }
.form-field input {
    display: block;
    width: 100%;
    max-width: 420px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    padding: 8px 12px;
    font-size: 14px;
}
.form-field input:focus { outline: none; border-color: var(--color-accent); }

@media (min-width: 481px) {
    .row .row-secondary { display: inline-block; }
    .row .sep { display: inline; }
}

@media (min-width: 700px) {
    .hm-month-num { display: none; }
    .hm-month-abbr { display: inline; }
    .panel { padding: 16px; }
    .content { padding: 24px 32px; }
    .page-header { flex-wrap: nowrap; }
    .page-header-actions { flex-direction: row; align-items: center; width: auto; }
    .date-filter { order: 0; }
    .widget .word-cloud.carousel { --wc-scale: 1; }
    .list-title-row { flex-wrap: nowrap; }
    .qs-tabs { display: none; }
    .qs-results-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .qs-column[hidden] { display: block; }
    .qs-column-title { display: block; }
    .date-filter { flex-wrap: nowrap; }
    .theme-row { flex-wrap: nowrap; }
    .preview-bar-info { display: flex; }
    .account-stat-list li { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }

    .ml-tabs { display: none; }
    .ml-genre-cloud { order: 0; flex: 1; }
    .ml-columns {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 32px;
        align-items: start;
        border-top: none;
        background: none;
        padding: 0;
        border-radius: 0;
    }
    .ml-column { max-height: calc(100vh - 220px); overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; padding-right: 8px; }
    .ml-column:not(:first-child) { border-left: 1px solid var(--color-border); margin-left: -20px; padding-left: 20px; }
    .ml-column[hidden] { display: block; }
    .ml-column-title { display: block; }
}


@media (min-width: 700px) {
@container (min-width: 534px) {
    .detail-header-top:has(.hero-image-raw, .hero-image-large) {
        grid-template-areas: "hero title" "hero heatmap";
        grid-template-rows: auto minmax(0, 1fr);
        --hero-size: clamp(160px, 30cqw, 280px);
        height: var(--hero-size);
    }
    .hero-image-raw, .hero-image-large { grid-row: 1 / 3; }
    .detail-header-top:has(.hero-image-raw, .hero-image-large) .heatmap-years-overview {
        height: 100%;
    }
}
}
