* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --teal: #7fd8c4;
  --teal-d: #4aab96;
  --teal-l: #e8f8f4;
  --blue: #6a97ee;
  --blue-d: #3a6abf;
  --blue-l: #eaf1fd;
  --pink: #f6cee1;
  --pink-d: #c75a7a;
  --pink-l: #fdf0f6;
  --orange: #f5a623;
  --orange-l: #fef3e2;
  --purple: #9b59b6;
  --purple-l: #f3e9f9;
  --red: #fe6450;
  --cream: #faf7f0;
  --ink: #18223a;
  --ink2: #4a5570;
  --ink3: #8892a8;
  --white: #fff;
  --border: #e8edf5;
  --nav-h: 64px;
}
html,
body {
  height: 100%;
  background: var(--cream);
  font-family: "Lato", system-ui, sans-serif;
  color: var(--ink);
}
nav {
  height: var(--nav-h);
  background: #204F58;
  border-bottom: none;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo-img {
  height: 38px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}
.logo-text-nav {
  font-size: 1.4rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.04em;
}
.logo-text-nav span {
  color: #5BDBC3;
}
.nav-spacer {
  flex: 1;
}
.nav-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
}
.tag-school {
  background: rgba(91, 219, 195, 0.2);
  color: #5BDBC3;
}
.tag-user {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}
.btn-logout {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
}
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  margin: 5px 0;
  border-radius: 2px;
  transition: all 0.2s;
}
.layout {
  display: flex;
  height: calc(100vh - var(--nav-h));
}
.side {
  width: 224px;
  background: #FAF7F0;
  border-right: none;
  padding: 24px 18px;
  flex-shrink: 0;
  overflow-y: auto;
  position: relative;
  z-index: 10;
  transition: transform 0.25s;
}
.side-sec {
  margin-bottom: 28px;
}
.side-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink3);
  padding: 0 12px;
  margin-bottom: 6px;
}
.sn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 16px;
  border: none;
  background: transparent;
  font-size: 15px;
  color: #3A4A4A;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background 0.2s ease, color 0.2s ease;
}
.sn:hover {
  background: #FFFFFF;
  box-shadow: 0 12px 28px rgba(32, 79, 88, 0.16);
  color: #204F58;
  transform: translateX(12px) scale(1.06);
}
.sn.on {
  background: #5BDBC3;
  color: #11423B;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(91, 219, 195, 0.45);
  transform: translateX(10px);
}
.age-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 18px;
  border-radius: 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background 0.2s ease;
}
.age-btn:hover {
  background: #FFFFFF;
  box-shadow: 0 12px 28px rgba(32, 79, 88, 0.16);
  transform: translateX(8px) scale(1.04);
}
.age-btn.on {
  background: rgba(91, 219, 195, 0.18);
  transform: translateX(6px);
}
.age-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.age-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-l);
  color: var(--blue-d);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.age-btn.on .age-num {
  background: #5BDBC3;
  color: #11423B;
}
.age-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2);
}
.age-btn.on .age-name {
  color: #204F58;
  font-weight: 700;
}
.age-words {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink3);
}
.age-btn.on .age-words {
  color: #204F58;
}
.main {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
}
.screen {
  display: none;
}
.screen.on {
  display: block;
  position: relative;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.page-title {
  font-family: "Sansita", serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}
.page-sub {
  font-size: 13px;
  color: var(--ink3);
  margin-bottom: 24px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--ink3);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 20px;
  padding: 0;
}
.back:hover {
  color: var(--teal-d);
}
/* Rensa-filter-knapp (visas när något filter är aktivt) */
.filter-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  color: var(--ink3);
  font-family: "Lato", sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-clear-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fff;
}
.section-title {
  font-family: "Sansita", serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: -0.1px;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}
