/* Support inbox (in the shell) and the embedded visitor chat (embed.html). The message bubbles,
   composer and live line are shared so both sides of a conversation look the same. */

.view--wide {
  max-width: none;
}

.support-live:empty {
  display: none;
}

.support-live {
  margin: 0 0 var(--space-3);
  color: var(--danger);
  font-size: var(--text-s);
}

.support-panes {
  display: grid;
  gap: var(--space-4);
}

.support-list-pane,
.support-thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
}

.conv-list-wrap {
  overflow-y: auto;
  min-height: 0;
}

.conv-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.conv-item {
  display: grid;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-3);
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.conv-item:hover {
  background: var(--hover);
}

/* Text on accent-soft must use its paired ink: in the 70s theme the normal ink is cream on mustard. */
.conv-item[aria-current="true"],
.conv-item[aria-current="true"] .hint {
  background: var(--accent-soft);
  color: var(--accent-ink-soft);
}

.conv-item--unread strong {
  font-weight: 800;
}

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

.conv-item__preview {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: var(--text-s);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* A chat's Udviklingsopgave (views/support.js) is a link beside its button, on a line of its own at the item's foot
   that the button keeps free, so it never covers the line above. */
.conv-list__entry {
  position: relative;
}

.conv-item--task {
  padding-bottom: calc(var(--space-3) + 1.5rem);
}

.conv-item__task {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  text-decoration: none;
}

.conv-item__task:hover {
  text-decoration: underline;
}

/* "Ubesvaret": the visitor waits for the team's answer (server/support.js WAITING_SQL). */
.conv-item__waiting {
  color: var(--danger);
}

/* The sort pick (views/support.js sortMenu): its icon is marked while "Ubesvarede først" is on, and the order in use
   is ticked in its menu. */
.support-sort--on {
  background: var(--accent-soft);
  color: var(--accent-ink-soft);
}

.support-sort-menu .row-menu__choice[aria-checked='true'] {
  font-weight: 600;
}

.unread-badge {
  display: inline-block;
  min-width: 1.5em;
  margin-left: var(--space-2);
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--text-xs);
  font-weight: 700;
  text-align: center;
}

.thread-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.thread-head h2 {
  margin: 0;
}

.thread-head p {
  margin: 0;
}

.thread-head .actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.bubbles {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-2) 0 var(--typing-room);
  overflow-y: auto;
  list-style: none;
  min-height: 0;
}

.bubble {
  max-width: min(36rem, 85%);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-m);
  background: var(--surface-raised);
  box-shadow: var(--shadow-1);
}

/* In the inbox the visitor's words sit on the guide's soft fill with a line, not white on white (Jeppe, 2026-10-10). */
.support-thread .bubble:not(.bubble--mine) {
  border: 1px solid var(--line);
  background: var(--surface-wash);
}

.bubble--mine {
  align-self: flex-end;
  background: var(--accent-soft);
  color: var(--accent-ink-soft);
}

/* Dark's light green on the dark green fill read poorly; one's own words are white there (Jeppe, 2026-11-17). Team
   chat's own bubbles (meeting.css .tchat-msg--mine) follow the same rule. */
:root[data-theme="dark"] .bubble--mine {
  color: var(--ink);
}

.bubble__meta {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  opacity: 0.8;
}

