/* ---------- fonts ---------- */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(assets/fonts/inter-latin-ext-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(assets/fonts/inter-latin-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(assets/fonts/inter-latin-ext-opsz-italic.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(assets/fonts/inter-latin-opsz-italic.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */

:root {
  --bg: #141519;
  --panel: #1b1c21;
  --panel-2: #212228;
  --raised: #25262d;
  --border: #2a2c33;
  --border-strong: #3a3d47;
  --hover: #23252c;
  --active: #2c2f38;
  --sel: #2c2f38;
  --sel-strong: #353946;
  --chip: #2a2c34;
  /* How much of a category's color washes its label: less on dark, so the text keeps 4.5:1. */
  --cat-tint: 11%;
  --text: #ecedf1;
  --text-2: #a7adba;
  --text-3: #7a808e;
  /* Team chat's caption grey: timestamps and counts in chat pass 4.5:1 on the panel and on dialogs, mail keeps --text-3. */
  --ch-text-3: #8a909e;
  /* Team chat's message bubble, reaction chips and file cards, and the row under the pointer around them. */
  --ch-bubble: #26272e;
  --ch-row-hover: #1f2025;
  /* Over a picture: the "+3" on the fourth image, the play badge on a video card. The image viewer is dark in both
     themes, as a photo viewer is. */
  --ch-overlay: rgba(10, 12, 18, 0.58);
  --ch-on-overlay: #ffffff;
  --ch-viewer-bg: rgba(8, 9, 12, 0.92);
  --ch-viewer-ink: #eceef2;
  --ch-viewer-soft: rgba(255, 255, 255, 0.12);
  --accent: #7aa5f5;
  --accent-soft: rgba(122, 165, 245, 0.15);
  --link: #8ab0ff;
  /* A signature is drawn as it will be sent, on light paper, and turned dark the way the reader turns mail
     dark: colors inverted and hues turned back. Its ink and links are light-theme values for that reason. */
  --signature-ink: #565c69;
  --signature-link: #2f63c8;
  --signature-filter: invert(1) hue-rotate(180deg);
  --primary: #e9ecf5;
  --on-primary: #15171c;
  /* Status colours that read on the --primary fill: a chosen mode tab's counts. */
  --on-primary-warn: #8f5d00;
  --on-primary-accent: #2a5bc4;
  --danger: #ff6b6b;
  --star: #ffc23d;
  --ok: #4ccf8b;
  --warn: #f5b84c;
  --focus: #7aa5f5;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Inter', 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
  --sidebar-w: 236px;
  --list-w: 400px;
  color-scheme: dark;
}

:root.light {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --raised: #ffffff;
  --border: #e6e8ec;
  --border-strong: #d2d6de;
  --hover: #f2f3f6;
  --active: #ebedf1;
  --sel: #ebedf1;
  --sel-strong: #e1e4ea;
  --chip: #eff1f4;
  --cat-tint: 16%;
  --text: #16181d;
  --text-2: #565c69;
  --text-3: #868b98;
  --ch-text-3: #666b7a;
  --ch-bubble: #f0f1f4;
  --ch-row-hover: #fafbfc;
  --ch-overlay: rgba(10, 12, 18, 0.52);
  --ch-on-overlay: #ffffff;
  --ch-viewer-bg: rgba(8, 9, 12, 0.9);
  --ch-viewer-ink: #eceef2;
  --ch-viewer-soft: rgba(255, 255, 255, 0.14);
  --accent: #2f66d6;
  --accent-soft: rgba(47, 102, 214, 0.1);
  --link: #2f63c8;
  --signature-ink: var(--text-2);
  --signature-link: var(--link);
  --signature-filter: none;
  --primary: #1c2340;
  --on-primary: #ffffff;
  --on-primary-warn: #f5b84c;
  --on-primary-accent: #7aa5f5;
  --danger: #d23b3b;
  --star: #e8a200;
  --ok: #1f9d5c;
  --warn: #c27c00;
  --focus: #2f66d6;
  --shadow: 0 12px 32px rgba(20, 24, 40, 0.14), 0 2px 6px rgba(20, 24, 40, 0.06);
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, 0.07), 0 0 0 1px rgba(20, 24, 40, 0.06);
  color-scheme: light;
}

/* ---------- base ---------- */

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11';
  user-select: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

time,
.count,
.meta,
kbd {
  font-variant-numeric: tabular-nums;
}

:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

kbd {
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
  line-height: 16px;
  display: inline-block;
  background: var(--panel-2);
}

/* Thin scrollbars that show while scrolling and when the thumb is pointed at. */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 9px;
  border: 2px solid transparent;
  background-clip: content-box;
  transition: background-color 200ms ease;
}
.is-scrolling::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(128, 128, 128, 0.42);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

/* ---------- buttons ---------- */

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: inline-grid;
  place-items: center;
  color: var(--text-2);
  flex: none;
  transition: background-color 120ms ease, color 120ms ease;
}
.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.icon-btn:active {
  background: var(--active);
}
.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
  background: none;
}
.icon-btn.on {
  background: var(--active);
  color: var(--text);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.7;
}
.icon-btn.sm {
  width: 28px;
  height: 28px;
}
.icon-btn.sm svg {
  width: 16px;
  height: 16px;
}
.icon-btn.xs {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.icon-btn.xs svg {
  width: 14px;
  height: 14px;
}

/* Toolbar button with a label. */
.tbtn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--text);
  white-space: nowrap;
  flex: none;
  font-weight: 500;
  transition: background-color 120ms ease;
}
.tbtn:hover {
  background: var(--hover);
}
.tbtn:active {
  background: var(--active);
}
.tbtn svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
  color: var(--text-2);
}
.tbtn.primary {
  background: var(--primary);
  color: var(--on-primary);
}
.tbtn.primary svg {
  color: inherit;
}
.tbtn.danger,
.tbtn.danger svg {
  color: var(--danger);
}

.btn {
  height: 32px;
  border-radius: var(--radius);
  background: var(--chip);
  color: var(--text);
  font-weight: 600;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: filter 120ms ease, background-color 120ms ease;
}
.btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}
.btn:hover {
  filter: brightness(0.96);
}
:root:not(.light) .btn:hover {
  filter: brightness(1.12);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn.primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn.secondary {
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.btn.sm {
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
}
.link-btn {
  color: var(--link);
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.link-btn:hover {
  text-decoration: underline;
}
.link-btn svg {
  width: 15px;
  height: 15px;
}
.chip-btn {
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px 0 7px;
  border-radius: 12px;
  background: var(--chip);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.chip-btn:hover {
  color: var(--text);
  background: var(--active);
}
.chip-btn svg {
  width: 14px;
  height: 14px;
}

/* Beautiful UI's SegmentedControl: equal segments in a pill, a thumb that slides to the chosen one.
   ui.js segmented() builds it; --n is the number of segments, --i the chosen one. */
.segmented {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  height: 32px;
  padding: 2px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--border) 70%, transparent);
  flex: none;
}
.seg-thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc((100% - 4px) / var(--n));
  border-radius: 9999px;
  background: var(--raised);
  box-shadow: var(--shadow-sm);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
:root:not(.light) .seg-thumb {
  background: var(--active);
}
.segmented button {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
  transition: color 120ms ease;
}
.segmented button:hover {
  color: var(--text-2);
}
.segmented button[aria-selected='true'] {
  color: var(--text);
}
.seg-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg-ic {
  display: none;
}
.seg-ic svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  .seg-thumb {
    transition: none;
  }
}

/* ---------- title bar ---------- */

.titlebar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 40px;
  -webkit-app-region: drag;
  display: flex;
  align-items: center;
  z-index: 100;
  /* Room for the native window buttons on Windows and Linux: the actions end 12px before them. The window controls
   * overlay's titlebar-area rectangle is the part of the bar the buttons leave free, in CSS pixels at the current
   * zoom. The buttons keep their width in screen pixels while the bar zooms (main.js only scales their height), so
   * at 80 percent they take more CSS pixels than at 100. Before the overlay reports, 150px, as Rukoo always had. */
  padding-right: calc(
    100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, calc(100vw - 138px)) + 12px
  );
}
/* The icon, then the modes and the search. The brand is as wide as its icon, whatever the sidebar's width, so the
 * modes and the search stay where they are when the sidebar folds to its rail. */
.titlebar-brand {
  flex: none;
  display: flex;
  align-items: center;
  padding-left: 22px;
  overflow: hidden;
  pointer-events: none;
}
/* Window buttons on the left, or on both sides, on Linux: bootstrap.js sets data-controls="left". The brand starts
 * after the buttons, and the actions end 12px before any buttons on the right or the window's edge (the padding
 * above). */
:root[data-controls="left"] .titlebar {
  padding-right: calc(
    100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, calc(100vw - env(titlebar-area-x, 0px))) + 12px
  );
}
:root[data-controls="left"] .titlebar-brand {
  padding-left: calc(22px + env(titlebar-area-x, 0px));
}
/* Traffic lights stay in native screen pixels while page zoom scales this bar: the brand starts after them. */
:root[data-platform="darwin"] .titlebar {
  padding-right: 12px;
}
:root[data-platform="darwin"] .titlebar-brand {
  padding-left: var(--mac-titlebar-inset, 86px);
  min-width: var(--mac-titlebar-inset, 86px);
}
.titlebar-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  flex: none;
}
.titlebar-name {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The main window's bar: the icon and the modes on the left, the search in the middle and the actions on the right.
 * The outer columns share what the search leaves, so the search keeps its place when a tab gets a count or the
 * language changes; it moves right only when the tabs need the room, and it shrinks before anything overflows. */
body.main-window .titlebar {
  display: grid;
  grid-template-columns: auto minmax(max-content, 1fr) minmax(0, 520px) minmax(max-content, 1fr);
}
body.main-window .titlebar-search {
  grid-column: 3;
  width: 100%;
}
body.main-window .titlebar-actions {
  grid-column: 4;
}

/* The modes: Mail, Calendar, Meet and Chat as tabs beside the icon (app.js renderModeSwitch). They change the sidebar
 * and the workspace together, so they sit above both. A track holds the tabs as labels; the chosen tab is filled with
 * ink, like the list's active quick filter, and only it shows its icon. Choosing another tab folds the old icon away
 * and opens the new one while the fill glides there. placeModeThumb measures where the chosen tab settles, as --x and
 * --w, so the fill goes straight to its end while the tabs change width under it. The track's 10px corners hold 8px
 * tabs at a 2px inset. What waits in a mode is a
 * number after its label, as in the quick filters. placeModeThumb also keeps room for the tabs at their widest, with
 * every count at 99+, as the box's min-width, so a count that comes or goes leaves the search where it is. Only the
 * tabs take clicks: the rest of the box and of the column still drags the window. */
.titlebar-modes {
  position: relative;
  justify-self: start;
  margin: 0 24px 0 2px;
}
.titlebar-modes:empty,
body.no-accounts .titlebar-modes,
body:has(.page) .titlebar-modes {
  display: none;
}
/* Settings > General > Tabs turned a mode off (app.js modesChanged): its ways in from the other modes go with its
 * tab. Meet: the recording clock in the title bar and Record on a calendar event. Calendar's go in invite.js and
 * composer.js, which draw the invitation card and the calendar button without them. */
body.hides-meeting .rec-indicator,
body.hides-meeting .cal-record {
  display: none !important;
}
.mode-tabs {
  -webkit-app-region: no-drag;
  position: relative;
  display: flex;
  align-items: center;
  width: max-content;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--border) 70%, transparent);
}
/* The copy placeModeThumb measures: in the same place and font, never seen. */
.mode-tabs.is-measure {
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
  pointer-events: none;
}
.mode-thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: var(--w, 0);
  border-radius: var(--radius);
  background: var(--primary);
  transform: translateX(var(--x, 0));
  pointer-events: none;
  z-index: 1;
}
/*   0ms  the old tab's icon folds, the new tab's icon opens, the fill glides over the tabs between
 *  40ms  the new tab's label starts to take the fill's ink, as the fill arrives under it
 * 300ms  all settled; the icon's own pop overshoots a little and settles with them
 * The fill passes over the other tabs and under the chosen one, so a label it crosses is covered, never dim text on
 * ink. */
.mode-tabs.glides .mode-thumb {
  transition:
    transform 300ms cubic-bezier(0.23, 1, 0.32, 1),
    width 300ms cubic-bezier(0.23, 1, 0.32, 1);
}
.mode-tabs button {
  position: relative;
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 120ms ease;
}
.mode-tabs button:hover {
  color: var(--text);
}
.mode-tabs button[aria-selected='true'] {
  z-index: 2;
  color: var(--on-primary);
  transition: color 100ms ease 40ms;
}
.mode-ic {
  display: inline-flex;
  width: 0;
  margin-right: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    width 300ms cubic-bezier(0.23, 1, 0.32, 1),
    margin-right 300ms cubic-bezier(0.23, 1, 0.32, 1),
    opacity 200ms ease;
}
.mode-ic svg {
  flex: none;
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
  display: block;
  transform: scale(0.6);
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
[aria-selected='true'] > .mode-ic {
  width: 14px;
  margin-right: 6px;
  opacity: 1;
}
[aria-selected='true'] > .mode-ic svg {
  transform: none;
}
/* Booking requests on Calendar in orange, and on Chat the messages for you in accent, or a dot for other unread
 * messages. The light theme darkens the orange, as for the booking warnings, so the number stays readable. On the
 * chosen tab's fill they take the --on-primary variants of both colours. */
.mode-badge {
  margin-left: 5px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--warn);
}
:root.light .mode-badge {
  color: color-mix(in srgb, var(--warn) 55%, var(--text));
}
.mode-badge.is-mention,
:root.light .mode-badge.is-mention {
  color: var(--accent);
}
:root .mode-tabs button[aria-selected='true'] .mode-badge {
  color: var(--on-primary-warn);
}
:root .mode-tabs button[aria-selected='true'] .mode-badge.is-mention {
  color: var(--on-primary-accent);
}
.mode-dot {
  width: 6px;
  height: 6px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.mode-tabs [aria-selected='true'] .mode-dot {
  background: var(--on-primary-accent);
}
/* A narrow window gives the room to the search: every tab shows its icon, with the label in the tooltip, and a count
 * becomes a pill on the icon's corner. Half a 1920px screen, 960px, still has the labels. */
@media (max-width: 939px) {
  .mode-tabs button {
    width: 32px;
    padding: 0;
    justify-content: center;
  }
  .mode-label {
    display: none;
  }
  .mode-ic,
  [aria-selected='true'] > .mode-ic {
    width: 16px;
    margin-right: 0;
    opacity: 1;
  }
  .mode-ic svg {
    width: 16px;
    height: 16px;
    transform: none;
  }
  .mode-badge,
  .mode-dot {
    position: absolute;
    margin: 0;
  }
  .mode-badge,
  :root .mode-tabs button[aria-selected='true'] .mode-badge {
    top: -3px;
    right: -3px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 9999px;
    display: inline-grid;
    place-items: center;
    font-size: 9.5px;
    font-weight: 650;
    background: var(--warn);
    color: var(--panel);
  }
  /* Dark ink on the orange in both themes; the light theme's panel colour is white, too faint on it. */
  :root.light .mode-badge,
  :root.light .mode-tabs button[aria-selected='true'] .mode-badge {
    color: var(--text);
  }
  .mode-badge.is-mention,
  :root.light .mode-badge.is-mention,
  :root .mode-tabs button[aria-selected='true'] .mode-badge.is-mention {
    background: var(--accent);
    color: var(--panel);
  }
  .mode-dot,
  .mode-tabs [aria-selected='true'] .mode-dot {
    top: 3px;
    right: 4px;
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--bg);
  }
}
/* The smallest bar, from 200 percent in the smallest window: the tabs close up and a recording shows its dot without
 * the clock (meeting.js puts it in the indicator's tooltip too), so the actions stay clear of the window buttons. The
 * search can end up narrower than its input there; a press on it still puts the cursor in it (app.js renderSearch). */
@media (max-width: 480px) {
  .titlebar-modes {
    margin-right: 8px;
  }
  .mode-tabs button {
    width: 28px;
  }
  .titlebar-actions .rec-time {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mode-tabs.glides .mode-thumb,
  .mode-tabs button,
  .mode-tabs button[aria-selected='true'],
  .mode-ic,
  .mode-ic svg {
    transition: none;
  }
}

/* The search gives way before the bar overflows: at 200 percent in a small window it shrinks below its field's own
 * width, so the actions stay clear of the window buttons. */
.titlebar-search {
  -webkit-app-region: no-drag;
  width: min(560px, 100%);
  min-width: 0;
  overflow: hidden;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  padding: 0 4px 0 10px;
  transition: box-shadow 120ms ease;
}
.titlebar-search:empty {
  display: none;
}
.titlebar-search:focus-within {
  box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-soft);
}
.titlebar-search .s-ic svg {
  width: 15px;
  height: 15px;
  color: var(--text-3);
  display: block;
}
.titlebar-search input {
  flex: 1;
  min-width: 60px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  height: 100%;
}
.titlebar-search input::placeholder {
  color: var(--text-3);
}
.titlebar-search input::-webkit-search-cancel-button {
  display: none;
}
/* A plain field at rest; the scope shows while you search, the shortcut while it waits for input. */
.search-scope {
  height: 22px;
  display: none;
  align-items: center;
  gap: 2px;
  padding: 0 4px 0 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--chip);
  white-space: nowrap;
}
.titlebar-search:focus-within .search-scope,
.titlebar-search.has-text .search-scope {
  display: inline-flex;
}
.search-scope:hover {
  color: var(--text);
}
.search-scope svg {
  width: 14px;
  height: 14px;
}
.search-kbd {
  display: none;
  margin-right: 4px;
}
.titlebar-search:focus-within:not(.has-text) .search-kbd {
  display: inline-block;
}
body.no-accounts .titlebar-search,
body.chat-only .titlebar-search,
body:has(.page) .titlebar-search {
  display: none;
}
/* Right of the search, left of the room kept for the window buttons. */
.titlebar-actions {
  -webkit-app-region: no-drag;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
}
.titlebar-actions:empty,
body.no-accounts .titlebar-actions,
body:has(.page) .titlebar-actions {
  display: none;
}
/* With the chat panel closed, a dot on its button: an answer you have not seen (blue), or an agent waiting for your
 * approval (orange). Open, the bell in the panel's header counts them. */
.titlebar-actions [data-agent-toggle] {
  position: relative;
}
.titlebar-actions [data-agent-toggle].has-news:not(.on)::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg);
  animation: pop 140ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.titlebar-actions [data-agent-toggle][data-news='waiting']::after {
  background: var(--warn);
}
@media (prefers-reduced-motion: reduce) {
  .titlebar-actions [data-agent-toggle].has-news::after {
    animation: none;
  }
}

/* The logo comes in a light and a dark colourway; show the one that matches the theme. */
:root.light .brand-dark,
:root:not(.light) .brand-light {
  display: none;
}

#app {
  position: fixed;
  inset: 40px 0 0 0;
}

/* ---------- shell ---------- */

.shell {
  display: flex;
  height: 100%;
}

/* List and reader share one surface; hairlines divide them. Positioned for the chat panel's overlay mode. */
.workspace {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  background: var(--panel);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-top-left-radius: 12px;
  overflow: hidden;
}

/* ---------- sidebar ---------- */

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 2px 10px 8px 10px;
  min-height: 0;
}
.sidebar-main {
  display: contents;
}
.account-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
  text-align: left;
  min-height: 46px;
}
.account-switch:hover {
  background: var(--hover);
}
.account-switch .who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.account-switch .name {
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-switch .email {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-switch .chev svg {
  width: 16px;
  height: 16px;
  color: var(--text-3);
  display: block;
}

.compose-btn {
  width: 100%;
  margin: 6px 0 12px;
  height: 34px;
  justify-content: flex-start;
  padding: 0 12px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-weight: 600;
}
.compose-btn svg {
  color: var(--accent);
}

.nav {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  margin: 0 -4px;
  padding: 0 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 30px;
  padding: 0 8px 0 10px;
  border-radius: var(--radius);
  text-align: left;
  color: var(--text-2);
  position: relative;
}
.nav-item:hover {
  background: var(--hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--active);
  color: var(--text);
  font-weight: 600;
}
.nav-item .ic {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  flex: none;
}
.nav-item .ic svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}
.nav-item:hover .ic,
.nav-item.active .ic {
  color: var(--text-2);
}
.nav-item .label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Folder colours: a dot in the sidebar, a lettered tile in the rail. */
.ic.fdot i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: hsl(var(--h) 62% 55%);
}
.ic.fdot b {
  display: none;
}
.count {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  flex: none;
}
.count.strong {
  color: var(--text);
  font-weight: 650;
}
.nav-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  padding: 14px 6px 4px 10px;
}
.nav-section .icon-btn {
  opacity: 0;
}
.nav-section:hover .icon-btn,
.nav-section .icon-btn:focus-visible {
  opacity: 1;
}
.nav-item.drop-target {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
/* While an email is dragged, a folder row takes the drop itself rather than its icon, name or count. Chromium refuses a
   drop when the element under the pointer changed on the last update before it. */
body.dragging-mail .nav-item * {
  pointer-events: none;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}
.sync-status {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-3);
  text-align: left;
}
.sync-status:hover {
  background: var(--hover);
  color: var(--text-2);
}
.sync-status .t {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sync-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  flex: none;
}
.sync-status.ok .dot {
  background: var(--ok);
}
.sync-status.busy .dot {
  background: var(--warn);
  animation: pulse 1s ease-in-out infinite;
}
.sync-status.error {
  color: var(--danger);
}
.sync-status.error .dot {
  background: var(--danger);
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

/* Collapsed: an icon rail. When the rail runs short of height, at 200 percent zoom for one, the list keeps about three
   rows and the whole column scrolls instead: the tiles and the foot scroll away with the list and keep
   their size. The column draws no scrollbar of its own, which would take 9 of the rail's 60px and cut the list's
   tiles; the list's own scrollbar and the rows cut at its edge show that more follows. */
.shell.collapsed .sidebar {
  padding: 2px 8px 8px;
  align-items: center;
  overflow: hidden auto;
  scrollbar-width: none;
}
.shell.collapsed .sidebar > *,
.shell.collapsed .sidebar-main > * {
  flex-shrink: 0;
}
.shell.collapsed .account-switch {
  width: 44px;
  justify-content: center;
  padding: 6px 0;
}
.shell.collapsed .account-switch .who,
.shell.collapsed .account-switch .chev,
.shell.collapsed .compose-btn span,
.shell.collapsed .nav-item .label,
.shell.collapsed .nav-section span,
.shell.collapsed .nav-section .icon-btn,
.shell.collapsed .sync-status .t {
  display: none;
}
.shell.collapsed .compose-btn {
  width: 40px;
  padding: 0;
  justify-content: center;
}
.shell.collapsed .nav {
  width: 100%;
  min-height: 120px;
}
.shell.collapsed .nav-item {
  justify-content: center;
  padding: 0;
  width: 40px;
  height: 34px;
  margin: 0 auto;
}
/* In the rail an unread count becomes a dot beside the icon. */
.shell.collapsed .nav-item .count {
  display: none;
}
.shell.collapsed .nav-item .count.strong {
  display: block;
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  padding: 0;
  font-size: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg);
}
.shell.collapsed .ic.fdot i {
  display: none;
}
.shell.collapsed .ic.fdot b {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: hsl(var(--h) 55% 90%);
  color: hsl(var(--h) 45% 30%);
}
:root:not(.light) .shell.collapsed .ic.fdot b {
  background: hsl(var(--h) 30% 26%);
  color: hsl(var(--h) 70% 82%);
}
.shell.collapsed .nav-section {
  display: block;
  height: 1px;
  padding: 0;
  margin: 8px 10px;
  background: var(--border);
}
.shell.collapsed .sidebar-foot {
  flex-direction: column;
  width: 100%;
}
.shell.collapsed .sync-status {
  flex: none;
  width: 32px;
  justify-content: center;
  padding: 0;
}

/* ---------- avatars, pills, checkboxes ---------- */

.avatar {
  --h: 220;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  background: hsl(var(--h) 38% 27%);
  color: hsl(var(--h) 70% 84%);
}
:root.light .avatar {
  background: hsl(var(--h) 60% 93%);
  color: hsl(var(--h) 45% 32%);
}
/* A brand's own icon, on white as it was designed for. */
.avatar.logo,
:root.light .avatar.logo {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.avatar.logo img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  border-radius: 3px;
}
.avatar.lg {
  width: 38px;
  height: 38px;
  font-size: 13px;
}
.avatar.acc {
  background: color-mix(in srgb, var(--acc) 24%, var(--panel));
  color: color-mix(in srgb, var(--acc) 80%, var(--text));
  width: 30px;
  height: 30px;
}
.avatar.acc.all {
  background: var(--chip);
  color: var(--text-2);
}
.avatar.acc svg {
  width: 16px;
  height: 16px;
}

.pill {
  font-size: 11px;
  line-height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--chip);
  color: var(--text-2);
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: none;
}
.pill.vip {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 650;
}
/* An email's inbox category in a list that mixes them: a dot in its color before the name, which ends in an ellipsis
   when the row is short of room, on a wash of the color. */
.pill.cat {
  display: block;
  background: color-mix(in srgb, var(--cat) var(--cat-tint), var(--chip));
}
.pill.cat::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--cat);
  vertical-align: 1px;
}
/* The account of an email in a list of several accounts: a dot in its color on the sender's picture, ringed in the
   row's own background so it stands apart from the picture in each state of the row. */
.lead .acc-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 0 2px var(--panel);
}
.item:hover .lead .acc-dot {
  box-shadow: 0 0 0 2px var(--hover);
}
.item.selected .lead .acc-dot {
  box-shadow: 0 0 0 2px var(--sel);
}
.item.checked .lead .acc-dot {
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.draft-tag {
  color: var(--danger);
  font-weight: 600;
  margin-right: 6px;
}

.check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: var(--panel);
  display: grid;
  place-items: center;
  color: transparent;
  flex: none;
}
.check svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.6;
}
.check.on,
.check.some {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.check.some svg {
  display: none;
}
.check.some::after {
  content: '';
  width: 8px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

/* ---------- list ---------- */

.listpane {
  width: var(--list-w);
  flex: none;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  container-type: inline-size;
  container-name: list;
}
.list-head {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 12px 10px 4px 18px;
  min-height: 56px;
}
/* A category's tab: its color washes the top of the list and its dot stands before the name. */
.list-head.cat-head {
  background: linear-gradient(color-mix(in srgb, var(--cat) 18%, transparent), transparent);
}
.list-head.cat-head h1::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--cat);
  vertical-align: 2px;
}
.list-title {
  flex: 1;
  min-width: 0;
}
.list-title h1 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-title .sub {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 2px 10px 6px 14px;
  border-bottom: 1px solid var(--border);
}
/* Borderless tabs: the active one is filled, the others are text. */
.filters {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}
.filters::-webkit-scrollbar {
  display: none;
}
.filter {
  height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex: none;
}
.filter:hover {
  color: var(--text);
  background: var(--hover);
}
.filter.active {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
.filter .n {
  font-size: 11px;
  opacity: 0.6;
}
@container list (max-width: 380px) {
  .filter .n {
    display: none;
  }
  .filters {
    mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent);
  }
}
.list-tools.selecting {
  background: var(--accent-soft);
  gap: 2px;
}
.list-tools .check {
  margin: 0 8px 0 4px;
}
.sel-count {
  font-weight: 600;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* A narrow list keeps Read, Delete, More and Clear for checked emails; star, move and archive are in More. A count
 * too long even then gives way, so no button ever leaves the list. */
@container list (max-width: 420px) {
  .list-tools.selecting [data-bulk='star'],
  .list-tools.selecting [data-bulk='move'],
  .list-tools.selecting [data-bulk='archive'] {
    display: none;
  }
}
.spacer {
  flex: 1;
}

.list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 6px 16px;
  outline: none;
}
/* New mail above or below what the list shows (app.js updateNewPill). It floats over the top of the list, above the
   sticky day heading; app.js sets top. The chevron says which way the mail is. */