.stat-n {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.stat-n.teal {
  color: var(--teal-d);
}
.stat-n.blue {
  color: var(--blue-d);
}
.stat-l {
  font-size: 11px;
  color: var(--ink3);
}
.mod-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
.mcard {
  border-radius: 18px;
  border: none;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  padding: 24px;
}
.mcard.oib {
  background: var(--teal-d);
}
.mcard.fri {
  background: var(--blue);
}
.mcard h3 {
  font-family: "Sansita", serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 6px;
}
.mcard p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
  margin-bottom: 20px;
  flex: 1;
}
.rec-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.22);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 22px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  align-self: flex-start;
}
.mini-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.mw-b {
  width: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
}
.rec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rec-row {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.rec-row:hover {
  border-color: var(--teal);
}
.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-oib {
  background: var(--teal-d);
}
.dot-fri {
  background: var(--blue);
}
.rec-info {
  flex: 1;
  min-width: 0;
}
.rec-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-meta {
  font-size: 11px;
  color: var(--ink3);
  margin-top: 1px;
}
.rec-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-archive {
  background: var(--orange-l);
  border: none;
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
}
.btn-delete {
  background: var(--pink-l);
  border: none;
  color: var(--pink-d);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
}
.btn-restore {
  background: var(--teal-l);
  border: none;
  color: var(--teal-d);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
}
.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.tag-oib {
  background: var(--teal-l);
  color: var(--teal-d);
}
.tag-fri {
  background: var(--blue-l);
  color: var(--blue-d);
}
.tag-archived {
  background: var(--orange-l);
  color: var(--orange);
}
.age-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 640px) {
  .age-stats {
    grid-template-columns: 1fr 1fr;
  }
}
.astat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
}
.astat-n {
  font-size: 22px;
  font-weight: 700;
}
.astat-n.t {
  color: var(--teal-d);
}
.astat-n.b {
  color: var(--blue-d);
}
.astat-n.k {
  color: var(--ink);
}
.astat-l {
  font-size: 11px;
  color: var(--ink3);
  margin-top: 2px;
}
.age-bottom {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-bottom: 20px;
  align-items: stretch;
}
.vocab-mini {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 160px;
}
.vocab-mini-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink3);
  margin-bottom: 6px;
}
.vocab-mini-nums {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 6px;
}
.vocab-mini-big {
  font-size: 20px;
  font-weight: 700;
  color: var(--teal-d);
}
.vocab-mini-of {
  font-size: 11px;
  color: var(--ink3);
}
.vtrack {
  height: 7px;
  background: var(--cream);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.vfill {
  height: 100%;
  border-radius: 4px;
  background: var(--teal);
}
.vocab-mini-pct {
  font-size: 10px;
  color: var(--ink3);
}
.ordklass-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ok-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}
.ok-n {
  font-size: 18px;
  font-weight: 700;
}
.ok-n.t {
  color: var(--teal-d);
}
.ok-n.b {
  color: var(--blue-d);
}
.ok-n.p {
  color: var(--pink-d);
}
.ok-l {
  font-size: 10px;
  color: var(--ink3);
  margin-top: 2px;
  line-height: 1.3;
}
.time-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.time-filter label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink3);
}
.time-filter input[type="date"],
.time-filter select {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  font-family: "Lato", sans-serif;
}
.btn-filter {
  padding: 6px 14px;
  background: var(--teal-d);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.setup-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 14px;
}
.mtabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.mtab {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  text-align: center;
}
.mtab.on {
  border-color: var(--teal-d);
  background: var(--teal-l);
}
.mtab h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.mtab.on h4 {
  color: var(--teal-d);
}
.mtab span {
  font-size: 11px;
  color: var(--ink3);
}
.mtab.on span {
  color: var(--teal-d);
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink3);
  margin-bottom: 6px;
}
.field select,
.field input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink);
  background: var(--cream);
  outline: none;
  font-family: "Lato", sans-serif;
}
.field select:focus,
.field input:focus {
  border-color: var(--teal-d);
}
.field.invalid select,
.field.invalid input {
  border-color: var(--red);
}
.field.invalid label {
  color: var(--red);
}
.notice {
  background: var(--pink-l);
  border: 1px solid var(--pink);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--pink-d);
  margin-bottom: 12px;
  display: none;
}
.notice.show {
  display: block;
}
.mode-tabs {
  display: flex;
  margin-bottom: 18px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.mode-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink3);
  cursor: pointer;
  transition: background 0.15s;
}
.mode-tab:not(:last-child) {
  border-right: 1.5px solid var(--border);
}
.mode-tab.on {
  background: var(--teal-d);
  color: #fff;
}
.img-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
.img-box h3 {
  font-family: "Sansita", serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.img-frame {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cream);
}
.img-frame img {
  width: 100%;
  display: block;
  object-fit: contain;
  max-height: 260px;
}
.img-chips {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.ichip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.ichip.s {
  background: var(--teal-l);
  color: var(--teal-d);
}
.ichip.v {
  background: var(--blue-l);
  color: var(--blue-d);
}
.ichip.a {
  background: var(--pink-l);
  color: var(--pink-d);
}
.test-imgs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.test-img-btn {
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  padding: 0;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.test-img-btn:hover {
  border-color: var(--teal);
}
.test-img-btn.on {
  border-color: var(--teal-d);
  box-shadow: 0 0 0 2px var(--teal-l);
}
.test-img-btn img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}
.test-img-btn span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
  padding: 5px 8px;
  text-align: center;
  background: var(--white);
}
#fullscreen-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 500;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
#fullscreen-overlay.show {
  display: flex;
}
#fullscreen-overlay img {
  width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  object-fit: contain;
}
#fullscreen-overlay .fs-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#fullscreen-overlay .fs-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
  opacity: 0.8;
}
.upload-area {
  display: block;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 14px;
  transition:
    border-color 0.15s,
    background 0.15s;
  position: relative;
  z-index: 0;
}
.upload-area:hover,
.upload-area.drag {
  border-color: var(--teal-d);
  background: var(--teal-l);
}
.upload-area input {
  display: none;
}
.upload-icon {
  font-size: 28px;
  margin-bottom: 6px;
}
.upload-txt {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  margin-bottom: 3px;
}
.upload-sub {
  font-size: 11px;
  color: var(--ink3);
}
.mic-area {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}
.mic-area.dim {
  opacity: 0.45;
  pointer-events: none;
}
.mic-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--teal-d);
  border: none;
  cursor: pointer;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.mic-circle:hover {
  background: var(--teal);
}
.mic-circle.rec {
  background: var(--pink-d);
}
.mic-st {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.mic-hint {
  font-size: 12px;
  color: var(--ink3);
}
.waves {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: center;
  height: 22px;
  margin-top: 14px;
}
.wbar {
  width: 4px;
  border-radius: 3px;
  background: var(--border);
}
.live-transcript {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--cream);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.8;
  text-align: left;
  min-height: 44px;
  color: var(--ink3);
}
.live-interim {
  font-style: italic;
  color: var(--ink3);
}
.fw {
  border-radius: 6px;
  padding: 2px 7px;
  display: inline-block;
  color: var(--ink);
  margin: 1px 1px;
  line-height: 1.5;
  border: 1.5px solid transparent;
}
/* SUBSTANTIV — grön */
.fw.subst {
  background: #d8f5ec;
  color: var(--ink);
  border-color: #36cca9;
}
/* VERB — röd */
.fw.verb {
  background: #ffe0db;
  color: var(--ink);
  border-color: #ff715b;
}
/* ADJEKTIV — blå */
.fw.adj {
  background: #dceaf8;
  color: var(--ink);
  border-color: #6db5e7;
}
/* ADVERB — gul */
.fw.adv {
  background: #fdf2d4;
  color: var(--ink);
  border-color: #f5c842;
}
/* PRONOMEN — lila */
.fw.pron {
  background: #ede0f5;
  color: var(--ink);
  border-color: #9b59b6;
}
.fw.name,
.fw.anonym {
  background: var(--pink-l);
  color: var(--ink);
  border-color: var(--pink-d);
  font-weight: 700;
}
.fw.other {
  color: var(--ink);
}
/* Markering för fel-uttalade ord (saknar klassen "correct" från backend) */
.mispron-mark {
  display: inline-block;
  color: var(--red);
  font-weight: 800;
  font-size: 0.95em;
  margin-right: 1px;
  vertical-align: baseline;
}
.fw.mispron {
  text-decoration: underline wavy var(--red);
  text-underline-offset: 3px;
}
.matched-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
}
.matched-panel h5 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink3);
  margin-bottom: 8px;
}
.matched-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.mchip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.mchip.s {
  background: var(--teal-l);
  color: var(--teal-d);
}
.mchip.v {
  background: var(--blue-l);
  color: var(--blue-d);
}
.mchip.a {
  background: var(--pink-l);
  color: var(--pink-d);
}
.vocab-meter {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
}
.vocab-meter-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink3);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.vocab-meter-bar {
  height: 10px;
  background: var(--cream);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 6px;
}
.vocab-meter-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--teal);
  transition: width 0.4s;
}
.vocab-meter-info {
  font-size: 12px;
  color: var(--ink3);
}
.vocab-meter-info span {
  font-weight: 700;
  color: var(--teal-d);
}
.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.rcard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.rcard h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink3);
  margin-bottom: 14px;
}
.gauge-wrap {
  text-align: center;
}
.g-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--teal-d);
  margin-top: -4px;
}
.g-lbl {
  font-size: 11px;
  color: var(--ink3);
}
.bar-r {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.bar-lbl {
  font-size: 11px;
  font-weight: 600;
  width: 44px;
  text-align: right;
  flex-shrink: 0;
}
.bar-lbl.s {
  color: var(--teal-d);
}
.bar-lbl.v {
  color: var(--red);
}
.bar-lbl.a {
  color: var(--blue-d);
}
.bar-lbl.adv {
  color: var(--orange);
}
.bar-lbl.pron {
  color: var(--purple);
}
.bar-tr {
  flex: 1;
  height: 10px;
  background: var(--cream);
  border-radius: 5px;
  overflow: hidden;
}
.bar-f {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s;
}
.bar-f.s {
  background: var(--teal);
}
.bar-f.v {
  background: var(--red);
}
.bar-f.a {
  background: var(--blue);
}
.bar-f.adv {
  background: var(--orange);
}
.bar-f.pron {
  background: var(--purple);
}
.bar-v {
  font-size: 11px;
  color: var(--ink3);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}
.leg {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.li {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
}
.ld {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.twrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.htable {
  width: 100%;
  border-collapse: collapse;
}
.htable th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.htable td {
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.htable tr:last-child td {
  border-bottom: none;
}
.htable tbody tr:hover td {
  background: var(--teal-l);
  cursor: pointer;
}
/* Åtgärdsknappar i tabellrader — flex på en inre div, INTE på själva <td>,
   så att tabellradens border-bottom alltid bevaras */
.htable td .row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
}
.markning-badge {
  display: inline-block;
  background: var(--purple-l);
  color: var(--purple);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.admin-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.admin-card-icon {
  font-size: 20px;
  margin-bottom: 8px;
}
.admin-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.admin-card-body {
  font-size: 12px;
  color: var(--ink3);
  line-height: 1.5;
}
.admin-card.warn .admin-card-title {
  color: var(--orange);
}
.admin-card.good .admin-card-title {
  color: var(--teal-d);
}
.admin-card.info .admin-card-title {
  color: var(--blue-d);
}
.bm-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.bm-tab {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
  transition: all 0.15s;
}
.bm-tab:hover {
  border-color: var(--teal);
  color: var(--teal-d);
}
.bm-tab.on {
  background: var(--teal-d);
  color: #fff;
  border-color: var(--teal-d);
}
.bm-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.bm-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.bm-card:hover {
  border-color: var(--teal);
}
.bm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.bm-delta {
  font-size: 22px;
  font-weight: 700;
}
.bm-delta.pos {
  color: var(--teal-d);
}
.bm-delta.neg {
  color: var(--red);
}
.bm-delta-lbl {
  font-size: 10px;
  color: var(--ink3);
}
.chart-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.chart-title {
  font-family: "Sansita", serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.chart-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.cl-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
}
.cl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bar-chart {
  overflow-x: auto;
}
.bar-chart-inner {
  min-width: 400px;
}
.fs-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.fs-bar-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
  width: 160px;
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-bar-track {
  flex: 1;
  height: 12px;
  background: var(--cream);
  border-radius: 6px;
  overflow: hidden;
}
.fs-bar-fill {
  height: 100%;
  border-radius: 6px;
}
.fs-bar-val {
  font-size: 11px;
  color: var(--ink3);
  width: 60px;
  padding-left: 4px;
}
.side-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9;
}
.home-chart-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.home-chart-tab {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
  transition: all 0.15s;
}
.home-chart-tab:hover {
  border-color: var(--teal);
  color: var(--teal-d);
}
.home-chart-tab.on {
  background: var(--teal-d);
  color: #fff;
  border-color: var(--teal-d);
}
#custom-animal-box {
  display: none;
  margin-top: 8px;
  background: var(--teal-l);
  border: 1.5px solid var(--teal);
  border-radius: 10px;
  padding: 10px;
}
#custom-animal-box input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--teal-d);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  font-family: "Lato", sans-serif;
}
#custom-animal-box .hint {
  font-size: 11px;
  color: var(--teal-d);
  margin-top: 6px;
}
.dur-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--teal-l);
  color: var(--teal-d);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 6px;
}
@media (max-width: 768px) {
  :root {
    --nav-h: 56px;
  }
  .hamburger {
    display: block;
  }
  .nav-tag {
    display: none;
  }
  .side {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    height: calc(100vh - var(--nav-h));
    transform: translateX(-100%);
    z-index: 10;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  }
  .side.open {
    transform: translateX(0);
  }
  .side-overlay.open {
    display: block;
  }
  .layout {
    height: calc(100vh - var(--nav-h));
  }
  .main {
    padding: 16px;
  }
  .stat-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
  }
  .mod-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .res-grid {
    grid-template-columns: 1fr;
  }
  .age-bottom {
    grid-template-columns: 1fr;
  }
  .vocab-mini {
    min-width: unset;
  }
  .ordklass-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .bm-overview {
    grid-template-columns: 1fr;
  }
  .time-filter {
    gap: 8px;
  }
  .page-title {
    font-size: 18px;
  }
  .fs-bar-name {
    width: 100px;
  }
  .admin-cards {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .stat-row {
    grid-template-columns: 1fr 1fr;
  }
  .stat-n {
    font-size: 18px;
  }
  .mcard {
    padding: 18px;
  }
  .mcard h3 {
    font-size: 15px;
  }
  .rec-actions {
    flex-direction: column;
    gap: 3px;
  }
  .admin-cards {
    grid-template-columns: 1fr;
  }
}
.oib-tabs {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 4px;
  background: #dadadb;
  border-radius: 14px;
  margin-bottom: 22px;
  gap: 0;
}
.oib-tab-indicator {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--teal-d);
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(74, 171, 150, 0.35);
  transition: left 0.22s ease-out;
  z-index: 1;
}
.oib-tab {
  flex: 1;
  position: relative;
  z-index: 2;
  padding: 14px 11px;
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: color 0.15s;
  letter-spacing: 0.01em;
  border-radius: 10px;
}
.oib-tab.on {
  color: #fff;
}
.mic-circle {
  background: var(--red) !important;
  box-shadow: 0 4px 16px rgba(254, 100, 80, 0.45) !important;
}
.mic-circle:hover {
  background: #e04030 !important;
}
.mic-circle.rec {
  background: #9b0000 !important;
  box-shadow: 0 4px 20px rgba(155, 0, 0, 0.5) !important;
}
.mic-stop-btn {
  display: none;
  margin: 10px auto 0;
  padding: 10px 28px;
  border-radius: 22px;
  border: none;
  background: #18223a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: "Lato", sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}
.mic-stop-btn:hover {
  background: #4aab96;
}
.mic-stop-btn.show {
  display: block;
}
.transcript-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px auto 0;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
}
.transcript-toggle:hover {
  border-color: var(--teal);
}
.live-transcript.hidden {
  display: none;
}
#fullscreen-overlay .fs-close {
  top: 20px;
  right: 24px;
  width: 52px;
  height: 52px;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.92);
  color: #18223a;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(0, 0, 0, 0.1);
}
#fullscreen-overlay .fs-close:hover {
  background: #fff;
}
.facit-box {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--teal-l);
  border: 1.5px solid var(--teal);
  border-radius: 10px;
  position: relative;
}
.upload-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--teal-d);
  background: #fff;
  color: var(--teal-d);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s;
  z-index: 2;
}
.upload-close-btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.facit-box label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--teal-d);
  display: block;
  margin-bottom: 5px;
}
.facit-box input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--teal-d);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  font-family: "Lato", sans-serif;
}
.facit-box .hint {
  font-size: 11px;
  color: var(--teal-d);
  margin-top: 5px;
}
.test-info-banner {
  background: var(--blue-l);
  border: 1px solid var(--blue);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--blue-d);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.test-info-banner strong {
  font-weight: 700;
}
#s-celebration {
  display: none;
}
#celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  animation: cel-fadein 0.25s ease forwards;
  cursor: pointer;
}
#celebration-overlay.show {
  display: flex;
}
@keyframes cel-fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes cel-fadeout {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
#celebration-overlay.hiding {
  animation: cel-fadeout 0.35s ease forwards;
}
#celebration-overlay::after {
  content: "Tryck var som helst för att fortsätta";
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  white-space: nowrap;
  font-family: "Lato", sans-serif;
}
.celebration-overlay-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.celebration-overlay-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: cel-pop 0.4s ease both;
  pointer-events: none;
}
@keyframes cel-pop {
  from {
    opacity: 0;
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.fri-header {
  background: linear-gradient(135deg, #faf7f0 0%, #f5ede0 100%);
  border: 1px solid #e8ddd0;
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.fri-header-icon {
  font-size: 36px;
  flex-shrink: 0;
}
.fri-header-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}
.fri-header-sub {
  font-size: 12px;
  color: var(--ink3);
}
.oib-mode-info-wrap {
  position: relative;
  display: inline-block;
}
.oib-mode-info-trigger {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink3);
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}
.oib-mode-info-trigger:hover {
  color: var(--blue-d);
}
.oib-mode-info-box {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 320px;
  background: var(--white);
  border: 1.5px solid var(--blue);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 8px 32px rgba(106, 151, 238, 0.15);
  z-index: 1000;
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.6;
}
.oib-mode-info-box strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}
.oib-mode-info-box p {
  margin: 0;
  color: var(--ink2);
}
.oib-mode-info-arrow {
  position: absolute;
  top: -8px;
  left: 20px;
  width: 14px;
  height: 14px;
  background: var(--white);
  border-left: 1.5px solid var(--blue);
  border-top: 1.5px solid var(--blue);
  transform: rotate(45deg);
}
.oib-mode-info-wrap:hover .oib-mode-info-box {
  display: block;
}
.oib-mode-info-wrap:hover {
  z-index: 1000;
}
.unique-words-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--purple-l);
  color: var(--purple);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 4px;
}
.lang-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 14px;
}
.lang-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink3);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}
.lang-label {
  color: var(--ink3);
  font-size: 11px;
  font-weight: 600;
}
.lang-value {
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
}
.lang-accent-bar {
  height: 7px;
  background: var(--cream);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.lang-accent-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--blue);
  transition: width 0.4s;
}
.lang-note {
  font-size: 11px;
  color: var(--ink3);
  margin-top: 10px;
  font-style: italic;
  line-height: 1.5;
}
.hist-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  align-items: center;
}
/* Status-gruppen (Aktiva/Arkiverade/Papperskorg) hamnar på samma rad om plats finns,
   annars wrap'ar den till egen rad utan att skapa konstigt utrymme */