.bubble__body {
  margin: var(--space-1) 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble__status {
  font-size: var(--text-xs);
  opacity: 0.8;
}

.bubble__status--failed {
  color: var(--danger);
  opacity: 1;
}

.thread-closed {
  margin: 0;
}

/* Desktop, as in Smartsupp: conversations, the chat and the visitor in one surface filling the workspace height.
   The visitor column needs room; below 1100px it moves behind the Detaljer button. Both side columns are as wide as
   they are dragged (resize-handle.js sets --support-list and --support-visitor, within the same bounds) and fold away
   (collapse.js); the window keeps the final say through the vw ceilings. */
@media (min-width: 820px) {
  .support-panes {
    --support-list-col: clamp(260px, var(--support-list, 22rem), 32vw);
    --support-visitor-col: clamp(240px, var(--support-visitor, 20rem), 30vw);
    grid-template-columns: var(--support-list-col) minmax(0, 1fr);
    gap: 0;
    height: calc(100dvh - 2 * var(--space-6));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    background: var(--surface);
    box-shadow: var(--shadow-1);
  }

  .support-list-pane {
    position: relative;
    padding: var(--space-4) var(--space-3) 0;
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 50%, var(--surface));
  }

  /* Room below the reply field, so it does not sit on the window's edge (Jeppe, 2026-10-10). */
  .support-thread {
    padding: 0 var(--space-4) var(--space-4);
  }

  .support-back {
    display: none;
  }

  .support-visitor {
    position: relative;
  }

  /* Folded, the conversations are their avatars (an unread one ringed) and the visitor pane only its unfold button. */
  .support-panes--list-collapsed {
    --support-list-col: 4.5rem;
  }

  .support-panes--visitor-collapsed {
    --support-visitor-col: 3.25rem;
  }

  .support-panes--list-collapsed .support-list-pane {
    padding-inline: var(--space-2);
  }

  .support-panes--list-collapsed .support-list-head,
  .support-panes--visitor-collapsed .support-visitor__head {
    justify-content: center;
  }

  .support-panes--list-collapsed .conv-item__main {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .support-panes--list-collapsed .support-list-head > .icon-btn:not(.collapse-toggle),
  .support-panes--list-collapsed .support-list-head > .support-sort-slot,
  .support-panes--list-collapsed .support-list-pane > :not(.support-list-head, .conv-list-wrap),
  .support-panes--list-collapsed .conv-list-wrap > :not(.conv-list),
  .support-panes--visitor-collapsed .support-visitor > :not(.support-visitor__head) {
    display: none;
  }

  .support-panes--list-collapsed .conv-item__task {
    display: none;
  }

  .support-panes--list-collapsed .conv-item {
    grid-template-columns: auto;
    justify-content: center;
    padding: var(--space-2);
  }

  .support-panes--list-collapsed .conv-item--unread .conv-item__avatar {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  }
}

@media (min-width: 1100px) {
  .support-panes {
    grid-template-columns: var(--support-list-col) minmax(0, 1fr) var(--support-visitor-col);
  }

  .support-details {
    display: none;
  }
}

/* Doubled class: the pane's own rule further down would otherwise show it again, below the reply field on phones. */
@media (max-width: 1099.98px) {
  .support .support-visitor {
    display: none;
  }
}

/* The search's icon is a phone's (below); a wide screen always shows the field. */
.support-search-toggle {
  display: none;
}

/* Mobile: list, then thread, with a back affordance (docs/DESIGN.md). */
@media (max-width: 819.98px) {
  .support[data-pane="list"] .support-thread,
  .support[data-pane="thread"] .support-list-pane {
    display: none;
  }

  .support[data-pane="thread"] .support-thread {
    height: calc(100dvh - 12rem - env(safe-area-inset-bottom));
  }

  /* One column no wider than the screen: a long name or line in the header is cut short instead of widening the page. */
  .support-panes {
    grid-template-columns: minmax(0, 1fr);
  }

  .support .collapse-toggle,
  .support .resize-handle {
    display: none;
  }

  /* The filled workspace drops the page margin; on a phone the list and chat need it back. */
  .support {
    padding-inline: var(--space-3);
  }

  /* The settings, Åben/Lukket and the search share the list's first row, to leave the room to the conversations
     (Jeppe, 2026-11-13); the rest of the pane stands below it, full width. */
  .support-list-pane {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-content: start;
    align-items: center;
    column-gap: var(--space-2);
    padding-top: var(--space-3);
  }

  .support-list-pane > * {
    grid-column: 1 / -1;
  }

  .support-list-pane > .support-list-head,
  .support-list-pane > .tabs,
  .support-list-pane > input[type="search"],
  .support-list-pane > .support-search-toggle {
    grid-row: 1;
    align-self: center;
  }

  .support-list-pane > .support-list-head {
    grid-column: 1;
  }

  .support-list-pane > .tabs {
    grid-column: 2;
  }

  .support-list-pane > input[type="search"] {
    grid-column: 3;
    min-width: 0;
  }

  .support-list-pane > .support-search-toggle {
    display: inline-flex;
    grid-column: 4;
  }

  /* The search shows once its icon is tapped (views/support.js showSearch). */
  .support-list-pane:not(.support-list-pane--searching) > input[type="search"] {
    display: none;
  }

  /* The list runs down the page, which scrolls as on every other phone page: the panes' screen height
     (components.css) is the open conversation's alone. */
  .support[data-pane="list"] .support-panes {
    height: auto;
  }

  /* An open conversation has the whole screen, as in Chat (views/support.js focusScreen; meeting.css hides the top
     bar and the bottom menu): its header at the top, the field on the bottom edge clear of the home indicator. */
  body.chat-focus .support[data-pane="thread"] .support-thread {
    height: 100dvh;
    padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
  }
}

/* --- Embedded visitor chat, in Miira's look ------------------------------ */
/* The chat sits inside Miira's pages, so it wears Miira's own palette (from hej.miira.dk's "miira" theme): cream paper,
   warm brown text, sand lines and the yellow accent with brown text, 3D buttons and round 20px cards. Miira's typeface
   (Roobert PRO) is licensed to Miira, so the chat uses the same fallbacks Miira lists after it. Shappa's components
   take these through their usual tokens. */
.chat-page {
  /* The chat speaks only in Miira's tokens (css/miira.css, set live from the page by js/chat-theme.js), so it follows
     every Miira theme, a school's own colours and font included (docs/DESIGN.md, the guide's golden rule 1). Shappa's
     shared components read these names. */
  --bg: var(--miira-bg-primary);
  --surface: var(--miira-bg-surface);
  --surface-raised: var(--miira-bg-input);
  --surface-wash: var(--miira-bg-surface);
  --ink: var(--miira-text-primary);
  --ink-muted: var(--miira-text-secondary);
  --ink-faint: var(--miira-text-muted);
  --line: var(--miira-border-color);
  --line-hover: var(--miira-border-hover);
  --accent: var(--miira-accent);
  --accent-ink: var(--miira-accent-text);
  --accent-text: var(--miira-accent-text);
  --accent-soft: var(--miira-accent);
  --accent-ink-soft: var(--miira-accent-text);
  --accent-shade: var(--miira-accent-shade);
  --danger: var(--miira-red);
  --success: var(--miira-green);
  --focus: var(--miira-focus-ring);
  --hover: var(--miira-bg-hover);
  --radius-s: var(--miira-radius-sm);
  --radius-m: var(--miira-radius-md);
  --radius-l: var(--miira-radius-lg);
  --shadow-1: none;
  --shadow-2: var(--miira-shadow-elev);
  --font: var(--miira-font);
  --text-xs: var(--miira-font-size-xs);
  --text-s: var(--miira-font-size-sm);
  --text-m: var(--miira-font-size-body);
  --text-l: var(--miira-font-size-h4);
  margin: 0;
  background: var(--miira-bg-primary);
  color: var(--miira-text-primary);
  font-family: var(--miira-font);
}

/* Miira's buttons (styleguide .btn, .btn--primary): every one rides the 3D shelf, its face lifting on hover and pressing
   on click, and never darkens. Timings are the guide's literals. */
.chat-page .btn {
  border: 1px solid var(--miira-border-color);
  border-radius: var(--miira-radius-md);
  background: var(--miira-bg-surface);
  color: var(--miira-text-primary);
  font-size: var(--miira-font-size-sm);
  font-weight: 500;
  box-shadow: 0 1px 0 0 var(--miira-border-color);
  transform: translateY(0);
  transition: transform 0.12s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.12s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.15s,
    filter 0.12s ease;
}

.chat-page .btn:hover {
  border-color: var(--miira-border-hover);
  background: var(--miira-bg-surface);
  box-shadow: 0 2px 0 0 var(--miira-border-hover);
  transform: translateY(-1px);
}

.chat-page .btn:active {
  box-shadow: 0 0 0 0 transparent;
  transform: translateY(1px);
}

.chat-page .btn--primary,
.chat-page .btn--primary:hover {
  border-color: transparent;
  background: var(--miira-accent);
  color: var(--miira-accent-text);
  font-weight: 600;
}

.chat-page .btn--primary {
  box-shadow: 0 2px 0 0 var(--miira-3d-shadow);
}

.chat-page .btn--primary:hover {
  box-shadow: 0 4px 0 0 var(--miira-3d-shadow);
  filter: brightness(1.02);
  transform: translateY(-2px);
}

.chat-page .btn--primary:active {
  box-shadow: 0 1px 0 0 var(--miira-3d-shadow);
  filter: brightness(0.98);
  transform: translateY(1px);
}

.chat-page .btn:disabled {
  box-shadow: 0 1px 0 0 var(--miira-border-color);
  transform: none;
}

/* Miira's icon-only button (styleguide .icon-btn): no shelf; it grows on hover and shrinks on click. */
.chat-page .icon-btn {
  width: var(--miira-icon-btn-size);
  height: var(--miira-icon-btn-size);
  border: 1px solid transparent;
  border-radius: var(--miira-radius-sm);
  background: transparent;
  color: var(--miira-text-primary);
  transition: transform 0.12s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.15s, background 0.15s, border-color 0.15s;
}

.chat-page .icon-btn:hover {
  background: transparent;
  transform: translateY(-1px) scale(1.2);
}

.chat-page .icon-btn:active {
  transform: translateY(1px) scale(0.92);
}

.chat-page .icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Miira's text field (styleguide .field): the input fill, and an accent border on focus with no halo. */
.chat-page .input {
  padding: 10px 12px;
  border-color: var(--miira-border-color);
  border-radius: var(--miira-radius-md);
  background: var(--miira-bg-input);
  color: var(--miira-text-primary);
  transition: border-color 0.15s, background 0.15s;
}

.chat-page .input::placeholder {
  color: var(--miira-text-muted);
}

.chat-page .input:focus-visible {
  border-color: var(--miira-accent);
  outline: none;
  box-shadow: none;
}

.chat-page :focus-visible {
  outline: 2px solid var(--miira-focus-ring);
  outline-offset: 2px;
}

.chat {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* As the guide's editor side pane header: one row over a line. */
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--miira-border-color);
  background: var(--miira-bg-primary);
}