.new-pill {
  position: absolute;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  max-width: calc(100% - 32px);
  padding: 0 12px 0 8px;
  border-radius: 9999px;
  background: var(--raised);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
  animation: new-pill-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transition: background 120ms ease;
}
.new-pill[hidden] {
  display: none;
}
.new-pill:hover {
  background: var(--hover);
}
.new-pill:active {
  transform: translateX(-50%) scale(0.96);
}
.new-pill svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--accent);
  stroke-width: 2;
}
.new-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes new-pill-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .new-pill {
    animation: none;
  }
}
.group-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  padding: 12px 12px 4px 18px;
}

.item-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}
.swipe-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 22px;
  color: #fff;
  font-weight: 600;
  gap: 10px;
  opacity: 0;
}
.swipe-bg svg {
  width: 20px;
  height: 20px;
}
/* A swipe to the right shows its action on the left, and the other way round. */
.swipe-bg.right {
  background: var(--sw);
}
.swipe-bg.left {
  background: var(--sw);
  flex-direction: row-reverse;
}

.item {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 11px;
  padding: 9px 10px 9px 18px;
  background: var(--panel);
  border-radius: var(--radius);
  cursor: default;
  touch-action: pan-y;
}
.item:hover {
  background: var(--hover);
}
/* One cue per state: grey for the open message, a tint plus checkbox for the selection. */
.item.selected {
  background: var(--sel);
}
.item.checked {
  background: var(--accent-soft);
}
.list-scroll.kbd:focus .item.cursor {
  box-shadow: inset 0 0 0 2px var(--focus);
}
/* Unread: a dot in its own gutter, and bold text. Nothing else changes colour. */
.unread-dot {
  position: absolute;
  left: 6px;
  top: 22px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: none;
}
.item.unread .unread-dot {
  display: block;
}
.lead {
  position: relative;
  width: 32px;
  height: 32px;
  margin-top: 2px;
}
.lead .check {
  position: absolute;
  inset: 7px;
  display: none;
}
.item:hover .lead .avatar,
.shell.selecting .lead .avatar {
  display: none;
}
.item:hover .lead .check,
.shell.selecting .lead .check {
  display: grid;
}
.item .body {
  min-width: 0;
}
.line1,
.line2 {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sender {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
}
.item.unread .sender {
  font-weight: 700;
}
.meta {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-3);
  font-size: 11.5px;
  white-space: nowrap;
  flex: none;
}
.meta svg {
  width: 13px;
  height: 13px;
  display: block;
}
.subject {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
}
.item.unread .subject {
  color: var(--text);
  font-weight: 600;
}
.line2 .sep,
.line2 .preview-inline {
  display: none;
}
/* The pills give way before the subject does: they shrink and end in an ellipsis, and never take more than 60% of
   the line, so a narrow list with VIP, folder and category pills still shows some of the subject. */
.flags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 60%;
}
.flags .pill {
  flex: 0 1 auto;
  min-width: 0;
}
.flags .star-btn {
  flex: none;
}
.star-btn {
  width: 22px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  border-radius: 5px;
  visibility: hidden;
}
.star-btn svg {
  width: 15px;
  height: 15px;
}
.item:hover .star-btn,
.star-btn.on {
  visibility: visible;
}
.star-btn:hover {
  color: var(--text);
  background: var(--active);
}
.star-btn.on {
  color: var(--star);
}
.preview {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
  margin-top: 1px;
}

/* Stacks, when they are on: read mail in a row from one sender folds into one row with a pile icon and a count. */
.stack-btn {
  height: 18px;
  min-width: 26px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--chip);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: none;
  position: relative;
}
/* A 24px target around the 18px chip, so a near miss doesn't open the email instead. */
.stack-btn::before {
  content: '';
  position: absolute;
  inset: -3px -2px;
}
.stack-btn:not(.open) {
  padding-left: 5px;
}
.stack-btn:hover {
  background: var(--active);
  color: var(--text);
}
.stack-btn svg {
  width: 13px;
  height: 13px;
}
/* The edge of the next card in the pile, under a folded row. The row keeps room for it: the row's wrap clips what
   sticks out, for swipes. */
.item-wrap.folded {
  padding-bottom: 4px;
}
.item-wrap.folded .swipe-bg {
  bottom: 4px;
}
.item.folded::after {
  content: '';
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: -4px;
  height: 5px;
  border-radius: 0 0 6px 6px;
  border: 1px solid var(--border);
  border-top: 0;
  pointer-events: none;
}
.item-wrap.stacked .item {
  padding-left: 30px;
}
.item-wrap.stacked .lead {
  visibility: hidden;
}
.item-wrap.stacked .item:hover .lead,
.shell.selecting .item-wrap.stacked .lead {
  visibility: visible;
}
.item-wrap.stacked .sender {
  color: var(--text-3);
  font-weight: 500;
}

/* Compact density: no avatar or preview; two tight lines, or one line in a wide list. */
.shell.compact .item {
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 8px;
  padding: 5px 10px 5px 16px;
  align-items: center;
}
.shell.compact .lead {
  width: 18px;
  height: 18px;
  margin: 0;
}
.shell.compact .lead .avatar {
  display: none;
}
.shell.compact .lead .check {
  inset: 0;
}
.shell.compact .unread-dot {
  left: 21px;
  top: 50%;
  margin-top: -3.5px;
}
.shell.compact .item:hover .unread-dot,
.shell.compact.selecting .unread-dot {
  display: none;
}
.shell.compact .preview {
  display: none;
}
.shell.compact .item-wrap.stacked .item {
  padding-left: 26px;
}
@container list (min-width: 620px) {
  .shell.compact .item {
    height: 34px;
    padding-top: 0;
    padding-bottom: 0;
  }
  .shell.compact .item .body {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .shell.compact .line1 {
    display: contents;
  }
  .shell.compact .sender {
    order: 1;
    flex: 0 0 28%;
  }
  .shell.compact .stack-btn {
    order: 1;
  }
  .shell.compact .line2 {
    order: 2;
    flex: 1;
    gap: 0;
  }
  .shell.compact .line1 .meta {
    order: 3;
  }
  .shell.compact .line2 .subject {
    flex: 0 1 auto;
    max-width: 65%;
    min-width: 40px;
  }
  .shell.compact .line2 .sep,
  .shell.compact .line2 .preview-inline {
    display: block;
    color: var(--text-3);
    font-size: 12.5px;
    white-space: pre;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .shell.compact .line2 .sep {
    flex: none;
  }
  .shell.compact .line2 .preview-inline {
    flex: 1 1 0;
    min-width: 0;
  }
  .shell.compact .line2 .sep:has(+ .preview-inline:empty) {
    display: none;
  }
  .shell.compact .line2 .flags {
    margin-left: 6px;
  }
}

.drag-ghost {
  position: fixed;
  top: -100px;
  left: -100px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  text-align: center;
  color: var(--text-3);
  padding: 70px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.empty svg {
  width: 40px;
  height: 40px;
  opacity: 0.6;
  margin-bottom: 6px;
}
.empty .t {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 600;
}
.empty .h {
  font-size: 12.5px;
}
.empty .btn {
  margin-top: 10px;
}
.list-scroll .empty .spinner {
  width: 18px;
  height: 18px;
  margin: 0 0 6px;
  border-color: color-mix(in srgb, var(--text-3) 40%, transparent);
  border-top-color: var(--text-2);
}

/* The row at the end of the list: Load older, or how the search of older mail on the server went. */
.list-older {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  padding: 14px 12px 6px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  text-wrap: pretty;
}
.list-older .t {
  color: var(--text-2);
}
.list-older .h {
  font-variant-numeric: tabular-nums;
}
.list-older .spinner {
  width: 13px;
  height: 13px;
  margin: 0;
  border-color: color-mix(in srgb, var(--text-3) 40%, transparent);
  border-top-color: var(--text-2);
}
.list-older .btn {
  gap: 6px;
  padding-left: 10px;
}
.list-older .btn .ic {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex: none;
}
.list-older .btn:disabled {
  cursor: progress;
}
.empty + .list-older {
  margin-top: -48px;
}

/* ---------- divider ---------- */

.divider {
  width: 1px;
  flex: none;
  background: var(--border);
  position: relative;
  cursor: col-resize;
  z-index: 3;
}
.divider::before {
  content: '';
  position: absolute;
  inset: 0 -4px;
}
.divider:hover,
.divider.dragging,
.divider:focus-visible {
  background: var(--accent);
  outline: none;
  box-shadow: 0 0 0 1px var(--accent);
}

/* ---------- reader ---------- */

.reader {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  container-name: reader;
}
.reader-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 50px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.bar-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 6px;
  flex: none;
}
/* The subject joins the toolbar once it scrolls out of view. */
.bar-subject {
  min-width: 0;
  margin-left: 8px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: none;
}
.reader.scrolled .bar-subject {
  opacity: 1;
  transform: none;
}
@container reader (max-width: 560px) {
  .reader-bar .tbtn span {
    display: none;
  }
  .reader-bar .tbtn {
    width: 32px;
    padding: 0;
    justify-content: center;
  }
  .bar-subject {
    display: none;
  }
}
.reader-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 48px;
  user-select: text;
  outline: none;
}
.message {
  max-width: 880px;
  margin: 0 auto;
}
.subject-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.reader-subject {
  flex: 1;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.018em;
  margin: 0;
  line-height: 1.3;
  word-break: break-word;
}
.reader-star {
  margin-top: -2px;
}
.reader-star.on {
  color: var(--star);
}
.msg-from {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
}
.msg-from .who {
  flex: 1;
  min-width: 0;
}
.from-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  line-height: 1.4;
}
.person {
  border-radius: 4px;
  padding: 0 1px;
  margin: 0 -1px;
  user-select: text;
}
.person:hover {
  text-decoration: underline;
}
.from-name {
  font-weight: 650;
  font-size: 13.5px;
}
/* The raw address waits until you point at the sender. */
.addr {
  color: var(--text-3);
  font-size: 12px;
  user-select: text;
  opacity: 0;
  transition: opacity 120ms ease;
}
.msg-from:hover .addr,
.msg-from:focus-within .addr {
  opacity: 1;
}
.to-summary {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 1px;
  padding: 0 4px 0 0;
  border-radius: 5px;
  font-size: 12.5px;
  color: var(--text-2);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.to-summary:hover {
  color: var(--text);
}
.to-summary svg {
  width: 14px;
  height: 14px;
  flex: none;
  transition: transform 140ms ease;
}
.to-summary[aria-expanded='true'] svg {
  transform: rotate(180deg);
}
.msg-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.reader-date {
  color: var(--text-3);
  font-size: 12px;
  white-space: nowrap;
}
.details {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 6px 12px;
  margin: 12px 0 0 50px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 12.5px;
}
.details .k {
  color: var(--text-3);
}
.details .v {
  color: var(--text-2);
  min-width: 0;
  word-break: break-word;
}
.msg-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

/* A calendar invitation above the email, or in the dialog for an .ics file (invite.js): what, when and who, the
   answer, and where the answer goes. The note keeps its line while main looks in the calendars, so nothing jumps. */
.invite {
  margin: 14px 0 2px;
  padding: 12px;
  border-radius: 10px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border);
  max-width: 640px;
}
.scrim .invite {
  margin: 0;
  max-width: none;
}
.invite-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.invite-icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--chip);
  color: var(--text-2);
}
.invite-icon svg {
  width: 18px;
  height: 18px;
}
.invite-titles {
  flex: 1;
  min-width: 0;
}
.invite-kind {
  font-size: 12px;
  color: var(--text-3);
}
.invite-title {
  margin: 1px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
  overflow-wrap: anywhere;
  user-select: text;
}
.invite-when {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  user-select: text;
}
.invite.cancelled .invite-title {
  text-decoration: line-through;
  color: var(--text-2);
}
.invite-pill {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  font-weight: 600;
}
.invite-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 0 42px;
  font-size: 12.5px;
  color: var(--text-2);
  min-width: 0;
}
.invite-row svg {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--text-3);
}
.invite-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
  user-select: text;
}
.invite-row .link-btn {
  padding: 0;
}
.invite-count {
  color: var(--text);
  font-weight: 500;
}
.invite-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.invite-foot .spacer {
  flex: 1;
}
.invite-rsvp {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-2);
}
.invite-rsvp .filter:disabled {
  opacity: 0.55;
  cursor: default;
}
.invite-note {
  margin-top: 8px;
  min-height: 18px;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-3);
  text-wrap: pretty;
}

.atts {
  padding: 14px 0 2px;
}
.atts-head,
.rel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.atts-toggle,
.rel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  padding: 4px 6px 4px 2px;
  border-radius: 6px;
}
.atts-toggle:hover,
.rel-toggle:hover {
  color: var(--text);
}
.atts-toggle svg,
.rel-toggle svg {
  width: 15px;
  height: 15px;
  transition: transform 140ms ease;
}
.atts.closed .atts-toggle svg {
  transform: rotate(-90deg);
}
.atts-size {
  font-weight: 400;
  color: var(--text-3);
}
.atts-head .link-btn {
  font-size: 12.5px;
}
.atts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
}
.atts-head + .atts-list {
  margin-top: 8px;
}
.att {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 10px;
  padding: 6px 6px 6px 7px;
  min-width: 0;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: background-color 120ms ease;
}
.att:hover {
  background: var(--hover);
}
.att-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.att-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.att-name {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.att-size {
  font-size: 11.5px;
  color: var(--text-3);
}
.ftype {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: #fff;
  background: #6b7385;
}
.ftype.pdf {
  background: #d9474b;
}
.ftype.doc {
  background: #2f6fe0;
}
.ftype.sheet {
  background: #1f9d5c;
}
.ftype.slides {
  background: #e07b2f;
}
.ftype.image {
  background: #8a5cd6;
}
.ftype.archive {
  background: #8d7a52;
}
.ftype.cal,
.ftype.mail {
  background: #2a8fa8;
}
.att .thumb {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--chip);
}
.att .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The spinner in place of a button's icon while the button waits for a large email to come in whole (app.js
   busyButton): Save, Save all, Retry, Unsubscribe, and Reply, Reply all, Forward and Edit in the bar. The size of the
   icon it stands in for, so the button keeps its shape. */
.att .icon-btn .spinner,
.atts-head .link-btn .spinner,
.download-note .link-btn .spinner,
.reader .chip-btn .spinner,
.reader-bar .spinner {
  width: 15px;
  height: 15px;
  margin: 0;
  border-color: color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
}
.reader .chip-btn .spinner {
  width: 14px;
  height: 14px;
}
.reader-bar .tbtn .spinner {
  width: 17px;
  height: 17px;
  color: var(--text-2);
}
.reader-bar .icon-btn .spinner {
  width: 18px;
  height: 18px;
}
@media (prefers-reduced-motion: reduce) {
  .att .icon-btn .spinner,
  .atts-head .link-btn .spinner,
  .download-note .link-btn .spinner,
  .reader .chip-btn .spinner,
  .reader-bar .spinner {
    animation-duration: 2s;
  }
}
/* A large email whose text showed first and whose whole download then failed (app.js downloadNoteHtml): one quiet
   line under the attachment cards, with Retry. */
.download-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}
.download-note .link-btn {
  font-size: 12.5px;
}

/* Related emails under the header (app.js relatedHtml): one line per email in a card, newest first. The card folds
   away under its header like the attachments do, and grows back from its top edge. */
.related {
  padding: 14px 0 2px;
}
.related.closed .rel-toggle svg {
  transform: rotate(-90deg);
}
.rel-body {
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 320ms cubic-bezier(0.23, 1, 0.32, 1),
    opacity 320ms cubic-bezier(0.23, 1, 0.32, 1);
}
.related.closed .rel-body {
  grid-template-rows: 0fr;
  opacity: 0;
}
/* Room for the rows' focus ring, which the fold would otherwise clip. */
.rel-clip {
  min-height: 0;
  overflow: hidden;
  margin: 0 -3px;
  padding: 0 3px 3px;
}
.rel-list {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  padding: 4px;
  border-radius: 10px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border);
}
.rel {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px 0 6px;
  border-radius: 6px;
  min-width: 0;
  font-size: 12.5px;
  text-align: left;
  color: var(--text-2);
  transition: background-color 120ms ease;
}
.rel:hover {
  background: var(--hover);
}
.rel-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.rel.unread .rel-dot {
  background: var(--accent);
}
.rel-who {
  flex: 0 1 auto;
  max-width: 34%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text);
}
.rel.unread .rel-who {
  font-weight: 700;
}
.rel-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rel-date {
  flex: none;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.rel-more {
  margin: 6px 0 0 2px;
  font-size: 12.5px;
}
@media (prefers-reduced-motion: reduce) {
  .rel-body {
    transition: none;
  }
}

.mail-frame {
  width: 100%;
  border: 0;
  display: block;
  margin-top: 18px;
  min-height: 120px;
  background: transparent;
}
.loading-bar {
  height: 2px;
  margin: 22px 0 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: shimmer 1s linear infinite;
}
@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}
.reader .error {
  margin-top: 20px;
}

.reader-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-3);
  text-align: center;
  padding: 24px;
}
.reader-empty > svg {
  width: 44px;
  height: 44px;
  opacity: 0.5;
  stroke-width: 1.3;
}
.reader-empty .t {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 600;
}
.reader-empty .keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  font-size: 12px;
  margin-top: 6px;
}
.reader-empty .keys kbd {
  margin-right: 4px;
}
.multi .stack {
  position: relative;
  width: 64px;
  height: 52px;
  margin-bottom: 6px;
}
.multi .stack span {
  position: absolute;
  width: 54px;
  height: 40px;
  border-radius: 8px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.multi .stack span:nth-child(1) {
  left: 0;
  top: 12px;
}
.multi .stack span:nth-child(2) {
  left: 5px;
  top: 6px;
}
.multi .stack span:nth-child(3) {
  left: 10px;
  top: 0;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.multi-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 8px 0 4px;
}
.multi-actions .tbtn {
  background: var(--panel-2);
}

.shell.expanded .sidebar,
.shell.expanded .listpane,
.shell.expanded .divider {
  display: none;
}
.shell.expanded .workspace {
  border-left: 0;
  border-top-left-radius: 0;
}

.narrow-only {
  display: none;
}

/* Narrow windows: one pane at a time. */
@media (max-width: 860px) {
  .listpane {
    width: auto;
    flex: 1;
  }
  .divider {
    display: none;
  }
  .narrow-only {
    display: inline-grid;
  }
  .wide-only {
    display: none;
  }
  .shell.has-message .listpane {
    display: none;
  }
  .shell:not(.has-message) .reader {
    display: none;
  }
}

/* ---------- menus, dialogs, toast ---------- */

.menu {
  position: fixed;
  z-index: 80;
  min-width: 220px;
  max-width: 360px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  box-shadow: var(--shadow);
  animation: pop 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* A menu taller than the window's room for it, capped by showMenu(). */
.menu.scrolls {
  overflow-y: auto;
  overscroll-behavior: contain;
}
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  padding: 0 10px 0 8px;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
}
/* The row under the pointer or the arrow keys: the selected-row grey, as in the suggestion lists. The dark --hover is
   darker than --raised, so it doesn't show on a menu. The current row has that grey too, so the arrow keys' row also
   keeps the focus ring, inside the row as in other lists. */
.menu button:hover,
.menu button:focus-visible {
  background: var(--sel);
}
.menu button:focus-visible {
  outline-offset: -2px;
}
.menu button:disabled {
  opacity: 0.45;
}
.menu .mi {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  flex: none;
}
.menu .mi svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.7;
}
.menu .mi .avatar {
  width: 20px;
  height: 20px;
  font-size: 10px;
}
.menu .ml {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* A row with a second line under its label, such as an account's address under its name. */
.menu button.two {
  padding-top: 5px;
  padding-bottom: 5px;
}
.menu .mt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.menu .mt .ml {
  flex: none;
}
.menu .ms {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu .mh {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.menu kbd {
  border: 0;
  background: none;
  padding: 0;
  margin-left: 12px;
}
.menu button.danger,
.menu button.danger .mi {
  color: var(--danger);
}
.menu button.current {
  background: var(--active);
  font-weight: 600;
}
/* The current row already has the selected-row grey: under the pointer or the arrow keys it goes one step further. */
.menu button.current:hover,
.menu button.current:focus-visible {
  background: var(--sel-strong);
}
.menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 2px;
}
.menu-heading {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  padding: 6px 10px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(10, 12, 18, 0.45);
  display: grid;
  place-items: center;
  animation: fade 120ms ease;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.dialog {
  width: min(420px, calc(100vw - 40px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 20px 16px;
  box-shadow: var(--shadow);
  animation: pop 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: text;
}
.dialog.wide {
  width: min(560px, calc(100vw - 40px));
}
.dialog h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 650;
}
.dialog p {
  color: var(--text-2);
  margin: 0 0 10px;
  line-height: 1.5;
}
.dialog code {
  font-size: 12px;
}
.about-logo {
  display: block;
  height: 36px;
  margin: 2px 0 16px;
}
.dialog .buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.dialog .buttons button {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--panel);
}
.dialog .buttons button:hover {
  background: var(--hover);
}
.dialog .buttons button:last-child,
.dialog .buttons button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.dialog .buttons button.danger {
  color: var(--danger);
}
.dialog .buttons button.danger:first-child:not(:last-child),
.dialog .buttons button.left {
  margin-right: auto;
}
/* White on the light red, the dark ink on dark's lighter red: both keep the label above 4.5:1. */
.dialog .buttons button.danger:last-child {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--on-primary);
}
.choices {
  display: flex;
  flex-direction: column;
  max-height: 50vh;
  overflow-y: auto;
  margin: 0 -8px;
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  text-align: left;
  border-radius: var(--radius);
}
.radio-row:hover {
  background: var(--hover);
}
.radio-row .rl {
  flex: 1;
}
.radio-row .rh {
  font-size: 12px;
  color: var(--text-3);
}
/* Labels that are sentences: the hint goes under the label, and the radio stays with the first line. */
.choices.stacked .radio-row {
  align-items: flex-start;
  padding: 8px;
}
.choices.stacked .radio {
  margin-top: 1px;
}
.choices.stacked .rt {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex: none;
  display: grid;
  place-items: center;
}
.radio.on {
  border-color: var(--accent);
}
.radio.on::after {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  display: flex;
  align-items: center;
  gap: 14px;
  background: #22252d;
  color: #f2f4f8;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 90;
  max-width: min(560px, 80vw);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.show.has-action {
  pointer-events: auto;
}
/* An editor's bar (attach, picture, calendar, Send) runs along the bottom of the reading pane and of a compose window,
   where the notice would cover its buttons and an Undo notice would take their clicks (#260). The notice goes above
   the bar's 54px instead, 12px clear of it. */
body:has(.composer .composer-bar) .toast {
  bottom: 66px;
}
/* A 24px target; the negative margins keep the notice as tall as one without a button. */
.toast button {
  color: #9cc0ff;
  font-weight: 650;
  min-height: 24px;
  padding: 4px 8px;
  margin: -4px -8px -4px 0;
  border-radius: 6px;
  white-space: nowrap;
}
.toast button:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- pages (settings, setup) ---------- */

.page {
  position: fixed;
  inset: 40px 0 0 0;
  z-index: 40;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: slide 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.page-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  min-height: 52px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.page-bar h1 {
  flex: 1;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 48px;
}
.page-inner {
  max-width: 720px;
  margin: 0 auto;
}

/* settings */
.settings-group-title {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  padding: 18px 4px 6px;
}
.settings-group-title:empty {
  padding-top: 8px;
}
/* Settings > Inbox categories: a category row is a button to edit it plus buttons to move it. */
.row.cat-row {
  gap: 4px;
  padding-right: 10px;
}
.cat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 2px 0;
}
.cat-main .text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cat-main .title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.cat-main .desc {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.4;
}
.cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: var(--cat);
}
.cat-colors {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-2);
}
.cat-colors [role='radiogroup'] {
  display: flex;
  gap: 6px;
}
.cat-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cat);
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px var(--border);
}
.cat-swatch[aria-checked='true'] {
  border-color: var(--panel);
  box-shadow: 0 0 0 2px var(--cat);
}
/* The category dialog's switches, Show in Inbox and Notifications: a label with a line under it, and the switch. */
.cat-inbox,
.cat-notify {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 2px 0;
  border-radius: 6px;
  cursor: pointer;
}
.cat-inbox .text,
.cat-notify .text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.cat-inbox .title,
.cat-notify .title {
  font-size: 13px;
  color: var(--text);
}
.cat-inbox .switch,
.cat-notify .switch {
  pointer-events: none;
}
/* Notifications off for all mail: the switch keeps its state, dimmed, and the help under it says why. */
.cat-notify:disabled {
  cursor: default;
}
.cat-notify:disabled .switch {
  opacity: 0.45;
}
/* A category Inbox doesn't show: a crossed-out eye beside its name, here and under Inbox in the sidebar. */
.cat-off {
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--text-3);
}
.cat-off svg {
  width: 14px;
  height: 14px;
}
.cat-main .title .cat-off {
  margin-left: 6px;
  vertical-align: -2px;
}
/* A category whose notifications are off on this computer: a crossed-out bell at the end of its row. */
.cat-muted {
  flex: none;
  margin-left: auto;
  display: flex;
  color: var(--text-3);
}
.cat-muted svg {
  width: 16px;
  height: 16px;
}
/* Settings > Rukoo account: a paragraph between the cards, and the recovery key shown once. */
.settings-text {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  padding: 16px 4px 2px;
  text-wrap: pretty;
  user-select: text;
}
.settings-group-title + .settings-text {
  padding-top: 0;
}
.recovery-key {
  margin: 14px 0 12px;
  padding: 14px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-align: center;
  user-select: all;
  white-space: nowrap;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  position: relative;
  min-height: 52px;
}
.row:not(.static):hover {
  background: var(--hover);
}
/* A switch that can't change now, such as the last tab that shows in Settings > General > Tabs: it keeps its state,
 * dimmed, and the help under it says why. */
.row:disabled {
  cursor: default;
}
.row:disabled:hover {
  background: none;
}
.row:disabled .switch {
  opacity: 0.45;
}
.row + .row::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  border-top: 1px solid var(--border);
}
.row.indent + .row.indent::before {
  left: 60px;
}
.row .text {
  flex: 1;
  min-width: 0;
}
.row .title {
  font-size: 13.5px;
  font-weight: 500;
}
.row .desc {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 2px;
}
.row .value {
  font-size: 12.5px;
  color: var(--accent);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .title.danger {
  color: var(--danger);
}
.row .add-ic {
  color: var(--ok);
  width: 30px;
  display: grid;
  place-items: center;
}
.row .add-ic svg {
  width: 20px;
  height: 20px;
}
.row .avatar.small {
  width: 30px;
  height: 30px;
  font-size: 12px;
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
  color: var(--accent);
}
/* Settings > Accounts: a row is a button that opens the account, with Set as default beside it. */
.row.acc-row {
  padding: 0 16px 0 0;
  gap: 10px;
}
.row.acc-row:hover {
  background: var(--hover);
}
.acc-main {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 10px 16px;
  text-align: left;
}
.acc-main:focus-visible {
  outline-offset: -2px;
  border-radius: var(--radius);
}
.acc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.acc-email {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The default account or address. A state without a status color: field fill, grey text. */
.default-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 9999px;
  background: var(--chip);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}
.switch {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--border-strong);
  position: relative;
  flex: none;
  transition: background 140ms ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.switch.on {
  background: var(--accent);
}
.switch.on::after {
  transform: translateX(16px);
}
.switch-sep {
  display: none;
}
.form {
  display: grid;
  gap: 14px;
  padding: 18px 16px;
}
.form label {
  display: grid;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-2);
}
.mt-title-input,
.form input[type='text'],
.form input[type='email'],
.form input[type='password'],
.form input[type='number'],
.form input[type='date'],
.form input[type='time'],
.form textarea,
.form select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13.5px;
  outline: none;
  user-select: text;
  color: var(--text);
}
.mt-title-input:focus,
.form input:focus,
.form textarea:focus,
.form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form textarea {
  min-height: 110px;
  resize: vertical;
}
.form .two {
  display: grid;
  grid-template-columns: 1fr 110px 100px;
  gap: 10px;
  align-items: end;
}
.form .inline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}
/* A line under a field that says what it is for. */
.form .field-help {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.45;
  text-wrap: pretty;
}
.pw {
  position: relative;
}
.pw .icon-btn {
  position: absolute;
  right: 2px;
  top: 1px;
}
.error {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}
/* "Email me a code", on the line under the error of a locked account (email-code.js). */
.error .code-offer {
  display: flex;
  width: fit-content;
  margin-top: 4px;
  padding: 0;
  font-size: inherit;
}
/* The code step of the account forms (email-code.js): where the code went, the code field and Send a new code, under
   a hairline that sets it apart from the fields above. In the What's new guide it spans the guide's two field
   columns. */