.hist-filters > .hist-status-group {
  margin-left: auto;
}
@media (max-width: 1280px) {
  /* På mindre skärmar (laptops), wrap'a status-gruppen till egen rad */
  .hist-filters > .hist-status-group {
    margin-left: 0;
    flex-basis: 100%;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 4px;
  }
}
@media (max-width: 900px) {
  /* Dölj vertikalstrecken när raderna wrap'ar — de ser konstiga ut */
  .hist-filter-divider {
    display: none;
  }
}
.hist-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.hist-filter-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.hist-filter-group select {
  padding: 5px 9px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  font-family: "Lato", sans-serif;
}
.hist-filter-group select:focus {
  border-color: var(--teal-d);
}
.hist-filter-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 2px;
}
.filter-sep {
  flex-basis: 100%;
  height: 0;
}
.age-modul-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.age-modul-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
  transition: all 0.15s;
}
.age-modul-btn:hover {
  border-color: var(--teal);
  color: var(--teal-d);
}
.age-modul-btn.on {
  background: var(--teal-d);
  color: #fff;
  border-color: var(--teal-d);
}
.admin-pw-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}
.admin-pw-section h3 {
  font-family: "Sansita", serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 14px;
}
.pw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.pw-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
  width: 100px;
  flex-shrink: 0;
}
.pw-row input {
  flex: 1;
  min-width: 140px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  background: var(--cream);
  outline: none;
  font-family: "Lato", sans-serif;
}
.pw-row input:focus {
  border-color: var(--teal-d);
}
.pw-row .btn-save-pw {
  padding: 7px 16px;
  background: var(--teal-d);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.pw-row .btn-save-pw:hover {
  background: var(--teal);
}
.pw-msg {
  font-size: 11px;
  margin-left: 4px;
  font-weight: 600;
}
.pw-msg.ok {
  color: var(--teal-d);
}
.pw-msg.err {
  color: var(--red);
}
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 8px;
}
.sync-indicator.synced {
  background: var(--teal-l);
  color: var(--teal-d);
}
.sync-indicator.syncing {
  background: var(--blue-l);
  color: var(--blue-d);
}
.sync-indicator.offline {
  background: var(--orange-l);
  color: var(--orange);
}
.sync-indicator.error {
  background: var(--pink-l);
  color: var(--pink-d);
}
.fs-bar-own .fs-bar-name {
  color: var(--blue-d);
  font-weight: 700;
}
.fs-bar-own .fs-bar-fill {
  background: var(--blue-d) !important;
}
.fs-bar-own .fs-bar-val {
  color: var(--blue-d);
  font-weight: 700;
}
.fs-bar-other .fs-bar-fill {
  background: #c8d0e0 !important;
}
.fs-bar-other .fs-bar-val {
  color: var(--ink3);
}
.leg-key-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: rgba(255, 200, 0, 0.28);
  border: 2px solid #e8a000;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 3px;
}
.leg-rel-dot {
  display: inline-block;
  width: 14px;
  height: 8px;
  border-bottom: 2px dashed #c88000;
  vertical-align: middle;
  margin-right: 3px;
}
.unique-words-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
}
.unique-words-panel h5 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink3);
  margin-bottom: 8px;
}
.unique-words-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.uw-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--purple-l);
  color: var(--purple);
}
.fw.adv-word {
  background: rgba(155, 89, 182, 0.15);
  border-bottom: 2px solid #9b59b6;
  border-radius: 4px;
  padding: 1px 5px;
  font-style: italic;
}
.leg-adv-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: rgba(155, 89, 182, 0.15);
  border-bottom: 2px solid #9b59b6;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 3px;
}
.saved-imgs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.saved-img-btn {
  position: relative;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  padding: 0;
  transition: border-color 0.15s;
}
.saved-img-btn:hover {
  border-color: var(--teal-d);
}
.saved-img-btn.on {
  border-color: var(--teal-d);
  box-shadow: 0 0 0 2px var(--teal-d);
}
.saved-img-btn img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}
.saved-img-btn span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
  padding: 5px 8px;
  text-align: center;
  background: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-img-delete {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.saved-img-delete:hover {
  background: var(--red);
}
.facit-save-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.facit-save-row input {
  flex: 1;
}
.btn-save-img {
  padding: 7px 14px;
  background: var(--teal-d);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-save-img:hover {
  background: var(--teal);
}
.saved-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink3);
  margin-bottom: 6px;
  margin-top: 2px;
}
#fri-recording-bg {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: none;
  background: #f5f0e8 url("fri-bakgrund.png") center center / cover no-repeat;
  animation: fri-bg-in 0.4s ease forwards;
}
#fri-recording-bg.show {
  display: block;
}
@keyframes fri-bg-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fri-bg-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
#fri-recording-bg.hiding {
  animation: fri-bg-out 0.3s ease forwards;
}
#fri-recording-stop {
  position: fixed;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8001;
  background: #fe6450;
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 18px 44px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 32px rgba(254, 100, 80, 0.5);
  animation: stop-pulse 1.8s ease-in-out infinite;
  display: none;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