.chat-head__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--miira-accent);
  color: var(--miira-accent-text);
  font-weight: 700;
}

/* The supporter's picture fills the round avatar instead of the initial on the accent. */
.chat-head__avatar--photo {
  overflow: hidden;
  background: none;
}

.chat-head__avatar--photo .avatar {
  width: 100%;
  height: 100%;
}

.chat-head__text {
  flex: 1;
  min-width: 0;
}

.chat-head h1 {
  margin: 0;
  font-size: var(--miira-font-size-h5);
}

.chat-head p {
  margin: 0;
  color: var(--miira-text-secondary);
  font-size: var(--miira-font-size-xs);
}

/* Online or offline by the team's hours: a dot in Miira's green, or a muted one, before the words. */
.chat-presence {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-presence::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--miira-text-muted);
  content: "";
}

.chat-presence--online::before {
  background: var(--miira-green);
}

/* The messages as in Miira's own chat (styleguide .sidepane__msg): the visitor's on an accent tint at the right, the
   team's on the surface at the left, each with one small corner toward its side. A tint is drawn through --miira-wash,
   so the Kontrast theme turns it into a white plate in a black frame. */
.chat .bubbles {
  gap: 12px;
  padding: 16px 16px var(--typing-room);
}

.chat .bubble {
  max-width: 88%;
  padding: 10px 12px;
  border: 1px solid var(--miira-border-color);
  border-radius: var(--miira-radius-md);
  border-bottom-left-radius: var(--miira-radius-sm);
  background: var(--miira-bg-surface);
  color: var(--miira-text-primary);
  font-size: var(--miira-font-size-sm);
  line-height: 1.5;
}