.code-step {
  display: grid;
  gap: 10px;
}
.form > .code-step {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.code-step.compact {
  grid-column: 1 / -1;
  gap: 8px;
}
.code-step .code-sent {
  margin: 0;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.code-step input[name='emailCode'] {
  font-variant-numeric: tabular-nums;
}
.code-step .code-help {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.45;
  text-wrap: pretty;
}
.code-step .code-actions {
  display: flex;
  min-width: 0;
}
.code-step .code-actions .link-btn {
  padding-left: 0;
  white-space: normal;
  text-align: left;
}
.code-step .link-btn:disabled {
  color: var(--text-3);
  cursor: default;
  text-decoration: none;
}
.note {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  background: var(--chip);
  border-radius: 10px;
  padding: 10px 12px;
}
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 8px;
  animation: spin 700ms linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* setup */
.setup-language {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 16px 0 24px;
}
.setup-language select {
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}
.setup {
  display: grid;
  place-items: center;
  overflow-y: auto;
}
.setup-inner {
  width: min(520px, 90vw);
  padding: 32px 0;
}
.setup-logo {
  display: block;
  height: 40px;
  margin: 0 0 26px;
}
.setup h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 650;
  margin: 0 0 6px;
}
.setup-lead {
  color: var(--text-2);
  margin: 0 0 26px;
}
.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.provider {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  aspect-ratio: 1 / 0.82;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.provider:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.provider .logo {
  width: 52px;
  height: 52px;
  background: #fff;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.provider .logo svg {
  width: 36px;
  height: 36px;
}
.setup-demo {
  display: block;
  margin: 28px auto 0;
  color: var(--link);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
}
.setup-demo:hover {
  background: var(--hover);
}
.setup-back {
  position: fixed;
  left: 14px;
  top: 50px;
}
/* The first-run page's way to Settings, for a profile that has some (setup.js): opposite the back button's place. */
.setup-settings {
  position: fixed;
  right: 14px;
  top: 50px;
}
.login-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.login-head .logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.login-head .logo svg {
  width: 30px;
  height: 30px;
}
.login-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}
.login .form {
  padding: 0;
}
.login .actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.login .btn {
  height: 36px;
  padding: 0 18px;
}
/* Above the password field for a provider that only takes an app password: what to enter, and the link to make one. */
.setup-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--chip);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.setup-callout > svg {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: var(--text-2);
}
.setup-callout > div {
  min-width: 0;
}
.setup-callout p {
  margin: 0;
  text-wrap: pretty;
}
.setup-callout .link-btn,
.login .error .link-btn {
  margin: 4px 0 0 -4px;
  white-space: normal;
}
/* Under the Google password form when Rukoo has no Google OAuth client: why, and the way to add one. */
.setup-foot {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.5;
}
.setup-foot p {
  margin: 0;
  text-wrap: pretty;
}
.setup-foot .link-btn {
  margin: 4px 0 0 -4px;
}

/* Team chat without a mail account (RUK-234): under the providers on the first-run page while the account server has
 * team chat and nobody is signed in, and its two steps (the link, then the Rukoo account). */
.setup-chat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 28px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.setup-chat[hidden] {
  display: none;
}
.setup-chat-ic {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--chip);
  color: var(--text-2);
  display: grid;
  place-items: center;
}
.setup-chat-ic svg {
  width: 18px;
  height: 18px;
}
.setup-chat-text {
  flex: 1;
  min-width: 0;
}
.setup-chat h2 {
  margin: 1px 0 2px;
  font-size: 14px;
  font-weight: 600;
  text-wrap: balance;
}
.setup-chat p,
.setup-chat-lead {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  text-wrap: pretty;
}
.setup-chat-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
}
.setup-chat-actions .link-btn {
  margin-left: -4px;
  white-space: normal;
  text-align: left;
}
.login-head .logo.setup-chat-logo {
  background: var(--chip);
  border-color: transparent;
  color: var(--text);
}
.login-head .logo.setup-chat-logo svg {
  width: 22px;
  height: 22px;
}
.login .actions .link-btn {
  white-space: normal;
  text-align: left;
}

/* ---------- composer (inline in the reader, or in a compose window) ---------- */

body.compose-window {
  background: var(--panel);
}
.compose-window .titlebar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.compose-window .titlebar-brand {
  width: auto;
  min-width: 0;
  flex: 1;
  padding-left: 16px;
}
:root[data-controls="left"] .compose-window .titlebar-brand {
  padding-left: calc(16px + env(titlebar-area-x, 0px));
}
.compose-window .titlebar-name {
  font-size: 12.5px;
  color: var(--text);
}

.composer {
  flex: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--panel);
}
.composer-head {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 50px;
  padding: 0 10px 0 22px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.composer-title {
  font-weight: 650;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.composer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 24px 20px;
}
.composer.inline .composer-scroll > * {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}
.compose-fields {
  flex: none;
}
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
  position: relative;
}
.field label {
  color: var(--text-2);
  width: 76px;
  flex: none;
  font-size: 12.5px;
  font-weight: 500;
}
.field input,
.field select {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13.5px;
  min-width: 100px;
  padding: 5px 0;
}
.field select {
  cursor: pointer;
}
.field select option,
.field select optgroup {
  background: var(--raised);
  color: var(--text);
}
.from-static {
  font-size: 13.5px;
  color: var(--text);
}
.cc-links {
  display: flex;
  gap: 2px;
  flex: none;
}
.cc-links .link-btn {
  font-size: 12.5px;
  color: var(--text-2);
  padding: 2px 6px;
}
.cc-links .link-btn:hover {
  color: var(--link);
  text-decoration: none;
}
/* "Use as default account" beside From. Where the window has no room for it, it moves under the address. */
.field.from-field {
  flex-wrap: wrap;
}
.from-default {
  margin-left: auto;
}
.recipients {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-width: 0;
}
.recipients input {
  min-width: 140px;
}
.recipient {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  background: var(--chip);
  border-radius: 12px;
  padding: 0 3px 0 10px;
  font-size: 12.5px;
  max-width: 100%;
}
.recipient.invalid {
  box-shadow: inset 0 0 0 1.5px var(--danger);
}
.recipient[draggable='true'] {
  cursor: grab;
}
.recipient.dragging {
  opacity: 0.4;
}
/* Where a dragged recipient will land: a field of To, Cc and Bcc, or the Cc or Bcc link that opens one. Marked like a
   folder an email is dragged onto (.nav-item.drop-target). The field's band reaches into the composer's side padding,
   so the label doesn't sit on its edge. */
.field.drop-recipient::before {
  content: '';
  position: absolute;
  inset: 3px -8px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  pointer-events: none;
}
.cc-links .link-btn.drop-recipient {
  color: var(--link);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.recipient button {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-3);
}
.recipient button:hover {
  background: var(--active);
  color: var(--text);
}
.recipient button svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}
.suggest {
  position: absolute;
  left: 76px;
  top: calc(100% - 2px);
  z-index: 5;
  min-width: 320px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 4px;
}
.suggest button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border-radius: 6px;
}
/* The keyboard's row, which Enter picks: the selected-row grey, as in the @-mention list. The dark --hover is
   darker than --raised, so it doesn't show on this surface. */
.suggest button.active,
.suggest button:hover {
  background: var(--sel);
}
.suggest .addr {
  color: var(--text-3);
  font-size: 12px;
  opacity: 1;
}
/* @-mentions: the people to mention, under the @ in the text (mentions.js), and the mention itself. */
.suggest.mention-suggest {
  position: fixed;
  z-index: 80;
  display: flex;
  flex-direction: column;
  min-width: 0;
  animation: pop 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: top left;
}
/* mentions.js caps the height to the window; the options scroll and the line under them stays. */
.mention-list {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mention-suggest [role='option'] {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
/* The keyboard's row, which Enter picks: the selected-row grey, which still shows on the raised dark surface. */
.mention-suggest [role='option'].active {
  background: var(--sel);
}
.mention-suggest .avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}
.mention-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mention-who > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mention-name {
  font-weight: 500;
}
.mention-tag {
  flex: none;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--chip);
  color: var(--text-2);
  font-size: 11.5px;
}
.mention-hint {
  flex: none;
  padding: 6px 8px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 11.5px;
}
.editor a.mention {
  padding: 0 3px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--link);
  text-decoration: none;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
@media (prefers-reduced-motion: reduce) {
  .suggest.mention-suggest {
    animation: none;
  }
}
.compose-body {
  /* The frame around a selected image is placed in here. */
  position: relative;
  padding: 16px 0 4px;
  cursor: text;
}
.editor {
  /* Keeps any positioned content from a pasted or reopened mail inside the editor. */
  contain: layout paint;
  position: relative;
  min-height: 96px;
  outline: none;
  font-size: 14.5px;
  line-height: 1.6;
  user-select: text;
  word-wrap: break-word;
  cursor: text;
}
.editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
}
/* Signatures in the editor and in Settings; see the --signature tokens. */
.editor .signature,
.sig-render {
  color: var(--signature-ink);
  filter: var(--signature-filter);
}
.editor .signature img,
.sig-render img {
  max-width: 100%;
  filter: var(--signature-filter);
}
.editor .signature a,
.sig-render a {
  color: var(--signature-link);
}
.editor img {
  max-width: 100%;
}
.editor a {
  color: var(--link);
}
/* Earlier messages hide behind a "···" pill, as in Gmail. */
.quote-zone {
  margin-top: 10px;
}
.quote-pill {
  height: 20px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--chip);
  color: var(--text-2);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 20px;
}
.quote-pill:hover {
  background: var(--active);
  color: var(--text);
}
.quote-pill.excluded {
  letter-spacing: 0;
  font-weight: 500;
  text-decoration: line-through;
}
.quote {
  margin-top: 10px;
  border-left: 2px solid var(--border-strong);
  padding-left: 14px;
  transition: opacity 120ms ease;
  cursor: default;
}
.quote.excluded {
  opacity: 0.4;
}
.quote-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.quote-bar .link-btn {
  font-size: 12px;
}
.quote-head {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
  white-space: pre-wrap;
  user-select: text;
}
.quote-frame {
  width: 100%;
  border: 0;
  margin-top: 12px;
  min-height: 80px;
}
.compose-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0 0;
}
.compose-attachments:empty {
  display: none;
}
.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  border-radius: var(--radius);
  padding: 0 3px 0 8px;
  font-size: 12.5px;
  max-width: 320px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border);
}
.att-chip > svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  flex: none;
}
.att-chip .n {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-chip .s {
  color: var(--text-3);
  font-size: 11.5px;
  flex: none;
}
.att-chip button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--text-3);
}
.att-chip button:hover {
  background: var(--hover);
  color: var(--text);
}
.att-chip button svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}
.format-row {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 4px 12px;
  border-top: 1px solid var(--border);
  flex: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.format-row .sep,
.float-bar .sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 5px;
  flex: none;
}
.composer-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 54px;
  padding: 0 14px 0 12px;
  border-top: 1px solid var(--border);
  flex: none;
}
.save-state {
  font-size: 12px;
  color: var(--text-3);
  margin-right: 10px;
  white-space: nowrap;
}
.send-btn {
  height: 34px;
  padding: 0 14px 0 16px;
}
.float-bar {
  position: absolute;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 3px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  animation: pop 100ms ease;
}
/* Links in the text (editor-links.js), for mail and meeting notes: the bubble under a link at the caret and the
   popover Ctrl+K opens. Both are popovers in the top layer, so no pane clips them; the script places them. */
.link-bubble,
.img-bubble,
.link-pop {
  position: fixed;
  inset: auto;
  margin: 0;
  max-width: calc(100vw - 16px);
  overflow: visible;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform-origin: top left;
  animation: pop 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.link-bubble,
.img-bubble {
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 10px;
  font-size: 12.5px;
}
.link-bubble:popover-open,
.img-bubble:popover-open {
  display: flex;
}
/* In a window too narrow for one row, such as a compose window at 200% zoom, the image bar's buttons wrap. The script
   drops the separator then, as it would end the first row. */
.img-bubble {
  flex-wrap: wrap;
}
.img-bubble[data-wrapped] .sep {
  display: none;
}
.link-bubble button,
.img-bubble button {
  flex: none;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}
.link-bubble button:hover,
.img-bubble button:hover {
  background: var(--hover);
  color: var(--text);
}
.link-bubble button:active,
.img-bubble button:active {
  background: var(--active);
}
/* The address gives way first in a narrow window; Change and Remove keep their words. */
.link-bubble .link-go {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--link);
}
.link-bubble .link-go:hover {
  color: var(--link);
}
.link-go svg {
  flex: none;
  width: 14px;
  height: 14px;
}
/* In a narrow window the path gives way before the site, and the site loses its start: the end of the host, which
   names where the link goes, stays in view. */
.link-go-url {
  display: flex;
  min-width: 0;
}
.link-go-site,
.link-go-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-go-site {
  flex: 0 1 auto;
  direction: rtl;
}
.link-go-site bdi {
  direction: ltr;
}
.link-go-path {
  flex: 0 1000 auto;
}
.link-bubble .sep,
.img-bubble .sep {
  flex: none;
  width: 1px;
  height: 16px;
  margin: 0 3px;
  background: var(--border);
}
.link-pop {
  width: 360px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-radius: 14px;
}
.link-pop:popover-open {
  display: grid;
}
.link-pop label {
  display: contents;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}
.link-pop input {
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  outline: none;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  user-select: text;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.link-pop input::placeholder {
  color: var(--text-3);
}
.link-pop input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.link-pop label:first-child input {
  grid-column: 2 / 4;
}
.link-pop .btn {
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  .link-bubble,
  .img-bubble,
  .link-pop {
    animation: none;
  }
}
/* A selected image in the text: a frame with a handle on each corner, and a bar under it that looks like the
   link's bubble (editor-images.js). */
.editor img::selection {
  background: transparent;
}
.img-frame {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  border: 1px solid var(--accent);
  pointer-events: none;
}
.img-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border: 1px solid var(--raised);
  border-radius: 2px;
  pointer-events: auto;
  touch-action: none;
}
/* A larger target than the square that shows. */
.img-handle::before {
  content: '';
  position: absolute;
  inset: -7px;
}
.img-handle[data-corner='nw'] {
  left: -5px;
  top: -5px;
  cursor: nwse-resize;
}
.img-handle[data-corner='ne'] {
  right: -5px;
  top: -5px;
  cursor: nesw-resize;
}
.img-handle[data-corner='sw'] {
  left: -5px;
  bottom: -5px;
  cursor: nesw-resize;
}
.img-handle[data-corner='se'] {
  right: -5px;
  bottom: -5px;
  cursor: nwse-resize;
}
.img-bubble button[aria-pressed='true'] {
  background: var(--sel);
  color: var(--text);
}
.color-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.compose-error {
  padding: 40px 24px;
  display: grid;
  gap: 16px;
  justify-items: start;
}
.composer.drop-files::after {
  content: attr(data-drop-hint);
  position: absolute;
  inset: 8px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--accent);
  pointer-events: none;
  z-index: 50;
}
/* While files are dragged over it, the composer itself takes the drop rather than what is in it, like the chat panel
   (.agentpane.is-drop): a drop that went to an element drawn again just before it never reached the composer. */
.composer.drop-files * {
  pointer-events: none;
}

/* The composer's free-times dialog: four choices in a grid, then a preview of what goes into the message, drawn as
   message text. */
.free-times-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.free-times-grid label {
  min-width: 0;
}
.free-preview-label {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 2px;
}
.free-preview {
  min-height: 132px;
  max-height: 260px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  user-select: text;
}
.free-preview ul {
  margin: 4px 0;
  padding-left: 20px;
  font-variant-numeric: tabular-nums;
}
.free-preview a {
  color: var(--link);
  overflow-wrap: anywhere;
}
.free-preview-note {
  display: flex;
  align-items: center;
  margin: 0;
  color: var(--text-2);
}
.free-preview-note + .free-preview-note {
  margin-top: 6px;
}
.free-preview-note.warn {
  color: var(--warn);
}
.free-preview-note.error {
  color: var(--danger);
}
.free-preview-note .spinner {
  border-color: color-mix(in srgb, var(--text-3) 40%, transparent);
  border-top-color: var(--text-2);
}

/* ---------- chat panel ---------- */

/* Docked beside the workspace in wide windows, on the canvas like the folders, so the list and the email
   stay one white card in the middle. The divider is only a resize handle; the card's edge is the line.
   No width transition while docked: the mail frame refits on every resize. */
.shell.agent-open .workspace {
  border-right: 1px solid var(--border);
  border-top-right-radius: 12px;
}
.agent-divider {
  display: none;
  width: 1px;
  flex: none;
  background: transparent;
  position: relative;
  cursor: col-resize;
  z-index: 3;
}
.agent-divider::before {
  content: '';
  position: absolute;
  inset: 0 -4px;
}
.agent-divider:hover,
.agent-divider.dragging,
.agent-divider:focus-visible {
  background: var(--accent);
  outline: none;
  box-shadow: 0 0 0 1px var(--accent);
}
.agentpane {
  display: none;
  flex: none;
  width: var(--agent-w, 380px);
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: var(--bg);
  container-type: inline-size;
  container-name: agent;
}
.shell.agent-open .agent-divider {
  display: block;
}
.shell.agent-open .agentpane {
  display: flex;
}
/* Narrower windows: the panel slides over the reader instead of squeezing it. */
@media (max-width: 1239px) {
  .shell.agent-open .agent-divider {
    display: none;
  }
  .shell.agent-open .workspace {
    border-right: 0;
    border-top-right-radius: 0;
  }
  .agentpane {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .shell.agent-open .agentpane {
    animation: agent-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
}
/* Narrow windows: one pane at a time, the chat included. */
@media (max-width: 860px) {
  .agentpane {
    /* The rail stays visible; the chat covers the workspace. */
    left: var(--sidebar-w);
    width: auto;
    border-left: 0;
    box-shadow: none;
  }
}
@keyframes agent-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .shell.agent-open .agentpane {
    animation: none;
  }
}

/* Same height as the reader toolbar, so the hairlines line up. */
.agentpane .ap-head {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 50px;
  padding: 0 8px 0 14px;
  flex: none;
}
.agentpane .ap-mono {
  display: flex;
  flex: none;
  margin-right: 8px;
}
.agentpane .ap-who {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.agentpane .ap-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.agentpane .ap-agent {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agentpane .ap-title {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The bell opens the list of chats. With news it widens into a tinted pill with the count: blue for answers you have
 * not seen, orange when an agent waits for your approval. */
.agentpane .ap-bell.has-news {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px 0 6px;
  background: var(--accent-tint);
  color: var(--accent-ink);
}
.agentpane .ap-bell.has-news:hover {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}
.agentpane .ap-bell.has-news[data-tone='waiting'] {
  background: var(--orange-tint);
  color: var(--orange);
}
.agentpane .ap-bell.has-news[data-tone='waiting']:hover {
  background: color-mix(in srgb, var(--orange) 24%, transparent);
}
.agentpane .ap-count {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.agentpane .ap-dot,
.agent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--text-3);
  opacity: 0.7;
}
.agentpane .ap-dot[data-state='ready'],
.agent-dot[data-state='ready'] {
  background: var(--ok);
  opacity: 1;
}
.agentpane .ap-dot[data-state='offline'],
.agent-dot[data-state='offline'] {
  background: var(--danger);
  opacity: 1;
}
.agentpane .ap-dot[data-state='starting'],
.agent-dot[data-state='starting'] {
  animation: pulse 1.2s ease-in-out infinite;
}

.agentpane .ap-body {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}
.agentpane .ap-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 20px;
  outline: none;
  user-select: text;
}
.agentpane .ap-transcript {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.agentpane .ap-item {
  min-width: 0;
}
.agentpane .ap-item.is-stopped {
  opacity: 0.75;
}
.agentpane .ap-jump {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--raised);
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  animation: pop 120ms ease;
}
.agentpane .ap-jump:hover {
  color: var(--text);
}
.agentpane .ap-jump svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}
/* While files or emails are dragged over the panel: where they go, and the input that takes them. */
.agentpane .ap-drop {
  position: absolute;
  inset: 10px 10px 4px;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1.5px dashed var(--accent);
  border-radius: 14px;
  background: color-mix(in oklab, var(--accent) 9%, var(--bg));
  color: var(--link);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  pointer-events: none;
}
.agentpane.is-drop .ap-drop {
  display: flex;
  animation: pop 120ms ease;
}
/* The panel itself takes the drop, not what is in it. The empty state and the transcript are drawn again as the
   agent's status and replies come in; a drop that went to an element that just left the page never reached the panel. */
.agentpane.is-drop * {
  pointer-events: none;
}
.agentpane.is-drop .bui-pb__box {
  border-color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  .agentpane.is-drop .ap-drop {
    animation: none;
  }
}
.agentpane .ap-empty {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}
.agentpane .ap-actions {
  flex-wrap: wrap;
}
.agentpane .ap-foot {
  flex: none;
  padding: 0 10px 10px;
}
/* In the input while the agent cannot take a message: why, and the way to Settings. */
/* A long custom agent name (up to 40 characters) wraps the sentence and ends the link in an ellipsis, inside the input. */
.agentpane .ap-setup {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.agentpane .ap-setup .link-btn {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: inherit;
  padding: 1px 2px;
}
/* The technical cause of an error, small, under the sentence that explains it. */
.agentpane .ap-detail {
  margin: 1px 0 0 24px;
  font-family: 'Cascadia Mono', Consolas, ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-3);
  overflow-wrap: anywhere;
  user-select: text;
}
/* The components' scoped reset squares off buttons; the panel's own chrome keeps Rukoo's shapes. */
.agentpane .icon-btn {
  border-radius: var(--radius);
}
.agentpane .icon-btn:disabled {
  opacity: 0.35;
}
.agentpane .link-btn {
  border-radius: 6px;
}

/* ---------- agent drafts in the composer ---------- */

.agent-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-right: 10px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.agent-mark svg {
  width: 14px;
  height: 14px;
  flex: none;
  stroke-width: 1.7;
  color: var(--accent);
}
.agent-mark-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-mark .link-btn {
  font-size: 12px;
  padding: 1px 3px;
}
@container reader (max-width: 440px) {
  .agent-mark-text {
    display: none;
  }
}

/* ---------- settings: agents ---------- */

.settings-intro {
  margin: 8px 4px 2px;
  max-width: 580px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
}
.settings-group-title.agent-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.agent-product {
  font-weight: 500;
  color: var(--text-3);
  opacity: 0.75;
}
.agent-status .agent-dot {
  width: 8px;
  height: 8px;
  margin: 0 3px 0 2px;
}
.row.static {
  cursor: default;
}
.row .agent-detail {
  font-family: 'Cascadia Mono', Consolas, ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: text;
}
.row .agent-detail:empty {
  display: none;
}
/* Main's note under the address, e.g. that the chosen port was taken. */
.row .agent-note {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-3);
}
.agent-card .agent-form {
  position: relative;
  gap: 12px;
  padding: 14px 16px 16px;
}
.agent-card .agent-form::before,
.agent-card .agent-form + .row::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  border-top: 1px solid var(--border);
}
.agent-form .pw input {
  padding-right: 38px;
}
.agent-form .pw .icon-btn {
  top: 2px;
}
.agent-key-box {
  display: grid;
  gap: 8px;
}
.agent-key {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  font-size: 12.5px;
  color: var(--text-2);
}
.agent-key-saved {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
}
.agent-key-saved svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  color: var(--ok);
}
.agent-key-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- settings: phone ---------- */

