:root{
  --bg: #f6f7fb;
  --paper: #ffffff;
  --text: #1c2330;
  --muted: #667085;
  --line: rgba(18, 31, 59, 0.10);

  --brand: #3b82f6;     /* blå */
  --brand2:#22c55e;     /* grön accent (sparsam) */
  --danger:#ef4444;

  --shadow: 0 18px 50px rgba(16,24,40,0.12);
  --radius: 16px;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    linear-gradient(180deg, rgba(235,243,255,0.92) 0%, rgba(248,250,255,0.98) 45%, rgba(246,247,251,1) 100%),
    radial-gradient(1200px 520px at 80% 0%, rgba(99,179,237,0.18), transparent 55%),
    radial-gradient(900px 400px at 20% 0%, rgba(59,130,246,0.12), transparent 55%),
    radial-gradient(700px 360px at 85% 10%, rgba(34,197,94,0.10), transparent 50%),
    var(--bg);
  transition: background 220ms ease, color 220ms ease;
}

/* Public site header */
.siteHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.siteBrand{
  display:flex;
  align-items:center;
  gap:12px;
}
.siteLogo{
  height: 44px;
  width: auto;
  border-radius: 10px;
}
.siteBrandName{
  font-weight: 900;
  font-size: 18px;
}
.siteBrandTag{
  color: var(--muted);
  font-size: 12px;
}
.siteNav{
  display:flex;
  gap:12px;
  flex-wrap: wrap;
}
.siteMenuBtn{
  display:none;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.95);
  border-radius: 999px;
  padding: 8px 10px;
  cursor:pointer;
  box-shadow: 0 10px 24px rgba(16,24,40,0.12);
}
.siteMenuBtn span{
  display:block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
  border-radius: 2px;
  transition: transform 180ms ease, opacity 180ms ease;
}
.siteNavInner{
  display:flex;
  gap:12px;
  flex-wrap: wrap;
}
.siteNav a{
  text-decoration:none;
  color: var(--text);
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.siteNav a:hover{
  border-color: rgba(59,130,246,0.25);
  background: rgba(59,130,246,0.08);
}
body.isAuthed .siteHeader{ display:none; }

.topbar{
  position: static;
  z-index:10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:22px 22px;
  min-height: 140px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.65)),
    url("images/header.webp") center/cover no-repeat;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(16,24,40,0.06);
  transition: opacity 220ms ease, transform 220ms ease;
  will-change: opacity, transform;
}
.topbar.isHidden{
  opacity: 0;
  transform: translateY(-14px);
  pointer-events: none;
}

/* Ad bar + collapse */
.adBar{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 22px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
}
.adSlot{
  flex:1;
  display:flex;
  align-items:center;
  gap:12px;
  border: 1px dashed rgba(16,24,40,0.18);
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.65);
}
.adLabel{
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.adText{
  font-size: 12px;
  color: var(--muted);
}
.collapseBtn{
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(59,130,246,0.08);
  font-weight: 800;
  color: var(--text);
  cursor:pointer;
}
.collapseIcon{ font-size: 14px; }
.collapseText{ font-size: 12px; }
.collapseBtnSong{
  display:none;
}

.topbar, .brand, .topbar-actions{ overflow: visible; }
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  user-select:none;
}
.brandLogoChip{
  height: 96px;
  width: auto;
  max-width: 360px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 8px 14px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.12);
  flex: 0 0 auto;
}
.brand-logo{
  height: 100%;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  object-position: center;
  display:block;
  image-rendering: auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.18));
}
.brandText{ display:none; }
.brand-name{ display:none; }
.brand-tag{ display:none; }

.topbar-actions{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 46%;
}

.searchWrap{
  flex:1;
  display:flex;
  align-items:center;
  gap:10px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 10px 10px 14px;
  box-shadow: 0 10px 20px rgba(16,24,40,0.06);
}
.searchInput{
  width:100%;
  border:0;
  outline:0;
  background: transparent;
  font-size:14px;
  color: var(--text);
}

.tabs{
  display:flex;
  gap:8px;
  padding: 10px 16px 0 16px;
}
.tabs .primaryBtn{
  margin-left: auto;
}
.tab{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.65);
  padding:10px 12px;
  border-radius: 999px;
  cursor:pointer;
  color: var(--muted);
  font-weight:700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.tab.isActive{
  color: var(--text);
  border-color: rgba(59,130,246,0.28);
  background: rgba(59,130,246,0.10);
}
.tab:hover{ transform: translateY(-1px); }

