:root {
  color-scheme: light;
  --ink: #26183f;
  --muted: #584d68;
  --line: #e2dbe9;
  --bg: #faf8fc;
  --white: #fff;
  --dark: #26183f;
  --accent: #613b93;
  --lavender: #f0e5fa;
  --mint: #e0f4e8;
  --orange: #79440b;
  --cream: #fff0d3;
  --red: #9b1c1c;
  --rose: #fde8e8;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .65; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #8b51c9; outline-offset: 4px; }
.site-header :focus-visible { outline-color: #ebc9ff; }
.skip { position: fixed; top: -100px; z-index: 10; background: white; padding: 12px; }
.skip:focus { top: 8px; }

.shell { min-height: 100vh; }
.site-header { background: var(--dark); color: white; }
.site-inner {
  max-width: 1264px;
  margin: auto;
  padding: 0 30px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 30px;
  min-height: 74px;
}
.home-button { padding: 0; border: 0; background: none; color: inherit; justify-self: start; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 790; font-size: 22px; letter-spacing: -.045em; }
.mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #e8cdfa; color: #47216b; }
.mark svg { width: 26px; height: 26px; }
.site-header nav { grid-column: 2; grid-row: 1; display: flex; align-self: stretch; justify-content: center; gap: 7px; }
.site-header nav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #f1e7f8;
  font-size: 14px;
  white-space: nowrap;
}
.site-header nav button:hover { background: #ffffff15; }
.site-header nav button[aria-current="page"] { color: white; background: #ffffff12; border-bottom-color: #e8bdfb; font-weight: 720; }
.site-header nav button span { color: #edcafa; font-size: 18px; line-height: 1; }
.account { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13px; }
.account i, .avatar { display: grid; place-items: center; flex: none; border-radius: 50%; font-style: normal; background: var(--lavender); color: #513077; font-size: 12px; font-weight: 750; }
.account i { width: 30px; height: 30px; }
.avatar { width: 36px; height: 36px; }

.main { max-width: 1264px; margin: auto; padding: 30px 30px 52px; }
.hero, .intro { border-radius: 21px; background: var(--lavender); }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: clamp(22px, 4vw, 50px);
  margin-bottom: 20px;
}
.hero-copy { max-width: 570px; }
.hero-art { width: 100%; max-width: 408px; justify-self: end; }
.hero-copy > p:not(.eyebrow) { margin: 0 0 20px; color: var(--muted); font-size: clamp(15px, 1.7vw, 18px); }
.intro { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 20px; padding: clamp(20px, 3.5vw, 36px); }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .13em; font-weight: 770; font-size: 11px; margin: 0 0 9px; }
h1 { font-size: clamp(31px, 5vw, 62px); letter-spacing: -.055em; line-height: 1.06; margin: 0 0 9px; overflow-wrap: anywhere; }
.intro h1 { font-size: clamp(30px, 4vw, 47px); }
h2 { font-size: 23px; letter-spacing: -.035em; margin: 0 0 7px; }
h3 { margin: 0 0 10px; font-size: 17px; }
p { line-height: 1.55; }
.muted, .intro p:last-child { color: var(--muted); }
.intro p:last-child { margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid #c7b8d6;
  border-radius: 9px;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); background: #f6eefb; }
.primary { background: var(--accent); border-color: var(--accent); color: white; }
.primary:hover { background: #4c277c; }
.linkbtn { border: 0; background: transparent; color: var(--accent); font-weight: 730; padding: 7px 0; text-align: left; }
.linkbtn:hover { text-decoration: underline; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat, .panel { background: var(--white); border: 1px solid var(--line); border-radius: 15px; }
.stat { padding: 15px 18px; border-top: 4px solid #b598da; }
.stat:nth-child(2) { border-top-color: #e3ac59; }
.stat.accent { border-top-color: #71ad93; }
.stat:nth-child(4) { border-top-color: #8ea7da; }
.stat p { margin: 0 0 3px; color: var(--muted); font-weight: 680; font-size: 13px; }
.stat strong { display: block; font-size: 32px; line-height: 1.08; letter-spacing: -.045em; }
.stat small { font-size: 12px; color: var(--muted); }
.panel { padding: 21px; margin-bottom: 16px; }
.panelhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panelhead p, .panel > p { margin: 0 0 10px; font-size: 14px; }
.process { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.process li { font-size: 13px; background: #f5effa; border-radius: 9px; padding: 10px; font-weight: 650; overflow-wrap: anywhere; }
.process li span { display: block; color: var(--accent); font-size: 18px; }
.process .past { background: var(--mint); }
.process .active { background: var(--accent); color: white; }
.process .active span { color: white; }

.tablepanel { padding: 0; overflow: hidden; }
.tablepanel .panelhead { padding: 18px 21px 0; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input { width: 210px; }
.filters select { width: auto; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; min-width: 650px; }
.review-table { overflow-x: auto; }
.review-table :is(th, td) { padding: 8px; }
.review-table th { text-transform: none; letter-spacing: normal; font-size: inherit; }
.review-table select { min-width: 200px; }
.review-table table { min-width: 0; }
.review-absence { min-width: 0; border: 1px solid var(--line); border-radius: 9px; }
.attendance-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.attendance-week { display: grid; grid-template-columns: repeat(5, minmax(60px, 1fr)); gap: 6px; overflow-x: auto; padding: 5px; }
.attendance-day { padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); cursor: pointer; }
.attendance-day small { display: block; }
.attendance-day[aria-pressed="true"] { border-color: var(--accent); background: var(--lavender); }
.attendance-day:disabled, .attendance-nav button:disabled { opacity: .5; cursor: default; }
.attendance-options { border: 0; padding: 0; margin: 12px 0 0; }
.attendance-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .875rem; }
.attendance-key-choice { background: none; border: 0; padding: 4px 0; color: var(--ink); cursor: pointer; }
.attendance-key-choice:hover, .attendance-key-choice[aria-pressed="true"] { text-decoration: underline; }
.attendance-code { display: inline-block; min-width: 2em; padding: 1px 5px; border-radius: 5px; text-align: center; font-weight: 700; }
.attendance-code[data-code="T"] { color: #14532d; background: #dcfce7; }
.attendance-code[data-code="S"] { color: #713f12; background: #fef3c7; }
.attendance-code[data-code="FM"] { color: #1e3a8a; background: #dbeafe; }
.attendance-code[data-code="FU"] { color: #7f1d1d; background: #fee2e2; }
.attendance-code[data-code="F"] { color: #334155; background: #e2e8f0; }
th { background: #f5effa; color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
th, td { padding: 10px 15px; border-top: 1px solid var(--line); }
tbody tr:hover { background: #fcf9fe; }
td small { display: block; color: var(--muted); margin-top: 2px; }
.person { display: flex; gap: 10px; align-items: center; }
.badge { display: inline-block; padding: 4px 9px; border-radius: 99px; background: var(--lavender); color: #513077; font-size: 12px; font-weight: 750; white-space: nowrap; }
.badge.wait { background: var(--cream); color: var(--orange); }
.badge.go { background: var(--mint); color: #22523c; }
.badge.late { background: var(--rose); color: var(--red); }
tr.late td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.late-summary { margin: 0 0 10px; color: var(--red); font-weight: 750; }
.empty { padding: 20px; color: var(--muted); }

input, select, textarea { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid #aa9ab9; border-radius: 8px; background: var(--white); color: var(--ink); }
input:not([type="checkbox"]), select { min-height: 44px; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
textarea { min-height: 85px; resize: vertical; }
label { font-size: 14px; font-weight: 650; display: block; }
label > input, label > textarea, label > select { display: block; margin-top: 5px; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.full { grid-column: 1 / -1; }
.plan-fields { min-width: 0; margin: 2px 0; padding: 12px 14px 14px; border: 1px solid #c7b8d6; border-radius: 11px; background: #f8f4fb; }
.plan-fields legend { padding: 0 6px; font-weight: 750; }
.plan-fields [role="status"]:not(:empty) { margin: 0 0 12px; padding: 8px 10px; background: var(--mint); border-radius: 7px; color: #22523c; }
.plan-lookup { padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.plan-lookup summary { color: var(--accent); font-weight: 700; cursor: pointer; }
.period-settings { display: grid; gap: 8px; margin-top: 12px; }
@media (min-width: 641px) {
  [data-form="practice-period"] .formgrid, .review-answers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .review-answers label { display: flex; flex-direction: column; justify-content: space-between; }
}
.plan-lookup [aria-live]:not(:empty) { margin-top: 14px; }
.goal-list { padding-inline-start: 1.7rem; margin: 10px 0 14px; }
.goal-list > li { padding-inline-start: .25rem; margin-block: 8px; overflow-wrap: anywhere; }
.goal-list > li::marker { color: var(--accent); font-weight: 750; }
.goal-editor-row { display: flex; gap: 8px; align-items: start; }
.goal-editor-row textarea { min-height: 62px; font-weight: 400; }
.goal-remove { flex: 0 0 44px; width: 44px; padding: 0; }
.goal-choice { display: flex; align-items: start; gap: 8px; font-weight: 500; }
.goal-choice input { flex: none; margin-top: 4px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.columns { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.callout { border-radius: 10px; background: #f5effa; padding: 13px 15px; margin: 12px 0; }
.callout p { margin: 3px 0 0; }
.results, .entries { list-style: none; padding: 0; margin: 0; }
.results li, .entries li { padding: 11px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.results li:first-child, .entries li:first-child { border-top: 0; }
.entry-date { display: flex; align-items: center; gap: 6px; }
.entry-edit { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--accent); cursor: pointer; }
.entry-edit:hover, .entry-edit[aria-expanded="true"] { background: var(--lavender); }
.results li { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.results small, .entries small { display: block; color: var(--muted); }
.checklist { display: grid; gap: 10px; margin: 10px 0; }
.checklist label { display: flex; gap: 8px; align-items: start; font-weight: 500; }
.checklist input { margin-top: 4px; }
.shared { max-width: 820px; margin: auto; padding: 24px 18px; }
.shared .brand { margin-bottom: 20px; }
.shared-period { flex: 0 1 auto; min-width: 0; max-width: 100%; padding: 12px 16px; border-radius: 12px; background: var(--white); overflow-wrap: anywhere; }
.shared-period h2 { margin: 0 0 4px; font-size: 1rem; }
.shared-period time { font-weight: 700; }
.loading { padding: 30px; }
#toast { position: fixed; bottom: 18px; right: 18px; max-width: min(420px, 90vw); background: var(--dark); color: white; border-radius: 9px; padding: 11px 16px; z-index: 5; box-shadow: 0 3px 15px #26183f30; }
#toast:empty { display: none; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.notice { margin: 0; color: var(--muted); font-size: 13px; }
dialog { border: 1px solid var(--line); border-radius: 17px; max-width: 540px; width: calc(100% - 30px); padding: 24px; color: var(--ink); }
dialog::backdrop { background: #26183f80; }

@media (max-width: 940px) {
  .site-inner { grid-template-columns: 1fr auto; gap: 0; padding-top: 12px; }
  .account { grid-column: 2; }
  .site-header nav { grid-column: 1 / -1; grid-row: 2; justify-content: start; margin-top: 8px; flex-wrap: wrap; }
  .columns { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .site-inner, .main { padding-left: 14px; padding-right: 14px; }
  .site-header nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 4px; }
  .site-header nav button { padding: 0 6px; font-size: 13px; }
  .main { padding-top: 16px; }
  .hero { grid-template-columns: 1fr; gap: 8px; padding: 22px; }
  .hero-art { max-width: 200px; max-height: 112px; justify-self: end; }
  .intro { align-items: start; flex-direction: column; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px; }
  .panel { padding: 15px; }
  .tablepanel { padding: 0; }
  .tablepanel .panelhead { padding-left: 14px; padding-right: 14px; }
  .process { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .formgrid { grid-template-columns: 1fr; }
  .results li { flex-wrap: wrap; }
}

.period-lines { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 4px 0 12px; }
.period-lines legend { font-weight: 750; padding: 0 4px; }
.period-lines .muted { margin: 0; font-size: 13px; }
.line-hint { display: block; color: var(--muted); margin-top: 4px; min-height: 0; }
.line-hint:empty { display: none; }
.line-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 10px; }
.line-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; align-items: end; }
@media (max-width: 560px) {
  .line-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .line-row label:first-child { grid-column: 1 / -1; }
}
/* Praksissaker som kort på smale skjermer */
@media (max-width: 720px) {
  .tablepanel .panelhead { display: block; }
  .filters { margin-top: 10px; }
  .filters input, .filters select { flex: 1 1 100%; width: 100%; min-height: 44px; }
  .tablepanel .scroll { overflow: visible; }
  .tablepanel table { min-width: 0; font-size: 14px; }
  .tablepanel thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tablepanel tbody { display: grid; gap: 10px; padding: 0 14px 14px; }
  .case-row {
    position: relative; display: grid; gap: 6px 10px;
    grid-template-columns: 1fr auto;
    grid-template-areas: "person person" "status due" "company company" "next next" "wait wait";
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white);
  }
  .case-row.late { border-color: #f1b8b8; box-shadow: inset 4px 0 0 var(--red); }
  .case-row:active { background: #faf6fd; }
  .case-row td { display: block; padding: 0; border: 0; box-shadow: none !important; min-width: 0; overflow-wrap: anywhere; }
  .c-person { grid-area: person; padding-right: 28px !important; }
  .c-open { position: absolute; top: 16px; right: 14px; font-size: 20px; }
  .c-status { grid-area: status; }
  .c-due { grid-area: due; justify-self: end; }
  .c-due.is-empty { display: none !important; }
  .c-company { grid-area: company; }
  .c-next { grid-area: next; font-weight: 650; }
  .c-wait { grid-area: wait; color: var(--muted); font-size: 13px; }
  .case-row td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 500; }
  /* Hele kortet kan trykkes */
  .case-link::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
  .case-link:focus-visible { outline: none; }
  .case-row:has(.case-link:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
  .tablepanel td.empty { border: 0; padding: 14px 0; }
  .hero-art { display: none; }
  .process li { overflow-wrap: normal; hyphens: auto; font-size: 12px; padding: 8px; }
}
/* Skole og skoleår */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.header-right { display: flex; align-items: center; gap: 12px; justify-self: end; min-width: 0; }
.context-picker select { min-height: 36px; max-width: 260px; padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: inherit; font-weight: 650; }
.context-picker option, .context-picker optgroup { color: var(--ink); background: #fff; }
.archive-note { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--cream); color: var(--orange); }
@media (max-width: 640px) {
  .header-right { gap: 8px; }
  .context-picker select { max-width: 170px; font-size: 13px; }
  .context-picker select { max-width: 150px; }
}
.header-right { grid-column: 3; grid-row: 1; }
@media (max-width: 940px) { .header-right { grid-column: 2; } }
/* Avtalte bedrifter og linjevalg som brikker */
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip { font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 99px; background: var(--lavender); color: #513077; }
.chip.all { background: #eef0f2; color: var(--muted); }
.chip-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip-button { border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: 99px; padding: 5px 12px; font-size: 13px; font-weight: 650; cursor: pointer; min-height: 32px; }
.chip-button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-choices { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip-toggle { position: relative; cursor: pointer; }
.chip-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-toggle span { display: inline-block; border: 1px solid var(--line); background: var(--white); border-radius: 99px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.chip-toggle input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-toggle input:checked + span::before { content: "✓ "; }
.chip-toggle input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.period-lines .muted { font-size: 12px; margin: 4px 0 0; }
.partner-list { list-style: none; margin: 0; padding: 0; }
.partner-row { border-top: 1px solid var(--line); padding: 12px 0; }
.partner-row:first-child { border-top: 0; }
.partner-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.partner-text strong { display: block; }
.partner-text small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.partner-edit, .partner-new { margin-top: 12px; padding: 14px; border-radius: 12px; background: #faf6fd; border: 1px solid var(--line); }
.partner-edit > .muted { margin: 0 0 4px; font-size: 13px; }
.partner-new h3 { margin: 0 0 6px; }
@media (max-width: 520px) {
  .partner-main { grid-template-columns: minmax(0, 1fr) auto; }
  .partner-main .avatar { display: none; }
}
.context-picker { flex: none; }
.context-picker select { width: auto; min-width: 0; max-width: 280px; text-overflow: ellipsis; }
@media (max-width: 640px) { .context-picker select { min-width: 0; width: 170px; } }
/* Med skolevelger trengs mer plass: menyen går til egen rad tidligere. */
@media (max-width: 1180px) {
  .site-inner { grid-template-columns: 1fr auto; gap: 0; padding-top: 12px; }
  .header-right { grid-column: 2; }
  .site-header nav { grid-column: 1 / -1; grid-row: 2; justify-content: start; margin-top: 8px; flex-wrap: wrap; }
}
/* Meny: korte navn vises bare på mobil */
.site-header nav em { font-style: normal; }
.nav-short { display: none; }
/* Mobil: kompakt topplinje og fast meny nederst, som i en app */
@media (max-width: 640px) {
  .site-inner { grid-template-columns: auto minmax(0, 1fr); gap: 10px; min-height: 56px; padding: 8px 14px; }
  .site-header .brand { font-size: 0; gap: 0; }
  .header-right { grid-column: 2; justify-self: end; min-width: 0; max-width: 100%; }
  .context-picker { min-width: 0; flex: 0 1 auto; }
  .context-picker select { width: 100%; max-width: 100%; font-size: 14px; min-height: 40px; }
  .site-header nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    grid-column: auto; grid-row: auto; margin: 0;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
    background: var(--dark); padding: 2px 2px calc(2px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 14px #26183f40;
  }
  .site-header nav button {
    flex-direction: column; justify-content: center; gap: 3px;
    min-height: 58px; padding: 4px 2px; font-size: 11px; font-weight: 600;
    border-bottom: 0; border-top: 3px solid transparent; border-radius: 0;
  }
  .site-header nav button[aria-current="page"] { border-top-color: #e8bdfb; border-bottom-color: transparent; }
  .site-header nav button span { font-size: 20px; }
  .nav-full { display: none; }
  .nav-short { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .main { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  #toast { left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); max-width: none; }
}
.import-box { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.import-box h3 { margin: 0 0 6px; }
.import-search { display: flex; gap: 8px; align-items: end; }
.import-search label { flex: 1; }
.chip-toggle input:disabled + span { opacity: .6; }
/* Ønsker for praksis */
.wish-step { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 14px; margin: 0 0 14px; background: var(--white); }
.wish-step legend { font-weight: 750; font-size: 16px; padding: 0 6px; display: flex; align-items: center; gap: 8px; }
.wish-step legend span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; }
.goal-picks { display: grid; gap: 6px; margin: 6px 0 10px; max-height: 280px; overflow: auto; padding-right: 4px; }
.wish-summary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0 0 10px; }
.wish-summary dt { font-weight: 700; color: var(--muted); font-size: 13px; padding-top: 2px; }
.wish-summary dd { margin: 0; overflow-wrap: anywhere; }
.wish-summary dd p { margin: 4px 0 0; }
.proposal-list, .candidate-list, .reasons, .notes { list-style: none; margin: 0; padding: 0; }
.proposal { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--white); }
.proposal-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.proposal small, .candidate small { display: block; color: var(--muted); }
.reasons { margin-top: 6px; font-size: 13px; }
.reasons li { padding-left: 20px; position: relative; margin: 2px 0; }
.reasons li::before { content: "✓"; position: absolute; left: 0; color: #22523c; font-weight: 800; }
.reasons li.warn::before { content: "!"; color: var(--orange); left: 4px; }
.reasons li.warn { color: var(--orange); }
.notes li { background: var(--cream); color: var(--orange); border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; font-size: 13px; }
.analysis { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.analysis h3 { margin: 0 0 4px; }
.candidate { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--white); }
.candidate:has(input:checked) { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.candidate-pick { display: flex; gap: 10px; align-items: start; cursor: pointer; font-weight: 500; }
.candidate-pick input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.candidate-score { display: flex; align-items: center; gap: 10px; margin: 8px 0 0 28px; }
.score-bar { flex: 1; max-width: 220px; height: 6px; border-radius: 99px; background: #eee6f6; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.candidate .reasons { margin-left: 28px; }
@media (max-width: 520px) {
  .wish-summary { grid-template-columns: 1fr; }
  .proposal-head { flex-direction: column; align-items: stretch; }
}
.yff-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #f7f2fc; }
.yff-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.yff-row .chip-choices { margin: 0; }
.yff-row .btn { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.goal-plan { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; background: var(--white); }
.goal-plan summary { cursor: pointer; font-weight: 700; }
/* Analyse i søyler. Faste farger per faktor (validert kategorisk palett, lys modus). */
:root { --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; }
[data-factor="avtale"] { background: var(--series-1); }
[data-factor="eget"] { background: var(--series-2); }
[data-factor="bransje"] { background: var(--series-3); }
[data-factor="maal"] { background: var(--series-7); }
[data-factor="sted"] { background: var(--series-4); }
[data-factor="bedrift"] { background: var(--series-5); }
[data-factor="ferdigheter"] { background: var(--series-6); }
[data-factor="kapasitet"], .swatch.minus, .seg.minus { background: repeating-linear-gradient(135deg, #b9b4c0 0 3px, #ece9f0 3px 6px); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin: 6px 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr) 30px; align-items: center; gap: 8px; width: 100%;
  padding: 6px 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.bar-row:hover { background: #f7f2fc; }
.bar-row.is-picked { border-color: var(--accent); background: #f4ecfb; }
.bar-name { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: flex; gap: 2px; height: 14px; background: #f1edf5; border-radius: 0 4px 4px 0; overflow: hidden; }
.seg { display: block; height: 100%; min-width: 2px; }
.seg.total { background: var(--accent); }
.seg:last-child { border-radius: 0 4px 4px 0; }
.bar-value { font-size: 13px; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }
.weight-box { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.weight-box summary { cursor: pointer; font-weight: 700; }
.weights { display: grid; gap: 6px; margin-top: 8px; }
.weight { display: grid; grid-template-columns: 12px minmax(0, 1fr) minmax(80px, 1fr) 36px; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.weight input { width: 100%; accent-color: var(--accent); }
.weight output { font-variant-numeric: tabular-nums; text-align: right; color: var(--muted); }
.weights .btn { justify-self: start; min-height: 32px; font-size: 13px; }
.viz-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--dark); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; max-width: 260px; box-shadow: 0 3px 12px #26183f40; }
.viz-inline { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
@media (min-width: 941px) { .viz-inline { display: none; } }
@media (max-width: 940px) { .viz-side { display: none; } .columns > div:last-child > .panel:has(.viz-side) { display: none; } }
/* Analyse i sanntid */
.live-head { margin: 0 0 4px; font-size: 14px; }
.live-row { cursor: pointer; }
.delta { display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 700; }
.delta.up { color: #22523c; }
.delta.down { color: var(--orange); }
.delta.new { color: var(--accent); }
.bar-row.live-row { grid-template-columns: minmax(0, 38%) minmax(0, 1fr) 54px; }
.live-drawer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--white); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px #26183f26; max-height: 70vh; display: flex; flex-direction: column; }
.live-toggle { display: flex; gap: 8px; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 8px 16px;
  border: 0; background: var(--dark); color: #fff; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.live-toggle [data-live-status] { flex: 1; color: #e8daf5; font-size: 13px; }
.live-body { display: none; overflow: auto; padding: 10px 16px 14px; }
.live-drawer.open .live-body { display: block; }
.shared { padding-bottom: 80px; }
@media (min-width: 941px) { .shell .live-drawer { display: none; } }
@media (max-width: 640px) { .shell .live-drawer { bottom: calc(62px + env(safe-area-inset-bottom)); } }
/* Sanntidsanalysen følger med når læreren blar i skjemaet */
@media (min-width: 941px) {
  .columns > div:last-child > .panel:has(.viz-side[data-live]) { position: sticky; top: 12px; z-index: 2; max-height: calc(100vh - 24px); overflow: auto; }
}
/* Hvorfor denne bedriften? */
.explain-wrap { margin-top: 6px; }
.explain-btn { font-size: 13px; padding: 4px 0; }
.explain-box { margin-top: 8px; padding: 12px 14px; border-radius: 10px; background: #faf6fd; border: 1px solid var(--line); font-size: 14px; }
.explain-box h4 { margin: 12px 0 4px; font-size: 14px; }
.explain-sum { margin: 0; }
.explain-list { margin: 0; padding-left: 18px; }
.explain-list li { margin: 3px 0; }
.web-card { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--white); border: 1px solid var(--line); }
.web-card strong { display: block; }
.web-card p { margin: 4px 0 6px; }
.web-card .muted { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 12px; margin: 10px 0 0; font-size: 13px; }
.facts dt { color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.checks { margin-left: 0; }
.explain-box .source { font-size: 12px; margin: 10px 0 0; }
.live-explain { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.live-explain-title { margin: 0 0 6px; font-size: 15px; }
.live-explain .explain-box { margin-top: 0; }
/* Elevsiden: ønskeskjema med analyse i sanntid ved siden av */
.shared.has-live { max-width: 1240px; }
.wish-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.wish-live { position: sticky; top: 12px; }
.wish-live .panel { max-height: calc(100vh - 24px); overflow: auto; }
@media (min-width: 941px) { .has-live .live-drawer { display: none; } }
@media (max-width: 940px) { .wish-layout { grid-template-columns: 1fr; } .wish-live { display: none; } }
/* Innlogging og konto */
.login-page { max-width: 460px; }
.login-box h1 { margin-top: 0; }
.login-box form { display: grid; gap: 12px; margin: 12px 0; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-name { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.account-name small { font-weight: 500; opacity: .8; font-size: 11px; }
.account-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; display: grid; gap: 4px; min-width: 170px;
  padding: 8px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 8px 24px #26183f33; }
.account-menu .menu .btn { width: 100%; justify-content: flex-start; }
.pw-row { display: flex; gap: 6px; }
.pw-row input { flex: 1; font-family: ui-monospace, monospace; }
table.audit { min-width: 560px; font-size: 13px; }
table.audit td { vertical-align: top; }
@media (max-width: 640px) { .account-name { display: none; } }
.panel .facts + h3 { margin-top: 16px; }
.period-readonly { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.results li > .btn { margin-left: auto; flex: none; }
.context-text { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 650; font-size: 14px; white-space: nowrap; }
.context-text .context-school { overflow: hidden; text-overflow: ellipsis; }
.context-text .context-picker select { min-width: 0; width: auto; max-width: 150px; }
@media (max-width: 640px) { .context-text .context-school { display: none; } }
dialog.wide-dialog { width: min(760px, calc(100vw - 24px)); max-width: none; }
table.import-table { width: 100%; font-size: 14px; }
table.import-table td, table.import-table th { padding: 6px 8px; text-align: left; vertical-align: middle; }
table.import-table select { min-width: 110px; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.student-table { width: 100%; font-size: 14px; }
.student-table th, .student-table td { padding: 8px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
.student-table thead th { border-top: 0; }
.link-button { border: 0; background: none; padding: 0; color: var(--purple, #634497); font: inherit; font-weight: 650; cursor: pointer; text-align: left; }
.link-button:hover { text-decoration: underline; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 10px; }
.filters .grow { flex: 1 1 240px; }
.filters .grow { max-width: 460px; }
.filters .grow input { width: 100%; }
@media (max-width: 640px) {
  .student-table th:nth-child(2), .student-table td:nth-child(2) { display: none; }
  .site-header nav button { font-size: 10px; }
}
.btn.danger { color: #9b1c1c; border-color: #e3b4b4; }
.btn.danger:hover { background: #fbebeb; }
#delete-student-dialog [type=submit] { background: #9b1c1c; border-color: #9b1c1c; color: #fff; }
.absence-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.absence-summary > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.absence-summary dt { font-size: 12px; color: var(--muted); font-weight: 700; }
.absence-summary dd { margin: 2px 0 0; }
.absence-summary strong { font-size: 22px; }
.absence-summary small { display: block; color: var(--muted); font-size: 12px; }
.subnav { display: flex; gap: 4px; margin: 0 0 14px; padding: 4px; border-radius: 12px; background: var(--white, #fff); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; }
.subnav button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 8px 14px; border-radius: 9px; font: inherit; font-weight: 650; font-size: 14px; color: inherit; cursor: pointer; white-space: nowrap; }
.subnav button:hover { background: #f1e9fb; }
.subnav button[aria-current="page"] { background: #634497; color: #fff; }
.subnav .tab-icon { width: 17px; height: 17px; flex: none; opacity: .85; }
.subnav button[aria-current="page"] .tab-icon { opacity: 1; }
@media (max-width: 640px) { .subnav button { padding: 8px 10px; gap: 5px; font-size: 13px; } .subnav .tab-icon { width: 15px; height: 15px; } }
@media (max-width: 640px) { .subnav { flex-wrap: wrap; width: 100%; overflow: visible; } }
