/* lescharts.ch — mobile-first */

:root {
    --bg: #f7f8fb;
    --surface: #ffffff;
    --ink: #11161d;
    --ink-soft: #4b5566;
    --muted: #8a93a3;
    --line: #e5e8ef;
    --accent: #d61f3f;
    --accent-ink: #ffffff;
    --up: #1e9c5d;
    --down: #c63030;
    --flat: #8a93a3;
    --new: #1473e6;
    --re: #b07a00;
    --shadow: 0 1px 2px rgba(17,22,29,.05), 0 6px 18px rgba(17,22,29,.06);
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1320;
        --surface: #161c2c;
        --ink: #ecf0f6;
        --ink-soft: #b6becd;
        --muted: #7c8499;
        --line: #232a3c;
        --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.45);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 0.85em; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(100% - 24px, 1100px); margin: 0 auto; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(180%) blur(8px);
}
.header-row {
    display: flex; gap: 10px; align-items: center; justify-content: space-between;
    padding: 10px 0 0;
}
.brand {
    display: inline-flex; gap: 0; font-weight: 800;
    font-size: 19px; line-height: 1; letter-spacing: -.4px;
    color: var(--ink);
}
.brand-mark { color: var(--accent); }
@media (min-width: 700px) {
    .brand { font-size: 28px; letter-spacing: -.6px; }
}
@media (min-width: 1100px) {
    .brand { font-size: 32px; letter-spacing: -.7px; }
}
.search-form {
    display: flex; align-items: center;
    background: var(--bg); border: 1px solid var(--line);
    border-radius: 999px; padding: 4px 4px 4px 12px;
    margin: 8px 0 10px;
}
.search-form input {
    border: 0; background: transparent; flex: 1; min-width: 0;
    font: inherit; color: var(--ink); padding: 8px 6px; outline: none;
}
.search-form button {
    background: var(--ink); color: var(--surface);
    border: 0; border-radius: 999px; width: 36px; height: 36px;
    display: inline-grid; place-items: center; cursor: pointer;
}
.lang-nav { position: relative; }
.lang-nav summary {
    list-style: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 8px 10px; min-width: 44px; min-height: 36px;
    border-radius: 8px;
    background: transparent; color: var(--ink-soft);
    font-weight: 700; font-size: 13px; letter-spacing: 0.04em;
    border: 1px solid var(--line);
}
.lang-nav summary::-webkit-details-marker { display: none; }
.lang-nav summary::marker { content: ''; }
.lang-nav summary::after {
    content: '▾'; font-size: 9px; opacity: 0.7;
}
.lang-nav[open] summary { background: var(--bg); color: var(--ink); }

.lang-menu {
    position: absolute; top: calc(100% + 4px); right: 0; z-index: 30;
    margin: 0; padding: 4px;
    list-style: none;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 10px; box-shadow: var(--shadow);
    min-width: 90px;
}
.lang-menu a {
    display: block; padding: 8px 12px; border-radius: 6px;
    color: var(--ink-soft); font-weight: 600; font-size: 13px;
    text-align: left;
}
.lang-menu a:hover { background: var(--bg); text-decoration: none; }
.lang-menu a.is-active { color: var(--accent); }

/* Main */
.main { padding: 16px 0 32px; }

/* Chart head */
.chart-head { margin: 8px 0 16px; }
.chart-head-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; justify-content: space-between; }
.chart-head h1 { font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.2px; }
.week-picker select {
    font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
    border-radius: 8px; padding: 8px 30px 8px 10px; min-height: 40px;
}