.chat .typing-line {
  background: var(--miira-bg-primary);
  color: var(--miira-text-secondary, var(--ink-muted));
}

.chat .bubble--mine {
  border-color: var(--miira-wash-edge, color-mix(in srgb, var(--miira-accent) 45%, transparent));
  border-radius: var(--miira-radius-md);
  border-bottom-right-radius: var(--miira-radius-sm);
  background: var(--miira-wash, color-mix(in srgb, var(--miira-accent) 22%, var(--miira-bg-input)));
  color: var(--miira-text-primary);
}

/* The team's initials beside its messages: the accent tint of the theme, not Shappa's per-person hues. */
.chat .bubble-row .avatar:not(.avatar--photo) {
  border: 1px solid var(--miira-wash-edge, transparent);
  background: var(--miira-wash, color-mix(in srgb, var(--miira-accent) 22%, var(--miira-bg-surface)));
  color: var(--miira-text-primary);
}

.chat .bubble__meta {
  color: var(--miira-text-muted);
  font-size: var(--miira-font-size-xs);
  font-weight: 400;
  opacity: 1;
}

.chat .composer {
  position: relative; /* for the typing line over its top edge (components.css) */
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--miira-border-color);
  background: var(--miira-bg-primary);
}

/* Miira's chat field (styleguide .sidepane__composer): one rounded shell with the text on top and a row of round 3D
   buttons below, the send on the accent. The shell shows focus, so the field inside draws none of its own. Sizes and
   timings are the guide's literals. */
