/* Skifti. Lys, rolig flate med hvite kort; hver ansatt har sin egen farge
   (--c), og vaktkortene tegnes i en lys tone av den. Mobil først; fra 900 px
   får appen sidemeny og rutenett som bruker hele bredden. */

:root {
  color-scheme: light;
  --bg: #F4F5FA; --surface: #fff; --surface-2: #F7F8FC; --text: #1C2033; --muted: #6A6F85; --faint: #9AA0B4;
  --line: #E6E8F0; --line-2: #EEF0F6;
  --accent: #4F6BED; --accent-2: #3F58D6; --accent-soft: #EEF1FF; --accent-ink: #2F44B5;
  --danger: #E5484D; --danger-soft: #FDECEC; --warn-soft: #FFF6E3; --warn-ink: #7A4F07;
  --open: #94A3B8;
  --r: 12px; --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(22, 28, 61, .05);
  --shadow: 0 1px 2px rgba(22, 28, 61, .04), 0 8px 24px rgba(22, 28, 61, .07);
  --shadow-lg: 0 24px 64px rgba(22, 28, 61, .2);
  --ring: 0 0 0 4px rgba(79, 107, 237, .16);
  --tab-h: 64px; --side-w: 236px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { letter-spacing: -.015em; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(79, 107, 237, .35); outline-offset: 2px; }

.ic { width: 20px; height: 20px; flex: none; display: block; }

/* ---- rammen: mobil -------------------------------------------------------- */

.sidebar { display: none; }
.content { min-width: 0; }
.topstack { position: sticky; top: 0; z-index: 20; }
.mobilebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: rgba(244, 245, 250, .86); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
}
.mobileme a { display: block; text-decoration: none; }
main { padding: 4px max(16px, env(safe-area-inset-right)) calc(var(--tab-h) + 28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); max-width: 1600px; margin: 0 auto; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px; display: block; overflow: hidden; flex: none;
  background: linear-gradient(135deg, #4F6BED, #8B5CF6); box-shadow: 0 4px 12px rgba(91, 99, 240, .35);
}
.logo-mark svg { width: 100%; height: 100%; display: block; }
.wordmark { font-weight: 800; font-size: 19px; letter-spacing: -.035em; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--faint); font-size: 11px; font-weight: 600; text-decoration: none; min-width: 0;
}
.tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 2px; }
.tabbar a .ic { width: 24px; height: 24px; }
.tabbar a.active { color: var(--accent); }
.tabbar a.active .ic { stroke-width: 2.2; }

body:not(.authed) .tabbar, body:not(.authed) .mobileme, body:not(.authed) .bell { display: none; }
.mobile-right { display: flex; align-items: center; gap: 6px; }
.bell {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  color: var(--muted); text-decoration: none; transition: background .15s, color .15s;
}
.bell:hover, .bell.active { background: var(--accent-soft); color: var(--accent-ink); }
.bell .ic { width: 21px; height: 21px; }
.bell-badge {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #fff;
}
body:not(.authed) main { padding-bottom: 40px; }

/* ---- rammen: desktop ------------------------------------------------------ */

