:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1d2433; --muted: #667085; --line: #e3e6eb;
  --accent: #2f6fec; --accent-ink: #fff; --danger: #c4372b; --ok: #1a7f4b; --today: #fff7e0;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea, select { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; background: #fff; min-width: 0; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { width: 100%; resize: vertical; }
button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .45rem .8rem; cursor: pointer; }
button:hover { background: #f0f2f5; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--danger); }
button.link { border: 0; background: none; color: var(--accent); }
button.icon { border: 0; background: none; color: var(--muted); padding: .3rem .5rem; }
button.icon:hover { color: var(--danger); }
button.add { border-style: dashed; color: var(--accent); margin-top: .4rem; }

.login { max-width: 340px; margin: 15vh auto; background: var(--card); padding: 2rem; border-radius: 14px; display: grid; gap: .8rem; box-shadow: 0 2px 10px #0001; }
.error { color: var(--danger); margin: 0; }

.top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; padding: .7rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; }
.classpick, .weeknav { display: flex; gap: .4rem; align-items: center; }
.weeklabel { display: grid; text-align: center; min-width: 7.5rem; line-height: 1.2; }
.badge { margin-left: auto; font-size: .85rem; color: var(--muted); }
.badge.saved { color: var(--ok); }
.badge.error { color: var(--danger); font-weight: 600; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; padding: 1.25rem; max-width: 1400px; margin: 0 auto; }
.side { position: sticky; top: 4.5rem; align-self: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.welcome { max-width: 520px; margin: 3rem auto; }
.rows { display: grid; gap: .45rem; }
.row { display: flex; gap: .45rem; align-items: center; }
.row .grow { flex: 1; }
.row .mid { width: 9rem; }
.subj { width: 9rem; flex: none; }
input.big { width: 100%; font-size: 1.1rem; }

.days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
.day { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: .6rem; }
.day.today { background: var(--today); }
.dayentry { display: grid; gap: .3rem; margin-bottom: .5rem; padding-bottom: .5rem; border-bottom: 1px dashed var(--line); }
.dayentry .subj { width: 100%; flex: 1; }
.day .add { width: 100%; }
.footactions { display: flex; gap: .6rem; justify-content: flex-end; }

.qrcard { text-align: center; }
.qr { width: 100%; max-width: 240px; image-rendering: pixelated; display: block; margin: .5rem auto; }
.qrcard .actions { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin: .6rem 0; }
.qrcard details { text-align: left; margin-top: .8rem; }
.preview { display: inline-block; margin: .2rem 0; color: var(--accent); text-decoration: none; font-weight: 600; }
.printonly { display: none; }

@media (max-width: 1100px) { .days { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; padding: .75rem; }
  .side { position: static; order: -1; }
  .row { flex-wrap: wrap; }
  .row .grow { flex-basis: 100%; }
}

@media print {
  body { background: #fff; }
  .top, .editor, .noprint, details { display: none !important; }
  .layout { display: block; }
  .qrcard { border: 0; margin: 10vh auto; }
  .qr { max-width: 70vw; }
  .printonly { display: block; font-size: 1.8rem; font-weight: 700; }
  .qrcard .printtitle { font-size: 1.8rem; }
  .qrcard .printsub { font-size: 1.15rem; margin: .5rem auto 1rem; max-width: 32em; }
}

/* Ukeplan / Timeplan tabs */
.tabs { display: flex; background: #eef1f6; border-radius: 10px; padding: 3px; }
.tabs button { border: 0; background: none; border-radius: 8px; padding: .35rem .9rem; font-weight: 600; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #0002; }
.tt .times { gap: .3rem; }
.tt .times input.time { flex: 1; width: 0; min-width: 0; padding: .4rem; text-align: center; font-variant-numeric: tabular-nums; }
.tt .times input.bad { outline: 2px solid var(--danger); }
.tt .dayentry > input { width: 100%; }
.tt .note { font-size: .85rem; }

/* Fag */
/* Fag: fagene som en knapperad øverst (bryter over flere linjer), redigering under */
.fagwrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.faglist { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .7rem; }
.faglist > h2 { display: none; }
.faglist .fagbtn { flex: none; white-space: nowrap; border: 1px solid var(--line); padding: .45rem .8rem; border-radius: 999px; background: var(--card); }
.faglist .fagbtn.on { background: hsl(var(--hue) 70% 93%); border-color: hsl(var(--hue) 55% 70%); }
.faglist .fagbtn .count { margin-left: .3rem; }
.faglist .add, .faglist .link { flex: none; white-space: nowrap; margin: 0; }
.fagbtn { display: flex; align-items: center; gap: .5rem; text-align: left; border: 0; background: none; padding: .5rem .6rem; border-radius: 8px; }
.fagbtn.on { background: hsl(var(--hue) 70% 93%); font-weight: 600; }
.fagbtn .dot { width: .7rem; height: .7rem; border-radius: 50%; background: hsl(var(--hue) 55% 50%); flex: none; }
.fagbtn .count { margin-left: auto; font-size: .75rem; color: var(--muted); }
.fagedit .row .big { flex: 1; }
.period { width: 9rem; flex: none; }
.notes { background: #fffdf5; }

.dropzone.over { outline: 3px dashed var(--accent); outline-offset: -6px; background: #f3f7ff; }
.uploadbar { display: flex; gap: .6rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: .6rem; padding: .6rem .8rem; border: 1px dashed var(--line); border-radius: 10px; }
.imgrow .thumb { width: 88px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.combo { position: absolute; z-index: 50; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px #0002; max-height: 260px; overflow-y: auto; }
.combo li { padding: .4rem .6rem; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.combo li:hover, .combo li.active { background: #eef3ff; }
.combo li.active { font-weight: 600; }
.remember { display: flex; gap: .4rem; align-items: center; color: var(--muted); }
.role { padding: .15rem .5rem; border: 1px solid var(--line); border-radius: 99px; }
.teacherpin { margin-top: .8rem; padding: .7rem; background: #f6f8fb; border-radius: 8px; }
.teacherpin code { font-size: 1.1rem; font-weight: 700; letter-spacing: .08em; }
.tplbanner { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .8rem 1rem; margin-bottom: .8rem; background: #eef3ff; border-radius: 10px; }
.daytoggles { display: flex; gap: 3px; flex: none; }
.daytoggles button { padding: .35rem .45rem; font-size: .8rem; border-radius: 6px; color: var(--muted); min-width: 2.4rem; }
.daytoggles button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.daytoggles button.all { min-width: 0; border-style: dashed; }
.row input.date { width: 10rem; flex: none; }

/* Import */
.impdrop { border: 2px dashed var(--line, #ccc); border-radius: 12px; padding: 1.5rem; text-align: center; color: var(--muted); background: #fafafa; }
.impdrop.over { border-color: var(--accent); background: #eef4ff; color: var(--accent); }
.impdrop:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.impbar { display: flex; flex-direction: column; gap: .5rem; }
.impbar h2, .impbar p { margin: 0; }
.impactions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; position: sticky; bottom: 0; z-index: 5; background: var(--card); padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
.impactions .muted { margin-right: auto; }
.impgroup > h3 { margin: 0 0 .6rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.improw { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem; border: 1px solid var(--line, #e5e5e5); border-radius: 10px; margin-bottom: .45rem; background: #fff; }
.improw.off { opacity: .5; background: #f6f6f6; }
.improw.haswarn { border-color: #e0a100; background: #fffaf0; }
.improw > input[type=checkbox] { margin-top: .5rem; width: 1.1rem; height: 1.1rem; flex: none; }
.impmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.impmain textarea { width: 100%; min-height: 2.4rem; resize: vertical; font: inherit; }
.impctl { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.impctl select, .impctl input { width: auto; }
.impctl input.subj { width: 9rem; }
.why { font-style: italic; }
.warn { color: #9a6700; }
.warnline { background: #fff4d6; border: 1px solid #e0a100; border-radius: 8px; padding: .5rem .75rem; color: #6b4a00; }

.row:has(.testpensum) { flex-wrap: wrap; padding-bottom: .6rem; border-bottom: 1px dashed var(--line); }
.row:has(.testpensum) > input.grow:not(.testpensum) { flex: 1 1 11rem; }
.row .testpensum { resize: vertical; font: inherit; line-height: 1.4; min-height: 2.2rem; }
.row input.testpensum, .row textarea.testpensum { flex: 2 1 16rem; background: #fbfaf5; }

textarea.pensumtext { resize: vertical; min-height: 2.4rem; font: inherit; line-height: 1.4; overflow: hidden; }
button.link.clearall { color: var(--danger); margin-right: auto; }

/* Forhåndsvisning av appen */
/* Av/på-bryter til høyre i toppen */
.pvbtn { display: inline-flex; align-items: center; gap: .5rem; }
.pvbtn .switch { position: relative; width: 2.1rem; height: 1.2rem; border-radius: 99px; background: #cfd4dc; transition: background .15s; flex: none; }
.pvbtn .switch::after { content: ''; position: absolute; top: .15rem; left: .15rem; width: .9rem; height: .9rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .15s; }
.pvbtn.on { border-color: var(--accent); color: var(--accent); }
.pvbtn.on .switch { background: var(--accent); }
.pvbtn.on .switch::after { transform: translateX(.9rem); }
/* Toppen har to linjer for alle: valg og innlogging øverst, ukevelger og forhåndsvisning under */
.toprow2 { flex: 1 1 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.toprow2 > .topright { justify-self: end; display: flex; gap: .5rem; align-items: center; }
.toprow2 .weeknav { gap: .6rem; position: relative; }
.toprow2 .weeknav > button:not(.link) { min-width: 2.9rem; min-height: 2.6rem; font-size: 1.05rem; }
.toprow2 .weeklabel { min-width: 10rem; }
.toprow2 .weeklabel strong { font-size: 1.3rem; }
.toprow2 .weeklabel .small { font-size: .85rem; }
.toprow2 .weeknav .thisweek { position: absolute; left: 100%; margin-left: .4rem; white-space: nowrap; }
.classpick select { max-width: 7.5rem; }
.top > .groupbar { flex: 1 1 0; min-width: 0; }
@media (max-width: 820px) { .tabmore { display: none; } .toprow2 { display: contents; } .toprow2 > .topright { display: contents; } .pdfbtn { order: 6; flex: 1 1 100%; } .toprow2 .weeknav .thisweek { position: static; margin: 0; } .toprow2 .weeklabel { min-width: 0; } .top > .groupbar { flex: 1 1 100%; } }
.pvpane { position: fixed; top: calc(var(--toph, 76px) + .5rem); right: 1rem; bottom: 1rem; width: 404px; z-index: 30; display: flex; flex-direction: column; gap: .4rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: .7rem .8rem; box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.pvhead { display: flex; align-items: center; justify-content: space-between; }
.pvhead .icon { font-size: 1.4rem; }
.pvphone { flex: 1; min-height: 0; border: 10px solid #1d2433; border-radius: 28px; overflow: hidden; background: #fff; }
.pvframe { width: 100%; height: 100%; border: 0; display: block; }
body.withpreview .layout { margin-right: 420px; max-width: none; }
@media (max-width: 1150px) { body.withpreview .layout { margin-right: 0; } .pvpane { width: 360px; } }
@media print { .pvpane { display: none; } }
/* Med forhåndsvisning: QR-kortet skjules så redigeringen får plass (QR-koden er tilbake når forhåndsvisningen lukkes) */
body.withpreview .layout { grid-template-columns: minmax(0, 1fr); }
body.withpreview .layout > .side { display: none; }

.scopepick { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.scopeopt { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .9rem; }
.scopeopt.on { border-color: var(--accent); background: #eef4ff; color: var(--accent); font-weight: 600; }

/* PIN-koder */
.pintable { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
.pintable th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
.pintable td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pintable tr.current td { background: #f5f8ff; }
.pintable code.pin { font-size: 1.15rem; letter-spacing: .12em; font-weight: 600; }
.pintable input.pinname { font-weight: 700; font-size: 1rem; width: 100%; max-width: 14rem; border: 1px solid transparent; background: transparent; padding: .3rem .45rem; border-radius: 6px; }
.pintable input.pinname:hover { border-color: var(--line); background: #fff; }
.pintable input.pinname:focus { border-color: #3b6fd8; background: #fff; outline: none; }
@media print { .pintable input.pinname { border: 0; } }
.pinactions { text-align: right; white-space: nowrap; }
.pinactions button { margin-left: .4rem; }
.pinfoot { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
pre.cmd { background: #f4f5f7; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; overflow-x: auto; font-size: .85rem; }
@media print { .pinactions, .pinfoot button, .top, .pvpane, body:has(.pins) .side { display: none !important; } .pins .card:last-child { display: none; } }
.pins h3 { margin: 1.2rem 0 .2rem; font-size: 1rem; }
.pintable input.pingrade { width: 3.2rem; text-align: center; font-weight: 600; border: 1px solid transparent; background: transparent; padding: .3rem .3rem; border-radius: 6px; }
.pintable input.pingrade:hover { border-color: var(--line); background: #fff; }
.pintable input.pingrade:focus { border-color: #3b6fd8; background: #fff; outline: none; }
.pinfoot + .pinfoot { margin-top: .8rem; }
.card.groupnote { background: #f2f6ff; border-color: #c9d8f8; }
.card.groupnote p { margin: .3rem 0 0; }
@media print { .pintable input.pingrade { border: 0; } }
.subj.warnlang { border-color: #e08a2c; background: #fff6ec; text-decoration: line-through; }
.fagwrap.single { grid-template-columns: minmax(0, 1fr); }
.fagtitle { margin: 0 0 .2rem; }
.pvexample { display: block; background: #fff6dd; border: 1px solid #f0d58a; border-radius: 8px; padding: .5rem .7rem; color: #5a4300; line-height: 1.4; }
.langswitch { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .8rem; margin: .4rem 0 .6rem; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; cursor: pointer; }
.langswitch.on { background: #eef8f1; border-color: #9fd3b0; }
.langswitch input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; }
.row.filerow .fileicon { font-size: 1.6rem; text-decoration: none; width: 2.6rem; text-align: center; }

/* ---------- Mobil ---------- */
details.qrfold { padding: 0; }
details.qrfold > summary { padding: .85rem 1rem; font-weight: 600; cursor: pointer; list-style-position: inside; }
details.qrfold > .qrcard { border: 0; margin: 0; padding-top: 0; }
@media (max-width: 820px) {
  html { -webkit-text-size-adjust: 100%; }
  input, select, textarea, button { font-size: 16px; } /* hindrer at iPhone zoomer inn i feltene */
  .top { position: static; gap: .5rem; padding: .6rem .75rem; }
  .brand { font-size: .95rem; flex: 1 1 auto; }
  .classpick { order: 0; }
  .classpick select { max-width: 11rem; }
  .tabs { order: 2; flex: 1 1 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; flex: none; padding: .45rem .8rem; }
  .weeknav { order: 3; flex: 1 1 100%; justify-content: space-between; position: sticky; top: 0; }
  .weeknav .weeklabel { flex: 1; }
  .weeknav button { min-width: 2.75rem; min-height: 2.5rem; }
  .pvbtn { display: none; } /* forhåndsvisning gir ikke mening på mobilen; åpne appen i stedet */
  .badge { order: 4; margin-left: 0; }
  .role { order: 5; }
  .top > .link { order: 6; margin-left: auto; }
  .side { order: 1; position: static; }
  .card { padding: .85rem .8rem; border-radius: 10px; margin-bottom: .75rem; }
  .row { flex-wrap: wrap; row-gap: .35rem; }
  .row .grow, .row .subj, .row input.testpensum, .row textarea.testpensum { flex: 1 1 100%; width: auto; }
  .row input.date, .row .period { flex: 1 1 8rem; width: auto; }
  .row > .icon { margin-left: auto; }
  .daytoggles { flex-wrap: wrap; }
  .days { grid-template-columns: 1fr; }
  /* Fag: fagene som en vannrett rad med knapper øverst, ikke en lang liste */
  .faglist { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: .35rem; padding: .5rem; position: static; -webkit-overflow-scrolling: touch; }
  .faglist > h2 { display: none; }
  .faglist .fagbtn { flex: none; white-space: nowrap; border: 1px solid var(--line); padding: .45rem .7rem; }
  .faglist .fagbtn .count { margin-left: .3rem; }
  .faglist .add, .faglist .link { flex: none; white-space: nowrap; }
  .fagedit { scroll-margin-top: .5rem; }
  /* PIN-tabellen: hver klasse/gruppe som en liten blokk i stedet for en bred tabell */
  .layout > * { min-width: 0; }
  .pintable, .pintable tbody { display: block; width: 100%; }
  .pintable thead { display: none; }
  .pintable tr { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .2rem .4rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
  .pintable td { border: 0; padding: 0; }
  .pintable td.pinactions { grid-column: 1 / -1; text-align: left; display: flex; gap: .4rem; }
  .pintable td.pinactions button { margin: 0; flex: 1; }
  .pintable input.pinname { max-width: none; }
  .faglist { position: sticky; top: 0; z-index: 4; box-shadow: 0 2px 6px #0001; }
  .fagedit { scroll-margin-top: 4.5rem; }
  .footactions { flex-wrap: wrap; justify-content: stretch; }
  .footactions > * { flex: 1 1 100%; }
}

/* Språklærere: fagvelger som knapperad øverst – alle fagene synlige uten scrolling */
.groupbar { display: flex; flex-wrap: wrap; gap: .4rem; padding: .25rem 0; }
.groupbar .groupchip { flex: none; white-space: nowrap; border: 1px solid var(--line); padding: .45rem .8rem; border-radius: 999px; cursor: pointer; background: var(--card); }
.groupbar .groupchip.on { background: hsl(var(--hue) 70% 93%); border-color: hsl(var(--hue) 55% 70%); }
.groupbar .groupchip .count { margin-left: .3rem; }
@media (max-width: 820px) {
  .groupbar { gap: .3rem; }
  .groupbar .groupchip { padding: .35rem .65rem; font-size: .9rem; }
}
@media (min-width: 821px) and (max-width: 1400px) { .top .role { display: none; } .tabs button { padding-left: .7rem; padding-right: .7rem; } }

/* Import av timeplan fra PDF/bilde */
.ttimp .status.error { color: var(--danger); }
.ttimpwrap { display: grid; gap: 1rem; }
.ttimp .ttrow { gap: .3rem; flex-wrap: nowrap; }
.ttimp .ttrow input.time { width: 4.2rem; flex: none; }
.ttimp .ttrow input.grow { flex: 1; min-width: 0; }
.ttimpsrc img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; margin-top: .5rem; }
.ttimp .ttsubj { width: 100%; margin-top: .3rem; }
.ttimp .ttrow input.time { width: auto; flex: 1; min-width: 0; }
.ttimp .day { min-width: 0; }
.ttimp input { min-width: 0; box-sizing: border-box; }
.ttimp .ttrow input.time { flex: 1 1 0; width: 0; padding-left: .35rem; padding-right: .35rem; }

/* PC og større skjermer: skriften to hakk større (mobil er som før) */
@media (min-width: 821px) { html { font-size: 18px; } body { font-size: 17px; } }
@media (min-width: 821px) {
  .toprow2 { grid-template-columns: minmax(0, 1fr) auto auto; }
  .toprow2 > .topright > * { white-space: nowrap; flex: none; }
}
@media (max-width: 820px) { .top .logout { order: 5; margin-left: auto; } }

/* Beskjed når en annen lærer har endret samtidig */
.syncnotice { position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 1rem); max-width: min(560px, calc(100vw - 2rem)); background: #1d2433; color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: 0 8px 24px #0003; font-size: .95rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.syncnotice.show { opacity: 1; transform: translate(-50%, 0); }

/* PDF-meny: ukeplan eller aktivitetskalender */
.pdfmenu { position: relative; }
.pdfmenu > summary { list-style: none; cursor: pointer; border: 1px solid var(--line, #d0d7e2); border-radius: 8px; padding: .35rem .8rem; background: #fff; white-space: nowrap; }
.pdfmenu > summary::-webkit-details-marker { display: none; }
.pdfmenu > summary::after { content: ' ▾'; color: #888; }
.pdfmenu[open] > summary { background: #eef1f6; }
.pdfmenu .pdfitems { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: grid; gap: 2px; min-width: 16rem; padding: 4px; background: #fff; border: 1px solid #d0d7e2; border-radius: 10px; box-shadow: 0 6px 20px rgb(0 0 0 / .15); }
.pdfmenu .pdfitems button { text-align: left; border: 0; background: none; padding: .5rem .7rem; border-radius: 6px; white-space: nowrap; }
.pdfmenu .pdfitems button:hover { background: #eef1f6; }
@media (max-width: 820px) { .pdfmenu .pdfitems { left: 0; right: auto; } }

/* Aktiviteter i Ukas info */
.actcard .actdate { width: 10.5rem; flex: none; }
.actcard .actscope { font-size: .8rem; color: var(--muted, #667); white-space: nowrap; align-self: center; }
.actcard .actadd { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed #d0d7e2; }
.actcard .actadd select { flex: none; }
.actcard details.actall { margin-top: .8rem; }
.actcard details.actall summary { cursor: pointer; color: var(--accent, #2a5db0); }
.actcard .actweek { margin: .5rem 0 .1rem; }
@media (max-width: 820px) { .actcard .row { flex-wrap: wrap; } .actcard .actdate { width: auto; } .actcard .actadd .grow { flex: 1 1 100%; } }

/* Varsel før automatisk utlogging */
.idlewarn { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  max-width: calc(100vw - 32px); background: #1f2937; color: #fff; padding: .7rem 1rem; border-radius: 12px; box-shadow: 0 6px 24px rgb(0 0 0 / .3); }
.idlewarn .link { color: #cfe0ff; }
.idleset { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: .3rem 0 1rem; }
.idleset label { display: flex; align-items: center; gap: .5rem; }

/* ---------- deling med andre klasser på trinnet (👥) ---------- */
.sharepick { position: relative; flex: none; }
.sharepick > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; background: #fff; white-space: nowrap; font-size: .85em; color: var(--muted); }
.sharepick > summary::-webkit-details-marker { display: none; }
.sharepick.shared > summary { color: var(--accent); border-color: var(--accent); background: #eef3fe; font-weight: 600; }
.sharepick[open] > summary { background: #eef1f6; }
.sharepick .sharemenu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: grid; gap: .35rem; min-width: 14rem; padding: .6rem .8rem; background: #fff; border: 1px solid #d0d7e2; border-radius: 10px; box-shadow: 0 6px 20px rgb(0 0 0 / .15); }
.sharepick .sharemenu p { margin: 0; }
.sharepick .sharemenu label { display: flex; align-items: center; gap: .3rem; white-space: nowrap; cursor: pointer; }
.sharepick .sharemenu label.muted { cursor: default; }