/* A paired phone's row leads with a phone, in the column the add row's plus uses. */
.row .phone-ic {
  color: var(--text-2);
  width: 30px;
  display: grid;
  place-items: center;
}
.row .phone-ic svg {
  width: 20px;
  height: 20px;
}
/* The pairing dialog: this computer's address and the code, as label and value rows on a field-colored panel. */
.phone-pair {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px 16px;
  margin: 14px 0 12px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.phone-pair dt {
  font-size: 12px;
  color: var(--text-3);
}
.phone-pair dd {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-family: 'Cascadia Mono', Consolas, ui-monospace, monospace;
  overflow-wrap: anywhere;
  user-select: text;
}
.phone-pair-address {
  font-size: 12.5px;
}
.phone-pair-code {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.phone-pair-code.gone {
  color: var(--text-3);
  text-decoration: line-through;
}
.dialog p.phone-pair-time {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.dialog p.phone-pair-time.ended {
  color: var(--danger);
}
.dialog p.phone-pair-note {
  margin: 8px 0 0;
  font-size: 12px;
}

/* ---------- settings: shortcuts ---------- */

/* A row per shortcut: the part that opens the editor, then move up, move down and the switch. Each is its own
   button, so the row is a static one. */
.shortcut-row {
  gap: 2px;
  padding: 6px 10px 6px 6px;
}
.shortcut-main {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 6px 4px;
  border-radius: var(--radius);
  text-align: left;
  transition: background-color 120ms ease;
}
.shortcut-main:hover {
  background: var(--hover);
}
.shortcut-main .title,
.shortcut-main .desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shortcut-lead {
  display: grid;
  width: 30px;
  flex: none;
  place-items: center;
  color: var(--text-2);
}
/* Turned off: still there to edit and move, quieter. */
.shortcut-row.is-hidden .title,
.shortcut-row.is-hidden .shortcut-lead {
  color: var(--text-3);
}
.shortcut-switch {
  display: grid;
  flex: none;
  place-items: center;
  height: 32px;
  margin-left: 6px;
  padding: 0 4px;
  border-radius: var(--radius);
}
.shortcut-form .shortcut-command {
  position: relative;
  display: block;
}
.shortcut-form .shortcut-command > span {
  position: absolute;
  top: 50%;
  left: 11px;
  transform: translateY(-50%);
  font-size: 13.5px;
  color: var(--text-3);
  pointer-events: none;
}
.form .shortcut-command input[type='text'] {
  padding-left: 20px;
}
.form .shortcut-command input:disabled {
  color: var(--text-2);
  background: var(--chip);
  cursor: default;
}
.shortcut-field {
  display: grid;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-2);
}
.shortcut-field .choices {
  color: var(--text);
}
.shortcut-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.shortcut-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: var(--radius);
  color: var(--text-2);
  transition: background-color 120ms ease, color 120ms ease;
}
.shortcut-icon:hover {
  background: var(--hover);
  color: var(--text);
}
.shortcut-icon[aria-checked='true'] {
  background: var(--active);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* Settings > Calendar: weekday toggles, the working hours' two time fields, and per calendar a colour swatch and the
   "counts toward availability" switch. */
.calset-days {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}
.calset-day {
  min-width: 40px;
  height: 28px;
  padding: 0 8px;
  border-radius: 9999px;
  background: var(--chip);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.calset-day:hover {
  color: var(--text);
}
.calset-day[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--link);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.calset-hours {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  flex: none;
}
.calset-hours input,
.booking-range input {
  height: 30px;
  padding: 0 8px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  user-select: text;
}
.calset-hours input:focus,
.booking-range input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.calset-hours input[aria-invalid='true'],
.booking-setup [aria-invalid='true'],
.booking-type [aria-invalid='true'] {
  border-color: var(--danger) !important;
}
.calset-error:empty {
  display: none;
}
.calset-error {
  font-size: 12.5px;
  margin-top: 4px;
}
.calset-account {
  color: var(--text-3);
  font-size: 12px;
  padding: 14px 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calset-cal {
  gap: 12px;
}
.calset-swatch {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  background: var(--cal);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
  transition: transform 120ms ease;
}
.calset-swatch:hover {
  transform: scale(1.12);
}
.calset-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  min-height: 32px;
  padding: 0 4px;
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: 12px;
}
.calset-switch:hover {
  color: var(--text-2);
}
.calset-palette {
  display: grid;
  grid-template-columns: repeat(6, 28px);
  gap: 10px;
  padding: 4px 2px 8px;
}
.calset-palette .cat-swatch {
  width: 28px;
  height: 28px;
}
@media (max-width: 620px) {
  .calset-switch-label {
    display: none;
  }
  .calset-days-row,
  .calset-hours-row {
    flex-wrap: wrap;
  }
}

/* Settings > Booking page. */
.booking-handle {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.booking-handle:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* Its own width, up to 55%: a long server address keeps its end, next to the handle, and loses its start behind an
   ellipsis (rtl puts the overflow on the left; the inner span stays ltr). */
.booking-handle-base {
  flex-shrink: 0;
  align-self: center;
  padding: 0 2px 0 10px;
  color: var(--text-3);
  font-size: 13.5px;
  white-space: nowrap;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl;
  text-align: left;
}
.form .booking-handle input[type='text'] {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding-left: 0;
  min-width: 0;
}
.form .booking-handle:has([aria-invalid='true']) {
  border-color: var(--danger);
}
.form .booking-status.ok {
  color: var(--ok);
}
.form .booking-status.error {
  color: var(--danger);
}
.booking-field {
  display: grid;
  gap: 3px;
  font-size: 12.5px;
  color: var(--text-2);
}
.booking-field-value {
  color: var(--text);
  font-size: 13.5px;
}
.booking-cals {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.booking-cals legend {
  padding: 0;
  margin-bottom: 2px;
  font-size: 12.5px;
  color: var(--text-2);
}
.booking-cal-account {
  margin-top: 6px;
  color: var(--text-3);
  font-size: 12px;
}
.form .booking-cal {
  align-items: flex-start;
}
.booking-cal input {
  margin-top: 2px;
}
.booking-cal-name {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.booking-cal-note {
  color: var(--text-3);
  font-size: 12px;
}
.booking-done {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 8px;
  padding: 14px 16px;
  animation: slide 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.booking-done-text {
  flex: 1 1 260px;
  min-width: 0;
}
.booking-done-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
}
.booking-done-title svg {
  width: 16px;
  height: 16px;
  color: var(--ok);
}
.booking-url {
  user-select: text;
  overflow-wrap: anywhere;
}
.booking-done .booking-url {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 12.5px;
}
.booking-done-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.booking-added {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 12.5px;
}
.booking-added svg {
  width: 15px;
  height: 15px;
  color: var(--ok);
}
.booking-link-row {
  flex-wrap: wrap;
  gap: 8px 10px;
}
.booking-link-row .text {
  flex: 1 1 220px;
}
.booking-link-row .btn,
.booking-done .btn {
  gap: 6px;
}
.booking-item,
.booking-notice {
  gap: 12px;
  align-items: flex-start;
}
.booking-item .title {
  display: flex;
  min-width: 0;
  gap: 4px;
}
.booking-guest {
  user-select: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.booking-type-name {
  color: var(--text-2);
  font-weight: 400;
  white-space: nowrap;
}
.booking-notes {
  user-select: text;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-3) !important;
}
.booking-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex: none;
  align-self: center;
}
/* Also a row's second line, whose own color would win in the dark theme. */
.booking-warn,
.row .desc.booking-warn {
  color: var(--warn);
}
:root.light .booking-warn {
  color: color-mix(in srgb, var(--warn) 55%, var(--text));
}
.booking-notice-ic {
  display: grid;
  place-items: center;
  width: 20px;
  margin-top: 1px;
  color: var(--text-3);
  flex: none;
}
.booking-notice-ic svg {
  width: 16px;
  height: 16px;
}
.booking-notice.warn .booking-notice-ic {
  color: var(--warn);
}
.booking-notice.error .booking-notice-ic {
  color: var(--danger);
}
.booking-notices {
  margin-top: 8px;
}
.booking-empty {
  padding-top: 0;
}
.booking-device .btn {
  align-self: center;
}
/* Settings > Video meetings: a service's state as a dot, its buttons on the right. */
.video-service {
  gap: 8px 14px;
  flex-wrap: wrap;
}
.video-service .text {
  flex: 1 1 220px;
  min-width: 0;
}
.video-dot {
  width: 8px;
  height: 8px;
  margin: 0 2px;
  border-radius: 50%;
  flex: none;
  align-self: center;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--text-3);
}
.video-dot[data-state='connected'] {
  background: var(--ok);
  box-shadow: none;
}
.video-dot[data-state='renew'] {
  background: var(--warn);
  box-shadow: none;
}
.video-dot[data-state='spacer'] {
  visibility: hidden;
}
.video-dot[data-state='busy'] {
  box-shadow: inset 0 0 0 1.5px var(--warn);
  animation: pulse 1.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .video-dot[data-state='busy'] {
    animation: none;
  }
}
.booking-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.booking-form-actions .spacer {
  flex: 1;
}
.booking-hours-form .booking-form-actions {
  padding: 16px 4px 0;
}
.booking-form-error:empty {
  display: none;
}
.booking-form-error {
  padding: 10px 4px 0;
}
.danger-text {
  color: var(--danger);
}
.booking-location {
  display: grid;
  gap: 10px;
}
.booking-location[hidden],
[data-location-label][hidden],
[data-default-length][hidden] {
  display: none;
}
/* The meeting type editor's Available durations: a row of pills, each a checkbox, the picked ones tinted like the
   weekdays in Settings > Calendar. */
.booking-lengths {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.booking-lengths legend {
  padding: 0;
  margin-bottom: 2px;
  font-size: 12.5px;
  color: var(--text-2);
}
.booking-length-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.form .booking-length {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 9999px;
  background: var(--chip);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.form .booking-length:hover {
  color: var(--text);
}
.form .booking-length:active {
  scale: 0.96;
}
.booking-length input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.form .booking-length:has(input:checked) {
  background: var(--accent-soft);
  color: var(--link);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.booking-length:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
/* The meeting type editor's sections (When guests can book, More options): a hairline above, and a heading that
   folds the section and turns its chevron when open. */
.booking-section {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  container: booking-section / inline-size;
}
.booking-section summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  padding: 4px 6px 4px 2px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.booking-section summary::-webkit-details-marker {
  display: none;
}
.booking-section summary svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--text-3);
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), color 120ms ease;
}
.booking-section summary:hover svg {
  color: var(--text);
}
.booking-section[open] summary svg {
  transform: rotate(90deg);
}
.booking-section[open] > :not(summary) {
  animation: fade 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
/* Fields in the pairs they form (free time; notice and how far ahead; start times and the limit), with a full-width
   help line under a pair. One column where two don't fit, at a narrow window or a high zoom. */
.booking-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-top: 4px;
}
.form .booking-grid-help {
  grid-column: 1 / -1;
  margin-top: -7px;
}
@container booking-section (max-width: 440px) {
  .booking-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.booking-day {
  gap: 12px;
  align-items: center;
}
.booking-day-name {
  width: 150px;
  flex: none;
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.booking-ranges {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.booking-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
}
.booking-unavailable,
.booking-blocked {
  color: var(--text-3);
  font-size: 13px;
  line-height: 30px;
}
@media (max-width: 620px) {
  .booking-day {
    flex-wrap: wrap;
  }
  .booking-day-name {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .booking-done,
  .booking-section[open] > :not(summary) {
    animation: none;
  }
  .booking-section summary svg,
  .calset-swatch,
  .form .booking-length {
    transition: none;
  }
}

/* ---------- calendar ---------- */

/* The calendar takes the place of the list and the reader. Search looks through mail, so it waits for Mail. */
.calendar {
  display: none;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  --gutter: 56px;
}
.shell.calendar-mode .calendar {
  display: flex;
}
.shell.calendar-mode .listpane,
.shell.calendar-mode .divider,
.shell.calendar-mode .reader {
  display: none;
}
body.calendar-mode .titlebar-search {
  visibility: hidden;
}

.cal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 10px 18px;
  min-height: 56px;
}
.cal-head-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
.cal-nav .tbtn {
  margin-right: 4px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.cal-nav .tbtn:hover {
  background: var(--hover);
}
.cal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.cal-busy {
  display: inline-flex;
  color: var(--text-3);
}
.cal-busy .spinner {
  width: 13px;
  height: 13px;
  margin: 0;
  border-color: color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
}
.cal-head .segmented {
  margin-left: 8px;
}

.cal-notices {
  display: grid;
  gap: 6px;
  padding: 0 12px 10px 18px;
}
.cal-notices:empty {
  display: none;
}
.cal-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  box-shadow: var(--shadow-sm);
}
.cal-notice .ic svg {
  width: 18px;
  height: 18px;
  display: block;
  color: var(--text-2);
}
.cal-notice.error .ic svg {
  color: var(--danger);
}
.cal-notice .text {
  flex: 1;
  min-width: 0;
}
.cal-notice .t {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.cal-notice .d {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
  text-wrap: pretty;
}

.cal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.cal-grid-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* The day names, the all-day row and the grid share their columns; each keeps room for the grid's scrollbar. */
.cal-days,
.cal-allday,
.cal-grid {
  display: grid;
  grid-template-columns: var(--gutter) repeat(var(--days), minmax(0, 1fr));
}
.cal-days,
.cal-allday,
.cal-scroll {
  scrollbar-gutter: stable;
}
.cal-days {
  overflow: hidden;
  padding: 2px 0 4px;
}
.cal-dayhead {
  height: 54px;
  margin: 0 3px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  transition: color 120ms ease, background-color 120ms ease;
}
.cal-dayhead:hover {
  color: var(--text);
  background: var(--hover);
}
.cal-dayhead .dow {
  font-size: 11.5px;
  color: var(--text-3);
}
.cal-dayhead .dom {
  height: 28px;
  min-width: 28px;
  padding: 0 6px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.cal-dayhead.today .dow {
  color: var(--text);
}
.cal-dayhead.today .dom {
  background: var(--primary);
  color: var(--on-primary);
}

.cal-allday {
  grid-auto-rows: 26px;
  max-height: 84px;
  min-height: 30px;
  padding: 1px 0 3px;
  overflow-y: auto;
  border-bottom: 1px solid var(--border);
}
.cal-allday-label {
  grid-row: 1;
  grid-column: 1;
  align-self: center;
  justify-self: end;
  padding-right: 8px;
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}
.cal-allday-cell {
  cursor: pointer;
}

/* Events are soft cards in their calendar's colour: a tint, rounded corners and a little room around each, no
   edges. The tint is that colour at a set lightness, with its chroma capped. Calendars come in every lightness,
   Google's pastels beside deep blues, and a share of each mixed into the panel left the pastels nearly white; this
   way every calendar shows at the same strength and its text at the same contrast, and a grey one stays grey.
   Each level is a lightness (-l) and a chroma cap (-c); which one applies depends on the theme, on hover, on the
   open card and on the answer to an invitation. */
.calendar,
.cal-pop {
  --ev-l: 0.34;
  --ev-c: 0.05;
  --ev-hover-l: 0.38;
  --ev-hover-c: 0.055;
  --ev-pale-l: 0.265;
  --ev-pale-c: 0.025;
  --ev-open-l: 0.43;
  --ev-open-c: 0.07;
}
:root.light .calendar,
:root.light .cal-pop {
  --ev-l: 0.93;
  --ev-c: 0.055;
  --ev-hover-l: 0.905;
  --ev-hover-c: 0.065;
  --ev-pale-l: 0.965;
  --ev-pale-c: 0.022;
  --ev-open-l: 0.87;
  --ev-open-c: 0.08;
}
.cal-chip,
.cal-ev {
  --tint: oklch(from var(--c) var(--ev-l) min(c, var(--ev-c)) h);
  background: var(--tint);
  color: var(--text);
  text-align: left;
  transition: background-color 120ms ease;
}
.cal-chip:hover,
.cal-ev:hover {
  --tint: oklch(from var(--c) var(--ev-hover-l) min(c, var(--ev-hover-c)) h);
}
.cal-chip {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 22px;
  margin: 2px 3px;
  padding: 0 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
}
.cal-chip .t {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* An event that goes on before or after the days on screen runs off the edge. */
.cal-chip.cont-l {
  margin-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.cal-chip.cont-r {
  margin-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.cal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.cal-grid {
  position: relative;
}
.cal-hours {
  position: relative;
}
.cal-hour {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
/* Only the hours are ruled; the days are told apart by the room between their events. */
.cal-col {
  position: relative;
  container-type: inline-size;
  background-image: linear-gradient(var(--border) 1px, transparent 1px);
  background-size: 100% 56px;
  cursor: pointer;
}
.cal-col.today {
  background-color: var(--panel-2);
}
.cal-ev {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 8px;
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
  line-height: 15px;
}
.cal-ev .t {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-ev .w {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.cal-ev .w svg {
  width: 12px;
  height: 12px;
  stroke-width: 1.8;
  flex: none;
}
.cal-ev .w > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-ev.short {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding-top: 0;
  padding-bottom: 0;
}
.cal-ev.short .t {
  flex: 0 1 auto;
  min-width: 2.5em;
}
/* Where a short event is narrow, its time gives way before its title, and in a narrow day it goes. */
.cal-ev.short .w {
  flex: 0 100 auto;
  min-width: 0;
  text-overflow: clip;
}
@container (max-width: 140px) {
  .cal-ev.short .w {
    display: none;
  }
}
/* An invitation that waits for an answer is a pale card with a dot in the account's colour before its title;
   maybe is striped; declined fades and is struck through. */
.cal-ev.needs,
.cal-chip.needs {
  --tint: oklch(from var(--c) var(--ev-pale-l) min(c, var(--ev-pale-c)) h);
}
.cal-ev.needs:hover,
.cal-chip.needs:hover {
  --tint: oklch(from var(--c) var(--ev-l) min(c, var(--ev-c)) h);
}
.cal-ev.needs .t::before,
.cal-chip.needs .t::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--c);
  vertical-align: 1px;
}
.cal-ev.maybe,
.cal-chip.maybe {
  background: repeating-linear-gradient(135deg, var(--tint) 0 6px, oklch(from var(--c) var(--ev-pale-l) min(c, var(--ev-pale-c)) h) 6px 12px);
}
.cal-ev.declined,
.cal-chip.declined {
  --tint: oklch(from var(--c) var(--ev-pale-l) min(c, var(--ev-pale-c)) h);
  color: var(--text-3);
}
.cal-ev.declined .t,
.cal-chip.declined .t {
  text-decoration: line-through;
}
.cal-ev.declined .w {
  color: var(--text-3);
}
/* The event whose card is open stands out by a deeper tint and a lift. On the deeper tint every line uses the
   full ink, a declined one too; its strike-through still says it is declined. */
.cal-ev.open,
.cal-chip.open {
  z-index: 2;
  --tint: oklch(from var(--c) var(--ev-open-l) min(c, var(--ev-open-c)) h);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.cal-ev.open .w {
  color: var(--text);
}
.cal-now {
  position: absolute;
  left: -1px;
  right: 0;
  height: 2px;
  margin-top: -1px;
  background: var(--primary);
  z-index: 3;
  pointer-events: none;
}
.cal-now::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.cal-list-inner {
  max-width: 820px;
  padding: 0 18px 24px 10px;
}
.cal-list-day {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}
.cal-list-day h2 {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 16px 4px 4px;
  background: var(--panel);
  font-size: 13px;
  font-weight: 600;
}
.cal-list-day h2 .sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}
/* A row is a soft card in its account's colour, like the events in the week. Everything in it hangs from the
   first line: the time, the dot, the title, a pill and the guests. */
.cal-row {
  --tint: oklch(from var(--c) var(--ev-pale-l) min(c, var(--ev-pale-c)) h);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--tint);
  text-align: left;
  line-height: 18px;
  transition: background-color 120ms ease;
}
.cal-row:hover,
.cal-row.open {
  --tint: oklch(from var(--c) var(--ev-l) min(c, var(--ev-c)) h);
}
.cal-row-time {
  width: 104px;
  flex: none;
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.cal-row-time > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-row-time .rel {
  font-size: 11.5px;
  color: var(--text-3);
}
.cal-row-time .rel.now {
  color: var(--text);
  font-weight: 600;
}
.cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}
.cal-row .cal-dot {
  margin-top: 5px;
}
.cal-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-row-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-row-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-2);
}
.cal-row-sub .m {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}
.cal-row-sub .m svg {
  width: 13px;
  height: 13px;
  flex: none;
  color: var(--text-3);
}
.cal-row-sub .m span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-row.declined .cal-row-title {
  color: var(--text-3);
  text-decoration: line-through;
}
/* The guests: faces that overlap, each ringed in the row's own colour. */
.cal-people {
  display: flex;
  align-items: center;
  flex: none;
  margin: -3px 0 -3px 3px;
}
.cal-people .avatar {
  width: 24px;
  height: 24px;
  margin-left: -3px;
  font-size: 9.5px;
  box-shadow: 0 0 0 2px var(--tint);
}
.cal-people-more {
  margin-left: 6px;
  font-size: 11.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
/* The list measures itself: where it is narrow the faces go, and narrower still the time column shrinks, so
   the title keeps its room. */
.cal-list {
  container-type: inline-size;
}
@container (max-width: 560px) {
  .cal-people {
    display: none;
  }
}
@container (max-width: 400px) {
  .cal-row {
    gap: 8px;
    padding: 8px 10px;
  }
  .cal-row-time {
    width: 76px;
  }
}
.cal-pill {
  flex: none;
  height: 22px;
  margin-top: -2px;
  padding: 0 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 500;
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: var(--warn);
}
.cal-more {
  display: flex;
  margin: 18px 0 0;
}

/* The event card next to an event. */
.cal-pop {
  position: fixed;
  z-index: 60;
  width: min(360px, calc(100vw - 16px));
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 8px 16px 14px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  animation: pop 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cal-pop-bar {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  margin: 0 -10px 2px 0;
}
.cal-pop-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.cal-swatch {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 4px;
  background: var(--c);
  flex: none;
}
.cal-pop-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.cal-pop-when {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.cal-pop-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 5px 0;
  font-size: 13px;
  line-height: 1.45;
}
.cal-pop-row > .ic svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  display: block;
  color: var(--text-3);
}
.cal-pop-row > div {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.cal-pop-row .link-btn {
  padding: 0;
}
.cal-pop-row .cal-dot {
  display: inline-block;
  margin-right: 6px;
  vertical-align: 1px;
}
.cal-acc {
  margin-left: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.cal-pop .sel,
.cal-desc {
  user-select: text;
}
.cal-pop a {
  color: var(--link);
}
.cal-guests {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 3px;
}
.cal-guests li {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-2);
}
.cal-guests .mark svg {
  width: 14px;
  height: 14px;
  display: block;
  stroke-width: 2;
  color: var(--text-3);
}
.cal-guests .accepted .mark svg {
  color: var(--ok);
}
.cal-guests .declined .mark svg {
  color: var(--danger);
}
.cal-guests .tentative .mark svg {
  color: var(--warn);
}
.cal-guests .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-guests .role,
.cal-guests .more {
  font-size: 11.5px;
  color: var(--text-3);
}
.cal-desc {
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
}
.cal-rsvp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}

/* Calendars in the sidebar: a box in the calendar's colour, filled while the calendar shows. */
.cal-check {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1.5px var(--c);
  color: transparent;
}
/* A calendar brings its colour from Google or the CalDAV server, pale or deep, so the tick is dark on a light colour
   and white on a dark one, whatever the theme. */
.cal-check.on {
  background: var(--c);
  color: oklch(from var(--c) clamp(0, (0.72 - l) * 1000, 1) 0 0);
}
.cal-check svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}
/* The dot beside Default color in a calendar's menu, in the colour it goes back to. */
.menu .mi .cal-dot {
  width: 12px;
  height: 12px;
}

/* The event dialog. */
.cal-form {
  padding: 4px 0 0;
  gap: 12px;
}
.cal-form .cal-form-title {
  font-size: 15px;
  font-weight: 500;
  padding: 8px 10px;
}
/* Starts and Ends side by side while both fit with their date and time whole, and one under the other when they
   don't: a narrow or zoomed window, or a longer time format. */
.cal-when {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cal-when > label {
  flex: 1 1 auto;
  width: max-content;
}
.cal-dt {
  display: flex;
  gap: 6px;
}
.cal-dt input[type='date'] {
  flex: 1;
  min-width: 0;
}
/* As wide as the system's time format needs: "12:00 PM" under a 12-hour clock, "12:00" under a 24-hour one. */
.cal-dt input[type='time'] {
  width: auto;
  flex: none;
}
.cal-form.all-day input[type='time'] {
  display: none;
}
.cal-form textarea {
  min-height: 72px;
}
.cal-form select:disabled {
  opacity: 0.55;
}
/* The calendar field, with the chosen calendar's colour as a dot before its name. */
.cal-pick {
  position: relative;
  display: block;
}
.cal-pick .cal-dot {
  position: absolute;
  left: 11px;
  top: 50%;
  margin-top: -4px;
  pointer-events: none;
}
.cal-form .cal-pick select {
  padding-left: 27px;
}
.cal-pick:has(select:disabled) .cal-dot {
  opacity: 0.55;
}
.cal-form .error:empty {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .cal-pop {
    animation: none;
  }
}

/* The toolbar's title is a button that opens Go to date; search and the side panel sit before the view switch.
   Where the calendar is narrow (a small window, a high zoom) the controls go to a second row before the title
   gets shorter than about 260 px. */
.cal-head {
  flex-wrap: wrap;
  row-gap: 6px;
}
.cal-head-main {
  flex: 1 1 260px;
}
.cal-head .spacer {
  display: none;
}
.cal-head-side {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.cal-heading {
  display: flex;
  min-width: 0;
  margin: 0;
  font: inherit;
}
button.cal-title {
  padding: 3px 8px;
  margin-left: -2px;
  border-radius: var(--radius);
  text-align: left;
  transition: background-color 120ms ease;
}
button.cal-title:hover {
  background: var(--hover);
}
.cal-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}
.cal-head.searching .cal-head-main {
  flex: 1;
}
.cal-head.searching .spacer {
  display: none;
}
.cal-search {
  flex: 1;
  min-width: 0;
  max-width: 560px;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 10px;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 120ms ease;
}
.cal-search:focus-within {
  box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-soft);
}
.cal-search .s-ic svg {
  width: 15px;
  height: 15px;
  display: block;
  color: var(--text-3);
}
.cal-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  user-select: text;
}
.cal-search input::placeholder {
  color: var(--text-3);
}
.cal-search input::-webkit-search-cancel-button {
  display: none;
}
.cal-search-count {
  padding: 14px 4px 0;
  font-size: 12px;
  color: var(--text-3);
}
.cal-search-failed {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 4px 0;
  font-size: 12px;
  color: var(--warn);
}
.cal-search-failed svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.cal-list .empty .spinner {
  width: 18px;
  height: 18px;
}

.cal-notice.warn .ic svg {
  color: var(--warn);
}

/* The grid and a side panel beside it, or over it as a sheet where the grid would get narrower than 560 px. */
.cal-main {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
}
.cal-main > .cal-body {
  min-width: 0;
}
.cal-panel {
  width: 340px;
  flex: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--panel);
  animation: cal-panel-in 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cal-panel.sheet {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  width: min(360px, 100%);
  background: var(--raised);
  border-top-left-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.cal-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 8px 6px 16px;
}
.cal-panel-head h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
@keyframes cal-panel-in {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
}

/* Outside working hours the grid dims; the availability panel's open time shows in green behind the events. */
.cal-off {
  position: absolute;
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  pointer-events: none;
}
:root.light .cal-off {
  background: color-mix(in srgb, var(--bg) 75%, transparent);
}
.cal-hl {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 45%, transparent);
  pointer-events: none;
}

/* A booked event carries the booking icon before its title. */
.cal-mark {
  display: inline-flex;
  vertical-align: -2px;
  margin-right: 4px;
}
.cal-mark svg {
  width: 13px;
  height: 13px;
  stroke-width: 1.8;
}
.cal-chip .cal-mark,
.cal-mchip .cal-mark {
  flex: none;
}

/* A booking request that waits for an answer: a dashed, orange block at its time. */
.cal-ev.cal-req,
.cal-mchip.cal-req,
.cal-row.cal-req {
  --c: var(--warn);
  background: color-mix(in srgb, var(--warn) 7%, var(--panel));
  border: 1.5px dashed color-mix(in srgb, var(--warn) 65%, transparent);
}
.cal-ev.cal-req:hover,
.cal-mchip.cal-req:hover,
.cal-row.cal-req:hover {
  background: color-mix(in srgb, var(--warn) 13%, var(--panel));
}
.cal-req .tag {
  margin-right: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--warn);
}
.cal-mchip.cal-req .tag {
  margin-right: 0;
}
/* The light theme's orange is too light for small text on white: darkened toward the text colour, it reads. */
:root.light .cal-req .tag,
:root.light .cal-search-failed {
  color: color-mix(in srgb, var(--warn) 55%, var(--text));
}

/* Dragging. Touch keeps scrolling the grid; a long press starts a drag instead (calendar.js). */
.cal-col,
.cal-allday,
.cal-month {
  touch-action: pan-y;
}
.cal-resize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7px;
  cursor: ns-resize;
}
.cal-ev.drag:hover .cal-resize::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 16px;
  height: 2px;
  margin-left: -8px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--text) 35%, transparent);
}
/* A finger needs a wider edge to hold, and can't hover to find it: the grip shows on every event it can resize. */
@media (pointer: coarse) {
  .cal-resize {
    height: 14px;
  }
  .cal-ev.short .cal-resize {
    height: 10px;
  }
  .cal-ev.drag .cal-resize::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 20px;
    height: 3px;
    margin-left: -10px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--text) 35%, transparent);
  }
  .cal-ev.drag.short .cal-resize::after {
    bottom: 1px;
    width: 14px;
    height: 2px;
    margin-left: -7px;
  }
}
.calendar.dragging,
.calendar.dragging * {
  cursor: grabbing;
}
.calendar.drag-resize,
.calendar.drag-resize *,
.calendar.drag-create,
.calendar.drag-create * {
  cursor: ns-resize;
}
.calendar.drag-span,
.calendar.drag-span * {
  cursor: default;
}
.calendar .drag-src {
  opacity: 0.4;
}
.calendar.dragging .cal-resize::after {
  display: none;
}
.cal-ev.cal-ghost {
  z-index: 4;
  pointer-events: none;
  --tint: oklch(from var(--c) var(--ev-open-l) min(c, var(--ev-open-c)) h);
  box-shadow: var(--shadow);
}
.cal-ev.cal-ghost.new {
  --tint: oklch(from var(--c) var(--ev-l) min(c, var(--ev-c)) h);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 60%, transparent), var(--shadow-sm);
}
.cal-allday-cell.drop,
.cal-mcell.drop {
  background: oklch(from var(--c) var(--ev-pale-l) min(c, var(--ev-pale-c)) h);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent);
}
.cal-allday-cell.drop {
  border-radius: 6px;
}

/* The month: a grid of weeks. Each week is a grid of its own, with a row for the day numbers and a row per event;
   long events span the days they cover. */
