:root {
  --accent: #0067c0;
  --bg: #f3f3f3;
  --border: #e5e5e5;
  --text: #1b1b1b;
  --muted: #616161;
  --sel: #cce4f7;
  --coach: #1e3a8a;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: "Segoe UI", "Segoe UI Variable", system-ui, -apple-system, sans-serif; font-size: 14px; color: var(--text); overflow: hidden; }
button { font-family: inherit; }
.hidden { display: none !important; }

#app { display: flex; height: 100vh; width: 100vw; }

/* ---------- Skrivebord ---------- */
#desktop { flex: 1; position: relative; overflow: hidden; user-select: none;
  background: radial-gradient(ellipse at 20% 20%, #7fc0ff 0%, #3b7dd8 35%, #1d3f8a 75%, #142a5c 100%); }
#desktop-icons { position: absolute; top: 8px; left: 8px; bottom: 60px; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 2px; z-index: 1; }
.dicon { width: 84px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; border-radius: 4px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.9); font-size: 12px; text-align: center; border: 1px solid transparent; }
.dicon:hover { background: rgba(255,255,255,.15); }
.dicon.selected { background: rgba(255,255,255,.28); border-color: rgba(255,255,255,.5); }
.dicon.drop-hover { background: rgba(255,255,255,.35); outline: 2px solid #fff; }
.dicon.cut { opacity: .55; }
.dicon .name { margin-top: 4px; line-height: 1.2; word-break: break-word; max-height: 2.5em; overflow: hidden; }
.dicon .name input { width: 100%; font: inherit; color: #000; text-shadow: none; text-align: center; }

#windows { position: absolute; inset: 0 0 48px 0; pointer-events: none; z-index: 5; }

/* ---------- Vinduer ---------- */
.win { position: absolute; pointer-events: auto; background: #fff; border: 1px solid rgba(0,0,0,.3); border-radius: 8px; box-shadow: 0 10px 36px rgba(0,0,0,.4); display: flex; flex-direction: column; min-width: 480px; min-height: 300px; overflow: hidden; resize: both; outline: none; }
.win.inactive { box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.win.maximized { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; resize: none; }
.win.minimized { display: none; }
.win-title { height: 36px; display: flex; align-items: center; padding-left: 12px; gap: 8px; background: #fff; flex-shrink: 0; cursor: default; border-bottom: 1px solid #f0f0f0; }
.win.inactive .win-title { color: #8a8a8a; }
.win-icon { display: inline-flex; width: 18px; height: 18px; }
.win-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-ctrl { margin-left: auto; display: flex; height: 100%; }
.wc { width: 46px; height: 100%; border: 0; background: transparent; font-size: 12px; color: #333; cursor: default; }
.wc:hover { background: #e8e8e8; }
.wc.close:hover { background: #c42b1c; color: #fff; }
.win-body { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

/* ---------- Oppgavelinje ---------- */
#taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 48px; z-index: 50; background: rgba(238,242,249,.94); backdrop-filter: blur(20px); border-top: 1px solid rgba(0,0,0,.08); display: flex; align-items: center; justify-content: center; }
#taskbar-center { display: flex; gap: 4px; }
.tb-app { width: 44px; height: 40px; border: 0; background: transparent; border-radius: 5px; display: flex; align-items: center; justify-content: center; position: relative; cursor: default; }
.tb-app:hover { background: rgba(0,0,0,.07); }
.tb-app.open::after { content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 6px; height: 3px; border-radius: 2px; background: #7a7a7a; }
.tb-app.active { background: rgba(0,0,0,.09); }
.tb-app.active::after { width: 16px; background: var(--accent); }
#taskbar-right { position: absolute; right: 14px; top: 0; height: 100%; display: flex; align-items: center; }
#clock { font-size: 12px; text-align: center; line-height: 1.25; }
#sim-label { font-size: 10px; line-height: 1.2; text-align: center; color: #555; text-transform: uppercase; letter-spacing: .04em; margin-right: 14px; padding-right: 14px; border-right: 1px solid rgba(0,0,0,.15); }

/* ---------- Start-meny ---------- */
#startmenu { position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%); width: 600px; z-index: 60; background: rgba(243,246,251,.98); border: 1px solid #c8cdd6; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.35); padding: 22px 26px 14px; }
.sm-title { font-weight: 600; margin-bottom: 14px; }
.sm-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sm-app { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px; border-radius: 6px; font-size: 12px; text-align: center; }
.sm-app:hover { background: rgba(0,0,0,.06); }
.sm-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid #d8dce4; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #555; }

/* ---------- Kontekstmeny ---------- */
#ctxmenu, .submenu { position: fixed; z-index: 10000; background: #f9f9f9; border: 1px solid #c8c8c8; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); padding: 4px; min-width: 210px; user-select: none; }
.cm-item { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 4px; position: relative; cursor: default; white-space: nowrap; }
.cm-item:hover { background: #e4e4e4; }
.cm-item.disabled { opacity: .4; pointer-events: none; }
.cm-item .ico { width: 16px; height: 16px; display: inline-flex; flex-shrink: 0; }
.cm-item .kbd { margin-left: auto; color: #777; font-size: 12px; padding-left: 20px; }
.cm-item .arrow { margin-left: auto; color: #666; padding-left: 20px; }
.cm-sep { height: 1px; background: #dcdcdc; margin: 4px 8px; }
.submenu { position: absolute; left: calc(100% - 4px); top: -5px; display: none; }
.cm-item:hover > .submenu { display: block; }

/* ---------- Dialoger ---------- */
#modal-layer { position: absolute; inset: 0; z-index: 100; background: rgba(0,0,0,.22); display: flex; align-items: center; justify-content: center; }
.dlg { background: #fff; border-radius: 8px; box-shadow: 0 14px 44px rgba(0,0,0,.45); min-width: 400px; max-width: 92%; max-height: 92%; display: flex; flex-direction: column; overflow: hidden; }
.dlg-title { padding: 10px 16px; font-weight: 600; font-size: 13px; }
.dlg-body { padding: 8px 16px 16px; overflow: auto; flex: 1; }
.dlg-body p { margin: 0 0 10px; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; background: #f3f3f3; }
.dlg-err { color: #c42b1c; font-size: 12px; min-height: 16px; margin-top: 6px; }
.btn { padding: 6px 16px; border: 1px solid #c4c4c4; border-radius: 4px; background: #fbfbfb; font: inherit; min-width: 96px; cursor: default; }
.btn:hover { background: #f0f0f0; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #0a5cab; }
.btn.small { min-width: 0; padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; }
input.txt, select.txt { font: inherit; padding: 5px 8px; border: 1px solid #8a8a8a; border-radius: 4px; width: 100%; background: #fff; }
input.txt:focus { outline: 2px solid var(--accent); border-color: transparent; }
label { font-size: 13px; }
.prop-table { border-collapse: collapse; width: 100%; }
.prop-table td { padding: 5px 6px; border-bottom: 1px solid #eee; vertical-align: top; }
.prop-table td:first-child { color: #666; width: 110px; }
.prop-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-weight: 600; }

/* Introduksjon (flersidig dialog) */
.dlg-wiz { width: 560px; max-width: 94%; }
.dlg-wiz .dlg-title { font-size: 17px; padding: 16px 22px 0; }
.dlg-wiz .dlg-body { padding: 10px 22px 18px; }
.dlg-wiz .dlg-btns { align-items: center; }
.wiz-sp { flex: 1; }
.wiz-dots { display: flex; gap: 6px; }
.wiz-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.wiz-dots .dot.on { background: var(--coach); }
.wiz-page { line-height: 1.6; min-height: 210px; }
.wiz-page p { margin: 0 0 10px; }
.wiz-page ul { margin: 0 0 10px; padding-left: 20px; }
.wiz-page li { margin-bottom: 7px; }
.wiz-page label { display: block; margin-top: 12px; font-weight: 600; }
.wiz-page .txt { margin-top: 4px; }
.wiz-hero { font-size: 46px; text-align: center; margin-bottom: 6px; }
.wiz-err { color: #c42b1c; font-size: 13px; min-height: 18px; margin-top: 4px; }
.wiz-tip { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px; padding: 9px 12px; margin-top: 12px !important; }

/* Filvelger (Lagre som / Åpne) */
.dlg.dlg-fc { min-width: 0; }
.dlg.dlg-fc .dlg-body { padding: 0; display: flex; }
.fc { width: 780px; height: 500px; display: flex; flex-direction: column; }
.fc-top { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #eee; }
.fc-main { flex: 1; display: flex; min-height: 0; }
.fc-nav { width: 190px; border-right: 1px solid #eee; overflow: auto; padding: 4px 0; background: #fbfbfb; }
.fc-list { flex: 1; overflow: auto; }
.fc-bottom { padding: 10px 16px; display: grid; grid-template-columns: 70px 1fr 200px; gap: 8px 10px; align-items: center; border-top: 1px solid #eee; }
.fc-bottom .dlg-err { grid-column: 2 / 4; margin: 0; }

/* ---------- Filutforsker ---------- */
.ex { display: flex; flex-direction: column; height: 100%; }
.ex-toolbar { display: flex; align-items: center; gap: 2px; padding: 5px 8px; border-bottom: 1px solid var(--border); background: #f9f9f9; flex-wrap: wrap; }
.tb { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 9px; border-radius: 4px; font: inherit; font-size: 13px; cursor: default; white-space: nowrap; }
.tb:hover:not(:disabled) { background: #e8e8e8; }
.tb:disabled { opacity: .4; }
.tb .ico { width: 16px; height: 16px; display: inline-flex; }
.vsep { width: 1px; height: 22px; background: #d6d6d6; margin: 0 6px; }
.ex-address { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.nav-btn { width: 32px; height: 30px; border: 0; background: transparent; border-radius: 4px; font-size: 15px; color: #444; cursor: default; }
.nav-btn:hover:not(:disabled) { background: #e8e8e8; }
.nav-btn:disabled { opacity: .35; }
.crumbs { flex: 1; display: flex; align-items: center; height: 32px; border: 1px solid #c8c8c8; border-radius: 4px; padding: 0 6px; background: #fff; overflow: hidden; white-space: nowrap; gap: 2px; }
.crumb { padding: 3px 6px; border-radius: 3px; display: inline-flex; align-items: center; gap: 6px; }
.crumb:hover { background: #e8e8e8; }
.crumb-sep { color: #777; font-size: 11px; padding: 0 2px; }
.ex-search { width: 190px; height: 32px; border: 1px solid #c8c8c8; border-radius: 4px; padding: 0 10px; font: inherit; }
.ex-search:focus { outline: 2px solid var(--accent); border-color: transparent; }
.ex-main { flex: 1; display: flex; min-height: 0; }
.ex-nav { width: 210px; border-right: 1px solid var(--border); overflow: auto; padding: 6px 0; background: #fbfbfb; flex-shrink: 0; }
.nav-item { display: flex; align-items: center; gap: 6px; padding: 4px 8px; cursor: default; white-space: nowrap; border-radius: 4px; margin: 0 4px; }
.nav-item:hover { background: #ebebeb; }
.nav-item.active { background: #dbe7f5; }
.nav-item .tw { width: 14px; font-size: 10px; color: #666; text-align: center; flex-shrink: 0; }
.nav-item .ico { width: 18px; height: 18px; display: inline-flex; flex-shrink: 0; }
.nav-item.drop-hover { outline: 2px solid var(--accent); background: #dbe7f5; }
.nav-gap { height: 10px; border-bottom: 1px solid #e8e8e8; margin: 0 8px 8px; }
.ex-content { flex: 1; overflow: auto; padding: 8px; position: relative; outline: none; }
.ex-content.drop-hover { background: #f1f6fc; }
.ex-content.icons { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 2px; }
.item { display: flex; flex-direction: column; align-items: center; width: 100px; height: 104px; padding: 8px 4px; border-radius: 4px; border: 1px solid transparent; text-align: center; cursor: default; }
.item:hover { background: #eef3fb; }
.item.selected { background: var(--sel); border-color: #99c9f0; }
.item.drop-hover { background: #dbe7f5; outline: 2px solid var(--accent); }
.item.cut { opacity: .5; }
.item .ico { width: 48px; height: 48px; }
.item .name { font-size: 12px; line-height: 1.25; margin-top: 4px; word-break: break-word; max-height: 2.5em; overflow: hidden; width: 100%; }
.item .name input, .row .name input { width: 100%; font: inherit; font-size: 12px; text-align: center; border: 1px solid var(--accent); padding: 1px 2px; }
.row .name input { text-align: left; }
.ex-content.details { display: block; padding: 0; }
.dt-head, .row { display: grid; grid-template-columns: minmax(220px, 2fr) 150px 210px 90px; align-items: center; }
.dt-head.with-loc, .row.with-loc { grid-template-columns: minmax(200px, 2fr) minmax(180px, 1.5fr) 140px 190px 80px; }
.dt-head { color: #555; font-size: 12px; padding: 4px 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 1; }
.dt-head span { padding: 3px 6px; border-radius: 3px; }
.dt-head span:hover { background: #eee; }
.row { padding: 3px 8px; border-radius: 3px; margin: 0 4px; cursor: default; }
.row:hover { background: #eef3fb; }
.row.selected { background: var(--sel); }
.row.drop-hover { outline: 2px solid var(--accent); }
.row.cut { opacity: .5; }
.row .name { display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row .name .ico { width: 20px; height: 20px; display: inline-flex; flex-shrink: 0; }
.row .col { color: #555; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-right: 8px; }
.empty { color: #777; padding: 30px; text-align: center; width: 100%; }
.ex-status { height: 24px; border-top: 1px solid var(--border); font-size: 12px; display: flex; gap: 24px; align-items: center; padding: 0 12px; color: #444; flex-shrink: 0; }

/* ---------- Skriv ---------- */
.skriv { display: flex; flex-direction: column; height: 100%; }
.menubar { display: flex; align-items: center; gap: 2px; padding: 4px 8px; border-bottom: 1px solid var(--border); background: #f9f9f9; }
.menubar button { border: 0; background: transparent; padding: 5px 10px; border-radius: 4px; font: inherit; font-size: 13px; }
.menubar button:hover { background: #e8e8e8; }
.menubar .spacer { flex: 1; }
.menubar .hint { font-size: 12px; color: #777; padding-right: 6px; }
.sk-tools { display: flex; align-items: center; gap: 3px; padding: 5px 8px; border-bottom: 1px solid var(--border); background: #f3f3f3; flex-wrap: wrap; }
.sk-tools.disabled { opacity: .45; pointer-events: none; }
.sk-tools select { font: inherit; font-size: 13px; padding: 3px 4px; border: 1px solid #c8c8c8; border-radius: 4px; background: #fff; }
.sk-tools .sk-font { width: 150px; } .sk-tools .sk-size { width: 60px; } .sk-tools .sk-color { width: 90px; } .sk-tools .sk-style { width: 120px; }
.sk-b { width: 30px; height: 28px; border: 1px solid transparent; background: transparent; border-radius: 4px; font: inherit; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.sk-b:hover { background: #e4e4e4; }
.sk-b.active { background: #cce4f7; border-color: #99c9f0; }
.sk-scroll { flex: 1; overflow: auto; background: #e9e9e9; padding: 20px 0; }
.sk-page { background: #fff; width: 760px; max-width: calc(100% - 40px); min-height: 700px; margin: 0 auto; padding: 60px 72px; box-shadow: 0 2px 10px rgba(0,0,0,.2); outline: none; font: 11pt/1.45 Calibri, "Segoe UI", sans-serif; color: #000; white-space: pre-wrap; word-wrap: break-word; user-select: text; cursor: text; }
.sk-page h1 { font-size: 16pt; font-weight: 400; color: #2f5496; margin: 14pt 0 4pt; line-height: 1.2; }
.sk-page h2 { font-size: 13pt; font-weight: 400; color: #2f5496; margin: 10pt 0 3pt; line-height: 1.2; }
.sk-page ul, .sk-page ol { margin: 4pt 0; padding-left: 28pt; }
.sk-page div, .sk-page p { min-height: 1.45em; }
.sk-status { height: 22px; font-size: 12px; color: #555; padding: 0 12px; display: flex; align-items: center; gap: 20px; border-top: 1px solid var(--border); }
.sk-status .spacer { flex: 1; }

/* ---------- Nettleser ---------- */
.browser { display: flex; flex-direction: column; height: 100%; background: #fff; }
.br-tabs { background: #dfe3ea; padding: 6px 8px 0; display: flex; }
.br-tab { background: #fff; padding: 6px 14px; border-radius: 8px 8px 0 0; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.br-addr { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: #fff; }
.br-addr .url { flex: 1; background: #f0f2f5; border-radius: 16px; padding: 6px 14px; font-size: 13px; color: #333; }
.br-page { flex: 1; overflow: auto; background: #f5f7fa; position: relative; }
.site-head { background: #2f5fa8; color: #fff; padding: 18px 30px; font-size: 20px; font-weight: 600; }
.site-head small { display: block; font-size: 13px; font-weight: 400; opacity: .85; margin-top: 2px; }
.site-body { padding: 24px 30px; max-width: 760px; }
.site-body h2 { font-size: 16px; margin: 0 0 12px; }
.card { background: #fff; border: 1px solid #e1e4ea; border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 14px; }
.card .ico { width: 36px; height: 36px; flex-shrink: 0; }
.card .ct { flex: 1; }
.card .ct b { display: block; }
.card .ct span { font-size: 12px; color: #666; }
.card .fag { font-size: 11px; background: #eef3fb; color: #2f5fa8; padding: 2px 8px; border-radius: 10px; }
.dl-flyout { position: absolute; top: 44px; right: 10px; width: 340px; background: #fff; border: 1px solid #ccc; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.3); padding: 10px 12px; z-index: 5; }
.dl-flyout h4 { margin: 0 0 8px; font-size: 13px; }
.dl-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #eee; }
.dl-row .ico { width: 28px; height: 28px; flex-shrink: 0; }
.dl-row .ct { flex: 1; font-size: 12px; }
.dl-row .ct b { display: block; font-size: 13px; }
.dl-row .ct a { color: var(--accent); margin-right: 10px; cursor: pointer; }
.dl-row .ct a:hover { text-decoration: underline; }
.dl-empty { font-size: 12px; color: #666; }

/* ---------- Innleveringer (Teams-lignende) ---------- */
.teams { display: flex; height: 100%; background: #f5f5f5; }
.tm-side { width: 250px; background: #ebebeb; border-right: 1px solid #ddd; overflow: auto; }
.tm-side h3 { font-size: 13px; margin: 14px 14px 8px; color: #555; }
.tm-item { padding: 10px 14px; border-left: 3px solid transparent; cursor: default; }
.tm-item:hover { background: #e0e0e0; }
.tm-item.active { background: #fff; border-left-color: #5b5fc7; }
.tm-item b { display: block; font-size: 13px; }
.tm-item span { font-size: 12px; color: #666; }
.tm-item .st { font-size: 11px; color: #107c10; }
.tm-main { flex: 1; padding: 24px 30px; overflow: auto; }
.tm-main h2 { margin: 0 0 4px; font-size: 20px; }
.tm-meta { color: #666; font-size: 12px; margin-bottom: 16px; }
.tm-desc { background: #fff; border: 1px solid #e1e1e1; border-radius: 6px; padding: 12px 14px; margin-bottom: 20px; }
.tm-work { background: #fff; border: 1px solid #e1e1e1; border-radius: 6px; padding: 12px 14px; }
.tm-work h4 { margin: 0 0 8px; }
.tm-file { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.tm-file .ico { width: 24px; height: 24px; }
.tm-file .rm { margin-left: auto; border: 0; background: transparent; color: #a00; font-size: 12px; }
.tm-actions { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.btn.teams { background: #5b5fc7; color: #fff; border-color: #5b5fc7; }
.btn.teams:hover { background: #4b4fb7; }
.tm-submitted { color: #107c10; font-weight: 600; }
.tm-empty { color: #666; font-size: 13px; padding: 40px; text-align: center; }

/* ---------- Visning av filer ---------- */
.viewer { display: flex; flex-direction: column; height: 100%; background: #e9ecf1; }
.v-head { padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.v-head .ico { width: 24px; height: 24px; }
.v-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto; }
.v-paper { background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.2); width: 480px; min-height: 340px; padding: 40px 48px; white-space: pre-wrap; font: 14px/1.6 "Calibri", "Segoe UI", sans-serif; }
.v-slide { background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.2); width: 560px; height: 315px; padding: 40px; display: flex; flex-direction: column; justify-content: center; border-top: 14px solid #c43e1c; }
.v-slide h1 { margin: 0 0 12px; font-size: 30px; }
.v-sheet { background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.2); border-collapse: collapse; font-size: 13px; }
.v-sheet td, .v-sheet th { border: 1px solid #d0d0d0; padding: 4px 10px; min-width: 80px; }
.v-sheet th { background: #f3f3f3; font-weight: 400; color: #555; }
.v-img { width: 520px; height: 340px; border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.v-generic { text-align: center; color: #444; }
.v-generic .ico { width: 96px; height: 96px; margin: 0 auto 12px; }
.v-info { padding: 10px 16px; font-size: 12px; color: #555; background: #fff; border-top: 1px solid var(--border); line-height: 1.5; }

/* ---------- Innstillinger ---------- */
.settings { padding: 24px 28px; }
.settings h3 { margin: 0 0 14px; }
.settings .opt { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eee; }
.settings .opt .desc { flex: 1; }
.settings .opt .desc small { display: block; color: #666; }

/* ---------- Fullskjerm-startbilde og knapp ---------- */
#fs-overlay { position: fixed; inset: 0; z-index: 50000; cursor: pointer; color: #fff; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 20% 20%, #7fc0ff 0%, #3b7dd8 35%, #1d3f8a 75%, #142a5c 100%); }
.fso-box { text-align: center; background: rgba(0,0,0,.35); padding: 44px 64px; border-radius: 16px; backdrop-filter: blur(6px); max-width: 90%; }
.fso-logo { font-size: 64px; }
.fso-box h1 { margin: 6px 0 12px; font-size: 34px; font-weight: 600; }
.fso-box p { font-size: 19px; margin: 6px 0; }
.fso-box .fso-tip { color: #dbe4f5; font-size: 13px; margin-top: 16px; }
.fso-box .fso-sub { font-size: 14px; color: #dbe4f5; margin-bottom: 14px; }
.fso-box kbd { color: #000; }
.fs-btn { width: 36px; height: 36px; margin-right: 6px; }

/* ---------- Oppgavebehandling ---------- */
.taskmgr { padding: 16px 20px; display: flex; flex-direction: column; height: 100%; }
.taskmgr h3 { margin: 0 0 10px; }
.tk-rows { flex: 1; overflow: auto; border: 1px solid #e5e5e5; border-radius: 6px; background: #fff; }
.tkr { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #eee; }
.tkr .t { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tkr .ico { width: 20px; height: 20px; display: inline-flex; }

/* ---------- Programmeringssiden: eget utseende så det er tydelig at det er et annet kurs ---------- */
body.page-prog { --coach: #0f766e; }
body.page-prog #desktop {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 40px),
    radial-gradient(ellipse at 20% 15%, #2a9d8f 0%, #1b5e5a 35%, #0f2f3a 70%, #08161f 100%);
}
body.page-prog #fs-overlay { background: radial-gradient(ellipse at 20% 15%, #2a9d8f 0%, #1b5e5a 35%, #0f2f3a 70%, #08161f 100%); }
body.page-prog .fso-box h1::after { content: ' · programmering'; font-weight: 400; font-size: 22px; color: #a7f3d0; }
body.page-prog #taskbar { background: rgba(14, 40, 44, .94); border-top-color: rgba(255,255,255,.08); }
body.page-prog .tb-app:hover { background: rgba(255,255,255,.1); }
body.page-prog .tb-app.active { background: rgba(255,255,255,.14); }
body.page-prog .tb-app.open::after { background: #bbb; }
body.page-prog .tb-app.active::after { background: #5eead4; }
body.page-prog .fs-btn svg path { stroke: #e5e7eb; }
body.page-prog #clock { color: #e5e7eb; }
body.page-prog #sim-label { color: #9ca3af; border-right-color: rgba(255,255,255,.15); }
body.page-prog .ctab.active { border-bottom-color: #0f766e; color: #0f766e; }
body.page-prog .step.active { border-color: #0f766e; background: #ecfdf5; box-shadow: 0 2px 8px rgba(15,118,110,.15); }
body.page-prog .step.active .num { background: #0f766e; }
body.page-prog .step .txt b { color: #0f766e; }
body.page-prog .kurs-card.open { border-color: #5eead4; background: #f0fdfa; }
body.page-prog .opp-row .play { color: #0f766e; }
body.page-prog .opp-row:hover { background: #ecfdf5; }
body.page-prog .laer { background: #f0fdfa; border-color: #99f6e4; }
body.page-prog .btn.primary { background: #0f766e; border-color: #0f766e; }
body.page-prog .btn.primary:hover { background: #115e59; }

/* Vindussnapping, utskrift, deling og autolagring */
.snap-ghost { position: absolute; z-index: 4; background: rgba(255,255,255,.28); border: 2px solid rgba(255,255,255,.7); border-radius: 8px; pointer-events: none; }
.sk-status .auto.on { color: #0f766e; } .sk-status .auto.off { color: #b45309; }
.print-dlg { display: flex; gap: 18px; width: 640px; }
.pd-left { width: 250px; display: flex; flex-direction: column; gap: 4px; }
.pd-left label { margin-top: 6px; }
.pd-left .muted { margin-top: 8px; line-height: 1.5; }
.pd-prev { flex: 1; background: #e9e9e9; padding: 12px; border-radius: 6px; overflow: auto; max-height: 340px; }
.pd-paper { background: #fff; padding: 22px 26px; box-shadow: 0 2px 8px rgba(0,0,0,.2); font: 9pt/1.4 Calibri, sans-serif; min-height: 300px; }
.share { width: 420px; display: flex; flex-direction: column; gap: 4px; }
.share label { margin-top: 8px; }
.sh-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.sh-head .ico { width: 32px; height: 32px; display: inline-flex; }
.sh-warn { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 6px; padding: 8px 10px; font-size: 13px; line-height: 1.5; }
.sh-link { margin-top: 10px; }
.sh-link input { font-size: 12px; background: #f3f4f6; }
.sh-tip { margin-top: 10px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px; padding: 8px 10px; font-size: 13px; line-height: 1.5; }

/* ---------- Firmaportalen ---------- */
.fp { display: flex; flex-direction: column; height: 100%; background: #fff; font-size: 14px; }
.fp-top { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: #1f6fb2; color: #fff; }
.fp-top .spacer { flex: 1; }
.fp-logo { font-size: 26px; }
.fp-sub { font-size: 12px; opacity: .85; }
.fp-search { width: 240px; height: 30px; border: 0; font-size: 13px; }
.fp-body { flex: 1; display: flex; min-height: 0; }
.fp-cats { width: 180px; border-right: 1px solid var(--border); padding: 10px 0; background: #fafafa; flex-shrink: 0; }
.fp-cat { display: flex; justify-content: space-between; align-items: center; padding: 9px 16px; cursor: default; }
.fp-cat:hover { background: #eee; }
.fp-cat.active { background: #e3eefa; font-weight: 600; box-shadow: inset 3px 0 0 #1f6fb2; }
.fp-cat .cnt { color: #888; font-size: 12px; }
.fp-list { flex: 1; overflow: auto; padding: 12px 16px; }
.fp-app { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; }
.fp-app .ico { width: 40px; height: 40px; display: inline-flex; flex-shrink: 0; }
.fp-app .ct { flex: 1; min-width: 0; }
.fp-app .ct b { display: block; }
.fp-app .note { display: block; font-size: 12px; color: #1f6fb2; }
.fp-app .meta { display: block; font-size: 12px; color: #888; }
.fp-app .desc { display: block; font-size: 13px; color: #555; margin-top: 3px; }
.fp-app .act { width: 150px; flex-shrink: 0; text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.fp-state { font-size: 13px; }
.fp-state.ok { color: #107c10; font-weight: 600; }
.fp-state.bad { color: #c42b1c; font-weight: 600; text-align: right; }
.fp-progress { width: 100%; }
.fp-progress .pb { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.fp-progress .pb > div { height: 100%; background: #1f6fb2; transition: width .4s; }
.fp-empty { padding: 40px 20px; text-align: center; color: #666; line-height: 1.7; }
.fp-foot { padding: 8px 18px; border-top: 1px solid var(--border); font-size: 12px; color: #666; background: #fafafa; }

/* ---------- Notater (OneNote) ---------- */
.note { display: flex; flex-direction: column; height: 100%; background: #fff; }
.note-top { display: flex; align-items: center; gap: 12px; padding: 7px 12px; background: #7719aa; color: #fff; font-size: 13px; }
.note-top .spacer { flex: 1; }
.note-book, .note-loc { white-space: nowrap; flex-shrink: 0; }
.note-loc { opacity: .85; font-size: 12px; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.note-search { width: 200px; min-width: 120px; height: 26px; font-size: 12px; border: 0; }
.note-body { flex: 1; display: flex; min-height: 0; }
.note-secs { width: 170px; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: #faf7fc; flex-shrink: 0; }
.note-pages { width: 200px; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: #fcfcfc; flex-shrink: 0; }
.secs, .pages { flex: 1; overflow: auto; padding: 6px 0; }
.note-add { border: 0; background: transparent; color: #7719aa; font: inherit; font-size: 12px; text-align: left; padding: 8px 12px; border-top: 1px solid var(--border); }
.note-add:hover { background: #f0e6f6; }
.sec-row, .page-row { display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: default; font-size: 13px; }
.sec-row:hover, .page-row:hover { background: #f0eaf5; }
.sec-row.active { background: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #7719aa; }
.page-row.active { background: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #c239b3; }
.sec-row .dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.sec-row .nm, .page-row .nm { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sec-row .cnt, .page-row .dt { font-size: 11px; color: #888; }
.note-empty { padding: 20px 12px; color: #888; font-size: 12px; text-align: center; line-height: 1.6; }
.note-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.note-main.empty .note-page, .note-main.empty .note-tools { opacity: .4; pointer-events: none; }
.note-title { border: 0; border-bottom: 1px solid var(--border); font: 20px/1.3 "Segoe UI", sans-serif; padding: 14px 24px; outline: none; color: #7719aa; }
.note-tools { display: flex; gap: 4px; padding: 5px 20px; border-bottom: 1px solid var(--border); background: #fafafa; }
.note-tools button { border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 4px 9px; font: inherit; font-size: 12px; }
.note-tools button:hover { background: #eee; }
.note-page { flex: 1; overflow: auto; padding: 16px 24px; outline: none; font: 14px/1.6 Calibri, "Segoe UI", sans-serif; }
.note-page ul { padding-left: 22px; }
.note-page input[type=checkbox] { margin-right: 6px; }
.note-status { padding: 4px 24px; font-size: 11px; color: #888; border-top: 1px solid var(--border); }

/* ---------- E-post ---------- */
.mail { display: flex; height: 100%; background: #fff; font-size: 13px; }
.mail-side { width: 190px; background: #f3f2f1; border-right: 1px solid var(--border); flex-shrink: 0; padding: 10px; }
.mail-new { width: 100%; padding: 8px; border: 0; border-radius: 4px; background: #0364b8; color: #fff; font: inherit; font-weight: 600; margin-bottom: 12px; }
.mail-new:hover { background: #024e91; }
.mf { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 4px; cursor: default; }
.mf:hover { background: #e6e6e6; }
.mf.active { background: #dbeafe; font-weight: 600; }
.mf .badge { background: #0364b8; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; }
.mail-list { width: 280px; border-right: 1px solid var(--border); overflow: auto; flex-shrink: 0; }
.mail-item { padding: 9px 12px; border-bottom: 1px solid #f0f0f0; cursor: default; border-left: 3px solid transparent; }
.mail-item:hover { background: #f5f5f5; }
.mail-item.active { background: #eaf3fb; border-left-color: #0364b8; }
.mail-item.unread .subj { font-weight: 700; }
.mail-item.unread { border-left-color: #0364b8; }
.mi-top { display: flex; justify-content: space-between; font-size: 12px; color: #444; }
.mail-item .who { font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mail-item .when { color: #888; flex-shrink: 0; margin-left: 6px; }
.mail-item .subj { margin: 2px 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mail-item .prev { font-size: 12px; color: #777; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mail-read { flex: 1; overflow: auto; padding: 18px 24px; min-width: 0; }
.mail-empty { padding: 40px 20px; color: #888; text-align: center; }
.mr-head h2 { margin: 0 0 4px; font-size: 19px; }
.mr-attach { margin: 14px 0; padding: 10px 12px; background: #f8f8f8; border: 1px solid var(--border); border-radius: 6px; }
.att { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.att .ico { width: 24px; height: 24px; display: inline-flex; flex-shrink: 0; }
.att .nm { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mr-body { white-space: pre-wrap; line-height: 1.6; margin: 14px 0; }
.mr-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.compose { display: grid; grid-template-columns: 80px 1fr; gap: 8px 10px; align-items: start; width: 520px; }
.compose label { padding-top: 6px; }
.compose textarea { font: inherit; padding: 6px 8px; border: 1px solid #8a8a8a; border-radius: 4px; resize: vertical; }
.att-box { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.att-list { width: 100%; }

/* ---------- Skrivetrening ---------- */
.type { display: flex; flex-direction: column; height: 100%; padding: 14px 18px; gap: 10px; overflow: auto; background: #fff; }
.type-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.type-top .spacer { flex: 1; }
.type-top .txt { width: auto; }
.type-stat { font-size: 13px; color: #555; font-variant-numeric: tabular-nums; }
.type-text { font: 17px/1.9 Consolas, "Courier New", monospace; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px 16px; letter-spacing: .5px; word-wrap: break-word; }
.type-text .tc { color: #16a34a; }
.type-text .tw { color: #dc2626; background: #fee2e2; text-decoration: underline; }
.type-text .tn { background: #2563eb; color: #fff; border-radius: 2px; }
.type-in { font: 16px Consolas, "Courier New", monospace; padding: 10px 12px; border: 2px solid #cbd5e1; border-radius: 8px; outline: none; }
.type-in:focus { border-color: #2563eb; }
.type-tips { font-size: 13px; line-height: 1.6; background: #fefce8; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 14px; }
.type-tips ul { margin: 6px 0 0; padding-left: 20px; }
.type-result { text-align: center; padding: 14px; background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px; }
.tr-big { font-size: 34px; font-weight: 700; color: #16a34a; }
.tr-sub { font-size: 15px; margin-bottom: 6px; }

/* ---------- Spill: Kabal og Minesveiper ---------- */
.dlg-spill { width: 600px; }
.spill-om-top { display: flex; gap: 14px; align-items: flex-start; }
.spill-om-top > svg { flex-shrink: 0; margin-top: 4px; }
.spill-om ul { margin: 0 0 10px; padding-left: 20px; line-height: 1.55; }
.spill-om p { line-height: 1.55; }
.spill-om-skip { display: flex; gap: 6px; align-items: center; font-size: 12px; color: #555; margin-top: 6px; }
.spill-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #f3f3f3; border-bottom: 1px solid var(--border); font-size: 13px; }
.spill-bar .spacer { flex: 1; }
.spill-bar select.txt { width: auto; padding: 3px 6px; font-size: 12px; }
.spill-stat { font-size: 12px; color: #444; font-variant-numeric: tabular-nums; }
.spill-tip { font-size: 12px; color: #444; padding: 6px 10px; background: #f3f3f3; border-top: 1px solid var(--border); }
.kab, .mine { display: flex; flex-direction: column; height: 100%; user-select: none; -webkit-user-select: none; }
.kab-board { flex: 1; position: relative; overflow: hidden; background: radial-gradient(ellipse at center, #1f8a4c 0%, #146b39 100%); touch-action: none; }
.kab-board .slot, .kab-board .card { position: absolute; width: var(--cw); height: var(--ch); border-radius: 6px; }
.kab-board .slot { border: 2px solid rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.35); font: 700 calc(var(--cw) * .38) Arial, sans-serif; box-sizing: border-box; }
.kab-board .stock-slot { cursor: pointer; }
.card { background: #fff; border: 1px solid #9aa4b2; box-shadow: 0 1px 2px rgba(0,0,0,.35); color: #111; font: 700 calc(var(--cw) * .2) Arial, sans-serif; box-sizing: border-box; overflow: hidden; }
.card.red { color: #d11; }
.card .cr { position: absolute; left: 4px; top: 3px; line-height: 1; text-align: center; }
.card .cr2 { left: auto; top: auto; right: 4px; bottom: 3px; transform: rotate(180deg); }
.card .cs { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(var(--cw) * .5); }
.card.back { background: repeating-linear-gradient(45deg, #1d4ed8 0 4px, #2563eb 4px 8px); border: 3px solid #fff; outline: 1px solid #9aa4b2; }
.card.drag { z-index: 1000 !important; box-shadow: 0 8px 18px rgba(0,0,0,.45); pointer-events: none; }
.spill-win { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 2000; background: #fff; border-radius: 10px; padding: 18px 28px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.sw-big { font-size: 22px; font-weight: 700; color: #146b39; }
.mine-wrap { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 14px; background: #e5e7eb; }
.mine-box { background: #c0c7d1; padding: 8px; border: 3px solid; border-color: #fff #7b8594 #7b8594 #fff; }
.mine-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding: 4px 6px; border: 2px solid; border-color: #7b8594 #fff #fff #7b8594; }
.mine-count, .mine-time { background: #111; color: #f33; font: 700 22px/1 Consolas, "Courier New", monospace; padding: 3px 5px; min-width: 42px; text-align: center; letter-spacing: 1px; }
.mine-face { font-size: 22px; width: 38px; height: 38px; padding: 0; line-height: 1; background: #c0c7d1; border: 3px solid; border-color: #fff #7b8594 #7b8594 #fff; cursor: pointer; }
.mine-face:active { border-color: #7b8594 #fff #fff #7b8594; }
.mine-grid { display: grid; border: 3px solid; border-color: #7b8594 #fff #fff #7b8594; }
.mc { width: 26px; height: 26px; box-sizing: border-box; background: #c0c7d1; border: 3px solid; border-color: #fff #7b8594 #7b8594 #fff; display: flex; align-items: center; justify-content: center; font: 700 15px Arial, sans-serif; cursor: default; }
.mc:not(.open):active { border: 1px solid #9aa4b2; }
.mc.open { border: 1px solid #9aa4b2; background: #d6dbe2; }
.mc.boom { background: #ef4444; }
.mc.n1 { color: #1d4ed8; } .mc.n2 { color: #15803d; } .mc.n3 { color: #dc2626; } .mc.n4 { color: #1e3a8a; }
.mc.n5 { color: #7f1d1d; } .mc.n6 { color: #0f766e; } .mc.n7 { color: #111; } .mc.n8 { color: #6b7280; }

/* ---------- Terminal (PowerShell) ---------- */
.term { flex: 1; background: #0c0c0c; color: #cccccc; font: 14px/1.4 Consolas, "Cascadia Mono", "Courier New", monospace; padding: 8px 12px; overflow: auto; user-select: text; cursor: text; }
.term-l { white-space: pre-wrap; word-break: break-all; min-height: 1.4em; }
.term-l.err { color: #f87171; } .term-l.warn { color: #fbbf24; } .term-l.dim { color: #8b8b8b; } .term-l.cmdline { color: #e5e5e5; } .term-l.add { color: #4ade80; }
.term-line { display: flex; align-items: baseline; white-space: pre-wrap; }
.term-prompt { color: #e5e5e5; white-space: pre; flex-shrink: 0; }
.term-in { flex: 1; background: transparent; border: 0; outline: none; color: #fff; font: inherit; padding: 0; margin: 0; caret-color: #fff; min-width: 40px; }

/* ---------- Kode (editor) ---------- */
.kode { display: flex; flex-direction: column; height: 100%; background: #1e1e1e; color: #d4d4d4; font-size: 13px; }
.k-menu { display: flex; align-items: center; gap: 2px; padding: 4px 8px; background: #2d2d2d; border-bottom: 1px solid #3c3c3c; }
.k-menu button { border: 0; background: transparent; color: #ccc; padding: 5px 10px; border-radius: 4px; font: inherit; font-size: 13px; }
.k-menu button:hover { background: #3c3c3c; }
.k-menu .k-run { background: #0e639c; color: #fff; font-weight: 600; }
.k-menu .k-run:hover { background: #1177bb; }
.k-spacer { flex: 1; }
.k-hint { font-size: 11px; color: #888; padding-right: 10px; }
.k-hint kbd { background: #3c3c3c; border-color: #555; color: #ddd; }
.k-body { flex: 1; display: flex; min-height: 0; }
.k-side { width: 220px; background: #252526; border-right: 1px solid #3c3c3c; display: flex; flex-direction: column; flex-shrink: 0; }
.k-side-h { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 6px; font-size: 11px; letter-spacing: .06em; color: #bbb; }
.k-side-btns button { border: 0; background: transparent; color: #ccc; font-size: 14px; padding: 0 4px; border-radius: 3px; }
.k-side-btns button:hover { background: #3c3c3c; }
.k-tree { flex: 1; overflow: auto; padding-bottom: 20px; }
.k-tree-root { font-size: 11px; font-weight: 700; color: #ccc; padding: 4px 10px; letter-spacing: .04em; }
.k-tree-empty { padding: 14px 12px; color: #999; font-size: 12px; line-height: 1.5; }
.k-tree-empty code, .k-empty code { background: #3c3c3c; padding: 1px 5px; border-radius: 3px; color: #fff; }
.k-row { display: flex; align-items: center; gap: 4px; padding: 3px 8px; cursor: default; white-space: nowrap; color: #ccc; }
.k-row:hover { background: #2a2d2e; }
.k-row.active { background: #37373d; color: #fff; }
.k-tw { width: 12px; font-size: 10px; color: #999; text-align: center; }
.k-ico { width: 16px; height: 14px; display: inline-flex; align-items: center; }
.k-nm { overflow: hidden; text-overflow: ellipsis; }
.k-dot { color: #fff; margin-left: auto; font-size: 10px; }
.k-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.k-tabs { display: flex; background: #252526; overflow-x: auto; flex-shrink: 0; min-height: 35px; }
.k-tab { display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 12px; background: #2d2d2d; color: #999; border-right: 1px solid #252526; font-size: 13px; white-space: nowrap; cursor: default; }
.k-tab.active { background: #1e1e1e; color: #fff; border-top: 1px solid #0e639c; }
.k-close { margin-left: 4px; padding: 0 4px; border-radius: 3px; font-size: 11px; }
.k-close:hover { background: #3c3c3c; }
.k-editor { flex: 1; display: flex; position: relative; min-height: 0; overflow: hidden; }
.k-gutter { width: 48px; padding: 10px 10px 10px 0; text-align: right; color: #858585; font: 14px/1.5 Consolas, "Cascadia Mono", "Courier New", monospace; white-space: pre; user-select: none; flex-shrink: 0; overflow: hidden; background: #1e1e1e; }
.k-wrap { flex: 1; position: relative; overflow: hidden; }
.k-hl, .k-ta { position: absolute; inset: 0; margin: 0; padding: 10px 14px; font: 14px/1.5 Consolas, "Cascadia Mono", "Courier New", monospace; white-space: pre; tab-size: 4; border: 0; }
.k-hl { color: #d4d4d4; pointer-events: none; overflow: hidden; width: max-content; min-width: 100%; }
.k-ta { background: transparent; color: transparent; caret-color: #fff; resize: none; outline: none; overflow: auto; }
.k-ta::selection { background: rgba(38, 79, 120, .7); }
.k-editor:not(.has-file) .k-gutter, .k-editor:not(.has-file) .k-wrap { display: none; }
.k-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: #888; font-size: 14px; text-align: center; padding: 20px; line-height: 1.6; }
.k-status { display: flex; align-items: center; gap: 16px; padding: 3px 12px; background: #0e639c; color: #fff; font-size: 12px; flex-shrink: 0; }
.k-status .k-file { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.k-c { color: #6a9955; } .k-s { color: #ce9178; } .k-n { color: #b5cea8; } .k-k { color: #569cd6; } .k-b { color: #dcdcaa; } .k-f { color: #dcdcaa; } .k-p { color: #d4d4d4; } .k-v { color: #9cdcfe; } .k-o { color: #9cdcfe; }

/* ---------- Nødstripe ved feil ---------- */
#recovery { position: fixed; top: 0; left: 0; right: 0; z-index: 60000; background: #c42b1c; color: #fff; padding: 10px 16px; display: flex; gap: 14px; align-items: center; justify-content: center; font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
#recovery .btn { min-width: 0; }

/* ---------- Toast ---------- */
#toasts { position: absolute; right: 16px; bottom: 60px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #2b2b2b; color: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.35); font-size: 13px; max-width: 340px; animation: toastin .2s ease-out; }
@keyframes toastin { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Veileder-panel ---------- */
#coach { width: 400px; flex-shrink: 0; background: #fff; border-left: 1px solid #d0d0d0; display: flex; flex-direction: column; transition: width .15s; }
#coach.collapsed { width: 46px; }
#coach.collapsed #coach-tabs, #coach.collapsed #coach-body, #coach.collapsed .coach-title { display: none; }
#coach.collapsed #coach-head { flex-direction: column; padding: 10px 4px; }
#coach.collapsed #coach-toggle { margin: 6px 0 0; transform: rotate(180deg); }
#coach-head { padding: 12px 14px; background: var(--coach); color: #fff; display: flex; align-items: center; gap: 10px; }
.coach-logo { font-size: 24px; }
.coach-title { flex: 1; font-weight: 600; font-size: 16px; }
.coach-sub { font-size: 12px; font-weight: 400; opacity: .85; }
#coach-toggle { border: 0; background: rgba(255,255,255,.15); color: #fff; width: 28px; height: 28px; border-radius: 6px; font-size: 18px; }
#coach-toggle:hover { background: rgba(255,255,255,.3); }
#coach-tabs { display: flex; border-bottom: 1px solid #ddd; }
.ctab { flex: 1; padding: 10px; text-align: center; border: 0; background: transparent; font: inherit; border-bottom: 2px solid transparent; color: #444; }
.ctab.active { border-bottom-color: var(--coach); font-weight: 600; color: var(--coach); }
.ctab:hover { background: #f5f5f5; }
#coach-body { flex: 1; overflow: auto; padding: 14px 16px 30px; }
#coach-body h2 { font-size: 17px; margin: 4px 0 10px; }
#coach-body h3 { font-size: 14px; margin: 14px 0 6px; }
.ktag { font-size: 12px; color: #666; }
.step { display: flex; gap: 10px; padding: 9px 10px; border-radius: 8px; margin-bottom: 6px; border: 1px solid #e5e7eb; background: #fff; }
.step.done { opacity: .55; }
.step.active { border-color: #2563eb; background: #eff6ff; box-shadow: 0 2px 8px rgba(37,99,235,.15); }
.step.locked { opacity: .45; }
.step.jump { cursor: pointer; }
.step.jump:hover { opacity: .9; border-color: #93c5fd; }
.jump-info { margin: 4px 0 8px; }
.step .num { width: 22px; height: 22px; border-radius: 50%; background: #e5e7eb; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; margin-top: 1px; }
.step.done .num { background: #16a34a; color: #fff; }
.step.active .num { background: #2563eb; color: #fff; }
.step .txt { flex: 1; line-height: 1.45; }
.step .txt b { color: #1d4ed8; }
.hintbox { margin-top: 8px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.linkbtn { border: 0; background: transparent; color: #2563eb; font: inherit; font-size: 12px; padding: 4px 0; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.quiz-opt { display: block; width: 100%; text-align: left; padding: 8px 10px; margin: 5px 0; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; font: inherit; line-height: 1.35; }
.quiz-opt:hover { background: #f1f5f9; }
.quiz-opt.wrong { border-color: #dc2626; background: #fef2f2; }
.quiz-opt.right { border-color: #16a34a; background: #f0fdf4; }
.quiz-opt:disabled { opacity: .45; background: #f3f4f6; }
.quiz-opt.wrong:disabled { opacity: .8; }
.goto-laer { margin-top: 8px; }
.laer-lockbox { margin-top: 12px; padding: 8px 10px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 6px; font-size: 13px; }
.laer-unlock { margin-top: 8px; width: 100%; }
.laer-unlock:disabled { background: #9ca3af; border-color: #9ca3af; color: #fff; }
.done-box { background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px; padding: 14px; margin: 12px 0; text-align: center; font-weight: 600; }
.done-box .big { font-size: 34px; }
.cbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.kurs-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.kurs-card:hover { background: #f9fafb; }
.kurs-card.open { border-color: #93c5fd; background: #f8fbff; }
.kurs-card .kt { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.kurs-card .kt small { font-weight: 400; color: #666; }
.bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar > div { height: 100%; background: #16a34a; }
.opp-list { margin-top: 10px; }
.opp-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; font-size: 13px; }
.opp-row:hover { background: #eef2ff; }
.opp-row .ok { color: #16a34a; width: 18px; }
.opp-row .play { color: #2563eb; width: 18px; }
.opp-row .todo { color: #9ca3af; width: 18px; }
.laer { background: #fefce8; border: 1px solid #fde68a; border-radius: 8px; padding: 6px 12px 10px; margin-bottom: 12px; font-size: 13px; line-height: 1.5; }
.laer summary { font-weight: 600; cursor: pointer; padding: 4px 0; }
.laer.oppslag { background: #f1f5f9; border-color: #cbd5e1; }
.laer.oppslag > summary { color: #334155; }
.laer.oppslag:not([open]) > summary::after { content: ' (klikk for å åpne)'; font-weight: 400; color: #64748b; font-size: 12px; }
.laer h4 { margin: 10px 0 4px; font-size: 13px; }
.laer p { margin: 6px 0; }
.laer ul { margin: 4px 0; padding-left: 18px; }
.laer table { border-collapse: collapse; width: 100%; margin: 6px 0; background: #fff; }
.laer td, .laer th { border: 1px solid #e5e7eb; padding: 3px 6px; text-align: left; font-size: 12px; vertical-align: top; }
.laer th { background: #f3f4f6; }
.laer .ico { width: 18px; height: 18px; display: inline-flex; vertical-align: middle; }
kbd { background: #f3f4f6; border: 1px solid #c4c4c4; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-family: inherit; font-size: 12px; white-space: nowrap; }
/* Mesterprøve, repetisjon og «gjør det på ekte» */
.opp-intro { background: #f8fafc; border-left: 3px solid #cbd5e1; padding: 8px 10px; margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
.master-box { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; line-height: 1.5; }
.master-box p { margin: 0 0 8px; } .master-box p:last-child { margin: 0; }
.goals { margin-bottom: 12px; }
.goal { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 6px; background: #fff; line-height: 1.45; }
.goal.done { border-color: #86efac; background: #f0fdf4; }
.goal .gm { width: 20px; flex-shrink: 0; color: #9ca3af; font-size: 15px; }
.goal.done .gm { color: #16a34a; font-weight: 700; }
.goal .gt { flex: 1; }
.goal.done .gt { color: #555; }
.opp-row.master { border-top: 1px solid #eee; margin-top: 4px; padding-top: 9px; font-weight: 600; }
.opp-row.locked { opacity: .55; }
.opp-row.locked:hover { background: #fef3c7; }
.opp-row.master.locked:hover { background: transparent; }
.teori-laas { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 6px; padding: 7px 10px; margin: 8px 0 6px; font-size: 12px; line-height: 1.45; }
.ekte { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.ekte h3 { margin: 0 0 4px; font-size: 14px; }
.ekte p { margin: 0 0 8px; }
.ekte-row { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 13px; line-height: 1.45; cursor: pointer; }
.ekte-row input { margin-top: 2px; flex-shrink: 0; }
.rep-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; background: #fff; }
.rep-card.due { border-color: #fcd34d; background: #fffbeb; }
.rep-card .kt { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.rep-card .kt small { font-weight: 400; color: #666; }
.rep-card .btn { margin-top: 8px; }
.rep-task { border: 1px solid #c7d2fe; background: #eef2ff; border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.rep-task .rt { font-size: 14px; line-height: 1.5; margin-top: 4px; }

.frem-name { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.frem-name input { flex: 1; }
.frem-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px solid #eee; }
.diplom { border: 3px double #b45309; background: #fffbeb; padding: 18px; text-align: center; border-radius: 8px; margin: 14px 0; }
.diplom h2 { margin: 0 0 6px; color: #92400e; }
.muted { color: #666; font-size: 12px; }
.welcome { line-height: 1.5; }
.welcome ul { padding-left: 18px; }

/* ---------- Kursnivåer i veilederen ---------- */
.kurs-del { margin: 18px 0 8px; padding: 8px 10px; border-radius: 8px; background: linear-gradient(90deg, #eef2ff, #f8fafc); border-left: 4px solid #6366f1; }
.kurs-del b { display: block; font-size: 14px; color: #312e81; }
.kurs-del span { display: block; font-size: 12px; color: #555; margin-top: 2px; }
body.page-prog .kurs-del { background: linear-gradient(90deg, #ecfeff, #f8fafc); border-left-color: #0d9488; }
body.page-prog .kurs-del b { color: #134e4a; }

/* ---------- Dra-markering i Filutforsker ---------- */
.ex-band { position: absolute; border: 1px solid #0a64c8; background: rgba(10, 100, 200, .14); pointer-events: none; z-index: 5; }

/* ---------- ZIP-filer ---------- */
.zipv .zip-bar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #fff7e6; border-bottom: 1px solid #f3d9a4; }
.zip-tag { font-size: 12px; font-weight: 600; color: #8a5a00; }
.zip-warn { font-size: 12px; padding: 6px 12px; background: #fffbeb; color: #6b4d00; border-bottom: 1px solid #f3e3b5; }
.zipv .crumbs { padding: 4px 8px; font-size: 13px; }
.zip-dlg { width: 520px; max-width: 100%; }
.zip-dlg label { display: block; margin-top: 8px; font-size: 13px; }
.zip-row { display: flex; gap: 6px; margin-top: 4px; }
.zip-row .txt { flex: 1; }
.zip-show { display: flex !important; gap: 6px; align-items: center; margin-top: 12px !important; }

/* ---------- Nettleser: lenker og artikler ---------- */
.br-links { display: flex; flex-direction: column; gap: 8px; }
.br-link { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; color: #1a4e9a; text-decoration: none; }
.br-link:hover { background: #f1f6fd; }
.br-link small { display: block; color: #15803d; font-size: 12px; }
.bl-ico { font-size: 22px; }
.art { max-width: 720px; margin: 0 auto; padding: 26px 34px 40px; background: #fff; min-height: 100%; user-select: text; -webkit-user-select: text; line-height: 1.65; font-size: 15px; }
.art h1 { font-size: 28px; margin: 6px 0 6px; }
.art-site { color: #1a4e9a; font-weight: 600; font-size: 13px; }
.art-by { color: #555; font-size: 12px; margin-bottom: 18px; border-bottom: 1px solid #e5e7eb; padding-bottom: 10px; }
.art-foot { margin-top: 24px; font-size: 12px; color: #666; border-top: 1px solid #e5e7eb; padding-top: 10px; }
.art.blog { background: #fffdf5; font-family: 'Comic Sans MS', 'Segoe UI', sans-serif; }
.art.blog h1 { color: #dc2626; }
.blog-ad { background: repeating-linear-gradient(45deg, #fde047, #fde047 10px, #facc15 10px, #facc15 20px); color: #7c2d12; font-weight: 700; text-align: center; padding: 10px; margin: 10px 0; border-radius: 4px; }

/* ---------- E-post: lenker og avsender ---------- */
.mr-addr { color: #555; }
.mr-links { margin: 6px 0 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.mr-link { display: inline-block; padding: 8px 16px; background: #0a64c8; color: #fff; border-radius: 4px; text-decoration: none; font-weight: 600; }
.mr-link:hover { background: #0a54a8; }
.mr-status { position: sticky; bottom: 0; font-size: 12px; background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; padding: 3px 8px; display: inline-block; opacity: 0; transition: opacity .1s; }
.mr-status.on { opacity: 1; }

/* ---------- Passord ---------- */
.pwd { width: 440px; max-width: 100%; }
.pw-bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.pw-bar div { height: 100%; width: 0; transition: width .2s, background .2s; }
.pw-label { font-size: 13px; margin-top: 4px; min-height: 18px; }
.pw-tips { font-size: 12px; color: #444; padding-left: 18px; margin: 8px 0 0; line-height: 1.55; }