.shell{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  padding: 14px 16px 30px 16px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 140px);
}
.shell.isSingleColumn{
  grid-template-columns: 1fr;
}

.side{
  display:block;
  position: sticky;
  top: 76px;
  height: fit-content;
}
.sideCard{
  background: rgba(255,255,255,0.75);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(16,24,40,0.08);
  padding: 14px;
  margin-bottom: 12px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.sideCard:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 46px rgba(16,24,40,0.10);
}
.sideCard.subtle{
  background: rgba(255,255,255,0.5);
}
.sideTitle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  font-weight:900;
  margin-bottom:10px;
}
.hint{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.hint code{
  background: rgba(59,130,246,0.10);
  border: 1px solid rgba(59,130,246,0.18);
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--text);
}
.hintSmall{ margin-top:8px; font-size:12px; opacity:0.9; }

.playlistList{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.playlistItem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--pl-color, #7DB2FF) 18%, #fff 82%), #fff);
  box-shadow: 0 10px 26px rgba(16,24,40,0.06);
}
.playlistItem.isSystem{
  border-color: color-mix(in srgb, var(--pl-color, #7DB2FF) 35%, var(--line));
}
.playlistItem strong{ font-size:14px; }
.playlistItem span{ color:var(--muted); font-size:12px; }
.playlistItem .row{
  display:flex; flex-direction:column;
}
.playlistItem .row2{
  display:flex; gap:8px; align-items:center;
}

.panel{
  background: rgba(255,255,255,0.78);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
  transition: box-shadow 200ms ease;
}
.panelHeader{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  padding: 18px 20px;
  border-bottom:1px solid var(--line);
}
.panelTitle{ font-weight: 900; font-size: 16px; }
.panelMeta{ color: var(--muted); font-size: 12px; }

.songList{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding: 10px 10px 12px 10px;
}
.songRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.80);
  cursor:pointer;
  box-shadow: 0 10px 26px rgba(16,24,40,0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.songRow:hover{
  background: rgba(59,130,246,0.06);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(16,24,40,0.10);
}
.songRow .left{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.songRow .title{ font-weight: 900; }
.songRow .artist{ color: var(--muted); font-size: 12px; }
.songRow .right{
  display:flex;
  align-items:center;
  gap:10px;
}

.emptyState{
  padding: 26px 16px;
  text-align:center;
}
.emptyTitle{ font-weight: 900; font-size: 18px; }
.emptyText{ color: var(--muted); margin-top: 6px; }

.songView{ padding-bottom: 8px; }
.songTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 16px;
  border-bottom:1px solid var(--line);
}
.songTopRight{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
}
.songTopRight .ghostBtn,
.songTopRight .iconBtn{
  white-space: nowrap;
}
.songTopMid{ text-align:center; flex:1; }
.songTitle{ font-weight: 1000; font-size: 18px; }
.songArtist{ color: var(--muted); font-size: 12px; margin-top:2px; }

.controls{
  display:flex;
  flex-wrap:wrap;
  gap: 14px;
  padding: 12px 16px;
  border-bottom:1px solid var(--line);
}
.ctrlGroup{ display:flex; flex-direction:column; gap:8px; min-width: 260px; }
.ctrlLabel{ color: var(--muted); font-size: 12px; font-weight: 800; }
.ctrlRow{ display:flex; align-items:center; gap:10px; }
.ctrlSpacer{ flex:1; }
.ctrlRow .ghostBtn{
  margin-left: 0;
}
.ctrlValue{
  padding: 8px 10px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.7);
  font-weight: 900;
}
.range{ width: 260px; }

.songTitleInline{
  text-align:center;
  padding: 12px 16px 6px 16px;
}
.songPaper{
  padding: 10px 16px 18px 16px;
}
.songBottomNav{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:12px;
  padding: 10px 16px 18px 16px;
}
.songContent{
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(16,24,40,0.10);
  padding: 18px 16px;

  /* ✅ viktigaste för UG-alignment */
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  tab-size: 4;
}

.line{
  font-size: 16px;
  line-height: 1.55;
  padding: 4px 0;
  white-space: pre-wrap;
}
.chord{
  display:inline-block;
  font-weight: 900;
  color: var(--brand);
  background: rgba(59,130,246,0.10);
  border: 1px solid rgba(59,130,246,0.18);
  padding: 0px 6px;
  border-radius: 10px;
  transform: translateY(-1px);
  margin-right: 2px;
}

/* Buttons */
.primaryBtn{
  border: 1px solid rgba(59,130,246,0.30);
  background: rgba(59,130,246,0.14);
  color: var(--text);
  font-weight: 900;
  padding: 10px 14px;
  border-radius: 999px;
  cursor:pointer;
  transition: transform 140ms ease, background 160ms ease, box-shadow 160ms ease;
}
.primaryBtn:hover{
  background: rgba(59,130,246,0.20);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(59,130,246,0.18);
}
.primaryBtn.small{ padding: 8px 12px; }

.ghostBtn{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.65);
  color: var(--text);
  font-weight: 900;
  padding: 10px 12px;
  border-radius: 999px;
  cursor:pointer;
  transition: transform 140ms ease, background 160ms ease;
}
.ghostBtn:hover{
  background: rgba(255,255,255,0.85);
  transform: translateY(-1px);
}
.ghostBtn.small{ padding: 8px 12px; }