/* Chart list — one card per row, uniform height, single-line text */
.chart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chart-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.chart-link {
    display: grid;
    grid-template-columns: 36px 56px minmax(0, 1fr);
    gap: 10px; align-items: center;
    padding: 8px 12px;
    color: var(--ink);
    height: 72px;
    overflow: hidden;
}
.chart-link:hover { text-decoration: none; background: rgba(214,31,63,0.04); }
.pos { font-size: 20px; font-weight: 700; text-align: center; }
.cover {
    width: 56px; height: 56px; border-radius: 8px; overflow: hidden;
    background: var(--bg); display: grid; place-items: center;
    flex-shrink: 0;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback { color: var(--muted); font-size: 20px; }
.cover-fallback.large { font-size: 64px; }
.cover-fallback.small { font-size: 18px; }
.meta { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.meta .title,
.meta .artist {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.meta .title  { font-weight: 600; font-size: 15px; line-height: 1.2; }
.meta .artist { color: var(--ink-soft); font-size: 13px; line-height: 1.2; }
.meta .badges {
    display: flex; flex-wrap: nowrap; gap: 4px; margin-top: 2px; align-items: center;
}
.badge {
    font-size: 10px; font-weight: 700;
    padding: 1px 5px; border-radius: 5px;
    background: var(--bg); color: var(--ink-soft);
    border: 1px solid var(--line);
    white-space: nowrap; line-height: 1.4;
}
.badge-up   { color: var(--up); border-color: rgba(30,156,93,0.3); }
.badge-down { color: var(--down); border-color: rgba(198,48,48,0.3); }
.badge-flat { color: var(--flat); }
.badge-new  { color: var(--new); border-color: rgba(20,115,230,0.3); }
.badge-re   { color: var(--re);  border-color: rgba(176,122,0,0.3); }
.badge-stat { background: transparent; }

@media (min-width: 1000px) {
    .chart-link { grid-template-columns: 48px 64px minmax(0, 1fr); padding: 10px 16px; height: 80px; }
    .cover { width: 64px; height: 64px; }
    .meta .title { font-size: 16px; }
    .meta .artist { font-size: 14px; }
    .pos { font-size: 22px; }
}

.empty-state { padding: 30px 0; color: var(--muted); text-align: center; }

/* Album page */
.album-page { display: grid; gap: 20px; }
.album-hero { display: grid; grid-template-columns: 1fr; gap: 16px; }
.album-hero-cover img { border-radius: var(--radius); box-shadow: var(--shadow); }
.album-hero-cover { aspect-ratio: 1; max-width: 240px; }
.album-title { margin: 0 0 4px; font-size: 26px; line-height: 1.15; letter-spacing: -.3px; }
.album-artist { margin: 0; color: var(--ink-soft); font-weight: 600; }
.album-release { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.album-original-name { color: var(--muted); margin: 6px 0 0; font-size: 13px; }
@media (min-width: 700px) {
    .album-hero { grid-template-columns: 240px 1fr; align-items: end; }
}

.album-stats h2, .album-history h2, .album-other h2, .album-spotify h2 {
    font-size: 16px; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--muted); margin: 0 0 8px;
}
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat-grid > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stat-grid dt { font-size: 12px; color: var(--muted); margin: 0; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-grid dd { margin: 2px 0 0; font-size: 22px; font-weight: 700; }
@media (min-width: 600px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

.spotify-embed iframe { border-radius: var(--radius); box-shadow: var(--shadow); display: block; width: 100%; }

.history-table {
    width: 100%; border-collapse: collapse;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden;
}
.history-table th, .history-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.history-table tr:last-child td { border-bottom: 0; }

.other-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.other-list li a { display: flex; gap: 10px; align-items: center; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.other-list li img { width: 48px; height: 48px; border-radius: 6px; }
.other-list li span { display: grid; gap: 2px; }

/* Search */
.search-page { display: grid; gap: 14px; }
.search-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.search-results li a {
    display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    color: var(--ink);
}
.search-results img { width: 56px; height: 56px; border-radius: 6px; }
.search-results .meta { display: grid; gap: 2px; }
.search-results .artist { color: var(--ink-soft); }

/* Footer */
.site-footer { color: var(--muted); border-top: 1px solid var(--line); margin-top: 24px; padding: 18px 0 30px; font-size: 13px; }
.site-footer p { margin: 0 0 4px; }
.site-footer .sister-link { font-weight: 600; color: var(--ink-soft); }
.site-footer .sister-link a { color: var(--accent); }

/* Error pages */
.error-page { padding: 40px 0; text-align: center; }