@media (min-width: 900px) and (min-height: 560px) {
  body.authed .app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
  body.authed .sidebar {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow: hidden auto;
    padding: 22px 14px 16px; color: #fff;
    background: radial-gradient(420px 320px at 0% 0%, rgba(99, 125, 255, .35), transparent 70%),
      radial-gradient(380px 300px at 100% 100%, rgba(255, 209, 102, .14), transparent 70%),
      linear-gradient(175deg, #272C86 0%, #33298A 55%, #452B8F 100%);
  }
  .side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 22px 8px; }
  .sidebar .logo-mark { background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
  .sidebar .wordmark { color: #fff; }
  .sidebar .bell { color: rgba(255, 255, 255, .75); }
  .sidebar .bell:hover, .sidebar .bell.active { background: rgba(255, 255, 255, .12); color: #fff; }
  .sidebar .bell-badge { box-shadow: 0 0 0 2px #2A2C86; }
  /* Logoens piller, svakt nederst */
  body.authed .side-art { display: block; position: absolute; left: -40px; bottom: 56px; width: 300px; height: 190px; opacity: .035; pointer-events: none; }
  .side-art i { position: absolute; height: 56px; border-radius: 28px; background: #fff; }
  .side-art i:first-child { left: 0; top: 20px; width: 190px; }
  .side-art i:nth-child(2) { left: 56px; top: 100px; width: 190px; }
  @media (max-height: 820px) { body.authed .side-art { display: none; } }
  .side-art b { position: absolute; left: 210px; top: 26px; width: 42px; height: 42px; border-radius: 50%; background: #fff; }
.sidebar .logo { padding: 0; }
  .mobilebar, .tabbar { display: none; }
  main { padding: 30px 36px 56px; }
}
@media (min-width: 900px) and (min-height: 560px) and (max-width: 1199px) {
  main { padding: 24px 20px 48px; }
  .wg-emp { padding-left: 12px; gap: 9px; }
  .wg-emp .av { width: 30px; height: 30px; font-size: 11px; }
}
/* Sidemenyen (PC): dyp blå-lilla bakgrunn som innloggingen, grupper, og
   aktiv side med lys bakgrunn, hvit ikonboks og gul markør. */
.sidenav { display: flex; flex-direction: column; gap: 18px; }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-label { padding: 0 12px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .42); }
.sidenav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 12px;
  color: rgba(255, 255, 255, .74); font-weight: 600; font-size: 14.5px; text-decoration: none; transition: background .15s, color .15s;
}
.sidenav .nav-ic { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, .08); transition: background .15s, color .15s; }
.sidenav .nav-ic .ic { width: 18px; height: 18px; }
.tabbar .nav-ic { display: contents; }
.sidenav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidenav a:hover .nav-ic { background: rgba(255, 255, 255, .14); }
.sidenav a.active { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.sidenav a.active .nav-ic { background: #fff; color: #4338CA; box-shadow: 0 4px 12px rgba(17, 12, 60, .3); }
.sidenav a.active::before { content: ""; position: absolute; left: -14px; top: 50%; width: 4px; height: 20px; margin-top: -10px; border-radius: 0 4px 4px 0; background: #FFD166; }
/* Chatten åpnes over siden, så den markeres uten den gule markøren. */
.sidenav a.nav-chat.active::before { display: none; }
.sidenav .nav-badge { box-shadow: 0 0 0 2px rgba(23, 20, 70, .5); }
.side-new {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; margin-bottom: 2px; border: 0; border-radius: 12px;
  background: #fff; color: #3730A3; font: 700 14.5px var(--font); cursor: pointer; box-shadow: 0 8px 20px rgba(10, 8, 40, .28); transition: transform .08s, box-shadow .15s;
}
.side-new:hover { box-shadow: 0 10px 26px rgba(10, 8, 40, .36); }
.side-new:active { transform: translateY(1px); }
.side-new .ic { width: 18px; height: 18px; }
.side-user { margin-top: auto; position: relative; z-index: 1; }
.side-user-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: 14px;
  background: rgba(255, 255, 255, .1); color: #fff; font: inherit; text-align: left; cursor: pointer; transition: background .15s;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.side-user-btn:hover { background: rgba(255, 255, 255, .16); }
.side-user-btn .grow { min-width: 0; }
.side-user-btn > .ic { width: 16px; height: 16px; color: rgba(255, 255, 255, .55); }
.side-user-btn .av { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.side-art { display: none; }
.me-btn { display: block; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.me-btn:active { transform: scale(.95); }
.me-btn.active .av { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.side-user:empty { display: none; }
.side-collapse {
  display: none; flex: none; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 10px; background: transparent;
  color: rgba(255, 255, 255, .6); cursor: pointer; transition: background .15s, color .15s;
}
.side-collapse:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.side-collapse .ic { width: 19px; height: 19px; }
body.authed .side-collapse { display: grid; }
.side-top .logo { min-width: 0; }
.side-top .wordmark { min-width: 0; }
/* Smal sidemeny: bare ikoner, navnet vises når man holder over (title). */
@media (min-width: 900px) and (min-height: 560px) {
  body.side-mini { --side-w: 76px; }
  body.authed.side-mini .sidebar { padding: 20px 12px 16px; }
  body.side-mini .side-top { flex-direction: column; gap: 12px; padding: 0 0 18px; }
  body.side-mini .side-top .wordmark, body.side-mini .side-art { display: none !important; }
  body.side-mini .side-label { height: 1px; padding: 0; margin: 2px 8px 8px; font-size: 0; background: rgba(255, 255, 255, .14); }
  body.side-mini .sidenav a { justify-content: center; padding: 6px 0; }
  body.side-mini .sidenav a > span { display: none; }
  body.side-mini .sidenav a.active::before { left: -12px; }
  body.side-mini .sidenav .nav-badge { position: absolute; top: 0; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; line-height: 18px; font-size: 10.5px; }
  body.side-mini .side-new { padding: 0; }
  body.side-mini .side-new span { display: none; }
  body.side-mini .side-user-btn { justify-content: center; padding: 8px 0; }
  body.side-mini .side-user-btn .grow, body.side-mini .side-user-btn > .ic { display: none; }
}
.side-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-role { font-size: 12px; color: rgba(255, 255, 255, .6); }

/* ---- sidehode ------------------------------------------------------------- */

.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 16px; margin: 6px 0 18px; }
.pagehead h1 { font-size: 28px; line-height: 1.15; margin: 0; letter-spacing: -.025em; }
.pagehead p { margin: 3px 0 0; color: var(--muted); }
.pagehead-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 899px), (max-height: 559px) {
  .pagehead { margin-top: 2px; }
  .pagehead h1 { font-size: 24px; }
  .pagehead-tools { width: 100%; justify-content: space-between; }
  .pagehead-tools.end { width: auto; }
  .hide-sm { display: none; }
}

/* ---- knapper -------------------------------------------------------------- */

a.btn { text-decoration: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-weight: 650; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .06s;
}
.btn:hover { background: var(--surface-2); border-color: #D6DAE6; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(79, 107, 237, .3), 0 6px 16px rgba(79, 107, 237, .28); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--accent-ink); }
.btn-ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #F5C6C8; }
.btn-block { width: 100%; height: 48px; }

.seg { display: inline-flex; padding: 3px; background: #E8EAF2; border-radius: 12px; }
.seg button {
  border: 0; background: transparent; height: 36px; padding: 0 16px; border-radius: 9px;
  font-weight: 650; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(22, 28, 61, .1); }
.stepper { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.stepper button {
  border: 0; background: transparent; height: 34px; min-width: 34px; padding: 0 10px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 650; cursor: pointer;
}
.stepper button:hover { background: var(--surface-2); }
.stepper .ic { width: 18px; height: 18px; }

/* ---- skjema --------------------------------------------------------------- */

.field { display: block; margin: 0 0 16px; min-width: 0; }
.label { display: block; font-size: 13px; font-weight: 650; color: var(--muted); margin-bottom: 7px; }
input:where(:not([type=checkbox]):not([type=radio]):not([type=hidden])), textarea {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 46px; padding: 0 14px; margin: 0;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); font: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.4; }
input:hover, textarea:hover { border-color: #D4D8E5; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=date], input[type=time] { display: flex; align-items: center; font-variant-numeric: tabular-nums; }
input::-webkit-date-and-time-value { text-align: left; }
input::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.time-wrap { position: relative; display: block; }
.time-wrap .ic { position: absolute; left: 14px; top: 23px; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
input.time-input { padding-left: 42px; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
input.time-input::placeholder { font-weight: 500; letter-spacing: 0; }
input.is-bad { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(229, 72, 77, .14); }
.time-wrap.open input.time-input { border-color: var(--accent); box-shadow: var(--ring); }
.time-wrap.open .ic { color: var(--accent); }

/* Tidsvelger under klokkeslettfeltene */
/* Datovelger */
.date-wrap { position: relative; display: block; }
.date-wrap > .ic { position: absolute; left: 14px; top: 23px; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
input.date-input { padding-left: 40px; padding-right: 46px; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
input.date-input::placeholder { font-weight: 500; letter-spacing: 0; }
input.date-input.is-bad { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.date-dow { position: absolute; right: 12px; top: 23px; transform: translateY(-50%); font-size: 13px; font-weight: 650; color: var(--muted); pointer-events: none; }
.date-wrap.open input.date-input { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 107, 237, .16); }
.datepop {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: 304px; padding: 10px 10px 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); animation: drop .14s ease-out;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 2px 8px; }
.dp-title { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.dp-nav { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
.dp-nav:hover { background: var(--surface-2); color: var(--text); }
.dp-nav .ic { width: 18px; height: 18px; }
.dp-grid { display: grid; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); row-gap: 2px; }
.dp-dowh { padding: 2px 0 6px; text-align: center; font-size: 11px; font-weight: 750; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.dp-wk { display: grid; place-items: center; font-size: 10.5px; font-weight: 650; color: var(--faint); font-variant-numeric: tabular-nums; }
.dp-dowh.dp-wk { font-size: 9.5px; }
.dp-day {
  position: relative; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--text);
  font: 600 14px var(--font); font-variant-numeric: tabular-nums; cursor: pointer;
}
.dp-day:hover:not(:disabled) { background: var(--surface-2); }
.dp-day.is-out { color: var(--faint); font-weight: 500; }
.dp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent-ink); }
.dp-day.in-range { background: var(--accent-soft); border-radius: 0; }
.dp-day.r-start { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.dp-day.r-end { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.dp-day.is-sel, .dp-day.is-sel:hover { background: var(--accent); color: #fff; border-radius: 10px; box-shadow: 0 4px 10px rgba(79, 107, 237, .35); }
.dp-day:disabled { color: #C9CDD9; cursor: default; text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .15); }
.dp-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 6px 2px 0; border-top: 1px solid var(--line-2); }
.dp-link { border: 0; background: none; padding: 6px 8px; border-radius: 8px; color: var(--accent-ink); font: 650 13px var(--font); cursor: pointer; }
.dp-link:hover:not(:disabled) { background: var(--accent-soft); }
.dp-link:disabled { color: var(--faint); cursor: default; }
.row2 > .field:last-child .datepop { left: auto; right: 0; }

.timepop {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: 100%; min-width: 200px;
  display: block; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: drop .14s ease-out;
}
.tp-list { position: relative; display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; overscroll-behavior: contain; }
.tp-list button {
  flex: none; height: 34px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text);
}
.tp-list button { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 12px; }
.tp-list button small { font-size: 12px; font-weight: 600; color: var(--faint); }
.tp-list button:hover { background: var(--surface-2); }
.tp-list button.on { background: var(--accent); color: #fff; }
.tp-list button.on small { color: rgba(255, 255, 255, .8); }
.tp-list button:disabled { color: #C8CCD8; cursor: default; background: transparent; }
.tp-sep { flex: none; padding: 6px 4px 2px; font-size: 10px; font-weight: 750; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; text-align: center; border-top: 1px dashed var(--line); margin-top: 2px; }
.hint { font-size: 13px; color: var(--muted); margin: -8px 0 16px; min-height: 1em; }
.error { color: var(--danger); font-size: 14px; min-height: 1em; margin: 6px 0 0; }
.error:empty { display: none; }

/* Egen nedtrekksliste (erstatter <select>) */
.picker { position: relative; }
.picker-btn {
  width: 100%; height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 10px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.picker-btn:hover { border-color: #D4D8E5; }
.picker-btn:focus-visible, .picker.open .picker-btn { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.picker-btn .chev { margin-left: auto; color: var(--faint); transition: transform .18s; }
.picker.open .chev { transform: rotate(180deg); }
.opt-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.opt-text span { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-text small { font-size: 12.5px; color: var(--muted); }
.picker-list {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px); max-height: 300px; overflow: auto;
  padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: drop .14s ease-out;
}
.picker-opt {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 10px;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left;
}
.picker-opt:hover, .picker-opt:focus-visible { background: var(--surface-2); outline: none; }
.picker-opt[aria-selected="true"] { background: var(--accent-soft); }
.picker-opt[aria-selected="true"]::after {
  content: ""; margin-left: auto; width: 18px; height: 18px; flex: none; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; box-shadow: 0 0 0 3px #fff, 0 0 0 4px color-mix(in srgb, var(--c) 30%, #fff); margin: 0 4px; }

/* Brikker: hurtigvalg og pause */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer; transition: all .15s;
}
.chip-btn:hover { border-color: #D4D8E5; background: var(--surface-2); }
.chip-btn.on { background: var(--accent-soft); border-color: rgba(79, 107, 237, .45); color: var(--accent-ink); }
.chips.even { display: grid; grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); }
.chips.even .chip-btn { padding: 0 6px; }

/* Fargevalg */
.swatches { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px 2px; }
.swatch { position: relative; cursor: pointer; display: block; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch span { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); transition: transform .12s, box-shadow .12s; }
.swatch:hover span { transform: scale(1.08); }
.swatch input:checked + span { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); }
.swatch input:focus-visible + span { outline: 3px solid rgba(79, 107, 237, .4); outline-offset: 5px; }

/* Bryter */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.switch span { font-weight: 600; }
.switch small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.switch input { -webkit-appearance: none; appearance: none; position: relative; width: 46px; height: 28px; margin: 0; border-radius: 999px; background: #D7DAE6; cursor: pointer; flex: none; transition: background .18s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .18s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

/* ---- generelle flater ----------------------------------------------------- */

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 14px; font-size: 16px; }
.card p { margin: 0 0 6px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed #D9DCE6; border-radius: 16px; }
.loading { padding: 48px 0; text-align: center; color: var(--faint); animation: late-in .2s .35s both; }
/* «Laster…» vises bare om det tar litt tid, så raske sider ikke blinker. */
@keyframes late-in { from { opacity: 0; } to { opacity: 1; } }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; color: var(--muted); }
.badge.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.badge.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn-ink); }

/* Avatarer med initialer i den ansattes farge */
.av {
  --c: #64748B; display: inline-grid; place-items: center; flex: none; border-radius: 50%; font-weight: 750; letter-spacing: -.02em;
  background: #EEF0F6; background: color-mix(in srgb, var(--c) 20%, #fff);
  color: var(--c); color: color-mix(in srgb, var(--c) 78%, #0B0D17);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 32%, #fff);
}
.av-sm { width: 26px; height: 26px; font-size: 10.5px; }
.av-md { width: 36px; height: 36px; font-size: 13px; }
.av-lg { width: 48px; height: 48px; font-size: 16px; }
.av-xl { width: 72px; height: 72px; font-size: 24px; }
.av-open { background: #fff; color: var(--faint); box-shadow: none; border: 1.5px dashed var(--open); }
.stack { display: inline-flex; align-items: center; }
.stack .av { box-shadow: 0 0 0 2px #fff; }
.stack .av + .av { margin-left: -8px; }

/* ---- vaktkort ------------------------------------------------------------- */

.shift {
  --c: #64748B; display: block; width: 100%; text-align: left; padding: 8px 10px; margin: 0;
  font-size: 13px; line-height: 1.3; border-radius: 10px;
  background: #F3F4F8; background: color-mix(in srgb, var(--c) 14%, #fff);
  color: var(--text); color: color-mix(in srgb, var(--c) 58%, #0E1120);
  border: 1px solid color-mix(in srgb, var(--c) 20%, #fff);
}
button.shift { cursor: pointer; font: inherit; font-size: 13px; transition: transform .08s, box-shadow .15s, opacity .2s; }
button.shift:hover { transform: translateY(-1px); box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 28%, transparent); }
.shift.is-draft {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 9%, #fff) 0 6px, #fff 6px 12px);
  border: 1.5px dashed color-mix(in srgb, var(--c) 60%, #fff);
}
.shift.is-open { border-style: dashed; border-color: #C3CBD8; }
.shift.is-dim { opacity: .25; }
.shift-time { font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-time span { font-weight: 550; opacity: .8; }
.shift-time .ic { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; margin-left: 4px; opacity: .7; }
.shift-name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-meta { font-size: 12px; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift .tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; vertical-align: 1px;
  background: #FFF1D6; color: var(--warn-ink); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.shift-list { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; font-size: 14px; }
.shift-list .shift-name { font-size: 15px; }
.shift-list .shift-meta, .tl-card .shift-meta { display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: 13px; margin-top: 3px; white-space: normal; }
.shift-meta .ic { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.shift-note { margin-top: 8px; font-size: 13px; background: rgba(255, 255, 255, .65); border-radius: 9px; padding: 7px 9px; color: var(--text); }
.shift-go { color: color-mix(in srgb, var(--c) 50%, #8A90A6); }
.shift-go .ic { width: 18px; height: 18px; }

/* ---- planverktøy ---------------------------------------------------------- */

.banner {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 16px; margin-bottom: 14px;
  background: var(--warn-soft); border: 1px solid #F4DFB0; border-radius: 16px; color: var(--warn-ink);
}
.banner-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.banner-text span { font-size: 13px; opacity: .85; }
.subtools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 14px; }
/* Vaktplanen på PC: dato og bla-knapper øverst, visning og handlinger under */
.calhead { margin: 6px 0 0; }
.calhead-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.calhead-date { display: flex; align-items: center; gap: 16px; min-width: 0; }
.calhead h1 { font-size: 28px; line-height: 1.15; margin: 0; letter-spacing: -.025em; }
.calhead .pagehead-title p { margin: 3px 0 0; color: var(--muted); }
.calhead .stepper button.is-now { color: var(--faint); }
.subtools-end { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.subtools-end .legend { flex: none; margin: 0 6px 0 0; }
.seg-lay button { display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; }
.seg-lay .ic { width: 17px; height: 17px; flex: none; }
/* Tekstene i verktøylinjen forsvinner etter plassen linjen har (smal meny gir mer). */
.calhead .subtools { container-type: inline-size; }
@container (max-width: 1200px) {
  .seg-lay .lbl { display: none; }
  .seg-lay button { padding: 0 11px; }
}
@container (max-width: 960px) { .subtools-end .lbl { display: none; } }
.legend { display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; padding: 3px; margin: -3px; scrollbar-width: none; }
.legend::-webkit-scrollbar { display: none; }
.lchip {
  --c: var(--open); display: inline-flex; align-items: center; gap: 7px; flex: none; height: 36px; padding: 0 12px 0 5px;
  border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 650; font-size: 13px; white-space: nowrap; cursor: pointer;
  transition: all .15s;
}
.lchip small { color: var(--muted); font-weight: 550; }
.lchip:hover { border-color: #D4D8E5; }
.lchip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 28%, transparent); }

/* Ukerutenett (desktop): ansatte nedover, dager bortover */
.wgrid-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: auto; max-height: calc(100vh - 220px); }
.wgrid { display: grid; grid-template-columns: minmax(170px, 230px) repeat(7, minmax(92px, 1fr)); min-width: 820px; }
.wg-row { display: contents; }
.wg-corner, .wg-day { position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 1px solid var(--line); }
.wg-corner { left: 0; z-index: 4; display: flex; align-items: flex-end; padding: 0 18px 14px; font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.wg-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; border-left: 1px solid var(--line-2); }
.wg-dow { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: capitalize; }
.wg-date { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 19px; font-weight: 750; letter-spacing: -.03em; }
.wg-day.is-today .wg-dow { color: var(--accent); }
.wg-day.is-today .wg-date { background: var(--accent); color: #fff; box-shadow: 0 6px 14px rgba(79, 107, 237, .35); }
.wg-count { font-size: 11.5px; color: var(--faint); }
.wg-emp {
  position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: 11px; padding: 10px 12px 10px 16px;
  background: #fff; border-bottom: 1px solid var(--line-2); min-width: 0;
}
.wg-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-sub { font-size: 12px; color: var(--muted); }
.wg-cell { display: flex; flex-direction: column; gap: 6px; min-height: 78px; padding: 6px; border-left: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); transition: opacity .2s; }
.wg-cell.is-today { background: #FAFBFF; }
.wg-row.is-open > * { background: #FAFBFD; }
.wg-row:last-child > * { border-bottom: 0; }
.wg-row.is-dim > * { opacity: .28; }
.wg-row.is-dim > .wg-emp { opacity: .5; }
.wg-add, .mg-add {
  display: grid; place-items: center; border: 1px dashed transparent; border-radius: 9px; background: transparent;
  color: var(--faint); cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s, border-color .15s;
}
.wg-add { margin-top: auto; height: 28px; width: 100%; }
.wg-add:only-child { flex: 1; }
.wg-add .ic, .mg-add .ic { width: 16px; height: 16px; }
.wg-cell:hover .wg-add, .wg-add:focus-visible { opacity: 1; border-color: #D9DCE6; }
.wg-add:hover, .mg-add:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* Månedsrutenett (desktop) */
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.mg-dow { padding: 12px 12px 10px; font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.mg-cell { display: flex; flex-direction: column; gap: 5px; min-height: 148px; min-width: 0; padding: 8px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.mgrid > :nth-child(7n) { border-right: 0; }
.mg-cell.is-out { background: #FAFBFD; }
.mg-cell.is-out .mg-num { color: var(--faint); }
.mg-head { display: flex; align-items: center; justify-content: space-between; height: 28px; }
.mg-num { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 13.5px; font-weight: 750; }
.mg-cell.is-today .mg-num { background: var(--accent); color: #fff; }
.mg-add { width: 28px; height: 28px; }
.mg-cell:hover .mg-add, .mg-add:focus-visible { opacity: 1; }
.shift-grid { padding: 7px 8px; }
.shift-grid .shift-time { white-space: normal; }
.shift-month { padding: 6px 8px; font-size: 12px; }
.shift-month .shift-time { font-size: 12px; }
.shift-month .shift-meta { font-size: 11.5px; }

/* Tidsrutenett for uken (PC): tidsakse for hele døgnet, vakter etter start og lengde */
.tgrid-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: auto; height: calc(100vh - 230px); min-height: 440px; overscroll-behavior: contain; }
.tgrid { display: grid; grid-template-columns: 58px repeat(var(--days, 7), minmax(96px, 1fr)); min-width: 760px; }
.tgrid.tgrid-day { min-width: 0; grid-template-columns: 52px minmax(0, 1fr); }
.tgrid-day .wg-day { flex-direction: row; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 10px; }
.tgrid-day .wg-unav { flex-basis: 100%; }
.tgrid-day .slot-in { padding: 8px 12px; }
.tgrid-day .shift-slot .shift-time { font-size: 16px; }
/* PC: kalenderen ruller med siden og bruker hele bredden; verktøylinjen over
   beholder bredden som før. Tidslinjen og
   ansattrutenettet får egen boks bare når de ikke får plass (.is-boxed). */
@media (min-width: 900px) and (min-height: 560px) {
  main:has(.subtools) { max-width: none; }
  main:has(.subtools) > :not(.tgrid-wrap, .gt-wrap, .wgrid-wrap, .mcal) { max-width: 1528px; margin-left: auto; margin-right: auto; }
  main:has(.subtools) .tgrid-wrap { height: auto; min-height: 0; overflow: clip; overscroll-behavior: auto; }
  main:has(.subtools) .tgrid:not(.tgrid-day) { min-width: 0; grid-template-columns: 58px repeat(var(--days, 7), minmax(0, 1fr)); }
  main:has(.subtools) .gt-wrap:not(.is-boxed), main:has(.subtools) .wgrid-wrap:not(.is-boxed) { max-height: none; overflow: clip; }
}
@media (max-width: 899px), (max-height: 559px) {
  .tgrid-wrap.is-day { height: calc(100vh - 300px); height: calc(100dvh - 300px); min-height: 380px; }
  .tgrid-day .tg-axis span { font-size: 10.5px; right: 6px; }
}
.tg-corner { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); }
.tgrid .wg-day { z-index: 5; }
.tg-axis { position: relative; height: calc(var(--hh) * var(--span, 24)); }
.tg-axis span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; font-weight: 650; color: var(--faint); font-variant-numeric: tabular-nums; }
.tg-col {
  position: relative; height: calc(var(--hh) * var(--span, 24)); border-left: 1px solid var(--line-2);
  background-image:
    repeating-linear-gradient(to bottom, var(--line-2) 0 1px, transparent 1px var(--hh)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--hh) / 2), #F6F7FA calc(var(--hh) / 2) calc(var(--hh) / 2 + 1px), transparent calc(var(--hh) / 2 + 1px) var(--hh));
}
.tg-col.is-today { background-color: #FAFBFF; }
.tg-col.can-add { cursor: pointer; }
.tg-midnight { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed #C9CEDC; z-index: 1; pointer-events: none; }
.tg-axis span.next { color: var(--muted); }
.tg-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.tg-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.tg-ghost {
  position: absolute; left: 3px; right: 3px; height: calc(var(--hh) - 2px); z-index: 1; pointer-events: none;
  padding: 6px 8px; border: 1.5px dashed var(--accent); border-radius: 10px; background: rgba(238, 241, 255, .85);
  color: var(--accent-ink); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums;
}
.shift-slot {
  position: absolute; z-index: 2; display: block; overflow: hidden; container: slot / size;
  padding: 0; border-radius: 10px; border-left: 3px solid var(--c); text-align: left;
}
.slot-in { display: flex; flex-direction: column; gap: 2px; height: 100%; min-width: 0; padding: 6px 8px; overflow: hidden; }
.shift-slot.is-draft, .shift-slot.is-open { border-left-width: 1.5px; }
.shift-slot .shift-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.shift-slot .shift-head .ic { width: 13px; height: 13px; margin-left: auto; opacity: .7; flex: none; }
.shift-slot .shift-head .av { width: 22px; height: 22px; font-size: 9.5px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .8); }
.shift-slot .shift-time { font-size: 14px; margin-top: 2px; }
.shift-slot-note { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; margin-top: 4px; font-style: italic; }
.shift-slot.size-m .shift-meta { display: none; }
.shift-slot.size-m .shift-time { margin-top: 0; }
.shift-slot.size-s .slot-in { flex-direction: row; align-items: center; gap: 6px; padding: 2px 6px; }
.shift-slot.size-s .av, .shift-slot.size-s .shift-meta, .shift-slot.size-s .shift-head .ic { display: none; }
.shift-slot.size-s .shift-time { order: -1; font-size: 12px; margin: 0; }
.shift-slot.is-cut { border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; }
.shift-slot.is-cont { border-top-left-radius: 2px; border-top-right-radius: 2px; }
button.shift-slot:hover { z-index: 4; }
/* Smale, høye bokser (mange på jobb samtidig): teksten går loddrett, lest
   ovenfra og ned. Avatar og navn er første søyle; tid og posisjon følger i
   neste og brekker til en ny søyle når boksen er for kort. */
@container slot (max-width: 88px) and (min-height: 96px) {
  .slot-in, .tgrid-day .slot-in { writing-mode: vertical-lr; flex-direction: row; flex-wrap: wrap; align-content: flex-start; gap: 2px 10px; padding: 8px 4px 8px 5px; }
  .slot-in .shift-head { flex-basis: 100%; gap: 5px; }
  .slot-in .av, .slot-in .shift-head .ic, .slot-in .conflict-ic svg { writing-mode: horizontal-tb; }
  .slot-in .shift-name { font-size: 13px; }
  .slot-in > * { max-inline-size: 100%; }
  .slot-in .shift-time, .tgrid-day .slot-in .shift-time { font-size: 13.5px; margin: 0; }
  .slot-in .shift-meta { display: block; font-size: 11.5px; }
  .slot-in .shift-slot-note { display: none; }
}
}
.seg-icons button { padding: 0 11px; display: grid; place-items: center; }
.seg-icons .ic { width: 18px; height: 18px; }

/* Uken på mobil: én seksjon per dag, med dekningsstripe og en rad per vakt */
.agenda { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.ag-axis { display: grid; grid-template-columns: 52px 1fr 34px; align-items: end; gap: 10px; padding: 0 12px; margin-bottom: -6px; }
.ag-axis-lbl { font-size: 10.5px; font-weight: 750; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.ag-ticks { position: relative; height: 14px; }
.ag-ticks span { position: absolute; top: 0; transform: translateX(-50%); font-size: 10.5px; font-weight: 650; color: var(--faint); font-variant-numeric: tabular-nums; }
.ag-ticks span:first-child { transform: none; }
.ag-ticks span:last-child { transform: translateX(-100%); }
.ag-day { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.ag-day.is-today { border-color: rgba(79, 107, 237, .45); box-shadow: 0 0 0 3px rgba(79, 107, 237, .1), var(--shadow-sm); }
.ag-head { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; }
.ag-day:not(.is-empty) .ag-head { border-bottom: 1px solid var(--line-2); }
.ag-date { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 48px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; }
.ag-day.is-today .ag-date { background: var(--accent); color: #fff; }
.ag-dow { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.ag-num { font-size: 19px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.ag-sum { min-width: 0; }
.ag-sum-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; font-size: 13px; font-weight: 650; color: var(--muted); }
.ag-sum-top .wg-unav { margin: 0; justify-content: flex-end; flex-wrap: nowrap; overflow: hidden; }
.ag-bar { position: relative; height: 12px; margin-top: 6px; border-radius: 4px; background: repeating-linear-gradient(90deg, #EEF0F5 0 1px, #F6F7FA 1px 100%); overflow: hidden; }
.ag-seg { position: absolute; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7); }
.ag-seg.is-open { background: repeating-linear-gradient(135deg, #B9C2D0 0 3px, #E3E7EE 3px 6px); }
.ag-seg.is-draft { opacity: .45; }
.ag-seg.is-dim { opacity: .2; }
.ag-now { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--danger); border-radius: 1px; }
.ag-add { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--accent-ink); cursor: pointer; }
.ag-add .ic { width: 18px; height: 18px; }
.ag-day.is-empty .ag-sum-top > span { color: var(--faint); font-weight: 600; }

.shift.ag-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: stretch; gap: 10px; padding: 6px 12px; margin: 0; border: 0; border-radius: 0; background: none; color: var(--text); box-shadow: none; transform: none; }
.shift.ag-row:first-of-type { padding-top: 10px; }
.shift.ag-row:last-child { padding-bottom: 12px; }
button.shift.ag-row:hover { transform: none; box-shadow: none; }
button.shift.ag-row:active .ag-card { transform: scale(.985); }
.ag-time { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; font-variant-numeric: tabular-nums; line-height: 1.25; }
.ag-time b { font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; }
.ag-time span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ag-time sup { font-size: 9px; margin-left: 1px; color: var(--accent-ink); font-weight: 800; }
.ag-card {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 11px; border-radius: 12px; border-left: 4px solid var(--c);
  background: color-mix(in srgb, var(--c) 11%, #fff); color: color-mix(in srgb, var(--c) 55%, #0E1120); transition: transform .08s;
}
.ag-row.is-me .ag-card { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, #fff); }
.ag-row.is-draft .ag-card { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 8%, #fff) 0 6px, #fff 6px 12px); border: 1.5px dashed color-mix(in srgb, var(--c) 60%, #fff); border-left: 4px solid var(--c); }
.ag-row.is-open .ag-card { background: #fff; border: 1.5px dashed #C3CBD8; border-left: 4px solid #94A3B8; color: var(--text); }
.ag-row.has-conflict .ag-card { box-shadow: inset 0 0 0 1.5px rgba(220, 38, 38, .45); }
.ag-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ag-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.ag-name .tag { margin-left: 2px; }
.ag-name .conflict-ic .ic { width: 15px; height: 15px; }
.ag-meta { font-size: 12.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-meta .ic { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 2px; }
.ag-meta em { font-style: italic; }
.ag-hrs { flex: none; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; opacity: .85; }
.shift .tag.tag-me { background: var(--accent); color: #fff; }

/* Mobilkalender for uke og måned: brikker med initialer i den ansattes farge */
.mcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 10px 6px 8px; margin-bottom: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.mcal-dow { text-align: center; font-size: 11px; font-weight: 750; color: var(--faint); padding-bottom: 6px; text-transform: uppercase; }
.mcal-cell {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; min-height: 78px; padding: 4px 3px 5px;
  border: 0; border-radius: 11px; background: transparent; cursor: pointer; transition: background .15s;
}
.mcal-week .mcal-cell { min-height: 112px; }
.mcal-num { align-self: center; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 650; }
.mcal-cell.is-out { opacity: .4; }
.mcal-cell.is-today .mcal-num { color: var(--accent); font-weight: 800; }
.mcal-cell.is-sel { background: var(--accent-soft); }
.mcal-cell.is-sel .mcal-num { background: var(--accent); color: #fff; box-shadow: 0 4px 10px rgba(79, 107, 237, .35); }
.mcal-chips { display: flex; flex-direction: column; gap: 3px; }
.mchip {
  display: block; padding: 4px 0; border: 1px solid transparent; border-radius: 6px; font-style: normal; text-align: center;
  font-size: 10px; font-weight: 800; line-height: 1; letter-spacing: .02em; white-space: nowrap; overflow: hidden;
  background: #EEF0F6; background: color-mix(in srgb, var(--c) 20%, #fff); color: color-mix(in srgb, var(--c) 72%, #0E1120);
}
.mchip small { display: block; margin-top: 3px; font-size: 9.5px; font-weight: 650; letter-spacing: 0; opacity: .85; }
.mcal-week .mchip { padding: 6px 0; }
.mchip.is-draft { background: #fff; border: 1px dashed color-mix(in srgb, var(--c) 65%, #fff); }
.mchip.is-open { background: #fff; border: 1px dashed var(--open); color: var(--muted); }
.mchip.is-dim { opacity: .25; }
.mchip-more { font-size: 10px; font-weight: 700; color: var(--muted); text-align: center; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom)); z-index: 25;
  width: 58px; height: 58px; border: 0; border-radius: 19px; background: var(--accent); color: #fff;
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 12px 28px rgba(79, 107, 237, .45);
}
.fab .ic { width: 26px; height: 26px; }

/* ---- mine vakter ---------------------------------------------------------- */

.mine { display: grid; gap: 22px; }
@media (min-width: 900px) and (min-height: 560px) {
  .mine { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); align-items: start; gap: 32px; }
  .mine-side { position: sticky; top: 30px; }
}
.hero {
  --c: var(--accent); position: relative; overflow: hidden; padding: 22px; border-radius: 24px; color: #fff;
  background: var(--c);
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 82%, #11142A) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 72%, #fff) 100%);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--c) 34%, transparent);
}
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero > * { position: relative; z-index: 1; }
.hero-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; opacity: .85; }
.hero-when { margin-top: 12px; font-size: 15px; font-weight: 600; opacity: .95; }
.hero-time { font-size: 38px; font-weight: 800; letter-spacing: -.035em; line-height: 1.08; font-variant-numeric: tabular-nums; }
.hero-meta { margin-top: 4px; opacity: .9; }
.hero-note { margin-top: 12px; padding: 9px 11px; border-radius: 11px; background: rgba(255, 255, 255, .18); font-size: 14px; }
.hero-with { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .25); font-size: 13.5px; }
.hw-title { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.hw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; min-width: 0; }
.hw-row .av { box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
.hw-row b { font-weight: 700; }
.hw-time { font-variant-numeric: tabular-nums; opacity: .85; }
.hw-tag { margin-left: auto; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 11.5px; font-weight: 750; white-space: nowrap; }
.hw-tag.is-same { background: rgba(255, 255, 255, .92); color: var(--c, #4F6BED); color: color-mix(in srgb, var(--c, #4F6BED) 80%, #000); }
.tl-with { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12.5px; opacity: .8; }
.tl-with .ic { width: 14px; height: 14px; flex: none; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat { padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.stat span { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.stat strong { display: block; font-size: 24px; letter-spacing: -.03em; line-height: 1.2; }
.stat small { color: var(--muted); }
.weeklabel { margin: 22px 4px 10px; font-size: 12.5px; font-weight: 800; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; }
.mine-main > .weeklabel:first-child { margin-top: 0; }
.tl-row { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 12px; margin-bottom: 10px; }
.tl-date { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tl-num { font-size: 24px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.tl-dow { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: capitalize; margin-top: 2px; }
.tl-date.is-today .tl-num, .tl-date.is-today .tl-dow { color: var(--accent); }
.tl-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; }
.tl-time { font-size: 17px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---- ansatte og posisjoner ------------------------------------------------ */

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pcard {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .08s, border-color .15s;
}
.pcard:hover { box-shadow: var(--shadow); border-color: #DCE0EA; transform: translateY(-1px); }
.pcard.inactive { opacity: .55; }
.pcard-name { font-weight: 750; }
.pcard-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.pcard-go { color: var(--faint); }
.pos-ico { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) 16%, #fff); color: color-mix(in srgb, var(--c) 80%, #0B0D17); }
.pos-ico .ic { width: 22px; height: 22px; }

/* ---- meg ------------------------------------------------------------------ */

.meg { display: grid; gap: 14px; }
@media (min-width: 900px) and (min-height: 560px) { .meg { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; max-width: 1000px; } }
.profile { display: flex; align-items: center; gap: 16px; }
.profile-name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }

/* ---- innlogging ----------------------------------------------------------- */

/* Innlogging og passordsider: myk fargeovergang i bakgrunnen og et lyst,
   litt gjennomsiktig kort. Logoen står bare øverst til venstre. */
html:has(body:not(.authed)) { background: #EEF0FF; }
body:not(.authed) {
  min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(900px 560px at -10% -5%, rgba(79, 107, 237, .32), transparent 62%),
    radial-gradient(760px 520px at 110% 12%, rgba(139, 92, 246, .26), transparent 60%),
    radial-gradient(720px 480px at 50% 108%, rgba(255, 209, 102, .30), transparent 64%),
    linear-gradient(170deg, #EEF1FF 0%, #F5F1FF 55%, #FFF8EC 100%);
}
body:not(.authed) .mobilebar { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.auth-brand { display: none; }
.login { max-width: 400px; margin: 7vh auto 0; }

/* PC: merkevarepanel til venstre, skjemaet midt i høyre side */
@media (min-width: 900px) and (min-height: 560px) {
  body:not(.authed) main { padding: 0; max-width: none; }
  .auth { display: grid; grid-template-columns: minmax(380px, 42%) 1fr; min-height: 100vh; min-height: 100dvh; }
  .auth-main { display: flex; align-items: center; justify-content: center; padding: 40px; }
  .auth-main .login { width: 100%; margin: 0; }
  .auth-brand {
    position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 34px 48px 30px; color: #fff;
    background: radial-gradient(700px 520px at 85% 110%, rgba(255, 209, 102, .22), transparent 60%),
      linear-gradient(155deg, #3E52D6 0%, #5B5CF0 45%, #7C4DE8 100%);
  }
  .auth-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
  .auth-logo .logo-mark { width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
  .auth-logo .wordmark { font-size: 22px; color: #fff; }
  .auth-pitch { position: relative; z-index: 1; margin: auto 0; max-width: 440px; }
  .auth-pitch h2 { margin: 0 0 22px; font-size: 40px; line-height: 1.12; letter-spacing: -.035em; font-weight: 800; }
  .auth-pitch ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
  .auth-pitch li { position: relative; padding-left: 22px; font-size: 15.5px; line-height: 1.45; color: rgba(255, 255, 255, .88); }
  .auth-pitch li::before { content: ""; position: absolute; left: 0; top: .5em; width: 9px; height: 9px; border-radius: 50%; background: #FFD166; box-shadow: 0 0 0 4px rgba(255, 209, 102, .22); }
  .auth-foot { position: relative; z-index: 1; font-size: 12.5px; color: rgba(255, 255, 255, .6); }
  /* Logoens to piller og gule prikk, stort og svakt nederst til høyre */
  .auth-art { position: absolute; right: -10px; bottom: -40px; width: 460px; height: 340px; opacity: .16; pointer-events: none; }
  .auth-art .pill { position: absolute; height: 92px; border-radius: 46px; background: #fff; }
  .auth-art .pill-1 { left: 0; top: 40px; width: 300px; }
  .auth-art .pill-2 { left: 90px; top: 172px; width: 300px; opacity: .65; }
  .auth-art .dot { position: absolute; left: 330px; top: 52px; width: 68px; height: 68px; border-radius: 50%; background: #FFD166; }
  body:not(.authed) .mobilebar { display: none; }
}

.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.label-row .label { margin: 0; }
.label-link { font-size: 13px; font-weight: 650; color: var(--accent-ink); text-decoration: none; }
.label-link:hover { text-decoration: underline; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--faint); cursor: pointer; }
.pw-eye:hover { color: var(--muted); background: var(--surface-2); }
.pw-eye .ic { width: 19px; height: 19px; }
.login .card {
  padding: 30px 28px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .75);
  background: rgba(255, 255, 255, .84); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 26px 60px rgba(79, 70, 229, .16), 0 2px 6px rgba(28, 32, 51, .05);
}
.login h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.035em; }
.login .lead { margin: 0 0 22px; color: var(--muted); }
.login-link { display: block; margin-top: 16px; text-align: center; font-size: 14px; font-weight: 650; color: var(--accent-ink); text-decoration: none; }
.login-link:hover { text-decoration: underline; }
.login .push-state { margin-bottom: 4px; }
.invite-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; }
.invite-box > .ic { width: 19px; height: 19px; color: var(--accent); }
.invite-box .grow { min-width: 200px; }
.linkbox input { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ---- dialoger ------------------------------------------------------------- */

dialog {
  border: 0; padding: 24px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  border-radius: 24px; color: var(--text); background: #fff; box-shadow: var(--shadow-lg);
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
}
dialog[open] { animation: pop .18s ease-out; }
dialog::backdrop { background: rgba(17, 21, 43, .4); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
#confirm { width: min(440px, calc(100vw - 32px)); }
#confirm p { margin: 0; font-size: 16px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; outline: none; }
.sheet-head h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.actions .left { margin-right: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }

@media (max-width: 899px), (max-height: 559px) {
  dialog, #confirm {
    width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92vh; max-height: 92dvh; overflow: auto;
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0;
  }
  dialog::before { content: ""; display: block; width: 40px; height: 5px; margin: 0 auto 16px; border-radius: 3px; background: #D9DCE6; }
  dialog[open] { animation: up .26s cubic-bezier(.2, .8, .2, 1); }
  .picker-list { position: static; margin-top: 6px; max-height: 260px; box-shadow: var(--shadow); animation: none; }
  .timepop { position: static; min-width: 0; margin-top: 6px; box-shadow: var(--shadow); animation: none; }
  .datepop { position: static; width: auto; margin-top: 6px; box-shadow: var(--shadow); animation: none; }
  /* To datofelt ved siden av hverandre: kalenderen bruker hele bredden under begge. */
  .row2 > .field:first-child .datepop { width: calc(200% + 12px); }
  .row2 > .field:last-child .datepop { width: calc(200% + 12px); margin-left: calc(-100% - 12px); }
  .dp-day { height: 40px; }
  .tp-list { max-height: 184px; }
  .tp-list button { height: 40px; }
  .actions .btn { flex: 1; }
  .actions .left { flex: 0 0 auto; }
}

/* ---- utilgjengelighet ----------------------------------------------------- */

.banner-danger { background: #FDEFEF; border-color: #F6CFD1; color: #9B2C2F; }
.banner .ic { flex: none; }
.shift.has-conflict { box-shadow: inset 0 0 0 1.5px var(--danger); }
.conflict-ic { display: inline-flex; color: var(--danger); }
.conflict-ic .ic { width: 14px !important; height: 14px !important; margin-left: 4px; opacity: 1 !important; }
.shift-slot .shift-head .conflict-ic { margin-left: auto; }
.shift-slot .shift-head .conflict-ic + .ic { margin-left: 4px; }
.shift-warn { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--danger); }
.shift-warn .ic { width: 15px; height: 15px; }
.warn-line { display: flex; align-items: center; gap: 8px; margin: -6px 0 16px; padding: 9px 12px; border-radius: 11px; background: #FDEFEF; color: #9B2C2F; font-size: 13.5px; font-weight: 600; }
.warn-line .ic { width: 17px; height: 17px; flex: none; }
.warn-line.soft { background: var(--warn-soft); color: var(--warn-ink); }

/* Brikker i dagshodet: hvem som ikke kan den dagen */
.wg-unav { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; margin-top: 5px; max-width: 100%; }
.uchip {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border: 1px dashed #C9CDD9; border-radius: 6px;
  background: repeating-linear-gradient(135deg, #F4F5F8 0 4px, #fff 4px 8px); color: var(--muted);
  font-size: 10px; font-weight: 800; letter-spacing: .02em; cursor: default; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--c) 70%, #000);
}
button.uchip { cursor: pointer; font-family: inherit; }
button.uchip:hover { border-color: var(--muted); }
.uchip small { font-size: 9.5px; font-weight: 650; text-decoration: none; }
.uchip.is-dim { opacity: .3; }
.uchip-more { font-size: 10px; font-weight: 700; color: var(--muted); align-self: center; }
.tg-unav {
  position: absolute; left: 0; right: 0; z-index: 1; pointer-events: none; overflow: hidden;
  background: repeating-linear-gradient(135deg, rgba(148, 163, 184, .16) 0 6px, transparent 6px 12px);
  border-top: 1px dashed #B8BFCC; border-bottom: 1px dashed #B8BFCC;
}
.tg-unav span { display: block; padding: 4px 6px; font-size: 10.5px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* Kort i måned og per ansatt */
.ucard-mini {
  display: block; width: 100%; padding: 5px 8px; text-align: left; border: 1px dashed #C9CDD9; border-radius: 9px;
  background: repeating-linear-gradient(135deg, #F5F6F9 0 5px, #fff 5px 10px); color: var(--muted); font: inherit; font-size: 11.5px; line-height: 1.3;
}
button.ucard-mini { cursor: pointer; }
button.ucard-mini:hover { border-color: var(--muted); }
.ucard-mini span { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucard-mini b { display: block; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucard-mini i { display: block; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucard-mini.is-dim { opacity: .25; }

button
/* Siden for tilgjengelighet */
.filter-picker { width: 240px; }
.filter-picker .picker-btn { height: 42px; }
@media (max-width: 899px), (max-height: 559px) { .filter-picker { width: auto; flex: 1; } }
.ulist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.ugroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px 16px; align-items: start; }
.ulist-one { grid-template-columns: 1fr; }
.ugroup-head { display: flex; align-items: center; gap: 10px; margin: 0 4px 10px; font-weight: 750; }
.ugroup-head small { color: var(--muted); font-weight: 550; font-size: 13px; }
.ucard {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); font: inherit; color: var(--text);
  transition: box-shadow .15s, border-color .15s, transform .08s;
}
.ucard:hover { box-shadow: var(--shadow); border-color: #DCE0EA; transform: translateY(-1px); }
.ucard > .ic { color: var(--faint); }
.ucard-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; background: #F1F2F6; color: var(--muted); }
.ucard-ico.rep { background: var(--accent-soft); color: var(--accent-ink); }
.ucard-title { display: block; font-weight: 750; }
.ucard-sub { display: block; font-size: 13.5px; color: var(--muted); }
.ucard-next { display: block; margin-top: 3px; font-size: 12px; font-weight: 650; color: var(--faint); }
.empty-big { max-width: 460px; margin: 40px auto; padding: 32px 24px; text-align: center; background: #fff; border: 1px dashed #D3D7E4; border-radius: 22px; }
.empty-big > .ic { width: 40px; height: 40px; color: var(--faint); margin: 0 auto 10px; }
.empty-big h3 { margin: 0 0 6px; font-size: 18px; }
.empty-big p { margin: 0 0 18px; color: var(--muted); }

/* Dialogen */
.seg-full { display: flex; width: 100%; }
.seg-full button { flex: 1; }
.repeat-box { margin: -6px 0 16px; padding: 14px 14px 2px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.summary { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 0; padding: 10px 12px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13.5px; font-weight: 600; }
.summary:empty { display: none; }
.summary .ic { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.only-sm { display: none; }
@media (max-width: 899px), (max-height: 559px) { .only-sm { display: inline-flex; } }

/* Unntak i gjentakelser */
.skipbox { display: flex; align-items: center; gap: 12px; margin: -4px 0 18px; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; }
.skipbox > .ic { flex: none; }
.skipbox .btn { flex: none; height: 38px; }
@media (max-width: 899px), (max-height: 559px) { .skipbox { flex-wrap: wrap; } .skipbox .btn { width: 100%; } }
.day-chip { height: 34px; padding: 0 12px; font-size: 13px; text-transform: capitalize; }
.day-chip.skip { background: #fff; border-style: dashed; color: var(--faint); text-decoration: line-through; }
.hint-inline { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* Ledige vakter */
.claim-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; vertical-align: 1px; }
.shift .tag.tag-open { background: var(--accent-soft); color: var(--accent-ink); }
.shift.claimable { cursor: pointer; }
.shift.claimable:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 107, 237, .15); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 0; border: 0; background: none; color: var(--accent-ink); font-weight: 650; font-size: 13.5px; cursor: pointer; }
.link-btn .ic { width: 16px; height: 16px; }
.link-btn:hover { text-decoration: underline; }
.claims { margin: 0 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.claims-head { margin: 0 2px 8px; font-size: 12.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.claim-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.claim-row b { display: block; }
.claim-row small { display: block; color: var(--muted); font-size: 12px; }
.sugg { margin: 8px 0 4px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.sugg-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 4px; }
.sugg-head span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sugg-head span svg { width: 15px; height: 15px; color: var(--accent); }
.sugg-head small { color: var(--muted); font-size: 11.5px; }
.sugg-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 6px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sugg-row:hover { background: var(--surface); }
.sugg-row.on { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent); }
.sugg-row > svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.sugg-row .grow { min-width: 0; }
.sugg-row b { display: block; font-size: 14px; }
.sugg-row small { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.sugg-row small i { font-style: normal; }
.sugg-row .sg-good { color: var(--accent-ink); }
.sugg-row .sg-warn { color: var(--warn-ink); }
.sugg-row .sg-bad { color: var(--muted); }
.sugg-row.blocked { opacity: .62; }
.sugg-row.blocked .av { filter: grayscale(1); }
.sg-hrs { flex: none; margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; }
.sg-hrs small { display: inline; margin-left: 3px; font-weight: 600; }
.sugg-none { margin: 6px 4px; font-size: 13px; }
.sugg .sugg-more { margin: 2px 4px 0; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.open-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.open-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px dashed rgba(79, 107, 237, .45); border-radius: 18px; background: #FBFCFF; }
.open-card .tl-date { width: 40px; flex: none; }
.open-card.is-off { border-color: var(--line); background: #fff; }
.open-card.is-off .tl-time { color: var(--muted); }
.open-mode { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--accent-ink); }
.open-card.is-off .open-mode { color: var(--muted); }
.open-mode .ic { width: 14px; height: 14px; flex: none; }
@media (max-width: 899px), (max-height: 559px) { .open-card { flex-wrap: wrap; } .open-card .btn { width: 100%; } }
@media (max-width: 899px), (max-height: 559px) { .actions { flex-wrap: wrap; } }
.ncard-ico.ico-open_shift, .ncard-ico.ico-claim, .ncard-ico.ico-taken, .ncard-ico.ico-claim_accepted { background: var(--accent-soft); color: var(--accent-ink); }
.ncard-ico.ico-claim_declined { background: #F1F2F6; color: var(--muted); }

/* Varsler */
.nlist { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.ncard {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s;
}
.ncard:hover { box-shadow: var(--shadow); border-color: #DCE0EA; }
.ncard > .ic { color: var(--faint); }
.ncard.unread { border-color: rgba(79, 107, 237, .4); background: #FBFCFF; }
.ncard-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: #FDEFEF; color: var(--danger); }
.ncard-title { display: block; font-weight: 750; }
.ncard.unread .ncard-title::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--accent); vertical-align: 2px; }
.ncard-body { display: block; font-size: 14px; color: var(--muted); }
.ncard-time { display: block; margin-top: 3px; font-size: 12px; font-weight: 650; color: var(--faint); }

/* ---- godkjenninger, bytter og historikk ----------------------------------- */

.sidenav a, .tabbar a { position: relative; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; }
.tabbar .nav-badge { position: absolute; top: 7px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; line-height: 18px; box-shadow: 0 0 0 2px #fff; }
.badge.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.uchip.is-pending, .ucard-mini.is-pending { border-color: #E9B44C; background: repeating-linear-gradient(135deg, #FFF6E3 0 4px, #fff 4px 8px); color: #8A5A00; }
.alist { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; margin-bottom: 8px; }
.acard { padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.acard-head { display: flex; align-items: center; gap: 10px; }
.acard-head small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.acard-head .stack .av { box-shadow: 0 0 0 2px #fff; }
.acard-title { font-weight: 700; }
.acard-crash, .ucard-warn { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: 13.5px; font-weight: 600; color: #9B2C2F; }
.acard-crash .ic, .ucard-warn .ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.ucard-warn { font-size: 12.5px; }
.acard-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: auto; padding-top: 6px; }
@media (max-width: 899px), (max-height: 559px) { .alist { grid-template-columns: 1fr; } .acard-actions .btn { flex: 1; } }
.crash { display: flex; gap: 10px; margin: 10px 0 0; padding: 11px 13px; border-radius: 12px; background: #FDEFEF; color: #9B2C2F; font-size: 13.5px; line-height: 1.45; }
.crash .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: left; font: inherit; color: var(--text); cursor: pointer; text-decoration: none; }
.choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.choice > .ic:first-child { width: 22px; height: 22px; color: var(--accent-ink); }
.choice > .ic:last-child { color: var(--faint); }
.choice b { display: block; }
.choice small { display: block; color: var(--muted); font-size: 13px; }
.trade-card { align-items: flex-start; }
.trade-card .ucard-ico { width: 38px; height: 38px; }
.trade-line { font-size: 14px; color: var(--muted); margin-top: 2px; }
.trade-btns { display: flex; gap: 6px; flex: none; }
@media (max-width: 899px), (max-height: 559px) { .trade-btns { width: 100%; } .trade-btns .btn { flex: 1; } }
.trade-status { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 5px 9px; border-radius: 8px; background: #FFF4DE; color: #8A5300; font-size: 13px; font-weight: 700; }

/* Varsler i iPhone-appen (under «Meg») */
.push-state { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.push-state .ic { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.push-state.on { background: #E6F7EF; color: #0F5C3D; }
.push-state.on .ic { color: #11734B; }
.push-state.off { background: #FFF4DE; color: #6B4100; }
.push-state.off .ic { color: #D27C00; }

/* Pågående bytte: banner øverst på alle sider */
.tradebar { padding: 0 16px 8px; background: rgba(244, 245, 250, .86); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); }
.tradebar[hidden] { display: none; }
.tradebar-in {
  display: flex; align-items: flex-start; gap: 12px; max-width: 1600px; margin: 0 auto; padding: 12px 14px;
  border: 1.5px solid #F2B35B; border-radius: 14px; background: #FFF4DE; color: #6B4100; text-decoration: none;
  box-shadow: 0 6px 18px rgba(214, 140, 30, .18);
}
.tradebar-in > .ic { width: 22px; height: 22px; color: #D27C00; margin-top: 1px; }
.tradebar-in > .ic:last-child { width: 18px; height: 18px; color: #B87A2A; align-self: center; }
.tradebar-row { font-size: 14px; line-height: 1.4; }
.tradebar-row + .tradebar-row { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(210, 124, 0, .2); }
.tradebar-row b { color: #8A3B00; }
.tradebar-foot { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: #9A6420; }
@media (min-width: 900px) and (min-height: 560px) {
  .tradebar { padding: 18px 36px 0; background: var(--bg); }
  body.has-tradebar main { padding-top: 18px; }
}
@media (min-width: 900px) and (min-height: 560px) and (max-width: 1199px) { .tradebar { padding: 14px 20px 0; } }
.trade-warn { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 4px; padding: 11px 13px; border-radius: 12px; background: #FFF4DE; border: 1px solid #F2C77F; color: #6B4100; font-size: 13.5px; line-height: 1.45; }
.trade-warn .ic { width: 19px; height: 19px; color: #D27C00; flex: none; margin-top: 1px; }
.trade-warn b { color: #8A3B00; }
.trade-status .ic { width: 15px; height: 15px; }
button.tl-card.is-action { width: 100%; text-align: left; font: inherit; cursor: pointer; }
button.tl-card.is-action:hover { box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 25%, transparent); }
.history { margin: 0 0 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.history summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; font-weight: 650; cursor: pointer; list-style: none; }
.history summary::-webkit-details-marker { display: none; }
.history summary .ic { width: 17px; height: 17px; color: var(--muted); }
.history summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); transition: transform .15s; }
.history[open] summary::after { transform: rotate(-135deg); }
.hist-list { padding: 4px 14px 12px; max-height: 300px; overflow: auto; }
.hist-row { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.hist-row + .hist-row::before { content: ""; position: absolute; left: 4px; top: -8px; height: 16px; border-left: 2px solid var(--line); }
.hist-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 5px; box-shadow: 0 0 0 3px var(--accent-soft); }
.hist-title { font-weight: 650; font-size: 14px; }
.hist-line { font-size: 13px; color: var(--text); }
.hist-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.only-sm-block { display: none; }
@media (max-width: 899px), (max-height: 559px) { .only-sm-block { display: block; } }

/* ---- ønsker --------------------------------------------------------------- */

/* Lagrestatus på Ønsker: alltid synlig nederst (over fanelinjen på mobil). */
.save-pill {
  position: fixed; z-index: 40; left: 50%; bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 9px 16px; border-radius: 999px; white-space: nowrap;
  font-size: 13.5px; font-weight: 700; box-shadow: 0 10px 28px rgba(28, 32, 51, .18); transition: background .2s, color .2s;
  background: rgba(255, 255, 255, .96); color: var(--muted); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.save-pill .ic { width: 16px; height: 16px; flex: none; }
.save-pill small { font-weight: 600; opacity: .75; }
.save-pill.is-saving { background: #1F2337; color: #fff; border-color: transparent; }
.save-pill.is-saved { background: #11734B; color: #fff; border-color: transparent; animation: pill-pop .3s ease-out; }
.save-pill.is-all { color: #11734B; border-color: #CBEBDD; }
.save-pill.is-error { background: var(--danger); color: #fff; border-color: transparent; }
.save-pill button { margin-left: 4px; padding: 4px 10px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .22); color: #fff; font: 700 12.5px var(--font); cursor: pointer; }
.spin { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pill-pop { 0% { transform: translateX(-50%) scale(.92); } 60% { transform: translateX(-50%) scale(1.05); } 100% { transform: translateX(-50%) scale(1); } }
@media (min-width: 900px) and (min-height: 560px) { .save-pill { bottom: 24px; left: calc(var(--side-w) + (100% - var(--side-w)) / 2); } }
.wish-grid { margin-bottom: 64px; }
.wish-grid .card { position: relative; }
.wish-grid .card.just-saved::after {
  content: "✓ Lagret"; position: absolute; top: 14px; right: 16px; padding: 3px 9px; border-radius: 999px;
  background: #DDF5EA; color: #11734B; font-size: 12px; font-weight: 800; animation: saved-tag 1.8s ease-out forwards;
}
@keyframes saved-tag { 0% { opacity: 0; transform: translateY(-3px); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
.wish-summary { margin-bottom: 14px; background: linear-gradient(135deg, #F3F5FF, #F7F2FF); border-color: rgba(79, 107, 237, .2); }
.wish-sum-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--accent-ink); }
.wish-sum-head .ic { width: 18px; height: 18px; }
.wish-summary .wdl { margin-top: 4px; }
.wish-summary .wish-note { margin: 12px 0 0; }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 11px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 600; line-height: 1.35; }
.wish-note { margin: 10px 0 0; font-size: 14px; font-style: italic; color: var(--muted); }
.wish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 899px), (max-height: 559px) { .wish-grid { grid-template-columns: 1fr; } }
.wish-grid .card h3 { margin-bottom: 14px; }
.wish-grid textarea { min-height: 96px; }

.slider { margin: 0 0 20px; }
.slider-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; min-height: 28px; }
.slider-top output { font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--accent-ink); }
.slider.unset .slider-top output { font-size: 14.5px; font-weight: 600; color: var(--faint); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; cursor: pointer; --p: 50%; }
input[type=range]:focus { box-shadow: none; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--p), #E3E6F0 var(--p)); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--p), #E3E6F0 var(--p)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 2px 10px rgba(79, 107, 237, .35); }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 2px 10px rgba(79, 107, 237, .35); }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(79, 107, 237, .2); }
.slider.unset input[type=range]::-webkit-slider-runnable-track { background: #E3E6F0; }
.slider.unset input[type=range]::-moz-range-track { background: #E3E6F0; }
.slider.unset input[type=range]::-webkit-slider-thumb { border-color: #B8BFCF; box-shadow: none; }
/* Merkene står rett under der tommelen havner: 14px inn fra hver kant. */
.ticks { position: relative; height: 18px; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.ticks span { position: absolute; top: 0; left: calc(14px + (100% - 28px) * var(--t)); transform: translateX(-50%); white-space: nowrap; }
.ticks span:first-child { left: 0; transform: none; }
.ticks span:last-child { left: auto; right: 0; transform: none; }

.lvl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-2); }
.lvl-row:first-of-type { border-top: 0; }
.lvl-row b { font-weight: 650; }
.lvl-row small { margin-left: 6px; color: var(--muted); font-size: 12.5px; }
.lvl { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 10px; background: #EEF0F5; }
.lvl button { height: 32px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; font-weight: 650; font-size: 13px; color: var(--muted); cursor: pointer; }
.lvl button.on[data-v="yes"] { background: #DDF5EA; color: #11734B; }
.lvl button.on[data-v="ok"] { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.lvl button.on[data-v="no"] { background: #FDE7E7; color: #A3282C; }
.pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pick button { min-height: 46px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-weight: 650; font-size: 13px; cursor: pointer; line-height: 1.2; }
.pick button small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.pick button.on { border-color: rgba(79, 107, 237, .5); background: var(--accent-soft); color: var(--accent-ink); }
.pick button:hover { border-color: #D4D8E5; }
@media (max-width: 419px) { .pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.wish-cards { align-items: start; }
.wish-card { display: flex; flex-direction: column; gap: 12px; }
.acard-head b { display: block; }
.wdays { display: flex; gap: 4px; }
.wdays span { flex: 1; height: 26px; display: grid; place-items: center; border-radius: 7px; background: #F1F2F6; color: var(--muted); font-size: 11.5px; font-weight: 750; }
.wdays span.yes { background: #DDF5EA; color: #11734B; }
.wdays span.no { background: #FDE7E7; color: #A3282C; }

/* ---- rapporter ------------------------------------------------------------ */

.rp-bar { margin: -4px 0 16px; }
.rp-periods { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-custom { max-width: 520px; margin-top: 12px; }
.rp-custom .field { margin-bottom: 0; }
.rp-range { margin: 10px 2px 0; font-size: 13px; font-weight: 650; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.kpi-top { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.kpi-top .ic { width: 16px; height: 16px; color: var(--accent); }
.kpi-val { margin-top: 6px; white-space: nowrap; font-size: clamp(19px, 1.75vw, 26px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.rp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.rp-wide { grid-column: 1 / -1; }
@media (max-width: 899px), (max-height: 559px) { .rp-grid { grid-template-columns: 1fr; } .kpis { grid-template-columns: 1fr 1fr; } .kpi-val { font-size: 22px; } }
.rp-grid .card h3 { margin-bottom: 14px; }

.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 96px; align-items: center; gap: 12px; }
.hbar-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 650; font-size: 14px; }
.hbar-name > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { display: flex; height: 14px; border-radius: 7px; background: #F1F2F7; overflow: hidden; }
.hbar-track i { display: block; height: 100%; }
.hbar-track .done { background: var(--c); }
.hbar-track .plan { background: color-mix(in srgb, var(--c) 35%, #fff); }
.hbar-val { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hbar-val b { font-size: 14px; }
.hbar-val small, .prow-val small, .prow small { font-size: 12px; color: var(--muted); }
@media (max-width: 599px) { .hbar { grid-template-columns: 84px minmax(0, 1fr) 76px; gap: 8px; } }
.legend-line { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-block; width: 12px; height: 8px; border-radius: 3px; background: var(--accent); margin-left: 8px; }
.lg:first-child { margin-left: 0; }
.lg-plan { background: color-mix(in srgb, var(--accent) 35%, #fff); }

.rp-table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-table th { padding: 8px 7px; text-align: right; font-size: 11.5px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.rp-table td { padding: 9px 7px; text-align: right; border-bottom: 1px solid var(--line-2); }
.rp-table th:first-child, .rp-table td:first-child { text-align: left; }
.rp-table tbody tr:hover td { background: var(--surface-2); }
.rp-table tfoot td { font-weight: 750; border-bottom: 0; border-top: 2px solid var(--line); }
.rp-table.no-wish tr > :nth-child(7) { display: none; } /* «Ønske» når ønsker er slått av */
.rp-who { display: flex; align-items: center; gap: 8px; font-weight: 650; }

.vbars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 8px; height: 170px; }
.vbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.vbar i { display: block; width: 100%; max-width: 42px; min-height: 2px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #6F86F5, var(--accent)); }
.vbar-val { margin-bottom: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.vbar-lbl { margin-top: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: capitalize; }

.plist { display: flex; flex-direction: column; }
.prow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.prow:first-child { border-top: 0; padding-top: 0; }
.prow .grow { display: flex; flex-direction: column; min-width: 0; }
.prow-val { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.prow .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

/* ---- filter --------------------------------------------------------------- */

.fbtn { position: relative; flex: none; }
.fbtn.on { background: var(--accent-soft); }
.fcount { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; }
.fpanel {
  position: fixed; z-index: 250; width: 340px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 14px 14px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); animation: drop .14s ease-out;
}
@media (max-width: 899px), (max-height: 559px) {
  .fpanel { left: 0; right: 0; bottom: 0; width: auto; max-height: 80vh; border-radius: 22px 22px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); animation: up .22s cubic-bezier(.2, .8, .2, 1); }
}
.fpanel-head { display: flex; align-items: center; justify-content: space-between; min-height: 30px; margin: 0 2px 10px; font-size: 16px; }
.fpanel-head .link-btn { margin: 0; }
.switch.compact { padding: 9px 12px; margin-bottom: 8px; }
.switch.compact span { font-size: 14px; }
.fsec { margin: 14px 2px 8px; font-size: 12px; font-weight: 800; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchips.is-off { opacity: .45; }
.fchip {
  --c: var(--accent); display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 4px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 650; font-size: 13px; cursor: pointer;
}
.fchip-pos { padding-left: 8px; }
.fchip-pos .dot { margin: 0 2px; width: 10px; height: 10px; }
.fchip:hover { border-color: #D4D8E5; }
.fchip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 25%, transparent); }
.fnote { margin: 8px 2px 0; font-size: 12.5px; color: var(--muted); }
.banner-info { background: var(--accent-soft); border-color: rgba(79, 107, 237, .25); color: var(--accent-ink); }

/* ---- høyreklikkmeny ------------------------------------------------------- */

.ctx {
  position: fixed; z-index: 300; min-width: 240px; max-width: 320px; max-height: min(520px, calc(100vh - 16px)); overflow-y: auto; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); animation: drop .12s ease-out;
}
.ctx-user { min-width: 260px; padding: 6px; }
.ctx-profile { display: flex; align-items: center; gap: 11px; padding: 8px 10px 10px; }
.ctx-profile .grow { min-width: 0; }
.ctx-profile b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-profile small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; }
.ctx-user .ctx-item { padding-top: 9px; padding-bottom: 9px; font-size: 14.5px; }
.ctx-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; }
.ctx-head { padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line-2); font-size: 12px; font-weight: 750; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 9px;
  background: transparent; font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer;
}
.ctx-item .ic { width: 17px; height: 17px; color: var(--muted); }
.ctx-item > .ic:last-child { width: 15px; height: 15px; color: var(--faint); }
.ctx-item .av { width: 22px; height: 22px; font-size: 9.5px; }
.ctx-item small { display: block; font-size: 12px; color: var(--muted); }
.ctx-item:hover, .ctx-item:focus-visible { background: var(--accent-soft); outline: none; }
.ctx-item:hover > .ic:first-child, .ctx-item:focus-visible > .ic:first-child { color: var(--accent-ink); }
.ctx-item.danger, .ctx-item.danger .ic { color: var(--danger); }
.ctx-item.danger:hover, .ctx-item.danger:focus-visible { background: var(--danger-soft); }
.ctx-item:disabled { opacity: .45; cursor: default; background: transparent; }
.ctx-back { font-weight: 650; }
.ctx-sep { height: 1px; margin: 4px 6px; background: var(--line-2); }

/* ---- dra og slipp --------------------------------------------------------- */

.tg-col.can-add .shift-slot, .can-drag .shift { cursor: grab; }
body.dragging, body.dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
body.dragging.drag-copy, body.dragging.drag-copy * { cursor: copy !important; }
body.dragging .shift { transition: none; }
.shift.is-dragsrc { opacity: .35; }
body.drag-copy .shift.is-dragsrc { opacity: 1; }
.drag-preview {
  z-index: 6; pointer-events: none; left: 3px; width: calc(100% - 6px);
  background: color-mix(in srgb, var(--c) 28%, #fff); border: 1.5px solid var(--c); border-left-width: 3px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--c) 35%, transparent);
}
/* Håndtak for å endre lengden, øverst og nederst i vakta */
.rz { position: absolute; left: 0; right: 0; height: 9px; z-index: 3; cursor: ns-resize; }
/* Trykk og hold på berøringsskjerm: vakta krymper litt mens man holder, og løftes når den kan dras. */
.shift-slot { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.shift-slot.is-pressing { transition: transform .45s ease-out; transform: scale(.97); }
.shift-slot.is-lifted { transform: scale(1.03); z-index: 7; box-shadow: 0 14px 30px color-mix(in srgb, var(--c) 40%, transparent); transition: transform .12s ease-out; }
.rz-top { top: 0; }
.rz-bot { bottom: 0; }
.rz::after {
  content: ""; position: absolute; left: 50%; width: 22px; height: 4px; margin-left: -11px; border-radius: 2px;
  background: color-mix(in srgb, var(--c) 70%, #fff); opacity: 0; transition: opacity .12s;
}
.rz-top::after { top: 2px; }
.rz-bot::after { bottom: 2px; }
.shift-slot:hover .rz::after { opacity: 1; }
.shift-slot.size-s .rz { height: 6px; }
.shift-slot.size-s .rz::after { display: none; }
body.resizing, body.resizing * { cursor: ns-resize !important; }
@media (hover: none) {
  .rz { height: 16px; }
  .rz::after { opacity: .9; }
  .rz-top { top: -2px; }
  .rz-bot { bottom: -2px; }
}
.drag-tag { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; vertical-align: 1px; }
.drag-float { position: fixed; z-index: 200; margin: 0; pointer-events: none; transform: rotate(-1.5deg); box-shadow: var(--shadow-lg); opacity: .96; }
.drag-float.is-copy::after { content: "Kopi"; position: absolute; top: -9px; right: -9px; padding: 2px 7px; border-radius: 7px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.drop-on { background: var(--accent-soft) !important; box-shadow: inset 0 0 0 2px var(--accent); }
.grid-hint { display: flex; align-items: center; gap: 8px; margin: 12px 4px 0; font-size: 13px; color: var(--muted); }
.grid-hint .ic { width: 16px; height: 16px; color: var(--faint); }
kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: #fff; font: 600 12px var(--font); color: var(--text); }

/* ---- toast ---------------------------------------------------------------- */

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translateX(-50%) translateY(16px); max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 14px; background: #1C2033; color: #fff; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast { display: flex; align-items: center; gap: 14px; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.has-action { pointer-events: auto; padding-right: 8px; }
.toast-btn { height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: rgba(255, 255, 255, .14); color: #fff; font-weight: 750; cursor: pointer; }
.toast-btn:hover { background: rgba(255, 255, 255, .24); }
#toast.err { background: var(--danger); }
@media (min-width: 900px) and (min-height: 560px) { #toast { bottom: 28px; } }

/* ---- automatisk fordeling ---------------------------------------------- */
.ap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ap .card h3 { display: flex; align-items: center; gap: 10px; }
.ap-step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 800; }
.ap-lead { margin: -6px 0 14px !important; font-size: 13.5px; }
.ap-period { max-width: 520px; margin-bottom: 4px; }
.ap .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-week, .ap-days { display: grid; gap: 6px; }
.ap-wd, .ap-day { display: grid; grid-template-columns: 150px auto 1fr auto; align-items: center; gap: 10px 14px; padding: 7px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; }
.ap-wd { grid-template-columns: 150px auto 1fr; }
.ap-day.is-edited { border-color: rgba(79, 107, 237, .35); background: var(--accent-soft); }
.ap-open { display: flex; align-items: center; gap: 9px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ap-open input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.ap-open b { font-weight: 700; }
.ap-open span { font-weight: 500; }
.ap-times { display: flex; align-items: center; gap: 6px; }
.ap-times .time-wrap { width: 108px; }
.ap-times input { height: 38px; font-size: 14.5px; }
.ap-dash { color: var(--faint); }
.ap-closed { display: none; color: var(--faint); font-size: 13.5px; }
.ap-wd.is-closed .ap-times, .ap-day.is-closed .ap-times { opacity: .35; pointer-events: none; }
.ap-wd.is-closed .ap-closed { display: block; }
.ap-split { font-size: 13px; color: var(--muted); }
.ap-day.is-closed .ap-split { color: var(--faint); }
.ap-reset { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--accent-ink); cursor: pointer; }
.ap-reset:hover { background: rgba(79, 107, 237, .12); }
.ap-reset svg { width: 16px; height: 16px; }
.ap-settings { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 4px 24px; margin-top: 20px; align-items: start; }
.ap-settings .slider { margin-bottom: 6px; }
.ap-settings .hint { margin: 0 0 8px; }
.ap-settings .switch { grid-column: 1 / -1; margin: 6px 0 0; }
.switch small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.ap-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px 22px; }
.ap-person { padding: 12px 14px 0; border-radius: 14px; border: 1px solid var(--line); }
.ap-who { display: flex; align-items: center; gap: 10px; }
.ap-who .grow { min-width: 0; }
.ap-who b { display: block; }
.ap-who small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-weight { margin: 4px 0 10px; }
.ap-weight .slider-top { min-height: 22px; margin-bottom: 0; }
.ap-weight .slider-top output { font-size: 14.5px; }
.ap-weight.is-off .slider-top output { color: var(--faint); }
.ap-weight.is-off input[type=range]::-webkit-slider-runnable-track { background: #E3E6F0; }
.ap-go { display: flex; align-items: center; gap: 14px; }
.ap-go .hint { margin: 0; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
#apResult { margin-top: 16px; scroll-margin-top: 80px; }
.ap-result-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ap-result-head h3 { margin-bottom: 4px; }
.ap-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.warn-text { color: var(--warn-ink); }
.ap-fair { display: grid; gap: 8px; }
.ap-frow { display: grid; grid-template-columns: 140px 1fr 170px; align-items: center; gap: 12px; }
.ap-frow.is-off { opacity: .5; }
.ap-fname { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.ap-fname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-ftrack { position: relative; height: 12px; border-radius: 6px; background: var(--surface-2); }
.ap-ftrack i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--c); }
.ap-ftrack b { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--text); }
.ap-fval b { font-size: 14.5px; }
.ap-fval small { display: block; font-size: 12px; color: var(--muted); }
.ap-fval small svg { width: 12px; height: 12px; vertical-align: -1px; color: var(--warn-ink); }
.lg-goal { display: inline-block; width: 3px; height: 12px; border-radius: 2px; background: var(--text); margin-left: 10px; }
.ap-plan { display: grid; gap: 4px; margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.ap-pday { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.ap-pday:last-child { border-bottom: 0; }
.ap-pdate b { display: block; font-size: 14px; }
.ap-pdate span { font-size: 12.5px; color: var(--muted); }
.ap-pslots { display: grid; gap: 6px; }
.ap-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; padding: 7px 10px; border-radius: 10px; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 8%, #fff); }
.ap-slot.is-open { background: var(--warn-soft); border-left-color: #E5A13A; }
.ap-stime { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13.5px; min-width: 92px; }
.ap-why { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.ap-why i { font-style: normal; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(28, 32, 51, .06); color: var(--muted); }
.ap-why i.warn { background: var(--warn-soft); color: var(--warn-ink); }
.ap-why i svg { width: 11px; height: 11px; vertical-align: -1px; margin-right: 3px; }
/* Dagene i perioden: sammendrag som åpner lista */
.ap-days-sum { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ap-days-sum:hover { border-color: #D4D8E5; }
.ap-days-sum b { display: block; font-size: 15px; }
.ap-days-sum small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); }
.ap-sum-act { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 14px; font-weight: 700; color: var(--accent-ink); white-space: nowrap; }
.ap-sum-act .ic { width: 16px; height: 16px; transition: transform .15s; }
.ap-days-sum[aria-expanded="true"] .ap-sum-act .ic { transform: rotate(180deg); }
.ap-days:not([hidden]) { margin-top: 12px; }
.ap-days .ap-lead { margin: 0 0 4px !important; }
.ap-short { display: none; }

@media (max-width: 760px) {
  .ap { gap: 12px; }
  .ap .card { padding: 16px; }
  .ap .card h3 { margin-bottom: 12px; font-size: 15.5px; }
  .ap-lead { font-size: 13px; margin: -4px 0 12px !important; }
  /* Periode: datoene får plass, hurtigvalgene på én linje */
  .ap-period { gap: 10px; }
  .ap-period .date-wrap > .ic { display: none; }
  .ap-period input.date-input { padding-left: 12px; padding-right: 44px; }
  .ap .chips { flex-wrap: nowrap; gap: 6px; }
  .ap .chips .chip-btn { flex: 1; min-width: 0; padding: 0 6px; font-size: 13.5px; white-space: nowrap; }
  /* Ukedager og dager: én linje hver, kort navn */
  .ap-long { display: none; }
  .ap-short { display: inline; }
  .ap-week, .ap-days { gap: 4px; }
  .ap-wd, .ap-day { grid-template-columns: 62px minmax(0, 1fr) auto; gap: 2px 8px; padding: 5px 8px; }
  .ap-wd { grid-template-columns: 62px minmax(0, 1fr); }
  .ap-day { grid-template-columns: 84px minmax(0, 1fr) auto; }
  .ap-day .ap-open { font-size: 14px; }
  .ap-open { gap: 7px; }
  .ap-times { gap: 4px; min-width: 0; }
  .ap-times .time-wrap { flex: 1; width: auto; min-width: 0; }
  .ap-times .time-wrap > .ic { display: none; }
  .ap-times input.time-input { height: 36px; padding: 0 6px; text-align: center; font-size: 16px; }
  .ap-wd .ap-closed, .ap-wd .ap-times { grid-column: 2; grid-row: 1; }
  .ap-wd.is-closed .ap-times, .ap-day.is-closed .ap-times { display: none; }
  .ap-day.is-closed .ap-split { grid-column: 2; grid-row: 1; }
  .ap-day .ap-split { grid-column: 2 / -1; font-size: 12px; }
  .ap-day .ap-reset { width: 30px; height: 30px; }
  .ap-settings { grid-template-columns: 1fr; margin-top: 16px; }
  /* Hvem og hvor mye: tettere kort */
  .ap-people { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ap-person { padding: 10px 12px 0; border-radius: 12px; }
  .ap-person .av-md { width: 34px; height: 34px; font-size: 12.5px; }
  .ap-weight { margin: 2px 0 6px; }
  .ap-weight .ticks { font-size: 11px; }
  /* «Lag forslag» står fast nederst over menyen */
  .ap-go { position: sticky; bottom: calc(var(--tab-h) + 10px + env(safe-area-inset-bottom)); z-index: 15; }
  .ap-go .btn-lg { flex: 1; box-shadow: 0 10px 26px rgba(79, 107, 237, .4); }
  .ap-go .hint:empty { display: none; }
  /* Forslaget */
  .ap-frow { grid-template-columns: 92px 1fr 100px; gap: 8px; }
  .ap-why { margin-left: 0; width: 100%; }
  .ap-pday { grid-template-columns: 48px 1fr; gap: 8px; }
  .ap-result-head .ap-actions { width: 100%; }
  .ap-result-head .ap-actions .btn { flex: 1; }
}
}
.ap-empty { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 18px; border-radius: 12px; background: var(--surface-2); }
.ap-empty svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 1px; }
.ap-empty p { margin: 2px 0 0 !important; color: var(--muted); font-size: 13.5px; }

/* ---- flere vakter på en gang ------------------------------------------- */
#selBtn.on { background: var(--accent-soft); color: var(--accent-ink); border-color: rgba(79, 107, 237, .35); }
.shift.selectable { position: relative; }
/* Vaktene i tidsrutenettet er plassert etter klokkeslett og må forbli det. */
.shift.shift-slot.selectable { position: absolute; }
.shift.selectable::after {
  content: ''; position: absolute; top: 5px; right: 5px; z-index: 3; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--c) 45%, #fff); background: #fff; box-sizing: border-box;
}
.shift.selectable.is-sel { box-shadow: 0 0 0 2.5px var(--accent), 0 6px 16px rgba(79, 107, 237, .25); }
.shift.selectable.is-sel::after {
  border-color: var(--accent); background: var(--accent) no-repeat center / 12px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5L19.5 7'/%3E%3C/svg%3E");
}
.shift.selectable .shift-go { visibility: hidden; }
.shift.selectable.is-dim { opacity: 1; }
.shift-slot.selectable .rz { display: none; }
.ag-row.selectable::after { top: 50%; margin-top: -9px; right: 10px; }
.ag-row.selectable.is-sel { box-shadow: none; }
.ag-row.selectable.is-sel .ag-card { box-shadow: 0 0 0 2.5px var(--accent); }
.ag-row.selectable .ag-hrs { margin-right: 26px; }
.shift-month.selectable::after, .shift-grid.selectable::after { width: 15px; height: 15px; top: 4px; right: 4px; background-size: 10px; }

.selbar {
  position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 6px; border-radius: 16px;
  background: #1C2033; color: #fff; box-shadow: 0 16px 40px rgba(17, 20, 38, .35); animation: selbar-in .18s ease-out;
}
@keyframes selbar-in { from { transform: translateY(14px); opacity: 0; } }
.selbar-x { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border: 0; border-radius: 11px; background: transparent; color: #C9CDDC; cursor: pointer; }
.selbar-x:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.selbar-x .ic { width: 18px; height: 18px; }
.selbar-count { min-width: 0; flex: 1; line-height: 1.2; }
.selbar-count b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selbar-count small { display: block; font-size: 12px; color: #A9AEC2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selbar-quick { display: flex; gap: 6px; }
.selbar .chip-btn { height: 34px; white-space: nowrap; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; }
.selbar .chip-btn:hover { background: rgba(255, 255, 255, .16); }
.selbar .chip-btn:disabled { opacity: .4; }
.selbar-acts { display: flex; gap: 6px; }
.selbar .btn { height: 38px; }
.selbar .btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .22); color: #fff; }
.selbar .btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.selbar .btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.selbar .btn-primary .ic:last-child { width: 15px; height: 15px; margin: 0 -2px 0 2px; }
main:has(.selbar) { padding-bottom: calc(var(--tab-h) + 100px + env(safe-area-inset-bottom)); }
@media (max-width: 899px), (max-height: 559px) {
  .selbar-count small { display: none; }
  .selbar .hide-sm { display: none; }
  .selbar .btn-primary { padding: 0 12px; font-size: 14px; }
}
@media (max-width: 420px) {
  .selbar { gap: 6px; }
  .selbar .btn-primary { font-size: 0; gap: 0; padding: 0 12px; }
  .selbar .btn-primary::before { content: 'Gjør'; font-size: 14px; }
}
@media (min-width: 900px) and (min-height: 560px) {
  .selbar { left: calc(var(--side-w) + 24px); right: 24px; bottom: 20px; max-width: 980px; margin: 0 auto; padding: 8px 10px 8px 8px; }
  main:has(.selbar) { padding-bottom: 110px; }
}

/* ---- forespørsler som venter på svar fra meg --------------------------- */
.askbar { padding: 6px 16px 4px; }
.askbar[hidden] { display: none; }
.askbar-in, .ask-inline {
  max-width: 1600px; margin: 0 auto; padding: 12px 14px 6px; border-radius: 18px;
  background: linear-gradient(135deg, #4F6BED 0%, #6A55E0 100%); color: #fff;
  box-shadow: 0 12px 30px rgba(79, 107, 237, .32);
}
.askbar-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; letter-spacing: .01em; color: rgba(255, 255, 255, .85); }
.askbar-head .ic { width: 16px; height: 16px; animation: ask-ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ask-ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .askbar-head .ic { animation: none; } }
.ask-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.ask-row + .ask-row { border-top: 1px solid rgba(255, 255, 255, .18); }
.ask-row .av { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.ask-title { font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; }
.ask-line { font-size: 14px; color: rgba(255, 255, 255, .92); margin-top: 2px; }
.ask-line span { font-weight: 700; }
.ask-note { font-size: 13.5px; font-style: italic; color: rgba(255, 255, 255, .85); margin-top: 3px; }
.ask-btns { display: flex; gap: 8px; flex: none; }
.askbar .btn-ghost, .ask-inline .btn-ghost { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff; }
.askbar .btn-ghost:hover, .ask-inline .btn-ghost:hover { background: rgba(255, 255, 255, .2); }
.askbar .btn-primary, .ask-inline .btn-primary { background: #fff; border-color: #fff; color: var(--accent-ink); box-shadow: 0 4px 12px rgba(20, 24, 60, .18); }
.askbar .btn-primary:hover, .ask-inline .btn-primary:hover { background: #F1F3FF; }
.ask-more { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 0 6px; border-top: 1px solid rgba(255, 255, 255, .18); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; }
.ask-more .ic { width: 16px; height: 16px; }
.ask-inline { margin-bottom: 20px; padding-bottom: 12px; }
.ask-inline .open-card { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; margin-top: 8px; box-shadow: none; }
.ask-inline .ucard-ico.rep { background: rgba(255, 255, 255, .18); color: #fff; }
.ask-inline .trade-line, .ask-inline .shift-note { color: rgba(255, 255, 255, .9); }
@media (max-width: 899px), (max-height: 559px) {
  .ask-row { flex-wrap: wrap; align-items: flex-start; }
  .ask-row .grow { flex: 1; min-width: 0; }
  .ask-btns { width: 100%; padding-left: 52px; }
  .ask-btns .btn { flex: 1; }
  .ask-inline .trade-card { flex-wrap: wrap; }
  .ask-inline .trade-btns { width: 100%; }
  .ask-inline .trade-btns .btn { flex: 1; }
}
@media (min-width: 900px) and (min-height: 560px) {
  .askbar { padding: 18px 36px 0; }
  body.has-askbar main { padding-top: 18px; }
}
@media (min-width: 900px) and (min-height: 560px) and (max-width: 1199px) { .askbar { padding: 14px 20px 0; } }
.ask-inline .open-card { border-style: solid; }
.ask-inline .tl-time { color: #fff; }

/* Navnet på bedriften under «Skifti» */
.wordmark .org-name { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; line-height: 1.15; opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.sidebar .wordmark .org-name { max-width: 128px; }
.wordmark:has(.org-name) { line-height: 1.05; }

/* ---- banner: support-tilgang og prøveperiode ---- */
.noticebar { padding: 0 16px 8px; }
.noticebar[hidden] { display: none; }
.notice-in { display: flex; align-items: center; gap: 12px; max-width: 1600px; margin: 0 auto; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.4; text-decoration: none; }
.notice-in > .ic { width: 20px; height: 20px; flex: none; }
.notice-in > .ic:last-child:not(:first-child) { width: 18px; height: 18px; }
.notice-support { background: #23284A; color: #fff; box-shadow: 0 6px 18px rgba(20, 24, 60, .25); }
.notice-support .btn { flex: none; background: #fff; border-color: #fff; color: #23284A; }
.notice-trial { border: 1.5px solid #F2B35B; background: #FFF4DE; color: #6B4100; }
.notice-trial b { color: #8A3B00; }
/* Abonnement: så lav som mulig, én linje. */
.notice-slim { gap: 10px; padding: 3px 4px 3px 12px; border-radius: 12px; border: 1px solid #F2D49A; background: #FFF7E6; color: #6B4100; font-size: 13.5px; }
.notice-slim > .ic { width: 17px; height: 17px; color: #C27A0E; }
.notice-slim .ns-text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: inherit; text-decoration: none; }
.notice-slim .ns-text b { color: #8A3B00; font-weight: 700; }
.notice-slim .btn-sm { flex: none; height: 28px; padding: 0 12px; font-size: 13px; box-shadow: none; }
.ns-close { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: #A5751F; cursor: pointer; }
.ns-close:hover { background: rgba(194, 122, 14, .12); }
.ns-close .ic { width: 16px; height: 16px; }
.notice-slim .ns-short { display: none; }
@media (max-width: 599px) { .notice-slim .ns-price, .notice-slim .ns-long { display: none; } .notice-slim .ns-short { display: inline; } }

/* ---- registrering: feltet roboter fyller ut ---- */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Skifti-admin ---- */
.adm { display: grid; gap: 14px; max-width: 1100px; }
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.adm-table tr[data-id] { cursor: pointer; }
.adm-table tr[data-id]:focus-visible td { background: var(--accent-soft); outline: none; }
.adm-name b { display: block; }
.adm-name small { display: block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-weight: 500; }
.adm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.adm-head h3 { margin: 0; }
.adm-month { display: flex; align-items: center; gap: 4px; }
.adm-month b { min-width: 130px; text-align: center; }
.adm-log { display: grid; }
.adm-log-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.adm-log-row:last-child { border-bottom: 0; }
.adm-log-row small { flex: none; text-align: right; color: var(--muted); font-size: 12.5px; }
.adm-log-detail { margin-top: 2px; color: var(--muted); overflow-wrap: anywhere; }
.danger-text { color: var(--danger); }

/* ---- innstillinger: seksjoner med rader ---- */
.settings { display: grid; gap: 26px; max-width: 760px; }
.set-sec h2 { margin: 0 4px 8px; font-size: 12.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.set-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; }
.set-row[hidden] { display: none; }
.set-card > * + * { border-top: 1px solid var(--line-2); }
label.set-row { cursor: pointer; }
label.set-row:hover { background: var(--surface-2); }
.set-text { flex: 1; min-width: 0; display: block; cursor: inherit; }
.set-text b { display: block; font-size: 15px; font-weight: 650; }
.set-text small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.set-input { width: 260px; flex: none; }
.set-input.num { width: 76px; text-align: right; }
.set-unit { display: flex; align-items: center; gap: 8px; flex: none; font-weight: 650; color: var(--muted); }
.set-btns { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.set-foot { margin: 8px 4px 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.tgl { -webkit-appearance: none; appearance: none; position: relative; width: 46px; height: 28px; margin: 0; border-radius: 999px; background: #D7DAE6; cursor: pointer; flex: none; transition: background .18s; }
.tgl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .18s; }
.tgl:checked { background: var(--accent); }
.tgl:checked::after { transform: translateX(18px); }
.set-more summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 650; color: var(--accent-ink); }
.set-more summary::-webkit-details-marker { display: none; }
.set-more summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; margin-right: 4px; }
.set-more[open] summary::after { transform: rotate(-135deg); }
.set-more > div { padding: 0 18px 16px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.set-more p { margin: 0 0 10px; }
.set-more ul { margin: 0 0 10px; padding-left: 20px; }
.set-more li + li { margin-top: 4px; }
@media (max-width: 599px) {
  .set-row.stack { flex-direction: column; align-items: stretch; gap: 10px; }
  .set-row.stack .set-input { width: 100%; }
  .set-row { padding: 13px 16px; }
}

/* ---- ønsker: oversikten for lederen ---- */
.wish-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: -6px 0 16px; font-size: 14px; color: var(--muted); }
.wlegend { display: inline-flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: 13px; }
.wlegend i { display: inline-block; width: 12px; height: 12px; margin-right: -4px; border-radius: 4px; background: #F1F2F6; border: 1px solid var(--line); }
.wlegend i.yes { background: #DDF5EA; border-color: #BFE8D4; }
.wlegend i.no { background: #FDE7E7; border-color: #F6CACA; }
.wish-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 599px) { .wish-overview { grid-template-columns: 1fr; } }
.wish-card { display: flex; flex-direction: column; gap: 14px; }
.wish-card.empty-wish { background: var(--surface-2); box-shadow: none; }
.wdl { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 9px 12px; align-items: center; margin: 0; }
.wdl dt { font-size: 11.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.wdl dd { margin: 0; font-size: 14px; font-weight: 600; min-width: 0; }
.wcells { display: flex; gap: 4px; }
.wcells span { flex: 1; min-width: 0; height: 26px; display: grid; place-items: center; padding: 0 4px; border-radius: 7px; background: #F1F2F6; color: var(--muted);
  font-size: 11.5px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcells span.yes { background: #DDF5EA; color: #11734B; }
.wcells span.no { background: #FDE7E7; color: #A3282C; }
.wish-card .wish-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; font-style: italic; color: var(--muted); }


/* Safari på iPhone zoomer inn når man trykker i et felt med tekst under
   16 px, og zoomer ikke ut igjen (siden blir bredere enn skjermen). På
   berøringsskjerm har alle felt derfor minst 16 px. */
@media (pointer: coarse) {
  input:where(:not([type=checkbox]):not([type=radio]):not([type=hidden])), textarea, select,
  .linkbox input, .ap-times input { font-size: 16px; }
}

/* Skifti-admin på mobil: tabellene blir ett kort per bedrift, med etikett
   på hver verdi, og ingenting rulles sidelengs. */
@media (max-width: 699px) {
  .adm .card { padding: 16px; }
  .adm .rp-table-wrap { overflow: visible; margin: 0; padding: 0; }
  .adm-cards, .adm-cards tbody, .adm-cards tfoot { display: block; width: 100%; white-space: normal; }
  .adm-cards thead { display: none; }
  .adm-cards tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
  .adm-cards td { display: block; padding: 0; border: 0; text-align: left !important; min-width: 0; overflow-wrap: anywhere; }
  .adm-cards td.adm-name { grid-column: 1 / -1; }
  .adm-cards td[data-label="Status"] { grid-column: span 2; }
  .adm-cards .badge { white-space: nowrap; }
  .adm-cards td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 10.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
  .adm-cards tbody tr:hover td { background: transparent; }
  .adm-cards tfoot tr { grid-template-columns: 1fr auto; border-bottom: 0; }
  .adm-cards tfoot td { border-top: 0; }
  .adm-name small { max-width: none; white-space: normal; }
  .adm-log-row { flex-direction: column; gap: 4px; }
  .adm-log-row small { text-align: left; }
  .adm-month b { min-width: 0; }
}


/* Autofordeling: trykk på en ansatt for å se alle ønskene */
button.ap-who { width: 100%; padding: 0; margin: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ap-chev { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; color: var(--muted); transition: transform .15s, background .15s; }
.ap-chev .ic { width: 18px; height: 18px; }
button.ap-who:hover .ap-chev { background: var(--surface-2); }
.ap-person.is-open .ap-chev { transform: rotate(180deg); }
.ap-person.is-open .ap-who small { display: none; }
.ap-wishes { margin: 12px 0 4px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.ap-wishes .wchip { font-size: 12.5px; }
.ap-wish-note { margin: 10px 0 0; font-size: 13.5px; font-style: italic; color: var(--text); }
.ap-wish-note:first-child { margin-top: 0; }
.ap-wish-when { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
/* Innstillinger: fristen for å gi bort eller bytte */
#releaseRow .set-text { flex: 1; min-width: 0; }
#releaseRow .picker { flex: none; width: 168px; }
@media (max-width: 520px) { #releaseRow { flex-wrap: wrap; } #releaseRow .picker { width: 100%; } }
.choice.is-off { cursor: default; background: var(--surface-2); }
.choice.is-off:hover { border-color: var(--line); background: var(--surface-2); }
.choice.is-off > .ic:first-child { color: var(--faint); }
.choice.is-off b { color: var(--muted); }

/* ---- chat ----------------------------------------------------------------- */
.side-top .chatbtn { margin-left: auto; }
.chatbtn { border: 0; background: transparent; cursor: pointer; font: inherit; padding: 0; }
.chat {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: 420px; max-width: 100vw; display: flex; flex-direction: column;
  background: #fff; border-left: 1px solid var(--line); box-shadow: -18px 0 48px rgba(17, 21, 43, .16);
  transform: translateX(104%); transition: transform .2s ease-out;
}
.chat.in { transform: none; }
.chat[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .chat { transition: none; } }
.chat-head { display: flex; align-items: center; gap: 6px; min-height: 60px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line); flex: none; }
.chat-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.chat-title small { display: block; margin-top: 1px; font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-title-row b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title-row .chat-row-ic { width: 26px; height: 26px; }
.chat-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.chat-ic:hover { background: var(--surface-2); color: var(--text); }
.chat-ic .ic { width: 20px; height: 20px; }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 8px 20px; -webkit-overflow-scrolling: touch; }
.chat-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 4px 4px; }
.chat-qbtn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid rgba(79, 107, 237, .22); border-radius: 12px; background: var(--accent-soft);
  color: var(--accent-ink); font: inherit; font-size: 13.5px; font-weight: 700; text-align: left; cursor: pointer; }
.chat-qbtn:hover { border-color: rgba(79, 107, 237, .45); }
.chat-qbtn .ic { width: 18px; height: 18px; flex: none; }
.chat-sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 10px 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.chat-sec small { font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 4px; }
.chat-sec-add { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 0; border-radius: 8px; background: none; color: var(--accent-ink);
  font: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: 0; text-transform: none; cursor: pointer; }
.chat-sec-add:hover { background: var(--accent-soft); }
.chat-sec-add .ic { width: 14px; height: 14px; }
.chat-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; }
.chat-row:hover { background: var(--surface-2); }
.chat-row[hidden] { display: none; }
.chat-row .grow { min-width: 0; }
.chat-row b { display: block; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row small { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.unread b { font-weight: 800; }
.chat-row.unread small { color: var(--text); font-weight: 500; }
.chat-row-ic { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 9px; background: var(--surface-2); color: var(--muted); }
.chat-row-ic .ic { width: 17px; height: 17px; }
.chat-row.bc .chat-row-ic { background: var(--warn-soft); color: var(--warn-ink); }
.chat-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.chat-row-meta time { font-size: 11.5px; color: var(--faint); }
.chat-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; line-height: 20px; text-align: center; }
.chat-read { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.chat-read .ic { width: 13px; height: 13px; }
.chat-read.all { color: var(--green, #11734B); }
.chat-empty { margin: 4px 10px; font-size: 13.5px; color: var(--muted); }
.chat-search { padding: 4px 4px 8px; }
.chat-search input { height: 40px; }
/* meldingene */
.chat-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 10px; -webkit-overflow-scrolling: touch; }
.chat-msgs > .loading { padding: 30px; }
.chat-older { display: block; margin: 6px auto 10px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.chat-start { padding: 26px 18px 14px; }
.chat-start .ic { width: 30px; height: 30px; padding: 9px; box-sizing: content-box; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); }
.chat-start b { display: block; margin-top: 12px; font-size: 18px; }
.chat-start p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.chat-day { display: flex; align-items: center; margin: 14px 0 6px; padding: 0 14px; }
.chat-day::before, .chat-day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.chat-day span { padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 700; color: var(--muted); }
.cm { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 6px 14px; }
.cm:hover { background: var(--surface-2); }
.cm.compact { padding-top: 1px; padding-bottom: 1px; }
.cm-hover-time { padding-top: 3px; font-size: 10.5px; color: var(--faint); text-align: right; opacity: 0; }
.cm:hover .cm-hover-time { opacity: 1; }
.cm-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.cm-meta b { font-size: 14.5px; }
.cm-meta time { font-size: 11.5px; color: var(--faint); }
.cm-role { padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; letter-spacing: .02em; }
.cm-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; background: var(--warn-soft); color: var(--warn-ink); font-size: 11px; font-weight: 700; }
.cm-tag .ic { width: 12px; height: 12px; }
.cm-text { font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.cm-text a { color: var(--accent-ink); }
.cm-text.deleted { font-style: italic; color: var(--faint); }
.cm.bc .cm-text { margin-top: 3px; padding: 8px 11px; border-radius: 10px; background: var(--warn-soft); }
.cm-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.cm-react { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.cm-react span { font-size: 12px; font-weight: 700; color: var(--muted); }
.cm-react.on { border-color: rgba(79, 107, 237, .5); background: var(--accent-soft); }
.cm-react.on span { color: var(--accent-ink); }
.cm-tools { position: absolute; right: 12px; top: -14px; z-index: 2; display: none; gap: 1px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.cm-tools button { display: grid; place-items: center; width: 30px; height: 28px; border: 0; border-radius: 7px; background: none; font-size: 15px; cursor: pointer; color: var(--muted); }
.cm-tools button:hover { background: var(--surface-2); }
.cm-tools .ic { width: 17px; height: 17px; }
@media (hover: hover) { .cm:hover .cm-tools { display: flex; } }
.cm-seen { display: flex; align-items: center; gap: 3px; padding: 0 14px 4px 60px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cm-seen .ic { width: 13px; height: 13px; color: var(--green, #11734B); }
/* skrivefeltet */
.chat-compose { display: flex; align-items: flex-end; gap: 8px; flex: none; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.chat-compose textarea { flex: 1; min-height: 42px; max-height: 140px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; resize: none; font: inherit; font-size: 15px; line-height: 1.35; }
.chat-compose textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 107, 237, .14); }
.chat-send { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 0; border-radius: 12px; background: var(--accent); color: #fff; cursor: pointer; }
.chat-send:disabled { opacity: .5; }
.chat-send .ic { width: 19px; height: 19px; }
/* skjemaene: gruppe og kunngjøring */
.chat-form { padding: 14px 14px 24px; }
.chat-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 15px; resize: vertical; }
.chat-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.chat-form-actions .btn-danger { margin-right: auto; }
.chat-check { cursor: pointer; }
.chat-check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.chat-seg { display: flex; margin-bottom: 12px; }
.chat-seg button { flex: 1; }
.chat-when { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chat-date { height: 40px; margin-bottom: 10px; }
.chat-aud { margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.chat-aud > .loading { padding: 8px; }
.chat-aud-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13.5px; }
.chat-aud-head span { color: var(--muted); }
.chat-aud-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-aud-p { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chat-aud-p small { margin-left: 5px; font-weight: 500; color: var(--muted); }
.chat-aud .chat-empty { margin: 0; }
.chat-bc-body { margin: 6px 6px 4px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); font-size: 14.5px; line-height: 1.45; }
/* telefon og appen: hele skjermen */
@media (max-width: 899px), (max-height: 559px) {
  .chat { width: 100%; z-index: 60; border-left: 0; box-shadow: none; padding-top: env(safe-area-inset-top); height: 100%; height: 100dvh; }
  body.chat-open { overflow: hidden; }
  .chat-compose textarea, .chat-search input, .chat-form textarea { font-size: 16px; }
}

/* ---- tidslinje (Gantt) ---------------------------------------------------- */
.gt-wrap { position: relative; overflow: auto; max-height: calc(100vh - 236px); min-height: 220px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-sm); }
.gt { --name: 210px; position: relative; min-width: 100%; }
.gt-day { min-width: calc(var(--name) + var(--hours) * 46px + 40px); }
/* Dagen: luft på hver side av timeaksen, så klokkeslettene i kantene ikke kuttes. */
.gt-day .gt-axis, .gt-day .gt-track { margin: 0 20px; }
.gt-week { min-width: calc(var(--name) + var(--days) * 124px); }
.gt-head, .gt-cover, .gt-row { display: grid; grid-template-columns: var(--name) minmax(0, 1fr); }
.gt-head { position: sticky; top: 0; z-index: 6; height: 40px; background: #fff; border-bottom: 1px solid var(--line); }
.gt-week .gt-head { height: 54px; }
.gt-corner { position: sticky; left: 0; z-index: 2; display: flex; align-items: flex-end; padding: 0 14px 10px; background: #fff; border-right: 1px solid var(--line);
  font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.gt-corner.sub { align-items: center; padding-bottom: 0; background: var(--surface-2); }
.gt-axis { position: relative; min-width: 0; }
.gt-tick { position: absolute; bottom: 10px; transform: translateX(-50%); font-size: 11.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.gt-tick.sub { bottom: 4px; font-size: 10.5px; color: var(--faint); }
.gt-dayhead { position: absolute; top: 0; height: 36px; padding: 8px 10px 0; border: 0; border-left: 1px solid var(--line); background: none; font: inherit; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; }
.gt-dayhead:first-child { border-left: 0; }
.gt-dayhead b { font-size: 13.5px; }
.gt-dayhead small { margin-left: 6px; font-size: 11.5px; color: var(--muted); }
.gt-dayhead.is-today b { color: var(--accent-ink); }
.gt-dayhead:hover b { text-decoration: underline; }
.gt-cover { position: sticky; top: 40px; z-index: 5; height: 26px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.gt-cov { position: absolute; top: 3px; bottom: 3px; display: grid; place-items: center; border-left: 2px solid var(--surface-2); border-radius: 4px; background: var(--accent-soft);
  font-size: 11.5px; font-weight: 800; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.gt-cov.zero { background: transparent; }
.gt-row { border-bottom: 1px solid var(--line-2); }
.gt-row:last-of-type { border-bottom: 0; }
.gt-row:hover .gt-emp, .gt-row:hover .gt-track { background-color: #FAFBFE; }
.gt-row.drop-on .gt-track { background: var(--accent-soft); }
.gt-row.is-dim { opacity: .45; }
.gt-row.is-open .gt-emp b { color: var(--muted); }
.gt-emp { position: sticky; left: 0; z-index: 3; display: flex; align-items: center; gap: 8px; min-width: 0; height: 100%; min-height: 34px; padding: 0 12px; background: #fff; border-right: 1px solid var(--line); }
.gt-emp .grow { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.gt-emp b { min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-emp small { flex: none; font-size: 11.5px; color: var(--faint); }
.gt-emp .av { width: 24px; height: 24px; font-size: 10px; flex: none; }
.gt-track { position: relative; min-width: 0; }
.gt.can-edit .gt-track { cursor: copy; }
.gt-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); pointer-events: none; }
.gt-line.day { background: var(--line); }
.gt-todaybg { position: absolute; top: 0; bottom: 0; background: rgba(79, 107, 237, .045); pointer-events: none; }
.gt-now { position: absolute; top: 0; bottom: 0; z-index: 2; width: 2px; margin-left: -1px; background: var(--danger); pointer-events: none; }
.shift.shift-tl { position: absolute; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 0 8px; overflow: hidden; border-radius: 7px; border-left: 3px solid var(--c);
  white-space: nowrap; font-size: 12px; line-height: 1; }
.shift-tl .gt-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.shift-tl .gt-pos { min-width: 0; overflow: hidden; text-overflow: ellipsis; opacity: .8; }
.shift-tl .ic { width: 13px; height: 13px; flex: none; }
.shift-tl.size-xs { padding: 0 4px; }
.shift-tl.size-xs .gt-pos { display: none; }
.shift-tl.is-cut { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.shift-tl.is-cont { border-left-style: dashed; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.shift-tl .rz { position: absolute; top: 0; bottom: 0; width: 8px; z-index: 2; cursor: ew-resize; }
.shift-tl .rz-l { left: -2px; }
.shift-tl .rz-r { right: 0; }
.shift-tl.drag-preview { z-index: 5; opacity: .92; box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 35%, transparent); pointer-events: none; }
button.shift.shift-tl:hover { transform: none; z-index: 4; box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 30%, transparent); }
.gt-unav { position: absolute; top: 3px; bottom: 3px; z-index: 0; display: flex; align-items: center; padding-left: 6px; overflow: hidden; border: 1px dashed rgba(229, 72, 77, .45); border-radius: 7px;
  background: repeating-linear-gradient(135deg, rgba(229, 72, 77, .1) 0 6px, transparent 6px 12px); font: inherit; font-size: 10.5px; font-weight: 700; color: var(--danger); white-space: nowrap; cursor: pointer; }
.gt-unav.is-pending { border-color: rgba(214, 140, 30, .5); color: var(--warn-ink); background: repeating-linear-gradient(135deg, rgba(214, 140, 30, .1) 0 6px, transparent 6px 12px); }
.gt-more { display: inline-flex; align-items: center; gap: 6px; margin: 10px 12px 12px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; position: sticky; left: 12px; }
.gt-more .ic { width: 16px; height: 16px; }
@media (max-width: 899px), (max-height: 559px) {
  .gt { --name: 118px; }
  .gt-wrap { max-height: calc(100dvh - 300px); }
  .gt-emp { padding: 0 8px; gap: 6px; }
  .gt-emp .av { display: none; }
  .gt-emp small { display: none; }
  .gt-emp b { font-size: 12.5px; }
  .gt-day { min-width: calc(var(--name) + var(--hours) * 52px + 40px); }
}
/* For mange samtidig i kalenderoppsettet, måneden og listen på mobil */
.tg-more { position: absolute; z-index: 2; display: grid; place-items: center; padding: 0; border: 1.5px dashed rgba(79, 107, 237, .45); border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.tg-more:hover { background: #E3E9FF; }
.cap-hint { margin-bottom: 12px; }
.mg-more { display: block; width: 100%; margin-top: 4px; padding: 5px 8px; border: 1px dashed var(--line); border-radius: 8px; background: #fff;
  color: var(--accent-ink); font: inherit; font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; }
.mg-more:hover { background: var(--accent-soft); }
.ag-more { display: flex; align-items: center; justify-content: center; gap: 6px; width: calc(100% - 20px); margin: 4px 10px 10px; padding: 9px; border: 1px dashed var(--line);
  border-radius: 12px; background: #fff; color: var(--accent-ink); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.ag-more .ic { width: 16px; height: 16px; }

/* Tidslinjen: rader per ansatt eller per posisjon. */
.tl-group { flex: none; }
.gt-posrow .pos-dot { width: 12px; height: 12px; flex: none; border-radius: 4px; background: var(--c); }


/* ---- kompetanse og bemanningsmal */
.pos-badge { gap: 5px; padding-left: 7px; }
.pos-badge .dot { width: 8px; height: 8px; margin: 0; box-shadow: none; }
#compPrimary .field { margin: 12px 0 0; }
.st-lead { margin: -2px 0 10px; }
.st-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.st-rows:empty { display: none; }
.st-row { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.st-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.st-top .time-wrap { width: 104px; }
.st-top input.time-input { height: 36px; font-size: 14.5px; }
.st-break { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; font-size: 12.5px; color: var(--muted); }
.st-break input { width: 58px; height: 36px; padding: 0 6px; text-align: center; }
.st-del { margin-left: auto; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.st-del:hover { background: var(--danger-soft, #FDECEC); color: var(--danger); }
.st-del .ic { width: 17px; height: 17px; }
.st-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.st-days label { display: grid; gap: 3px; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.st-days input { width: 100%; height: 38px; padding: 0; text-align: center; font-size: 15px; font-weight: 700; -moz-appearance: textfield; }
.st-days input::-webkit-outer-spin-button, .st-days input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.st-days input[value="0"] { color: var(--faint); font-weight: 500; }

/* Fordel automatisk: bemanningsmalen eller åpningstiden */
.ap-mode { margin: -2px 0 14px; }
.ap-mode button { display: grid; gap: 1px; height: auto; padding: 8px 10px; text-align: center; }
.ap-mode button b { font-size: 14px; }
.ap-mode button small { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.ap-tlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-bottom: 12px; }
.ap-tpos { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.ap-tpos .dot { grid-row: span 2; width: 10px; height: 10px; box-shadow: none; margin: 0; }
.ap-tpos b { font-size: 13.5px; }
.ap-tpos small { font-size: 12px; color: var(--muted); }
.ap-tpos.is-empty small { color: var(--warn-ink, #A16207); }
.ap-day.is-tpl { grid-template-columns: 150px 1fr auto; }
.ap-posum { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; margin: 4px 0 18px; }
.ap-posrow { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.ap-posrow .dot { width: 10px; height: 10px; box-shadow: none; margin: 0; }
.ap-posrow > span:not(.dot):not(.ap-posopen) { color: var(--muted); }
.ap-posopen { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--success, #15803D); }
.ap-posopen .ic { width: 14px; height: 14px; }
.ap-posrow.has-open .ap-posopen { color: var(--warn-ink, #A16207); }
.ap-spos { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: color-mix(in srgb, var(--c) 70%, #1E2235); }
.ap-spos .dot { width: 8px; height: 8px; margin: 0; box-shadow: none; }
.ap-fillmark { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.ap-pday-d { display: block; padding: 0; }
.ap-pday-d > summary { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; list-style: none; }
.ap-pday-d > summary::-webkit-details-marker { display: none; }
.ap-pday-d > summary .ic { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.ap-pday-d[open] > summary .ic { transform: rotate(180deg); }
.ap-pcount { font-size: 13px; color: var(--muted); }
.ap-pday-d .ap-pslots { padding: 0 0 10px 76px; }
@media (max-width: 899px), (max-height: 559px) {
  .ap-day.is-tpl { grid-template-columns: 84px minmax(0, 1fr); }
  .ap-day.is-tpl .ap-split { grid-column: 2; grid-row: 1; }
  .ap-pday-d .ap-pslots { padding-left: 0; }
  .st-top .time-wrap { flex: 1; width: auto; min-width: 0; }
  .st-top .time-wrap > .ic { display: none; }
  .st-top input.time-input { padding: 0 6px; text-align: center; font-size: 16px; }
  .ap-tlist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-break { margin-left: 0; }
}
#compHint { margin: 8px 0 0; }

/* Automatisk fordeling: over hele skjermen mens forslaget lages. */
.work-ov { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 80% at 20% 0%, rgba(111, 134, 245, .97), rgba(52, 58, 170, .97) 55%, rgba(98, 62, 206, .97));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff; opacity: 0; transition: opacity .25s ease; }
.work-ov.show { opacity: 1; }
body.work-lock { overflow: hidden; }
.work-in { width: min(400px, 100%); text-align: center; transform: translateY(10px); transition: transform .35s cubic-bezier(.2, .9, .3, 1); }
.work-ov.show .work-in { transform: none; }
.work-board { margin: 0 auto 30px; padding: 16px 16px 18px; border-radius: 22px; background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 24px 60px rgba(14, 12, 60, .35); }
.work-days, .work-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.work-days { margin-bottom: 10px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; color: rgba(255, 255, 255, .72); }
.work-slot { display: block; height: 18px; border-radius: 7px; background: rgba(255, 255, 255, .1); transform: scale(.55); opacity: .7;
  transition: transform .38s cubic-bezier(.2, 1.5, .4, 1), background-color .25s, opacity .25s; }
.work-slot.on { background: var(--c); transform: scale(1); opacity: 1; box-shadow: 0 3px 10px rgba(10, 8, 50, .25), inset 0 0 0 1px rgba(255, 255, 255, .35); }
.work-title { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.work-title .ic { width: 26px; height: 26px; animation: wand-wave 1.4s ease-in-out infinite; transform-origin: 20% 80%; }
.work-ov.done .work-title .ic { animation: none; }
.work-step { min-height: 22px; margin-top: 10px; font-size: 15.5px; color: rgba(255, 255, 255, .86); transition: opacity .22s, transform .22s; }
.work-step.out { opacity: 0; transform: translateY(-6px); }
.work-bar { width: 230px; height: 6px; margin: 24px auto 0; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .2); }
.work-bar i { display: block; width: 0; height: 100%; border-radius: inherit; background: #fff; transition: width .35s ease; }
@keyframes wand-wave { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-14deg); } 60% { transform: rotate(10deg); } }
@media (prefers-reduced-motion: reduce) {
  .work-slot, .work-in, .work-step { transition: none; }
  .work-title .ic { animation: none; }
}


/* Fordel automatisk: bemanning for én dato, og forslaget i tidslinjen */
.ap-staff { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 8px 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ap-staff:hover { border-color: #C9CEDD; background: var(--accent-soft); }
.ap-staff .ic { width: 15px; height: 15px; flex: none; color: var(--muted); }
.ap-staff small { font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.ap-staff.is-set { border-color: rgba(79, 107, 237, .45); background: var(--accent-soft); }
.ap-staff.is-set .ic { color: var(--accent-ink); }
.ap-day.is-staffed { border-color: rgba(79, 107, 237, .35); }
.sd-lead { margin: -8px 0 14px; font-size: 13.5px; }
.sd-pos { margin-bottom: 12px; }
.sd-poshead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.sd-poshead .dot { width: 10px; height: 10px; margin: 0; box-shadow: none; }
.sd-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 34px; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; }
.sd-row.is-changed, .sd-row.is-extra { border-color: rgba(79, 107, 237, .35); background: var(--accent-soft); }
.sd-when b { display: block; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.sd-when small { font-size: 12px; color: var(--muted); }
.sd-base { font-weight: 700; color: var(--accent-ink); }
.sd-tag { font-weight: 700; color: var(--accent-ink); }
.sd-count { display: inline-flex; align-items: center; gap: 4px; }
.sd-count button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 18px; font-weight: 700; line-height: 1; color: var(--text); cursor: pointer; }
.sd-count button:hover { background: var(--accent-soft); }
.sd-count input { width: 48px; height: 34px; padding: 0; text-align: center; font-size: 15px; font-weight: 700; -moz-appearance: textfield; }
.sd-count input::-webkit-outer-spin-button, .sd-count input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sd-row .st-del { margin: 0; }
.sd-new { display: grid; gap: 8px; padding: 10px; margin-bottom: 8px; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgba(79, 107, 237, .35); }
.sd-newtop { display: flex; align-items: center; gap: 8px; }
.sd-newtop .picker { flex: 1; min-width: 0; }
.ap-tlbtn { justify-self: start; align-self: start; margin-bottom: 2px; }
dialog.dlg-wide { width: min(1100px, calc(100vw - 48px)); }
.ap-tl .sheet-head { flex-wrap: wrap; margin-bottom: 12px; }
.ap-tlnav { margin-left: auto; }
.ap-tlnav button:disabled { opacity: .35; cursor: default; }
.ap-tlbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
.ap-tlbar .hint { margin: 0; }
.ap-tl .gt-wrap { max-height: calc(100vh - 260px); }
@media (max-width: 899px), (max-height: 559px) {
  .ap-day.is-tpl .ap-split { min-width: 0; }
  .ap-staff { padding: 4px 8px; font-size: 12.5px; }
  .ap-staff small { display: none; }
  .sd-row { grid-template-columns: minmax(0, 1fr) auto 30px; gap: 8px; padding: 7px 8px; }
  .sd-count input { font-size: 16px; }
  dialog.dlg-wide { width: 100%; }
  .ap-tl .gt-wrap { max-height: calc(92dvh - 230px); }
}
.ap-people-box:not([hidden]) { margin-top: 12px; }
.ap-people-box .ap-lead { margin: 0 0 12px !important; }

/* ---- ansatte: tabell på PC, kort på mobil */
.emp-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.emp-search { position: relative; flex: 1 1 280px; max-width: 420px; }
.emp-search .ic { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; margin-top: -8.5px; color: var(--muted); pointer-events: none; }
.emp-search input { width: 100%; height: 42px; padding-left: 38px; }
.emp-pick { width: 210px; }
.emp-pick .picker-btn { min-height: 42px; }
.emp-count { margin-left: auto; font-size: 13px; color: var(--muted); }
.emp-table-wrap { padding: 4px 0; overflow-x: auto; }
.emp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.emp-table th { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.emp-table th button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; }
.emp-table th.is-sorted button { color: var(--text); }
.emp-table th button .ic { width: 13px; height: 13px; }
.emp-table th.num, .emp-table td.num { text-align: right; }
.emp-table th.num button { flex-direction: row-reverse; }
.emp-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.emp-table tbody tr { cursor: pointer; }
.emp-table tbody tr:last-child td { border-bottom: 0; }
.emp-table tbody tr:hover td, .emp-table tbody tr:focus-visible td { background: var(--surface-2); }
.emp-table tbody tr:focus-visible { outline: none; }
.emp-table tr.is-inactive td { color: var(--muted); }
.emp-table tr.is-inactive .av { opacity: .55; }
.emp-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.emp-who { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.emp-who b { display: block; font-weight: 700; }
.emp-who small { display: block; font-size: 12.5px; color: var(--muted); }
.emp-poss { display: flex; flex-wrap: wrap; gap: 4px; }
.emp-pos { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 7px; border-radius: 999px; font-size: 12px; font-weight: 650; background: color-mix(in srgb, var(--c) 10%, #fff); color: color-mix(in srgb, var(--c) 60%, #1E2235); white-space: nowrap; }
.emp-pos .dot { width: 7px; height: 7px; margin: 0; box-shadow: none; }
.emp-pos.is-main { font-weight: 800; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); }
.emp-more { font-size: 12px; font-weight: 700; color: var(--muted); align-self: center; }
.emp-ok { font-size: 13px; color: var(--muted); }
.emp-table td .badge { white-space: nowrap; }
.emp-go { width: 28px; color: var(--faint); }
.emp-go .ic { width: 16px; height: 16px; }
.emp-cards { display: none; }
@media (max-width: 899px), (max-height: 559px) {
  .emp-table-wrap { display: none; }
  .emp-cards { display: grid; }
  .emp-search { flex-basis: 100%; max-width: none; }
  .emp-pick { flex: 1 1 0; width: auto; min-width: 0; }
  .emp-count { flex-basis: 100%; margin: 0; }
}

/* ---- Fordel automatisk: ansatte i grupper, én kompakt rad hver */
.ap-psearch { display: block; max-width: 360px; margin: 0 0 12px; }
.ap-groups { display: grid; gap: 8px; }
.ap-grp { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.ap-grp > summary { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; list-style: none; border-radius: 14px; }
.ap-grp > summary::-webkit-details-marker { display: none; }
.ap-grp > summary:hover { background: var(--surface-2); }
.ap-grp > summary .dot { width: 10px; height: 10px; margin: 0; box-shadow: none; }
.ap-grp > summary b { font-size: 14.5px; }
.ap-grp > summary small { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-grp > summary > .ic { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; flex: none; }
.ap-grp[open] > summary > .ic { transform: rotate(180deg); }
.ap-grp[open] > summary { border-bottom: 1px solid var(--line-2); border-radius: 14px 14px 0 0; }
.ap-grp .ap-people { display: block; padding: 2px 6px 4px; }
.ap-grp .ap-person { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: center; column-gap: 18px; padding: 6px 8px; border: 0; border-radius: 10px; }
.ap-grp .ap-person + .ap-person { border-top: 1px solid var(--line-2); border-radius: 0; }
.ap-grp .ap-person[hidden] { display: none; }
.ap-grp .ap-who { padding: 2px 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.ap-grp div.ap-who { cursor: default; }
.ap-grp .ap-who .av { width: 30px; height: 30px; font-size: 11px; }
.ap-grp .ap-who b { font-size: 14px; }
.ap-grp .ap-weight { display: grid; grid-template-columns: minmax(0, 1fr) 128px; align-items: center; gap: 12px; margin: 0; }
.ap-grp .ap-weight .slider-top { order: 2; min-height: 0; margin: 0; justify-content: flex-start; }
.ap-grp .ap-weight .slider-top output { font-size: 13px; font-weight: 700; }
.ap-grp .ap-wishes { grid-column: 1 / -1; margin: 6px 0 4px 40px; }
.ap-grp .ap-fair { padding: 10px 14px 12px; gap: 6px; }
.ap-fgroups { margin-bottom: 4px; }
@media (max-width: 899px), (max-height: 559px) {
  .ap-grp .ap-person { grid-template-columns: minmax(0, 1fr); row-gap: 4px; padding: 8px 6px; }
  .ap-grp .ap-weight { grid-template-columns: minmax(0, 1fr) 112px; }
  .ap-grp .ap-wishes { margin-left: 0; }
  .ap-psearch { max-width: none; }
}
.ap-grp .ap-frow { grid-template-columns: 150px minmax(0, 1fr) 230px; }
.ap-grp .ap-fval { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.ap-grp .ap-fval small { display: inline; }
@media (max-width: 899px), (max-height: 559px) {
  .ap-grp .ap-frow { grid-template-columns: 92px minmax(0, 1fr) 76px; }
  .ap-grp .ap-fval { display: block; }
  .ap-grp .ap-fval small { display: block; }
}
/* Rolle og posisjoner i listene i Fordel automatisk */
.ap-namerow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ap-namerow .emp-poss { gap: 4px; }
.ap-who .ap-namerow b { display: inline; }
.ap-role { height: 20px; padding: 0 8px; font-size: 11px; }
.ap-allpos { font-size: 12px; color: var(--muted); }
.ap-frow { grid-template-columns: 140px minmax(0, 250px) minmax(0, 1fr) 170px; }
.ap-grp .ap-frow { grid-template-columns: 150px minmax(0, 270px) minmax(0, 1fr) 230px; }
.ap-fposs { flex-wrap: nowrap; overflow: hidden; }
@media (max-width: 1199px) { .ap-fposs .emp-pos:not(.is-main):nth-child(n+3) { display: none; } }
@media (max-width: 899px), (max-height: 559px) {
  .ap-fposs { display: none; }
  .ap-frow, .ap-grp .ap-frow { grid-template-columns: 92px minmax(0, 1fr) 76px; }
}

/* Ansattdialogen i to kolonner på PC */
@media (min-width: 900px) and (min-height: 560px) {
  dialog:has(.emp-cols) { width: min(960px, calc(100vw - 48px)); padding: 28px 32px; }
  .emp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; align-items: start; }
  .emp-col > :last-child { margin-bottom: 0; }
  .emp-cols + .invite-box, .emp-cols + .hint { margin-top: 16px; }
}

/* ---- stempling (Mine vakter) */
.clock-slot:empty { display: none; }
.clock-slot { display: grid; gap: 10px; margin-bottom: 14px; }
.clock { padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm, 0 1px 3px rgba(22, 28, 61, .06)); }
.clock.is-in { background: #ECFDF3; border-color: #A7E8C3; }
.clock-top { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.clock-dot { width: 10px; height: 10px; border-radius: 50%; background: #16A34A; box-shadow: 0 0 0 4px rgba(22, 163, 74, .18); animation: clockpulse 2s ease-in-out infinite; }
@keyframes clockpulse { 50% { box-shadow: 0 0 0 7px rgba(22, 163, 74, .08); } }
.clock-run { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; color: #166534; }
.clock-meta { margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.clock-btn { width: 100%; margin-top: 12px; justify-content: center; background: var(--accent); color: #fff; border: 0; }
.clock-btn:hover { filter: brightness(1.05); }
.clock-btn.out { background: #16A34A; }
.clock-free { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line); background: transparent; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.clock-free:hover { background: var(--surface-2); }
.clock-free .ic { width: 20px; height: 20px; color: var(--accent); }
.clock-free b { display: block; font-size: 14px; }
.clock-free small { display: block; font-size: 12.5px; color: var(--muted); }
.clock-list { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.clock-list-head { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.clock-row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.clock-row:first-of-type { border-top: 0; }
.clock-date { font-weight: 700; }
.clock-times { font-variant-numeric: tabular-nums; color: var(--muted); }
.tpill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 750; white-space: nowrap; }
.tpill .ic { width: 12px; height: 12px; }
.tpill.ok { background: #E7F8EE; color: #166534; }
.tpill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.tpill.bad { background: var(--danger-soft); color: #B42318; }

/* ---- timer (leder) */
.row3 { display: grid; grid-template-columns: 1fr 1fr 110px; gap: 12px; }
.tdlg-sub { margin: -8px 0 12px; }
.tdlg-quick { margin: -4px 0 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.danger-text { color: var(--danger) !important; }
.tcmp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.tcmp small { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tcmp b { font-variant-numeric: tabular-nums; }
.tdevs { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tdev { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 750; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tdev.big { background: var(--warn-soft); color: var(--warn-ink); }
.tsum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tsum .stat.warn strong { color: var(--warn-ink); }
.tfilters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ttable-wrap { padding: 4px 0; overflow-x: auto; }
.ttable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ttable th { padding: 10px 12px; text-align: left; font-size: 11.5px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ttable td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-variant-numeric: tabular-nums; }
.ttable tr.tday td { padding: 14px 12px 6px; font-size: 12.5px; font-weight: 800; color: var(--text); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ttable tr.is-missing td { background: color-mix(in srgb, var(--warn-soft) 45%, #fff); }
.ttable .emp-who { min-width: 200px; }
.ttable .emp-who small { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tact { text-align: right; white-space: nowrap; }
@media (max-width: 899px), (max-height: 559px) {
  .tsum { grid-template-columns: 1fr 1fr; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 > .field:last-child { grid-column: 1 / -1; }
  .ttable thead { display: none; }
  .ttable, .ttable tbody, .ttable tr, .ttable td { display: block; }
  .ttable tr:not(.tday) { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
  .ttable td { padding: 0; border: 0; }
  .ttable td:first-child { grid-column: 1 / -1; }
  .ttable .tact { grid-column: 2; grid-row: 2 / span 3; align-self: center; }
  .ttable .emp-who { min-width: 0; }
}
.tcard .acard-actions { flex-wrap: wrap; }
.more-link { margin: -4px 0 18px; }
@media (max-width: 899px), (max-height: 559px) {
  .ttable td[data-l]::before { content: attr(data-l); display: inline-block; width: 74px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
  .ttable td:empty { display: none; }
}
/* Vakt på en posisjon den ansatte ikke står oppført på */
.shift.no-comp { box-shadow: inset 0 0 0 1.5px #E5A13A; }
.shift.no-comp .conflict-ic { color: #B7791F; }

/* ---- kalenderabonnement (Meg) */
.cal-card h3 { display: flex; align-items: center; gap: 8px; }
.cal-card h3 .ic { width: 18px; height: 18px; color: var(--accent); }
.cal-card > .muted { margin: -6px 0 12px; }
.cal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cal-link { display: flex; gap: 6px; align-items: center; }
.cal-link input { flex: 1; min-width: 0; height: 40px; }
.cal-card .hint { margin: 10px 0 4px; }
.cal-hint { margin-top: 12px; }

/* Sveip i uke og måned: innholdet glir inn fra siden */
@keyframes calSlideNext { from { transform: translateX(28px); opacity: .35; } to { transform: none; opacity: 1; } }
@keyframes calSlidePrev { from { transform: translateX(-28px); opacity: .35; } to { transform: none; opacity: 1; } }
.cal-slide-next > :not(.pagehead):not(.subtools):not(.fab) { animation: calSlideNext .26s ease-out; }
.cal-slide-prev > :not(.pagehead):not(.subtools):not(.fab) { animation: calSlidePrev .26s ease-out; }
@media (prefers-reduced-motion: reduce) { .cal-slide-next > *, .cal-slide-prev > * { animation: none !important; } }

/* ---- vaktplan på mobil: dato øverst, flytende linje nederst ---------------- */
.calhead-m { margin: 6px 0 12px; }
.calhead-row { display: flex; align-items: flex-start; gap: 10px; }
.calhead-row .pagehead-title { flex: 1; min-width: 0; }
.calhead-row h1 { margin: 0; font-size: 26px; letter-spacing: -.03em; line-height: 1.15; }
.calhead-row p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.calhead-nav { display: flex; align-items: center; gap: 6px; padding-top: 2px; }
.today-pill { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 14px; font-weight: 700; color: var(--accent-ink); cursor: pointer; box-shadow: var(--shadow-sm); }
.stepper-sm button { width: 36px; height: 34px; padding: 0; }
.wstrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 10px -10px 0; touch-action: pan-y; }
.wsd { display: grid; justify-items: center; gap: 4px; padding: 2px 0 4px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wsd-wd { font-size: 11.5px; font-weight: 750; color: var(--muted); }
.wsd.is-wkend .wsd-wd { color: var(--faint); }
.wsd-num { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background .15s, color .15s; }
.wsd.is-today .wsd-num { color: var(--accent); font-weight: 800; }
.wsd.is-sel .wsd-num { background: var(--text); color: #fff; font-weight: 750; }
.wsd.is-sel.is-today .wsd-num { background: var(--accent); }

.calbar { position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 4px; padding: 5px; max-width: calc(100vw - 16px);
  background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(214, 219, 234, .9); border-radius: 18px; box-shadow: 0 10px 30px rgba(22, 28, 61, .16); }
.calbar-seg { padding: 3px; border-radius: 13px; }
.calbar-seg button { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.calbar-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 13px; background: transparent; color: var(--text); cursor: pointer; }
.calbar-btn .ic { width: 20px; height: 20px; }
.calbar-btn.on { color: var(--accent); background: var(--accent-soft); }
.calbar-btn.primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(79, 107, 237, .4); }
.calbar-btn .fcount { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; line-height: 16px; }
@media (max-width: 899px), (max-height: 559px) {
  main:has(.calbar) { padding-bottom: calc(var(--tab-h) + 96px + env(safe-area-inset-bottom)); }
  /* Kalenderen nesten kant til kant */
  main:has(.calhead-m) .tgrid-wrap, main:has(.calhead-m) .gt-wrap, main:has(.calhead-m) .mcal, main:has(.calhead-m) .agenda { margin-left: -12px; margin-right: -12px; border-radius: 14px; }
  main:has(.calhead-m) .tgrid-wrap.is-day { height: calc(100vh - 330px); height: calc(100dvh - 330px); min-height: 360px; }
  /* Dagen står i linjen over; raden øverst i rutenettet trengs bare når noen ikke kan jobbe */
  main:has(.wstrip) .tgrid-day .tg-corner, main:has(.wstrip) .tgrid-day .wg-day:not(:has(.wg-unav)) { display: none; }
}

/* Chat og varsler øverst på mobil: like store som navnesirkelen, og på linje */
button.bell { padding: 0; border: 0; background: none; font: inherit; line-height: 0; cursor: pointer; }
@media (max-width: 899px), (max-height: 559px) {
  .mobile-right { gap: 4px; }
  .mobilebar .bell { width: 42px; height: 42px; border-radius: 13px; color: var(--text); }
  .mobilebar .bell .ic { width: 28px; height: 28px; }
  .mobilebar .bell-badge { top: 1px; right: 0; }
  .mobileme .av-md { width: 40px; height: 40px; font-size: 14px; }
}

/* Liggende telefon: lav skjerm. Mobiloppsettet (også når skjermen er over
   900 px bred), smalere linjer øverst og nederst, og plass til hakket på siden. */
@media (max-height: 559px) and (orientation: landscape) {
  :root { --tab-h: 50px; }
  .tabbar { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .tabbar a { flex-direction: row; gap: 8px; font-size: 13px; }
  .tabbar a .ic { width: 21px; height: 21px; }
  .mobilebar { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 6px; }
  .topstack { position: static; }  /* linjen øverst ruller bort, så kalenderen får høyden */
  .calhead-m { margin: 2px 0 8px; }
  .calhead-row h1 { font-size: 22px; }
  .wstrip { margin-top: 6px; }
  .wsd-num { width: 32px; height: 32px; font-size: 16px; }
  main:has(.calhead-m) .tgrid-wrap.is-day { height: calc(100dvh - 120px); min-height: 260px; }
  main:has(.calhead-m) .gt-wrap { max-height: calc(100dvh - 120px); min-height: 260px; }
  .calbar { bottom: calc(var(--tab-h) + 8px + env(safe-area-inset-bottom)); }
}

/* ---- kom i gang ----------------------------------------------------------- */
.ob { display: grid; gap: 18px; max-width: 980px; }
.ob-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 20px;
  padding: 28px 30px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, #4F6BED 0%, #6C5CF0 55%, #8B5CF6 100%); box-shadow: 0 18px 40px rgba(79, 107, 237, .28); }
.ob-kicker { display: inline-block; font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.ob-hero h1 { margin: 8px 0 8px; font-size: 30px; line-height: 1.12; letter-spacing: -.035em; }
.ob-hero p { margin: 0; font-size: 15.5px; opacity: .92; max-width: 46ch; }
.ob-progress { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.ob-pbar { flex: 1; max-width: 280px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.ob-pbar i { display: block; height: 100%; border-radius: 4px; background: #FFD166; }
.ob-progress b { font-size: 13.5px; }
.ob-hero-art { position: relative; height: 150px; }
.ob-hero-art i { position: absolute; height: 46px; border-radius: 23px; background: rgba(255, 255, 255, .9); box-shadow: 0 8px 20px rgba(17, 12, 60, .2); }
.ob-hero-art i:first-child { left: 0; top: 22px; width: 150px; }
.ob-hero-art i:nth-child(2) { left: 46px; top: 84px; width: 150px; background: rgba(255, 255, 255, .6); }
.ob-hero-art b { position: absolute; left: 168px; top: 26px; width: 38px; height: 38px; border-radius: 50%; background: #FFD166; }
.ob-steps { display: grid; gap: 10px; }
.ob-step { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.ob-step > summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.ob-step > summary::-webkit-details-marker { display: none; }
.ob-step > summary b { display: block; font-size: 16px; }
.ob-step > summary small { display: block; font-size: 13px; color: var(--muted); }
.ob-step > summary > .ic { width: 18px; height: 18px; color: var(--muted); transition: transform .15s; }
.ob-step[open] > summary > .ic { transform: rotate(180deg); }
.ob-num { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
.ob-step.is-done .ob-num { background: #16A34A; color: #fff; }
.ob-step.is-done .ob-num .ic { width: 18px; height: 18px; stroke-width: 2.6; }
.ob-step.is-done > summary b { color: var(--muted); }
.ob-body { padding: 0 18px 18px 66px; font-size: 14.5px; color: var(--text); }
.ob-body > p { margin: 0 0 10px; line-height: 1.55; }
.ob-label { margin: 14px 0 6px !important; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ob-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ob-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px dashed #C9CFE3; background: #fff; font: inherit; font-size: 13.5px; font-weight: 650; color: var(--accent-ink); cursor: pointer; }
.ob-chip:hover { background: var(--accent-soft); border-style: solid; }
.ob-chip .ic { width: 15px; height: 15px; }
.ob-chip.is-have { border: 0; cursor: default; color: color-mix(in srgb, var(--c) 65%, #1E2235); background: color-mix(in srgb, var(--c) 12%, #fff); }
.ob-chip.is-have .dot { width: 9px; height: 9px; margin: 0; box-shadow: none; }
.ob-inline { display: flex; gap: 8px; margin-top: 10px; max-width: 460px; }
.ob-inline input { flex: 1; min-width: 0; height: 40px; }
.ob-list { margin: 4px 0 12px; padding-left: 18px; line-height: 1.55; }
.ob-list li { margin: 4px 0; }
.ob-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ob-example { margin: 4px 0 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); max-width: 520px; }
.ob-ex-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ob-ex-head .dot { width: 10px; height: 10px; margin: 0; box-shadow: none; }
.ob-ex-head small { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.ob-ex-row { display: grid; grid-template-columns: 96px repeat(7, minmax(0, 1fr)); gap: 4px; align-items: end; margin-top: 4px; }
.ob-ex-time { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; padding-bottom: 7px; }
.ob-ex-cell { display: grid; justify-items: center; gap: 2px; padding: 4px 0; border-radius: 8px; background: #fff; border: 1px solid var(--line-2); font-weight: 800; font-size: 14px; }
.ob-ex-cell small { font-size: 10px; font-weight: 700; color: var(--muted); }
.ob-poslist { display: grid; gap: 6px; margin-top: 8px; max-width: 560px; }
.ob-posrow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; text-align: left; cursor: pointer; }
.ob-posrow:hover { background: var(--surface-2); }
.ob-posrow .dot { width: 10px; height: 10px; margin: 0; box-shadow: none; }
.ob-posrow b { display: block; font-size: 14px; }
.ob-posrow small { display: block; font-size: 12.5px; color: var(--muted); }
.ob-go { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.ob-go .ic { width: 15px; height: 15px; }
.ob-h2 { margin: 12px 0 0; font-size: 19px; letter-spacing: -.02em; }
.ob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ob-card { display: block; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.ob-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(22, 28, 61, .08); }
.ob-card-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.ob-card-ic .ic { width: 20px; height: 20px; }
.ob-card b { display: block; font-size: 15px; }
.ob-card p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.ob-foot { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.ob-foot .link-btn { margin: 0; }
.setup-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 16px; border-radius: 16px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #4F6BED, #7C5CFA); box-shadow: 0 10px 24px rgba(79, 107, 237, .25); }
.setup-banner > .ic { width: 22px; height: 22px; flex: none; }
.setup-banner b { display: block; font-size: 15px; }
.setup-banner small { display: block; font-size: 12.5px; opacity: .85; }
.setup-bar { width: 120px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.setup-bar i { display: block; height: 100%; background: #FFD166; }
.set-link { text-decoration: none; color: inherit; }
.set-link > .ic { width: 18px; height: 18px; color: var(--muted); }
@media (max-width: 899px), (max-height: 559px) {
  .ob-hero { grid-template-columns: 1fr; padding: 22px 20px; border-radius: 20px; }
  .ob-hero h1 { font-size: 24px; }
  .ob-hero-art { display: none; }
  .ob-body { padding: 0 16px 16px; }
  .ob-step > summary { padding: 14px 16px; }
  .ob-ex-row { grid-template-columns: 74px repeat(7, minmax(0, 1fr)); }
  .ob-ex-time { font-size: 11px; }
  .setup-bar { display: none; }
  .ob-grid { grid-template-columns: 1fr 1fr; }
}

/* Posisjoner og ønsker som tabell på PC (samme stil som Ansatte) */
.pos-ico.sm { width: 30px; height: 30px; border-radius: 9px; }
.pos-ico.sm .ic { width: 16px; height: 16px; }
.pos-days { display: inline-grid; grid-template-columns: repeat(7, 30px); gap: 3px; }
.pos-days span { display: grid; justify-items: center; padding: 2px 0; border-radius: 7px; background: var(--surface-2); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pos-days span small { font-size: 9.5px; font-weight: 700; color: var(--muted); }
.pos-days span.zero { color: var(--faint); font-weight: 600; background: transparent; }
.emp-table .small { font-size: 12px; }
.wish-table .wcells { flex-wrap: nowrap; }
.wish-note-cell { max-width: 240px; }
.wish-note-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-style: italic; }
@media (min-width: 900px) and (min-height: 560px) {
  .wish-overview.emp-cards, .pgrid.emp-cards { display: none; }
}
.wish-table .wcells span { flex: none; width: 24px; padding: 0; }
.wish-table .emp-table td { white-space: nowrap; padding: 8px 10px; }
.wish-table .emp-table th { padding: 10px; }
.wish-table .emp-who { min-width: 0; }
.wish-table .emp-poss { flex-wrap: wrap; max-width: 190px; }
.wish-table td:last-child { white-space: normal; }
.wnote-ic { display: inline-grid; vertical-align: -2px; color: var(--accent); }
.wnote-ic .ic { width: 15px; height: 15px; }
.wextra { height: 20px; padding: 0 7px; font-size: 11px; }

/* Ansatte: lønnskostnaden denne måneden */
.emp-month { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; align-items: stretch; margin: 0 0 14px; }
.emp-month .emp-month-link { justify-content: center; }
.emp-skifti { text-decoration: none; color: inherit; background: linear-gradient(135deg, #EEF1FF, #F5F0FF); border-color: #DCE2FF; }
.emp-skifti strong { color: var(--accent-ink); }
.emp-month .stat strong { font-size: 22px; }
.emp-month .stat small { font-size: 12px; color: var(--muted); }
.emp-month-link { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: #fff; color: var(--accent-ink); font-weight: 700; font-size: 14px; text-decoration: none; }
.emp-month-link .ic { width: 16px; height: 16px; }
.emp-msub { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 899px), (max-height: 559px) {
  .emp-month { grid-template-columns: 1fr 1fr; }
  .emp-month .stat:nth-child(1) { grid-column: 1 / -1; }
  .emp-month-link { display: none; }
}

/* Ny vakt ved å dra over en tom plass */
.tg-ghost.is-creating { border-style: solid; background: rgba(238, 241, 255, .92); box-shadow: 0 6px 16px rgba(79, 107, 237, .2); z-index: 4; }
.gt-newghost { position: absolute; top: 3px; bottom: 3px; z-index: 4; display: flex; align-items: center; padding: 0 8px; overflow: hidden; white-space: nowrap;
  border: 1.5px solid var(--accent); border-radius: 8px; background: rgba(238, 241, 255, .92); color: var(--accent-ink); font-size: 12px; font-weight: 750; pointer-events: none;
  box-shadow: 0 6px 16px rgba(79, 107, 237, .2); font-variant-numeric: tabular-nums; }

/* ---- avtaler og personvern ------------------------------------------------ */
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 16px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check-row input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.auth-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 16px 0 0; font-size: 13px; }
.auth-legal a { color: var(--muted); text-decoration: none; }
.auth-legal a:hover { color: var(--accent-ink); text-decoration: underline; }
.legal-doc { font-size: 15px; line-height: 1.6; color: var(--text); }
.legal-doc h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.legal-doc .meta { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.legal-doc .lead { color: var(--muted); font-size: 16px; }
.legal-doc h2 { margin: 26px 0 6px; font-size: 18px; }
.legal-doc h3 { margin: 18px 0 4px; font-size: 15.5px; }
.legal-doc p, .legal-doc li { max-width: 72ch; }
.legal-doc ul { padding-left: 20px; }
.legal-doc li { margin: 3px 0; }
.legal-doc table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 13.5px; }
.legal-doc th, .legal-doc td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--line); }
.legal-doc th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.legal-doc .box { margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); }
.legal-page { max-width: 860px; margin: 0 auto; }
.legal-back { margin: 0 0 10px -8px; }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; font-size: 14.5px; }
.legal-tabs a { color: var(--muted); text-decoration: none; }
.legal-tabs a[aria-current="page"] { color: var(--text); font-weight: 700; }
.legal-page .legal-doc { padding: 28px 32px; }
@media (max-width: 899px), (max-height: 559px) { .legal-page .legal-doc { padding: 20px 18px; } }
@media (min-width: 900px) and (min-height: 560px) { #dlg.dlg-doc { width: min(820px, calc(100vw - 32px)); } }
.legal-dlg { max-height: min(70vh, 720px); overflow: auto; margin: -4px -4px 8px; padding: 4px; }
.terms-gate { max-width: 860px; margin: 0 auto; padding: 8px 0 40px; }
.terms-card { padding: 30px 32px; }
.terms-card h1 { margin: 10px 0 6px; font-size: 28px; letter-spacing: -.025em; }
.terms-card .lead { color: var(--muted); }
.terms-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); }
.terms-ic .ic { width: 24px; height: 24px; }
.terms-doc { margin: 18px 0; }
.terms-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.terms-doc-head h2 { margin: 0; font-size: 17px; }
.terms-scroll { max-height: 300px; overflow: auto; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); font-size: 14px; }
.terms-scroll h1, .terms-scroll .meta { display: none; }
.terms-scroll h2 { font-size: 16px; margin-top: 18px; }
.terms-check { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); font-size: 14.5px; }
.terms-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.terms-wait { text-align: left; }
@media (max-width: 899px), (max-height: 559px) { .terms-card { padding: 22px 18px; } .terms-card h1 { font-size: 24px; } .terms-actions .btn-primary { width: 100%; } }
.newco { max-width: 620px; margin: 0 auto; padding: 8px 0 40px; }
.newco-card { padding: 30px 32px; }
.newco-card h1 { margin: 10px 0 6px; font-size: 28px; letter-spacing: -.025em; }
.newco-card .lead { color: var(--muted); }
@media (max-width: 899px), (max-height: 559px) { .newco-card { padding: 22px 18px; } }

/* ---- viktige meldinger ----------------------------------------------------- */
.badge.ok { background: #E3F6EC; border-color: transparent; color: #11653D; }
.annbar { display: flex; flex-direction: column; gap: 10px; max-width: 1600px; margin: 0 auto; padding: 14px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
@media (min-width: 900px) and (min-height: 560px) { .annbar { padding: 22px 36px 0; } }
.ann { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border: 1px solid #F1D48A; border-left: 5px solid #E2A21B; border-radius: 16px;
  background: linear-gradient(180deg, #FFF8E6, #FFF3D6); box-shadow: 0 6px 18px rgba(120, 80, 0, .08); }
.ann-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: #FDE7AE; color: #8A5A00; }
.ann-ic .ic { width: 22px; height: 22px; }
.ann-text { flex: 1; min-width: 0; }
.ann-text b { display: block; font-size: 16.5px; color: #4A3200; }
.ann-text p { margin: 4px 0 6px; white-space: pre-line; color: #3D2F10; line-height: 1.5; overflow-wrap: anywhere; }
.ann-text small { color: #8A6A2A; font-size: 12.5px; }
.ann .btn { flex: none; align-self: center; }
@media (max-width: 899px), (max-height: 559px) {
  .ann { flex-wrap: wrap; padding: 14px; }
  .ann .btn { width: 100%; }
}
.ann-page { max-width: 860px; }
.ann-compose { padding: 20px 22px; }
.ann-compose textarea { min-height: 120px; }
.ann-send { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ann-h { margin: 28px 0 10px; font-size: 18px; }
.ann-item { padding: 16px 18px; margin-bottom: 10px; }
.ann-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ann-item-head b { font-size: 15.5px; margin-right: 6px; }
.ann-item-head small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.ann-body { margin: 8px 0 10px; white-space: pre-line; color: var(--text); overflow-wrap: anywhere; }
.ann-prog { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.ann-bar { flex: 1; min-width: 120px; max-width: 260px; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.ann-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.ann-who { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .ann-who { grid-template-columns: 1fr; } }
.ann-who h4 { margin: 0 0 6px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ann-person { display: inline-flex; align-items: center; gap: 6px; margin: 0 10px 6px 0; font-size: 13.5px; }

/* ---- menyene trukket inn mens man ruller (mobil) ------------------------- */
.tabmini { display: none; }
@media (max-width: 899px), (max-height: 559px) {
  .mobilebar, .mobilebar .logo, .mobile-right, .tabbar, .calbar { transition: background-color .22s, box-shadow .22s, opacity .2s, transform .24s cubic-bezier(.2, .8, .2, 1); }
  body.chrome-min .mobilebar { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
  body.chrome-min .mobilebar .logo { opacity: 0; transform: translateY(-8px); }
  body.chrome-min .mobile-right { pointer-events: auto; padding: 3px; border-radius: 999px; transform: scale(.88); transform-origin: right center;
    background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 6px 20px rgba(22, 28, 61, .16), 0 0 0 1px rgba(214, 219, 234, .8); }
  body.chrome-min .tabbar { transform: translateY(calc(100% + 4px)); pointer-events: none; }
  body.chrome-min .calbar { transform: translate(-50%, calc(var(--tab-h) + 90px)); pointer-events: none; }
  body.authed .tabmini { position: fixed; z-index: 31; left: max(14px, env(safe-area-inset-left)); bottom: calc(14px + env(safe-area-inset-bottom));
    display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    color: var(--accent); background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 8px 24px rgba(22, 28, 61, .18), 0 0 0 1px rgba(214, 219, 234, .8);
    opacity: 0; transform: scale(.6) translateY(20px); pointer-events: none; transition: opacity .2s, transform .24s cubic-bezier(.2, .8, .2, 1); }
  body.authed .tabmini[hidden] { display: none; }
  body.authed .tabmini .ic { width: 24px; height: 24px; stroke-width: 2.1; }
  body.chrome-min .tabmini { opacity: 1; transform: none; pointer-events: auto; }
}
/* Dag og tidslinje på mobil (stående) ruller inne i en boks. Når menyene er
   trukket inn, glir overskriften opp der linjen øverst var, og boksen vokser
   ned over plassen menyen nederst brukte. */
@media (max-width: 899px) and (min-height: 560px) {
  main:has(.calhead-m), .content:has(.calhead-m) > #annbar, .content:has(.calhead-m) > #askbar { transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
  main:has(.calhead-m) .tgrid-wrap.is-day, main:has(.calhead-m) .gt-wrap { transition: height .24s cubic-bezier(.2, .8, .2, 1), max-height .24s cubic-bezier(.2, .8, .2, 1); }
  body.chrome-fit:not(.day-float) main:has(.calhead-m), body.chrome-fit:not(.day-float) .content:has(.calhead-m) > #annbar, body.chrome-fit:not(.day-float) .content:has(.calhead-m) > #askbar { transform: translateY(-59px); }
  body.chrome-fit main:has(.calhead-m) .today-pill { opacity: 0; pointer-events: none; }
  body.chrome-fit main:has(.calhead-m) .tgrid-wrap.is-day { height: calc(100dvh - 166px); }
  body.chrome-fit main:has(.calhead-m) .gt-wrap { max-height: calc(100dvh - 151px); }
  body.chrome-fit main:has(.calhead-m) .grid-hint { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mobilebar, .mobilebar .logo, .mobile-right, .tabbar, .calbar, .tabmini { transition: none !important; }
  main:has(.calhead-m), main:has(.calhead-m) .tgrid-wrap.is-day, main:has(.calhead-m) .gt-wrap { transition: none !important; }
}

/* Dagskalenderen på mobil (stående): fast over hele skjermen under toppen, med
   overskrift og ukelinje oppå (se floatDay i app.js). */
@media (max-width: 899px) and (min-height: 560px) {
  body.day-float main .calhead-m { position: relative; z-index: 4; margin: -4px -16px 0; padding: 10px 16px 8px; background: var(--bg); transition: background-color .2s; }
  body.day-float main .calhead-row { position: relative; }
  body.day-float main .calhead-row .pagehead-title { transform-origin: left top; transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
  body.day-float main .wstrip { transition: opacity .18s, transform .24s cubic-bezier(.2, .8, .2, 1); }
  body.day-float main #tgrid.is-day { position: fixed; z-index: 2; left: 4px; right: 4px; top: var(--cal-top); bottom: 0; height: auto; min-height: 0; margin: 0;
    padding-top: var(--cal-pad); padding-bottom: calc(var(--tab-h) + 84px + env(safe-area-inset-bottom)); border-radius: 0; border-width: 0; box-shadow: none; transition: none; }
  body.day-float main .grid-hint { display: none; }
  /* Bare kalenderen ruller; siden står stille (og spretter ikke). */
  html:has(body.day-float), body.day-float { overflow: hidden; overscroll-behavior: none; }
  body.day-float main #tgrid.is-day { overscroll-behavior: contain; }
  body.day-float.chrome-min main .calhead-m { background: transparent; pointer-events: none; }
  body.day-float.chrome-min main .calhead-row .pagehead-title { transform: translateY(var(--title-dy)) scale(var(--title-s)); }
  body.day-float.chrome-min main .wstrip { opacity: 0; transform: translateY(-16px); }
  body.day-float.chrome-min main .today-pill { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  body.day-float main .calhead-row .pagehead-title, body.day-float main .wstrip { transition: none !important; }
}

.terms-kicker { display: block; margin-top: 12px; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.ob-terms-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.ob-terms-row small { display: block; color: var(--muted); font-size: 13px; }