#fri-recording-stop.show {
  display: inline-flex;
}
#fri-recording-stop:hover {
  background: #e55540;
}
@keyframes stop-pulse {
  0%,
  100% {
    box-shadow: 0 6px 32px rgba(254, 100, 80, 0.5);
  }
  50% {
    box-shadow:
      0 6px 48px rgba(254, 100, 80, 0.85),
      0 0 0 8px rgba(254, 100, 80, 0.15);
  }
}
#fri-recording-stop .stop-dot {
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Login page ── */
#login-page {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: url("bakgrund.png") center center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card-wrap {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  width: 100%;
  max-width: 360px;
  overflow: hidden;
}
.login-logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 24px;
  background: #fff;
}
.login-logo-text {
  font-size: 2.2rem;
  font-weight: 900;
  color: #18223a;
  letter-spacing: -0.04em;
}
.login-logo-text span {
  color: #4aab96;
}
.login-card-inner {
  padding: 0 2em 2.5em;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#login-heading {
  text-align: center;
  color: #18223a;
  font-size: 1.1em;
  font-weight: 700;
  margin-bottom: 4px;
}
.login-field {
  display: flex;
  align-items: center;
  gap: 0.5em;
  border-radius: 10px;
  padding: 0.7em 1em;
  background: #f5f5f5;
  border: 1.5px solid #e0e0e0;
}
.login-field svg {
  fill: #8892a8;
  flex-shrink: 0;
}
.login-field input {
  background: none;
  border: none;
  outline: none;
  width: 100%;
  color: #18223a;
  font-size: 14px;
  font-family: "Lato", sans-serif;
}
.login-field input::placeholder {
  color: #aaa;
}
.login-error {
  font-size: 12px;
  color: #fe6450;
  text-align: center;
  display: none;
  margin-top: -4px;
}
.login-error.show {
  display: block;
}
.login-btn {
  margin-top: 4px;
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: none;
  background: #18223a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: "Lato", sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}
.login-btn:hover {
  background: #4aab96;
}

/* ══ HEM – GENVÄGSKORT ══ */
.home-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 14px;
}
.home-shortcut {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 20px;
  padding: 28px 26px;
  cursor: pointer;
  text-align: left;
  color: #fff;
  font-family: "Lato", sans-serif;
  display: block;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.home-shortcut.sc-teal {
  background: linear-gradient(135deg, #36cca9 0%, #2ab394 100%);
  box-shadow: 0 8px 24px rgba(54, 204, 169, 0.28);
}
.home-shortcut.sc-blue {
  background: linear-gradient(135deg, #6db5e7 0%, #4f9bd4 100%);
  box-shadow: 0 8px 24px rgba(109, 181, 231, 0.28);
}
.home-shortcut:hover {
  transform: translateY(-3px);
}
.home-shortcut.sc-teal:hover {
  box-shadow: 0 12px 32px rgba(54, 204, 169, 0.38);
}
.home-shortcut.sc-blue:hover {
  box-shadow: 0 12px 32px rgba(109, 181, 231, 0.38);
}
.home-shortcut:active {
  transform: translateY(-1px);
}
.home-shortcut .sc-bubble {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.home-shortcut::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.home-shortcut .sc-icon {
  position: relative;
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  backdrop-filter: blur(10px);
}
.home-shortcut .sc-title {
  position: relative;
  display: block;
  font-family: "Sansita", serif;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.home-shortcut .sc-desc {
  position: relative;
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.5;
  margin-bottom: 18px;
}
.home-shortcut .sc-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 800;
}
.home-shortcut.sc-teal .sc-cta {
  color: #2ab394;
}
.home-shortcut.sc-blue .sc-cta {
  color: #4f9bd4;
}
.home-shortcut .sc-arrow {
  font-size: 16px;
  transition: transform 0.18s ease;
}
.home-shortcut:hover .sc-arrow {
  transform: translateX(4px);
}
@media (max-width: 640px) {
  .home-shortcuts {
    grid-template-columns: 1fr;
  }
}

/* ══ HEM – RUBRIKER I SANSITA ══ */
#s-home .page-title,
#s-home .page-sub,
#s-home .section-title,
#s-home .chart-title,
#s-home .fri-header-title,
#s-home .lang-card-title,
#s-home h1,
#s-home h2,
#s-home h3 {
  font-family: "Sansita", serif;
  letter-spacing: -0.01em;
}

/* ══ INSPELNINGAR – LÄGES-KNAPPAR ══ */
.hist-mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.hist-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  font-family: "Lato", sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.hist-mode-btn:hover {
  border-color: var(--ink2);
}
.hist-mode-btn.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}
.hmb-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hmb-teal { background: var(--teal); }
.hmb-orange { background: var(--orange); }
.hmb-blue { background: var(--blue); }

/* ══ INSPELNINGAR – INFO-TOOLTIPS PÅ ARKIVERA/RADERA ══ */
.hist-info-wrap {
  display: inline-block;
}
.hist-status-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.hist-info-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: var(--ink3);
  cursor: help;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
.hist-info-icon:hover {
  color: var(--ink);
}
.hist-info-box {
  width: 280px;
  left: 0 !important;
  right: auto !important;
  top: calc(100% + 10px) !important;
  white-space: normal;
  text-align: left;
  z-index: 1000 !important;
}
.hist-info-box p {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  text-align: left;
}
.hist-info-box p strong {
  display: inline !important;
  margin: 0 !important;
  font-size: inherit !important;
  color: var(--ink) !important;
}
.hist-info-box .oib-mode-info-arrow {
  left: 24px !important;
  right: auto !important;
}
@media (max-width: 600px) {
  .hist-info-box {
    width: min(260px, calc(100vw - 40px));
  }
}

/* ══ RESULTAT – BILDORD-RUTAN ══ */
.bildord-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-top: 16px;
}
.bildord-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.bildord-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bildord-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #ffd166 0%, #f5a623 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(245, 166, 35, 0.25);
  flex-shrink: 0;
}
.bildord-title {
  font-family: "Sansita", serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.bildord-info-wrap {
  display: inline-flex;
  align-items: center;
}
.bildord-info-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: var(--ink3);
  cursor: help;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
.bildord-info-icon:hover {
  color: var(--ink);
}
.bildord-info-box {
  width: 280px;
  white-space: normal;
  text-align: left;
}
.bildord-info-box p {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  text-align: left;
  margin: 0;
}
.bildord-head-right {
  text-align: right;
}
.bildord-pct {
  font-family: "Sansita", serif;
  font-size: 22px;
  font-weight: 800;
  color: #f5a623;
  line-height: 1;
}
.bildord-frac {
  font-size: 11px;
  color: var(--ink3);
  margin-top: 2px;
}
.bildord-bar {
  height: 8px;
  background: #f3eee0;
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 16px;
}
.bildord-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd166 0%, #f5a623 100%);
  border-radius: 100px;
  transition: width 0.4s ease;
}
.bildord-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.bildord-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: #faf7f0;
  color: var(--ink3);
}
.bildord-chip.matched {
  background: #fef3e2;
  border-color: #f5a623;
  color: #8a5a00;
  font-weight: 700;
}
.bildord-chip-check {
  width: 11px;
  height: 11px;
}
/* "Visa fler"-knapp för dolda facit-ord (visar bara sagda ord direkt) */
.bildord-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--ink2);
  font-family: "Lato", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.bildord-toggle-btn:hover {
  border-color: #f5a623;
  color: #8a5a00;
  background: #fef3e2;
}
.bildord-toggle-btn.on {
  border-color: #f5a623;
  color: #8a5a00;
  background: #fef3e2;
}
.bildord-rest {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

/* ══ RESULTAT – AVANCERADE ORD-RUTAN ══ */
.avancerat-card .bildord-icon.avancerat-icon {
  background: linear-gradient(135deg, #b388e8 0%, #6f42c1 100%);
  box-shadow: 0 3px 8px rgba(111, 66, 193, 0.25);
}
.avancerat-card .avancerat-pct {
  color: #6f42c1;
}
.avancerat-card .bildord-chip.matched {
  background: #f0e6fa;
  border-color: #6f42c1;
  color: #4a2c87;
}
.avancerat-card .bildord-chip-check path {
  stroke: #6f42c1 !important;
}
.avancerat-empty {
  font-size: 13px;
  color: var(--ink3);
  padding: 8px 0;
  font-style: italic;
}

/* ══ RESULTAT – UTTAL-RUTAN ══ */
.uttal-card .bildord-icon.uttal-icon {
  background: linear-gradient(135deg, #ff9b8e 0%, #fe6450 100%);
  box-shadow: 0 3px 8px rgba(254, 100, 80, 0.25);
}
.uttal-card .uttal-pct {
  color: var(--red);
}
.uttal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
}
.uttal-row-word {
  font-weight: 700;
  color: var(--ink);
  background: #fff0ed;
  border: 1.5px solid #ffb5a8;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: underline wavy var(--red);
  text-underline-offset: 3px;
  flex-shrink: 0;
}
.uttal-row-issue {
  font-size: 12px;
  color: var(--ink2);
  flex: 1;
}
.uttal-row-issue em {
  color: var(--ink3);
  font-style: italic;
}

/* ══ RESULTAT – MENINGSLÄNGD-RUTAN ══ */
.meningslangd-card .bildord-icon.meningslangd-icon {
  background: linear-gradient(135deg, #8be0cf 0%, #4aab96 100%);
  box-shadow: 0 3px 8px rgba(74, 171, 150, 0.25);
}
.meningslangd-card .meningslangd-pct {
  color: var(--teal-d);
}
.ml-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 130px;
  padding: 8px 4px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-top: 6px;
}
.ml-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}
.ml-bar-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink2);
  margin-bottom: 4px;
}
.ml-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #8be0cf 0%, #4aab96 100%);
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}
.ml-bar-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink3);
  margin-top: 6px;
}
.ml-summary {
  font-size: 12px;
  color: var(--ink3);
  margin-top: 10px;
  text-align: center;
}

