/* =====================================================================
   Team-sidene (Design 2026-10): ansatte, honorar, utlegg, bookinger,
   kalendere, planboard, ressursplan, jobbtavle, oppgaver, notater, chat,
   varsler, åpne oppdrag, kjøreplaner, prosjekter, jobbskjema, kjøretøy,
   bedriftsinfo, roller, admin-logger, e-post og innlogging.
   Bygger på de felles komponentene i style.css («Design 2026-10 · komponenter»).
   Alt er prefikset «tm-». Kun fargetokens, så lys og mørk modus virker automatisk.
   Mobil = under 760 px. Crew (body.role-crew) får større trykkflater.
   ===================================================================== */

/* ---------- Felles småbiter ---------- */
.tm-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tm-filtered { display: none !important; }
.tm-subcard { margin: 0 0 12px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.tm-subcard-h { display: block; margin: 0 0 4px; font-size: var(--fs-sm); font-weight: 650; color: var(--text); }
.tm-sumline { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; max-width: 380px; margin-top: 12px; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.tm-muted-sm { font-size: var(--fs-xs); color: var(--text-muted); }
.tm-nowrap { white-space: nowrap; }
.tm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tm-actions > form { margin: 0; display: inline-flex; }

/* ---------- Lange skjema: hoppliste + seksjoner ---------- */
.tm-formlayout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.tm-formlayout > form { min-width: 0; }
.tm-jump { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0; padding: 0 0 2px; }
.tm-jump::-webkit-scrollbar { display: none; }
.tm-jump-h { display: none; }
.tm-jump a { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 34px; padding: 5px 12px; border: 1px solid var(--border-strong);
  border-radius: 999px; background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap; }
.tm-jump a:hover { background: var(--surface-2); border-color: var(--border-hover); }
.tm-jump a .ic { color: var(--text-muted); }
.tm-jump a.is-current { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.tm-jump a.is-current .ic { color: var(--primary); }
@media (min-width: 1100px) {
  .tm-formlayout { grid-template-columns: 210px minmax(0, 1020px); }
  .tm-jump { position: sticky; top: calc(var(--topbar-h) + 16px); flex-direction: column; gap: 2px; overflow: visible; padding: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
  .tm-jump-h { display: block; padding: 2px 8px 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
  .tm-jump a { border: 0; border-radius: var(--radius-xs); background: transparent; min-height: 32px; padding: 6px 8px; font-weight: 500; white-space: normal; }
  .tm-jump a:hover { background: var(--surface-3); }
  .tm-jump a.is-current { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
  .tm-afterform { margin-left: calc(210px + var(--sp-4)); }
}
.tm-afterform { max-width: 1020px; margin-top: var(--sp-4); }
body.desktop-app .tm-jump { top: calc(var(--topbar-h) + 12px); }
.form-section .form-row:last-child { margin-bottom: 0; }
/* Siste felt i et indre rutenett som IKKE er sist i seksjonen beholder avstanden – ellers kom neste felt rett under
   uten luft (f.eks. «Gyldig til» → «Kontrakt / vilkår», og «Eller skriv kundenavn» → «Sted» på mobil). */
.form-section .form-grid-2:not(:last-child) > .form-row:last-child { margin-bottom: 16px; }
.form-section > .form-row + .form-row, .form-section > .form-grid-2 + .form-row, .form-section > .form-row + .form-grid-2 { margin-top: 0; }
.tm-times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
@media (max-width: 759.98px) { .tm-times { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 8px; } }
.tm-need-h { margin: 2px 0; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tm-switchrow { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tm-jobform .tm-picker { align-items: flex-end; }
.tm-jobform .tm-picker label { flex-direction: column; align-items: flex-start; gap: 4px; }
.tm-jobform .filter-bar.toolbar.tm-picker label { flex-direction: column; align-items: flex-start; }
.tm-logi { max-width: 380px; margin-top: 10px; }
.tm-logi-h { margin-bottom: 4px; font-size: var(--fs-sm); font-weight: 600; }
.tm-logi-row { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.tm-logi-suggest { margin-top: 7px; padding: 7px 9px; border-radius: var(--radius-xs); background: var(--primary-soft); color: var(--primary); font-size: var(--fs-xs); font-weight: 600; }
.tm-logi-suggest:empty { display: none; }
.tm-logi-warn { margin-top: 6px; padding: 7px 9px; border-radius: var(--radius-xs); background: var(--warn-bg); color: var(--warn-text); font-size: var(--fs-xs); }
.tm-trlist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; font-size: var(--fs-sm); }
.tm-tritem { display: flex; gap: 8px; align-items: center; padding: 6px 10px; font-weight: 400 !important; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs); }

/* Redigerbare tabeller i skjema (utstyr, fritekst, tekniker, frakt, sub-hire, transport). */
table.tm-edit-table td { padding-top: 7px; padding-bottom: 7px; }
table.tm-edit-table tbody tr:hover td { background: transparent; }
/* Tettere kolonner på PC: med 14 px luft på hver side ble utstyrstabellen bredere enn kortet, og den klistrede
   «Fjern»-kolonnen dekket «Sum» (bare første siffer var synlig). */
@media (min-width: 760px) {
  table.tm-edit-table th, table.tm-edit-table td { padding-left: 8px; padding-right: 8px; }
  table.tm-edit-table th:first-child, table.tm-edit-table td:first-child { padding-left: 14px; }
  /* Smale tallfelt (60 px): mindre innvendig luft, ellers ble «10,0» / «25.0» kuttet til «10,(». */
  table.tm-edit-table td input[type="number"] { padding-left: 8px; padding-right: 4px; }
}
@media (max-width: 759.98px) {
  table.tm-edit-table > tbody > tr { padding: 10px 12px; gap: 8px 10px; background: var(--surface-2); }
  table.tm-edit-table > tbody > tr > td { flex: 1 1 calc(50% - 5px); }
  table.tm-edit-table > tbody > tr > td.dt-full, table.tm-edit-table > tbody > tr > td.dt-main { flex-basis: 100%; }
  table.tm-edit-table td input, table.tm-edit-table td select { width: 100% !important; min-width: 0 !important; }
  table.tm-edit-table > tbody > tr > td.row-actions { padding-top: 8px; justify-content: flex-end; }
}

/* ---------- Crew-tabellen i jobbskjemaet ---------- */
.tm-crew-tools { margin: 10px 0; }
.tm-crew-tools .filter-chips { margin: 0; }
.crew-conflict-hint { max-width: 320px; margin-top: 2px; color: var(--warn-text); font-size: 0.76rem; font-weight: 600; }
table.tm-crew tr.tm-crew-row.is-selected > td { background: var(--primary-soft); }
table.tm-crew tr.tm-crew-row.is-selected > td.dt-check { box-shadow: inset 3px 0 0 var(--primary); }
table.tm-crew tr.tm-crew-row.is-selected + tr.shift-row > td { background: var(--primary-soft); }
table.tm-crew tbody tr:hover td { background: var(--row-hover); }
table.tm-crew tr.tm-crew-row.is-selected:hover > td { background: var(--primary-soft); }
table.tm-crew input[type=checkbox] { width: 18px; height: 18px; }
table.tm-crew td.row-actions { white-space: nowrap; }
table.tm-crew td.row-actions > * { margin: 2px 0; }
.tm-shifts { padding-top: 0 !important; }
.tm-shifts-h { margin-bottom: 4px; font-size: 0.78rem; color: var(--text-muted); }
.tm-shifts .shift-line { padding: 6px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xs); }
@media (max-width: 759.98px) {
  table.tm-crew > tbody > tr.tm-crew-row { align-items: center; gap: 10px 12px; padding: 12px; }
  table.tm-crew > tbody > tr.tm-crew-row > td.dt-check { order: 0; padding: 0; }
  table.tm-crew > tbody > tr.tm-crew-row > td.dt-check input { width: 24px; height: 24px; }
  table.tm-crew > tbody { display: flex; flex-direction: column; }
  table.tm-crew > tbody > tr.tm-sel0, table.tm-crew > tbody > tr.tm-sel0 + tr.shift-row { order: -1; }
  table.tm-crew > tbody > tr.tm-crew-row > td.dt-main { flex: 1 1 calc(100% - 48px); min-width: 0; font-size: var(--fs-base); }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-cd { flex: 1 1 calc(50% - 6px); }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-cd-t { flex: 1 1 calc(33.3% - 8px); }
  table.tm-crew > tbody > tr.tm-crew-row > td.row-actions { flex-basis: 100%; }
  table.tm-crew td input, table.tm-crew td select { width: 100% !important; min-width: 0 !important; }
  table.tm-crew td.dt-check input { width: 24px !important; }
  /* Ikke valgte personer: bare navn og avkryssing – feltene dukker opp når personen velges. */
  table.tm-crew > tbody > tr.tm-crew-row:has(input[name="employee_ids"]:not(:checked)) { padding: 10px 12px; background: var(--surface); }
  table.tm-crew > tbody > tr.tm-crew-row:has(input[name="employee_ids"]:not(:checked)) > td.tm-cd { display: none; }
  table.tm-crew > tbody > tr.tm-crew-row.is-selected, table.tm-crew > tbody > tr.tm-crew-row:has(input[name="employee_ids"]:checked) {
    border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
  table.tm-crew tr.tm-crew-row.is-selected > td, table.tm-crew tr.tm-crew-row.is-selected > td.dt-check { background: transparent; box-shadow: none; }
  table.tm-crew > tbody > tr.shift-row { margin-top: -14px; border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; padding-top: 4px; }
  table.tm-crew > tbody > tr.shift-row > td { background: transparent !important; }
  table.tm-crew > tbody > tr.shift-row .shift-line input { flex: 1 1 calc(50% - 6px); width: auto !important; }
  table.tm-crew > tbody > tr.shift-row .shift-line .btn { flex: 1 1 100%; }
}

/* Vakter pr. person (Design 2026-10): hver vakt er en egen blokk – «Vakt 1» (hovedraden) og «Vakt 2, 3 …»
   (ekstra vakter) – med etikett over hvert felt, så det er tydelig hvilken tid som hører til hvilken dato
   og hva som er get in, start og slutt. Samme kolonner på alle vaktene. Oppsettet følger bredden på
   crew-kortet (container query): bred = én linje pr. vakt, middels = to linjer (dato / tider), smal = stablet. */
.tm-vl { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; min-height: 40px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm, 10px); background: var(--surface); color: var(--primary);
  font-size: 0.78rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tm-shift-list { counter-reset: tmv 1; }
.tm-shift-list > .shift-line { counter-increment: tmv; }
.tm-vl-n::before { content: "Vakt " counter(tmv); }
.tm-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tm-f-l, table.tm-crew > tbody > tr.tm-crew-row > td[data-label]::before { color: var(--text-muted); font-size: 0.72rem; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-f input { width: 100% !important; min-width: 0 !important; }
.tm-shift-add { margin-top: 10px; }
@media (min-width: 760px) {
  .tm-crew-wrap { container: tmcrew / inline-size; }
  table.tm-crew { display: block; width: 100%; min-width: 0; }
  table.tm-crew > thead { display: none; }
  table.tm-crew > tbody { display: block; }
  table.tm-crew > tbody > tr.tm-crew-row { display: grid; column-gap: 10px; row-gap: 10px; align-items: end; padding: 12px 14px; border-top: 1px solid var(--border);
    grid-template-columns: 26px 60px repeat(4, minmax(0, 1fr)); }
  table.tm-crew > tbody > tr:first-child { border-top: 0; }
  table.tm-crew > tbody > tr.tm-filtered { display: none; }
  table.tm-crew > tbody > tr > td { display: block; min-width: 0; padding: 0; border: 0; background: transparent !important; box-shadow: none !important; }
  table.tm-crew > tbody > tr.tm-crew-row > td[data-label]::before { content: attr(data-label); display: block; margin: 0 0 3px; }
  table.tm-crew > tbody > tr.tm-crew-row > td input:not([type=checkbox]), table.tm-crew > tbody > tr.tm-crew-row > td select { width: 100% !important; min-width: 0 !important; }
  table.tm-crew > tbody > tr.tm-crew-row > td.dt-check { grid-column: 1; grid-row: 1; align-self: center; width: auto; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-act { position: static; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-self: center; white-space: nowrap; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-act > * { margin: 0; }
  /* Middels (standard): linje 1 navn + handlinger · linje 2 gruppe/tilgang/pris · Vakt 1 = dato fra, dato til, rolle / get in, start, slutt. */
  table.tm-crew > tbody > tr.tm-crew-row > td.dt-main { grid-column: 2 / 6; grid-row: 1; align-self: center; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-act { grid-column: 6; grid-row: 1; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-grp { grid-column: 3; grid-row: 2; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-acc { grid-column: 4; grid-row: 2; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-rt { grid-column: 5; grid-row: 2; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-fee { grid-column: 6; grid-row: 2; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-vl { grid-column: 2; grid-row: 3 / 5; align-self: stretch; display: flex; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-df { grid-column: 3; grid-row: 3; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-dt { grid-column: 4; grid-row: 3; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-ro { grid-column: 5 / 7; grid-row: 3; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-gi { grid-column: 3; grid-row: 4; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-st { grid-column: 4; grid-row: 4; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-en { grid-column: 5; grid-row: 4; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-vl .tm-vl { height: auto; }
  /* Ikke valgte personer: bare avkryssing og navn – feltene kommer fram når personen velges. */
  table.tm-crew > tbody > tr.tm-crew-row:has(input[name="employee_ids"]:not(:checked)) { padding-top: 9px; padding-bottom: 9px; }
  table.tm-crew > tbody > tr.tm-crew-row:has(input[name="employee_ids"]:not(:checked)) > td.tm-cd { display: none; }
  table.tm-crew > tbody > tr.tm-crew-row:hover { background: var(--row-hover); }
  table.tm-crew > tbody > tr.tm-crew-row.is-selected, table.tm-crew > tbody > tr.tm-crew-row:has(input[name="employee_ids"]:checked) {
    background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
  /* Ekstra vakter: samme kolonner som Vakt 1 (starter der «Vakt 1»-etiketten står: 14 + 26 + 10 px). */
  table.tm-crew > tbody > tr.shift-row { display: block; padding: 0 14px 14px 50px; }
  table.tm-crew > tbody > tr.shift-row[hidden] { display: none; }
  table.tm-crew > tbody > tr.tm-crew-row.is-selected + tr.shift-row,
  table.tm-crew > tbody > tr.tm-crew-row:has(input[name="employee_ids"]:checked) + tr.shift-row { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
  table.tm-crew > tbody > tr.shift-row > td.dt-hide-sm { display: none; }
  table.tm-crew > tbody > tr.shift-row > td.tm-shifts { display: block; }
  table.tm-crew .tm-shifts-h { margin: 0 0 2px; }
  table.tm-crew .tm-shift-list > .shift-line { display: grid; grid-template-columns: 60px repeat(4, minmax(0, 1fr)); column-gap: 10px; row-gap: 10px; align-items: end;
    margin: 0; padding: 12px 0 0; background: transparent; border: 0; border-radius: 0; }
  table.tm-crew .shift-line > .tm-vl { grid-column: 1; grid-row: 1 / 3; align-self: stretch; height: auto; }
  table.tm-crew .shift-line > .tm-f:nth-of-type(1) { grid-column: 2; grid-row: 1; }
  table.tm-crew .shift-line > .tm-f:nth-of-type(2) { grid-column: 3; grid-row: 1; }
  table.tm-crew .shift-line > .tm-f-ro { grid-column: 4 / 6; grid-row: 1; }
  table.tm-crew .shift-line > .tm-f:nth-of-type(3) { grid-column: 2; grid-row: 2; }
  table.tm-crew .shift-line > .tm-f:nth-of-type(4) { grid-column: 3; grid-row: 2; }
  table.tm-crew .shift-line > .tm-f:nth-of-type(5) { grid-column: 4; grid-row: 2; }
  table.tm-crew .shift-line > .btn { grid-column: 5; grid-row: 2; justify-self: end; align-self: center; }
  /* Bred: én linje pr. vakt. */
  @container tmcrew (min-width: 980px) {
    table.tm-crew > tbody > tr.tm-crew-row { grid-template-columns: 26px 60px repeat(2, minmax(0, 1.2fr)) repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr) 76px; }
    table.tm-crew > tbody > tr.tm-crew-row > td.dt-main { grid-column: 2 / 8; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-act { grid-column: 8 / 10; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-vl { grid-column: 2; grid-row: 3; align-self: end; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-df { grid-column: 3; grid-row: 3; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-dt { grid-column: 4; grid-row: 3; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-gi { grid-column: 5; grid-row: 3; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-st { grid-column: 6; grid-row: 3; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-en { grid-column: 7; grid-row: 3; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-ro { grid-column: 8; grid-row: 3; }
    table.tm-crew .tm-shift-list > .shift-line { grid-template-columns: 60px repeat(2, minmax(0, 1.2fr)) repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr) 76px; }
    table.tm-crew .shift-line > .tm-vl { grid-row: 1; align-self: end; height: 40px; }
    table.tm-crew .shift-line > .tm-f:nth-of-type(1) { grid-column: 2; grid-row: 1; }
    table.tm-crew .shift-line > .tm-f:nth-of-type(2) { grid-column: 3; grid-row: 1; }
    table.tm-crew .shift-line > .tm-f:nth-of-type(3) { grid-column: 4; grid-row: 1; }
    table.tm-crew .shift-line > .tm-f:nth-of-type(4) { grid-column: 5; grid-row: 1; }
    table.tm-crew .shift-line > .tm-f:nth-of-type(5) { grid-column: 6; grid-row: 1; }
    table.tm-crew .shift-line > .tm-f-ro { grid-column: 7; grid-row: 1; }
    table.tm-crew .shift-line > .btn { grid-column: 8; grid-row: 1; justify-self: stretch; align-self: end; min-height: 40px; }
  }
  /* Smal (f.eks. nettbrett med meny): stablet – «Vakt N» som overskrift, så dato/rolle og tider. */
  @container tmcrew (max-width: 639.98px) {
    table.tm-crew > tbody > tr.tm-crew-row { grid-template-columns: 26px repeat(3, minmax(0, 1fr)); }
    table.tm-crew > tbody > tr.tm-crew-row > td.dt-main { grid-column: 2 / 4; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-act { grid-column: 4; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-grp { grid-column: 2; grid-row: 2; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-acc { grid-column: 3; grid-row: 2; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-rt { grid-column: 4; grid-row: 2; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-fee { grid-column: 2; grid-row: 3; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-vl { grid-column: 2 / 5; grid-row: 4; align-self: end; display: block; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-vl .tm-vl { width: auto; min-height: 0; padding: 4px 10px; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-df { grid-column: 2; grid-row: 5; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-dt { grid-column: 3; grid-row: 5; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-ro { grid-column: 4; grid-row: 5; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-gi { grid-column: 2; grid-row: 6; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-st { grid-column: 3; grid-row: 6; }
    table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-en { grid-column: 4; grid-row: 6; }
    table.tm-crew .tm-shift-list > .shift-line { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    table.tm-crew .shift-line > .tm-vl { grid-column: 1 / 3; grid-row: 1; justify-self: start; width: auto; min-height: 0; padding: 4px 10px; }
    table.tm-crew .shift-line > .btn { grid-column: 3; grid-row: 1; justify-self: end; }
    table.tm-crew .shift-line > .tm-f:nth-of-type(1) { grid-column: 1; grid-row: 2; }
    table.tm-crew .shift-line > .tm-f:nth-of-type(2) { grid-column: 2; grid-row: 2; }
    table.tm-crew .shift-line > .tm-f-ro { grid-column: 3; grid-row: 2; }
    table.tm-crew .shift-line > .tm-f:nth-of-type(3) { grid-column: 1; grid-row: 3; }
    table.tm-crew .shift-line > .tm-f:nth-of-type(4) { grid-column: 2; grid-row: 3; }
    table.tm-crew .shift-line > .tm-f:nth-of-type(5) { grid-column: 3; grid-row: 3; }
  }
}
@media (max-width: 759.98px) {
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-grp, table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-acc,
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-rt, table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-fee { order: 1; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-vl { order: 2; flex: 1 1 100%; margin-top: 4px; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-df, table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-dt,
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-gi, table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-st,
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-en, table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-ro { order: 3; }
  table.tm-crew > tbody > tr.tm-crew-row > td.tm-a-ro { flex-basis: 100%; }
  /* Avkryssingen står til venstre for navnet (ikke nede ved «Gruppe»). */
  table.tm-crew > tbody > tr.tm-crew-row > td.dt-check { order: -2; flex: 0 0 26px; width: 26px; }
  table.tm-crew > tbody > tr.tm-crew-row > td.dt-main { flex: 1 1 calc(100% - 40px); }
  .tm-vl { width: auto; min-height: 0; padding: 4px 10px; justify-content: flex-start; }
  table.tm-crew .tm-shift-list > .shift-line { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; margin: 0 0 8px; }
  table.tm-crew .tm-shift-list > .shift-line > .tm-f-ro, table.tm-crew .tm-shift-list > .shift-line > .btn { grid-column: 1 / -1; }
  table.tm-crew .tm-shift-list > .shift-line > .tm-vl { grid-column: 1 / -1; justify-self: start; }
}

/* ---------- Kalendere (Kalender og Min kalender) ---------- */
.tm-caltools { gap: 8px; }
.tm-calnav { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tm-seg { display: inline-flex; gap: 2px; margin: 0; padding: 3px; background: var(--surface-3); border-radius: var(--radius-sm); }
.tm-seg .btn, .tm-seg .btn.secondary { min-height: 30px; padding: 5px 12px; border: 0; box-shadow: none; background: transparent; color: var(--text-muted); }
.tm-seg .btn:hover { background: var(--surface); color: var(--text); }
.tm-seg .btn:not(.secondary), .tm-seg .btn[aria-current] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
:root[data-theme="dark"] .tm-seg .btn.secondary { background: transparent; color: var(--text-muted); }
:root[data-theme="dark"] .tm-seg .btn:not(.secondary) { background: var(--surface-2); color: var(--text); }
.tm-adddetails { margin: 0 0 var(--sp-4); padding: 0; }
.tm-adddetails > summary { display: flex; align-items: center; gap: 8px; padding: 12px 18px; cursor: pointer; font-weight: 650; list-style: none; border-radius: var(--radius-lg); }
.tm-adddetails > summary::-webkit-details-marker { display: none; }
.tm-adddetails > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); transition: transform .15s var(--ease); }
.tm-adddetails[open] > summary::after { transform: rotate(-135deg); }
.tm-adddetails > summary:hover { background: var(--surface-2); }
.tm-adddetails > summary .ic { color: var(--primary); }
.tm-adddetails > :not(summary) { margin-left: 18px; margin-right: 18px; }
.tm-adddetails[open] { padding-bottom: 16px; }
.tm-adddetails[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; margin-bottom: 12px; }
.tm-pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; max-height: 180px; overflow: auto; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.tm-pickgrid label { display: flex; align-items: center; gap: 6px; font-weight: 400 !important; }

.tm-calgrid { gap: 6px; }
.tm-calgrid .cal-weekday { padding: 6px 2px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; text-transform: none; color: var(--text-muted); }
.tm-calgrid .cal-cell, .tm-cal .cal-cell.day-view { border-radius: var(--radius); border-color: var(--border); padding: 8px; gap: 4px; min-height: 110px; transition: border-color .12s; }
.tm-calgrid .cal-cell:hover { border-color: var(--border-hover); }
.tm-calgrid .cal-cell.empty { background: transparent; border: 0; min-height: 0; }
.tm-calgrid .cal-cell.is-past:not(.today) { background: var(--surface-2); }
.tm-calgrid .cal-cell.is-past:not(.today) .cal-day-num { color: var(--text-faint); }
.tm-cal .cal-cell.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.tm-cal .cal-day-num { align-self: flex-start; min-width: 26px; height: 26px; margin: 0 0 2px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); }
.tm-cal .calendar-grid.week .cal-day-num, .tm-cal .cal-cell.day-view .cal-day-num { height: auto; padding: 2px 8px; border-radius: var(--radius-xs); font-size: var(--fs-sm); }
.tm-cal .cal-cell.today > .cal-day-num { background: var(--btn-primary-bg); color: #fff; }
.tm-cal .tm-wd { display: none; }

/* Hendelsesbrikker (tokens – virker i lys og mørk modus) */
.tm-cal .cal-item { display: block; padding: 3px 7px; border-radius: 6px; border-left: 3px solid transparent; font-size: 0.74rem; font-weight: 600; line-height: 1.35;
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: filter .12s; }
.tm-cal a.cal-item:hover { filter: brightness(0.96); }
:root[data-theme="dark"] .tm-cal a.cal-item:hover { filter: brightness(1.15); }
.tm-cal .cal-item.job { background: var(--success-bg); color: var(--success); border-left-color: var(--success); }
.tm-cal .cal-item.event { background: var(--warn-bg); color: var(--warn-text); border-left-color: var(--warn); }
.tm-cal .cal-item.project { background: var(--primary-soft); color: var(--primary); border-left-color: var(--primary); }
.tm-cal .cal-item.booking { background: var(--info-bg); color: var(--info); border-left-color: var(--info); }
.tm-cal .cal-item.transport { background: var(--neutral-bg); color: var(--text); border-left-color: var(--neutral); }
.tm-cal .cal-item.openjob { background: var(--surface); color: var(--success); border: 1px dashed var(--success); border-left-width: 3px; }
.tm-cal .cal-item.task { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left-width: 3px; }
.tm-cal .cal-item.task.is-open { border-left-color: var(--warn); }
.tm-cal .cal-item.task.is-late { border-left-color: var(--danger); color: var(--danger); background: var(--error-bg); }
.tm-cal .cal-item.task.is-done { border-left-color: var(--border-strong); color: var(--text-muted); text-decoration: line-through; }
.tm-cal .cal-item.entry { display: flex; align-items: center; justify-content: space-between; gap: 4px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-left-width: 3px; }
.tm-cal .cal-item.entry.scope-personal { border-left-color: var(--warn); }
.tm-cal .cal-item.entry.scope-admin { border-left-color: var(--danger); }
.tm-cal .cal-item.entry.scope-staff { border-left-color: var(--success); }
.tm-cal .cal-item.entry.scope-specific { border-left-color: var(--primary); }
.tm-cal .cal-item.entry.scope-all { border-left-color: var(--info); }
.tm-cal .tm-entry-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: inherit; text-decoration: none; }
.tm-cal .tm-entry-del { display: inline; margin: 0; }
.tm-cal .tm-entry-del button { border: 0; background: none; color: var(--text-muted); cursor: pointer; padding: 0 3px; font-size: 0.95rem; line-height: 1; border-radius: 4px; }
.tm-cal .tm-entry-del button:hover { color: var(--danger); background: var(--error-bg); }
.tm-cal .tm-abj { margin: -2px 0 3px 2px; font-size: 0.68rem; }
.tm-cal .tm-avail { margin-top: 2px; font-size: 0.68rem; font-weight: 600; color: var(--success); }
.tm-cal .calendar-grid.week .cal-item, .tm-cal .cal-cell.day-view .cal-item { white-space: normal; }
.tm-cal .cal-cell.day-view { max-width: 900px; padding: 16px; }
.tm-cal .cal-cell.day-view .cal-item { padding: 8px 12px; font-size: var(--fs-sm); border-radius: var(--radius-xs); }
.tm-cal .tm-daystatus { align-self: flex-start; font-size: 0.68rem; }
.tm-cal .tm-availbtns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 4px; }
.tm-cal .tm-availbtns form { margin: 0; }
.tm-cal .tm-availbtns .btn { min-height: 24px; padding: 1px 7px; font-size: 0.68rem; border-radius: 6px; }
.tm-cal .tm-availbtns .btn.is-on.tm-av-yes { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.tm-cal .tm-availbtns .btn.is-on.tm-av-no { background: var(--error-bg); color: var(--danger); border-color: var(--danger-border); }

/* År */
.tm-yeargrid { gap: 12px; }
.tm-yeargrid .mini-month { padding: 12px 14px; }
.tm-mm-name { font-weight: 700; text-decoration: none; color: var(--text); }
a.tm-mm-name:hover { color: var(--primary); }
.tm-mm-n { font-size: 0.75rem; }
.tm-yeargrid .mm-day { border-radius: 6px; padding: 4px 0; }
.tm-yeargrid .mm-day:hover { background: var(--surface-3); }
.tm-yeargrid .mm-day.proj { background: var(--primary-soft); color: var(--primary); }
.tm-yeargrid .mm-day.today { outline: 2px solid var(--primary); outline-offset: -2px; }
/* Årsvisning: dagens farge følger hva dagen faktisk har (samme farger som forklaringen) –
   en dag med bare oppgaver blir oransje ring, ikke grønn jobb. Prikker = andre typer samme dag. */
.tm-yeargrid .mm-day { position: relative; }
.tm-yeargrid .mm-day.k-job { background: var(--success-bg); color: var(--success); font-weight: 700; }
.tm-yeargrid .mm-day.k-event { background: var(--warn-bg); color: var(--warn-text); font-weight: 700; }
.tm-yeargrid .mm-day.k-booking { background: var(--info-bg); color: var(--info); font-weight: 700; }
.tm-yeargrid .mm-day.k-transport { background: var(--neutral-bg); color: var(--text); font-weight: 700; }
.tm-yeargrid .mm-day.k-task { background: var(--surface); color: var(--warn-text); font-weight: 700; box-shadow: inset 0 0 0 2px var(--warn); }
.tm-yeargrid .mm-day.k-entry { background: var(--surface-2); color: var(--text); font-weight: 700; box-shadow: inset 0 0 0 1px var(--border-strong); }
.tm-yeargrid .mm-day.k-open { background: var(--surface); color: var(--success); font-weight: 700; box-shadow: inset 0 0 0 2px var(--success); }
.tm-yeargrid .mm-day.k-project { background: var(--primary-soft); color: var(--primary); }
.tm-yeargrid .mm-day[data-d]:hover { filter: brightness(0.96); }
.tm-yeargrid .mm-day.has-dots { padding-top: 2px; padding-bottom: 7px; }
.mm-dots { position: absolute; left: 0; right: 0; bottom: 2px; display: flex; justify-content: center; gap: 2px; pointer-events: none; }
.mm-dots i, .tm-yr-dot { display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--neutral); }
.mm-dots .d-job, .tm-yr-pop .d-job { background: var(--success) !important; }
.mm-dots .d-event, .tm-yr-pop .d-event { background: var(--warn) !important; }
.mm-dots .d-booking, .tm-yr-pop .d-booking { background: var(--info) !important; }
.mm-dots .d-transport, .tm-yr-pop .d-transport { background: var(--neutral) !important; }
.mm-dots .d-task, .tm-yr-pop .d-task { background: var(--surface) !important; box-shadow: inset 0 0 0 1.5px var(--warn); }
.mm-dots .d-entry, .tm-yr-pop .d-entry { background: var(--text-muted) !important; }
.mm-dots .d-open, .tm-yr-pop .d-open { background: var(--surface) !important; box-shadow: inset 0 0 0 1.5px var(--success); }
.mm-dots .d-project, .tm-yr-pop .d-project { background: var(--primary) !important; }
/* Hendelser: halvfylt prikk i målgruppens farge – samme farger som fargeforklaringen (Kun meg/Admin/Ansatte/Utvalgte/Alle) */
.d-entry.sc-personal, .mm-day.k-entry.sc-personal { --sc: var(--warn); }
.d-entry.sc-admin, .mm-day.k-entry.sc-admin { --sc: var(--danger); }
.d-entry.sc-staff, .mm-day.k-entry.sc-staff { --sc: var(--success); }
.d-entry.sc-specific, .mm-day.k-entry.sc-specific { --sc: var(--primary); }
.d-entry.sc-all, .mm-day.k-entry.sc-all { --sc: var(--info); }
.mm-dots .d-entry[class*="sc-"], .tm-yr-dot.d-entry[class*="sc-"] { background: linear-gradient(90deg, var(--sc) 0 50%, var(--surface) 50%) !important; box-shadow: inset 0 0 0 1px var(--sc); }
.tm-yeargrid .mm-day.k-entry[class*="sc-"] { box-shadow: inset 3px 0 0 var(--sc), inset 0 0 0 1px var(--border-strong); }
/* Hover-vinduet (PC): hva som gjelder for dagen. */
.tm-yr-pop { position: fixed; z-index: 3100; top: 0; left: 0; box-sizing: border-box; width: max-content; min-width: 200px; max-width: min(320px, calc(100vw - 16px));
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text);
  box-shadow: 0 14px 34px rgba(15, 20, 40, 0.18), 0 2px 6px rgba(15, 20, 40, 0.08); pointer-events: none;
  font-size: 0.82rem; line-height: 1.35; opacity: 0; transform: translateY(3px); transition: opacity .12s ease, transform .12s ease; }
.tm-yr-pop.is-on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .tm-yr-pop { transition: none; transform: none; } }
.tm-yr-pop-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.tm-yr-pop-h strong { font-size: 0.86rem; }
.tm-yr-pop-n { color: var(--text-muted); font-size: 0.74rem; white-space: nowrap; }
.tm-yr-pop-l { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tm-yr-it { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px; align-items: start; }
.tm-yr-it .tm-yr-dot { width: 8px; height: 8px; margin-top: 5px; }
.tm-yr-it .tm-yr-dot.d-task, .tm-yr-it .tm-yr-dot.d-open { box-shadow: inset 0 0 0 2px var(--warn); }
.tm-yr-it .tm-yr-dot.d-open { box-shadow: inset 0 0 0 2px var(--success); }
.tm-yr-tx { display: flex; flex-direction: column; min-width: 0; }
.tm-yr-top { display: flex; gap: 6px; min-width: 0; }
.tm-yr-tm { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.tm-yr-ti { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tm-yr-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 0.74rem; }
.tm-yr-more { margin-top: 6px; color: var(--text-muted); font-size: 0.74rem; }
.tm-yr-st { margin: 0 0 6px; padding: 3px 8px; border-radius: 999px; width: fit-content; font-size: 0.74rem; font-weight: 600; }
.tm-yr-st.is-free { background: var(--success-bg); color: var(--success); }
.tm-yr-st.is-busy { background: var(--neutral-bg); color: var(--text); }
.tm-yr-foot { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.72rem; }

/* Forklaring */
.tm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: var(--sp-4) 0 0; padding: 10px 14px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: var(--fs-xs); color: var(--text-muted); }
.tm-legend li { display: inline-flex; align-items: center; gap: 2px; }
.tm-legend-sep { align-self: stretch; width: 1px; background: var(--border); }
.tm-legend-h { font-weight: 600; color: var(--text); }
.tm-legend-note { flex-basis: 100%; }
.tm-legend .cal-dot { width: 10px; height: 10px; border-radius: 3px; }
.tm-legend .cal-dot.job { background: var(--success); }
.tm-legend .cal-dot.event { background: var(--warn); }
.tm-dot-project { background: var(--primary); }
.tm-dot-booking { background: var(--info); }
.tm-dot-transport { background: var(--neutral); }
.tm-dot-task { background: var(--surface); box-shadow: inset 0 0 0 2px var(--warn); }
.tm-dot-task.is-late { box-shadow: inset 0 0 0 2px var(--danger); }
.tm-dot-openjob { background: var(--surface); box-shadow: inset 0 0 0 2px var(--success); }
.tm-dot-personal, .tm-dot-admin, .tm-dot-staff, .tm-dot-specific, .tm-dot-all { background: var(--surface); }
.tm-dot-personal { box-shadow: inset 3px 0 0 var(--warn), inset 0 0 0 1px var(--border-strong); }
.tm-dot-admin { box-shadow: inset 3px 0 0 var(--danger), inset 0 0 0 1px var(--border-strong); }
.tm-dot-staff { box-shadow: inset 3px 0 0 var(--success), inset 0 0 0 1px var(--border-strong); }
.tm-dot-specific { box-shadow: inset 3px 0 0 var(--primary), inset 0 0 0 1px var(--border-strong); }
.tm-dot-all { box-shadow: inset 3px 0 0 var(--info), inset 0 0 0 1px var(--border-strong); }

/* Dagsvindu (fullskjerm-dag i Kalender) */
.tm-cal .day-modal { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: flex-start; justify-content: center; padding: 24px; overflow-y: auto;
  background: var(--overlay); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.tm-cal .day-modal-inner { width: min(760px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 0 22px 20px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: nsl-pop .16s var(--ease); }
.tm-cal .day-modal-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 -22px 14px; padding: 14px 22px;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.tm-cal .day-modal-head h2 { margin: 0; font-size: var(--fs-lg); }
.tm-cal .day-modal-body { display: flex; flex-direction: column; gap: 6px; }
.tm-cal .day-modal-body .cal-item { font-size: var(--fs-base); padding: 10px 12px; white-space: normal; border-radius: var(--radius-xs); }
.tm-cal .day-modal-body .muted { font-size: var(--fs-sm) !important; margin: 0 0 6px 2px !important; }

/* Mobil: måned og uke som agenda (én linje pr. dag, store trykkflater) */
@media (max-width: 759.98px) {
  .tm-caltools { flex-direction: column; align-items: stretch; }
  .tm-caltools .toolbar-spacer { display: none; }
  .tm-calnav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tm-calnav .btn, .tm-seg .btn { min-height: 40px; justify-content: center; }
  .tm-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tm-cal .tm-calgrid, .tm-cal .tm-calgrid.week { display: flex; flex-direction: column; gap: 6px; overflow: visible; padding: 0; }
  .tm-cal .tm-calgrid > .cal-weekday, .tm-cal .tm-calgrid > .cal-cell.empty { display: none; }
  .tm-cal .tm-calgrid > .cal-cell { display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-items: start; min-height: 0; padding: 10px 12px; }
  .tm-cal .tm-calgrid > .cal-cell > * { grid-column: 2; }
  .tm-cal .tm-calgrid > .cal-cell > .cal-day-num { grid-column: 1; grid-row: 1; justify-self: center; min-width: 34px; height: 34px; font-size: var(--fs-md); }
  .tm-cal .tm-calgrid > .cal-cell > .tm-wd { display: block; grid-column: 1; grid-row: 2; justify-self: center; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); }
  .tm-cal .tm-calgrid.week > .cal-cell > .cal-day-num { grid-column: 1 / -1; grid-row: auto; justify-self: start; height: auto; font-size: var(--fs-sm); }
  .tm-cal .tm-calgrid.week > .cal-cell { grid-template-columns: minmax(0, 1fr); }
  .tm-cal .tm-calgrid.week > .cal-cell > * { grid-column: 1; }
  .tm-cal .tm-calgrid > .cal-cell .cal-item { font-size: var(--fs-sm); padding: 8px 10px; white-space: normal; border-radius: var(--radius-xs); }
  .tm-cal .tm-calgrid > .cal-cell:not(:has(.cal-item)):not(.today) { padding-top: 6px; padding-bottom: 6px; background: transparent; }
  .tm-cal .tm-calgrid > .cal-cell.is-past:not(.today):not(:has(.cal-item)) { opacity: .6; }
  .tm-cal .tm-availbtns { gap: 6px; }
  .tm-cal .tm-availbtns form { flex: 1 1 0; }
  .tm-cal .tm-availbtns .btn { width: 100%; min-height: 40px; padding: 6px 14px; font-size: var(--fs-sm); border-radius: var(--radius-xs); justify-content: center; }
  .tm-cal .tm-legend { gap: 6px 12px; }
  .tm-cal .day-modal { padding: 0; }
  .tm-cal .day-modal-inner { width: 100%; max-height: none; min-height: 100%; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top, 0px); }
}
body.role-crew .tm-mycal .tm-availbtns .btn { min-height: 32px; }
@media print { .tm-caltools, .tm-adddetails { display: none !important; } }

/* ---------- Smale detalj-/skjemasider ---------- */
.tm-narrow { max-width: 760px; }
.tm-narrow-lg { max-width: 980px; }
.tm-sepform { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.tm-dangerzone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: var(--sp-4); padding: 12px 14px;
  border: 1px dashed var(--danger-border); border-radius: var(--radius-lg); }
.tm-dangerzone form { margin: 0; }
.tm-dz-h { margin-right: auto; font-size: var(--fs-sm); font-weight: 600; color: var(--danger); }

/* ---------- Crew-sider (Mine honorarer / bookinger / utlegg / oppdrag) ---------- */
.tm-kpi-2 { grid-template-columns: repeat(auto-fit, minmax(180px, 260px)); }
@media (max-width: 759.98px) { .tm-kpi-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fs-head h2 .hint { flex-basis: 100%; font-weight: 400; font-size: var(--fs-xs); }
.kpi.stat-card { padding: 12px 14px; }
.kpi.stat-card .value { font-size: 1.4rem; }
.tm-fee strong { font-variant-numeric: tabular-nums; }
.tm-cardlist { display: flex; flex-direction: column; gap: 12px; }
.tm-bk { padding: 16px 18px; }
.tm-bk.is-running { border-color: var(--success); box-shadow: inset 3px 0 0 var(--success); }
.tm-bk-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; }
.tm-bk-main { flex: 1 1 260px; min-width: 0; }
.tm-bk-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 2px; font-size: var(--fs-md); }
.tm-bk-title > a:first-child { color: var(--text); text-decoration: none; }
.tm-bk-title > a:first-child:hover { color: var(--primary); }
.tm-bk-cta:hover { filter: brightness(0.96); }
.tm-bk-meta { margin-top: 4px; }
.tm-bk-note { margin-top: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-xs); font-size: var(--fs-sm); }
.tm-bk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.tm-bk-amount { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.tm-bk-rate { font-size: var(--fs-xs); }
.tm-bk-work { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.tm-bk-work form { margin: 0; }
.tm-bk-running { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.tm-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 var(--success-border); animation: tm-pulse 1.6s infinite; flex-shrink: 0; }
@keyframes tm-pulse { 0% { box-shadow: 0 0 0 0 var(--success-border); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.tm-bk-basis { padding: 12px 14px; background: var(--primary-soft); border-radius: var(--radius-sm); }
.tm-bk-basis-h { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; color: var(--text-muted); }
.tm-bigbtn { min-height: 44px; padding: 10px 18px; font-size: var(--fs-base); }
.tm-expform { margin-bottom: var(--sp-5); }
.tm-receipt-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }
.tm-receipt-row input[type=file] { flex: 1 1 220px; min-width: 0; font-size: var(--fs-sm); }
.tm-formfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
@media (max-width: 759.98px) {
  .tm-bk-side { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; text-align: left; flex-wrap: wrap; }
  .tm-bigbtn, .tm-formfoot .btn { width: 100%; justify-content: center; }
  .tm-cambtn { flex: 1 1 100%; }
  .tm-expform .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .tm-pulse { animation: none; } }
/* Åpne oppdrag */
.tm-oj-when { display: none; }
.tm-oj-needs .badge { margin: 1px 2px 1px 0; }
table.tm-openjobs tr.is-yes > td:first-child { box-shadow: inset 3px 0 0 var(--success); }
.tm-avseg { display: inline-flex; }
.tm-avseg form { margin: 0; }
.tm-avseg button.on { background: var(--success-bg); color: var(--success); font-weight: 700; }
.tm-avseg button.on.no { background: var(--error-bg); color: var(--danger); }
@media (max-width: 759.98px) {
  .tm-oj-when { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: var(--fs-sm); color: var(--text-muted); }
  table.tm-openjobs > tbody > tr.is-yes { border-color: var(--success); box-shadow: inset 3px 0 0 var(--success); }
  table.tm-openjobs tr.is-yes > td:first-child { box-shadow: none; }
  .tm-avseg { display: grid; grid-template-columns: 2fr 1fr; width: 100%; }
  .tm-avseg button { width: 100%; min-height: 44px; font-size: var(--fs-base); }
}
/* Meld deg på (jobbsiden) */
.tm-signup { margin-top: 16px; max-width: 620px; border-left: 4px solid var(--primary); }
.tm-signup h2 { margin: 0 0 4px; font-size: var(--fs-md); }
.tm-signup .hint { margin: 0 0 12px; }
.tm-signup-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-signup-btns form { margin: 0; }
.tm-signup-status { margin: 10px 0 0; font-size: var(--fs-sm); }
@media (max-width: 759.98px) {
  .tm-signup-btns form { flex: 1 1 100%; }
  .tm-signup-btns .btn { width: 100%; min-height: 44px; justify-content: center; }
}
/* Min profil */
.tm-me-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.tm-me-img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.tm-me-initial { display: grid; place-items: center; background: var(--btn-primary-bg); color: #fff; font-size: 1.6rem; font-weight: 700; border: 0; }
.tm-me-id { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.tm-me-name { font-size: var(--fs-lg); font-weight: 700; overflow-wrap: anywhere; }
.tm-me-id > * { max-width: 100%; overflow-wrap: anywhere; }   /* lang e-post rant ut av profilkortet på mobil */
.tm-me-kv { margin-bottom: 14px; }
.tm-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.tm-check { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 400 !important; font-size: var(--fs-sm) !important; }
.tm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-afterblock { margin-top: var(--sp-4); }
.tm-afterblock > .card { margin-top: 0 !important; max-width: none !important; }

/* ---------- Ansatte ---------- */
.tm-person { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
.tm-person:hover .dt-title { color: var(--primary); }
.tm-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.tm-av-initial { display: inline-grid; place-items: center; background: var(--btn-primary-bg); color: #fff; font-size: 0.8rem; font-weight: 700; border: 0; }
.tm-av-lg { width: 56px; height: 56px; font-size: 1.3rem; }
.tm-ellip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-filter-none { margin: 12px 0; text-align: center; }
@media (max-width: 759.98px) { .tm-ellip { max-width: none; white-space: normal; } }
.tm-grid2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
@media (max-width: 999.98px) { .tm-grid2 { grid-template-columns: minmax(0, 1fr); } }
.tm-stack > .card, .tm-stack > div > .card { max-width: none !important; }
.tm-stack > .card + .card, .tm-stack > * { margin-top: 0 !important; }
.tm-stack { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-4); }
.tm-ph-person { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tm-contact-btns { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 759.98px) { .tm-contact-btns .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; } }
.tm-formcol { min-width: 0; }
.tm-formcol > .card, .tm-formcol > div > .card, .tm-formcol > form.card { max-width: none !important; }
.tm-sec-grid { margin-top: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.tm-sec-grid > .card { margin: 0 !important; }
.tm-switchlist { display: flex; flex-direction: column; gap: 8px; }
.tm-switchlist > .form-row.checkbox-row { margin: 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); align-items: flex-start; }
.tm-switchlist > .form-row.checkbox-row input { margin-top: 3px; }
/* Tilgangsmatrise */
table.tm-permtable td, table.tm-permtable th { text-align: left; }
.tm-perm-opt { display: inline-flex !important; align-items: center; gap: 6px; margin: 0; cursor: pointer; font-weight: 400 !important; }
.tm-perm-opt span { display: none; }
@media (max-width: 759.98px) {
  .tm-permwrap { overflow: visible; border: 0; background: transparent; }
  table.tm-permtable, table.tm-permtable tbody, table.tm-permtable tr { display: block; width: 100%; min-width: 0; background: transparent; }
  table.tm-permtable thead { display: none; }
  table.tm-permtable tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 8px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
  table.tm-permtable td { display: block; padding: 0; border: 0; background: transparent !important; }
  table.tm-permtable td.tm-perm-l { grid-column: 1 / -1; font-weight: 600; }
  .tm-perm-opt { width: 100%; justify-content: center; min-height: 40px; padding: 6px; border: 1px solid var(--border-strong); border-radius: var(--radius-xs); background: var(--surface); font-size: var(--fs-xs) !important; }
  .tm-perm-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600 !important; }
  .tm-perm-opt span { display: inline; }
}
/* Timeliste, historikk, oversikter */
.tm-lead { max-width: 820px; margin: 0 0 var(--sp-4); font-size: var(--fs-sm); }
.tm-grow { flex: 1 1 auto; }
.tm-bulkbar { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 20; }
.tm-filterform .form-group { margin: 0; }
.tm-filterform .form-group label { display: block; margin: 0 0 2px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.tm-filterform { align-items: flex-end; }
.tm-tscard, .tm-hcard { margin-bottom: var(--sp-4); }
.tm-tssum { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
table.data-table tr.tm-grouprow > td { background: var(--surface-2); font-weight: 600; }
@media (max-width: 759.98px) {
  table.data-table > tbody > tr.tm-grouprow { background: var(--surface-3); border-color: transparent; padding: 8px 12px; }
  table.data-table > tbody > tr.tm-grouprow > td.num { flex: 0 0 auto; }
  .tm-bulkbar { top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 6px); }
}
/* Bookinger */
.tm-times3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tm-listbar { margin-bottom: 12px; }
.tm-listbar .filter-chips { margin: 0; }
.tm-monthf .month-filter { margin: 0; }
.tm-bkform .form-grid-2 { gap: 0 18px; }
.tm-mt { margin-top: var(--sp-4); }
.tm-bkd { gap: var(--sp-4); }
.tm-respond { margin-top: var(--sp-4); border-left: 4px solid var(--primary); }
.tm-respond.is-ok { border-left-color: var(--success); }
.tm-respond.is-no { border-left-color: var(--danger); }
.tm-respond.is-wait { border-left-color: var(--warn); }
.tm-respond-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tm-respond-form input[type=text] { flex: 1 1 220px; min-width: 0; }
.tm-respline { margin-top: var(--sp-4); }
.tm-inline { align-items: center; }
.tm-inline select { flex: 0 1 220px; min-width: 0; }
.tm-statusbar { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.tm-statusbar form { margin: 0; }
@media (max-width: 759.98px) {
  .tm-respond-form .btn { flex: 1 1 auto; min-height: 44px; justify-content: center; }
  .tm-respond-form input[type=text] { flex-basis: 100%; }
}
/* Utlegg (admin) */
.tm-sendacc { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.tm-sendacc input[type=email] { flex: 1 1 200px; min-width: 0; max-width: 260px; min-height: 36px; }
.tm-exptools { gap: 8px 12px; }
.tm-segchips.seg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; background: transparent; overflow: visible; border-radius: 0; }
.tm-segchips.seg form + form button { border-left: 1px solid var(--border-strong); }
.tm-segchips.seg button { min-height: 32px; padding: 5px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; }
.tm-segchips.seg button:hover { background: var(--surface-2); }
.tm-segchips.seg button.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.tm-sumchip { font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tm-sumchip strong { color: var(--text); }
.tm-exptools .month-filter { margin: 0; }
@media (max-width: 759.98px) {
  .tm-segchips.seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .tm-segchips.seg button { white-space: nowrap; min-height: 36px; }
  .tm-sendacc { width: 100%; }
  .tm-sendacc input[type=email] { max-width: none; }
}
/* Planboard / ressursplan */
.tm-pbtools { gap: 8px 12px; }
.tm-pbrange { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tm-pbform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.tm-pbform select { width: auto; min-width: 0; }
.tm-pblegend { margin-top: 0; }
@media (max-width: 759.98px) { .tm-pbtools .tm-calnav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; } .tm-pbtools .toolbar-spacer { display: none; } }
.tm-rpsearch { flex: 1 1 200px; max-width: 320px; }
.tm-rplegend { margin: 0 0 12px; padding: 8px 12px; }
/* Ressurskalender */
.tm-rcal { display: flex; flex-direction: column; gap: 10px; }
.tm-rday { margin: 0; padding: 14px 16px; }
.tm-rday.is-empty { padding: 10px 16px; background: var(--surface-2); }
.tm-rday.is-empty strong { color: var(--text-muted); }
.tm-rday-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tm-rday-sum { display: inline-flex; flex-wrap: wrap; gap: 4px; font-size: var(--fs-sm); color: var(--text-muted); }
.tm-rjob { margin-top: 8px; padding: 10px 12px; background: var(--surface-2); border-left: 3px solid var(--primary); border-radius: var(--radius-xs); }
.tm-rjob-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 3px; font-size: var(--fs-sm); }
.tm-rfree { margin-top: 8px; font-size: var(--fs-xs); color: var(--success) !important; }
/* Oppgaver */
.tm-inline-h { display: inline; margin: 0; font-size: inherit; font-weight: inherit; letter-spacing: inherit; }
.tm-taskchk { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--border-strong);
  background: var(--surface); color: var(--btn-primary-text); font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: border-color .12s, background-color .12s; }
.tm-taskchk:hover { border-color: var(--success); }
.tm-taskchk.is-done { background: var(--success); border-color: var(--success); color: var(--surface); }
table.data-table tr.tm-overdue > td { background: var(--error-bg); }
table.data-table tr.tm-done .dt-title { text-decoration: line-through; }
.tm-comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tm-comment-b { flex: 1; min-width: 0; }
.tm-commentform { margin-top: 12px; }
@media (max-width: 759.98px) {
  table.data-table > tbody > tr.tm-overdue { border-color: var(--danger-border); background: var(--error-bg); }
  table.data-table > tbody > tr.tm-overdue > td { background: transparent; }
  .tm-taskchk { width: 32px; height: 32px; }
}
.tm-fieldset { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; border: 0; padding: 0; margin: 0; }
.tm-notebody { font-size: var(--fs-md); line-height: 1.6; min-height: 240px; }

/* ---------- Chat ---------- */
.tm-chatwrap { max-width: 980px; }
.tm-chatsearch { margin-bottom: var(--sp-5); }
.tm-chatsearch .toolbar-search input { min-height: 42px; }
.tm-chathits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tm-chathit { display: inline-flex; align-items: center; gap: 8px; }
.tm-chathit .tm-av { width: 22px; height: 22px; font-size: 0.68rem; }
.tm-conv { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.tm-av-group { background: var(--success); }
:root[data-theme="dark"] .tm-av-group { background: var(--success-bg); color: var(--success); }   /* hvit bokstav på lysegrønt ga for lav kontrast */
table.tm-convtable tr.is-unread .dt-title { font-weight: 800; }
table.tm-convtable td.last-msg { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-conv-role { color: var(--text-muted); font-size: var(--fs-sm); }
@media (max-width: 759.98px) {
  table.tm-convtable > thead { display: none; }
  table.tm-convtable td.last-msg { white-space: normal; max-width: none; display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  table.tm-convtable > tbody > tr > td.tm-conv-role { flex: 0 0 auto; align-self: center; }
  table.data-table.tm-convtable > tbody > tr > td.row-actions { border-top: 0; padding-top: 0; justify-content: flex-end; }
}
.tm-chatpage { max-width: 900px; }
.tm-chathead { margin-bottom: 12px; }
.tm-chathead h1 { margin: 0; }
.tm-chathead .tm-conv { display: flex; margin-top: 2px; }
.tm-members { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0; }
.tm-members > .ic { margin-top: 0.2em; }   /* ikonet følger første linje når medlemslisten går over flere linjer */
.tm-chat { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 200px); height: calc(100dvh - var(--topbar-h) - 200px); min-height: 380px; }
.tm-chat-msgs { flex: 1 1 auto; min-height: 0; padding: 16px; background: var(--surface-2); }
.tm-chat-msgs #chat-empty { margin: auto; text-align: center; }
.tm-chat-empty { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 50%; background: var(--surface-3); color: var(--text-muted); }
.tm-chat-file { padding: 6px 16px 0; font-size: var(--fs-xs); }
.tm-composer { display: flex; gap: 6px; align-items: center; margin: 0; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.tm-composer #chat-input { flex: 1 1 auto; min-width: 0; min-height: 42px; border-radius: 999px; padding-left: 16px; }
.tm-cbtn { padding: 8px 10px; }
.tm-cbtn .tm-cbtn-l { font-size: var(--fs-sm); }
.tm-sendbtn { min-height: 42px; border-radius: 999px; padding: 8px 16px; }
/* Meldingsbobler (klasser fra chatbox.js – overstyrer innebygde farger slik at mørk modus får god kontrast) */
.tm-chat .cb-msg { max-width: min(78%, 560px) !important; }
.tm-chat .cb-bubble { padding: 9px 13px !important; border-radius: 16px !important; font-size: var(--fs-base) !important; line-height: 1.45; box-shadow: var(--shadow-xs); }
.tm-chat .cb-msg.is-theirs .cb-bubble { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border); border-bottom-left-radius: 5px !important; }
.tm-chat .cb-msg.is-mine .cb-bubble { background: var(--btn-primary-bg) !important; color: #fff !important; border-bottom-right-radius: 5px !important; }
.tm-chat .cb-file { background: var(--surface) !important; border: 1px solid var(--border); color: var(--primary); }
.tm-chat .cb-time { padding: 0 4px; }
.tm-chat .cb-who { padding: 0 4px; font-weight: 600; }
@media (max-width: 759.98px) {
  .tm-chat { height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - 190px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); min-height: 320px; margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; }
  .tm-chathead .row-actions.ph-actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .tm-chathead .row-actions.ph-actions > form { width: auto; }
  .tm-chathead .row-actions.ph-actions .btn { width: auto; flex: 0 0 auto; }
  .tm-cbtn .tm-cbtn-l, .tm-sendbtn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tm-sendbtn { width: 42px; padding: 0; }
  .tm-chat .cb-msg { max-width: 86% !important; }
}
.tm-memsearch { margin-bottom: 8px; }

/* ---------- Varsler ---------- */
.tm-notifwrap { max-width: 980px; }
table.tm-notif tr.tm-dayrow > td { padding: 14px 14px 6px; background: var(--surface-2); color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
table.tm-notif tbody tr.tm-dayrow:hover > td { background: var(--surface-2); }
/* Flex på et indre element – flex på selve <td> gjorde at radstrekene ikke møttes mellom kolonnene */
.tm-nmsg-in { display: flex; align-items: flex-start; gap: 10px; }
.tm-ndot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; flex-shrink: 0; background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
table.tm-notif tr.is-unread .tm-ndot { background: var(--primary); box-shadow: none; }
table.tm-notif tr.is-unread .tm-ntext { font-weight: 650; }
table.tm-notif tr.is-unread > td { background: var(--primary-soft); }
table.tm-notif tbody tr.is-unread:hover > td { background: var(--primary-soft-2); }
.tm-ntime { white-space: nowrap; }
@media (max-width: 759.98px) {
  .tm-notifwrap { border: 0; background: transparent; overflow: visible; }
  table.tm-notif, table.tm-notif tbody { display: block; width: 100%; min-width: 0; background: transparent; }
  table.tm-notif thead { display: none; }
  table.tm-notif tr { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px; margin: 0 0 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
  table.tm-notif tr.is-unread { background: var(--primary-soft); border-color: var(--primary-soft-2); }
  table.tm-notif tr > td { display: block; padding: 0 !important; border: 0; background: transparent !important; }
  table.tm-notif tr > td.tm-nmsg { display: block; grid-column: 1 / -1; }
  table.tm-notif tr > td.tm-ntime { align-self: center; padding-left: 19px !important; }
  table.tm-notif tr > td.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
  table.tm-notif tr.tm-dayrow { display: block !important; padding: 10px 2px 2px; margin: 0; background: transparent; border: 0; }
}
/* Brytere (varslingssenter) */
.tm-switches { display: flex; flex-direction: column; }
.tm-switch { display: flex !important; justify-content: space-between; align-items: center; gap: 12px; margin: 0 !important; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; font-weight: 500 !important; }
.tm-switch:last-child { border-bottom: 0; }
.tm-switch input[type=checkbox] { appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0; width: 44px; height: 26px; min-height: 0; margin: 0; padding: 0;
  border-radius: 999px; border: 0; background: var(--border-strong); cursor: pointer; transition: background-color .15s var(--ease); }
.tm-switch input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform .15s var(--ease); }
.tm-switch input[type=checkbox]:checked { background: var(--success); }
.tm-switch input[type=checkbox]:checked::after { transform: translateX(18px); }
.tm-switch input[type=checkbox]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Kjøreplaner */
.tm-prog { display: inline-flex; align-items: center; gap: 8px; }
.tm-prog .progress { width: 70px; }
.tm-live { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; align-self: center; }
.tm-rsimport { margin-bottom: 14px; background: var(--surface-2); padding: 12px 16px; }
/* Prosjekter */
.tm-projgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }   /* min(): ikke sideskroll på 320 px */
.tm-projcard { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: border-color .12s, box-shadow .12s; }
.tm-projcard:hover { color: inherit; }
.tm-projtop { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tm-projmain { min-width: 0; }
.tm-projname { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); font-weight: 700; }
.tm-projname .ic { color: var(--primary); }
.tm-projmeta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); font-size: var(--fs-xs); }
.tm-projmeta span { display: inline-flex; align-items: center; gap: 5px; }
.tm-projempty { grid-column: 1 / -1; }
/* Tilgangsrutenett (prosjektmedlemmer) */
@media (max-width: 759.98px) {
  table.tm-permgrid, table.tm-permgrid tbody { display: block; width: 100%; min-width: 0; }
  table.tm-permgrid thead { display: none; }
  table.tm-permgrid tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 8px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
  table.tm-permgrid td { display: block; padding: 0; border: 0; background: transparent !important; text-align: left !important; }
  table.tm-permgrid td.tm-pname { grid-column: 1 / -1; font-weight: 600; }
  table.tm-permgrid td.tm-pcell { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 8px; background: var(--surface) !important; border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: var(--fs-xs); }
  table.tm-permgrid td.tm-pcell::before { content: attr(data-label); order: 2; }
  table.tm-permgrid td:last-child { grid-column: 1 / -1; text-align: right !important; }
  .tm-permgrid-wrap, .form-section .table-wrap { max-height: none !important; }
}

/* ---------- Admin: roller, backup, eksport, logger ---------- */
.tm-rolenew { max-width: 720px; margin-bottom: var(--sp-4); }
.tm-rolegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-4); align-items: start; }
.tm-rolegrid .card-head { justify-content: flex-start; }
.lr-item.is-off .lr-main { color: var(--text-muted); }
.tm-exportgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-4); align-items: start; }
.tm-exp { display: flex; flex-direction: column !important; align-items: stretch !important; gap: 8px; }
.tm-exp .btn { justify-content: flex-start; }
/* Min e-post */
.tm-mailbox, .tm-mailmsg { max-width: 860px; }
.tm-compose { margin-bottom: 14px; }
.tm-compose > summary { list-style: none; }
.tm-compose > summary::-webkit-details-marker { display: none; }
.tm-mailrow { display: block; padding: 12px 10px; margin: 0 -10px; border-bottom: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text); text-decoration: none; }
.tm-mailrow:hover { background: var(--row-hover); color: var(--text); }
.tm-mailrow.is-unread { box-shadow: inset 3px 0 0 var(--primary); }
.tm-mailrow-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tm-mailrow-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-mailrow:not(.is-unread) .tm-mailrow-top strong { font-weight: 500; }
.tm-mailprev { margin-top: 2px; font-size: var(--fs-sm); color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tm-mailhead { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }

/* ---------- Innlogging og invitasjon (kun visuelt) ---------- */
.tm-authlogo { display: block; height: 34px; width: auto; max-width: 70%; margin: 0 0 18px; }
.tm-joincard { padding: 24px; }
.tm-2fa { max-width: 520px; }
.tm-radiocards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.tm-radiocard { display: flex !important; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-weight: 400 !important; }
.tm-radiocard:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
/* Knapperader: bryt heller mellom knapper enn inni en knappetekst */
.form-actions { flex-wrap: wrap; }
.form-actions > .btn, .tm-formfoot > .btn, .tm-actions > .btn { white-space: nowrap; }
.tm-cal .tm-daystatus { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Prosjekt (detalj) ---------- */
.tm-pd-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; margin-bottom: var(--sp-4); }
@media (max-width: 899.98px) { .tm-pd-top { grid-template-columns: minmax(0, 1fr); } }
.tm-pd-top > .tm-pd-card { margin: 0; }
.tm-pd-card { margin-bottom: var(--sp-4); }
.tm-pd-over { gap: 10px 18px; font-size: var(--fs-sm); }
.tm-pd-wx { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.tm-pd-jh { margin-top: var(--sp-5); }
.tm-pd-jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-bottom: var(--sp-4); }
.tm-pd-job { display: block; margin: 0; padding: 14px 16px; color: inherit; text-decoration: none; }
.tm-pd-job:hover { color: inherit; }
.tm-pd-jobrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tm-pd-jobt { font-weight: 700; }
.tm-crewchip { cursor: default; gap: 6px; }
.tm-crewchip .tm-av { width: 20px; height: 20px; font-size: 0.62rem; }
.tm-yes { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: var(--success-bg); color: var(--success); font-size: 0.75rem; font-weight: 700; }
.tm-fileitem { align-items: center; }
.tm-chat-inline { padding: 12px; border-radius: var(--radius); background: var(--surface-2); }
/* Bobler også i innebygde chatter (prosjekt) */
.tm-chatbubbles .cb-msg { max-width: min(80%, 560px) !important; }
.tm-chatbubbles .cb-bubble { padding: 9px 13px !important; border-radius: 16px !important; }
.tm-chatbubbles .cb-msg.is-theirs .cb-bubble { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border); }
.tm-chatbubbles .cb-msg.is-mine .cb-bubble { background: var(--btn-primary-bg) !important; color: #fff !important; }

/* ---------- Kalender: filter, Oversikt (liste) og kompakt månedsrutenett på mobil (2026-09) ---------- */
.tm-calfilter { margin: 0 0 12px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.tm-calfilter::-webkit-scrollbar { display: none; }
.tm-calfilter .chip { flex: 0 0 auto; white-space: nowrap; }
.tm-agenda { display: flex; flex-direction: column; gap: 10px; }
.tm-ag-day { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 12px 14px; margin: 0; }
.tm-ag-day.is-today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.tm-ag-day.is-past { opacity: .75; }
.tm-ag-date { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 2px; }
.tm-ag-num { font-size: 1.35rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tm-ag-day.is-today .tm-ag-num { color: var(--primary); }
.tm-ag-wd { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.tm-ag-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tm-ag-h { font-weight: 600; font-size: var(--fs-sm); color: var(--text-muted); }
.tm-ag-body .cal-item { display: block; font-size: var(--fs-sm); padding: 8px 10px; white-space: normal; border-radius: var(--radius-xs); }
.tm-daypanel { display: none; }
@media (max-width: 759.98px) {
  .tm-seg { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tm-seg .btn { padding-left: 4px; padding-right: 4px; font-size: .82rem; }
  /* Kompakt måned: 7 kolonner, prikker for innhold, valgt dag vises under */
  .tm-cal-admin .tm-calgrid.tm-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-weekday { display: block; text-align: center; padding: 2px 0 4px; font-size: .68rem; }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell.empty { display: block; }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; align-content: flex-start; column-gap: 3px; row-gap: 3px;
    min-height: 56px; padding: 5px 2px 6px; border-radius: 10px; border: 1px solid transparent; background: var(--surface); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell:not(:has(.cal-item)):not(.today) { padding: 5px 2px 6px; background: var(--surface); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell.is-past:not(.today):not(:has(.cal-item)) { opacity: .55; }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .tm-wd { display: none; }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-day-num { flex: 0 0 auto; width: 30px; min-width: 0; height: 30px; margin: 0 calc((100% - 30px) / 2);
    display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: .92rem; pointer-events: none; }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell.today > .cal-day-num { background: var(--btn-primary-bg, var(--primary)); color: #fff; }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell.is-selected { border-color: var(--primary); background: var(--primary-soft); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell .tm-abj, .tm-cal-admin .tm-calgrid.tm-month > .cal-cell .tm-avail,
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell .tm-availbtns { display: none; }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item { flex: 0 0 auto; display: block; width: 7px; height: 7px; min-height: 0; padding: 0; margin: 0;
    border: 0; border-radius: 50%; font-size: 0; line-height: 0; overflow: hidden; background: currentColor; opacity: 1; pointer-events: none; }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item * { display: none; }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item:nth-child(n+7) { display: none; }
  /* nth-child talte også dagnummer, ukedag og skjulte «tilgjengelig»-linjer – prikker forsvant etter 2–4 elementer.
     Tell bare prikkene (maks 8 = to rader); nettlesere uten «of S» viser alle prikkene. */
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item:nth-child(n+7) { display: block; }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item:nth-child(n+9 of .cal-item) { display: none; }
  /* Prikkfarge pr. type – samme som fargeforklaringen (tekstfargen ga svarte prikker for oppgaver/transport/hendelser) */
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.job { background: var(--success); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.event { background: var(--warn); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.project { background: var(--primary); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.booking { background: var(--info); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.transport { background: var(--neutral); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.openjob { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--success); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.task { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--warn); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.task.is-late { box-shadow: inset 0 0 0 1.5px var(--danger); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.task.is-done { opacity: .45; }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.entry { --sc: var(--warn); background: linear-gradient(90deg, var(--sc) 0 50%, var(--surface) 50%); box-shadow: inset 0 0 0 1px var(--sc); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.entry.scope-admin { --sc: var(--danger); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.entry.scope-staff { --sc: var(--success); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.entry.scope-specific { --sc: var(--primary); }
  .tm-cal-admin .tm-calgrid.tm-month > .cal-cell > .cal-item.entry.scope-all { --sc: var(--info); }
  .tm-daypanel { display: block; margin-top: 12px; padding: 14px 16px; }
  .tm-daypanel[hidden] { display: none; }
  .tm-dp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
  .tm-dp-head h2 { margin: 0; font-size: 1.05rem; }
  .tm-dp-head .btn { flex-shrink: 0; white-space: nowrap; }   /* «Åpne dagen» brakk over to linjer ved lang dato */
  .tm-dp-body { display: flex; flex-direction: column; gap: 6px; }
  .tm-dp-body .cal-item { display: block; font-size: var(--fs-sm); padding: 9px 11px; white-space: normal; border-radius: var(--radius-xs); }
  .tm-ag-day { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding: 10px 12px; }
}


/* ---------- Teknikerbehov per dag (jobbskjemaet, Design 2026-10) ---------- */
.jf-dn { container: jfdn / inline-size; }
.jf-dn-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.jf-dn-list:empty { display: none; }
.jf-dn-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr) minmax(0, 0.95fr) minmax(0, 1.4fr) 76px minmax(0, 1.5fr) auto;
  gap: 8px 10px; align-items: end; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm, 10px); background: var(--surface-2); }
.jf-dn-row input { width: 100% !important; min-width: 0 !important; }
.jf-dn-row .jf-dn-del { align-self: end; min-height: 40px; }
.jf-dn-empty { margin: 6px 0; font-size: 0.86rem; }
.jf-dn-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jf-dn-msg { font-size: 0.82rem; }
@container jfdn (max-width: 759.98px) {
  .jf-dn-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .jf-dn-row > .jf-dn-day { grid-column: 1 / 3; }
  .jf-dn-row > .jf-dn-from { grid-column: 3 / 5; }
  .jf-dn-row > .jf-dn-to { grid-column: 5 / 7; }
  .jf-dn-row > .jf-dn-role { grid-column: 1 / 5; }
  .jf-dn-row > .jf-dn-qty { grid-column: 5 / 7; }
  .jf-dn-row > .jf-dn-note { grid-column: 1 / 6; }
  .jf-dn-row > .jf-dn-del { grid-column: 6 / 7; justify-self: stretch; }
}
@container jfdn (max-width: 419.98px) {
  .jf-dn-row > .jf-dn-day { grid-column: 1 / 7; }
  .jf-dn-row > .jf-dn-from { grid-column: 1 / 4; }
  .jf-dn-row > .jf-dn-to { grid-column: 4 / 7; }
  .jf-dn-row > .jf-dn-note { grid-column: 1 / 7; }
  .jf-dn-row > .jf-dn-del { grid-column: 1 / 7; }
}
/* Åpne oppdrag: behov per dag (fra–til) under behovsmerkene. */
.tm-oj-dn { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 0.8rem; }
.tm-oj-dn-d { font-weight: 700; text-transform: capitalize; }
.tm-oj-dn-t { font-variant-numeric: tabular-nums; color: var(--text-muted); }

/* Min kalender på mobil (2026-10): kompakt månedsrutenett med dagpanel (klassen is-compact settes av my_calendar.html). */
.tm-compact-toggle { display: none; }
.tm-daypanel-h { font-weight: 700; margin: 0 0 6px; font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 759.98px) {
  .tm-mycal .tm-compact-toggle { display: inline-flex; justify-content: center; min-height: 40px; }
  .tm-mycal.is-compact .tm-calgrid.tm-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .tm-mycal.is-compact .tm-calgrid.tm-month > .cal-weekday { display: block; text-align: center; padding: 4px 0; }
  .tm-mycal.is-compact .tm-calgrid.tm-month > .cal-cell.empty { display: block; min-height: 0; }
  .tm-mycal.is-compact .tm-calgrid.tm-month > .cal-cell { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; min-height: 60px; padding: 6px 2px; cursor: pointer; opacity: 1; background: var(--surface); }
  .tm-mycal.is-compact .tm-calgrid.tm-month > .cal-cell > :not(.cal-day-num):not(.tm-dots) { display: none !important; }
  .tm-mycal.is-compact .tm-calgrid.tm-month > .cal-cell > .cal-day-num { min-width: 30px; height: 30px; font-size: var(--fs-sm); margin: 0; }
  .tm-mycal.is-compact .tm-calgrid.tm-month > .cal-cell.is-past:not(.today) { opacity: .55; }
  .tm-mycal.is-compact .tm-calgrid.tm-month > .cal-cell.av-ledig { background: var(--success-bg, rgba(46, 160, 90, .14)); border-color: var(--success, #2ea05a); }
  .tm-mycal.is-compact .tm-calgrid.tm-month > .cal-cell.av-opptatt { background: var(--danger-bg, rgba(220, 60, 60, .12)); border-color: var(--danger, #dc3c3c); }
  .tm-mycal.is-compact .tm-calgrid.tm-month > .cal-cell.is-selected { outline: 2px solid var(--primary); outline-offset: -2px; }
  .tm-mycal.is-compact .tm-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
  .tm-mycal .tm-dots { display: none; }
  .tm-mycal.is-compact .tm-dots i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
  .tm-mycal.is-compact .tm-dots i.d-event { background: var(--warn, #e0a000); }
  .tm-mycal.is-compact .tm-dots i.d-openjob { background: var(--success, #2ea05a); }
  .tm-mycal.is-compact .tm-dots i.d-booking { background: #3b82f6; }
  .tm-mycal.is-compact .tm-dots i.d-transport { background: #0ea5e9; }
  .tm-mycal.is-compact .tm-dots i.d-task { background: var(--text-muted); }
  .tm-mycal.is-compact .tm-dots i.d-entry { background: #8b5cf6; }
  .tm-mycal .tm-daypanel { margin-top: 12px; }
  .tm-mycal .tm-daypanel > .cal-cell { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
  .tm-mycal .tm-daypanel > .cal-cell > .cal-day-num, .tm-mycal .tm-daypanel > .cal-cell > .tm-wd { display: none; }
  .tm-mycal .tm-daypanel .cal-item { font-size: var(--fs-sm); padding: 8px 10px; white-space: normal; border-radius: var(--radius-xs); }
}