.dangerBtn{
  border:1px solid rgba(239,68,68,0.30);
  background: rgba(239,68,68,0.10);
  color: var(--danger);
  font-weight: 900;
  padding: 10px 12px;
  border-radius: 999px;
  cursor:pointer;
}
.dangerBtn:hover{ background: rgba(239,68,68,0.14); }

.iconBtn{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.65);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  cursor:pointer;
  transition: transform 140ms ease, background 160ms ease;
}
.iconBtn.big{
  width: 44px; height: 44px;
  font-size: 18px;
}
.iconBtn:hover{ background: rgba(255,255,255,0.9); }

.miniBtn{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.65);
  border-radius: 999px;
  padding: 8px 10px;
  cursor:pointer;
  font-weight: 900;
  transition: transform 140ms ease, background 160ms ease;
}
.miniBtn:hover{
  background: rgba(255,255,255,0.9);
  transform: translateY(-1px);
}

.chipBtn{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.7);
  border-radius: 999px;
  padding: 8px 10px;
  cursor:pointer;
  font-weight: 900;
  transition: transform 140ms ease, background 160ms ease;
}
.chipBtn:hover{
  background: rgba(255,255,255,0.95);
  transform: translateY(-1px);
}
.subtleChip{
  color: var(--muted);
}

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  display:grid;
  place-items:center;
  background: rgba(16,24,40,0.35);
  padding: 18px;
  z-index: 50;
  animation: fadeIn 180ms ease;
}
.modalCard{
  width: min(760px, 100%);
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(16,24,40,0.24);
  overflow:hidden;
  animation: riseIn 200ms ease;
}
.modalHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.modalTitle{ font-weight: 1000; }
.modalFoot{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.modalFoot.center{
  justify-content:center;
}
.formGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 16px 14px 16px;
}
.field{ display:flex; flex-direction:column; gap:6px; }
.field span{ color: var(--muted); font-size: 12px; font-weight: 900; }
.field input, .field textarea{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.85);
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
}
.audioActions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap: wrap;
}
.audioStatus{
  font-size: 12px;
  color: var(--muted);
}
.toggleRow{
  display:flex;
  align-items:center;
  gap:8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
}
#trackPlayer{
  width: 260px;
  max-width: 100%;
  height: 36px;
}
.noTrackText{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}
.field textarea{ resize: vertical; min-height: 200px; }
.field input:focus, .field textarea:focus{
  border-color: rgba(59,130,246,0.35);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
}
.fieldFull{ grid-column: 1 / -1; }
.fieldHint{ color: var(--muted); font-size: 12px; margin-top:6px; }

.pickList{
  padding: 12px 16px 16px 16px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.pickRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.7);
}
.pickRow strong{ font-size:14px; }
.pickRow span{ color: var(--muted); font-size:12px; }

.isHidden{ display:none !important; }

/* Scene mode button only during song view */
body:not(.isSongView) #sceneModeBtn{
  display: none !important;
}

@keyframes fadeIn{
  from{ opacity: 0; }
  to{ opacity: 1; }
}
@keyframes riseIn{
  from{ transform: translateY(8px); opacity: 0.6; }
  to{ transform: translateY(0); opacity: 1; }
}