.composer__shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 10px 8px;
  border: 1px solid var(--miira-border-color);
  border-radius: 22px;
  background: var(--miira-bg-input);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.composer__shell:focus-within {
  border-color: color-mix(in srgb, var(--miira-accent) 60%, var(--miira-border-color));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--miira-accent) 20%, transparent);
}

.composer__input {
  width: 100%;
  min-height: 24px;
  max-height: 96px;
  padding: 4px 6px 2px;
  border: 0;
  background: transparent;
  color: var(--miira-text-primary);
  font: inherit;
  font-size: var(--miira-font-size-sm);
  line-height: 1.5;
  resize: none;
}

.composer__input:focus-visible {
  outline: none;
}

.composer__input::placeholder {
  color: var(--miira-text-muted);
}

.composer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.composer .chat-attach {
  align-self: center;
  gap: 6px;
}

.composer .chat-attach__btn,
.composer__send {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.12s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.12s cubic-bezier(0.2, 0.7, 0.2, 1), background 120ms ease,
    color 120ms ease, border-color 120ms ease, filter 0.12s ease;
}

.composer .chat-attach__btn {
  border: 1px solid color-mix(in srgb, var(--miira-border-color) 70%, transparent);
  background: transparent;
  color: var(--miira-text-secondary);
  box-shadow: 0 2px 0 0 var(--miira-border-color);
}

.composer .chat-attach__btn:hover {
  background: color-mix(in srgb, var(--miira-bg-hover) 70%, transparent);
  color: var(--miira-text-primary);
  box-shadow: 0 3px 0 0 var(--miira-border-hover), inset 0 0 0 2px var(--miira-wash-edge, transparent);
  transform: translateY(-1px);
}

.composer .chat-attach__btn:active {
  box-shadow: 0 1px 0 0 var(--miira-border-hover);
  transform: translateY(1px);
}

.composer__send {
  padding: 0;
  border: 2px solid var(--miira-accent-shade);
  background: var(--miira-accent);
  color: var(--miira-accent-text);
  box-shadow: 0 2px 0 0 var(--miira-accent-shade);
}

.composer__send:hover {
  box-shadow: 0 3px 0 0 var(--miira-accent-shade);
  filter: brightness(1.02);
  transform: translateY(-1px);
}

.composer__send:active {
  box-shadow: 0 1px 0 0 var(--miira-accent-shade);
  filter: brightness(0.98);
  transform: translateY(1px);
}

.composer .chat-attach__btn svg,
.composer__send svg {
  width: 18px;
  height: 18px;
}

.chat .thread-closed {
  padding: 0 16px;
  color: var(--miira-text-secondary);
}

.chat .chat-intake {
  margin: 16px;
  border-color: var(--miira-border-color);
  border-radius: var(--miira-radius-lg);
  background: var(--miira-bg-surface);
  box-shadow: 0 2px 0 0 var(--miira-border-color);
}

.chat-close {
  flex: none;
}

/* --- Smartsupp-style inbox pieces ------------------------------------------ */

.support-list-head {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.support-count {
  margin: 0;
  font-size: var(--text-xs);
}

/* The offer to switch notifications on (push-panel.js pushPrompt). */
.push-prompt {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-m);
  background: var(--surface-wash);
}

.push-prompt p {
  margin: 0;
}

/* Initials in a colour per name (chat-ui.js avatar()); pale in light themes, deep in dark ones. */
.avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: hsl(var(--avatar-hue) 70% 88%);
  color: hsl(var(--avatar-hue) 50% 26%);
  font-size: var(--text-xs);
  font-weight: 700;
}

:root[data-theme="dark"] .avatar,
:root[data-theme="70s"] .avatar {
  background: hsl(var(--avatar-hue) 35% 30%);
  color: hsl(var(--avatar-hue) 70% 88%);
}

.avatar--small {
  width: 24px;
  height: 24px;
  font-size: 0.625rem;
}

.avatar--large {
  width: 72px;
  height: 72px;
  font-size: var(--text-l);
}

/* A person's bubble beside their name (person.js), one size everywhere: Post's rows and messages, Opgaver's list,
   activity and pills (Jeppe, 2026-11-10: "make them all the same size"). It must follow .avatar here: in
   components.css, loaded before this file, it lost to .avatar's 36px. */