.cal-month {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 12px 12px 18px;
}
.cal-mnames {
  display: grid;
  grid-template-columns: repeat(var(--days), minmax(0, 1fr));
  height: 28px;
  align-items: center;
}
.cal-mname {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cal-mgrid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(var(--weeks), minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.cal-mweek {
  display: grid;
  grid-template-columns: repeat(var(--days), minmax(0, 1fr));
  grid-template-rows: 26px repeat(var(--rows), 22px) 1fr;
  min-height: 0;
  overflow: hidden;
}
.cal-mcell {
  grid-row: 1 / -1;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cal-mcell.out {
  background: color-mix(in srgb, var(--panel-2) 70%, transparent);
}
.cal-mnum {
  grid-row: 1;
  z-index: 1;
  justify-self: center;
  align-self: center;
  height: 22px;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background-color 120ms ease, color 120ms ease;
}
.cal-mnum:hover {
  background: var(--hover);
  color: var(--text);
}
.cal-mnum.out {
  color: var(--text-3);
}
.cal-mnum.today {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
.cal-mchip {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 20px;
  margin: 1px 3px;
  padding: 0 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  font-size: 12px;
  line-height: 20px;
  text-align: left;
  white-space: nowrap;
  transition: background-color 120ms ease;
}
.cal-mchip .t {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-mchip .w {
  flex: none;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.cal-mchip .cal-dot {
  width: 7px;
  height: 7px;
}
.cal-mchip.span {
  --tint: oklch(from var(--c) var(--ev-l) min(c, var(--ev-c)) h);
  background: var(--tint);
  font-weight: 500;
}
.cal-mchip.span:hover {
  --tint: oklch(from var(--c) var(--ev-hover-l) min(c, var(--ev-hover-c)) h);
}
.cal-mchip.timed:hover {
  background: var(--hover);
}
.cal-mchip.cont-l {
  margin-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.cal-mchip.cont-r {
  margin-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.cal-mchip.span.needs {
  --tint: oklch(from var(--c) var(--ev-pale-l) min(c, var(--ev-pale-c)) h);
}
.cal-mchip.span.maybe {
  background: repeating-linear-gradient(135deg, var(--tint) 0 6px, oklch(from var(--c) var(--ev-pale-l) min(c, var(--ev-pale-c)) h) 6px 12px);
}
.cal-mchip.timed.needs .cal-dot {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--c);
}
.cal-mchip.declined .t {
  color: var(--text-3);
  text-decoration: line-through;
}
.cal-mchip.open {
  background: var(--active);
  box-shadow: var(--shadow-sm);
}
.cal-mchip.span.open {
  --tint: oklch(from var(--c) var(--ev-open-l) min(c, var(--ev-open-c)) h);
  background: var(--tint);
}
.cal-mchip:focus-visible,
.cal-mmore:focus-visible,
.cal-mnum:focus-visible {
  outline-offset: -2px;
}
.cal-mmore {
  z-index: 1;
  justify-self: start;
  height: 20px;
  margin: 1px 3px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}
.cal-mmore:hover {
  background: var(--hover);
  color: var(--text);
}

/* The mini month in the calendar sidebar and in Go to date. Today is filled, the day in view ringed, the days of the
   week in view shaded; a dot marks a day with events. The icon rail leaves it out. */
.cal-mini {
  margin: 0 0 10px;
}
.cal-mini-head {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  padding-left: 6px;
}
.cal-mini-title {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  row-gap: 1px;
  justify-items: center;
}
.cal-mini-dow {
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--text-3);
}
.cal-mini-day {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  transition: background-color 120ms ease, color 120ms ease;
}
.cal-mini-day:hover {
  background: var(--hover);
  color: var(--text);
}
.cal-mini-day.out {
  color: var(--text-3);
}
.cal-mini-day.span {
  background: var(--active);
  color: var(--text);
}
.cal-mini-day.sel {
  box-shadow: inset 0 0 0 1.5px var(--text-2);
  color: var(--text);
  font-weight: 600;
}
.cal-mini-day.today {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}
.cal-mini-day.dot::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: var(--text-3);
}
.cal-mini-day.today.dot::after {
  background: var(--on-primary);
}
.cal-mini-day:focus-visible {
  outline-offset: 0;
}
.shell.collapsed .cal-mini {
  display: none;
}
.cal-goto {
  padding: 4px 0 0;
  gap: 10px;
}
.cal-goto .cal-mini {
  margin: 0;
}
.cal-goto .cal-mini-day {
  width: 34px;
  height: 32px;
  border-radius: var(--radius);
  font-size: 12.5px;
}
.cal-goto .error:empty {
  display: none;
}

/* A calendar in the sidebar: its eye toggle, and a ⋯ button for its menu that shows on hover, on focus and on
   touch screens. A right click or the menu key opens the same menu. */
.cal-side-row {
  position: relative;
  display: flex;
  align-items: center;
}
.cal-side-row .cal-toggle {
  flex: 1;
  min-width: 0;
  padding-right: 30px;
}
.cal-side-more {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  opacity: 0;
}
.cal-side-row:hover .cal-side-more,
.cal-side-more:focus-visible,
.cal-side-more[aria-expanded='true'] {
  opacity: 1;
}
@media (hover: none) {
  .cal-side-more {
    opacity: 1;
  }
}
.shell.collapsed .cal-side-more {
  display: none;
}

/* The colour swatches at the top of a calendar's menu. */
.cal-swatches {
  display: grid;
  grid-template-columns: repeat(6, 26px);
  gap: 6px;
  padding: 4px 8px 8px;
}
.menu button.cal-swatch-btn {
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  background: var(--c);
  color: var(--panel);
  transition: transform 120ms ease;
}
.menu button.cal-swatch-btn:hover,
.menu button.cal-swatch-btn:focus-visible {
  background: var(--c);
  transform: scale(1.08);
}
.menu button.cal-swatch-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.cal-swatch-btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.6;
}
/* The note under "Counts toward availability" for a calendar that isn't the user's own: it wraps, never cut off. */
.menu button.cal-menu-note .ms {
  white-space: normal;
}

@media (prefers-reduced-motion: reduce) {
  .cal-panel {
    animation: none;
  }
  .menu button.cal-swatch-btn {
    transition: none;
  }
}

/* The quick popover for a new event and a booking request's card float beside the grid like the event card. */
.cal-quick,
.cal-reqcard {
  position: fixed;
  z-index: 60;
  width: min(360px, calc(100vw - 16px));
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  animation: pop 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cal-reqcard {
  padding: 8px 16px 14px;
}
.cal-quick {
  width: min(344px, calc(100vw - 16px));
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}
.cal-quick-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.cal-quick-title {
  width: 100%;
  margin: 0 0 6px;
  padding: 4px 2px 8px;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  user-select: text;
  transition: border-color 120ms ease;
}
.cal-quick-title:focus {
  border-bottom-color: var(--accent);
}
.cal-quick-title::placeholder {
  color: var(--text-3);
}
.cal-quick .cal-pop-row {
  align-items: center;
  padding: 3px 0;
}
.cal-quick .cal-pop-row > .ic,
.cal-quick-cal .ic {
  width: 16px;
  display: grid;
  place-items: center;
  flex: none;
}
.cal-quick .cal-pop-row > .ic svg {
  margin-top: 0;
}
.cal-quick-cal .ic .cal-dot {
  width: 10px;
  height: 10px;
  margin: 0;
}
.cal-quick-when {
  color: var(--text-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.cal-quick select {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.cal-quick select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cal-quick .error {
  font-size: 12.5px;
}
.cal-quick-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.cal-quick.saving {
  cursor: progress;
}
/* Until its conflict check answers (at most 250 ms) the popover takes the keyboard but isn't shown, so it opens at
 * its full height; the pop-in plays when it shows. */
.cal-quick.measuring {
  opacity: 0;
  animation: none;
}

/* The event dialog hangs from a fixed top instead of being centred, so what grows below (the conflict line, guest
 * chips, the More section) never moves the fields above it. */
.scrim.cal-scrim {
  place-items: start center;
  padding-top: clamp(16px, 7vh, 64px);
}
/* 40px wider than other wide dialogs, so Starts and Ends still fit side by side with a 12-hour time (.cal-when). */
.scrim.cal-scrim .dialog {
  width: min(600px, calc(100vw - 40px));
  max-height: calc(100vh - clamp(16px, 7vh, 64px) - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* The title and the buttons stay in view; the fields scroll between them. The 4px inset keeps focus rings whole. */
.scrim.cal-scrim .dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin: 0 -4px;
  padding: 0 4px 4px;
}
.cal-quick .error:empty,
.cal-reqcard .error:empty,
.cal-gerror:empty {
  display: none;
}

/* The conflict line: a quiet orange tint with the overlapping event. */
.cal-conflict {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  color: var(--warn);
  font-size: 12.5px;
  line-height: 1.45;
  text-wrap: pretty;
  font-variant-numeric: tabular-nums;
}
.cal-conflict .ic svg {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  display: block;
}
.cal-conflict > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.cal-conflict .cal-quiet {
  color: inherit;
  opacity: 0.85;
}
/* The light theme's orange is too light for small text: darkened toward the text colour, as the request tag is. */
:root.light .cal-conflict {
  color: color-mix(in srgb, var(--warn) 55%, var(--text));
}

/* Small helpers for the card, the popover and the dialog. */
.cal-quiet {
  color: var(--text-3);
}
.cal-sub {
  font-size: 12px;
  color: var(--text-3);
}
.cal-guest-notes {
  max-height: 120px;
}
.cal-swatch-req {
  background: color-mix(in srgb, var(--warn) 18%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--warn);
}
.cal-req-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.cal-req-note {
  margin: 10px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
  text-wrap: pretty;
}

/* A field in the dialog that isn't one input: guests, repeat, reminders. */
.cal-efield {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.cal-elabel {
  font-size: 12.5px;
  color: var(--text-2);
}

/* Guests as chips in a box that looks like an input; the input grows into what is left of the row. */
.cal-gbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: text;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.cal-gbox:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cal-gbox.view {
  cursor: default;
  background: transparent;
  border-color: transparent;
  padding: 0;
  min-height: 0;
}
.cal-quick .cal-gbox {
  min-height: 30px;
  padding: 2px;
}
.cal-gchips {
  display: contents;
}
.cal-gchip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  height: 24px;
  border-radius: 12px;
  background: var(--chip);
  font-size: 12.5px;
  color: var(--text);
}
.cal-gchip.optional {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.cal-gchip-main {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 24px;
  padding: 0 4px 0 9px;
  border-radius: 12px;
}
.cal-gchip.fixed .cal-gchip-main {
  padding-right: 9px;
}
button.cal-gchip-main:hover {
  background: var(--active);
}
.cal-gchip .n {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-gchip .opt {
  font-size: 11.5px;
  color: var(--text-3);
}
.cal-gchip .mark svg {
  width: 12px;
  height: 12px;
  display: block;
  stroke-width: 2.2;
  color: var(--text-3);
}
.cal-gchip .mark.accepted svg {
  color: var(--ok);
}
.cal-gchip .mark.declined svg {
  color: var(--danger);
}
.cal-gchip .mark.tentative svg {
  color: var(--warn);
}
.cal-gchip .x {
  width: 18px;
  height: 18px;
  margin-right: 3px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  color: var(--text-3);
}
.cal-gchip .x:hover {
  background: var(--active);
  color: var(--text);
}
.cal-gchip .x svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}
.cal-ginput {
  flex: 1 1 120px;
  min-width: 120px;
  height: 24px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  outline: none;
  user-select: text;
}
.cal-ginput::placeholder {
  color: var(--text-3);
}
/* The suggestions lie over the dialog and the popover, next to the guest field. */
.suggest.cal-gsuggest {
  position: fixed;
  z-index: 80;
  min-width: 0;
  max-width: calc(100vw - 16px);
}
.cal-gsuggest button div:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-gerror {
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.45;
}

/* Google Meet: a row with a switch. */
.cal-meet {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 32px;
  padding: 4px 0;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  border-radius: 6px;
}
.cal-meet .ic svg {
  width: 16px;
  height: 16px;
  display: block;
  color: var(--text-3);
}
.cal-meet .l {
  flex: 1;
  min-width: 0;
}
.cal-meet .switch {
  pointer-events: none;
}
.cal-form .cal-meet {
  padding: 4px 2px;
}

/* Under the start and end: the all-day box, and the times on the event's own clock when its zone is another. */
.cal-when-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: -4px;
}
.cal-zone-note {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.cal-zone-note:empty {
  display: none;
}

/* The More section: closed, it is one row with a summary of what is set; open, it slides down. */
.cal-extras {
  border-top: 1px solid var(--border);
  padding-top: 6px;
}
.cal-extras-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 6px;
  width: 100%;
  border-radius: 6px;
  text-align: left;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 120ms ease;
}
.cal-extras-toggle:hover {
  background: var(--hover);
}
.cal-extras-toggle .chev svg {
  width: 14px;
  height: 14px;
  display: block;
  color: var(--text-3);
  transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.cal-extras.open .cal-extras-toggle .chev svg {
  transform: rotate(90deg);
}
.cal-extras-toggle .sum {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
  font-size: 12.5px;
  color: var(--text-3);
}
.cal-extras-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 320ms cubic-bezier(0.23, 1, 0.32, 1), opacity 200ms ease;
}
.cal-extras.open .cal-extras-body {
  grid-template-rows: 1fr;
  opacity: 1;
}
/* Room for the focus rings inside the clipped stretch. */
.cal-extras-inner {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 12px;
  padding: 0 3px;
  margin: 0 -3px;
}
.cal-extras.open .cal-extras-inner {
  padding: 8px 3px 3px;
}
.cal-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cal-form .field-help.cal-warn {
  color: var(--warn);
}
:root.light .cal-form .field-help.cal-warn {
  color: color-mix(in srgb, var(--warn) 55%, var(--text));
}
.cal-form [data-zone-help].bad {
  color: var(--danger);
}
.cal-form .error:empty {
  display: none;
}

/* The custom repeat: "Repeat every 2 weeks", the weekdays, and when it ends. */
.cal-rcustom {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border);
}
.cal-rline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}
.cal-rlabel {
  font-size: 12.5px;
  color: var(--text-2);
}
.cal-form .cal-rcustom select {
  width: auto;
  min-width: 0;
}
.cal-form input.cal-num {
  width: 72px;
  font-variant-numeric: tabular-nums;
}
.cal-wds {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
/* Days that are on take the accent tint with a ring, so Save stays the one filled button. */
.cal-wd {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--chip);
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.cal-wd:hover {
  color: var(--text);
}
.cal-wd[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--link);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
}
.cal-ends {
  display: grid;
  gap: 6px;
}
.cal-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.cal-form .cal-end .inline {
  min-width: 56px;
}
.cal-form .cal-end input[type='date'] {
  width: auto;
}
.cal-form .cal-end input:disabled {
  opacity: 0.55;
}
.cal-unit {
  font-size: 13px;
  color: var(--text);
}

/* Reminders: a choice per reminder with its x; email ones as text, as Rukoo keeps them. */
.cal-rems {
  display: grid;
  gap: 6px;
}
.cal-rem {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cal-rem .ic svg {
  width: 15px;
  height: 15px;
  display: block;
  color: var(--text-3);
}
.cal-form .cal-rem select {
  flex: 1;
  min-width: 0;
}
.cal-rem.email {
  min-height: 32px;
  font-size: 13px;
  color: var(--text-2);
}
.cal-add {
  justify-self: start;
  padding-left: 0;
}
.cal-efield .field-help {
  margin: 0;
}
.cal-efield .inline {
  font-size: 13px;
}

/* The message to a guest when a booking is cancelled or a request declined. */
.cal-message {
  padding: 0;
  gap: 12px;
}
.cal-message p {
  margin: 0;
}
.cal-message textarea {
  min-height: 72px;
}
.cal-message .error:empty {
  display: none;
}

@media (max-width: 560px) {
  .cal-pair {
    grid-template-columns: 1fr;
  }
}
/* Touch: the small targets grow. */
@media (pointer: coarse) {
  .cal-gchip .x {
    width: 24px;
    height: 24px;
  }
  .cal-wd {
    width: 36px;
    height: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cal-quick,
  .cal-reqcard {
    animation: none;
  }
  .cal-extras-body,
  .cal-extras-toggle .chev svg {
    transition: none;
  }
}

/* The availability panel (calendar-free.js): its choices in a label column and a control column, then what was
   checked, the copy actions and the open time by day. */
.free-panel {
  padding: 2px 16px 24px;
}
.free-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
}
.free-label {
  color: var(--text-3);
  font-size: 12px;
}
.free-form select,
.free-times-grid select {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 12.5px;
}
.free-form select:focus,
.free-times-grid select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* The lengths look like the app's segmented control: a track with the chosen one raised. */
.free-lengths {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  height: 30px;
  padding: 2px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--border) 70%, transparent);
}
.free-lengths button {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  border-radius: 9999px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background-color 120ms ease, color 120ms ease;
}
.free-lengths button:hover {
  color: var(--text-2);
}
.free-lengths button[aria-checked='true'] {
  background: var(--raised);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
:root:not(.light) .free-lengths button[aria-checked='true'] {
  background: var(--active);
}
.free-unit {
  flex: none;
  color: var(--text-3);
  font-size: 11.5px;
  padding: 0 6px 0 2px;
}
.free-result {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.free-status {
  display: grid;
  gap: 6px;
  justify-items: start;
}
.free-checked-toggle {
  padding-left: 0;
  font-size: 12.5px;
}
.free-checked-toggle svg {
  width: 13px;
  height: 13px;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.free-checked-toggle[aria-expanded='true'] svg {
  transform: rotate(180deg);
}
.free-checked {
  list-style: none;
  margin: 0;
  padding: 0 0 2px;
  display: grid;
  gap: 2px;
  font-size: 12.5px;
  animation: fade 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.free-checked li {
  display: flex;
  gap: 6px;
  min-width: 0;
}
.free-cal {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.free-cal-mail {
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.free-checked .link-btn {
  padding-left: 0;
}
.free-note {
  font-size: 12.5px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: var(--radius);
  text-wrap: pretty;
}
.free-note.warn {
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  color: var(--warn);
}
:root.light .free-note.warn,
:root.light .free-preview-note.warn {
  color: color-mix(in srgb, var(--warn) 55%, var(--text));
}
.free-note.error {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
}
.free-note .link-btn {
  padding: 0;
}
.free-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 4px;
}
.free-actions .btn {
  gap: 6px;
}
.free-days {
  transition: opacity 120ms ease;
}
.free-days.busy {
  opacity: 0.55;
}
.free-day {
  margin-top: 12px;
}
.free-day-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 24px;
}
.free-day-head h3 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.free-block {
  flex: none;
  font-size: 12px;
}
.free-day ul {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.free-allday {
  color: var(--text-3);
  font-size: 12px;
  padding: 2px 0 2px 10px;
  border-left: 2px solid var(--border-strong);
  margin: 2px 0 4px;
  overflow-wrap: anywhere;
}
.free-slot {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 6px;
  text-align: left;
  background: color-mix(in srgb, var(--ok) 9%, transparent);
  transition: background-color 120ms ease;
}
.free-slot:hover {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
}
.free-time {
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  user-select: text;
}
.free-len {
  margin-left: auto;
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.free-empty {
  color: var(--text-2);
  font-size: 13px;
  margin: 14px 0 0;
}
.free-zone-note {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.45;
  margin: 16px 0 0;
  text-wrap: pretty;
}
.free-zone-note .link-btn {
  padding: 0;
  font-size: inherit;
}
.free-loading {
  display: flex;
  align-items: center;
  color: var(--text-2);
  font-size: 12.5px;
  min-height: 60px;
}
.free-loading .spinner {
  border-color: color-mix(in srgb, var(--text-3) 40%, transparent);
  border-top-color: var(--text-2);
}
@media (prefers-reduced-motion: reduce) {
  .free-checked {
    animation: none;
  }
  .free-checked-toggle svg {
    transition: none;
  }
}

/* ---------- signature ---------- */

/* The signature as it will be sent, under its Settings row. Tall ones are cut off; the editor shows all of it. */
.sig-preview {
  margin-top: 6px;
  max-height: 132px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}
.sig-preview p {
  margin: 0;
}
/* Settings > Accounts: the Signatures row leads with a pen, in the column the add row's plus uses. */
.row .sig-ic {
  color: var(--text-2);
  width: 30px;
  display: grid;
  place-items: center;
}
.row .sig-ic svg {
  width: 20px;
  height: 20px;
}
/* Settings > Signatures: an account's avatar stays beside its address while a preview makes the row tall. */
.row.sig-account {
  align-items: flex-start;
}
.row.sig-account .avatar {
  flex: none;
}
.sig-dialog .sig-help {
  font-size: 12.5px;
  margin: 0 0 12px;
  text-wrap: pretty;
}
.sig-frame {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.sig-frame:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.sig-toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.sig-toolbar .sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 5px;
  flex: none;
}
.sig-toolbar .spacer {
  flex: 1;
}
.sig-toolbar button:disabled {
  opacity: 0.4;
  cursor: default;
}
.sig-linkbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.sig-linkbar input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text);
  outline: none;
  user-select: text;
}
.sig-linkbar input:focus {
  border-color: var(--accent);
}
.sig-editor {
  /* Keeps any positioned content from a pasted signature inside the editor. */
  contain: layout paint;
  position: relative;
  min-height: 140px;
  max-height: min(320px, 50vh);
  overflow: auto;
  padding: 12px 14px;
  outline: none;
  font-size: 14.5px;
  line-height: 1.6;
  user-select: text;
  overflow-wrap: anywhere;
  cursor: text;
}
.sig-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
}
.sig-source {
  display: block;
  width: 100%;
  min-height: 200px;
  max-height: min(320px, 50vh);
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 12px/1.5 'Cascadia Mono', Consolas, ui-monospace, monospace;
  resize: vertical;
  outline: none;
  user-select: text;
}

/* ---------- "What's new" guide (whats-new.js) ---------- */

.wn {
  position: relative;
  width: min(600px, calc(100vw - 40px));
  /* Tall enough for the first step's four features without scrolling in the default window. */
  height: min(760px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: pop 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.wn-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
}
.wn-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 30px 32px 8px;
}
.wn-body h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  padding-right: 32px;
}
.wn-lead {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 20px;
}
.wn-foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 20px;
}
.wn-foot > :first-child {
  justify-self: start;
}
.wn-foot > :last-child {
  justify-self: end;
}
.wn-foot .btn {
  height: 34px;
  padding: 0 16px;
}
.btn.ghost {
  background: none;
  color: var(--text-2);
  padding: 0 10px;
}
.btn.ghost:hover {
  background: var(--hover);
  color: var(--text);
  filter: none;
}
.wn-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.wn-dots span {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--border-strong);
  transition: width 200ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 200ms ease;
}
.wn-dots span.past {
  background: var(--text-3);
}
.wn-dots span.on {
  width: 18px;
  background: var(--text);
}
.wn-hero {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  padding: 16px;
  margin-bottom: 22px;
  border-radius: 12px;
  background: var(--panel-2);
}
.wn-mock-side {
  display: grid;
  gap: 2px;
}
.wn-mock-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  color: var(--text-2);
}
.wn-mock-nav svg {
  width: 13px;
  height: 13px;
  color: var(--text-3);
}
.wn-mock-nav.on {
  color: var(--text);
  font-weight: 600;
}
.wn-mock-nav.sub {
  padding-left: 12px;
}
.wn-mock-nav.cur {
  background: var(--active);
  color: var(--text);
  font-weight: 600;
}
.wn-mock-nav i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cat);
  margin: 0 2px;
}
.wn-mock-list {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 6px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.wn-mock-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 5px;
  padding: 7px 6px;
}
.wn-mock-row b {
  grid-row: span 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--chip);
}
.wn-mock-row span {
  height: 6px;
  border-radius: 3px;
  background: var(--chip);
}
.wn-mock-row span:first-of-type {
  background: var(--border-strong);
}
.wn-features {
  display: grid;
  gap: 16px;
  margin-bottom: 8px;
}
.wn-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.wn-feature b {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  margin: 1px 0 2px;
}
.wn-feature p {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}
.wn-ic {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--chip);
  color: var(--text-2);
}
.wn-ic svg {
  width: 17px;
  height: 17px;
}
.wn .row .text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.wn .row .title {
  font-weight: 600;
}
.wn .row .desc {
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.45;
}
.wn-cat:disabled {
  cursor: default;
}
.wn-cat:disabled:hover {
  background: none;
}
.wn-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cat);
  flex: none;
  align-self: flex-start;
  margin-top: 5px;
}
.wn-gap {
  margin-top: 12px;
}
.wn-select {
  flex: none;
  max-width: 180px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
}
.wn-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
}
.wn-note > svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  color: var(--text-3);
}
.wn-note b {
  color: var(--text);
  font-weight: 600;
}
.wn-note.muted {
  margin: 14px 0 0;
  color: var(--text-3);
}
.wn-server {
  color: var(--text-3);
}
.wn-choices {
  display: grid;
  gap: 2px;
}
.wn-choice {
  border-radius: var(--radius-lg);
}
.wn-choice.on {
  background: var(--panel-2);
}
.wn-choice .radio-row {
  padding: 10px 12px;
}
.wn-choice.on .radio-row:hover {
  background: none;
}
.wn-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 12px 42px;
}
.wn-fields .wide {
  grid-column: 1 / -1;
}
.wn-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.wn-input:focus,
.wn-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.wn-tick {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
}
.wn-tick input {
  margin: 2px 0 0;
}
.wn-ok {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok);
  flex: none;
}
.wn-ok svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}
.wn-key {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 22px 16px;
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  user-select: all;
}
.wn-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.wn-error {
  color: var(--danger);
  font-size: 12.5px;
  min-height: 18px;
  margin: 6px 12px 0;
}

/* ---------- inbox categories in the sidebar, under Inbox ---------- */

.nav-item.nav-sub {
  height: 28px;
  padding-left: 18px;
  font-size: 12.5px;
}
.nav-item.nav-sub .ic {
  width: 18px;
}
.nav-item .cdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat);
}
.nav-item.nav-sub .cat-off svg {
  width: 13px;
  height: 13px;
}
.shell.collapsed .nav-item.nav-sub {
  display: none;
}

/* ---------- quick actions: buttons over the time on a row under the mouse ---------- */

/* In the first line's flow, where the time is, so the sender and a stack's +N stay clickable. The negative
   margins keep the line's height. */
.quick {
  display: none;
  flex: none;
  gap: 1px;
  margin: -3px -4px -3px 4px;
}
.item:hover .quick {
  display: flex;
}
/* The buttons take the place of the time. */
.item:hover .quick + .meta {
  display: none;
}
.quick-btn {
  width: 26px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--text-2);
}
.quick-btn svg {
  width: 16px;
  height: 16px;
}
.quick-btn:hover {
  background: var(--active);
  color: var(--text);
}
.quick-btn.on {
  color: var(--star);
}

/* ---------- a newer Rukoo, above the sidebar's foot ---------- */

