/* Telefon and Telefoni (js/views/phone.js, admin-phone.js) and the call panel over every page (js/call-panel.js). */

/* The call in progress: above the page and the mail dock, clear of the phone's bottom bar. */
.call-panel {
  position: fixed;
  right: var(--space-4);
  top: var(--space-4);
  z-index: 40;
  display: grid;
  gap: var(--space-2);
  width: min(340px, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-raised);
  box-shadow: var(--shadow-2);
}

/* Where the caller dragged it (movable.js), never so far that its head leaves the window when the window shrinks. Later
   than .app--assistant .call-panel in components.css, so the place wins over the corner beside the assistant. */
.call-panel.is-moved {
  right: auto;
  left: clamp(0px, var(--move-x), calc(100vw - 3rem));
  top: clamp(0px, var(--move-y), calc(100dvh - 3rem));
}

.call-panel[hidden],
.call-panel [hidden] {
  display: none;
}

/* The grip, the title, and the X once the call is over; the whole head drags the panel. */
.call-panel__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  cursor: grab;
  touch-action: none;
}

.call-panel.is-moving,
.call-panel.is-moving * {
  cursor: grabbing;
  user-select: none;
}

.call-panel__head .move-grip {
  flex: none;
  margin: calc(-1 * var(--space-2)) 0 calc(-1 * var(--space-2)) calc(-1 * var(--space-2));
  cursor: inherit;
}

.call-panel__title {
  flex: 1;
  margin: 0;
  font-weight: 600;
}

.call-panel__digits {
  margin: 0;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}

.call-panel__digits:empty {
  display: none;
}

.call-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.call-panel__keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-1);
}

.phone-status {
  margin: 0;
  color: var(--ink-muted);
}

.phone-status[data-status="registered"] {
  color: var(--success);
}

.phone-status[data-status="failed"] {
  color: var(--danger);
}

.phone-dial {
  display: grid;
  gap: var(--space-2);
  max-width: 34rem;
}

.phone-dial__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.phone-dial__row .input {
  flex: 1;
  min-width: 10rem;
}

/* The user's AI switch and instructions (views/phone.js), in the dial row beside Ring op. */
.phone-ai {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.phone-ai__editor {
  display: grid;
  gap: var(--space-2);
}

.phone-ai__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.phone-people,
.phone-voicemail,
.phone-hits,
.phone-sounds {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.phone-person,
.phone-message,
.phone-hit,
.phone-sound {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.phone-person__name,
.phone-hit > :nth-child(2) {
  flex: 1;
  min-width: 10rem;
  font-weight: 600;
}

.phone-hit > :nth-child(2) {
  font-weight: 400;
}

.phone-person__ext {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.phone-person__presence {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-s);
}

.phone-presence {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--success);
}

.phone-presence .ui-icon svg {
  width: 16px;
  height: 16px;
}

.phone-message__head {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.phone-message audio,
.phone-sound audio {
  max-width: 100%;
}

.phone-player-slot:empty {
  display: none;
}

.phone-player {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.phone-player h3,
.phone-player p {
  margin: 0;
}

/* Played through the waveform's controls (.phone-wave-player); the element itself stays out of sight. */
.phone-player__audio {
  display: none;
}

.phone-player__sides {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  border: 0;
}

.phone-player__sides legend {
  float: left;
  margin-right: var(--space-2);
  color: var(--ink-muted);
}

.phone-player__solo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

/* The waveform player (recording-player.js): play, the call's two channels, the time. The played part is the same
   bars again in full colour, clipped to --progress. */
.phone-wave-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
}

.phone-wave__play {
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}

.phone-wave {
  position: relative;
  height: 56px;
  border-radius: var(--radius-m);
  cursor: pointer;
  --progress: 0%;
}

.phone-wave:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.phone-wave--flat::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 2px;
  background: var(--line);
}

.phone-wave__layer,
.phone-wave__layer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.phone-wave__layer path {
  fill: var(--ink-muted);
  opacity: 0.35;
}

.phone-wave__layer--played {
  clip-path: inset(0 calc(100% - var(--progress)) 0 0);
}

.phone-wave__layer--played path {
  opacity: 1;
}

.phone-wave__layer--played .phone-wave__left {
  fill: var(--ink);
}

.phone-wave__layer--played .phone-wave__right {
  fill: var(--accent);
}

.phone-wave--flat .phone-wave__layer--played {
  inset: calc(50% - 1px) auto auto 0;
  width: var(--progress);
  height: 2px;
  clip-path: none;
  background: var(--accent);
}

.phone-wave__time {
  color: var(--ink-muted);
  font-size: var(--text-s);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* A conversation: the caller (left channel) on the left, the callee (right channel) on the right. */
.phone-transcript {
  display: grid;
  gap: var(--space-2);
}

/* In a school's or customer's activity a long call reads in its own scroll, so the history around it stays short. */
.timeline__item--recording .phone-transcript {
  max-height: 20rem;
  overflow-y: auto;
}

/* The AI's recap of a call, open above its player and folded transcript (call-activity.js). */
.call-recap {
  margin-block: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-m);
  background: var(--surface-wash);
}

.call-recap__head {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-weight: 600;
}

.call-recap__text {
  white-space: pre-line;
}

.phone-line--now {
  border-color: var(--accent);
}

.phone-line {
  max-width: 80%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-wash);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.phone-line > :last-child {
  display: block;
}

.phone-line--right {
  justify-self: end;
  background: var(--accent-soft);
}

.phone-line:hover {
  border-color: var(--line-hover);
}

.phone-line__who {
  font-weight: 600;
}

.phone-line__at {
  margin-left: var(--space-2);
  color: var(--ink-muted);
  font-size: var(--text-s);
  font-variant-numeric: tabular-nums;
}

.phone-sip {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-1) var(--space-3);
  margin: 0;
}

.phone-sip dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.phone-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.phone-menu-options {
  display: grid;
  gap: var(--space-2);
}

.phone-menu-option {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}

.phone-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--space-2);
}