.avatar--tiny {
  width: 20px;
  height: 20px;
  font-size: 0.5625rem;
  letter-spacing: -0.02em;
}

/* A mail sender's brand logo (mail-message.js withLogo, BIMI) in place of the initials: square art cropped round. */
.avatar--logo {
  background: #fff;
  object-fit: cover;
}

.conv-item {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: var(--space-3);
  border-radius: var(--radius-m);
  border-bottom: 0;
}

.conv-item__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  min-width: 0;
}

.conv-item__who {
  overflow: hidden;
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The assignee's chip (views/support.js) stays whole; a long name ends in an ellipsis inside it. */
.conv-item__who .person {
  max-width: 100%;
}

.thread-head {
  flex-wrap: nowrap;
  align-items: center;
  padding: var(--space-3) 0;
}

.thread-head__who {
  flex: 1;
  min-width: 0;
}

.thread-head__who h2 {
  font-size: var(--text-m);
}

.support-resolve {
  border: 1px solid color-mix(in srgb, var(--success) 45%, transparent);
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
  color: var(--success);
}

.support-resolve:hover {
  background: color-mix(in srgb, var(--success) 20%, var(--surface));
}

/* A message row: the writer's initials beside the other side's bubbles; one's own bubbles sit right. */
.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
}

.bubble-row--mine {
  justify-content: flex-end;
}

.bubble-row .avatar {
  width: 30px;
  height: 30px;
  font-size: 0.6875rem;
}

.bubble__auto {
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--hover);
  font-weight: 600;
}

.bubble__edited {
  font-weight: 400;
}

.bubble__body--deleted {
  font-style: italic;
  opacity: 0.7;
}

/* A message's tools in the inbox (views/support.js): a team message's edit and delete, any message's task. Beside the
   bubble on hover or focus, on its outer side; always there where nothing hovers. */
.bubble-tools {
  display: flex;
  align-self: center;
  opacity: 0;
  transition: opacity 120ms;
}

.bubble-row:not(.bubble-row--mine) .bubble-tools {
  order: 1;
}

/* Visitor messages picked to become one task (support-picks.js): their toggle stays in view, pressed, and their bubble
   is outlined; the bar above the reply makes them a task. */
.bubble-tools:has(.support-pick[aria-pressed="true"]) {
  opacity: 1;
}

.support-pick[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink-soft);
}

.bubble-row:has(.support-pick[aria-pressed="true"]) .bubble {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.support-picks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--line);
}

.support-picks[hidden] {
  display: none;
}

.support-picks__count {
  margin-right: auto;
  font-size: var(--text-s);
}

.support-picks .form-error {
  flex-basis: 100%;
  margin: 0;
}

.bubble-row:hover .bubble-tools,
.bubble-tools:focus-within {
  opacity: 1;
}

@media (hover: none) {
  .bubble-tools {
    opacity: 1;
  }
}

.bubble--editing {
  width: min(36rem, 85%);
}

.bubble--editing .input {
  width: 100%;
  min-height: 4rem;
  resize: vertical;
}

.bubble--editing .hint {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
}

.support-visitor {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
}

.support-visitor__head {
  display: flex;
  padding: var(--space-2) var(--space-2) 0;
}

.support-visitor__body {
  display: grid;
  flex: 1;
  align-content: start;
  gap: var(--space-4);
  min-height: 0;
  padding: var(--space-2) var(--space-4) var(--space-5);
  overflow-y: auto;
}

.support-visitor__card {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  text-align: center;
}

.support-visitor__card h2 {
  font-size: var(--text-l);
}

/* "Tilføj person" for a visitor Kontakter does not know, with what went wrong under it (support-contact-add.js). */
.support-visitor__add {
  display: grid;
  justify-items: center;
  gap: var(--space-1);
}

.support-visitor__facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2) var(--space-3);
  margin: 0;
  font-size: var(--text-s);
}

.support-visitor__facts dt {
  color: var(--ink-muted);
}

.support-visitor__facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The LinkedIn row: the logo and the profile's name, or "Find på LinkedIn", as a link in the line of facts. */
.support-visitor__facts .linkedin-link {
  display: inline-flex;
  gap: var(--space-1);
  align-items: center;
  padding: 0;
  font: inherit;
}