/* Auth */
.authBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(8px);
}
body.isAuthed .authBar{
  display:none;
}
.authStatus{
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
}
.authActions{
  display:flex;
  align-items:center;
  gap:10px;
}
.authForm{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap: wrap;
}
.authForm input{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.85);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  min-width: 160px;
  outline: none;
}
.authForm input:focus{
  border-color: rgba(59,130,246,0.35);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
}

.authGate{
  display:none;
  min-height: calc(100vh - 64px);
  padding: 40px 20px;
  gap: 24px;
  align-items:center;
  justify-content:center;
  grid-template-columns: 1.1fr 0.9fr;
  background:
    radial-gradient(900px 460px at 15% 10%, rgba(59,130,246,0.18), transparent 60%),
    radial-gradient(700px 360px at 85% 10%, rgba(34,197,94,0.12), transparent 55%),
    linear-gradient(145deg, rgba(255,255,255,0.65), rgba(240,248,255,0.9));
}
.authHero{
  max-width: 840px;
  text-align:left;
}
.authHero p{
  color: var(--muted);
  font-size: 18px;
  margin-top: 12px;
}
.authHeroImage{
  width: min(840px, 100%);
  height: auto;
  display:block;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(16,24,40,0.18);
}
.authGateCard{
  width: min(600px, 100%);
  margin: 0 auto;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(16,24,40,0.12);
  padding: 22px;
  text-align:left;
}
.authGateTitle{
  font-weight: 900;
  font-size: 22px;
}
.authGateText{
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
}
.authGateStatus{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.authFormCard{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top: 14px;
  align-items:flex-start;
}
.authField{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.authField span{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}
.authFormCard input{
  border-radius: 14px;
  min-width: 100%;
  padding: 12px 14px;
}
.authFormCard .primaryBtn,
.authFormCard .ghostBtn{
  width: 100%;
}

body:not(.isAuthed) .tabs,
body:not(.isAuthed) .shell{
  display:none;
}
body:not(.isAuthed) .adBar{
  display:flex;
}
body:not(.isAuthed) .authGate{
  display:grid;
}
body:not(.isAuthed) .authBar{
  display:none;
}
body:not(.isAuthed) .topbar{
  display:none;
}
body:not(.isAuthed) .bottomNav{
  display:none;
}
body:not(.isAuthed) .brand,
body:not(.isAuthed) .searchWrap,
body:not(.isAuthed) .authMini{
  display:none;
}
body.isAuthed .authBar{
  display:none;
}

/* Public content */
.publicContent{
  display:none;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 48px 20px;
}
body:not(.isAuthed) .publicContent{
  display:block;
}
.contentPage{
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 48px 20px;
}
.contentPage h1{
  font-size: 28px;
  margin: 0 0 10px 0;
}
.contentPage h2{
  margin-top: 22px;
}
.contentPage h3{
  margin-top: 16px;
}
.contentPage p{
  line-height: 1.6;
}
.contentPage .lead{
  color: var(--muted);
  font-size: 15px;
}
.contentHero{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items:start;
}
.contentCard{
  background: rgba(255,255,255,0.85);
  border:1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(16,24,40,0.08);
}
.contentSection{
  margin-top: 26px;
}
.contentGrid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}
.contentGrid article{
  background: rgba(255,255,255,0.7);
  border:1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.contentSteps{
  padding-left: 18px;
  line-height: 1.6;
}
.contentNote{
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

/* Collapsed app (between header and song title) */
body.isSongView.appCollapsed .tabs,
body.isSongView.appCollapsed .authBar,
body.isSongView.appCollapsed #playlistSide,
body.isSongView.appCollapsed #libraryPanel,
body.isSongView.appCollapsed .controls{
  display:none;
}
body.isSongView .collapseBtnSong{
  display:inline-flex;
}
body.isSongView.appCollapsed .songTopRight > *{
  display:none;
}
body.isSongView.appCollapsed .songTopRight .collapseBtnSong{
  display:inline-flex;
}


/* Chords */
.chordsPanel{
  padding-bottom: 12px;
}
.chordsControls{
  display:flex;
  gap:10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  align-items:center;
}
.chordSearchInput{
  min-width: 220px;
  flex: 1 1 220px;
}
.chordsControls .chipBtn.isActive{
  border-color: rgba(59,130,246,0.35);
  background: rgba(59,130,246,0.12);
  color: var(--text);
}
.chordsControls .chipBtn.isActive{
  background: rgba(59,130,246,0.14);
  border-color: rgba(59,130,246,0.30);
}
.chordsGrid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap:12px;
  padding: 14px 16px 18px 16px;
}
.chordCard{
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  text-align:center;
  box-shadow: 0 10px 26px rgba(16,24,40,0.06);
}
.chordCard h4{
  margin: 8px 0 0;
  font-size: 14px;
}
.chordSvg{
  width: 100%;
  height: auto;
}

/* Export menu */
.exportWrap{ position: relative; }
.exportMenu{
  position: absolute;
  right: 0;
  top: 44px;
  display:flex;
  flex-direction:column;
  gap:6px;
  padding: 8px;
  background: rgba(255,255,255,0.98);
  border:1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(16,24,40,0.14);
  z-index: 20;
}
.exportMenu .ghostBtn{ width: 120px; }
.editWrap{ position: relative; }

/* Footer */
.pageFooter{
  margin-top: 40px;
  padding: 40px 16px 60px 16px;
  background:
    linear-gradient(180deg, rgba(246,247,251,0) 0%, rgba(246,247,251,1) 60%),
    url("images/footer.webp") center/cover no-repeat;
  border-top: 1px solid var(--line);
}
.footerInner{
  max-width: 1200px;
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 16px;
  padding: 22px 20px;
  backdrop-filter: blur(6px);
}
.footerLinks{
  display:flex;
  gap:12px;
  align-items:center;
}
.footerLink{
  border:0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor:pointer;
}
.footerLink:hover{
  color: var(--text);
}
.footerContact{
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.footerContact a{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.footerContact a:hover{
  border-bottom-color: rgba(0,0,0,0.25);
}

.legalBody{
  padding: 12px 16px 4px 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
}

/* Bottom nav (mobile) */
.bottomNav{
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: none;
  gap: 10px;
  align-items:center;
  justify-content:space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(16,24,40,0.16);
  z-index: 60;
}
.bottomNavBtn{
  flex:1;
  border:0;
  background: transparent;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  padding: 8px 6px;
  font-weight: 800;
  color: var(--muted);
  cursor:pointer;
}
.bottomNavBtn span{
  font-size: 12px;
}
.bottomNavBtn.isActive{
  color: var(--text);
  background: rgba(59,130,246,0.10);
  border-radius: 12px;
}

body.isSongView .bottomNav{ display:none; }

@media (max-width: 720px){
  .shell{ grid-template-columns: 1fr; padding: 0; }
  .topbar-actions{ min-width: 0; width:100%; }
  .side{ order: 2; }
  .tabs{ display:none; }
  .bottomNav{ display:flex; }
  .shell{ padding-bottom: 90px; }
  .topbar{
    min-height: 140px;
    padding: 18px 16px;
    flex-direction:column;
    align-items:flex-start;
    gap:12px;
  }
  .brand{ width: 100%; justify-content:flex-start; }
  .brandLogoChip{ height: 84px; max-width: 320px; }
  .topbar-actions{
    width: 100%;
    justify-content:space-between;
  }
  .panel{
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .panelHeader{ padding: 14px 16px; }
  .songList{ padding: 0; }
  .songRow{
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }
  .songPaper{ padding: 0; }
  .songContent{
    max-width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 0 8px;
  }
  .line{ padding: 6px 0; }
  .footerInner{
    flex-direction:column;
    align-items:flex-start;
  }
}

@media (max-width: 480px){
  .brandLogoChip{ height: 72px; max-width: 260px; border-radius: 14px; }
}

@media (max-width: 900px){
  .authGate{
    grid-template-columns: 1fr;
    padding: 28px 16px;
  }
  .authHero{
    text-align:center;
  }
  .authHeroImage{
    margin: 0 auto;
    max-width: 640px;
  }
  .contentHero{
    grid-template-columns: 1fr;
  }
  .contentGrid{
    grid-template-columns: 1fr;
  }
  .siteMenuBtn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
  }
  .siteNav{
    position: relative;
  }
  .siteNavInner{
    display:none;
    position:absolute;
    right:0;
    top: 44px;
    background: rgba(255,255,255,0.98);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    flex-direction:column;
    gap:8px;
    min-width: 200px;
    box-shadow: 0 14px 34px rgba(16,24,40,0.12);
    z-index: 20;
  }
.siteNav.isOpen .siteNavInner{
    display:flex;
  }
  .siteMenuBtn[aria-expanded="true"] span:nth-child(1){
    transform: translateY(6px) rotate(45deg);
  }
  .siteMenuBtn[aria-expanded="true"] span:nth-child(2){
    opacity: 0;
  }
  .siteMenuBtn[aria-expanded="true"] span:nth-child(3){
    transform: translateY(-6px) rotate(-45deg);
  }
  .collapseBtn{
    padding: 6px 10px;
  }
}

/* === Fullbredd-läge när man tittar på en låt === */
body.isSongView .shell{
  grid-template-columns: 1fr;
}

body.isSongView .side{
  display: none !important;
}

body.isSongView .songView{
  grid-column: 1 / -1;
}

body.isSongView .topbar-actions{
  min-width: 0;
}

/* Chords view cleanup */
body.isChords .shell{
  grid-template-columns: 1fr;
}
body.isChords #libraryPanel,
body.isChords #playlistSide{
  display: none !important;
}

/* === Textstorlek (styr via JS) === */
:root{
  --lyrics-size: 16px;
  --chord-size: 0.95em;
}

.songContent .line{
  font-size: var(--lyrics-size);
}

.songContent .chord{
  font-size: var(--chord-size);
}

@media (min-width: 1200px){
  .songContent{
    max-width: 1100px;
  }
}

/* === Mörkt scenläge === */
body.theme-dark{
  --bg: #070A12;
  --paper: #0b1020;
  --text: rgba(255,255,255,0.95);
  --muted: rgba(255,255,255,0.70);
  --line: rgba(255,255,255,0.12);

  --shadow: 0 18px 55px rgba(0,0,0,0.55);
}

body.theme-dark .topbar{
  background: rgba(7,10,18,0.72);
}

body.theme-dark .tab{
  background: rgba(255,255,255,0.06);
}

body.theme-dark .panel,
body.theme-dark .sideCard{
  background: rgba(11,16,32,0.72);
}

body.theme-dark .searchWrap,
body.theme-dark .ghostBtn,
body.theme-dark .iconBtn,
body.theme-dark .miniBtn,
body.theme-dark .chipBtn,
body.theme-dark .ctrlValue{
  background: rgba(255,255,255,0.06);
}

body.theme-dark .songContent{
  background: rgba(11,16,32,0.92);
}

body.theme-dark .chord{
  background: rgba(59,130,246,0.16);
  border-color: rgba(59,130,246,0.25);
}

body.theme-dark .authBar{
  background: rgba(7,10,18,0.72);
}
body.theme-dark .authForm input,
body.theme-dark .authGateCard{
  background: rgba(11,16,32,0.72);
}

/* === Print/PDF (printvänligt) === */
@media print{
  body{
    background: #fff !important;
  }
  .topbar, .tabs, .side, .controls, .songTopRight, #backBtn{
    display: none !important;
  }
  .shell{
    max-width: none !important;
    padding: 0 !important;
  }
  .panel{
    box-shadow: none !important;
    border: none !important;
  }
  .songContent{
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
  .chord{
    border: 1px solid #ddd !important;
    background: #f3f7ff !important;
    color: #111 !important;
  }
}

/* Ackord som "badge" (för [C]text-läge) */
.chord.chordBadge{
  display:inline-block;
  font-weight: 900;
  color: var(--brand);
  background: rgba(59,130,246,0.10);
  border: 1px solid rgba(59,130,246,0.18);
  padding: 0px 6px;              /* badge-look */
  border-radius: 10px;
  transform: translateY(-1px);
  margin-right: 2px;
}

/* Ackord i UG-linjer: INGEN padding/border (för att inte flytta position) */
.chord.chordPlain{
  font-weight: 900;
  color: var(--brand);
  background: transparent;
  border: 0;
  padding: 0;                    /* ✅ kritiskt */
  margin: 0;                     /* ✅ kritiskt */
  border-radius: 0;
  transform: none;
  text-decoration: underline;    /* tydlig skillnad utan width-ändring */
  text-underline-offset: 2px;
}
.authMini{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
}
.authMiniStatus{
  color: #16a34a;
  font-weight: 800;
  font-size: 13px;
}
.authMiniLogout{
  border:0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor:pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.authMiniLogout:hover{
  color: var(--text);
}