.phone-upload .field {
  flex: 1;
  min-width: 14rem;
}

@media (max-width: 819.98px) {
  .call-panel {
    right: var(--space-3);
    top: var(--space-3);
  }

  .phone-line {
    max-width: 100%;
  }
}

/* --- Ringelister (js/call-lists.js, js/call-page.js) ----------------------------------------------------------- */

.call-lists-view {
  max-width: 1100px;
  container-type: inline-size;
}

/* A list's schools beside the chat with its AI. On a wide screen the page fills the workspace's height: the schools
   scroll on the left and the chat is a side pane from top to bottom, which folds to its button (collapse.js). */
.call-with-chat {
  max-width: none;
}

.call-list__main,
.call-page__main {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  min-width: 0;
}

/* view--fill takes the workspace's margin away; on a phone the pages keep their own. */
.call-list__main,
.call-page__main {
  padding: var(--space-4) var(--space-4) 0;
}

.call-chat {
  padding: var(--space-4);
}

/* Both pages fill the workspace and never scroll as a page (shell.css view--fill): their own parts scroll inside. */
@media (min-width: 820px) {
  .call-list__main,
  .call-page__main {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-5) var(--space-6);
  }
}

@media (min-width: 960px) {
  .call-with-chat {
    --call-chat-col: clamp(300px, 28vw, 440px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--call-chat-col);
    grid-template-rows: minmax(0, 1fr);
  }

  .call-with-chat--collapsed {
    --call-chat-col: 3.25rem;
  }

  .call-chat {
    grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
    min-height: 0;
    padding: var(--space-4);
    border-left: 1px solid var(--line);
    background: var(--surface);
  }

  /* The pane's own height bounds the log here, not the 50vh it has when stacked below the schools. */
  .call-with-chat .call-chat__log {
    max-height: none;
    align-content: start;
  }

  .call-with-chat--collapsed .call-chat {
    padding-inline: var(--space-2);
  }
}

.call-chat__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.call-chat__head h2 {
  margin: 0;
}

.call-with-chat--collapsed .call-chat > :not(.call-chat__head),
.call-with-chat--collapsed .call-chat__head h2 {
  display: none;
}

.call-with-chat--collapsed .call-chat__head {
  justify-content: center;
}

.call-chat {
  display: grid;
  gap: var(--space-3);
}

.call-chat__log {
  display: grid;
  gap: var(--space-2);
  max-height: 50vh;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.call-chat__examples {
  margin: 0;
}

.call-chat__message {
  max-width: 90%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-m);
  background: var(--surface-wash);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.call-chat__message p {
  margin: 0;
}

.call-chat__message--user {
  justify-self: end;
  background: var(--accent-soft);
}

.call-chat__message--error {
  color: var(--danger);
}

.call-chat__status:empty {
  display: none;
}

.call-new {
  display: grid;
  gap: var(--space-3);
}

.call-new__label {
  font-weight: 600;
}

.call-new__actions {
  display: flex;
  justify-content: flex-end;
}

/* The contact lists in columns, like Opgaver's list (js/call-lists.js): the head and every row share one grid, so each
   fact sits under its name. The name is the row's link and takes the whole row. Narrow, the facts wrap under the name
   and the head goes. */
.call-lists__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
}