/* The page the chat came from can be a long address; one line of it, the whole in its title. */
.support-visitor__page {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-visitor__history ul {
  display: grid;
  gap: 2px;
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.support-history {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px var(--space-2);
  width: 100%;
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-m);
  background: none;
  color: inherit;
  font: inherit;
  font-size: var(--text-s);
  text-align: left;
  cursor: pointer;
}

.support-history:hover,
.support-history--current {
  background: var(--hover);
}

.support-history--current {
  box-shadow: inset 3px 0 0 var(--accent);
}

.support-history__status--open {
  color: var(--success);
  font-weight: 600;
}

.support-history__preview {
  grid-column: 1 / -1;
  overflow: hidden;
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A mail opens in place to its text (support-profile.js): its summary is the row a chat's button is, and the text
   below it can be selected, so only the summary reacts like a button. */
.support-history--mail {
  display: block;
  cursor: default;
}

.support-history--mail:hover {
  background: none;
}

.support-history__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px var(--space-2);
  list-style: none;
  cursor: pointer;
}

.support-history__head::-webkit-details-marker {
  display: none;
}

.support-history__text,
.support-history__files {
  margin: var(--space-2) 0 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
  cursor: text;
}

.support-history__text + .support-history__files {
  padding-top: 0;
  border-top: 0;
}

.support-history__text {
  max-height: 20rem;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Møder, the latest chats and mails, and the visitor's activity fold under their headings, which count what is in
   them; the chevron points down while open. */
.support-fold > summary {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  cursor: pointer;
}

.support-fold > summary::-webkit-details-marker {
  display: none;
}

.support-fold > summary h3 {
  margin: 0;
}

.support-fold__chevron {
  display: inline-flex;
  color: var(--ink-muted);
  transition: transform 0.15s;
}

.support-fold__chevron svg {
  width: 16px;
  height: 16px;
}

.support-fold:not([open]) .support-fold__chevron {
  transform: rotate(-90deg);
}

.support-fold[open] > summary {
  margin-bottom: var(--space-2);
}

.support-profile {
  display: grid;
  gap: var(--space-4);
}

.support-profile h4 {
  margin: var(--space-2) 0 var(--space-1);
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

.support-profile__address {
  margin: var(--space-1) 0 var(--space-2);
  font-size: var(--text-s);
}

.support-map {
  height: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.support-map__marker {
  fill: var(--accent);
  fill-opacity: 0.9;
  stroke: var(--surface);
  stroke-width: 2;
}

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

/* Each meeting is a card of its own (Jeppe, 2026-11-13); Lys and Mørk give it the card shelf (components.css). */
.support-meeting {
  display: grid;
  gap: 2px;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  font-size: var(--text-s);
}

.support-meeting__when {
  font-weight: 600;
}

.support-settings {
  display: grid;
  gap: var(--space-5);
}

.auto-rules {
  display: grid;
  gap: var(--space-3);
}

.auto-rule {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}

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

.auto-rule__seconds {
  width: 6rem;
}

.auto-rule .btn--link {
  justify-self: start;
  font-size: var(--text-xs);
}

/* A long last message must never push the time or the badge out of the row. */
.conv-item__row > :first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-item__preview {
  flex: 1;
}

.support-settings .btn {
  justify-self: start;
}

/* Phones: one row of the way back, the visitor's name and the ⋯ menu with the actions (views/support.js phoneActions). */
@media (max-width: 819.98px) {
  .thread-head {
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space-2);
    padding-block: var(--space-2);
  }

  .thread-head > .avatar,
  .thread-head > .presence {
    display: none;
  }

  .thread-head__who h2,
  .thread-head__who p {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .support-back {
    flex: none;
    margin-left: calc(-1 * var(--space-2));
  }

  /* The task button stands in the menu as one of its choices, behind an icon like theirs. */
  .support-menu__task {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-left: var(--space-3);
    border-radius: var(--radius-s);
  }

  .support-menu__task:hover {
    background: var(--hover);
  }

  .support-menu__task .work-propose {
    display: grid;
    flex: 1;
  }

  .support-menu__task .work-propose > .btn {
    justify-content: flex-start;
    min-height: 0;
    padding: var(--space-2) var(--space-3) var(--space-2) 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--ink);
    font-weight: inherit;
    text-align: left;
  }

  .support-menu__task .work-propose > .hint:empty {
    display: none;
  }

  .support-menu .row-menu__list {
    min-width: 13rem;
  }
}

/* The note after a mail went (views/support.js mailNote) takes no room above the field until it says something. */
.support-thread > .hint:empty {
  display: none;
}

/* "Foreslå svar" as a button among the reply field's tools (reply-suggest.js replySuggestInline), in the accent like
   the card it opens; it breathes while the assistant works. */
.suggest-slot {
  display: flex;
  align-self: flex-end;
}

.suggest-trigger {
  color: var(--accent-text);
}

.suggest-trigger[aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--accent-ink-soft);
}

.suggest-trigger.is-busy .ui-icon {
  animation: suggest-breathe 1.2s ease-in-out infinite;
}

@keyframes suggest-breathe {
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .suggest-trigger.is-busy .ui-icon {
    animation: none;
  }
}

/* Images and GIFs (chat-attach.js), in both the inbox and the visitor's chat. */
.chat-attach {
  display: flex;
  align-self: flex-end;
  gap: 2px;
}

.chat-attach__btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-m);
  font-size: 1rem;
}