/* ══ MÄRKNINGSVY – ÖVERBLICK ══ */
.m-page-title {
  font-family: "Sansita", serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.m-page-sub {
  font-size: 13px;
  color: var(--ink3);
  margin-bottom: 18px;
}

/* Ordförråd mot skolstartsmål – stor grön box */
.m-goalbox {
  background: linear-gradient(135deg, #36cca9 0%, #2ab394 100%);
  border-radius: 18px;
  padding: 24px;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(54, 204, 169, 0.22);
  position: relative;
  overflow: hidden;
}
.m-goalbox-bubble1 {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 50%;
  pointer-events: none;
}
.m-goalbox-bubble2 {
  position: absolute;
  bottom: -30px;
  left: 30%;
  width: 130px;
  height: 130px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  pointer-events: none;
}
.m-goalbox-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.m-goalbox-col {
  flex: 1;
  min-width: 240px;
}
.m-goalbox-label {
  font-size: 11px;
  opacity: 0.85;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
}
.m-goalbox-pct {
  font-family: "Sansita", serif;
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
}
.m-goalbox-desc {
  font-size: 13px;
  opacity: 0.92;
  line-height: 1.5;
}
.m-goalbox-desc strong {
  opacity: 1;
}
.m-goalbox-donut {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  position: relative;
}
.m-goalbox-donut svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.m-goalbox-donut-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.m-goalbox-donut-n {
  font-family: "Sansita", serif;
  font-size: 22px;
  font-weight: 800;
}
.m-goalbox-donut-l {
  font-size: 10px;
  opacity: 0.85;
  margin-top: -2px;
}
.m-goalbox-bar {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  margin-top: 16px;
  overflow: hidden;
}
.m-goalbox-bar-fill {
  height: 100%;
  background: #fff;
  border-radius: 100px;
  transition: width 0.4s ease;
}

/* Tre statboxar */
.m-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 900px) {
  .m-stat-row {
    grid-template-columns: 1fr;
  }
}
.m-statbox {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  position: relative;
}
.m-statbox-empty .m-statbox-empty-text {
  font-size: 12px;
  color: var(--ink3);
  font-style: italic;
  margin-top: 4px;
}
.m-statbox-empty-text {
  font-size: 12px;
  color: var(--ink3);
  font-style: italic;
}
.m-statbox-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.m-statbox-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.m-icon-blue {
  background: linear-gradient(135deg, #6db5e7 0%, #4f9bd4 100%);
}
.m-icon-orange {
  background: linear-gradient(135deg, #ffd166 0%, #f5a623 100%);
}
.m-icon-purple {
  background: linear-gradient(135deg, #b388e8 0%, #6f42c1 100%);
}
.m-statbox-title {
  font-family: "Sansita", serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.m-statbox-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.m-statbox-n {
  font-family: "Sansita", serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 4px;
}
.m-statbox-sub {
  font-size: 11px;
  color: var(--ink3);
  margin-bottom: 10px;
}
.m-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 100px;
}
.m-trend.up {
  color: #2ab394;
  background: #e8f8f4;
}
.m-trend.down {
  color: #c0392b;
  background: #fde8e6;
}
.m-spark {
  width: 100%;
  height: 30px;
  display: block;
}
.m-statbox-bar {
  height: 6px;
  background: #f3eee0;
  border-radius: 100px;
  overflow: hidden;
}
.m-bar-orange {
  height: 100%;
  background: linear-gradient(90deg, #ffd166 0%, #f5a623 100%);
  border-radius: 100px;
}

/* Avancerade ord-box (klickbar) */
.m-adv-box {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.m-adv-box:hover {
  border-color: #b388e8;
  box-shadow: 0 4px 12px rgba(111, 66, 193, 0.10);
}
.m-adv-chev {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.m-adv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.m-adv-chip {
  font-size: 11px;
  padding: 3px 9px;
  background: #f0e6fa;
  color: #4a2c87;
  border-radius: 100px;
  font-weight: 700;
}
.m-adv-chip.m-adv-more {
  background: #6f42c1;
  color: #fff;
  font-weight: 800;
}

/* Ordklass-utveckling */
.m-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 14px;
}
.m-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.m-card-title {
  font-family: "Sansita", serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}
.m-card-sub {
  font-size: 12px;
  color: var(--ink3);
  margin-top: 0;
  margin-bottom: 16px;
}
.m-ok-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.m-ok-tab {
  padding: 8px 16px;
  background: #faf7f0;
  color: var(--ink);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-family: "Lato", sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.m-ok-tab:hover:not(.on) {
  border-color: var(--ink3);
}
.m-ok-tab.on {
  border-color: transparent;
  font-weight: 800;
}
.m-ok-active {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.m-ok-active-n {
  font-family: "Sansita", serif;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}
.m-ok-active-l {
  font-size: 12px;
  color: var(--ink3);
}
.m-empty-graph {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink3);
  font-size: 13px;
  background: var(--bg);
  border-radius: 10px;
}

/* Tidigare inspelningar – tabell */
.m-table-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #f0f3f7;
  margin-top: 6px;
  overflow-x: auto;
}
.m-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}
.m-table thead tr {
  background: #faf7f0;
}
.m-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.m-table th:nth-child(4),
.m-table th:nth-child(5),
.m-table th:nth-child(6) {
  text-align: right;
}
.m-table tbody tr {
  border-top: 1px solid #f0f3f7;
  cursor: pointer;
  transition: background 0.12s ease;
}
.m-table tbody tr:hover {
  background: #faf7f0;
}
.m-table td {
  padding: 12px 14px;
  color: var(--ink);
  font-weight: 600;
}
.m-td-date {
  white-space: nowrap;
}
.m-td-muted {
  color: var(--ink2) !important;
  font-weight: 500 !important;
}
.m-td-right {
  text-align: right;
}
.m-td-chev {
  color: #c0c8d6;
  font-weight: 400 !important;
  width: 18px;
  font-size: 16px;
}
.m-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.m-pill-oib {
  background: #e8f8f4;
  color: #2ab394;
}
.m-pill-fri {
  background: #eaf1fd;
  color: #4f9bd4;
}
.m-pct-orange {
  color: #f5a623;
  font-weight: 800;
}

/* ══ LÅST FÖRSKOLA-FÄLT (förskola-konto har förvalt värde) ══ */
select.locked-school {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: none !important;
  padding-right: 12px !important;
  cursor: default;
}
select.locked-school::-ms-expand {
  display: none;
}

/* ══ NUMRERAD CIRKEL PÅ FÄRDIGA ÖVNINGSBILDER ══ */
.ovning-img-btn-numbered {
  position: relative;
}
.ovning-img-number {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  background: #36cca9;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Sansita", serif;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(54, 204, 169, 0.35);
  z-index: 2;
  pointer-events: none;
}

/* ══ EGNA ÖVNINGSBILDER – RUBRIKRAD MED INFO-IKON ══ */
.section-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.egna-info-wrap {
  display: inline-flex;
  align-items: center;
}
.egna-info-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: var(--ink3);
  cursor: help;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
.egna-info-icon:hover {
  color: var(--ink);
}
.egna-info-box {
  width: 280px;
  white-space: normal;
  text-align: left;
}
.egna-info-box p {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  text-align: left;
  margin: 0;
}

/* ══ EXPORTKNAPP & MENY (Inspelningar) ══ */
.hist-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.export-wrap {
  position: relative;
  flex-shrink: 0;
}
.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: "Lato", sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.export-btn:hover {
  background: #2a3553;
}
.export-btn:active {
  transform: translateY(1px);
}
.export-chev {
  margin-left: 2px;
  transition: transform 0.18s ease;
}
.export-wrap.open .export-chev {
  transform: rotate(180deg);
}
.export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(24, 34, 58, 0.12);
  padding: 6px;
  z-index: 100;
  min-width: 240px;
}
.export-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: "Lato", sans-serif;
  transition: background 0.12s ease;
}
.export-menu-item:hover {
  background: var(--bg);
}
.export-menu-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.export-icon-red {
  background: linear-gradient(135deg, #ff8a7a 0%, #e84118 100%);
}
.export-icon-green {
  background: linear-gradient(135deg, #4fd9b1 0%, #1d8a64 100%);
}
.export-menu-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}
.export-menu-desc {
  font-size: 11px;
  color: var(--ink3);
  margin-top: 1px;
}

/* ══ RESULTAT – LAYOUT (Talhastighet + Ordklasser sida vid sida, Transkript på egen rad) ══ */
.res-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.res-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.res-stats-row .res-stat-card {
  display: flex;
  flex-direction: column;
  margin: 0;
}
.res-stats-row .res-stat-card .gauge-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.res-transcript-card {
  margin: 0;
}
@media (max-width: 760px) {
  .res-stats-row {
    grid-template-columns: 1fr;
  }
}

/* ══ STATUS-KNAPPAR (Aktiva / Arkiverade / Papperskorg) ══ */
.hist-status-group {
  flex-wrap: wrap;
}
/* Aktiva (mintgrön) — överskrid grundregeln age-modul-btn.on */
.status-active {
  border: 1.5px solid var(--teal-d) !important;
  color: var(--teal-d) !important;
  background: var(--white) !important;
}
.status-active.on {
  background: var(--white) !important;
  border-color: var(--teal-d) !important;
  color: var(--teal-d) !important;
  border-width: 2px !important;
  font-weight: 800 !important;
}
/* Arkiverade (gul/orange) */
.status-archived {
  border: 1.5px solid #f5a623 !important;
  color: #b87800 !important;
  background: var(--white) !important;
}
.status-archived.on {
  background: var(--white) !important;
  border-color: #f5a623 !important;
  color: #b87800 !important;
  border-width: 2px !important;
  font-weight: 800 !important;
}
/* Raderade (röd) */
.status-trash {
  border: 1.5px solid var(--red) !important;
  color: var(--red) !important;
  background: var(--white) !important;
}
.status-trash.on {
  background: var(--white) !important;
  border-color: var(--red) !important;
  color: var(--red) !important;
  border-width: 2px !important;
  font-weight: 800 !important;
}

/* ══ RESULTAT – TEMPUSFORMER ══ */
.tempus-card .tempus-icon {
  background: linear-gradient(135deg, #5fa8e8 0%, #2a6dbb 100%);
  box-shadow: 0 3px 8px rgba(42, 109, 187, 0.25);
}
.tempus-card .tempus-pct {
  color: #2a6dbb;
}
.tempus-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.tempus-cell {
  background: #f5f8fc;
  border: 1.5px solid #e1ebf5;
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.tempus-cell-label {
  font-size: 12px;
  color: var(--ink2);
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.tempus-cell-num {
  font-family: "Sansita", serif;
  font-size: 26px;
  font-weight: 800;
  color: #2a6dbb;
  line-height: 1;
  margin-bottom: 4px;
}
.tempus-cell-pct {
  font-size: 11px;
  color: var(--ink3);
}
.tempus-cell-bar {
  height: 4px;
  background: #e1ebf5;
  border-radius: 100px;
  overflow: hidden;
  margin-top: 8px;
}
.tempus-cell-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #5fa8e8 0%, #2a6dbb 100%);
  border-radius: 100px;
  transition: width 0.4s ease;
}
@media (max-width: 700px) {
  .tempus-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ══ RESPONSIV LAYOUT ══ */
@media (max-width: 900px) {
  /* Goal-box (Ordförråd mot skolstartsmål) */
  .vocab-meter,
  .m-goalbox {
    padding: 18px 16px;
  }
  .m-goalbox-pct {
    font-size: 36px;
  }
  .m-goalbox-donut {
    width: 86px;
    height: 86px;
  }
  /* Inspelnings-filter */
  .hist-filters {
    flex-direction: column;
    align-items: stretch !important;
  }
  .hist-filters > div {
    width: 100%;
  }
  .hist-status-group {
    flex-wrap: wrap;
  }
  /* Resultat-grid */
  .res-grid {
    grid-template-columns: 1fr !important;
  }
  /* Tabeller scrollar horisontellt */
  .twrap,
  .m-table-wrap {
    overflow-x: auto;
  }
  .htable, .m-table {
    min-width: 600px;
  }
  /* Header-rad */
  .hist-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .export-wrap {
    align-self: flex-end;
  }
}

@media (max-width: 640px) {
  /* Page-rubriker mindre */
  .page-title {
    font-size: 22px;
  }
  /* Bildord/avancerat/tempus-boxarna */
  .bildord-card {
    padding: 16px;
  }
  .bildord-head {
    gap: 8px;
  }
  .bildord-title {
    font-size: 16px;
  }
  .bildord-pct {
    font-size: 20px;
  }
  /* Stat-rad i märkningsvyn */
  .m-stat-row {
    grid-template-columns: 1fr;
  }
  /* Goalbox kompakt */
  .m-goalbox {
    padding: 16px;
  }
  .m-goalbox-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .m-goalbox-donut {
    align-self: flex-end;
    margin-top: -56px;
  }
  /* Ordklass-flikar */
  .m-ok-tabs {
    width: 100%;
  }
  .m-ok-tab {
    flex: 1 1 auto;
    text-align: center;
    padding: 7px 10px;
    font-size: 12px;
  }
  /* Genvägskort */
  .home-shortcuts {
    grid-template-columns: 1fr !important;
  }
  /* Tempus-grid */
  .tempus-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Status-knappar */
  .hist-status-group {
    width: 100%;
    justify-content: flex-start;
  }
  /* Tooltip-positioner — tillåt att de syns bredd-mässigt */
  .oib-mode-info-box {
    max-width: calc(100vw - 40px);
  }
}
@media (max-width: 480px) {
  .res-stats-row {
    grid-template-columns: 1fr !important;
  }
  .export-menu {
    right: 0;
    left: auto;
    min-width: 220px;
  }
}

/* ══ MÄRKNING-VY HEADER MED EXPORT ══ */
.m-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
@media (max-width: 640px) {
  .m-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .m-header-row .export-wrap {
    align-self: flex-end;
  }
}

/* ══ BILDVISNING I RESULTATVYN ══ */
.rec-image-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-top: 16px;
}
/* Mini-bild i resultatsidans header (vid sidan av titel/meta) */
.res-header-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  cursor: pointer;
  width: 88px;
}
.res-header-thumb img {
  width: 88px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid var(--teal);
  background: #faf7f0;
  display: block;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.res-header-thumb:hover img {
  transform: scale(1.03);
  border-color: var(--teal-d);
}
.res-header-thumb-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--teal-d);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.rec-image-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rec-image-card h4::before {
  content: "";
  width: 4px;
  height: 18px;
  background: linear-gradient(180deg, #36cca9 0%, #2ab394 100%);
  border-radius: 2px;
}
.rec-image-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #faf7f0;
  border: 1.5px solid #f0ebe0;
  max-width: 420px;
  margin: 0 auto;
}
.rec-image-wrap img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  display: block;
  background: #faf7f0;
}
.rec-image-caption {
  font-size: 13px;
  color: var(--ink2);
  font-weight: 700;
  margin-top: 10px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rec-image-own-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  background: #d8f5ec;
  color: #2ab394;
  border-radius: 100px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .rec-image-wrap {
    max-width: 100%;
  }
  .rec-image-wrap img {
    max-height: 240px;
  }
}

/* ══ MINA FÖRSKOLOR (sidomeny för admin Pro) ══ */
#admin-schools-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-school-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: "Lato", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
}
.admin-school-btn:hover {
  border-color: var(--ink3);
  transform: translateX(2px);
}
.admin-school-btn.on {
  border-width: 2px;
  font-weight: 800;
}
.admin-school-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.admin-school-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-school-count {
  font-size: 11px;
  color: var(--ink3);
  font-weight: 600;
  flex-shrink: 0;
}

/* ══ HEMSIDANS VÄLKOMSTRUBRIK ══ */
.home-welcome {
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
@media (max-width: 640px) {
  .home-welcome {
    font-size: 30px;
  }
}

/* ══ ADMIN BASIC INFO-BANNER ══ */
.admin-basic-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, #fef3e2 0%, #fde6c4 100%);
  border: 1.5px solid #f5a623;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 13px;
  color: #6b3a00;
  line-height: 1.5;
}
.admin-basic-banner-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1.4;
}
.admin-basic-banner strong {
  color: #18223a;
  display: block;
  margin-bottom: 2px;
}

/* ════════════════════════════════════════════════════════════════════
   BENCHMARK (admin) — detaljerad analysvy
   ════════════════════════════════════════════════════════════════════ */

/* Modul-flikar (Test/Övning/Fri) */
.bm-module-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.bm-mod-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-family: "Lato", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink2);
  cursor: pointer;
  transition: all 0.15s;
}
.bm-mod-tab:hover {
  border-color: var(--teal);
  color: var(--teal-d);
  transform: translateY(-1px);
}
.bm-mod-tab.on {
  background: var(--teal-d);
  color: #fff;
  border-color: var(--teal-d);
  box-shadow: 0 3px 10px rgba(74, 171, 150, 0.25);
}
.bm-mod-tab.on .bm-mod-icon {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}
.bm-mod-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
}