.call-lists__table {
  /* A column its user resized has its width in --col-<key> (js/column-widths.js), else its own. */
  --call-lists-columns: var(--col-name, minmax(0, 1fr)) var(--col-called, 10rem) var(--col-responsible, minmax(0, 10rem))
    var(--col-createdBy, minmax(0, 8rem)) var(--col-created, 7rem) 2rem;
}

.call-lists__head,
.call-lists__row {
  display: grid;
  grid-template-columns: var(--call-lists-columns);
  align-items: center;
  gap: var(--space-3);
}

.call-lists__head {
  padding: 0 calc(2 * var(--space-2) + 2px) var(--space-2) calc(var(--space-3) + var(--space-2) + 2px);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-2);
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

.call-lists__head[hidden] {
  display: none;
}

.call-lists__row {
  position: relative;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.call-lists__row:hover {
  border-color: var(--line-hover);
}

.call-lists__cell {
  overflow: hidden;
  min-width: 0;
  color: var(--ink-muted);
  font-size: var(--text-s);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-lists__cell--name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
  font-size: inherit;
}

.call-lists__link {
  overflow: hidden;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
}

.call-lists__link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.call-lists__row .row-menu,
.call-lists__cell--responsible {
  position: relative;
  z-index: 1;
}

/* An open menu lies over the rows below it. */
.call-lists__row:has(.row-menu__button[aria-expanded='true']) {
  z-index: 2;
}

@container (max-width: 40rem) {
  .call-lists__head {
    display: none;
  }

  .call-lists__row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: var(--space-1) var(--space-3);
  }

  .call-lists__cell--name {
    grid-column: 1 / -2;
  }

  .call-lists__row .row-menu {
    grid-column: -2;
    grid-row: 1;
  }

  .call-lists__cell--createdBy,
  .call-lists__cell--created {
    display: none;
  }
}

.call-edit {
  display: grid;
  gap: var(--space-2);
}

.call-edit__label {
  font-weight: 600;
}

.call-lists,
.call-items,
.call-people {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Each row is a card on Miira's 3D shelf (components.css, as the call lists' rows have been since 2026-11-10), standing
   on the backdrop Opgaver's cards stand on (tokens.css --board-backdrop), so the cards stand out from it. The heads
   above are indented by the backdrop's padding and border, so each name stays over its column. After the shared
   rule above, whose padding: 0 would undo the backdrop's. An empty one holds its hint, roomy enough to read as a box. */
.call-lists,
.call-items {
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--board-backdrop, var(--surface));
}

.call-lists > .hint,
.call-items > .hint {
  padding: var(--space-4) var(--space-3);
  text-align: center;
}

/* A list's schools in columns (js/call-list-items.js), the head and every row on one grid. The school's name is the
   row's link and takes the whole row; the tick, the main number and × lie above it. Where the columns do not fit (the
   chat beside them, a phone) the facts wrap under the name and the head goes. */
.call-list__main {
  container-type: inline-size;
}

.call-items__table {
  --call-items-columns: 1.25rem var(--col-school, minmax(9rem, 2fr)) var(--col-contact, minmax(8rem, 2fr)) var(--col-phone, 8rem)
    var(--col-stage, 6.5rem) var(--col-students, 4rem) var(--col-estimate, 7rem) var(--col-outcome, 7rem) 2rem;
}

.call-items__head,
.call-items__row {
  display: grid;
  grid-template-columns: var(--call-items-columns);
  align-items: center;
  gap: var(--space-3);
}

.call-items__head {
  padding: 0 calc(2 * var(--space-2) + 2px) var(--space-2) calc(var(--space-3) + var(--space-2) + 2px);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-2);
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

.call-items__head[hidden] {
  display: none;
}

