:root {
  --bg: #0b0b0e; --panel: #131318; --line: #24242c; --text: #d2d6dc; --muted: #8a8a96;
  --accent: #7fe0d2; --todo: #2a2a33; --wip: #d9a441; --done: #4fbf8a; --danger: #d05a5a;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: .35em; color: var(--text); }
.top nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.who { color: var(--muted); }
.okmsg { color: var(--done); margin: 0; }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
main.narrow { max-width: 720px; }
body.wide main { max-width: 1500px; }
h1 { font-weight: 300; letter-spacing: .08em; text-transform: uppercase; font-size: 1.5rem; }
h2 { font-weight: 500; font-size: 1.2rem; margin: 0; }
h3 { margin: 22px 0 8px; font-size: 1rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 0 0 20px; }
.note { border-color: var(--accent); }

input, button, select { font: inherit; color: inherit; }
select, input { color-scheme: dark; }
select option { background: #16161d; color: var(--text); }
input:not([type=checkbox]) { background: #0d0d11; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0; }
input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type=date] { color-scheme: dark; }
.btn { background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #062421; border-color: var(--accent); font-weight: 600; }
.btn.danger:hover, .x:hover { border-color: var(--danger); color: var(--danger); }
.x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.err { color: var(--danger); margin: 0; }

.login { display: grid; gap: 14px; }
.login label { display: grid; gap: 4px; color: var(--muted); }

.album-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.album-head .title-input { font-size: 1.2rem; font-weight: 300; min-width: 220px; }
.album-head .bar { flex: 1; }
.pct { min-width: 3.2em; text-align: right; font-size: 1.15rem; }
.pub { color: var(--muted); display: flex; gap: 6px; align-items: center; white-space: nowrap; }

.bar { height: 8px; background: var(--todo); border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar.big { height: 12px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #5aa7f0); border-radius: 99px; transition: width .3s; }

.scroll { overflow-x: auto; }
.lbl { display: none; }
body.wide main { padding-left: 12px; padding-right: 12px; }
table.tracker { border-collapse: collapse; width: 100%; font-size: .9rem; }
.tracker th { color: var(--muted); font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; padding: 6px 3px; white-space: nowrap; }
.tracker td { padding: 4px 3px; border-top: 1px solid var(--line); text-align: center; vertical-align: middle; }
.tracker .l { text-align: left; }
.cell-title, .notes { width: 100%; min-width: 90px; }
.c-title { min-width: 110px; }
.c-notes { min-width: 90px; }
.tracker input[type=date] { width: 8.9em; padding-left: 6px; padding-right: 4px; }
.pw { position: relative; display: inline-block; }
.pct-in { --c: var(--muted); width: 64px; padding: 6px 20px 6px 2px; text-align: center; font-variant-numeric: tabular-nums;
          color: var(--c); border-color: var(--c); background: #0d0d11; background: color-mix(in srgb, var(--c) 9%, #0d0d11); }
.pct-in:focus { outline: 1px solid var(--c); }
/* freccette: compaiono solo con il mouse sopra (o con la tastiera nel campo) */
.stp { position: absolute; top: 2px; bottom: 2px; right: 2px; width: 16px; display: flex; flex-direction: column; opacity: 0; transition: opacity .12s; }
.pw:hover .stp, .pw:focus-within .stp { opacity: 1; }
.stp button { flex: 1; padding: 0; border: 0; background: rgba(255,255,255,.07); color: var(--text); font-size: 7px; line-height: 1; cursor: pointer; }
.stp button:first-child { border-radius: 4px 4px 0 0; margin-bottom: 1px; }
.stp button:last-child { border-radius: 0 0 4px 4px; }
.stp button:hover { background: var(--accent); color: #04191c; }
@media (hover: none) { .stp { opacity: 1; } }
.prog { min-width: 76px; }
.prog .bar { margin-bottom: 3px; }

.saved { animation: ok .8s; } .failed { animation: bad 1.2s; }
@keyframes ok { from { box-shadow: 0 0 0 2px var(--done); } to { box-shadow: 0 0 0 2px transparent; } }
@keyframes bad { from { box-shadow: 0 0 0 2px var(--danger); } to { box-shadow: 0 0 0 2px transparent; } }

.row-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
form.inline, .inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.new-album { margin-top: 10px; }
.set-row { margin: 8px 0; justify-content: space-between; }
.who-line { flex: 1 1 260px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }

.songs { list-style: none; padding: 0; margin: 0; }
.songs li { display: grid; grid-template-columns: 1fr 40% 3.2em; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.songs li b { text-align: right; }

@media (max-width: 560px) {
  .songs li { grid-template-columns: 1fr 3.2em; }
  .songs li .bar { grid-column: 1 / -1; grid-row: 2; }
  .album-head { flex-wrap: wrap; }
}

.num { color: var(--muted); width: 2.2em; font-variant-numeric: tabular-nums; }
.mv form { display: inline-flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.mv button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .6rem; line-height: 1; padding: 4px 8px; }
.mv button:hover:not(:disabled) { color: var(--accent); background: rgba(127,224,210,.1); }
.mv button:disabled { opacity: .25; cursor: default; }

/* ---- Responsive: sotto 1350px ogni canzone diventa una scheda ---- */
@media (max-width: 1350px) {
  .scroll { overflow: visible; }
  table.tracker, .tracker tbody { display: block; }
  .tracker thead { display: none; }
  .tracker tr {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px 8px;
    border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #0f0f13;
  }
  .tracker td { display: block; border: 0; padding: 0; text-align: left; min-width: 0; }
  .tracker td.num { width: auto; grid-column: 1 / -1; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
  .tracker td.num::before { content: attr(data-label) " "; }
  .c-title, .c-prog, .c-rel, .c-notes { grid-column: 1 / -1; }
  .c-title { min-width: 0; }
  .tracker td.ph::before { content: attr(data-label); display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pw { display: block; }
  .pct-in { width: 100%; }
  .prog { display: flex !important; align-items: center; gap: 10px; }
  .prog .bar { flex: 1; margin: 0; }
  .c-rel::before, .c-notes::before { content: attr(data-label); display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
  .c-rel input { width: 100%; }
  .c-fin, .c-pub, .c-del, .c-mv { grid-column: span 2; display: flex !important; align-items: center; }
  .c-pub label, .c-fin label { display: flex; gap: 6px; align-items: center; color: var(--muted); }
  .c-del { justify-content: center; }
  .c-mv { justify-content: flex-end; }
  .lbl { display: inline; }
  .c-mv button { padding: 8px 14px; }
  .x { padding: 8px 12px; }
}
@media (max-width: 700px) {
  .top { padding: 12px 14px; }
  main, body.wide main { padding: 16px 10px 48px; }
  .card { padding: 12px; }
  .album-head { flex-wrap: wrap; gap: 10px; }
  .album-head .title-input { flex: 1 1 100%; min-width: 0; }
  .album-head .bar { flex: 1 1 40%; }
  .album-head .pct { min-width: 0; }
  .top { flex-wrap: wrap; gap: 8px 16px; }
  .top nav { gap: 6px 14px; }
  .row-actions { flex-direction: column; }
  .row-actions form.inline { width: 100%; }
  .row-actions form.inline input { flex: 1; }
  .set-row { justify-content: flex-start; }
  .tracker tr { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
  .btn { padding: 9px 14px; }
}

/* ================= Roadmap ================= */
.is-hidden { display: none !important; }
.filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.filters label { display: grid; gap: 4px; color: var(--muted); font-size: .8rem; }
.filters select, table.rm select { background: #0d0d11; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; }
.filters select:focus, table.rm select:focus { outline: 1px solid var(--accent); }
.f-actions { display: flex; gap: 8px; }
.f-hint { flex-basis: 100%; margin: 0; }

.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tl-head h2 { font-size: 1rem; margin: 0 0 10px; }
.tl-legend { color: var(--muted); font-size: .78rem; }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 10px; vertical-align: -1px; }
.tl-scroll { overflow-x: auto; }
.tl-inner { position: relative; }
.tl-axis { position: relative; height: 22px; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.tl-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-row { display: flex; border-top: 1px solid var(--line); }
.tl-label { flex: none; padding: 6px 10px 0 0; font-size: .82rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-track { position: relative; flex: 1; min-width: 0; }
.tl-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: .7; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .8; z-index: 1; }
.tl-dot { position: absolute; z-index: 2; width: 12px; height: 12px; margin-left: -6px; padding: 0; border-radius: 50%; border: 2px solid var(--bg); cursor: pointer; }
.tl-dot:hover { transform: scale(1.35); }
.tl-empty { padding: 10px 0; }
.st-todo { background: #5a7dbd; } .st-late { background: var(--danger); } .st-done { background: var(--done); } .st-nodate { background: var(--todo); }

table.rm { border-collapse: collapse; width: 100%; font-size: .9rem; }
.rm th { color: var(--muted); font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; padding: 6px 4px; white-space: nowrap; }
.rm td { padding: 5px 4px; border-top: 1px solid var(--line); vertical-align: middle; }
.rm .l { text-align: left; }
.rm .c-title input { width: 100%; min-width: 170px; }
.rm .c-notes input { width: 100%; min-width: 90px; }
.rm input[type=date] { width: 9em; padding-left: 6px; padding-right: 4px; }
.rm td { padding-left: 3px; padding-right: 3px; }
.rm .c-pub, .rm .c-del { text-align: center; }
.rm-flash { animation: flashrow 1.6s; }
@keyframes flashrow { 0%, 60% { background: rgba(127,224,210,.16); } 100% { background: transparent; } }

.dl { white-space: nowrap; color: var(--text); }
.dl.soon { color: var(--wip); font-weight: 600; }
.dl.over { color: var(--danger); font-weight: 600; }
.dt { display: block; font-size: .75rem; margin-top: 2px; white-space: nowrap; }
.dt.bull { color: var(--accent); font-weight: 600; }
.dt.early { color: var(--done); }
.dt.lateb { color: var(--wip); }
.st { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; white-space: nowrap; color: #04120e; }
.st.st-todo { background: #8fa8d8; } .st.st-late { background: #e08a8a; } .st.st-done { background: var(--done); } .st.st-nodate { background: #3b3b47; color: var(--text); }

/* Chi: pulsanti sempre visibili */
.c-who { min-width: 262px; }
.chips { display: flex; flex-direction: column; gap: 4px; }
.chips .grp { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { position: relative; padding: 3px 8px 3px 19px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); font-size: .78rem; cursor: pointer; line-height: 1.3; }
.chip::before { content: ""; position: absolute; left: 6px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--uc, #8a8a96); box-shadow: 0 0 0 1px rgba(255,255,255,.45); }
.chip:hover { border-color: rgba(255,255,255,.45); color: var(--text); }
.chip.band { border-style: dashed; }
/* acceso: sfondo del colore del membro, testo bianco o nero secondo la leggibilita' */
.chip.on { background: var(--uc); border-color: var(--uc); border-style: solid; color: var(--ut); font-weight: 600; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.chip.on::before { background: var(--ut); box-shadow: none; opacity: .5; }

.h-list { font-size: 1rem; margin: 0; }
.add-ms { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.add-ms input[name=title] { flex: 1 1 280px; min-width: 0; }
.add-ms select { max-width: 180px; }

@media (max-width: 1350px) {
  .rm thead { display: none; }
  table.rm, .rm tbody { display: block; }
  .rm tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 10px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #0f0f13; }
  .rm td { display: block; border: 0; padding: 0; min-width: 0; }
  .rm .c-title, .rm .c-notes, .rm .c-who { grid-column: 1 / -1; }
  .chips { max-width: none; }
  .rm .c-title input, .rm .c-notes input { min-width: 0; }
  .rm td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
  .rm input[type=date], .rm select { width: 100%; }
  .rm .c-pub, .rm .c-del { display: flex !important; align-items: center; }
  .rm .c-pub label { display: flex; gap: 6px; align-items: center; color: var(--muted); }
  .rm .lbl { display: inline; }
  .rm-none { display: block; border: 0; padding: 0; background: none; }
}

/* ---- Font dei titoli: Aller Light (il font del logo Exyre) ---- */
@font-face { font-family: "Aller Light"; src: url("fonts/Aller_Lt.ttf") format("truetype"); font-weight: 300; font-style: normal; font-display: swap; }
h1, h2, h3, .brand, .title-input, .h-list { font-family: "Aller Light", system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 300; }
.colorpick { width: 38px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