/* Filter-rad */
.bm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  align-items: center;
}
.bm-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bm-filter-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.bm-filter-group select {
  padding: 5px 9px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  font-family: "Lato", sans-serif;
}
.bm-filter-group select:focus {
  border-color: var(--teal-d);
}

/* KPI-kort */
.bm-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.bm-kpi-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.15s;
}
.bm-kpi-card:hover {
  transform: translateY(-2px);
}
.bm-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.bm-kpi-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bm-kpi-val {
  font-family: "Sansita", serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bm-kpi-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Diagram */
.bm-chart {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.bm-chart-wide {
  grid-column: 1 / -1;
}
.bm-chart-title {
  font-family: "Sansita", serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.1px;
  margin-bottom: 12px;
}
.bm-chart-empty {
  padding: 24px;
  text-align: center;
  color: var(--ink3);
  font-size: 13px;
  font-style: italic;
}
.bm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 8px;
}
.bm-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
}
.bm-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* Grid för diagram */
#bm-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) {
  #bm-charts-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobil-finputs för benchmark + ålderssida */
@media (max-width: 640px) {
  /* Modul-tabs på mobil: lägre padding, mindre font, en per rad om det knäpper */
  .bm-mod-tab {
    padding: 8px 12px;
    font-size: 12px;
    gap: 8px;
  }
  .bm-mod-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  /* KPI-kort blir kompaktare */
  .bm-kpis {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .bm-kpi-card {
    padding: 10px 12px;
    gap: 8px;
  }
  .bm-kpi-icon {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
  .bm-kpi-val {
    font-size: 16px;
  }
  .bm-kpi-lbl {
    font-size: 10px;
  }
  /* Diagram-kort lite mindre padding */
  .bm-chart {
    padding: 12px;
  }
  .bm-chart-title {
    font-size: 12px;
  }
}
@media (max-width: 480px) {
  /* KPI:er till en kolumn på riktigt smal skärm */
  .bm-kpis {
    grid-template-columns: 1fr;
  }
  /* Filter-rad: en filter per rad */
  .bm-filter-group {
    width: 100%;
  }
  .bm-filter-group select {
    flex: 1;
  }
}
