:root {
  --navy: #003660;
  --navy-2: #0a446d;
  --cyan: #13c9e8;
  --cyan-soft: #e9faff;
  --green: #0b9b55;
  --green-soft: #e9f8f0;
  --gold: #f5b800;
  --ink: #172535;
  --muted: #637386;
  --line: #dce5ed;
  --panel: #ffffff;
  --page: #f4f7fa;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow: 0 14px 34px rgba(7, 46, 78, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.5;
}

a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

.site-header {
  background: linear-gradient(135deg, #03233c 0%, var(--navy) 58%, #0a4d74 100%);
  color: white;
  border-bottom: 4px solid var(--cyan);
  box-shadow: 0 10px 30px rgba(4, 42, 70, .18);
}
.header-inner {
  min-height: 116px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  min-width: 0;
}
.brand img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.2));
}
.brand h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.3rem); line-height: 1.1; }
.brand p { margin: 6px 0 0; color: #d7edf8; }
.version { white-space: nowrap; }
.top-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* Samma diskreta disclaimerstil som BadgePrinter */
.header-disclaimer {
  margin-top: -2px;
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 10px;
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.94);
  font-size: .88rem;
  line-height: 1.45;
}
.header-disclaimer strong { color: #fff; }
.header-disclaimer a {
  color: #fff;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.header-disclaimer a:hover { color: #d9efff; }



/* BadgeProgress – introduktion */
.intro-card {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr);
  gap: 30px;
  align-items: start;
  border-top: 4px solid var(--cyan);
  background:
    radial-gradient(circle at 100% 0, rgba(19,201,232,.10), transparent 36%),
    linear-gradient(135deg, #ffffff 0%, #f8fcfe 100%);
}
.intro-card-copy h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
  color: var(--navy);
}
.intro-card-copy > p:not(.eyebrow) {
  margin: 0 0 10px;
  color: #425669;
  line-height: 1.6;
}
.intro-card-copy > p:last-child { margin-bottom: 0; }
.intro-card-note {
  font-weight: 750;
  color: var(--navy-2) !important;
}
.intro-steps {
  padding: 18px;
  border: 1px solid #d4e7ef;
  border-radius: 14px;
  background: rgba(255,255,255,.86);
}
.intro-steps > strong {
  display: block;
  margin-bottom: 12px;
  color: var(--navy);
  font-size: 1rem;
}
.intro-steps ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 11px;
}
.intro-steps li {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  gap: 10px;
  align-items: start;
}
.intro-steps li > span {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--navy);
  color: white;
  font-size: .82rem;
  font-weight: 850;
}
.intro-steps b {
  display: block;
  color: #23384b;
  font-size: .92rem;
}
.intro-steps small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.4;
  font-size: .82rem;
}
@media (max-width: 820px) {
  .intro-card { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 580px) {
  .intro-steps { padding: 15px; }
}

.main-grid { display: grid; gap: 20px; padding-block: 28px 38px; }
.card, .notice {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 24px; }
.notice { padding: 20px 22px; }
.notice-local {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  border-left: 5px solid var(--cyan);
  background: linear-gradient(90deg, #f3fcff 0, white 50%);
}
.notice-icon { font-size: 2rem; }
.notice h2 { margin: 0 0 4px; font-size: 1.08rem; }
.notice p { margin: 0; color: var(--muted); }
.notice-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 1.35rem; }
.eyebrow { margin: 0 0 3px; color: var(--navy-2); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; }
.section-intro { margin: -8px 0 20px; color: var(--muted); }
.counter, .save-state, .status-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 750;
  white-space: nowrap;
}
.counter { background: #eef3f7; color: #526577; }
.save-state { background: var(--green-soft); color: #087540; }
.status-pill { background: var(--cyan-soft); color: #096785; }
.status-pill.error { background: var(--danger-soft); color: var(--danger); }

.field { display: grid; gap: 7px; min-width: 0; }
.field > span { font-size: .83rem; color: #405164; font-weight: 750; }
input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c8d5df;
  border-radius: 11px;
  padding: 9px 12px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, select:focus { border-color: #37afd0; box-shadow: 0 0 0 4px rgba(19,201,232,.13); }
.hint { margin: 10px 0 0; color: var(--muted); font-size: .88rem; }
.inline-form { display: flex; gap: 12px; align-items: end; }
.grow { flex: 1; }

.btn {
  min-height: 42px;
  border-radius: 11px;
  border: 1px solid transparent;
  padding: 9px 14px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: white; box-shadow: 0 6px 15px rgba(6,47,80,.18); }
.btn-primary:hover { background: #08416a; }
.btn-secondary { background: var(--cyan-soft); border-color: #aee8f3; color: #065f7b; }
.btn-ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); color: white; }
.card .btn-ghost { color: var(--navy); background: #f3f7fa; border-color: #d9e3eb; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #ffd3cf; }
.btn-small { min-height: 34px; padding: 6px 10px; font-size: .82rem; }
.icon-btn { border: 0; background: #edf3f7; width: 38px; height: 38px; border-radius: 50%; font-size: 1.45rem; color: #3e5367; }

.people-list { display: grid; gap: 9px; margin-top: 18px; }
.person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fbfdfe;
}
.person-name { font-weight: 800; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-state { color: var(--muted); border: 1px dashed #c8d5df; border-radius: 12px; padding: 18px; background: #fbfdfe; }

.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 12px; margin-bottom: 18px; }
.badge-loading { min-height: 130px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid #d7eef4; border-top-color: var(--cyan); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge-detail {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 22px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(135deg, #fff 60%, #f3fbfe);
}
.badge-detail img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: #f7fafc; }
.badge-detail h3 { margin: 0 0 8px; font-size: 1.45rem; }
.badge-pills { display: flex; gap: 7px; flex-wrap: wrap; margin: 0 0 12px; }
.pill { background: #edf4f8; color: #395268; border-radius: 999px; padding: 5px 9px; font-size: .78rem; font-weight: 750; }
.badge-text { color: #475c70; margin: 0 0 12px; }
.requirements { margin: 8px 0 0; padding-left: 20px; color: #394e62; }
.requirements li + li { margin-top: 5px; }
.badge-source { margin-top: 12px; font-size: .86rem; color: var(--muted); }
.badge-source a { color: #0b6e91; font-weight: 700; }

.activity-form { display: grid; gap: 16px; }
.form-row { display: grid; gap: 14px; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.span-2 { grid-column: span 2; }
.participant-checks { min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.participant-option { position: relative; }
.participant-option input { position: absolute; opacity: 0; pointer-events: none; }
.participant-option span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #cbd9e3;
  border-radius: 999px;
  padding: 8px 11px;
  background: white;
  font-size: .88rem;
  font-weight: 750;
  color: #405568;
  cursor: pointer;
}
.participant-option input:checked + span { background: var(--green-soft); color: #087540; border-color: #7fd0a8; box-shadow: inset 0 0 0 1px #7fd0a8; }
.participant-option input:checked + span::before { content: "✓"; font-weight: 900; }
.empty-checks { color: var(--muted); font-size: .9rem; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.edit-indicator { color: #8a5b00; background: #fff7db; padding: 7px 10px; border-radius: 999px; font-size: .83rem; font-weight: 750; }

.progress-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 13px; }
.progress-person { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fbfdfe; }
.progress-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.progress-top h3 { margin: 0; font-size: 1.05rem; }
.progress-km { font-weight: 850; color: var(--navy); }
.progress-track { height: 12px; border-radius: 999px; overflow: hidden; background: #e5edf2; margin: 11px 0 8px; }
.progress-fill { height: 100%; min-width: 0; border-radius: inherit; background: linear-gradient(90deg, #13c9e8, #0b9b55); }
.progress-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .82rem; margin-bottom: 12px; }

.activity-list { display: grid; gap: 10px; }
.activity-item { display: grid; grid-template-columns: 130px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; background: #fbfdfe; }
.activity-date { font-weight: 800; color: #3e5366; }
.activity-main h3 { margin: 0 0 2px; font-size: 1rem; }
.activity-main p { margin: 0; color: var(--muted); font-size: .88rem; }
.activity-distance { color: var(--navy); font-weight: 900; }
.activity-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.person-dialog { width: min(720px, calc(100% - 28px)); border: 0; border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px rgba(4, 35, 59, .28); }
.person-dialog::backdrop { background: rgba(2, 24, 41, .55); backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 18px; }
.dialog-head h2 { margin: 0; }
.dialog-summary-card { margin: 18px 0; padding: 16px; border-radius: 14px; background: #f3fbfd; border: 1px solid #d4edf3; }
.dialog-history { display: grid; gap: 8px; }
.dialog-history-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid #e3eaf0; }
.dialog-history-row:last-child { border-bottom: 0; }

.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100% - 40px)); background: #142f45; color: white; padding: 12px 15px; border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,.22); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translateY(0); }

.site-footer { border-top: 1px solid #d9e3ea; color: #667789; background: #eef3f6; text-align: center; font-size: .85rem; padding: 18px 0; }
.site-footer a { color: var(--navy-2); font-weight: 700; text-decoration: none; }

@media (max-width: 820px) {
  .header-inner { align-items: flex-start; flex-direction: column; }
  .top-links { width: 100%; justify-content: flex-start; }
  .notice-local { grid-template-columns: auto 1fr; }
  .notice-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .form-row-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .activity-item { grid-template-columns: 1fr auto; }
  .activity-date { grid-column: 1 / -1; }
  .activity-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 580px) {
  .header-disclaimer { margin-top: -2px; margin-bottom: 14px; padding: 10px 12px; font-size: .82rem; }
  .shell { width: min(100% - 20px, 1180px); }
  .brand img { width: 68px; height: 68px; }
  .brand p { font-size: .88rem; }
  .card { padding: 18px; }
  .notice { padding: 16px; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .filters { grid-template-columns: 1fr; }
  .badge-detail { grid-template-columns: 1fr; }
  .badge-detail img { width: 140px; margin-inline: auto; }
  .section-head { align-items: flex-start; }
  .progress-list { grid-template-columns: 1fr; }
  .dialog-history-row { grid-template-columns: 1fr auto; }
  .dialog-history-row > :first-child { grid-column: 1 / -1; }
}

/* BadgeProgress 0.2.2 */
.badge-picker { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; margin-bottom:18px; }
.badge-picker.badge-loading { display:grid; grid-template-columns:1fr; }
.badge-choice { display:grid; grid-template-columns:70px 1fr; gap:12px; align-items:center; width:100%; padding:12px; border:1px solid var(--line); border-radius:14px; background:#fbfdfe; text-align:left; cursor:pointer; color:var(--ink); }
.badge-choice:hover { border-color:#85cddd; background:#f5fcfe; }
.badge-choice.active { border-color:#16b9d7; box-shadow:0 0 0 3px rgba(19,201,232,.12); background:#f1fbfe; }
.badge-choice img { width:70px; height:70px; object-fit:contain; border-radius:10px; background:#f4f7f9; }
.badge-choice strong { display:block; font-size:1rem; margin-bottom:4px; }
.badge-choice small { color:var(--muted); line-height:1.35; }
.model-pill { display:inline-flex; align-items:center; padding:7px 11px; border-radius:999px; background:#eef6ff; color:#315f91; font-size:.82rem; font-weight:800; }
.badge-overview { display:grid; gap:12px; }
.badge-overview:not(.empty-state) { grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); }
.overview-badge { border:1px solid var(--line); border-radius:14px; padding:15px; background:#fbfdfe; }
.overview-badge-head { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.overview-badge-head img { width:48px; height:48px; object-fit:contain; border-radius:9px; background:#f4f7f9; }
.overview-badge-head h3 { margin:0; font-size:1rem; }
.status-columns { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.status-box { border-radius:11px; padding:10px; min-height:82px; }
.status-box.started { background:#fff8e7; border:1px solid #f2d99d; }
.status-box.done { background:var(--green-soft); border:1px solid #a8ddc1; }
.status-box strong { display:block; font-size:.78rem; text-transform:uppercase; letter-spacing:.05em; margin-bottom:6px; }
.status-box p { margin:0; color:#4f6376; font-size:.86rem; line-height:1.4; }
.tracker-intro { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.tracker-intro p { margin:0; color:var(--muted); }
.checklist-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:14px; }
.checklist-table { width:100%; min-width:620px; border-collapse:collapse; background:white; }
.checklist-table th,.checklist-table td { padding:11px 10px; border-bottom:1px solid #e5edf2; text-align:center; vertical-align:middle; }
.checklist-table th { background:#f5f9fb; color:#3c5165; font-size:.83rem; }
.checklist-table th:first-child,.checklist-table td:first-child { text-align:left; min-width:320px; }
.checklist-table tr:last-child td { border-bottom:0; }
.check-cell input { width:24px; min-height:24px; height:24px; accent-color:#0b9b55; cursor:pointer; }
.requirement-number { display:inline-flex; width:25px; height:25px; border-radius:50%; align-items:center; justify-content:center; background:#edf4f8; color:#3e5a70; font-weight:850; font-size:.78rem; margin-right:7px; }
.requirement-text { color:#374f63; line-height:1.4; }
.checklist-person-summary { display:flex; flex-wrap:wrap; gap:8px; margin-top:13px; }
.person-status-chip { display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:7px 10px; font-size:.82rem; font-weight:800; background:#edf3f7; color:#526577; border:0; cursor:pointer; }
.person-status-chip.started { background:#fff5d6; color:#8a5b00; }
.person-status-chip.done { background:var(--green-soft); color:#087540; }
.progress-complete .progress-fill { background:linear-gradient(90deg,#0b9b55,#3fbf77); }
.badge-status-label { font-size:.78rem; font-weight:850; border-radius:999px; padding:5px 8px; background:#edf3f7; color:#526577; white-space:nowrap; }
.badge-status-label.started { background:#fff5d6; color:#8a5b00; }
.badge-status-label.done { background:var(--green-soft); color:#087540; }
.person-badge-list { display:grid; gap:10px; margin:16px 0; }
.person-badge-row { width:100%; border:1px solid var(--line); border-radius:12px; padding:12px; background:#fbfdfe; color:inherit; font:inherit; text-align:left; cursor:pointer; transition:border-color .15s ease, box-shadow .15s ease, transform .12s ease, background .15s ease; }
.person-badge-row:hover { border-color:#8fcfe0; background:#f4fbfd; transform:translateY(-1px); box-shadow:0 5px 14px rgba(6,47,80,.08); }
.person-badge-row:focus-visible { outline:3px solid rgba(19,201,232,.28); outline-offset:2px; border-color:#37afd0; }
.person-badge-row-head { display:flex; justify-content:space-between; gap:10px; align-items:center; margin-bottom:6px; }
.person-badge-row-head strong { color:var(--navy); }
.person-badge-row p { margin:0; color:var(--muted); font-size:.88rem; }
.dialog-form { margin-top:18px; }
.activity-item .badge-mini { display:inline-flex; border-radius:999px; padding:3px 7px; background:#edf4f8; color:#486278; font-size:.74rem; font-weight:800; margin-left:6px; }
@media (max-width:580px) { .status-columns{grid-template-columns:1fr}.badge-choice{grid-template-columns:58px 1fr}.badge-choice img{width:58px;height:58px} }

/* BadgeProgress 0.3.0 */
.compatible-badges-field { margin-top: 2px; }
.compatible-badges-field > span { display:block; font-weight:800; color:var(--navy); margin-bottom:8px; }
.compatible-badges-field .hint { display:block; margin-top:8px; }
.compatible-option span { background:#f7fbfd; }
.activity-main .badge-mini { max-width:100%; white-space:normal; line-height:1.25; }

/* BadgeProgress 0.4.0 */
.section-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.dialog-head-actions { display:flex; align-items:center; gap:8px; }
.btn:disabled { opacity:.5; cursor:not-allowed; transform:none; box-shadow:none; }

.calendar-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:14px; background:white; }
.calendar-table { width:100%; min-width:900px; border-collapse:collapse; }
.calendar-table th,
.calendar-table td { padding:10px 8px; border-bottom:1px solid #e5edf2; text-align:center; vertical-align:middle; }
.calendar-table thead th { background:#f5f9fb; color:#3c5165; font-size:.8rem; }
.calendar-table th:first-child { text-align:left; min-width:150px; }
.calendar-table tbody th { text-align:left; color:var(--navy); background:#fbfdfe; }
.calendar-table tbody th small { display:block; color:var(--muted); font-weight:650; margin-top:2px; }
.calendar-table tr:last-child td,
.calendar-table tr:last-child th { border-bottom:0; }
.month-cell span { display:inline-grid; place-items:center; width:30px; height:30px; border-radius:50%; background:#edf3f7; color:#8796a4; font-weight:900; }
.month-cell.complete span { background:var(--green-soft); color:#087540; box-shadow:inset 0 0 0 1px #a8ddc1; }
.calendar-extra { margin-top:20px; }
.calendar-extra h3 { margin:0 0 3px; color:var(--navy); }
.calendar-extra .hint { margin:0 0 12px; }
.calendar-extra-table { min-width:680px; }


#printRoot { display:none; }

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  html, body { background:#fff !important; color:#111 !important; }
  body > *:not(#printRoot) { display:none !important; }
  #printRoot { display:block !important; }
  .print-report { font-family:Arial, Helvetica, sans-serif; font-size:9.5pt; color:#111; }
  .print-header { display:flex; align-items:center; gap:12px; border-bottom:2px solid #003660; padding-bottom:8px; margin-bottom:12px; }
  .print-header img { width:54px; height:54px; object-fit:contain; }
  .print-header h1 { margin:0; font-size:18pt; color:#003660; }
  .print-header p { margin:3px 0 0; color:#555; font-size:8.5pt; }
  .print-section { margin:0 0 16px; break-inside:avoid-page; }
  .print-section h2 { margin:12px 0 6px; font-size:12pt; color:#003660; }
  .print-table { width:100%; border-collapse:collapse; table-layout:auto; }
  .print-table th,
  .print-table td { border:1px solid #9aa7b2; padding:5px 6px; vertical-align:top; }
  .print-table thead th { background:#eaf2f7 !important; color:#003660; font-weight:700; }
  .print-table tbody th { text-align:left; background:#f5f7f9 !important; }
  .print-table small { display:block; margin-top:2px; color:#555; font-size:7.5pt; }
  .print-center { text-align:center; font-size:12pt; font-weight:700; }
  .print-group-table { font-size:8pt; }
  .print-group-table th,
  .print-group-table td { padding:4px; }
  .print-calendar { font-size:8pt; }
  .print-calendar th,
  .print-calendar td { padding:4px; }
  .print-checklist { font-size:8pt; }
}

@media print { .header-disclaimer { display: none !important; } }

/* BadgeProgress 0.9.0 */
.badge-detail-nav {
  display:flex;
  justify-content:flex-end;
  margin:0 0 10px;
  scroll-margin-top:16px;
}
.overview-badge-button {
  width:100%;
  color:inherit;
  font:inherit;
  text-align:left;
  cursor:pointer;
  transition:border-color .15s ease, box-shadow .15s ease, transform .12s ease, background .15s ease;
}
.overview-badge-button:hover {
  border-color:#85cddd;
  background:#f5fcfe;
  box-shadow:0 8px 22px rgba(6,47,80,.08);
  transform:translateY(-1px);
}
.overview-badge-button:focus-visible {
  outline:3px solid rgba(19,201,232,.28);
  outline-offset:2px;
}
.overview-open-hint {
  display:block;
  margin-top:10px;
  color:#0b7693;
  font-size:.8rem;
  font-weight:800;
}
#badges-heading { scroll-margin-top:18px; }
.status-pill { white-space:normal; text-align:right; line-height:1.35; justify-content:center; }
@media (max-width:580px) { .status-pill { text-align:left; } }

/* BadgeProgress 0.10.0 – delade grupper */
.notice-shared {
  border-left-color:#0b9b55;
  background:linear-gradient(90deg,#f2fbf6 0,white 50%);
}
.sharing-card { border-top:4px solid #0b7693; }
.sharing-panel { display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap; }
.sharing-panel > div:first-child { flex:1 1 420px; }
.sharing-panel p { margin:5px 0 0; }
.sharing-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.storage-mode-pill {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:76px; padding:7px 12px; border-radius:999px;
  font-size:.82rem; font-weight:850;
}
.storage-mode-pill.local { background:#edf3f7; color:#526577; }
.storage-mode-pill.shared { background:var(--green-soft); color:#087540; }
.shared-panel { align-items:flex-end; }
.shared-info { display:flex; gap:26px; flex:1 1 380px; flex-wrap:wrap; }
.shared-info > div { display:grid; gap:3px; }
.shared-label { font-size:.75rem; color:var(--muted); font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.shared-code { font-size:1.18rem; color:var(--navy); letter-spacing:.12em; }
.sync-error { color:var(--danger); }
.share-dialog { width:min(650px,calc(100% - 28px)); }
.form-row-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.check-option {
  display:flex; gap:10px; align-items:flex-start; padding:12px 13px;
  border:1px solid var(--line); border-radius:12px; background:#f8fbfd;
  color:#334b60; font-weight:700; cursor:pointer;
}
.check-option input { width:20px; min-width:20px; height:20px; margin-top:1px; accent-color:#0b9b55; }
.share-current-option { margin-top:12px; }
.share-dialog .hint { margin:12px 0 0; }
.share-dialog .form-actions { margin-top:18px; }
@media (max-width:700px) {
  .sharing-panel { align-items:stretch; }
  .sharing-actions { width:100%; }
  .sharing-actions .btn { flex:1 1 auto; }
  .form-row-2 { grid-template-columns:1fr; }
  .shared-info { gap:14px; }
}

/* Ledarprofiler och signerad progress */
.leader-dialog { width: min(760px, calc(100% - 28px)); }
.leader-intro { margin-top: 14px; }
.leader-choices { display: grid; gap: 9px; margin: 18px 0; }
.leader-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 8px;
  background: #fbfdfe;
}
.leader-row.current { border-color: #7fd0a8; background: var(--green-soft); }
.leader-choice-main {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 7px 9px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.leader-choice-main:hover { background: rgba(19,201,232,.08); }
.leader-choice-main > span:last-child { display: grid; gap: 2px; }
.leader-choice-main strong { font-size: 1rem; }
.leader-choice-main small { color: var(--muted); }
.leader-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--navy);
  color: white;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .04em;
}
.leader-add-form { display: flex; align-items: end; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.inactive-leader-section { margin-top: 20px; }
.inactive-leader-section h3 { margin: 0 0 10px; font-size: 1rem; }
.inactive-leader-list { display: grid; gap: 7px; }
.inactive-leader-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; background: #f4f7fa; color: var(--muted); }
.leader-history-list { display: grid; gap: 0; margin-top: 16px; max-height: 62vh; overflow: auto; }
.leader-history-row { display: grid; grid-template-columns: 155px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.leader-history-row:last-child { border-bottom: 0; }
.leader-history-row strong { color: var(--navy); }
.leader-history-row p { margin: 2px 0 0; color: #405568; }
.leader-history-time { color: var(--muted); font-size: .83rem; }
.check-cell-inner { display: grid; justify-items: center; gap: 4px; }
.check-meta { display: grid; max-width: 92px; color: #2e5367; font-size: .68rem; line-height: 1.15; overflow-wrap: anywhere; }
.check-meta small { color: var(--muted); font-size: .64rem; }
.activity-leader { margin-top: 3px !important; color: #426278 !important; font-size: .78rem !important; font-weight: 650; }

@media (max-width: 650px) {
  .leader-row { grid-template-columns: 1fr; }
  .leader-row > .btn { width: 100%; }
  .leader-add-form { align-items: stretch; flex-direction: column; }
  .leader-history-row { grid-template-columns: 1fr; gap: 2px; }
}

/* v0.11.1 – stora grupper: håll breda progress-tabeller inom sitt eget kort */
.main-grid > *,
.card,
.notice,
.people-card,
.overview-card,
.badge-card,
.tracker-card,
.history-card,
#trackerContent,
.people-list,
.person-row,
.badge-overview,
.badge-picker {
  min-width: 0;
  max-width: 100%;
}

.checklist-wrap,
.calendar-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

/* Tabellen får gärna bli bred när många scouter finns – men bara inne i sin scrollruta. */
.checklist-table {
  width: max-content;
  min-width: 100%;
}

.person-row > .person-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.row-actions {
  min-width: 0;
  justify-content: flex-end;
}

/* BadgeProgress 0.12.0 – stora grupper och pausade medlemmar */
.people-head-actions {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.btn-pause {
  background:#fff7df;
  color:#7a5700;
  border:1px solid #efd58d;
}
.btn-pause:hover { background:#ffefbc; }

.paused-people-list { display:grid; gap:9px; margin-top:16px; }
.paused-person-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 13px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fbfdfe;
}
.paused-person-row strong { display:block; color:var(--navy); }
.paused-person-row small { display:block; margin-top:3px; color:var(--muted); }

/* Kravkolumnen står still medan endast deltagarna scrollas i sidled. */
.checklist-table {
  border-collapse:separate;
  border-spacing:0;
}
.checklist-table th:first-child,
.checklist-table td:first-child {
  position:sticky;
  left:0;
  width:280px;
  min-width:280px;
  max-width:280px;
  white-space:normal;
  overflow-wrap:anywhere;
  z-index:2;
  box-shadow:8px 0 12px -12px rgba(6,47,80,.7);
}
.checklist-table thead th:first-child {
  z-index:4;
  background:#f5f9fb;
}
.checklist-table tbody td:first-child {
  background:#fff;
}
.checklist-table th:not(:first-child),
.checklist-table td:not(:first-child) {
  width:72px;
  min-width:72px;
  max-width:72px;
  overflow-wrap:anywhere;
}
.checklist-table th:not(:first-child) { line-height:1.15; }
.check-meta { max-width:68px; }

@media (max-width: 720px) {
  .checklist-table th:first-child,
  .checklist-table td:first-child {
    width:220px;
    min-width:220px;
    max-width:220px;
  }
  .paused-person-row { align-items:stretch; flex-direction:column; }
}

@media print {
  /* Checklistor med många deltagare delas i grupper om högst tio per utskriftssida. */
  .print-badge-page {
    break-after:page;
    page-break-after:always;
  }
  .print-badge-page:last-child {
    break-after:auto;
    page-break-after:auto;
  }
  .print-badge-page .print-section {
    break-inside:auto;
    page-break-inside:auto;
    margin-bottom:0;
  }
  .print-checklist {
    table-layout:fixed;
    font-size:8.5pt;
  }
  .print-checklist .print-requirement-col {
    width:38%;
    text-align:left;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .print-checklist .print-person-col {
    text-align:center;
    white-space:normal;
    overflow-wrap:anywhere;
    font-size:7.5pt;
    line-height:1.05;
  }
  .print-checklist th,
  .print-checklist td {
    padding:5px 4px;
  }
}

/* BadgeProgress 0.13.0 – adaptiv checklistlayout och sidindelad grupputskrift */
.checklist-wrap:not(.is-overflowing) .checklist-table {
  width:100%;
  min-width:0;
  table-layout:fixed;
}
.checklist-wrap:not(.is-overflowing) .checklist-table th:first-child,
.checklist-wrap:not(.is-overflowing) .checklist-table td:first-child {
  position:static;
  width:30%;
  min-width:0;
  max-width:none;
  box-shadow:none;
}
.checklist-wrap:not(.is-overflowing) .checklist-table th:not(:first-child),
.checklist-wrap:not(.is-overflowing) .checklist-table td:not(:first-child) {
  width:auto;
  min-width:0;
  max-width:none;
}

.checklist-wrap.is-overflowing .checklist-table {
  width:max-content;
  min-width:100%;
  table-layout:auto;
}
.checklist-wrap.is-overflowing .checklist-table th:first-child,
.checklist-wrap.is-overflowing .checklist-table td:first-child {
  position:sticky;
  left:0;
  width:280px;
  min-width:280px;
  max-width:280px;
  white-space:normal;
  overflow-wrap:anywhere;
  z-index:2;
  box-shadow:8px 0 12px -12px rgba(6,47,80,.7);
}
.checklist-wrap.is-overflowing .checklist-table thead th:first-child {
  z-index:4;
  background:#f5f9fb;
}
.checklist-wrap.is-overflowing .checklist-table tbody td:first-child { background:#fff; }
.checklist-wrap.is-overflowing .checklist-table th:not(:first-child),
.checklist-wrap.is-overflowing .checklist-table td:not(:first-child) {
  width:72px;
  min-width:72px;
  max-width:72px;
}

@media (max-width:720px) {
  .checklist-wrap.is-overflowing .checklist-table th:first-child,
  .checklist-wrap.is-overflowing .checklist-table td:first-child {
    width:220px;
    min-width:220px;
    max-width:220px;
  }
}

@media print {
  .print-group-page {
    break-after:page;
    page-break-after:always;
  }
  .print-group-page:last-child {
    break-after:auto;
    page-break-after:auto;
  }
  .print-group-page .print-section {
    break-inside:auto;
    page-break-inside:auto;
    margin-bottom:0;
  }
  .print-group-page .print-group-table {
    width:100%;
    table-layout:fixed;
    font-size:7.5pt;
  }
  .print-group-page .print-group-table thead { display:table-header-group; }
  .print-group-page .print-group-table tr {
    break-inside:avoid;
    page-break-inside:avoid;
  }
  .print-group-page .print-group-table th:first-child {
    width:12%;
  }
  .print-group-page .print-group-table th,
  .print-group-page .print-group-table td {
    padding:4px 3px;
    overflow-wrap:anywhere;
  }
}


/* BadgeProgress 0.14.0 – synlig publik ändringslogg */
.whats-new-nav {
  box-shadow: 0 5px 14px rgba(0,0,0,.12);
}
.whats-new-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(86vh, 860px);
}
.whats-new-intro { margin-top: 10px; }
.whats-new-content {
  max-height: min(64vh, 650px);
  overflow-y: auto;
  padding: 2px 8px 8px 0;
  scrollbar-gutter: stable;
}
.whats-new-content h3 {
  margin: 24px 0 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  font-size: 1.08rem;
}
.whats-new-content h3:first-child { margin-top: 4px; }
.whats-new-content p { margin: 8px 0 14px; color: var(--muted); }
.whats-new-content ul { margin: 8px 0 18px; padding-left: 22px; }
.whats-new-content li + li { margin-top: 7px; }
.whats-new-content code {
  padding: 1px 5px;
  border-radius: 6px;
  background: #edf3f7;
  color: #334c61;
  font-size: .9em;
}


/* BadgeProgress 0.14.1 – senaste uppdatering och olästmarkering */
.whats-new-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.whats-new-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.whats-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gold);
  color: #3f3100;
  font-size: .68rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .045em;
  box-shadow: 0 2px 7px rgba(0,0,0,.14);
}
.whats-new-badge[hidden] { display: none; }
.last-update-text {
  color: #cfe7f3;
  font-size: .72rem;
  line-height: 1.2;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .last-update-text { white-space: normal; }
}


/* BadgeProgress 0.15.0 – gemensam Lysfisken-header */
.lysfisken-global-bar {
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:34px;
  padding:7px 16px;
  background:linear-gradient(90deg, #021d31 0%, #06385a 55%, #074564 100%);
  border-bottom:1px solid rgba(19,201,232,.34);
  color:#eefaff;
  text-align:center;
  text-decoration:none;
  font-size:.84rem;
  font-weight:750;
  line-height:1.3;
  letter-spacing:.005em;
  transition:background .15s ease, color .15s ease;
}
.lysfisken-global-bar:hover {
  background:linear-gradient(90deg, #052943 0%, #08486f 55%, #0a5678 100%);
  color:#fff;
}
.lysfisken-global-bar:focus-visible {
  outline:3px solid rgba(19,201,232,.6);
  outline-offset:-3px;
}
@media (max-width:580px) {
  .lysfisken-global-bar {
    min-height:0;
    padding:7px 10px;
    font-size:.78rem;
    line-height:1.35;
  }
}
@media print {
  .lysfisken-global-bar { display:none !important; }
}