.update-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 30px;
  padding: 0 10px;
  margin-top: 6px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  white-space: nowrap;
  overflow: hidden;
}
.update-btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}
/* A nightly version doesn't fit the sidebar; the tooltip has all of it. */
.update-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.update-btn:hover {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.shell.collapsed .update-btn {
  justify-content: center;
  padding: 0;
}
.shell.collapsed .update-btn span {
  display: none;
}

/* Settings > Keyboard shortcuts: a scheme's radio, and the keys of each action. */
.row .radio {
  flex: none;
}
.row .keys {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.row .keys kbd {
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: var(--chip);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.kbd-or::before {
  content: '/';
  color: var(--text-3);
  font-size: 12px;
}

/* The sorting line above the sync status, and the panel it opens: how far Jev is and its last decisions
   (sort-activity.js). */
.sort-slot:empty {
  display: none;
}
.sort-status {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  margin-top: 6px;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-2);
  text-align: left;
}
.sort-status:hover,
.sort-status[aria-expanded='true'] {
  background: var(--hover);
  color: var(--text);
}
.sort-status .lead {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
}
.sort-status .lead svg {
  width: 16px;
  height: 16px;
}
.sort-status .t {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sort-status .n {
  flex: none;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.sort-status.done .lead {
  color: var(--ok);
}
.sort-status.waiting .lead {
  color: var(--warn);
}
.sort-status.key {
  color: var(--danger);
}
.sort-ring svg {
  transform: rotate(-90deg);
}
.sort-ring circle {
  fill: none;
  stroke-width: 2;
}
.sort-ring .track {
  stroke: var(--border-strong);
}
.sort-ring .fill {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dasharray 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sort-status.starting .sort-ring svg {
  animation: sort-turn 1s linear infinite;
}
.sort-status.starting .sort-ring .fill {
  stroke-dasharray: 25 100 !important;
}
@keyframes sort-turn {
  from {
    transform: rotate(-90deg);
  }
  to {
    transform: rotate(270deg);
  }
}
.shell.collapsed .sort-status {
  width: 32px;
  justify-content: center;
  padding: 0;
}
.shell.collapsed .sort-status .t,
.shell.collapsed .sort-status .n {
  display: none;
}

.sort-panel {
  position: fixed;
  z-index: 85;
  width: 340px;
  max-height: min(540px, calc(100vh - 80px));
  display: flex;
  flex-direction: column;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-origin: bottom left;
  animation: pop 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sa-head {
  padding: 16px 16px 14px;
}
.sa-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.sa-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
}
.sa-count {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.sa-bar {
  height: 4px;
  margin-top: 12px;
  border-radius: 2px;
  background: var(--hover);
  overflow: hidden;
}
.sa-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sa-heading {
  padding: 2px 16px 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
}
.sa-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 6px 4px;
}
.sa-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 1px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius);
  text-align: left;
}
.sa-item:hover {
  background: var(--hover);
}
.sa-subject {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sa-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.sa-cat .cdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cat);
}
.sa-meta {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sa-item.fresh {
  animation: sa-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes sa-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.sa-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 12px 16px;
}
.sa-foot p {
  flex: 1;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-3);
}
.sa-foot .btn {
  flex: none;
  margin-left: auto;
}
@media (prefers-reduced-motion: reduce) {
  .sort-ring .fill,
  .sa-bar span {
    transition: none;
  }
  .sort-status.starting .sort-ring svg,
  .sa-item.fresh,
  .sort-panel {
    animation: none;
  }
}

/* ---------- meetings ---------- */

/* Rukoo Voice's meetings take the place of the list and the reader, as the calendar does (meeting.js). Search looks
   through mail, so it waits for Mail. The view is a size container: a narrow one shows its parts as tabs. */
.meeting {
  display: none;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  container: meeting / inline-size;
}
.shell.meeting-mode .meeting {
  display: flex;
}
.shell.meeting-mode .listpane,
.shell.meeting-mode .divider,
.shell.meeting-mode .reader,
.shell.meeting-mode .calendar {
  display: none;
}
body.meeting-mode .titlebar-search {
  visibility: hidden;
}

/* The header: title, state and clock on the left, the recording's controls on the right. */
.mt-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 12px 10px 20px;
  border-bottom: 1px solid var(--border);
}
.mt-titles {
  flex: 1;
  min-width: 0;
}
.mt-title {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mt-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 28px;
}
.mt-title-row > .icon-btn {
  flex: none;
}
.mt-title-input {
  width: 100%;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
}
.mt-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 4px;
  min-height: 22px;
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.mt-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px 0 8px;
  border-radius: 9999px;
  background: var(--chip);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}
.mt-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
}
.mt-state.is-rec i {
  background: var(--danger);
}
.mt-state.is-paused i,
.mt-state.is-busy i {
  background: var(--warn);
}
.mt-state.is-failed {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}
.mt-state.is-failed i {
  background: var(--danger);
}
.mt-elapsed {
  color: var(--text-2);
  font-weight: 500;
}
.mt-hidden {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.mt-hidden svg {
  width: 14px;
  height: 14px;
}
/* What Voice records of the screen; a warning tint when Rukoo itself can show in those frames. */
.mt-screen {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.mt-screen svg {
  width: 14px;
  height: 14px;
}
/* A kept meeting's media coming down: how much is here, or that it waits for the bucket. */
.mt-keep {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.mt-keep > svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.mt-keep.is-waiting > svg {
  color: var(--warn);
}
.mt-keep > .spinner {
  width: 12px;
  height: 12px;
  margin: 0;
  border-width: 1.5px;
  border-color: color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  flex: none;
}
.mt-keep-bar {
  flex: none;
  width: 56px;
  height: 4px;
  overflow: hidden;
  border-radius: 9999px;
  background: var(--border);
}
.mt-keep-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--text-2);
  transition: width 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
  .mt-keep-bar > i {
    transition: none;
  }
}
.mt-visible {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px 0 7px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  color: var(--warn);
  font-size: 12px;
  font-weight: 500;
}
.mt-visible svg {
  width: 14px;
  height: 14px;
}
.mt-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.mt-actions .tbtn:not(.primary) {
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.mt-actions .tbtn:not(.primary):hover {
  background: var(--hover);
}
.mt-actions .tbtn:disabled {
  opacity: 0.45;
  cursor: default;
}
.mt-actions .tbtn.primary.is-confirm {
  background: var(--danger);
  color: var(--on-primary);
}

.mt-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 20px 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.4;
}
.mt-notice svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--text-3);
}

.mt-tabs {
  display: block;
  padding: 10px 16px 2px;
}
.mt-tabs .segmented {
  display: grid;
  width: 100%;
}

.mt-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 42%, 480px);
}

/* Notes can take the whole meeting width without losing the current transcript position. */
.meeting:not([data-tab='transcript']) .mt-body {
  grid-template-columns: minmax(0, 1fr);
}
.meeting:not([data-tab='transcript']) .mt-transcript-pane,
.meeting[data-tab='notes'] .mt-card[data-pane='people'],
.meeting[data-tab='people'] .mt-card[data-pane='notes'] {
  display: none;
}
.meeting:not([data-tab='transcript']) .mt-side {
  border-left: 0;
}
.mt-transcript-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 11.5px;
}
.mt-transcript-head .tbtn {
  height: 28px;
}
.mt-transcript-head .tbtn[aria-pressed='true'] {
  background: var(--sel);
  color: var(--text);
}
.mt-frame-count {
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--chip);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.mt-frame-strip {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  list-style: none;
  padding: 8px 0;
  margin: 0;
}
.mt-frame-strip > .mt-frame {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
}
.mt-frame-strip > .mt-frame > .mt-main {
  display: flex;
  flex-direction: column;
  padding: 0;
}
.mt-frame-strip > .mt-frame .mt-shot {
  width: 160px;
  height: 90px;
}
.mt-frame-strip > .mt-frame > .mt-at {
  text-align: left;
}
.mt-frame-strip .mt-frame-body {
  width: 160px;
}

/* The transcript: meeting time in the gutter, the voice once per stretch, then what was said. */
.mt-transcript-pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mt-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 20px 28px 8px;
}
.mt-transcript {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mt-transcript:focus-visible {
  outline-offset: -2px;
  border-radius: var(--radius);
}
.mt-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 10px;
  padding: 4px 8px 4px 0;
  border-radius: var(--radius);
}
.mt-row:focus-visible {
  outline-offset: -2px;
}
.mt-passage:not(.cont) {
  margin-top: 10px;
}
.mt-transcript > .mt-passage:first-child {
  margin-top: 0;
}
.mt-at {
  padding-top: 3px;
  text-align: right;
  font-size: 11.5px;
  line-height: 18px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.mt-passage.cont .mt-at {
  visibility: hidden;
}
.mt-passage.cont:hover .mt-at,
.mt-passage.cont:focus-visible .mt-at {
  visibility: visible;
}
.mt-main {
  min-width: 0;
}
.mt-who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 24px;
}
.mt-passage.cont .mt-who {
  display: none;
}
.mt-av {
  --h: 220;
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 9.5px;
  font-weight: 650;
  background: hsl(var(--h) 38% 27%);
  color: hsl(var(--h) 70% 84%);
}
:root.light .mt-av {
  background: hsl(var(--h) 60% 93%);
  color: hsl(var(--h) 45% 32%);
}
.mt-av.is-you,
:root.light .mt-av.is-you {
  background: var(--chip);
  color: var(--text-2);
}
.mt-av svg {
  width: 12px;
  height: 12px;
  stroke-width: 1.9;
}
.mt-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mt-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px 0 6px;
  border-radius: 9999px;
  background: var(--chip);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.mt-tag svg {
  width: 12px;
  height: 12px;
}
.mt-text {
  padding-left: 28px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: pretty;
  user-select: text;
}
/* Words the user dictated into another app reached the call but weren't part of the conversation. */
.mt-passage.is-dict .mt-text {
  color: var(--text-3);
}
.mt-corrected {
  padding-left: 28px;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--text-3);
}
.mt-mark {
  padding-top: 6px;
  padding-bottom: 6px;
}
.mt-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-3);
}
.mt-line span {
  min-width: 0;
}
.mt-line::after {
  content: '';
  flex: 1;
  min-width: 16px;
  height: 1px;
  background: var(--border);
}
/* A silent-call mark (a Mac Voice's) wraps over several lines: a 16px stub beside it would hang mid-sentence. */
.mt-mark.is-silent .mt-line::after {
  min-width: 0;
}
.mt-line svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.mt-mark.is-user .mt-line {
  color: var(--text-2);
  font-weight: 500;
}
.mt-mark.is-gap .mt-line svg,
.mt-mark.is-dropped .mt-line svg,
.mt-mark.is-video_dropped .mt-line svg,
.mt-mark.is-screen_gap .mt-line svg,
.mt-mark.is-silent .mt-line svg {
  color: var(--warn);
}

/* A screen frame at its moment: a 16:9 thumbnail where a passage's text starts, and beside it the first line Voice
   read on the screen. Open, the image takes the row's width at its own shape and all of the text shows. */
.mt-frame {
  padding-top: 6px;
  padding-bottom: 6px;
}
.mt-frame .mt-main {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: start;
  gap: 8px 12px;
  padding-left: 28px;
}
.mt-shot {
  position: relative;
  width: 112px;
  height: 63px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-3);
  transition: border-color 120ms ease;
}
.mt-shot:hover {
  border-color: var(--border-strong);
}
.mt-shot:focus-visible {
  outline-offset: 1px;
}
.mt-shot > svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.4;
}
.mt-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mt-frame.has-image .mt-shot > svg {
  display: none;
}
/* The image comes back from the bucket. */
.mt-shot > .spinner {
  width: 16px;
  height: 16px;
  margin: 0;
  border-color: color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
}
.mt-frame.is-open > .mt-main {
  grid-template-columns: minmax(0, 1fr);
}
.mt-frame.is-open > .mt-main > .mt-shot {
  width: 100%;
  height: auto;
  aspect-ratio: var(--ar);
  max-height: 72vh;
}
.mt-frame.is-open > .mt-main > .mt-shot img {
  object-fit: contain;
}
.mt-frame-body {
  min-width: 0;
}
.mt-frame-line {
  font-size: 13px;
  line-height: 20px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: text;
}
.mt-frame.is-open > .mt-main > .mt-frame-body > .mt-frame-line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mt-frame-line.is-none,
.mt-frame-note {
  font-size: 12px;
  line-height: 18px;
  color: var(--text-3);
  user-select: none;
}
.mt-frame-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  margin: 2px 0 0 -4px;
  padding: 0 8px 0 4px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  transition: background-color 120ms ease, color 120ms ease;
}
.mt-frame-toggle:hover {
  background: var(--hover);
  color: var(--text);
}
.mt-frame-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mt-frame.is-open > .mt-main > .mt-frame-body > .mt-frame-toggle svg {
  transform: rotate(180deg);
}
/* The rest of the text opens and closes in place. */
.mt-frame-rest {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 320ms cubic-bezier(0.23, 1, 0.32, 1), opacity 320ms cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 320ms;
}
.mt-frame.is-open > .mt-main > .mt-frame-body > .mt-frame-rest {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.mt-frame-full {
  min-height: 0;
  overflow: hidden;
  padding-top: 4px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}
@media (prefers-reduced-motion: reduce) {
  .mt-frame-rest,
  .mt-frame-toggle svg {
    transition: none;
  }
}

.mt-live {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 10px 0 0 62px;
  font-size: 12.5px;
  color: var(--text-3);
}
.mt-live:empty {
  display: none;
}
.mt-live .spinner {
  width: 13px;
  height: 13px;
  margin: 0;
}
/* While Voice records the line shimmers: the transcript is still coming. */
.mt-listening {
  background: linear-gradient(90deg, var(--text-3) 35%, var(--text) 50%, var(--text-3) 65%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: mt-shimmer 2.4s linear infinite;
}
@keyframes mt-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mt-listening {
    animation: none;
    background: none;
    color: var(--text-3);
  }
}
.mt-jump {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px 0 9px;
  border-radius: 9999px;
  background: var(--raised);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  font-weight: 500;
  animation: pop 140ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.mt-jump svg {
  width: 15px;
  height: 15px;
}
@media (prefers-reduced-motion: reduce) {
  .mt-jump {
    animation: none;
  }
}

/* Correcting a passage: the text becomes a field in place. */
.mt-edit-box {
  padding-left: 28px;
}
.mt-edit {
  display: block;
  width: 100%;
  resize: none;
  overflow: hidden;
  padding: 5px 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 13.5px;
  line-height: 1.55;
  user-select: text;
}
.mt-edit:focus {
  border-color: var(--focus);
}
.mt-edit-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.mt-edit-hint {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--text-3);
}

/* The side column: the linked event, the voices and the notes. */
.mt-side {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-left: 1px solid var(--border);
}
.mt-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.mt-card:last-child {
  border-bottom: 0;
}
.mt-card-title {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
}
.mt-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.mt-quiet {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-3);
}
.mt-event-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mt-event-ic {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--chip);
  color: var(--text-2);
}
.mt-event-ic svg {
  width: 15px;
  height: 15px;
}
.mt-event-text {
  flex: 1;
  min-width: 0;
}
.mt-event-title {
  display: block;
  max-width: 100%;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mt-event-title:hover {
  text-decoration: underline;
}
.mt-event-when {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mt-event-box .btn {
  flex: none;
}
.mt-people {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -8px;
}
.mt-person {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 4px 8px;
  border-radius: var(--radius);
  text-align: left;
  transition: background-color 120ms ease;
}
button.mt-person:hover {
  background: var(--hover);
}
button.mt-person:disabled {
  cursor: default;
  background: none;
}
.mt-person .mt-av {
  width: 28px;
  height: 28px;
  font-size: 11px;
}
.mt-person .mt-av svg {
  width: 14px;
  height: 14px;
}
.mt-person-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.mt-person-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mt-person-sub {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mt-person-sub.is-ask {
  color: var(--text-2);
}
/* A name Rukoo filled in for a 1:1 that a second voice on the call put in doubt: an orange dot asks for a look. The
   line wraps rather than cut off its last words, which say what to do ("controleer het" in Dutch). */
.mt-person-sub.is-check {
  color: var(--text-2);
  white-space: normal;
}
.mt-person-sub.is-check::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--warn);
  vertical-align: 1px;
}
.mt-person > svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--text-3);
}
/* The voices grouped: at the user's microphone, then on the call. */
.mt-people-top {
  align-items: center;
  margin: -4px 0 6px;
  min-height: 24px;
}
.mt-people-top .mt-card-title {
  margin: 0;
}
.mt-group {
  padding: 8px 8px 2px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
}
.mt-group:first-child {
  padding-top: 0;
}
/* A voice's row holds its menu button and, beside the chevron, the button that opens its player. */
.mt-prow {
  position: relative;
}
.mt-prow.has-play .mt-person-text {
  margin-right: 30px;
}
.mt-prow.is-open .mt-person {
  background: var(--hover);
}
.mt-prow .mt-play {
  position: absolute;
  top: 7px;
  right: 30px;
}
.mt-prow.no-menu .mt-play {
  right: 6px;
}
.mt-play.on {
  background: var(--active);
  color: var(--text);
}
.mt-quiet-btn {
  height: 24px;
  padding: 0 8px 0 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}
.mt-quiet-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.mt-quiet-btn svg {
  width: 13px;
  height: 13px;
}
/* The player under a voice: what it says in the clip, the clip's progress in the voice's colour, and the controls.
 *   0ms  the player opens: rows 0fr → 1fr with the fade, 300ms */
.mt-player {
  margin: 4px 8px 8px 46px;
  padding: 10px 10px 8px 12px;
  border-radius: var(--radius);
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: mt-player-in 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes mt-player-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.mt-clip {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  user-select: text;
}
.mt-clip-at {
  margin-right: 6px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.mt-prog {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mt-track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 9999px;
  background: var(--border);
  overflow: hidden;
}
.mt-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: hsl(var(--h, 220) 55% 66%);
}
:root.light .mt-fill {
  background: hsl(var(--h, 220) 55% 48%);
}
.mt-ptime {
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mt-pbar {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 -4px 0 -6px;
}
.mt-pp {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--chip);
  color: var(--text);
  transition: filter 120ms ease;
}
.mt-pp:hover {
  filter: brightness(0.96);
}
:root:not(.light) .mt-pp:hover {
  filter: brightness(1.12);
}
.mt-pp:disabled {
  opacity: 0.4;
  cursor: default;
  filter: none;
}
.mt-pp svg {
  width: 14px;
  height: 14px;
}
.mt-pp .spinner {
  width: 12px;
  height: 12px;
  margin: 0;
  border-color: var(--border-strong);
  border-top-color: var(--text-2);
}
.mt-pcount {
  flex: 1;
  min-width: 0;
  margin-left: 6px;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mt-assign {
  height: 28px;
  padding: 0 8px 0 12px;
  gap: 4px;
  font-weight: 500;
}
.mt-assign svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
}
.mt-pnote {
  display: flex;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-3);
  text-wrap: pretty;
}
.mt-pnote svg {
  width: 13px;
  height: 13px;
  flex: none;
  margin-top: 1.5px;
}
.mt-pnote.is-error {
  color: var(--text-2);
}
.mt-pnote.is-error svg {
  color: var(--danger);
}
/* Under the user's row: Split into voices, how a split goes, or why it can't. The dashed circle says there may be
   more people here than the one row shows. */
.mt-split {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 4px 8px;
}
.mt-split:has(> .mt-split-btn) {
  padding: 0;
}
.mt-split-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 4px 8px;
  border-radius: var(--radius);
  text-align: left;
  transition: background-color 120ms ease;
}
.mt-split-btn:hover {
  background: var(--hover);
}
.mt-split-btn:disabled {
  opacity: 0.55;
  cursor: default;
  background: none;
}
.mt-split-ic {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed var(--border-strong);
  color: var(--text-2);
}
.mt-split-ic svg {
  width: 14px;
  height: 14px;
}
.mt-split-ic .spinner {
  width: 12px;
  height: 12px;
  margin: 0;
  border-color: var(--border-strong);
  border-top-color: var(--text-2);
}
.mt-split.is-error .mt-split-ic {
  color: var(--danger);
}
.mt-split-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.mt-split-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  text-wrap: pretty;
}
.mt-split.is-off .mt-split-label,
.mt-split.is-quiet .mt-split-label {
  font-weight: 400;
  color: var(--text-3);
}
.mt-split-hint {
  font-size: 12px;
  color: var(--text-3);
  text-wrap: pretty;
}
/* The passage a player plays, marked in the transcript; three bars move in place of its time while it plays. */
.mt-passage.is-clip {
  background: var(--sel);
}
.mt-passage.is-clip .mt-at {
  color: var(--text-2);
}
.mt-passage.is-playing .mt-at {
  color: transparent;
  background: linear-gradient(var(--text-2), var(--text-2)) 22px 7px / 2px 11px no-repeat, linear-gradient(var(--text-2), var(--text-2)) 26px 7px / 2px 11px no-repeat, linear-gradient(var(--text-2), var(--text-2)) 30px 7px / 2px 11px no-repeat;
  animation: mt-eq 900ms ease-in-out infinite;
}
@keyframes mt-eq {
  0%,
  100% {
    background-size: 2px 11px, 2px 5px, 2px 8px;
    background-position: 22px 7px, 26px 13px, 30px 10px;
  }
  50% {
    background-size: 2px 5px, 2px 11px, 2px 6px;
    background-position: 22px 13px, 26px 7px, 30px 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mt-player,
  .mt-passage.is-playing .mt-at,
  .mt-split-ic .spinner {
    animation: none;
  }
}
.mt-notes-card {
  flex: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.mt-notes-status {
  font-size: 11.5px;
  color: var(--text-3);
}
.mt-notes-status.error {
  color: var(--danger);
}
/* Notes another computer changed at the same time: the other version waits here. */
.mt-notes-other {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-size: 12.5px;
}
.mt-notes-other-text {
  margin: 0 0 6px;
  color: var(--text-2);
  line-height: 1.45;
}
.mt-notes-other-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mt-notes-other-preview {
  margin-top: 8px;
  max-height: 180px;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 12.5px;
  line-height: 1.5;
  user-select: text;
}
.mt-notes-input {
  flex: 1;
  width: 100%;
  min-height: 150px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  font-size: 13px;
  line-height: 1.55;
  user-select: text;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.mt-notes-input:empty::before {
  content: attr(data-placeholder);
  color: var(--text-3);
  pointer-events: none;
}
.mt-notes-input:focus {
  border-color: var(--border-strong);
  background: var(--panel);
}
.mt-notes-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin-bottom: 8px;
}
.mt-notes-toolbar .sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 4px;
}
.mt-notes-input.editor {
  padding: 12px;
  min-height: 220px;
  overflow-wrap: anywhere;
}
.mt-notes-input h2 {
  font-size: 16px;
  font-weight: 600;
}
.mt-notes-input a {
  color: var(--accent);
  cursor: pointer;
}

/* Nothing to show yet: how to record, or why Rukoo can't. */
.mt-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px;
  text-align: center;
  color: var(--text-3);
}
.mt-empty > svg {
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  opacity: 0.5;
  stroke-width: 1.3;
}
.mt-empty .t {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}
.mt-empty-body {
  max-width: 400px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
}
.mt-empty .btn {
  margin-top: 10px;
}
.mt-empty .btn svg {
  color: var(--danger);
}
.mt-empty .mt-record-split {
  margin-top: 10px;
}
.mt-empty .mt-record-split .btn {
  margin-top: 0;
}
.mt-empty .mt-record-more svg {
  color: inherit;
}

/* Record with a choice: the main part records with Voice's default, the arrow beside it opens what to record of
   the screen. One hairline of the surface between them. */
.mt-record-split {
  display: flex;
  align-items: stretch;
  gap: 1px;
}
.mt-record-split > .btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.mt-record-split > .mt-record-more {
  flex: none;
  width: 32px;
  padding: 0;
  justify-content: center;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.mt-record-more svg {
  width: 15px;
  height: 15px;
}
.mt-empty-hint {
  max-width: 380px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
  text-wrap: pretty;
}

/* Narrow: the transcript, the notes and the details become tabs, and the controls go under the title. */
@container meeting (max-width: 720px) {
  .mt-head {
    flex-wrap: wrap;
    padding-left: 16px;
  }
  .mt-tabs {
    display: block;
  }
  .mt-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .mt-side {
    border-left: 0;
  }
  .meeting[data-tab='transcript'] .mt-side,
  .meeting:not([data-tab='transcript']) .mt-transcript-pane,
  .meeting[data-tab='notes'] .mt-card[data-pane='people'],
  .meeting[data-tab='people'] .mt-card[data-pane='notes'] {
    display: none;
  }
  .mt-scroll {
    padding-right: 12px;
  }
  .mt-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .mt-live {
    padding-left: 54px;
  }
}
@container meeting (max-width: 460px) {
  .mt-titles {
    flex-basis: 100%;
  }
  .mt-actions {
    margin-left: auto;
  }
  .mt-actions .tbtn:not(.primary) span {
    display: none;
  }
}

/* The sidebar in meeting mode: Record, then the meetings by day; in the rail each shows its day of the month. */
.mt-record-btn svg {
  color: var(--danger);
}
.mt-record-btn.is-off,
.mt-record-split.is-side .mt-record-more.is-off {
  color: var(--text-2);
}
.mt-record-btn.is-off svg {
  color: var(--text-3);
}
.mt-record-split.is-side {
  margin: 6px 0 12px;
}
.mt-record-split.is-side > .compose-btn {
  margin: 0;
}
.mt-record-split.is-side > .mt-record-btn {
  flex: 1;
  width: auto;
  min-width: 0;
}
.mt-record-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mt-record-split.is-side > .mt-record-more {
  width: 30px;
}
.mt-record-split.is-side > .mt-record-more svg {
  color: var(--text-3);
}
.shell.collapsed .mt-record-split.is-side > .mt-record-more {
  display: none;
}
.shell.collapsed .mt-record-split.is-side > .mt-record-btn {
  flex: none;
  border-radius: var(--radius);
}
.mt-nav .ic.mdot b {
  display: none;
}
.mt-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.mt-nav.is-removed .label {
  color: var(--text-3);
}
.mt-side-empty {
  margin: 8px 10px;
  font-size: 12.5px;
  color: var(--text-3);
}
.shell.collapsed .mt-side-empty,
.shell.collapsed .mt-nav .ic.mdot svg,
.shell.collapsed .mt-nav .ic.mdot .mt-rec-dot {
  display: none;
}
.shell.collapsed .mt-nav .ic.mdot b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--chip);
  color: var(--text-2);
}
.shell.collapsed .mt-nav.is-live .ic.mdot b {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}
.sync-status.rec .dot {
  background: var(--danger);
}

/* The title bar while a meeting records: a dot and the meeting's clock, in every mode. A click opens the meeting. */
.rec-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  margin-right: 6px;
  padding: 0 10px 0 9px;
  border-radius: 9999px;
  background: var(--chip);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background-color 120ms ease;
}
.rec-indicator:hover {
  background: var(--active);
}
.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent);
}
.rec-indicator.is-paused .rec-dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent);
}
.rec-indicator svg {
  display: none;
  width: 14px;
  height: 14px;
  color: var(--text-3);
}
.rec-indicator.is-hidden svg {
  display: block;
}

/* The event card's links: Join and Record with Rukoo Voice. */
.cal-pop-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
}
/* Record with Rukoo Voice and, beside it, the arrow that chooses what to record of the screen. */
.cal-record {
  display: inline-flex;
  align-items: center;
}
.cal-record-more {
  margin-left: 1px;
  padding: 2px;
}
.cal-record-more:hover {
  text-decoration: none;
  background: var(--hover);
}

/* Settings > Meetings: Rukoo Voice's status as a pill with a dot, tinted when it says something. */
.mtset-status {
  gap: 12px;
}
.mtset-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  flex: none;
  padding: 0 10px 0 9px;
  border-radius: 9999px;
  background: var(--chip);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.mtset-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
}
.mtset-pill.is-ok {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok);
}
.mtset-pill.is-ok i {
  background: var(--ok);
}
.mtset-pill.is-busy i {
  background: var(--warn);
}
.mtset-pill.is-error {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}
.mtset-pill.is-error i {
  background: var(--danger);
}
/* Your other computers: the other computer's bucket with its button on the right, and why using it didn't work. */
.mtset-offer {
  gap: 12px;
}
.mtset-offer .btn {
  flex: none;
}
.mtset-share-error {
  color: var(--danger);
}

/* ---------- team chat ---------- */

/* Team chat takes the place of the list and the reader, as the calendar and meetings do (chat.js, chat-view.js).
   Search looks through mail, so it waits for Mail. The view is a size container: the thread panel and the narrow
   rules read its own width, whatever the sidebar and the agent panel take.
   Layers: sticky day dividers 2, message tools 3, jump pills 5, the narrow thread overlay 6. */