.call-items__row {
  position: relative;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.call-items__row:hover {
  border-color: var(--line-hover);
}

.call-items__cell {
  display: grid;
  overflow: hidden;
  min-width: 0;
  color: var(--ink-muted);
  font-size: var(--text-s);
}

.call-items__cell > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-items__cell--school,
.call-items__cell--contact {
  color: var(--ink);
  font-size: inherit;
}

.call-items__link {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

/* The name with its new tab's link (new-tab.js) after it; the name is cut, the link always shows. */
.call-items__cell > .call-items__name {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  overflow: visible;
}

.call-items__name > .call-items__link {
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-items__link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.call-items__none {
  color: var(--ink-muted);
}

/* Everyone we know at the school in one line, cut off at the column's end and scrolled sideways; above the row's link,
   so it can be scrolled. The person to ask for comes first and is marked. */
.call-items__people {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: 0 0 2px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.call-items__cell > .call-items__people {
  text-overflow: clip;
}

.call-items__person {
  display: grid;
  flex: none;
  max-width: 12rem;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--bg);
}

.call-items__person > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-items__person.is-target {
  border-color: var(--accent);
}

.call-items__tick,
.call-items__phone,
.call-items__remove {
  position: relative;
  z-index: 1;
}

.call-items__phone {
  color: inherit;
}

@container (max-width: 62rem) {
  .call-items__head {
    display: none;
  }

  .call-items__row {
    grid-template-columns: 1.25rem minmax(0, 1fr) minmax(0, 1fr) 2rem;
    gap: var(--space-1) var(--space-3);
  }

  /* The tick and × keep their columns down the whole row, so the facts fill the two in between, two by two. */
  .call-items__tick {
    grid-column: 1;
    grid-row: 1 / span 4;
    align-self: start;
  }

  .call-items__remove {
    grid-column: -2;
    grid-row: 1 / span 4;
    align-self: start;
  }
}

.call-status--building {
  background: var(--accent-soft);
  color: var(--accent-ink-soft);
}

.call-status--failed,
.call-outcome--not_interested,
.call-outcome--wrong_person {
  color: var(--danger);
}

.call-outcome--interested,
.call-outcome--meeting {
  background: var(--accent-soft);
  color: var(--accent-ink-soft);
}

/* The bar over the call page stays in view while the page scrolls, so Next is always one click away. */
.call-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.call-bar--sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

/* The list's name and strip take a row of their own before they are squeezed; Næste and Ring op wrap below them. */
.call-bar__where {
  display: grid;
  flex: 1 1 16rem;
  min-width: 0;
}

/* The school's name, then its list in smaller type (call-page.js). */
.call-bar__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-2);
  min-width: 0;
}

.call-bar__title > strong {
  font-size: var(--text-s);
  color: var(--ink-muted);
}

.call-bar__school {
  font-size: var(--text-l);
  overflow-wrap: anywhere;
}

/* The name opens the school's customer pop-up (call-page.js); it reads as the heading until pointed at. */
.call-bar__school > a {
  color: inherit;
  text-decoration: none;
}

.call-bar__school > a:hover,
.call-bar__school > a:focus-visible {
  text-decoration: underline;
}

.call-bar__nav,
.call-bar__call {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* On a phone, whom Ring op calls goes under Book møde rather than past the screen's edge. */
.call-bar__call {
  flex-wrap: wrap;
  min-width: 0;
}

/* The outcome's select is as wide as its longest choice, not the bar's width. */
.call-bar__outcome > .input {
  width: auto;
}


.call-page__grid {
  display: grid;
  gap: var(--space-4);
  align-items: start;
}

/* Two columns only where the chat pane leaves room for them. There the call page is exactly the window's height: the
   bar stays on top, the school's column scrolls on its own, and on the right the activity takes the whole height and
   scrolls inside its card (Jeppe, 2026-11-10: "keep everything within 100vh"; 2026-11-12). The right column is
   as wide as the caller drags its border (--call-right, call-page.js). A mail being written never pushes the page past
   the window either (Jeppe, 2026-11-12): the history gives way down to a few lines, then the mail's text. */
@media (min-width: 1280px) {
  .call-page__main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .call-page__grid {
    flex: 1 1 0;
    min-height: 0;
    grid-template-columns: minmax(0, 5fr) minmax(0, var(--call-right, 6fr));
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }

  .call-page__left {
    align-content: start;
    min-height: 0;
    overflow-y: auto;
  }

  .call-page__right {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .call-page .call-activity {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }

  .call-page .call-activity > * {
    flex: none;
  }

  .call-page .call-activity__list {
    flex: 1 1 0;
    min-height: 5rem;
    max-height: none;
    align-content: start;
  }

  .call-page .call-activity__box,
  .call-page .work-mail,
  .call-page .work-mail__edit,
  .call-page .work-mail__body {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .call-page .call-activity__box > *,
  .call-page .work-mail > *,
  .call-page .work-mail__edit > *,
  .call-page .work-mail__body > * {
    flex: none;
  }

  .call-page .work-mail > .work-mail__edit,
  .call-page .call-activity__box > .work-mail,
  .call-page .work-mail__edit > .work-mail__body {
    flex: 0 1 auto;
  }

  .call-page .work-mail__review {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  .call-page .work-mail__body > .rich-editor__area {
    flex: 0 1 20rem;
    min-height: 6rem;
    max-height: none;
  }

  .call-page .work-mail__signature {
    max-height: 6rem;
    overflow-y: auto;
  }
}

/* The column border only where there are two columns. */
@media (max-width: 1279px) {
  .call-page__right > .resize-handle {
    display: none;
  }
}

/* A section of the call page sized by its bottom border (call-page.js sized()): --pane-h is the height dragged to, and
   without it the section keeps its natural height. A card scrolls inside the height it was given. */
.call-pane {
  position: relative;
  display: grid;
  min-width: 0;
}

.card.call-pane__sized {
  height: var(--pane-h, auto);
  overflow-y: auto;
}

.call-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.call-section__head h2 {
  margin: 0;
}

.call-page__left,
.call-page__right {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.call-page h1 {
  margin: 0 0 var(--space-2);
}

.call-school__reason {
  display: flex;
  gap: var(--space-2);
}

.call-school__facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  margin: 0;
}

/* The status (call-school.js): the stage's dot from the map's legend before its name; on the call page a button whose
   menu floats over the page from its left edge (row-menu.js places it), the stage chosen marked. */
.call-school__status-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.call-school__status {
  display: inline-block;
}

.call-school__status-button {
  min-height: 30px;
  padding: 0 var(--space-3);
}

.call-school__status .row-menu__choice[aria-checked='true'] {
  background: var(--hover);
  font-weight: 600;
}

.call-school__facts dt {
  color: var(--ink-muted);
}

.call-school__facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The people at the school as a gallery of cards; the one to ask for is marked. A .card's bullet list is indented,
   muted and spaces its items apart, which here greyed the names and set every card after the first lower. */
.card .call-people {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin: var(--space-3) 0 0;
  padding: 0;
  color: var(--ink);
}

.card .call-people > li + li {
  margin-top: 0;
}

/* Avatar beside the text, the actions in a footer across the card's width (Jeppe, 2026-11-11: buttons beside the text
   squeezed it to a few letters a line). Cards in a row are as tall as the tallest, and the footer keeps to the bottom
   so their buttons line up. */
.call-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.call-person--target {
  border-color: var(--accent);
}

.call-person__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  align-content: start;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Outranks .card p + p, whose paragraph spacing pulled the lines of a card far apart. */
.card .call-person__body > p {
  margin: 0;
}

.call-person__name {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  align-items: center;
  margin-bottom: 2px;
  font-weight: 600;
}

.call-person__title {
  color: var(--ink-muted);
  font-size: var(--text-s);
}

.call-person__fact {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--text-s);
}

/* A long address ends in an ellipsis (its whole text in the title) rather than breaking mid-domain. */
.call-person__fact a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-person__fact .ui-icon {
  flex: none;
  color: var(--ink-muted);
}

.call-person__fact .ui-icon svg {
  width: 14px;
  height: 14px;
}

.call-person__actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: var(--space-1);
  align-items: center;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

/* Save as contact keeps to the footer's far end, apart from the call. */
.call-person__actions > .icon-btn {
  margin-inline-start: auto;
}

/* Ring op sits at the footer's start, so its field for another number opens rightwards into the card. */
.call-person .call-split__other {
  inset-inline: 0 auto;
}

/* Personer på skolen, Opgaver and Kort in one card (call-page.js): the tabs and the open segment's add button on top.
   The map fills the height the card is dragged to, and has a height of its own in a card of natural height. */
.call-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.call-sections > .customer-segment {
  flex: 1 0 auto;
}

.call-sections > .customer-segment:has(> .call-map__wrap) {
  grid-template-rows: minmax(0, 1fr);
}

/* Leaflet stacks its panes and controls at z-index 400-1000; isolating the map keeps them inside it, so the page's
   own overlays (the card over a pointed-at dot, pop-ups) are not drawn behind it. */
.call-map {
  min-height: 280px;
  isolation: isolate;
}

.call-activity {
  display: grid;
  gap: var(--space-3);
}

.call-activity__list {
  max-height: 55vh;
  overflow-y: auto;
}

/* Under the history: the switch between a note and a mail, then the chosen form (work-mail.js for the mail). */
.call-activity__box {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.call-person__find {
  padding-block: var(--space-1);
}

.call-map__wrap {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

/* The legend sits in a .card, whose list rules (a top margin, a muted colour, a gap above each item after the first)
   would leave it ragged with space below; the card's padding is all the room it needs beside and under it. */
.call-map__wrap .client-map__legend {
  margin: 0;
  padding: var(--space-2) 0 0;
  color: inherit;
}

.call-map__wrap .client-map__legend li {
  margin: 0;
}

/* Active customers' star, as pipeline-map.js draws it on the map. */
.client-map__dot--star {
  width: 1rem;
  height: 1rem;
  border-radius: 0;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.call-add,
.call-add__manual {
  display: grid;
  gap: var(--space-2);
}

.call-add__manual[hidden] {
  display: none;
}

.call-add > .btn {
  justify-self: start;
}

.call-add__results {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.call-add__option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  width: 100%;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.call-add__option:hover {
  border-color: var(--line-hover);
}

/* A phone search's numbers in the chat: each a small card with its likelihood, why, and its pages. */
.call-chat__candidate {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  white-space: normal;
}

.call-chat__number {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.call-chat__candidate .btn {
  justify-self: start;
}

.call-chat__sources {
  margin: 0;
  padding-inline-start: var(--space-4);
}

.call-likelihood--high {
  background: var(--accent-soft);
  color: var(--accent-ink-soft);
}

.call-likelihood--low {
  color: var(--danger);
}

/* A school's latest history over its dot on the call page's map (pipeline-map.js), on the page so the map does not
   cut it off. */
.call-map__float {
  position: fixed;
  z-index: 60;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-raised);
  box-shadow: var(--shadow-2);
  pointer-events: none;
}

.call-map__float[hidden] {
  display: none;
}

.call-map__tip {
  display: grid;
  gap: var(--space-1);
  width: min(320px, 70vw);
}

.call-map__tip p {
  margin: 0;
}

.call-map__activity {
  font-size: var(--text-s);
}

/* The pop-up over a school clicked on the map (school-card.js): the call page's school, people and history. */
.school-card {
  display: grid;
  gap: var(--space-3);
}

.school-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

/* The school's name as large as the call page's. */
.school-card__head h2 {
  font-size: var(--text-xl);
}

.school-card__actions {
  margin-inline-start: auto;
}

.school-card__grid,
.school-card__column {
  display: grid;
  gap: var(--space-4);
  align-items: start;
  min-width: 0;
}

@media (min-width: 960px) {
  .school-card__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }
}

/* A contact's pop-up (contact-card.js), in the school pop-up's cards: the person and their details on the left, the
   form taking the details' place behind the pencil, their history on the right scrolling inside its card. */
.contact-card .school-card__head h2 {
  margin: 0;
}

.contact-form,
.contact-card__involvement {
  display: grid;
  gap: var(--space-3);
}

.contact-card__involvement > * {
  margin: 0;
}

.contact-card__history .contact-history {
  gap: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.contact-history__item .timeline__body > .btn {
  margin-top: var(--space-1);
}

/* A person's name that opens their pop-up reads as the name, not as a link-coloured button. */
.call-person__open,
.work-contact__open {
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: start;
}

/* How far a contact list has come (js/call-progress.js): every school as a share of one bar, the contacted ones from
   the left by outcome, best and darkest first, on one green ramp; the schools still to call are the track. A 2px gap
   between the parts keeps them apart where colours are close; their counts are always written beside them. */
.call-progress {
  --progress-meeting: var(--success);
  --progress-interested: var(--accent);
  --progress-callback: color-mix(in srgb, var(--accent) 45%, var(--surface));
  --progress-other: var(--ink-muted);
  --progress-rest: var(--line);
}

.call-progress__bar {
  display: flex;
  gap: 2px;
  overflow: hidden;
  min-width: 3rem;
  height: 8px;
  border-radius: 4px;
  background: var(--progress-rest);
}

.call-progress__part,
.call-progress__rest {
  flex-basis: 0;
  min-width: 2px;
}

.call-progress__part--meeting {
  background: var(--progress-meeting);
}

.call-progress__part--interested {
  background: var(--progress-interested);
}

.call-progress__part--callback {
  background: var(--progress-callback);
}

.call-progress__part--other {
  background: var(--progress-other);
}

.call-progress__rest {
  background: var(--progress-rest);
}

.call-progress--row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
}

.call-progress__count {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.call-progress--panel {
  display: grid;
  gap: var(--space-3);
}

.call-progress__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  color: var(--ink-muted);
}

.call-progress__percent {
  color: var(--ink);
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.call-progress__bar--big {
  height: 14px;
  border-radius: 7px;
}

.call-progress__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-s);
}

.call-progress__legend li {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.call-progress__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.call-progress__board h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-s);
}

.call-progress__callers {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.call-progress__callers li {
  display: grid;
  grid-template-columns: 1.5rem minmax(6rem, 10rem) minmax(4rem, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-s);
}

.call-progress__rank {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--progress-rest);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.call-progress__callers .is-leading .call-progress__rank {
  background: var(--accent);
  color: var(--accent-ink);
}

.call-progress__lane {
  height: 6px;
  border-radius: 3px;
  background: var(--progress-rest);
}

.call-progress__reach {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.call-progress__score {
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

@container (max-width: 40rem) {
  .call-progress__callers li {
    grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  }

  .call-progress__lane {
    display: none;
  }
}

/* The call page's place in its list (js/call-progress.js schoolStrip): a step per school, coloured by its outcome, the
   open one raised in the ink colour; each step opens its school. A step never gets narrower than a target worth
   clicking: a long list scrolls sideways instead, padded so the open step's ring is not clipped. */
.call-strip {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.call-strip__text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  font-size: var(--text-s);
}

.call-strip__steps {
  display: flex;
  gap: 2px;
  align-items: center;
  min-height: calc(14px + 2 * var(--space-1));
  padding: var(--space-1) 3px;
  overflow: auto hidden;
  scrollbar-width: thin;
}

.call-strip__step {
  flex: 1 0 0.75rem;
  max-width: 2.5rem;
  height: 8px;
  border-radius: 2px;
}

/* A school not called yet is the track; :where keeps this below the outcome colours, which are named earlier. */
:where(.call-strip__step) {
  background: var(--progress-rest);
}

.call-strip__step:hover {
  height: 12px;
}

.call-strip__step.is-current {
  height: 14px;
  box-shadow: 0 0 0 2px var(--ink);
}

/* Salgsopgaver's tasks (js/sales-tasks.js), in Udviklingsopgaver's list look (components.css .work-board): the task,
   its priority, deadline, customer (only on the overview) and who is responsible, then its delete. A column its user
   resized has its width in --col-<key> (js/column-widths.js). */
.sales-board {
  --work-columns: 1rem 3rem var(--col-task, minmax(8rem, 1fr)) var(--col-priority, 1.25rem) var(--col-deadline, 5.5rem)
    var(--col-organization, var(--work-wide)) var(--col-responsible, minmax(6rem, 10rem)) 2rem;
}

.sales-board--school {
  --work-columns: 1rem 3rem var(--col-task, minmax(6rem, 1fr)) var(--col-priority, 1.25rem) var(--col-deadline, 5.5rem)
    var(--col-responsible, minmax(5rem, 9rem)) 2rem;
}

/* On the call page the list stands in a card whose own box scrolls, so its head does not stick to the page. */
.sales-board--school .status-list__head {
  position: static;
}

/* Fewer columns than Udviklingsopgaver's fit a narrower box, such as the call page's left column, before the facts
   flow after the title. */
@container (max-width: 54rem) {
  .sales-board .status-list__head,
  .sales-board .status-row--cells {
    display: grid;
  }

  /* An empty cell keeps its column's place. */
  .sales-board .status-row__cell:empty {
    display: block;
  }
}

@container (max-width: 26rem) {
  .sales-board .status-list__head {
    display: none;
  }

  .sales-board .status-row--cells {
    display: flex;
    flex-wrap: wrap;
  }

  .sales-board .status-row__cell:empty {
    display: none;
  }
}

.call-lists__tasks {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

/* Salgsopgaver's automatic lists (js/sales-auto.js): each list a group of Salgsopgaver's list, its head in a color of
   its own, its customers in columns: the customer, contract value, estimated value, since when, the AI's certainty. A
   column its user resized has its width in --col-<key> (js/column-widths.js). */
.sales-board.sales-auto-board {
  --work-columns: 1rem 3rem var(--col-customer, minmax(6rem, 1fr)) var(--col-value, 6.5rem) var(--col-estimate, 6.5rem) var(--col-since, 6rem)
    var(--col-probability, 5rem) minmax(2rem, auto);
}

/* The tick stands at the row's end, also when the customer is dragged narrower and the last column takes the rest. */
.sales-auto-board .status-row--cells > .icon-btn {
  justify-self: end;
}

/* Too narrow for the columns: a row's values stand two by two under the customer, each with its column's name, and a
   list's sort and buttons go under its title. */
@container (max-width: 42rem) {
  .sales-auto-board .status-list__head {
    display: none;
  }

  .sales-auto-board .status-row--cells {
    display: grid;
    grid-template-columns: 1rem 3rem minmax(0, 1fr) minmax(0, 1fr) 2rem;
    row-gap: var(--space-1);
  }

  .sales-auto-board .status-row--cells > .status-row__main {
    grid-column: 3 / 5;
  }

  .sales-auto-board .status-row--cells > .icon-btn {
    grid-row: 1;
    grid-column: 5;
  }

  /* The four values are the row's 4th to 7th children: contract and estimate on one line, since and certainty below,
     from the row's start, as a phone shows no number. */
  .sales-auto-board .status-row--cells > .status-row__cell:nth-child(even) {
    grid-column: 1 / 4;
  }

  .sales-auto-board .status-row--cells > .status-row__cell:nth-child(odd) {
    grid-column: 4;
  }

  .sales-auto-board .status-row__cell {
    color: var(--ink-muted);
    font-size: var(--text-xs);
  }

  .sales-auto-board .status-row__cell [data-label]::before {
    content: attr(data-label) ": ";
  }

  .sales-auto-board .status-group__head {
    flex-wrap: wrap;
  }

  .sales-auto-board .status-group__toggle {
    flex-basis: 100%;
  }

  .sales-auto-board .sales-auto__tools {
    margin-left: auto;
  }
}

/* A phone hides a row's number (components.css), so the customer starts at the row's edge too. */
@media (max-width: 700px) {
  .sales-auto-board .status-row--cells > .work-unfold-room {
    display: none;
  }

  .sales-auto-board .status-row--cells > .status-row__main {
    grid-row: 1;
    grid-column: 1 / 5;
  }
}

.status-tone--auto-0 {
  --tone: #2563eb;
}

.status-tone--auto-1 {
  --tone: #7c3aed;
}

.status-tone--auto-2 {
  --tone: #0d9488;
}

.status-tone--auto-3 {
  --tone: #ea580c;
}

.status-tone--auto-4 {
  --tone: #db2777;
}

.status-tone--auto-5 {
  --tone: #ca8a04;
}

.sales-auto__tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* The search over every column, and on the manual tasks the choice of who is responsible, above Salgsopgaver's lists. */
.sales-toolbar {
  justify-content: flex-start;
  margin-bottom: var(--space-3);
}

.sales-toolbar .work-search {
  max-width: 28rem;
}

/* A column's name in a head that sorts (js/table-sort.js) is cut short beside its arrow. */
.column-head .work-column__sort .column-head__name {
  min-width: 0;
}

.sales-auto__active {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sales-task-form {
  display: grid;
  gap: var(--space-3);
}

.sales-task-form h2 {
  margin: 0;
}

.sales-task__field {
  display: grid;
  gap: var(--space-1);
  font-weight: 600;
}

.sales-task__field > span {
  color: var(--ink-muted);
  font-size: var(--text-s);
}

.sales-task__props {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--space-3);
}

/* Salgsopgaver's booking calendar (call-booking.js): the Kalender in a pop-up nearly as large as the window, the school
   above it, and the people to invite in its event form. The calendar fills the pop-up edge to edge. */
.modal.modal--calendar {
  width: min(1440px, calc(var(--page-width, 100vw) - 2 * var(--space-4)));
  height: calc(var(--page-height, 100dvh) - 2 * var(--space-4));
}

.modal--calendar .modal__body {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.modal--calendar .booking {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
}

.view--calendar.view--booking .booking-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  align-items: baseline;
  padding: 0 var(--space-3) var(--space-2) 0;
}

/* The grid scrolls inside the pop-up: the window less the pop-up's margin, its bar, the school and the toolbar. */
.view--calendar.view--fill.view--booking .cal-grid__scroll {
  max-height: calc(var(--page-height, 100dvh) - 2 * var(--space-4) - 13rem);
}

@media (max-width: 800px) {
  .modal.modal--calendar {
    width: var(--page-width, 100vw);
    height: var(--page-height, 100dvh);
  }

  .modal--calendar .modal__body {
    overflow-y: auto;
  }
}

.cal-invitees {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  border: 0;
}

/* An event's files (calendar-files.js): the heading with its paperclip, then one row per file with its X. */
.cal-files__head {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-s);
  font-weight: 600;
}

.cal-files__list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cal-files__list:empty {
  display: none;
}

.cal-files__item {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.cal-files__item > span:not(.ui-icon) {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