.chat-attach__gif {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.is-dropping {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
  background: color-mix(in srgb, var(--accent-soft) 40%, transparent);
}

/* Files waiting for the next send (chat-attach.js fileTray), above the field: Chat, the inbox and the visitor's chat. */
.tchat-tray {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  padding: 0;
  list-style: none;
}

.tchat-tray__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 16rem;
  padding: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface-wash);
}

.tchat-tray__thumb {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-s);
  background: var(--surface);
  object-fit: cover;
  color: var(--ink-muted);
}

.tchat-tray__text {
  display: grid;
  min-width: 0;
  font-size: var(--text-s);
}

.tchat-tray__name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tchat-tray__size {
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

/* Sound and video play in the message; the file card below downloads it. */
.bubble__media {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  max-width: 100%;
}

.bubble__media video {
  width: min(28rem, 100%);
  max-height: 20rem;
  border-radius: var(--radius-s);
  background: #000;
}

.bubble__media audio {
  width: min(20rem, 100%);
}

/* A sent file: its name and size on a card that downloads it. */
.bubble__file {
  display: grid;
  gap: 2px;
  margin: var(--space-1) 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

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

.bubble__file-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.bubble__file-size {
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.bubble__image {
  display: block;
  margin: var(--space-1) 0;
}

.bubble__image img {
  display: block;
  max-width: min(260px, 100%);
  height: auto;
  max-height: 260px;
  border-radius: var(--radius-m);
  object-fit: contain;
}

.gif-picker {
  display: grid;
  gap: var(--space-2);
  margin: 0 var(--space-3) var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-1, 0 4px 16px rgb(0 0 0 / 8%));
}

.gif-picker[hidden] {
  display: none;
}

.gif-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  /* Rows as tall as their 4:3 thumbnails. With auto rows, the max-height becomes the space the rows share, and the
     items (overflow: hidden, so no minimum height) were squeezed until they overlapped instead of scrolling. */
  grid-auto-rows: max-content;
  gap: var(--space-1);
  max-height: 240px;
  overflow-y: auto;
}

.gif-picker__item {
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--hover);
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.gif-picker__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.gif-picker__credit {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.6875rem;
  text-align: right;
}

/* The emoji grid (emoji-picker.js), in the same place and frame as the GIF search. */
.emoji-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 2px;
  max-height: 200px;
  margin: 0 var(--space-3) var(--space-2);
  padding: var(--space-2);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-1, 0 4px 16px rgb(0 0 0 / 8%));
}

.emoji-picker[hidden] {
  display: none;
}

.emoji-picker__item {
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
}

.emoji-picker__item:hover {
  background: var(--hover);
}

.emoji-picker__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Where the visitor has been (widget.js activity), in the visitor details. */
.support-activity__list {
  display: grid;
  gap: var(--space-2);
  max-height: 16rem;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  font-size: var(--text-xs);
}

/* Each entry: its kind's icon (support-activity.js), what happened and when, and below it where. */
.support-activity__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 var(--space-2);
}

.support-activity__icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-s);
  background: var(--surface-wash);
  color: var(--ink-muted);
}

.support-activity__icon svg {
  width: 14px;
  height: 14px;
}

.support-activity__item--click .support-activity__icon {
  background: var(--accent-soft);
  color: var(--accent-ink-soft);
}

.support-activity__item--file .support-activity__icon {
  background: var(--surface-wash);
  color: var(--ink);
}

.support-activity__item--page .support-activity__what {
  color: var(--ink-muted);
}

.support-activity__what {
  overflow-wrap: anywhere;
}

.support-activity__url {
  grid-column: 2 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