.chat {
  display: none;
  flex: 1;
  min-width: 0;
  position: relative;
  container: chat / inline-size;
}
/* Chat's surfaces draw their captions (times, counts, "Last reply") in chat's own caption grey, which passes 4.5:1;
   the mail around them keeps --text-3. Chat's dialogs and its mention list open on the body, outside .chat, so they
   take it too: an agent's "Made by Olga · Answers only Olga" there is 12px. */
.chat,
.ch-nav,
.ch-ws-switch,
.ch-form,
.dialog.ch-dialog,
.ch-suggest {
  --text-3: var(--ch-text-3);
}
.shell.chat-mode .chat {
  display: flex;
}
.shell.chat-mode .listpane,
.shell.chat-mode .divider,
.shell.chat-mode .reader {
  display: none;
}
body.chat-mode .titlebar-search {
  visibility: hidden;
}

/* The sidebar: the workspace switcher, then Channels and Direct messages. */
.ch-ws-tile {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  background: hsl(var(--h) 38% 27%);
  color: hsl(var(--h) 70% 84%);
}
:root.light .ch-ws-tile {
  background: hsl(var(--h) 60% 93%);
  color: hsl(var(--h) 45% 32%);
}
/* Another workspace asks for you (accent), or this one is stopped (warning). */
.ch-ws-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg);
}
.ch-ws-dot.is-warn {
  background: var(--warn);
}
.menu .mi .ch-ws-tile {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 8.5px;
}
.ch-nav.no-compose {
  margin-top: 6px;
}
.ch-row.is-unread {
  color: var(--text);
  font-weight: 600;
}
.ch-row.is-unread .ic {
  color: var(--text-2);
}
.ch-row.is-muted,
.ch-row.is-closed,
.ch-row.is-muted:hover,
.ch-row.is-closed:hover {
  color: var(--text-3);
}
.ch-row.active.is-muted,
.ch-row.active.is-closed {
  color: var(--text-2);
}
.ch-ic b {
  display: none;
}
.ch-badge {
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: var(--panel);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ch-row-quiet {
  color: var(--text-2);
}
.ch-side-fill {
  flex: 1;
  min-height: 0;
}
.ch-side-empty {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-3);
}

/* Rukoo's other apps (RUK-234): a card at the bottom of the Chat sidebar, once after the first workspace joined or made
 * here, until it is hidden. */
.ch-apps {
  flex: none;
  margin-top: 8px;
  padding: 6px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.ch-apps-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 0 2px 8px;
}
.ch-apps-head h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-apps-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 6px 6px;
  border-radius: 6px;
  text-align: left;
  color: var(--text);
  transition: background-color 120ms ease;
}
.ch-apps-row:hover {
  background: var(--hover);
}
.ch-apps-ic {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--chip);
  color: var(--text-2);
  display: grid;
  place-items: center;
}
.ch-apps-ic svg {
  width: 15px;
  height: 15px;
}
.ch-apps-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ch-apps-name {
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Up to two lines: the sidebar is narrow, and Dutch is longer. */
.ch-apps-desc {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}
.ch-apps-out {
  flex: none;
  margin-top: 2px;
  color: var(--text-3);
  display: grid;
}
.ch-apps-out svg {
  width: 13px;
  height: 13px;
}
.shell.collapsed .ch-apps {
  display: none;
}
.avatar.ch-av-14 {
  width: 14px;
  height: 14px;
  font-size: 7px;
}
.avatar.ch-av-16 {
  width: 16px;
  height: 16px;
  font-size: 7.5px;
}
.avatar.ch-av-18 {
  width: 18px;
  height: 18px;
  font-size: 9px;
}
.avatar.ch-av-24 {
  width: 24px;
  height: 24px;
  font-size: 10px;
}
.avatar.ch-av-40 {
  width: 40px;
  height: 40px;
  font-size: 14px;
}
.ch-av-group {
  display: inline-flex;
  align-items: center;
}
.ch-av-group .avatar + .avatar {
  margin-left: -4px;
  box-shadow: 0 0 0 1.5px var(--bg);
}
/* The rail: a channel shows its first letter on its hue, a mention count a small pill, a plain count the dot. Browse
 * channels stays as its search icon: the Channels heading and its plus hide in the rail, and Browse is then the way to
 * find and make channels. */
.shell.collapsed .ch-ic svg,
.shell.collapsed .ch-side-empty {
  display: none;
}
.shell.collapsed .ch-ic b {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: hsl(var(--h) 55% 90%);
  color: hsl(var(--h) 45% 30%);
}
:root:not(.light) .shell.collapsed .ch-ic b {
  background: hsl(var(--h) 30% 26%);
  color: hsl(var(--h) 70% 82%);
}
/* A closed DM's Closed tag sits where the unread pill goes; the rail has no room for it. */
.shell.collapsed .ch-row-tag {
  display: none;
}
.shell.collapsed .ch-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  font-size: 9.5px;
}

/* The pane: header, banner, log, composer. */
.ch-main {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ch-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px 10px 20px;
  border-bottom: 1px solid var(--border);
}
.ch-titles,
.ch-thread-titles {
  flex: 1;
  min-width: 0;
}
.ch-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ch-head-ic {
  display: grid;
  place-items: center;
  flex: none;
  color: var(--text-3);
}
.ch-head-ic svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}
.ch-title {
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-head-muted {
  display: grid;
  flex: none;
  color: var(--text-3);
}
.ch-head-muted svg {
  width: 14px;
  height: 14px;
}
.ch-meta,
.ch-thread-meta {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The header line says who hosts a DM and can read it, or who is in a channel: read, so in the supporting ink. */
.ch-meta {
  color: var(--text-2);
}
.ch-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.ch-members-n {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* A strip under the header: offline, reconnecting, stopped. Its height only while it shows, without motion. */
.ch-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 12px 4px 20px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}
.ch-banner > svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--text-3);
}
.ch-banner-text {
  flex: 1;
  min-width: 0;
  text-wrap: pretty;
}
.ch-banner .link-btn {
  flex: none;
  min-height: 24px;
}

.ch-log-area {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* The view keeps the scroll position itself when older rows come in above (chat-view.js render 'anchor'). */
.ch-scroll,
.ch-thread-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
  padding-bottom: 12px;
}
.ch-log,
.ch-thread-log {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ch-older,
.ch-thread-older {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 0;
  overflow: hidden;
  font-size: 12.5px;
  color: var(--text-3);
}
.ch-older.is-reserved,
.ch-thread-older.is-reserved {
  height: 40px;
}
.ch-older.is-opening {
  height: 72px;
}
.ch-older-text,
.ch-thread-older-text {
  min-width: 0;
}
.ch-older .spinner,
.ch-thread-older .spinner,
.ch-empty .spinner {
  margin: 0;
  color: var(--text-3);
  border-color: color-mix(in srgb, var(--text-3) 30%, transparent);
  border-top-color: currentColor;
}

/* Day dividers stay at the top while their day scrolls by. */
.ch-day {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 6px;
  background: var(--panel);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
}
.ch-day::before,
.ch-day::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
/* The first message after where you had read when you opened the room. It stays put while you read. */
.ch-new {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
}
.ch-new::before {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--accent);
}
.ch-floor {
  padding: 16px 20px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-2);
}
.ch-intro {
  padding: 28px 20px 12px;
}
.ch-intro-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--chip);
  color: var(--text-2);
}
.ch-intro-ic svg {
  width: 22px;
  height: 22px;
}
.ch-intro-ic:has(.avatar) {
  background: none;
}
.ch-intro-ic .avatar + .avatar {
  margin-left: -8px;
  box-shadow: 0 0 0 2px var(--panel);
}
.ch-intro-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.ch-intro-line {
  max-width: 64ch;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
}

/* A message: the avatar column, then the name line and the text. A continuation shows its time in the avatar column
   on hover and focus; the time is in the row's text for screen readers either way. */
.ch-msg {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 10px;
  padding: 2px 20px;
  outline-offset: -2px;
  transition: background-color 120ms ease;
}
.ch-msg.is-head {
  padding-top: 8px;
}
.ch-msg:hover,
.ch-msg:focus-within,
.ch-msg.has-popup {
  background: var(--ch-row-hover);
}
.ch-msg > .avatar,
.ch-msg > .ch-time.is-gutter {
  grid-column: 1;
}
.ch-msg > .ch-body {
  grid-column: 2;
  min-width: 0;
}
.ch-msg > .avatar {
  margin-top: 2px;
}
.ch-time {
  flex: none;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.ch-time.is-gutter {
  align-self: start;
  padding-top: 3px;
  font-size: 11px;
  text-align: right;
  visibility: hidden;
}
.ch-msg:hover > .ch-time.is-gutter,
.ch-msg:focus-within > .ch-time.is-gutter {
  visibility: visible;
}
.ch-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.ch-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-tag {
  flex: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 9999px;
  background: var(--chip);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}
/* The text sits in a rounded bubble as wide as it needs. The first of a group points at the avatar with a tighter
   corner; the rest of the group stacks under it 2px apart. */
.ch-text {
  width: fit-content;
  max-width: 100%;
  margin-top: 2px;
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--ch-bubble);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ch-msg.is-head .ch-text {
  border-top-left-radius: 6px;
}
/* One to three emoji and nothing else: larger, without the bubble. */
.ch-text.is-jumbo {
  padding: 0 2px;
  background: none;
  font-size: 32px;
  line-height: 1.25;
}
.ch-text.sel,
.ch-title.sel {
  user-select: text;
}
.ch-link {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ch-mention {
  padding: 0 2px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--link);
  font-weight: 500;
}
.ch-mention.is-me {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--text);
}
/* A message that mentions you: an accent bar on its left edge. */
.ch-msg.mentions-me {
  box-shadow: inset 2px 0 0 var(--accent);
}
.ch-removed {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}
.ch-removed svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.ch-msg.is-pending .ch-text {
  color: var(--text-2);
}
/* A thread's summary under its first message. Replies show only in their thread; the dot marks new ones. */
.ch-replies {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 24px;
  margin: 4px 0 2px -4px;
  padding: 0 8px 0 4px;
  border-radius: 6px;
  font-size: 12.5px;
  transition: background-color 120ms ease;
}
button.ch-replies:hover {
  background: var(--active);
}
.ch-replies-av {
  display: inline-flex;
  flex: none;
}
.ch-replies-av .avatar + .avatar {
  margin-left: -4px;
  box-shadow: 0 0 0 1.5px var(--panel);
}
.ch-replies-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}
.ch-replies-n {
  flex: none;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}
button.ch-replies .ch-replies-n {
  color: var(--link);
}
/* The middle dot between the line's parts; the line's gap spaces it. */
.ch-replies-sep {
  flex: none;
  margin: 0 -2px;
  color: var(--text-3);
}
.ch-replies-at {
  min-width: 0;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Replies of yours that wait or were refused: they show in the thread, with Retry and Discard. */
.ch-replies-unsent {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  color: var(--text-2);
  white-space: nowrap;
}
.ch-replies.has-failed .ch-replies-unsent {
  color: var(--danger);
  font-weight: 500;
}
.ch-replies-unsent svg {
  width: 13px;
  height: 13px;
  flex: none;
}
/* A thread whose first message has no row: retention took it, or it is further up. Its icon sits in the avatar column. */
.ch-msg.is-thread-row {
  padding-top: 8px;
}
.ch-thread-row-ic {
  grid-column: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 24px;
  color: var(--text-3);
}
.ch-thread-row-ic svg {
  width: 16px;
  height: 16px;
}
/* A notification's message, outlined for two seconds after it opened. */
.ch-msg.is-target {
  outline: 2px solid var(--focus);
}
/* A system event: who joined, left, made or renamed the channel. */
.ch-sys {
  display: grid;
  grid-template-columns: 32px minmax(0, max-content) max-content;
  column-gap: 10px;
  align-items: center;
  padding: 4px 20px;
  font-size: 12.5px;
  color: var(--text-2);
}
.ch-sys-ic {
  color: var(--text-3);
  display: grid;
  place-items: center;
}
.ch-sys-ic svg {
  width: 14px;
  height: 14px;
}
.ch-sys-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ch-sys .ch-time {
  font-size: 11.5px;
}
.ch-vh,
.ch-announce {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/*    0ms  a message that arrives while the room is open fades up 8px
 *  200ms  it rests. Loaded history doesn't move. */
.ch-msg.is-arriving {
  animation: ch-arrive 200ms cubic-bezier(0.23, 1, 0.32, 1) both;
}
@keyframes ch-arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* New messages below, or unread ones above: a pill at the log's edge. */
.ch-jump {
  position: absolute;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px 0 9px;
  border-radius: 9999px;
  background: var(--raised);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  animation: pop 140ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.ch-jump svg {
  width: 15px;
  height: 15px;
}
.ch-jump.is-up {
  top: 8px;
}
.ch-jump.is-down {
  bottom: 8px;
}
/* New replies in threads out of view: at the top, under the unread pill when that shows too. */
.ch-jump.is-thread {
  top: 8px;
}
.ch-jump.is-up:not([hidden]) + .ch-jump.is-thread {
  top: 44px;
}
.ch-jump.is-thread svg {
  color: var(--accent);
}
/* The hover bar (RUK-211 contract 5.2): React, Reply in thread and More as round buttons in a floating pill at the
   message's top right. It rides up over the row's top edge, as the first line of a row is its name or its bubble. Tab
   from the focused row reaches its buttons; Shift+F10 opens the same actions as a menu. A 32px pill holds 28px
   buttons at a 2px inset, so the buttons are pills too. */
.ch-tools {
  position: absolute;
  top: -12px;
  right: 20px;
  z-index: 3;
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 9999px;
  background: var(--raised);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.ch-msg.is-head > .ch-tools {
  top: -6px;
}
.ch-tool {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.ch-tool svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}
.ch-tool:hover,
.ch-tool[aria-expanded='true'] {
  background: var(--active);
  color: var(--text);
}
.ch-tool:active {
  transform: scale(0.96);
}
.ch-msg:hover > .ch-tools,
.ch-msg:focus-within > .ch-tools,
.ch-msg.has-popup > .ch-tools {
  opacity: 1;
  pointer-events: auto;
}

/* An unsent message's line: on its way, waiting, held or refused, with what the person can do. */
.ch-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  min-height: 22px;
  font-size: 12.5px;
  color: var(--text-2);
}
.ch-state > svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--text-3);
}
.ch-state .spinner {
  width: 12px;
  height: 12px;
  margin: 0;
  border-width: 1.5px;
  color: var(--text-3);
  border-color: color-mix(in srgb, var(--text-3) 30%, transparent);
  border-top-color: currentColor;
}
.ch-state-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ch-state .link-btn {
  font-size: 12.5px;
  min-height: 24px;
}
/* An unsent row keeps a little room under its line, so the line reads as its own and not as the next message's. */
.ch-msg.is-pending {
  padding-bottom: 6px;
}
/* A quick send never shows its line: it appears after a second, in room it already holds. */
.ch-state.is-sending {
  animation: ch-state-in 0s linear 1s both;
}
@keyframes ch-state-in {
  from {
    visibility: hidden;
  }
}
.ch-state.is-stale,
.ch-state.is-unknown,
.ch-state.is-failed {
  color: var(--danger);
}
.ch-state.is-stale > svg,
.ch-state.is-unknown > svg,
.ch-state.is-failed > svg {
  color: var(--danger);
}
.ch-msg.is-failed .ch-text {
  color: var(--text-2);
}

/* The composer: a card under the log (RUK-211 contract 5.2) with, top to bottom, the files to send, the formatting
   bar when it's on, the text, and a row of round buttons with Send at its end. The text grows up to 40 percent of the
   window, then scrolls. */
.ch-compose {
  padding: 0 20px 16px;
}
.ch-compose:empty {
  display: none;
}
.ch-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 8px 6px 12px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-sm);
  transition: box-shadow 120ms ease;
}
.ch-box:focus-within {
  box-shadow: 0 0 0 1px var(--border-strong), var(--shadow-sm);
}
.ch-box[hidden] {
  display: none;
}
.ch-input {
  position: relative;
  min-height: 20px;
  max-height: 40vh;
  overflow-y: auto;
  padding: 2px 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  outline: none;
  cursor: text;
}
.ch-input.is-empty::before {
  content: attr(data-placeholder);
  position: absolute;
  inset: 2px 0 auto 0;
  color: var(--text-3);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-box-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 28px;
}
.ch-box-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 auto 0 -6px;
  flex: none;
}
.ch-tb {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.ch-tb svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}
.ch-tb:hover,
.ch-tb[aria-expanded='true'] {
  background: var(--hover);
  color: var(--text);
}
.ch-tb.on {
  background: var(--active);
  color: var(--text);
}
.ch-tb:active {
  transform: scale(0.96);
}
.ch-limit {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--danger);
  text-wrap: pretty;
}
.ch-send {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--on-primary);
  transition: background-color 120ms ease, color 120ms ease;
}
.ch-send svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}
.ch-send:disabled {
  background: var(--chip);
  color: var(--text-3);
  cursor: default;
}
.ch-send:not(:disabled):active {
  transform: scale(0.96);
}
/* A mention in the composer: one locked piece, as it shows in the log. */
.ch-chip {
  padding: 0 2px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--link);
  font-weight: 500;
}
/* In place of the composer: the workspace stopped, an archived channel, a closed DM, a thread whose root went. */
.ch-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-height: 40px;
  padding: 6px 8px 6px 12px;
  border-radius: 12px;
  background: var(--panel-2);
  font-size: 12.5px;
  color: var(--text-2);
}
.ch-bar[hidden] {
  display: none;
}
.ch-bar-ic {
  display: grid;
  flex: none;
  color: var(--text-3);
}
.ch-bar-ic svg {
  width: 16px;
  height: 16px;
}
.ch-bar-text {
  flex: 1 1 200px;
  min-width: 0;
  text-wrap: pretty;
}
.ch-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
/* The people a mention can name, under or over the @ (chat-input.js), on the composer's mention list styles. */
.ch-suggest .avatar {
  width: 20px;
  height: 20px;
  font-size: 9px;
}
.ch-suggest [role='option'] {
  min-height: 32px;
}
.ch-suggest .ch-suggest-none {
  cursor: default;
  color: var(--text-3);
  font-size: 12.5px;
}

/* The thread: beside the log from 900px of the view's own width, over it below that. */
.ch-thread {
  position: relative;
  flex: none;
  width: clamp(320px, 36%, 420px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--panel);
}
.ch-thread[hidden] {
  display: none;
}
.ch-thread-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 10px 8px 10px 16px;
  border-bottom: 1px solid var(--border);
}
.ch-thread-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.ch-thread-back {
  display: none;
}
.ch-thread .ch-msg {
  padding-left: 16px;
  padding-right: 16px;
}
.ch-thread .ch-day {
  padding-left: 16px;
  padding-right: 16px;
}
.ch-thread .ch-thread-div {
  position: static;
}
.ch-thread .ch-tools {
  right: 12px;
}
.ch-thread-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 12px 16px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--chip);
  font-size: 12.5px;
  color: var(--text-2);
}
.ch-thread-note[hidden] {
  display: none;
}
.ch-thread-note > svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--text-3);
}
.ch-thread-note .link-btn {
  font-size: 12.5px;
}
.ch-thread-compose {
  padding: 0 16px 16px;
}
@container chat (max-width: 899.98px) {
  .ch-thread {
    position: absolute;
    inset: 0;
    z-index: 6;
    width: auto;
    border-left: 0;
  }
  .ch-thread-back {
    display: inline-flex;
  }
  .ch-thread-close {
    display: none;
  }
  .ch-thread-head {
    padding-left: 8px;
  }
  /*    0ms  the thread fades up 8px over the log
   *  200ms  it rests. Closing has no animation. */
  .ch-thread.is-entering {
    animation: ch-arrive 200ms cubic-bezier(0.23, 1, 0.32, 1) both;
  }
}

/* What the pane says when no conversation shows: loading, signed out, no workspace, gone. */
.ch-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px;
  text-align: center;
  color: var(--text-3);
}
.ch-empty > svg {
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  opacity: 0.5;
  stroke-width: 1.3;
}
.ch-empty-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}
.ch-empty-body {
  max-width: 420px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
}
.ch-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.ch-empty-hint {
  max-width: 380px;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-3);
  text-wrap: pretty;
}

/* Dialogs: make and join a workspace, a room's members. */
.ch-form {
  padding: 0;
}
.ch-form .error {
  margin: -8px 0 0;
}
/* A chat form's help says what a choice does ("You can't change this later.", what an invitation link gives). */
.ch-form .field-help {
  color: var(--text-2);
}
.ch-host {
  font-size: 12.5px;
}
.ch-join-preview p {
  margin: 0 0 4px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}
