:root {
  --bg: #14171c; --panel: #1c2128; --fg: #d8dee6; --muted: #8b95a3;
  --accent: #2ea76b; --border: #2a313b;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.5 system-ui, sans-serif;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.2rem; background: var(--panel); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--fg); text-decoration: none; letter-spacing: .5px; }
nav { display: flex; gap: 1rem; align-items: center; }
nav .user { color: var(--muted); }
a { color: var(--accent); }
main { max-width: 980px; margin: 0 auto; padding: 1.4rem 1.2rem; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 1.2rem; }
.login { max-width: 340px; margin: 3rem auto; }
.login form, .login label { display: flex; flex-direction: column; gap: .3rem; }
.login form { gap: 1rem; }
input {
  background: #11151a; border: 1px solid var(--border); color: var(--fg);
  padding: .5rem .6rem; border-radius: 6px; font: inherit;
}
button {
  background: var(--accent); color: #062; border: 0; padding: .5rem .9rem;
  border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer;
}
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
button.link { background: none; color: #d77; padding: 0; font-weight: 400; }
.error { color: #e66; }
.muted { color: var(--muted); }
.hidden { display: none; }

.toolbar { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.toolbar a { padding: .2rem .6rem; border-radius: 6px; text-decoration: none; }
.toolbar a.on { background: var(--panel); border: 1px solid var(--border); }

table.clips { width: 100%; border-collapse: collapse; }
table.clips th, table.clips td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
table.clips th { color: var(--muted); font-weight: 500; }
.btn { text-decoration: none; padding: .25rem .7rem; border: 1px solid var(--border); border-radius: 6px; }

.badge { padding: .1rem .5rem; border-radius: 10px; font-size: .8rem; }
.badge.pending { background: #3a2; color: #cfe; }
.badge.done { background: #284; color: #cff; }
.badge.skipped, .badge.background { background: #444; color: #ccc; }
.badge.cw { background: #185; color: #dfe; }
.badge.other { background: #964; color: #fed; }

.back { display: inline-block; margin-bottom: .6rem; }
.clip-head { display: flex; align-items: baseline; gap: 1rem; }
.clip-head small { color: var(--muted); font-weight: 400; }
.clip-head .meta { color: var(--muted); font-size: .9rem; }

#spectrogram { position: relative; margin-top: .8rem; border: 1px solid var(--border); border-radius: 6px 6px 0 0; }

/* bande delle annotazioni sovrapposte al waterfall (stesso asse tempi) */
.spectro-overlays { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.ov {
  position: absolute; top: 0; bottom: 0; box-sizing: border-box;
  pointer-events: auto; cursor: pointer;
  border-left: 2px solid; border-right: 2px solid;
}
.ov-cw         { background: rgba(0, 230, 130, .16); border-color: rgba(0, 230, 130, .9); }
.ov-background { background: rgba(150, 150, 150, .14); border-color: rgba(180, 180, 180, .85); }
.ov-other      { background: rgba(240, 170, 0, .15); border-color: rgba(240, 170, 0, .9); }
.ov.sel        { background: rgba(0, 150, 255, .30); border-color: #2af; box-shadow: 0 0 0 2px #2af inset; }

.ann-list li.sel { background: rgba(0, 150, 255, .12); border-radius: 4px; }
#waveform { border: 1px solid var(--border); border-top: 0; border-radius: 0 0 6px 6px; }
.controls { display: flex; align-items: center; gap: .8rem; margin: .8rem 0; }
.controls .spacer { flex: 1; }
.hint { color: var(--muted); font-size: .9rem; }

#editor { margin: 1rem 0; }
#editor .labels { display: flex; gap: 1.2rem; margin: .6rem 0; }
#editor .labels label { display: flex; gap: .35rem; align-items: center; }
#text-row { display: flex; flex-direction: column; gap: .3rem; }
#editor .row { display: flex; gap: .6rem; margin-top: .8rem; }

.ann-list { list-style: none; padding: 0; }
.ann-list li { padding: .4rem 0; border-bottom: 1px solid var(--border); display: flex; gap: .5rem; align-items: center; }