.ch-join-preview .ch-join-ws {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
}
.ch-members {
  max-height: 50vh;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.ch-members[aria-busy='true'] {
  display: grid;
  place-items: center;
  min-height: 72px;
}
.ch-member {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}
.ch-member-name {
  flex: 1;
  min-width: 0;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The rest of the dialogs (chat-dialogs.js, desktop-ui 6): fields, lists of people and channels, invitations,
 * settings sections and New message's To field. */
.dialog.ch-quiet-close .buttons button:last-child {
  background: var(--panel);
  border-color: var(--border-strong);
  color: var(--text);
}
.dialog.ch-quiet-close .buttons button:last-child:hover {
  background: var(--hover);
}
.dialog.ch-settings {
  max-height: calc(100vh - 48px);
}
/* A long dialog, such as Workspace settings in a short window or at 200 percent zoom, keeps its title and buttons in
 * view; the body scrolls between them (desktop-ui 10). The body reaches 8px into the dialog's padding on the sides and
 * 4px at the top and pads that back: the lists that run 8px into the margin (.ch-browse, .ch-people, .ch-new-list)
 * stay inside it without a sideways scrollbar, and a field's 3px focus halo stays whole at the top. The -4px top margin
 * keeps the gap under the title unchanged; overflow-x hidden keeps the body from scrolling sideways. */
.dialog.ch-dialog {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dialog.ch-dialog > h2,
.dialog.ch-dialog > .buttons {
  flex: none;
}
.dialog.ch-dialog > .dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden auto;
  margin: -4px -8px 0;
  padding: 4px 8px;
}
/* A body that scrolls shows that it does: the scrollbar stays hidden until it's used, so a cut between two sections
 * would look like the dialog's end. A hairline above the buttons while the body overflows, and a 16px fade at its
 * bottom edge while more sits below (chatDialog() in chat-dialogs.js sets both classes). */
.dialog.ch-dialog.is-scrollable > .buttons {
  margin-top: 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.dialog.ch-dialog.has-more > .dialog-body {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), transparent);
}
/* A dialog's error line in danger color (.dialog p would make it grey), and a button that can't be pressed yet looks
 * it, such as Make link before a guest has a channel. */
.dialog p.error {
  color: var(--danger);
}
.dialog .buttons button:disabled {
  opacity: 0.45;
  cursor: default;
}
.ch-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 9999px;
  background: var(--chip);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.ch-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.ch-label {
  padding: 0;
  font-size: 12.5px;
  color: var(--text-2);
}
.ch-warn {
  color: var(--warn);
}
.ch-checking {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
}
.ch-checking[hidden] {
  display: none;
}
.ch-checking .spinner,
.ch-invites-wait .spinner,
.ch-successors .spinner {
  color: var(--text-3);
  border-color: color-mix(in srgb, var(--text-3) 30%, transparent);
  border-top-color: currentColor;
}
/* The workspace an invitation is for, in the Join dialog. Not .ch-card, which is a link card under a message. */
.ch-join-preview {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}
.ch-join-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.ch-join-head .ch-join-ws {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
.ch-join-preview p:last-child {
  margin-bottom: 0;
}
.ch-other {
  margin: 0;
}
.ch-other[hidden] {
  display: none;
}
/* The name field of Make and Rename a channel: # inside it. */
.ch-hash-field {
  position: relative;
  display: block;
}
.ch-hash {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 13.5px;
  pointer-events: none;
}
.form .ch-hash-field input[type='text'] {
  padding-left: 22px;
}
.ch-checks {
  display: grid;
  gap: 2px;
  max-height: 168px;
  overflow-y: auto;
  margin: 0 -6px;
}
/* The rows reach into the margin for their hover fill; a note in their place lines up with the label above. */
.ch-checks > p,
.ch-checks > .ch-invite-none {
  margin: 0;
  padding: 0 6px;
}
.ch-invite-none p {
  margin: 0;
}
/* .form label lays fields out as a grid; these rows stay a line. */
.ch-check-row,
.ch-radio-row,
.form .ch-check-row,
.form .ch-radio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.ch-check-row:hover,
.ch-radio-row:hover {
  background: var(--hover);
}
.ch-check-row.is-disabled {
  cursor: default;
  color: var(--text-3);
}
.ch-check-row.is-disabled:hover {
  background: none;
}
.ch-check-row input,
.ch-radio-row input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: inherit;
}
.ch-check-ic {
  display: grid;
  flex: none;
  color: var(--text-3);
}
.ch-check-ic svg,
.ch-radio-label svg {
  width: 15px;
  height: 15px;
}
.ch-check-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-check-note {
  flex: 0 1 auto;
  text-align: right;
}
.ch-radio-row,
.form .ch-radio-row {
  align-items: flex-start;
  padding: 6px;
}
.ch-radio-row input {
  margin-top: 2px;
}
.ch-radio-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.ch-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--text);
}
.ch-radio-label svg {
  flex: none;
  color: var(--text-3);
}
.form input[type='text'].ch-link-field {
  font-size: 12.5px;
}
/* A withdrawn link stays in its field, struck through, so the line under it has something to point at. */
.ch-invite-withdrawn input[type='text'].ch-link-field {
  text-decoration: line-through;
  color: var(--text-3);
}
/* Copy link with "You'll see this link only once." under it; Guest with no channel to pick, with New channel. */
.ch-invite-copy,
.ch-invite-none {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
/* Invitations: the made link, and the open ones with Withdraw. */
.ch-open-invites {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.ch-set .ch-open-invites {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}
.ch-open-invites summary,
.ch-browse-archived summary {
  display: flex;
  align-items: center;
  min-height: 28px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
}
.ch-open-invites summary:hover,
.ch-browse-archived summary:hover {
  color: var(--text);
}
/* The summary keeps a disclosure mark: a chevron that turns when it opens. */
.ch-open-invites summary::-webkit-details-marker,
.ch-browse-archived summary::-webkit-details-marker {
  display: none;
}
.ch-open-invites summary::before,
.ch-browse-archived summary::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  margin: 0 10px 2px 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}
.ch-open-invites[open] summary::before,
.ch-browse-archived[open] summary::before {
  transform: rotate(45deg);
}
.ch-invites {
  display: grid;
  gap: 2px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.ch-invite {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}
.ch-invite-text {
  display: grid;
  flex: 1;
  min-width: 0;
}
.ch-invite-role {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.ch-invite-meta {
  font-size: 12px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}
.ch-invite .link-btn.danger {
  color: var(--danger);
}
.ch-invites-none,
.ch-browse-none {
  padding: 8px 0;
  font-size: 12.5px;
  color: var(--text-3);
}
.ch-invites-wait {
  display: grid;
  place-items: center;
  min-height: 48px;
}
/* Search and a button above a list, and buttons under it. */
.ch-dlg-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ch-search {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  outline: none;
  user-select: text;
}
.ch-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.ch-dlg-tools .btn,
.ch-dlg-foot .btn {
  flex: none;
}
.ch-dlg-tools .btn svg,
.ch-set .btn svg {
  width: 15px;
  height: 15px;
}
.ch-dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.dialog .ch-sub {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
/* Browse channels. */
.ch-browse,
.ch-people {
  display: grid;
  gap: 1px;
  max-height: min(48vh, 420px);
  margin: 0 -8px;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.ch-browse-row,
.ch-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 8px;
  border-radius: 8px;
}
.ch-browse-row:hover {
  background: var(--hover);
}
.ch-browse-open {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 40px;
  text-align: left;
  border-radius: 6px;
}
.ch-browse-ic {
  display: grid;
  flex: none;
  color: var(--text-3);
}
.ch-browse-ic svg {
  width: 16px;
  height: 16px;
}
.ch-browse-text {
  display: grid;
  min-width: 0;
}
.ch-browse-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-browse-meta {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-browse-none {
  padding-left: 8px;
}
.ch-browse-archived {
  margin-top: 8px;
}
.ch-browse-archived[hidden] {
  display: none;
}
/* People: members, the add picker, successors. */
.ch-person-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-group {
  display: flex;
  align-items: flex-end;
  min-height: 28px;
  padding: 6px 8px 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
}
.ch-pick .ch-check-row {
  min-height: 40px;
  padding: 0 8px;
  border-radius: 8px;
}
.ch-successors {
  display: grid;
  gap: 2px;
  max-height: min(40vh, 320px);
  margin: 0 -6px;
  overflow-y: auto;
}
.ch-successors[aria-busy='true'] {
  place-items: center;
  min-height: 56px;
}
.ch-person-pick {
  align-items: center;
}
.ch-person-pick input {
  margin-top: 0;
}
.ch-person-pick[hidden],
.ch-successors-none[hidden] {
  display: none;
}
.ch-successors-none {
  margin: 0;
  padding: 4px 6px;
}
.ch-successor-search {
  display: block;
  width: 100%;
  margin-bottom: 8px;
}
/* Leaving a workspace as the only manager of channels: a picker under each channel's name. */
.ch-handover {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}
.ch-handover-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ch-handover-name span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-handover .ch-successors {
  max-height: min(28vh, 240px);
}
/* Agents in channels (server/WORKSPACES.md "Agents"): an agent's avatar is a rounded square everywhere in Chat, and
 * the rows that name one say under its name whom it answers. */
.avatar.is-agent {
  border-radius: 28%;
}
/* Whom an agent answers and whether its runner connected wrap to a second line rather than lose "Not connected yet". */
.mention-who > .mention-note {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-3);
  white-space: normal;
  text-wrap: pretty;
}
/* On the row Enter picks, the selected-row grey leaves chat's caption grey at 4.2:1 in dark; the note steps up. */
.ch-suggest [role='option'].active .mention-note {
  color: var(--text-2);
}
.ch-agent-text {
  display: grid;
  flex: 1;
  min-width: 0;
}
/* Who made it and whom it answers wraps rather than cuts off the people it names, in a narrow dialog too. */
.ch-agent-meta,
.dialog .ch-agent-note {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-3);
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.ch-agent-row {
  min-height: 48px;
  padding-block: 4px;
}
/* A warning under a field, such as Chosen people with nobody picked; in light darker, for contrast at 12px. */
.form .field-help.ch-warn {
  color: var(--warn);
}
:root.light .form .field-help.ch-warn {
  color: color-mix(in srgb, var(--warn) 55%, var(--text));
}
.ch-pick .ch-agent-pick {
  min-height: 48px;
}
.dialog .ch-agents-intro {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-2);
  text-wrap: pretty;
}
.ch-dlg-tools-end {
  justify-content: flex-end;
}
.ch-agents-none {
  min-height: 40px;
  display: flex;
  align-items: center;
}
/* The people an agent answers besides its sponsor, under the Chosen people option. */
.ch-agent-people {
  display: grid;
  gap: 6px;
  margin: 2px 0 4px 32px;
  min-width: 0;
}
.ch-agent-people .ch-checks {
  max-height: 180px;
}
.dialog .ch-agent-people .field-help {
  margin: 0;
}
.form .ch-check-row.ch-agent-toggle {
  align-items: flex-start;
  padding: 6px;
}
.ch-agent-toggle input {
  margin-top: 2px;
}
.dialog .ch-agent-runs {
  margin: 0;
}
/* Under the Agents heading of Add people: what an agent does with the channel's messages. */
.dialog .ch-agents-read {
  padding: 0 8px 4px;
  text-wrap: pretty;
}
/* The key step: three numbered steps (who answers, the config with Copy config, how to start the runner), each a
 * label, its control and a line under it, with a number in a ring on the left. */
.ch-agent-steps {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: agent-step;
}
.ch-agent-step {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding-left: 32px;
  counter-increment: agent-step;
}
.ch-agent-step::before {
  content: counter(agent-step);
  position: absolute;
  top: -2px;
  left: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ch-agent-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 28px;
}
.ch-agent-step-head .ch-label {
  min-width: 0;
}
.ch-agent-step-head .btn {
  flex: none;
}
.ch-agent-step-head .btn svg,
.ch-agent-get svg {
  width: 15px;
  height: 15px;
}
.dialog .ch-agent-once {
  margin: 0;
  font-size: 12.5px;
  color: var(--text);
  text-wrap: pretty;
}
.ch-agent-step .ch-agent-cmd {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border);
  user-select: text;
}
.ch-agent-step .ch-agent-get {
  justify-self: start;
}
.form .ch-check-row.ch-agent-join {
  align-items: flex-start;
  padding: 6px;
}
.ch-agent-join input {
  margin-top: 2px;
}
.form textarea.ch-agent-config {
  min-height: 180px;
  font-family: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  tab-size: 2;
}
.dialog .ch-agent-key .field-help {
  margin: 0;
}
.ch-agent-cmd {
  font-family: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  font-size: 12px;
  color: var(--text);
  overflow-wrap: anywhere;
}
/* Run on this computer (agent-runs.js): the button, and in its place once the agent runs the line of what it does
 * here, at the button's height so the step doesn't jump. The same line sits under an agent in the Agents dialog. The
 * dot carries the state's color; the text stays grey. */
.ch-agent-run-row {
  display: flex;
  align-items: center;
  min-height: 28px;
  min-width: 0;
}
.ch-agent-run-row .btn svg {
  width: 15px;
  height: 15px;
}
.ch-agent-run {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.ch-agent-run-row .ch-agent-run {
  font-size: 12.5px;
  color: var(--text);
}
.ch-agent-run[hidden] {
  display: none;
}
.ch-run-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: var(--text-3);
  transform: translateY(-1px);
}
.ch-agent-run[data-tone='ok'] .ch-run-dot {
  background: var(--ok);
}
.ch-agent-run[data-tone='busy'] .ch-run-dot {
  background: var(--warn);
  animation: pulse 1s ease-in-out infinite;
}
.ch-agent-run[data-tone='warn'] .ch-run-dot {
  background: var(--warn);
}
.ch-agent-run[data-tone='error'] .ch-run-dot {
  background: var(--danger);
}
@media (prefers-reduced-motion: reduce) {
  .ch-agent-run[data-tone='busy'] .ch-run-dot {
    animation: none;
  }
}
/* Run it on another computer instead: the runner's config, closed under a summary with a turning chevron. */
.ch-agent-elsewhere {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ch-agent-elsewhere summary {
  display: flex;
  align-items: center;
  min-height: 28px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
}
.ch-agent-elsewhere summary:hover {
  color: var(--text);
}
.ch-agent-elsewhere summary::-webkit-details-marker {
  display: none;
}
.ch-agent-elsewhere summary::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  margin: 0 10px 2px 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}
.ch-agent-elsewhere[open] summary::before {
  transform: rotate(45deg);
}
@media (prefers-reduced-motion: reduce) {
  .ch-agent-elsewhere summary::before {
    transition: none;
  }
}
.ch-agent-elsewhere-body {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px 0 0 18px;
}
.ch-agent-elsewhere-body > .ch-label {
  margin-top: 8px;
}
.ch-agent-elsewhere-body .ch-agent-cmd {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border);
  user-select: text;
}
.ch-agent-elsewhere-body .ch-agent-get {
  justify-self: start;
}
.ch-agent-elsewhere-body .ch-agent-get svg {
  width: 15px;
  height: 15px;
}
.dialog .ch-agent-key [data-no-keyring] {
  margin: 12px 0 0;
}
/* Workspace settings: sections with a hairline between them. */
.ch-set {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.ch-set:first-child {
  padding-top: 0;
  border-top: 0;
}
.ch-set-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.ch-set-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 32px;
}
.ch-set-text {
  display: grid;
  flex: 1 1 200px;
  min-width: 0;
}
.ch-set-label {
  font-size: 12px;
  color: var(--text-3);
}
.ch-set-value {
  font-size: 13px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.ch-set-why {
  font-size: 12.5px;
  color: var(--text-2);
  text-wrap: pretty;
}
.dialog .ch-set-help {
  margin: 0;
}
.ch-set .ch-people {
  max-height: 200px;
}
.ch-set-leave {
  justify-items: start;
}
.ch-set-end {
  justify-content: flex-start;
}
.ch-browse-row > .btn {
  flex: none;
}
.btn.ch-danger-btn {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  color: var(--danger);
}
.btn.ch-danger-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 10%, var(--panel));
}
/* New message: picked people as chips in the To field, and the list under it. */
.ch-to {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: text;
}
.ch-to:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.ch-to-label {
  font-size: 12.5px;
  color: var(--text-3);
}
.ch-to-chips {
  display: contents;
}
.ch-to-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  height: 24px;
  padding: 0 2px 0 4px;
  border-radius: 9999px;
  background: var(--chip);
  font-size: 12.5px;
  color: var(--text);
}
.ch-to-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-to-x {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  color: var(--text-3);
}
.ch-to-x:hover {
  background: var(--hover);
  color: var(--text);
}
.ch-to-x svg {
  width: 12px;
  height: 12px;
}
.form .ch-to .ch-to-input {
  flex: 1 1 140px;
  min-width: 120px;
  height: 26px;
  padding: 0 2px;
  border: 0;
  background: none;
  box-shadow: none;
}
.ch-new-list {
  display: grid;
  gap: 1px;
  max-height: min(36vh, 280px);
  margin: -6px -8px 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.ch-new-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  cursor: pointer;
}
.ch-new-row:hover,
.ch-new-row.is-active {
  background: var(--hover);
}
.ch-new-list.is-full .ch-new-row {
  opacity: 0.45;
  cursor: default;
}
.ch-new-list.is-full .ch-new-row:hover {
  background: none;
}
/* People who can't be picked (you blocked them, or a guest), with why; Unblock stays fully clickable. */
.ch-new-off {
  margin-top: 0;
}
/* Right under the people who can be picked, as one list (the form's gap is 14px). */
.ch-new-list:not([hidden]) + .ch-new-off {
  margin-top: -13px;
}
.ch-new-row.is-off {
  cursor: default;
}
.ch-new-row.is-off:hover {
  background: none;
}
.ch-new-row.is-off > :first-child {
  opacity: 0.55;
}
.ch-new-row.is-off .ch-person-name {
  flex: 1;
  min-width: 0;
  color: var(--text-2);
}
.ch-new-off-text {
  flex: 1;
  min-width: 0;
  display: grid;
  padding: 4px 0;
}
/* Nobody to pick: the line, and Invite people for those who may invite. */
.ch-new-none {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
/* A channel the person isn't in, from Browse: the note fills the log's place and the Join bar sits under it. */
.ch-main.is-preview .ch-compose {
  order: 1;
}

/* ---------- team chat: rich messages (RUK-211) ---------- */

/* Markdown in a message (chat-rich.js textEl, contract 3.3). Blocks follow each other 4px apart in the bubble. */
.ch-text > * {
  margin: 0;
}
.ch-text > * + * {
  margin-top: 4px;
}
.ch-text strong,
.ch-h {
  font-weight: 650;
}
.ch-h {
  line-height: 1.35;
  text-wrap: balance;
}
.ch-h.is-1 {
  font-size: 1.25em;
}
.ch-h.is-2 {
  font-size: 1.125em;
}
.ch-text s {
  color: var(--text-2);
}
.ch-code,
.ch-pre {
  font-family: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  font-size: 12.5px;
}
.ch-code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--border);
}
.ch-pre {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--border);
  white-space: pre;
  overflow-x: auto;
  line-height: 1.45;
}
.ch-quote {
  padding-left: 10px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-2);
}
.ch-list {
  padding-left: 22px;
}
.ch-list .ch-list {
  margin: 0;
}
.ch-list li::marker {
  color: var(--text-2);
}

/* Files in a message (contract 3.6): one image in a box of at most 360 by 280 at its own shape, two to four in a grid,
   "+n" on the fourth for the rest; other files as cards with their kind, name, size and a download button. */
.ch-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.ch-media {
  display: grid;
  gap: 4px;
  width: min(360px, 100%);
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 118px;
}
.ch-media.is-n1 {
  width: min(var(--w, 360px), 100%);
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
}
.ch-media.is-n1 .ch-img {
  aspect-ratio: var(--ar, 4 / 3);
}
.ch-media.is-n2 {
  grid-auto-rows: 178px;
}
.ch-media.is-n3 .ch-img:first-child {
  grid-row: span 2;
}
.ch-img {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--ch-bubble);
  color: var(--text-3);
  cursor: zoom-in;
}
.ch-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 160ms ease;
}
.ch-img.is-loaded img {
  opacity: 1;
}
.ch-img-ph {
  display: grid;
}
.ch-img-ph svg {
  width: 22px;
  height: 22px;
}
.ch-img.is-loaded .ch-img-ph {
  visibility: hidden;
}
.ch-img::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--border);
  pointer-events: none;
}
.ch-img-more {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  background: var(--ch-overlay);
  color: var(--ch-on-overlay);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ch-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ch-file {
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(360px, 100%);
  min-height: 56px;
  padding: 6px;
  border-radius: 14px;
  background: var(--ch-bubble);
}
.ch-file-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
}
.ch-file-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text-2);
}
.ch-file-ic svg {
  width: 20px;
  height: 20px;
}
.ch-file-ic .spinner {
  width: 16px;
  height: 16px;
  margin: 0;
  color: var(--text-3);
  border-color: color-mix(in srgb, var(--text-3) 30%, transparent);
  border-top-color: currentColor;
}
.ch-file-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ch-file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-file-meta,
.ch-tray-sub {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-file-main:hover .ch-file-name {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ch-file-dl {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.ch-file-dl svg {
  width: 17px;
  height: 17px;
}
.ch-file-dl:hover {
  background: var(--active);
  color: var(--text);
}
.ch-file.is-busy button {
  pointer-events: none;
}
.ch-file.is-unsent {
  min-height: 48px;
}
.ch-file.is-unsent .ch-file-ic {
  width: 36px;
  height: 36px;
}

/* Link cards under a message (contract 3.6): the site, the title as the link, two lines of description, the image to
   the right, or under the text when it's wide. The author's remove button shows on hover and focus. */
.ch-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.ch-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  width: min(480px, 100%);
  padding: 10px 12px 10px 14px;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--border), inset 3px 0 0 var(--border-strong);
  cursor: pointer;
  transition: background-color 120ms ease;
}
.ch-card:hover {
  background: var(--hover);
}
.ch-card.is-below {
  grid-template-columns: minmax(0, 1fr);
  width: min(388px, 100%);
}
.ch-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ch-card-site {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-card-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--link);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.ch-card-title:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ch-card-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.ch-card-img {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--ch-bubble);
  color: var(--text-3);
}
.ch-card.is-below .ch-card-img {
  width: 100%;
  max-width: 360px;
  height: auto;
}
.ch-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 160ms ease;
}
.ch-card-img.is-loaded img {
  opacity: 1;
}
.ch-card-img.is-loaded .ch-img-ph {
  visibility: hidden;
}
.ch-card-img .ch-img-ph svg {
  width: 18px;
  height: 18px;
}
.ch-card-play {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: var(--ch-overlay);
  color: var(--ch-on-overlay);
}
.ch-card-play svg {
  width: 15px;
  height: 15px;
  margin-left: 2px;
  fill: currentColor;
}
.ch-card-x {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: var(--raised);
  box-shadow: var(--shadow-sm);
  color: var(--text-2);
  opacity: 0;
  cursor: pointer;
  transition: opacity 120ms ease;
}
.ch-card-x svg {
  width: 12px;
  height: 12px;
  stroke-width: 2;
}
.ch-card:hover .ch-card-x,
.ch-card:focus-within .ch-card-x {
  opacity: 1;
}
.ch-card-x:hover {
  color: var(--text);
}

/* Reactions under everything else (contract 3.6): a pill per emoji with its count, tinted when it holds yours, and the
   add button, which shows with the row's hover bar. */
.ch-reacts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.ch-react {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px 0 7px;
  border-radius: 9999px;
  background: var(--ch-bubble);
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 12.5px;
  cursor: pointer;
  transition: box-shadow 120ms ease, background-color 120ms ease;
}
.ch-react:hover {
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.ch-react:active,
.ch-react-add:active {
  transform: scale(0.96);
}
.ch-react-e {
  font-size: 15px;
  line-height: 1;
}
.ch-react-n {
  min-width: 1ch;
  font-weight: 500;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.ch-react.is-mine {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
}
.ch-react.is-mine .ch-react-n {
  color: var(--link);
}
.ch-react-add {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text-2);
  opacity: 0;
  cursor: pointer;
  transition: opacity 120ms ease, background-color 120ms ease;
}
.ch-react-add svg {
  width: 15px;
  height: 15px;
}
.ch-msg:hover .ch-react-add,
.ch-msg:focus-within .ch-react-add,
.ch-msg.has-popup .ch-react-add {
  opacity: 1;
}
.ch-react-add:hover {
  background: var(--hover);
  color: var(--text);
}

/* The composer's files (contract 3.5): image thumbnails and file cards above the text, each with its remove button,
   a bar while it uploads and Retry when it failed. */
.ch-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 4px -4px;
  padding-top: 2px;
}
.ch-tray-item {
  position: relative;
  flex: none;
  border-radius: 12px;
  background: var(--ch-bubble);
}
.ch-tray-item.is-file {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 248px;
  max-width: 100%;
  height: 52px;
  padding: 6px 30px 6px 6px;
}
.ch-tray-item.is-file .ch-file-ic {
  width: 40px;
  height: 40px;
}
/* As tall as a file card, so a row of mixed files lines up. */
.ch-tray-item.is-image {
  width: 52px;
  height: 52px;
}
.ch-tray-thumb {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}
.ch-tray-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ch-tray-item.is-image .ch-tray-sub {
  display: none;
}
.ch-tray-bar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  height: 3px;
  overflow: hidden;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--text-3) 30%, transparent);
  visibility: hidden;
}
.ch-tray-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.ch-tray-item.is-busy .ch-tray-bar {
  visibility: visible;
}
.ch-tray-item.is-image.is-busy img {
  opacity: 0.55;
}
.ch-tray-item.is-failed {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 50%, transparent);
}
.ch-tray-item.is-failed .ch-tray-sub {
  color: var(--danger);
}
.ch-tray-item.is-image.is-failed img {
  opacity: 0.4;
}
.ch-tray-retry {
  flex: none;
  min-height: 24px;
  font-size: 12px;
}
.ch-tray-item.is-image .ch-tray-retry {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  min-height: 20px;
  padding: 0 6px;
  border-radius: 9999px;
  background: var(--raised);
  box-shadow: var(--shadow-sm);
}
.ch-tray-x {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: var(--raised);
  box-shadow: var(--shadow-sm);
  color: var(--text-2);
  opacity: 0;
  cursor: pointer;
  transition: opacity 120ms ease;
}
.ch-tray-x svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}
.ch-tray-item.is-file .ch-tray-x {
  top: 50%;
  right: 6px;
  margin-top: -10px;
}
.ch-tray-item:hover .ch-tray-x,
.ch-tray-item:focus-within .ch-tray-x,
.ch-tray-item.is-failed .ch-tray-x {
  opacity: 1;
}
.ch-tray-x:hover {
  color: var(--text);
}

/* The formatting bar above the composer's text (contract 3.3): round buttons, a hairline under it. */
.ch-fmt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0 0 2px -6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.ch-fmt .icon-btn.sm {
  border-radius: 9999px;
}
.ch-fmt-sep {
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: var(--border);
}

/* ":smile" in the composer: the emoji list, on the mention list's styles. */
.ch-suggest.is-emoji [role='option'] {
  gap: 10px;
}
.ch-suggest-emoji {
  flex: none;
  width: 22px;
  font-size: 18px;
  line-height: 1;
  text-align: center;
}
.ch-suggest-label {
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The emoji picker (contract 3.4, 5.2): search and skin tone, group tabs, the grid with sticky group names, and the
   emoji under the keyboard or the pointer at its foot. A popover: 14px corners, the menu's layer. */
.ch-emoji {
  position: fixed;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: 348px;
  max-width: calc(100vw - 16px);
  height: 404px;
  max-height: calc(100vh - 16px);
  padding: 8px 8px 0;
  border-radius: 14px;
  background: var(--raised);
  box-shadow: var(--shadow), 0 0 0 1px var(--border);
  animation: pop 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ch-emoji-top {
  display: flex;
  gap: 6px;
}
.ch-emoji-field {
  position: relative;
  flex: 1;
  min-width: 0;
}
.ch-emoji-field svg {
  position: absolute;
  left: 9px;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  color: var(--text-3);
  pointer-events: none;
}
.ch-emoji-search {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 30px;
  border: 0;
  border-radius: 8px;
  background: var(--chip);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.ch-emoji-search::placeholder {
  color: var(--text-3);
}
/* The field's own clear button is the system's blue cross; backspace clears it, and Escape closes the picker. */
.ch-emoji-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.ch-emoji-tone,
.ch-emoji-tone-opt,
.ch-emoji-tab,
.ch-emoji-cell {
  display: grid;
  place-items: center;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.ch-emoji-tone {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
}
.ch-emoji-tone:hover,
.ch-emoji-tone[aria-expanded='true'] {
  background: var(--hover);
}
.ch-emoji-tones {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  padding-top: 4px;
}
.ch-emoji-tone-opt {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
}
.ch-emoji-tone-opt:hover,
.ch-emoji-tone-opt[aria-checked='true'] {
  background: var(--active);
}
.ch-emoji-tabs {
  display: flex;
  gap: 1px;
  margin: 6px -8px 0;
  padding: 0 6px 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.ch-emoji-tab {
  flex: none;
  width: 32px;
  height: 30px;
  border-radius: 6px;
  color: var(--text-2);
}
.ch-emoji-tab svg {
  width: 16px;
  height: 16px;
}
.ch-emoji-tab:hover {
  background: var(--hover);
  color: var(--text);
}
/* The group at the top of the list: its tab is grey like a selected row, its icon in the content ink. */
.ch-emoji-tab[aria-selected='true'] {
  background: var(--sel);
  color: var(--text);
}
/* Positioned, so a group's offsetTop is its place in the list its tab scrolls to. */
.ch-emoji-grid {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 -8px;
  padding: 0 8px 8px;
  overflow-y: auto;
}
.ch-emoji-sec {
  content-visibility: auto;
  contain-intrinsic-size: auto 240px;
}
.ch-emoji-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 2px 4px;
  background: var(--raised);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
}
.ch-emoji-cells {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
}
.ch-emoji-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  font-size: 22px;
}
.ch-emoji-cell:hover,
.ch-emoji-cell:focus-visible,
.ch-emoji-cell[tabindex='0']:focus {
  background: var(--active);
}
.ch-emoji-cell:focus-visible {
  outline-offset: -2px;
}
.ch-emoji-status {
  display: flex;
  justify-content: center;
  padding: 0 8px;
  font-size: 12.5px;
  color: var(--text-3);
}
.ch-emoji-status:not(:empty) {
  padding: 24px 8px;
}
.ch-emoji-status .spinner {
  margin: 0;
  color: var(--text-3);
  border-color: color-mix(in srgb, var(--text-3) 30%, transparent);
  border-top-color: currentColor;
}
.ch-emoji-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin: 0 -8px;
  padding: 0 12px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}
.ch-emoji-big {
  flex: none;
  font-size: 22px;
  line-height: 1;
}
.ch-emoji-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-emoji-code {
  flex: none;
  margin-left: auto;
  font-family: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  font-size: 11.5px;
  color: var(--text-3);
}

/* The image viewer (contract 3.6, 5.2): the picture at fit size on a dark scrim, its name, Open, Save and close on top,
   arrows beside it when the message has several. Dark in both themes, as a photo viewer is. */
.scrim.ch-viewer {
  /* Under the 40px title bar, which stays above every scrim with the window's own buttons. */
  inset: 40px 0 0 0;
  display: flex;
  flex-direction: column;
  /* .scrim centers a dialog; the viewer's bar and picture take the whole width. */
  align-items: stretch;
  justify-items: stretch;
  padding: 12px 16px 16px;
  background: var(--ch-viewer-bg);
  color: var(--ch-viewer-ink);
}
.ch-viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}
.ch-viewer-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ch-viewer-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-viewer-meta {
  font-size: 12px;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}
.ch-viewer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.ch-viewer-actions .btn svg {
  width: 16px;
  height: 16px;
}
.ch-viewer .icon-btn {
  color: var(--ch-viewer-ink);
  border-radius: 9999px;
}
.ch-viewer .icon-btn:hover {
  background: var(--ch-viewer-soft);
}
.ch-viewer-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px 48px 0;
}
.ch-viewer-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
  opacity: 0;
  transition: opacity 160ms ease;
}
.ch-viewer-stage.is-loaded .ch-viewer-img {
  opacity: 1;
}
.ch-viewer-step {
  position: absolute;
  top: 50%;
  margin-top: -20px;
  width: 40px;
  height: 40px;
  background: var(--ch-viewer-soft);
}
.ch-viewer-step.is-prev {
  left: 16px;
}
.ch-viewer-step.is-next {
  right: 16px;
}
.ch-viewer-step:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Files dragged over the conversation or the thread: where they go. It lets the drag through to what is under it,
   which tells the view which composer takes the drop. The thread's overlay is layer 6, so this is 7. */
.ch-drop {
  position: absolute;
  z-index: 7;
  display: grid;
  padding: 12px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  pointer-events: none;
}
.ch-drop-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent);
  border-radius: 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  text-wrap: balance;
}
.ch-drop-box svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}
.ch-drop-text {
  max-width: 32ch;
}

/* Touch screens have no hover: the add-reaction and remove buttons show without one. */
@media (hover: none) {
  .ch-react-add,
  .ch-card-x,
  .ch-tray-x {
    opacity: 1;
  }
}

/* A narrow view: the header drops its member count and meta line, rows tighten. */
@container chat (max-width: 560px) {
  .ch-head {
    padding: 8px 8px 8px 12px;
  }
  .ch-meta,
  .ch-members-n {
    display: none;
  }
  .ch-msg {
    grid-template-columns: 28px minmax(0, 1fr);
    padding-left: 12px;
    padding-right: 12px;
  }
  .ch-sys {
    grid-template-columns: 28px minmax(0, max-content) max-content;
    padding-left: 12px;
    padding-right: 12px;
  }
  .ch-msg > .avatar.ch-av {
    width: 28px;
    height: 28px;
  }
  .ch-day,
  .ch-new,
  .ch-intro,
  .ch-floor {
    padding-left: 12px;
    padding-right: 12px;
  }
  .ch-banner {
    padding-left: 12px;
  }
  .ch-compose {
    padding: 0 12px 12px;
  }
  /* React and More stay in the hover bar; More's menu holds Reply in thread. */
  .ch-tools [data-ch-tool='reply'] {
    display: none;
  }
  .ch-tools {
    right: 12px;
  }
  .ch-card.is-side .ch-card-img {
    width: 56px;
    height: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ch-msg.is-arriving,
  .ch-jump,
  .ch-thread.is-entering,
  .ch-emoji {
    animation: none;
  }
  .ch-msg,
  .ch-replies,
  .ch-tools,
  .ch-tool,
  .ch-box,
  .ch-send,
  .ch-tb,
  .ch-react,
  .ch-react-add,
  .ch-card,
  .ch-card-x,
  .ch-file-dl,
  .ch-tray-x,
  .ch-tray-bar i,
  .ch-img img,
  .ch-card-img img,
  .ch-viewer-img,
  .ch-open-invites summary::before,
  .ch-browse-archived summary::before {
    transition: none;
  }
}
