/* Rmail web mail surface. */

/* Arctic Blue: blue top bar on cool white; the dark theme keeps the same blue family.
   Scoped to the webmail so the admin center keeps its own colors. */
body.web {
  --mt-accent: #0b6bcb;
  --mt-accent-dark: #0957a6;
  --mt-accent-text: #0a63bd;
  --mt-accent-hover: #0959a8;
  --mt-accent-pale: #d6e7f8;
  --mt-accent-wash: #eaf3fc;
  --mt-on-accent: #ffffff;
  --mt-topbar: #0b6bcb;
  --mt-topbar-ink: #ffffff;
  --mt-text: #17222e;
  --mt-text-secondary: #57677a;
  --mt-text-tertiary: #6b7889;
  --mt-text-disabled: #9fabb8;
  --mt-border: #d3dde8;
  --mt-border-light: #e4ebf2;
  --mt-border-strong: #a9b7c6;
  --mt-rule: #e6edf4;
  --mt-bg: #f3f7fb;
  --mt-surface: #ffffff;
  --mt-hover: #eef4fa;
  --mt-selected: #e1edf9;
}

body.web.is-dark {
  --mt-accent: #4b9ef0;
  --mt-accent-dark: #6cb0f5;
  --mt-accent-text: #6cb0f5;
  --mt-accent-hover: #1d3a5c;
  --mt-accent-pale: rgba(75, 158, 240, 0.28);
  --mt-accent-wash: rgba(75, 158, 240, 0.14);
  --mt-on-accent: #06121f;
  --mt-topbar: #0d1b2c;
  --mt-topbar-ink: #e3ecf6;
  --mt-text: #e3eaf2;
  --mt-text-secondary: #a2b2c4;
  --mt-text-tertiary: #8b9cb0;
  --mt-text-disabled: #586a80;
  --mt-border: #263a52;
  --mt-border-light: #1c2d42;
  --mt-border-strong: #37506d;
  --mt-rule: #1c2d42;
  --mt-bg: #0f1a28;
  --mt-surface: #142234;
  --mt-hover: #1a2b40;
  --mt-selected: #1f3550;
}

.web {
  background: var(--mt-bg);
  overflow: hidden;
}

/* Hidden until a session is confirmed, so the app never flashes before sign-in. */
.web:not(.web--in) .web-app {
  visibility: hidden;
}

.web-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
}

/* Maintenance banner (admin center) */
.web-maintenance {
  flex: 0 0 auto;
  padding: 6px 16px;
  border-bottom: 1px solid var(--mt-warning-border);
  background: var(--mt-warning-bg);
  color: var(--mt-warning-text);
  font-size: 13px;
}

/* Top bar */
.web-topbar {
  display: flex;
  align-items: center;
  flex: 0 0 50px;
  height: 50px;
  padding-left: 4px;
  background: var(--mt-topbar);
  color: var(--mt-topbar-ink);
  white-space: nowrap;
}

.web-topbar__waffle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mt-topbar-ink);
  font-size: 18px;
}

.web-topbar__waffle:hover {
  background: var(--mt-accent-hover);
}

.web-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  height: 50px;
  margin-left: 2px;
  padding: 0 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--mt-topbar-ink);
  text-decoration: none;
}

.web-brand:hover {
  text-decoration: none;
  background: var(--mt-accent-hover);
}

.web-brand__name {
  font-family: var(--mt-font-light);
  font-size: 22px;
  font-weight: 300;
  line-height: 50px;
  letter-spacing: 0.01em;
}

.web-brand__product {
  font-size: 15px;
  line-height: 50px;
  color: rgba(255, 255, 255, 0.92);
}

.web-delegated {
  align-self: center;
  margin-left: 8px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  color: var(--mt-topbar-ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Switcher between the own and shared mailboxes. */
.web-mailbox {
  align-self: center;
  max-width: 220px;
  margin-left: 8px;
}

.web-search {
  display: flex;
  align-items: center;
  width: min(560px, 42vw);
  height: 40px;
  margin-left: 10px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--mt-accent-wash);
  background: var(--mt-surface);
  color: var(--mt-text-secondary);
}

.web-search:focus-within {
  border-color: var(--mt-surface);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.web-search .icon {
  flex: 0 0 auto;
  font-size: 15px;
  color: var(--mt-text-secondary);
}

.web-search input {
  min-width: 0;
  flex: 1;
  height: 36px;
  margin-left: 8px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--mt-text);
  font-size: 14px;
}

/* The box has its own clear button. */
.web-search input::-webkit-search-cancel-button {
  display: none;
}

.web-search input::placeholder {
  color: var(--mt-text-secondary);
}

.web-search__clear,
.web-search__advanced {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mt-text-secondary);
  font-size: 11px;
}

.web-search__clear:hover,
.web-search__advanced:hover,
.web-search__advanced[aria-expanded="true"] {
  background: var(--mt-bg);
}

/* Where Enter searches: this folder (default) or all folders; opens a flyout. */
.web-search__scope {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  height: 28px;
  margin-left: 6px;
  padding: 0 6px 0 10px;
  border: 0;
  border-left: 1px solid var(--mt-border);
  background: transparent;
  color: var(--mt-text-secondary);
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.web-search__scope:hover,
.web-search__scope[aria-expanded="true"] {
  background: var(--mt-hover);
  color: var(--mt-text);
}

.web-search__scope:focus-visible {
  outline: 1px solid var(--mt-accent);
  outline-offset: -1px;
}

.web-search .web-search__scope .icon {
  font-size: 10px;
}

.web-scope-menu {
  min-width: 160px;
}

/* Advanced search: labelled fields that build the operator query. */
.web-advsearch {
  display: grid;
  gap: 6px;
  width: 340px;
  max-width: calc(100vw - 16px);
  padding: 12px;
}

.web-advsearch__row {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.web-advsearch__check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.web-advsearch__hint {
  margin: 4px 0;
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-advsearch .mt-btn {
  justify-self: end;
}

/* Contacts, events and tasks matching a mail search, above the results. */
.web-other {
  flex: 0 0 auto;
  max-height: 40%;
  overflow: auto;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--mt-rule);
}

.web-other__title {
  margin: 6px 16px 2px;
  color: var(--mt-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.web-other__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 16px;
  border: 0;
  background: transparent;
  color: var(--mt-text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.web-other__item:hover,
.web-other__item:focus-visible {
  background: var(--mt-hover);
}

.web-other__name,
.web-other__detail {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.web-other__detail {
  color: var(--mt-text-secondary);
  font-size: 12px;
}

/* "Move to folder ›": the entry, and its side menu of folders. */
.web-submenu__item .icon:last-child {
  margin-left: auto;
  color: var(--mt-text-secondary);
}

.web-submenu__item[aria-expanded="true"] {
  background: var(--mt-accent-wash);
  color: var(--mt-text);
}

.web-submenu {
  position: absolute;
  left: 100%;
  min-width: 220px;
  max-width: 320px;
  border-top: 1px solid var(--mt-border);
}

.web-submenu.is-left {
  right: 100%;
  left: auto;
}

.web-submenu__list {
  max-height: min(60vh, 420px);
  overflow-y: auto;
}

.web-submenu__list .mt-flyout__item {
  overflow: hidden;
  text-overflow: ellipsis;
}

.web-folder-menu {
  min-width: 240px;
}

.web-submenu__filter {
  width: calc(100% - 16px);
  margin: 2px 8px 6px;
}

.web-scope-menu .mt-flyout__item[aria-checked="true"] {
  color: var(--mt-text);
}

/* The folder of a result when searching all folders. */
.web-row__folder {
  display: inline-block;
  margin-right: 6px;
  padding: 0 5px;
  border-radius: 3px;
  background: var(--mt-bg);
  color: var(--mt-text-secondary);
  font-size: 11px;
}

.web-topbar__right {
  display: flex;
  align-items: center;
  height: 50px;
  margin-left: auto;
}

.web-topbar__button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--mt-topbar-ink);
  font-size: 18px;
}

.web-topbar__button:hover {
  background: var(--mt-accent-hover);
}

.web-topbar__badge {
  position: absolute;
  top: 9px;
  right: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--mt-surface);
  color: var(--mt-accent-text);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.web-me {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 50px;
  padding: 0 14px 0 10px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--mt-topbar-ink);
  font-size: 15px;
}

.web-me:hover {
  background: var(--mt-accent-hover);
}

.web-me .mt-avatar {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: var(--mt-surface);
  color: var(--mt-accent-text);
  font-size: 12px;
}

.web-me__name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Command bar */
.web-commandbar {
  display: flex;
  align-items: center;
  flex: 0 0 44px;
  height: 44px;
  padding: 0 8px;
  border-bottom: 1px solid var(--mt-rule);
  background: var(--mt-surface);
}

.web-commandbar__primary,
.web-commandbar__secondary {
  display: flex;
  align-items: center;
  gap: 1px;
  min-width: 0;
}

.web-commandbar__secondary {
  margin-left: auto;
}

.web-commandbar__divider {
  width: 1px;
  height: 22px;
  margin: 0 6px;
  background: var(--mt-border);
}

.web-cmd {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--mt-text);
  font-size: 13px;
  white-space: nowrap;
}

.web-cmd .icon {
  font-size: 15px;
  color: var(--mt-text-secondary);
}

.web-cmd:hover {
  background: var(--mt-bg);
}

.web-cmd:disabled {
  color: var(--mt-text-disabled);
  cursor: default;
}

.web-cmd:disabled .icon {
  color: var(--mt-text-disabled);
}

.web-cmd:disabled:hover {
  background: transparent;
}

.web-cmd--primary {
  height: 32px;
  padding: 0 10px;
  background: var(--mt-accent);
  color: var(--mt-on-accent);
  font-size: 13px;
}

.web-cmd--primary .icon {
  color: var(--mt-on-accent);
}

.web-cmd--primary:hover {
  background: var(--mt-accent-dark);
}

.web-cmd--primary .web-cmd__caret {
  margin-left: 2px;
  font-size: 10px;
  opacity: 0.85;
}

.web-cmd--icon {
  width: 32px;
  padding: 0;
  justify-content: center;
}

.web-cmd--quiet {
  color: var(--mt-text-secondary);
  font-size: 12px;
}

/* Main three-column layout */
.web-main {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

/* Folder pane */
.web-nav {
  display: flex;
  flex-direction: column;
  flex: 0 0 var(--nav-width, 220px);
  width: var(--nav-width, 220px);
  min-height: 0;
  border-right: 1px solid var(--mt-rule);
  background: var(--mt-hover);
}

.web-nav__scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px 0 12px;
  overflow: auto;
}

.web-nav__group {
  margin-top: 12px;
}

.web-nav__group:first-child {
  margin-top: 2px;
}

.web-nav__grouphead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 5px 18px;
  color: var(--mt-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.web-nav__grouphead button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mt-text-secondary);
  font-size: 11px;
}

.web-nav__grouphead button:hover {
  background: var(--mt-rule);
}

.web-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  padding: 4px 12px 4px 18px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--mt-text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.web-nav__item .icon {
  flex: 0 0 16px;
  width: 16px;
  color: var(--mt-text-secondary);
  font-size: 16px;
  text-align: center;
}

.web-nav__item:hover {
  background: var(--mt-bg);
}

/* Collapse arrow of a parent folder, in the row's left padding. */
.web-nav__item {
  position: relative;
}

.web-nav__caret {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  cursor: pointer;
}

.web-nav__item .web-nav__caret .icon {
  flex: 0 0 auto;
  width: auto;
  font-size: 10px;
}

/* Labels (IMAP keywords): a coloured chip on list rows and in the reading header. */
.web-label {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--label);
  color: #fff;
  font-family: var(--mt-font, inherit);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  vertical-align: middle;
}

.web-reading__labels .web-label {
  font-size: 12px;
  line-height: 18px;
}

.web-label-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.web-labels__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.web-labels__row .web-label {
  flex: 1 1 0;
  min-width: 0;
  max-width: max-content;
  margin: 0 auto 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-labels__row .mt-select {
  flex: 0 0 140px;
  width: 140px;
}

.web-row__flags .is-pinned {
  color: var(--mt-accent-text);
}

.web-nav__item.is-selected {
  border-left-color: var(--mt-accent);
  background: var(--mt-selected);
  color: var(--mt-accent-text);
  font-weight: 600;
}

.web-nav__item.is-selected .icon {
  color: var(--mt-accent-text);
}

.web-nav__name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-nav__count {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--mt-border-light);
  color: var(--mt-text-secondary);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.web-nav__item.is-selected .web-nav__count,
.web-nav__item.is-unread .web-nav__count {
  background: var(--mt-accent);
  color: var(--mt-on-accent);
}

.web-nav__footer {
  flex: 0 0 auto;
  padding: 6px 0 8px;
  border-top: 1px solid var(--mt-rule);
}

.web-nav__new {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 12px 7px 18px;
  border: 0;
  background: transparent;
  color: var(--mt-text-secondary);
  font-size: 13px;
  text-align: left;
}

.web-nav__new:hover {
  background: var(--mt-bg);
  color: var(--mt-text);
}

.web-nav__new .icon {
  font-size: 14px;
}

/* Message list */
.web-listpane {
  display: flex;
  flex-direction: column;
  flex: 0 1 var(--list-width, 40%);
  width: var(--list-width, 40%);
  min-width: 320px;
  max-width: max(560px, var(--list-width, 0px));
  min-height: 0;
  border-right: 1px solid var(--mt-rule);
  background: var(--mt-surface);
}

.web-listheader {
  display: flex;
  align-items: center;
  flex: 0 0 56px;
  height: 56px;
  padding: 0 10px 0 16px;
  border-bottom: 1px solid var(--mt-rule);
}

.web-listheader__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.web-listheader h1 {
  margin: 0;
  overflow: hidden;
  color: var(--mt-text);
  font-family: var(--mt-font-light);
  font-size: 21px;
  font-weight: 300;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-listheader__count {
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-listheader__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.web-unread-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--mt-border-strong);
  background: var(--mt-surface);
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-unread-toggle:hover {
  border-color: var(--mt-accent-hover);
  background: var(--mt-accent-pale);
  color: var(--mt-text);
}

.web-unread-toggle[aria-pressed="true"] {
  border-color: var(--mt-accent);
  background: var(--mt-accent);
  color: var(--mt-on-accent);
}

.web-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  outline: none;
}

/* Swipe on touch: the list's colour shows behind the moving row. */
.web-list.is-swipe-left {
  background: var(--mt-danger);
}

.web-list.is-swipe-right {
  background: #498205;
}

.web-row.is-swipe-far {
  opacity: 0.8;
}

.web-row.is-jumped {
  box-shadow: inset 3px 0 0 var(--mt-accent);
}

/* Drag handles between the panes (wide screens only). */
.web-splitter {
  position: relative;
  z-index: 2;
  flex: 0 0 6px;
  margin: 0 -3px;
  cursor: col-resize;
  touch-action: none;
}

.web-splitter:hover,
.web-splitter:focus-visible {
  outline: none;
  background: linear-gradient(var(--mt-accent), var(--mt-accent)) center / 2px 100% no-repeat;
}

.mt-toast__undo {
  margin-left: auto;
  font-weight: 600;
}

.web-row {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-height: 68px;
  padding: 11px 14px 10px 13px;
  border-bottom: 1px solid var(--mt-bg);
  background: var(--mt-surface);
  cursor: pointer;
  user-select: none;
  touch-action: pan-y;
}

.web-row:hover {
  background: var(--mt-hover);
}

.web-row.is-selected {
  background: var(--mt-accent-wash);
}

.web-row.is-selected:hover {
  background: var(--mt-accent-pale);
}

.web-row.is-unread::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--mt-accent);
}

.web-row__avatar {
  margin-top: 1px;
}

/* Bulk-select box, over the avatar: shown on hover and while any row is ticked. */
.web-row__check {
  position: absolute;
  top: 20px;
  left: 22px;
  width: 18px;
  height: 18px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.web-row:hover .web-row__check,
.web-row__check:focus-visible,
.has-checks .web-row__check {
  opacity: 1;
}

.web-row:hover .web-row__avatar,
.has-checks .web-row__avatar {
  visibility: hidden;
}

.web-row.is-checked {
  background: var(--mt-accent-wash);
}

/* Several messages ticked: bulk commands replace reply/forward. */
.web-cmd--bulk,
.web-commandbar.is-bulk .web-cmd--single {
  display: none;
}

.web-commandbar.is-bulk .web-cmd--bulk {
  display: inline-flex;
}

.web-commandbar__count {
  align-items: center;
  padding: 0 6px 0 10px;
  color: var(--mt-text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

/* A folder under dragged messages. */
.web-nav__item.is-drop {
  background: var(--mt-accent-wash);
  outline: 2px dashed var(--mt-accent);
  outline-offset: -2px;
}

/* The drag image: how many messages move. */
.web-drag-ghost {
  position: fixed;
  top: -100px;
  left: 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--mt-accent);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
}

.web-row__main {
  min-width: 0;
}

.web-row__line1 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.web-row__sender {
  overflow: hidden;
  color: var(--mt-text);
  font-size: 14px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-row.is-unread .web-row__sender {
  font-weight: 600;
}

.web-row__flags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  color: var(--mt-danger);
  font-size: 11px;
}

.web-row__flags .is-attachment {
  color: var(--mt-text-secondary);
}

/* The search matched inside a text attachment. */
.web-row__flags .is-attachment.is-match {
  color: var(--mt-accent);
}

.web-row__conversation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--mt-border-light);
  color: var(--mt-text-secondary);
  font-size: 10px;
  font-weight: 600;
}

.web-row__subject {
  overflow: hidden;
  margin-top: 2px;
  color: var(--mt-text);
  font-size: 14px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-row.is-unread .web-row__subject {
  font-weight: 600;
}

.web-row__preview {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 2px;
  color: var(--mt-text-secondary);
  font-size: 12.5px;
  line-height: 17px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Flags and date sit at the right end of the sender line. */
.web-row__side {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.web-row__date {
  color: var(--mt-text-secondary);
  font-size: 11.5px;
  white-space: nowrap;
}

.web-row.is-unread .web-row__date {
  color: var(--mt-accent-text);
  font-weight: 600;
}

.web-row__quick {
  display: inline-flex;
  gap: 3px;
  color: var(--mt-text-secondary);
  font-size: 13px;
}

.web-list__empty {
  flex: 1 1 auto;
}

.web-list.is-compact .web-row {
  min-height: 48px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.web-list.is-compact .web-row__preview {
  display: none;
}

.web-list.is-compact .web-row__avatar {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 11px;
}

/* Reading pane */
.web-readingpane {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--mt-surface);
}

.web-reading {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.web-reading__header {
  flex: 0 0 auto;
  padding: 14px 24px 12px;
  border-bottom: 1px solid var(--mt-rule);
}

.web-reading__subjectrow {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.web-reading__subject {
  flex: 1 1 auto;
  margin: 0;
  color: var(--mt-text);
  font-family: var(--mt-font-light);
  font-size: 21px;
  font-weight: 300;
  line-height: 28px;
}

.web-reading__subjectactions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: -4px;
}

.web-reading__close {
  display: none;
}

.web-reading__senderrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.web-reading__sender {
  min-width: 0;
  flex: 1 1 auto;
}

.web-reading__from {
  overflow: hidden;
  color: var(--mt-text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-reading__from span {
  color: var(--mt-text-secondary);
  font-size: 12px;
  font-weight: 400;
}

.web-reading__to {
  overflow: hidden;
  margin-top: 2px;
  color: var(--mt-text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-reading__date {
  flex: 0 0 auto;
  color: var(--mt-text-secondary);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.web-reading__toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 44px;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--mt-rule);
  background: var(--mt-surface);
}

.web-reading__content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 24px 40px;
  overflow: auto;
  color: var(--mt-text);
  font-size: 15px;
  line-height: 1.5;
}

.web-reading__content > :first-child {
  margin-top: 0;
}

.web-reading__content p {
  margin: 0 0 1em;
}

.web-reading__content .web-signature {
  margin-top: 1.6em;
  color: var(--mt-text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.web-reading__content ul,
.web-reading__content ol {
  margin: 0 0 1em;
  padding-left: 1.6em;
}

.web-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 24px 24px;
}

.web-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  max-width: 320px;
  padding: 9px 12px;
  border: 1px solid var(--mt-border);
  background: var(--mt-hover);
  color: var(--mt-text);
  text-align: left;
}

.web-attachment:hover {
  border-color: var(--mt-border-strong);
  background: var(--mt-bg);
}

.web-attachment > .icon {
  flex: 0 0 auto;
  font-size: 26px;
  color: var(--mt-accent-text);
}

.web-attachment > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.web-attachment__name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-attachment__size {
  margin-top: 2px;
  color: var(--mt-text-secondary);
  font-size: 11.5px;
}

.web-reading__empty {
  flex: 1 1 auto;
}

.web-dock-bottom .web-main {
  flex-direction: column;
}

.web-dock-bottom .web-nav {
  flex-basis: auto;
  width: 100%;
  height: 46px;
  border-right: 0;
  border-bottom: 1px solid var(--mt-rule);
}

.web-dock-bottom .web-nav__scroll,
.web-dock-bottom .web-nav__footer {
  display: none;
}

.web-dock-bottom .web-listpane {
  flex-basis: 45%;
  width: 100%;
  max-width: none;
  border-right: 0;
  border-bottom: 1px solid var(--mt-rule);
}

.web-pane-off .web-readingpane {
  display: none;
}

/* Settings window: centered over the mail, topics on the left, one topic shown at a time. */
.web-settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.45);
}

.web-settings {
  display: flex;
  flex-direction: column;
  width: min(860px, 100%);
  height: min(640px, 100%);
  overflow: hidden;
  border: 1px solid var(--mt-border);
  border-radius: 6px;
  background: var(--mt-surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.web-settings__head {
  justify-content: space-between;
}

.web-settings__main {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.web-settings__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 200px;
  padding: 10px 8px;
  overflow: auto;
  border-right: 1px solid var(--mt-rule);
  background: var(--mt-bg);
}

.web-settings__tab {
  padding: 8px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--mt-text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.web-settings__tab:hover {
  background: var(--mt-hover);
}

.web-settings__tab.is-active {
  background: var(--mt-selected);
  color: var(--mt-accent-text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--mt-accent);
}

.web-settings__tab:focus-visible {
  outline: 2px solid var(--mt-accent);
  outline-offset: -2px;
}

.web-settings__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 48px;
  height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid var(--mt-rule);
}

.web-settings__head h2 {
  margin: 0;
  font-family: var(--mt-font-light);
  font-size: 21px;
  font-weight: 300;
}

.web-settings__search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--mt-rule);
  color: var(--mt-text-secondary);
}

.web-settings__search .icon {
  font-size: 15px;
}

.web-settings__search .mt-input {
  min-height: 30px;
  border-color: var(--mt-border-strong);
  font-size: 13px;
}

.web-settings__body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 20px 30px;
  overflow: auto;
}

.web-settings__section {
  padding-top: 16px;
}

.web-settings__section h3 {
  margin: 0 0 8px;
  color: var(--mt-text);
  font-family: var(--mt-font-light);
  font-size: 17px;
  font-weight: 300;
}

.web-setting {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--mt-bg);
}

.web-setting > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.web-setting__label {
  color: var(--mt-text);
  font-size: 13px;
}

.web-setting__row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  font-size: 13px;
}

.web-setting__row > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.web-setting__hint {
  margin-top: 2px;
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-setting .mt-select {
  width: 140px;
  min-height: 28px;
  font-size: 12px;
}

/* Compose pane */
.web-compose {
  position: fixed;
  top: 94px;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(var(--compose-width, 760px), 100%);
  border-left: 1px solid var(--mt-border-strong);
  background: var(--mt-surface);
  box-shadow: -10px 0 28px rgba(0, 0, 0, 0.2);
}

/* Drag the left edge to resize; the width is kept per browser. */
.web-compose__resize {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3px;
  z-index: 2;
  width: 6px;
  cursor: col-resize;
  touch-action: none;
}

.web-compose__resize:hover,
.web-compose__resize:focus-visible {
  outline: none;
  background: linear-gradient(var(--mt-accent), var(--mt-accent)) center / 2px 100% no-repeat;
}

.web-compose__head {
  display: flex;
  align-items: center;
  flex: 0 0 44px;
  height: 44px;
  padding: 0 6px 0 16px;
  background: var(--mt-accent);
  color: var(--mt-on-accent);
}

.web-compose__head h2 {
  flex: 1 1 auto;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-compose__headactions {
  display: flex;
  gap: 2px;
}

.web-compose__headbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mt-on-accent);
  font-size: 12px;
}

.web-compose__headbtn:hover {
  background: var(--mt-accent-hover);
}

.web-compose__fields {
  flex: 0 0 auto;
  padding: 0 16px;
}

.web-compose__field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border-bottom: 1px solid var(--mt-rule);
}

.web-compose__label {
  flex: 0 0 46px;
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-compose__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--mt-text);
  font-size: 14px;
}

.web-compose__input--subject {
  font-size: 15px;
}

.web-compose__format {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 36px;
  height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--mt-rule);
}

.web-formatbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mt-text);
  font-size: 13px;
}

.web-formatbtn:hover {
  background: var(--mt-bg);
}

.web-compose__formatdivider {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--mt-border);
}

.web-compose__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 16px;
  overflow: auto;
  outline: 0;
  color: var(--mt-text);
  font-size: 14px;
  line-height: 1.5;
}

.web-compose__body:empty::before {
  content: "";
}

.web-compose__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 52px;
  padding: 8px 14px;
  border-top: 1px solid var(--mt-rule);
}

.web-send {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--mt-accent);
  background: var(--mt-accent);
  color: var(--mt-on-accent);
  font-size: 13px;
}

.web-send:hover {
  background: var(--mt-accent-dark);
  border-color: var(--mt-accent-dark);
}

.web-send .icon {
  font-size: 10px;
  opacity: 0.9;
}

.web-compose__footspacer {
  flex: 1 1 auto;
}

.web-compose__saved {
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-formatbtn--bold {
  font-weight: 700;
}

.web-formatbtn--italic {
  font-style: italic;
}

.web-formatbtn--underline {
  text-decoration: underline;
}

.web-compose__editor blockquote {
  margin: 0.5em 0;
  padding-left: 12px;
  border-left: 3px solid var(--mt-border-strong);
  color: var(--mt-text-secondary);
}

.web-compose__editor ul,
.web-compose__editor ol {
  padding-left: 1.6em;
}

.web-compose__editor img {
  max-width: 100%;
}

.web-compose .web-attachments {
  padding: 6px 16px;
}

.web-compose .web-attachments:empty {
  display: none;
}

.web-attachment__remove {
  flex: 0 0 auto;
  margin-left: auto;
}

/* Drop zone over the compose pane while files are dragged in */
.web-compose__drop {
  position: absolute;
  inset: 44px 8px 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--mt-accent);
  background: color-mix(in srgb, var(--mt-surface) 88%, transparent);
  color: var(--mt-accent-text);
  font-size: 15px;
  pointer-events: none;
}

/* Recipient suggestions (combobox listbox) */
.web-compose__field {
  position: relative;
}

.web-suggest {
  position: absolute;
  top: 100%;
  left: 54px;
  right: 0;
  z-index: 3;
  max-height: 260px;
  margin: 0;
  padding: 4px 0;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--mt-border-strong);
  background: var(--mt-surface);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.web-suggest__item {
  padding: 6px 12px;
  overflow: hidden;
  color: var(--mt-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.web-suggest__item[aria-selected="true"],
.web-suggest__item:hover {
  background: var(--mt-hover);
}

/* Settings: scheduled messages */
.web-scheduled {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.web-scheduled__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.web-scheduled__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Launcher */
.web-launcher {
  position: fixed;
  top: 50px;
  left: 4px;
  z-index: 95;
  width: 320px;
  padding: 18px;
  border: 1px solid var(--mt-border);
  background: var(--mt-surface);
  box-shadow: var(--mt-shadow-panel);
}

.web-launcher__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 8px;
}

.web-launcher__app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--mt-text);
  font-size: 12px;
  text-align: center;
  text-decoration: none;
}

.web-launcher__app:hover {
  color: var(--mt-accent-text);
  text-decoration: none;
}

.web-launcher__tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #fff;
  font-size: 22px;
}

.web-launcher__tile--mail { background: var(--mt-accent); }
.web-launcher__tile--calendar { background: #2560a8; }
.web-launcher__tile--people { background: #008272; }
.web-launcher__tile--tasks { background: #2564cf; }
.web-task--done strong { text-decoration: line-through; opacity: .6; }
.web-launcher__tile--tasks { background: #b4009e; }
.web-launcher__tile--admin { background: #6b5b95; }

/* Dialog tweaks */
.web .mt-dialog__title {
  font-size: 20px;
}

/* Responsive */
@media (max-width: 1180px) {
  .web-nav {
    flex-basis: var(--nav-width, 190px);
    width: var(--nav-width, 190px);
  }

  .web-listpane {
    flex-basis: var(--list-width, 44%);
    width: var(--list-width, 44%);
    min-width: 300px;
  }

  .web-me__name {
    display: none;
  }

  .web-brand__product {
    display: none;
  }
}

@media (max-width: 920px) {
  .web-search {
    width: 280px;
  }

  .web-nav {
    flex-basis: 56px;
    width: 56px;
  }

  .web-nav__grouphead,
  .web-nav__name,
  .web-nav__count,
  .web-nav__footer {
    display: none;
  }

  .web-nav__item {
    justify-content: center;
    padding: 8px 0;
    border-left-width: 0;
  }

  .web-nav__item .icon {
    flex-basis: auto;
  }

  .web-listpane {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
  }

  .web-splitter,
  .web-compose__resize {
    display: none;
  }

  .web-readingpane {
    position: fixed;
    top: 94px;
    right: 0;
    bottom: 0;
    left: 56px;
    z-index: 50;
    transform: translateX(100%);
    /* Closed: no shadow at the screen edge and nothing to tab into. */
    visibility: hidden;
    transition: transform 0.18s ease, visibility 0s linear 0.18s;
  }

  .web-readingpane.is-open {
    transform: none;
    visibility: visible;
    transition: transform 0.18s ease;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
  }

  .web-reading__close {
    display: inline-flex;
  }
}

@media (max-width: 700px) {
  .web-brand {
    padding-right: 10px;
  }

  .web-brand__name {
    font-size: 18px;
  }

  .web-search {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    margin-right: 4px;
  }

  .web-search input {
    min-width: 0;
    width: 100%;
  }

  .web-me .icon--ChevronDownSmall {
    display: none;
  }

  .web-topbar__button:nth-child(1),
  .web-topbar__button:nth-child(3) {
    display: none;
  }

  .web-me {
    padding: 0 8px;
  }

  .web-commandbar {
    overflow-x: auto;
    flex-basis: 52px;
    height: 52px;
  }

  /* Thumb-sized commands. */
  .web-cmd {
    flex-shrink: 0;
    min-width: 44px;
    height: 44px;
    justify-content: center;
  }

  .web-commandbar__primary {
    flex-shrink: 0;
  }

  /* Filter and Sort do nothing yet: room for the title and the quick filter. */
  .web-commandbar__secondary,
  .web-listheader [data-action="sort"] {
    display: none;
  }

  .web-listpane {
    min-width: 0;
  }

  .web-listheader {
    padding-left: 12px;
  }

  .web-cmd span:not(.icon) {
    display: none;
  }

  .web-cmd--primary span:not(.icon) {
    display: inline;
  }

  .web-readingpane {
    top: 102px;
    left: 0;
  }

  .web-reading__header,
  .web-reading__content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .web-compose {
    top: 50px;
    width: 100%;
  }

  .web-settings-backdrop {
    padding: 0;
  }

  .web-settings {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .web-settings__main {
    flex-direction: column;
  }

  .web-settings__nav {
    flex: 0 0 auto;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--mt-rule);
  }

  .web-settings__tab {
    white-space: nowrap;
  }

  .web-settings__tab.is-active {
    box-shadow: inset 0 -3px 0 var(--mt-accent);
  }
}

/* Webmail reading: plain text keeps its line breaks; HTML mail is shown in a
   sandboxed frame (no scripts, no remote content under the page CSP). */
.web-reading__text {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.web-reading__blocked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid var(--mt-border);
  background: var(--mt-accent-wash);
  color: var(--mt-text);
  font-size: 13px;
}

.web-trusted {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

/* The formatted mail fills the reading pane's height; it scrolls inside only when longer. */
.web-reading__content.has-frame {
  display: flex;
  flex-direction: column;
  padding-bottom: 12px;
}

.web-reading__frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 320px;
  border: 0;
  background: #fff;
}

.web-moveto {
  min-width: 160px;
}

.web-rules {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

/* One inbox rule: its conditions (all or any), then one action. */
.web-rule {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--mt-border);
  border-radius: 8px;
  background: var(--mt-bg);
}

.web-rule__head,
.web-rule__condition,
.web-rule__then {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.web-rule__when {
  min-width: 40px;
  color: var(--mt-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.web-rule__spacer {
  flex: 1 1 auto;
}

.web-rule__conditions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.web-rule__condition .mt-select {
  flex: 0 0 160px;
}

.web-rule__condition .mt-input {
  flex: 1 1 160px;
  min-width: 0;
}

.web-rule__then .mt-select,
.web-rule__then .mt-input {
  flex: 1 1 150px;
  min-width: 0;
}

.web-rule > .mt-btn--link {
  align-self: flex-start;
}

.web-rule__foot {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.web-rules__filter {
  width: 100%;
  margin-bottom: 6px;
}

/* One line per saved rule: on/off, summary (click to edit), order, remove. */
.web-rule-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid var(--mt-border);
  border-radius: 8px;
  background: var(--mt-bg);
}

.web-rule-row__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  padding: 4px 6px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.web-rule-row__text:hover {
  text-decoration: underline;
}

.web-rule-row.is-off .web-rule-row__text {
  color: var(--mt-text-secondary);
  text-decoration: line-through;
}

.web-canned {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 6px;
  align-items: start;
}

.web-sieve {
  width: 100%;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

/* Conversation size in the message list. */
.web-row__threadcount {
  display: inline-block;
  min-width: 18px;
  margin-right: 6px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--mt-border-light);
  color: var(--mt-text-secondary);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.web-nav__item.is-unsubscribed .web-nav__name {
  color: var(--mt-text-tertiary);
  font-style: italic;
}

.web-nav__more {
  margin: 4px 12px;
  font-size: 12px;
}

/* Calendar and People views. */
.web-view {
  flex: 1 1 auto;
  max-width: 900px;
  padding: 16px 24px 40px;
  overflow: auto;
}

.web-view__title {
  margin: 0 0 12px;
  font-family: var(--mt-font-light);
  font-size: 24px;
  font-weight: 300;
}

.web-event {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid var(--mt-rule);
}

.web-event__when,
.web-event__where {
  color: var(--mt-text-secondary);
}

.web-security { margin: 8px 0; padding: 8px 12px; background: var(--mt-bg); border-left: 3px solid var(--mt-accent); font-size: 13px; }
.web-invite { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.web-invite__info { flex: 1 1 100%; }
.web-invite__conflicts { flex: 1 1 100%; color: var(--mt-warning-text); }

.web-event__repeat-end {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 4px;
}

.web-event__repeat-end > .mt-input {
  flex: 1 1 140px;
  width: auto;
}

.web-event__edit {
  flex: 1 1 100%;
}

/* Account menu header (name and address above Settings / Sign out). */
.web-account__who {
  font-weight: 600;
  cursor: default;
}

.web-account__address {
  color: var(--mt-text-secondary);
  font-size: 12px;
  cursor: default;
  border-bottom: 1px solid var(--mt-border-light);
}

/* The shared sign-in screen in the webmail's Arctic Blue. */
.web .mt-login {
  --login-accent: #4b9ef0;
  --login-accent-ink: #06121f;
  --login-accent-text: #6cb0f5;
  --login-dot: rgba(75, 158, 240, 0.35);
  --login-soft: rgba(75, 158, 240, 0.14);
  --login-soft-hover: rgba(75, 158, 240, 0.24);
  --login-muted: #a2b2c4;
  --login-line: #263a52;
  --login-field: #142234;
  background: #0f1a28;
}

/* Settings controls: rounded fields, switches for on/off choices, a segmented theme picker. */
.web-settings .mt-input,
.web-settings .mt-select,
.web-settings .mt-textarea {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--mt-border);
  border-radius: 8px;
  background: var(--mt-surface);
  font-size: 13px;
}

.web-settings .mt-input:hover,
.web-settings .mt-select:hover,
.web-settings .mt-textarea:hover {
  border-color: var(--mt-border-strong);
}

.web-settings .mt-input:focus,
.web-settings .mt-select:focus,
.web-settings .mt-textarea:focus {
  border-color: var(--mt-accent);
  outline: 0;
  box-shadow: 0 0 0 3px var(--mt-accent-pale);
}

.web-settings .mt-btn:not(.mt-btn--link) {
  /* Long labels (German) wrap instead of running out of the panel. */
  height: auto;
  max-width: 100%;
  min-height: 32px;
  padding: 6px 14px;
  white-space: normal;
  border: 1px solid var(--mt-border);
  border-radius: 8px;
  background: transparent;
  color: var(--mt-accent-text);
  font-weight: 600;
}

.web-settings .mt-btn:not(.mt-btn--link):hover {
  border-color: var(--mt-accent);
  background: var(--mt-accent-wash);
}

.web-settings .mt-btn.mt-btn--primary {
  border-color: var(--mt-accent);
  background: var(--mt-accent);
  color: var(--mt-on-accent);
}

.web-settings .mt-btn.mt-btn--primary:hover {
  border-color: var(--mt-accent-dark);
  background: var(--mt-accent-dark);
}

.web-settings .mt-btn.mt-btn--danger {
  border-color: var(--mt-danger);
  background: var(--mt-danger);
  color: #fff;
}

.web-settings input[type="checkbox"] {
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 20px;
  margin: 0;
  border-radius: 10px;
  background: var(--mt-border-strong);
  cursor: pointer;
  transition: background 0.15s;
}

.web-settings input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--mt-surface);
  transition: transform 0.15s;
}

.web-settings input[type="checkbox"]:checked {
  background: var(--mt-accent);
}

.web-settings input[type="checkbox"]:checked::after {
  background: var(--mt-on-accent);
  transform: translateX(14px);
}

.web-settings input[type="checkbox"]:focus-visible,
.web-segmented__item:focus-visible {
  outline: 2px solid var(--mt-accent);
  outline-offset: 2px;
}

.web-segmented {
  display: flex;
  max-width: 320px;
  margin: 4px 0 8px;
  overflow: hidden;
  border: 1px solid var(--mt-border);
  border-radius: 8px;
}

.web-segmented__item {
  flex: 1;
  min-height: 32px;
  border: 0;
  border-left: 1px solid var(--mt-border);
  background: transparent;
  color: var(--mt-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.web-segmented__item:first-child {
  border-left: 0;
}

.web-segmented__item[aria-checked="true"] {
  background: var(--mt-accent);
  color: var(--mt-on-accent);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .web-settings input[type="checkbox"],
  .web-settings input[type="checkbox"]::after {
    transition: none;
  }
}

/* Animated sign-in backdrop: the scene replaces the dots; the box gets a frosted panel so text stays readable. */
.mt-login__scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.web .mt-login.has-scene::before {
  display: none;
}

.web .mt-login.has-scene .mt-login__box {
  padding: 28px 26px;
  border: 1px solid rgba(140, 180, 230, 0.22);
  border-radius: 12px;
  background: rgba(9, 18, 30, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* Calendar (design #16 "Compact Ops"): compact hours, thin-bar events, tinted
   today column, side panel with mini month and calendars (open by default). */
.web-view.web-cal {
  --cal-1: var(--mt-accent);
  --cal-2: #0f8a7e;
  --cal-3: #c2410c;
  --cal-4: #a21caf;
  --cal-5: #4d7c0f;
  --cal-6: #b45309;
  --cal-now: #d0342c;
  --cal-off: rgba(15, 40, 70, 0.035);
  --cal-radius: 3px;
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: none;
  padding: 0;
  overflow: hidden;
  background: var(--mt-surface);
}

body.web.is-dark .web-view.web-cal {
  --cal-2: #2bc4a8;
  --cal-3: #f0864b;
  --cal-4: #d77ae8;
  --cal-5: #93c95a;
  --cal-6: #f0b44b;
  --cal-now: #ff6b5e;
  --cal-off: rgba(0, 0, 0, 0.18);
}

.web-cal__cmd {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--mt-border);
  background: var(--mt-surface);
}

.web-cal__title {
  margin: 0 8px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.web-cal__spacer {
  flex: 1 1 auto;
}

.web-cal__search {
  width: 200px;
  min-height: 30px;
}

.web-cal__views {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--mt-border);
  border-radius: var(--cal-radius);
}

.web-cal__views button {
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-left: 1px solid var(--mt-border);
  background: var(--mt-surface);
  color: var(--mt-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.web-cal__views button:first-child {
  border-left: 0;
}

.web-cal__views button:hover {
  background: var(--mt-hover);
}

.web-cal__views button[aria-pressed="true"] {
  background: var(--mt-selected);
  color: var(--mt-accent-text);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--mt-accent);
}

.web-cal__main {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.web-cal__side {
  display: flex;
  flex: 0 0 232px;
  flex-direction: column;
  gap: 14px;
  padding: 12px;
  overflow: auto;
  border-right: 1px solid var(--mt-border);
  background: var(--mt-bg);
}

.web-cal.is-side-closed .web-cal__side {
  display: none;
}

.web-cal__mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-weight: 600;
}

.web-cal__mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  font-size: 11.5px;
  text-align: center;
}

.web-cal__mini-grid.has-weeks {
  grid-template-columns: 22px repeat(7, 1fr);
}

.web-cal__mini-dh,
.web-cal__mini-wn {
  align-self: center;
  padding: 3px 0;
  color: var(--mt-text-secondary);
  font-size: 10.5px;
}

.web-cal__mini-grid button {
  position: relative;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mt-text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.web-cal__mini-grid button:hover {
  background: var(--mt-hover);
}

.web-cal__mini-grid button.is-out {
  color: var(--mt-text-disabled);
}

.web-cal__mini-grid button.is-range {
  border-radius: var(--cal-radius);
  background: var(--mt-selected);
}

.web-cal__mini-grid button.is-today {
  border-radius: 50%;
  background: var(--mt-accent);
  color: var(--mt-on-accent);
  font-weight: 700;
}

.web-cal__mini-grid button.has-events::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.web-cal__cals h2 {
  margin: 0 0 6px;
  color: var(--mt-text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.web-cal__cal {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: var(--cal-radius);
  cursor: pointer;
}

.web-cal__cal:hover {
  background: var(--mt-hover);
}

.web-cal__cal input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 2px solid var(--c);
  border-radius: 4px;
  appearance: none;
  cursor: pointer;
}

.web-cal__cal input:checked {
  background: var(--c);
  box-shadow: inset 0 0 0 2px var(--mt-bg);
}

.web-cal__calname {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-cal__calname small {
  color: var(--mt-text-secondary);
}

.web-cal__view {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* Day / week grid */
.web-cal__grid {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.web-cal__head,
.web-cal__allday,
.web-cal__body {
  display: grid;
  grid-template-columns: 56px repeat(var(--n), minmax(0, 1fr));
}

.web-cal__head,
.web-cal__allday {
  flex: 0 0 auto;
  padding-right: var(--sbw, 0px);
  border-bottom: 1px solid var(--mt-border);
}

.web-cal__gut {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 4px;
  color: var(--mt-text-secondary);
  font-size: 10.5px;
}

.web-cal__day {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border: 0;
  border-left: 1px solid var(--mt-border);
  background: transparent;
  color: var(--mt-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.web-cal__day:hover .web-cal__dn {
  text-decoration: underline;
}

.web-cal__wd {
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-cal__dn {
  font-size: 19px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
}

.web-cal__day.is-today,
.web-cal__col.is-today {
  background-color: var(--mt-accent-wash);
}

.web-cal__day.is-today .web-cal__dn {
  color: var(--mt-accent-text);
  font-weight: 600;
}

.web-cal__allcell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  min-height: 26px;
  padding: 2px;
  border-left: 1px solid var(--mt-border);
  cursor: pointer;
}

.web-cal__scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.web-cal__body {
  position: relative;
}

.web-cal__hours {
  position: relative;
}

.web-cal__hours span {
  position: absolute;
  right: 8px;
  color: var(--mt-text-secondary);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  transform: translateY(-50%);
}

.web-cal__col {
  position: relative;
  border-left: 1px solid var(--mt-border);
  background-image: linear-gradient(var(--mt-border) 1px, transparent 1px), linear-gradient(var(--mt-rule) 1px, transparent 1px);
  background-size: 100% var(--hh), 100% calc(var(--hh) / 2);
  touch-action: none;
}

.web-cal__off {
  position: absolute;
  left: 0;
  right: 0;
  background: var(--cal-off);
  pointer-events: none;
}

.web-cal__now {
  position: absolute;
  left: -1px;
  right: 0;
  z-index: 4;
  height: 2px;
  background: var(--cal-now);
  pointer-events: none;
}

.web-cal__now::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cal-now);
}

.web-cal__sel {
  position: absolute;
  left: 2px;
  right: 2px;
  z-index: 3;
  padding: 2px 6px;
  border: 1px solid var(--mt-accent);
  border-radius: var(--cal-radius);
  background: var(--mt-accent-wash);
  color: var(--mt-accent-text);
  font-size: 11px;
  pointer-events: none;
}

.web-cal__ev {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 2px 6px;
  overflow: hidden;
  border-left: 4px solid var(--c);
  border-radius: 2px;
  background: color-mix(in srgb, var(--c) 9%, var(--mt-surface));
  color: var(--mt-text);
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.web-cal__ev:hover {
  background: color-mix(in srgb, var(--c) 16%, var(--mt-surface));
}

.web-cal__ev b {
  overflow: hidden;
  color: color-mix(in srgb, var(--c) 75%, var(--mt-text));
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-cal__when {
  overflow: hidden;
  font-size: 11px;
  opacity: 0.85;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-cal__ev.is-short {
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}

.web-cal__ev.is-short .web-cal__when {
  display: none;
}

.web-cal__ev.is-short b {
  font-size: 11px;
  line-height: 1.1;
}

.web-cal__ev.is-dragging {
  z-index: 6;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  opacity: 0.92;
}

.web-cal__resize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  cursor: ns-resize;
}

.web-cal__flags {
  position: absolute;
  top: 2px;
  right: 3px;
  display: flex;
  gap: 2px;
  font-size: 10px;
  opacity: 0.7;
}

.web-cal__chip {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 1px 6px;
  overflow: hidden;
  border-radius: 2px;
  color: var(--mt-text);
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.web-cal__chip:hover {
  background: var(--mt-hover);
}

.web-cal__chip::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
}

.web-cal__chip.is-all {
  border-left: 4px solid var(--c);
  background: color-mix(in srgb, var(--c) 9%, var(--mt-surface));
}

.web-cal__chip.is-all::before {
  display: none;
}

.web-cal__chip b {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
}

.web-cal__chip.is-dragging {
  opacity: 0.5;
}

.web-cal__tm {
  color: var(--mt-text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Month */
.web-cal__month {
  display: grid;
  flex: 1 1 auto;
  grid-template-rows: auto repeat(6, minmax(0, 1fr));
  min-height: 0;
}

.web-cal__mhead,
.web-cal__mrow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--mt-border);
}

.web-cal__month.has-weeks .web-cal__mhead,
.web-cal__month.has-weeks .web-cal__mrow {
  grid-template-columns: 30px repeat(7, minmax(0, 1fr));
}

.web-cal__mhead span {
  padding: 6px 8px;
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-cal__mwn {
  padding: 6px 4px;
  border-right: 1px solid var(--mt-border);
  color: var(--mt-text-secondary);
  font-size: 10.5px;
  text-align: center;
}

.web-cal__mcell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  min-height: 0;
  padding: 3px;
  overflow: hidden;
  border-left: 1px solid var(--mt-border);
  cursor: pointer;
}

.web-cal__mcell.is-out {
  background: var(--mt-bg);
}

.web-cal__mcell.is-today {
  background: var(--mt-accent-wash);
}

.web-cal__mcell.is-drop {
  background: var(--mt-selected);
}

.web-cal__mdn {
  align-self: flex-start;
  padding: 1px 4px;
  border: 0;
  border-radius: var(--cal-radius);
  background: transparent;
  color: var(--mt-text);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.web-cal__mdn:hover {
  background: var(--mt-hover);
}

.web-cal__mcell.is-out .web-cal__mdn {
  color: var(--mt-text-secondary);
}

.web-cal__mcell.is-today .web-cal__mdn {
  color: var(--mt-accent-text);
  font-weight: 700;
}

.web-cal__more {
  padding: 1px 6px;
  border: 0;
  background: transparent;
  color: var(--mt-accent-text);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

/* Agenda */
.web-cal__agenda {
  flex: 1 1 auto;
  padding: 8px 16px 24px;
  overflow: auto;
}

.web-cal__aday {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--mt-rule);
}

.web-cal__adate b {
  display: block;
  font-size: 22px;
  font-weight: 300;
}

.web-cal__adate span {
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-cal__aday.is-today .web-cal__adate b {
  color: var(--mt-accent-text);
  font-weight: 600;
}

.web-cal__alist {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.web-cal__aev {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-left: 4px solid var(--c);
  border-radius: 2px;
  background: color-mix(in srgb, var(--c) 6%, var(--mt-surface));
  cursor: pointer;
}

.web-cal__aev:hover {
  background: color-mix(in srgb, var(--c) 14%, var(--mt-surface));
}

.web-cal__aev b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-cal__aev small {
  color: var(--mt-text-secondary);
}

.web-cal__empty {
  padding: 30px;
  color: var(--mt-text-secondary);
  text-align: center;
}

/* Popovers and the editor */
.web-cal__pop {
  position: absolute;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 330px;
  max-width: calc(100% - 16px);
  padding: 14px;
  border: 1px solid var(--mt-border);
  border-radius: 6px;
  background: var(--mt-surface);
  color: var(--mt-text);
  box-shadow: var(--mt-shadow-panel);
}

.web-cal__pophead {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.web-cal__pophead h3 {
  flex: 1 1 auto;
  margin: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.web-cal__menu h3 {
  margin: 0;
  font-size: 15px;
}

.web-cal__swatch {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 3px;
  background: var(--c);
}

.web-cal__poprow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.web-cal__poprow > .icon {
  margin-top: 2px;
  color: var(--mt-text-secondary);
}

.web-cal__poprow > span {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.web-cal__poprow small {
  display: block;
  color: var(--mt-text-secondary);
}

.web-cal__popacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.web-cal__titlefield {
  border: 0;
  border-bottom: 2px solid var(--mt-accent);
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
}

.web-cal__form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.web-cal__pair {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.web-cal__problem {
  margin: 0;
  color: var(--mt-danger);
}

.web-cal__problem:empty {
  display: none;
}

.web-cal__shares {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.web-cal__share {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--mt-border);
  border-radius: var(--cal-radius);
}

.web-cal__share span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.web-cal__share small {
  color: var(--mt-text-secondary);
}

.web-cal__undo {
  pointer-events: auto;
}

@media (max-width: 760px) {
  .web-cal__side {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 25;
    display: none;
    box-shadow: var(--mt-shadow-panel);
  }

  .web-cal.is-side-open .web-cal__side {
    display: flex;
  }

  .web-cal__search {
    width: 100%;
    order: 10;
  }

  .web-cal__head,
  .web-cal__allday,
  .web-cal__body {
    grid-template-columns: 44px repeat(var(--n), minmax(0, 1fr));
  }

  .web-cal__day {
    flex-direction: column;
    gap: 0;
    padding: 4px;
  }

  .web-cal__aday,
  .web-cal__aev {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Contacts (design #78): groups as tabs above the list, details beside it,
   square avatars, rounded section cards on a soft canvas. */
.web-view.web-ct {
  --ct-radius: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: none;
  padding: 0;
  overflow: hidden;
  background: var(--mt-bg);
}

.web-ct__bar,
.web-ct__bulk {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--mt-border);
  background: var(--mt-surface);
}

.web-ct__bulk {
  background: var(--mt-accent-wash);
}

.web-ct__bulk[hidden] {
  display: none;
}

.web-ct__bulk .mt-input {
  width: auto;
  min-height: 30px;
}

.web-ct__search {
  width: min(320px, 40vw);
  min-height: 32px;
}

.web-ct__sort {
  width: auto;
  min-height: 32px;
}

.web-ct__spacer {
  flex: 1 1 auto;
}

.web-ct__tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 0 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--mt-border);
  background: var(--mt-surface);
}

.web-ct__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 10px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--mt-text-secondary);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.web-ct__tab small {
  font-size: 11px;
  opacity: 0.8;
}

.web-ct__tab:hover {
  color: var(--mt-text);
}

.web-ct__tab[aria-selected="true"] {
  border-color: var(--mt-accent);
  color: var(--mt-accent-text);
  font-weight: 600;
}

.web-ct__tab.is-drop {
  border-radius: 6px 6px 0 0;
  background: var(--mt-accent-wash);
  outline: 2px dashed var(--mt-accent);
}

.web-ct__main {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.web-ct__listpane {
  position: relative;
  display: flex;
  flex: 0 0 340px;
  flex-direction: column;
  min-height: 0;
  padding-right: 20px;
  border-right: 1px solid var(--mt-border);
  background: var(--mt-surface);
}

.web-ct__listhead {
  padding: 6px 12px;
  border-bottom: 1px solid var(--mt-border);
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-ct__checkall {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.web-ct__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.web-ct__letter {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 4px 14px;
  border-bottom: 1px solid var(--mt-rule);
  background: var(--mt-bg);
  color: var(--mt-accent-text);
  font-size: 12px;
  font-weight: 700;
}

.web-ct__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--mt-rule);
  cursor: pointer;
}

.web-ct__row:hover {
  background: var(--mt-hover);
}

.web-ct__row[aria-selected="true"] {
  background: var(--mt-selected);
  box-shadow: inset 3px 0 0 var(--mt-accent);
}

.web-ct__row input,
.web-ct__checkall input,
.web-ct__checks input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: var(--mt-accent);
}

.web-ct__who {
  flex: 1 1 auto;
  min-width: 0;
}

.web-ct__who b,
.web-ct__who small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-ct__who b {
  font-weight: 600;
}

.web-ct__who small {
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-ct__av {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--avc);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.web-ct__av--lg {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  font-size: 26px;
}

.web-ct__star {
  display: grid;
  place-items: center;
  padding: 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--mt-text-secondary);
  cursor: pointer;
}

.web-ct__star.is-on {
  color: #e3a008;
}

.web-ct__rail {
  position: absolute;
  top: 36px;
  right: 1px;
  bottom: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 18px;
}

.web-ct__rail button {
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: var(--mt-accent-text);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.web-ct__rail button:disabled {
  color: var(--mt-text-disabled);
  cursor: default;
}

.web-ct__detail {
  flex: 1 1 auto;
  min-width: 0;
  overflow: auto;
  background: var(--mt-bg);
}

.web-ct__dhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--mt-border);
  background: var(--mt-surface);
}

.web-ct__dtitle {
  flex: 1 1 260px;
  min-width: 0;
}

.web-ct__dtitle h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.web-ct__dtitle p {
  margin: 2px 0 0;
  color: var(--mt-text-secondary);
}

.web-ct__dacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.web-ct__dacts a.mt-btn {
  text-decoration: none;
}

.web-ct__back {
  display: none;
}

.web-ct__dbody {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 18px 26px 30px;
}

.web-ct__section {
  padding: 12px 14px;
  border: 1px solid var(--mt-border);
  border-radius: var(--ct-radius);
  background: var(--mt-surface);
}

.web-ct__section--wide {
  grid-column: 1 / -1;
}

.web-ct__section h3 {
  margin: 0 0 8px;
  color: var(--mt-text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.web-ct__kv {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
}

.web-ct__kv dt {
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-ct__kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.web-ct__kv a {
  color: var(--mt-text);
  text-decoration: none;
}

.web-ct__kv a:hover {
  color: var(--mt-accent-text);
  text-decoration: underline;
}

.web-ct__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.web-ct__tag {
  padding: 2px 9px;
  border: 1px solid var(--mt-accent-pale);
  border-radius: 999px;
  background: var(--mt-accent-wash);
  color: var(--mt-accent-text);
  font-size: 12px;
}

.web-ct__note {
  margin: 0;
  white-space: pre-wrap;
}

.web-ct__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--mt-text-secondary);
  text-align: center;
}

.web-ct__empty > .icon {
  font-size: 36px;
  opacity: 0.5;
}

.web-ct__editor {
  width: min(680px, 100%);
}

.web-ct__form {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.web-ct__multi {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.web-ct__multirow {
  display: flex;
  gap: 6px;
}

.web-ct__multirow select {
  flex: 0 0 110px;
  width: 110px;
}

.web-ct__multi .mt-btn--link {
  align-self: flex-start;
}

.web-ct__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.web-ct__checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

@media (max-width: 820px) {
  .web-ct__listpane {
    flex: 1 1 auto;
    border-right: 0;
  }

  .web-ct.has-selection .web-ct__listpane,
  .web-ct:not(.has-selection) .web-ct__detail {
    display: none;
  }

  .web-ct__back {
    display: inline-flex;
  }

  .web-ct__search {
    order: 10;
    width: 100%;
  }
}

/* To Do (design #7 "Board"): lists on the left, columns by due date,
   soft task cards, round checkboxes, details slide in from the right. */
.web-view.web-td {
  --td-radius: 8px;
  position: relative;
  display: flex;
  max-width: none;
  padding: 0;
  overflow: hidden;
  background: var(--mt-bg);
}

.web-td__side {
  display: flex;
  flex: 0 0 230px;
  flex-direction: column;
  gap: 1px;
  padding: 10px 8px;
  overflow: auto;
  border-right: 1px solid var(--mt-border);
  background: var(--mt-surface);
}

.web-td__side h4 {
  margin: 12px 8px 4px;
  color: var(--mt-text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.web-td__list {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: var(--td-radius);
  background: transparent;
  color: var(--mt-text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.web-td__list:hover {
  background: var(--mt-hover);
}

.web-td__list[aria-pressed="true"] {
  background: var(--mt-selected);
  color: var(--mt-accent-text);
  font-weight: 600;
}

.web-td__list span {
  flex: 1 1 auto;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-td__list small {
  color: var(--mt-text-secondary);
  font-variant-numeric: tabular-nums;
}

.web-td__list.is-drop {
  background: var(--mt-accent-wash);
  outline: 2px dashed var(--mt-accent);
}

.web-td__newlist {
  color: var(--mt-accent-text);
}

.web-td__dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin: 0 3px;
  border-radius: 3px;
  background: var(--c);
}

.web-td__center {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.web-td__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 22px 8px;
}

.web-td__titlebox {
  min-width: 0;
}

.web-td__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--mt-accent-text);
  font-size: 24px;
  font-weight: 700;
}

.web-td__sub {
  margin: 2px 0 0;
  color: var(--mt-text-secondary);
  font-size: 12.5px;
}

.web-td__spacer {
  flex: 1 1 auto;
}

.web-td__search {
  width: 220px;
  min-height: 32px;
}

.web-td__sort {
  width: auto;
  min-height: 32px;
}

.web-td__add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 22px 10px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--mt-border);
  border-radius: var(--td-radius);
  background: var(--mt-surface);
  color: var(--mt-accent-text);
  box-shadow: 0 1px 2px rgba(16, 34, 60, 0.08);
}

.web-td__add[hidden] {
  display: none;
}

.web-td__add:focus-within {
  border-color: var(--mt-accent);
}

.web-td__add input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 32px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--mt-text);
  font: inherit;
}

.web-td__add input[type="date"] {
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--mt-border);
  border-radius: 6px;
  background: var(--mt-surface);
  color: var(--mt-text);
  font: inherit;
  font-size: 12px;
}

.web-td__chip {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--mt-text-secondary);
  cursor: pointer;
}

.web-td__chip.is-on {
  border-color: var(--mt-accent);
  background: var(--mt-accent-wash);
  color: var(--mt-accent-text);
}

.web-td__scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 22px 22px;
  overflow: auto;
}

.web-td__board {
  display: grid;
  grid-auto-columns: minmax(240px, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  align-items: start;
}

.web-td__col {
  min-height: 120px;
  padding: 8px;
  border: 1px solid var(--mt-rule);
  border-radius: calc(var(--td-radius) + 2px);
  background: var(--mt-selected);
}

.web-td__col h3 {
  display: flex;
  justify-content: space-between;
  margin: 2px 4px 8px;
  font-size: 13px;
}

.web-td__col h3 small {
  color: var(--mt-text-secondary);
  font-weight: 400;
}

.web-td__col.is-over h3 {
  color: var(--mt-danger);
}

.web-td__col.is-drop {
  outline: 2px dashed var(--mt-accent);
}

.web-td__plain {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 760px;
}

.web-td__card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  padding: 10px 12px;
  border-radius: var(--td-radius);
  background: var(--mt-surface);
  box-shadow: 0 1px 2px rgba(16, 34, 60, 0.1);
  cursor: pointer;
}

.web-td__card:hover {
  background: var(--mt-hover);
}

.web-td__card[aria-selected="true"] {
  box-shadow: 0 0 0 2px var(--mt-accent);
}

.web-td__card.is-dragging {
  opacity: 0.45;
}

.web-td__card.is-before {
  box-shadow: 0 -3px 0 var(--mt-accent);
}

.web-td__card.is-done .web-td__name {
  color: var(--mt-text-secondary);
  text-decoration: line-through;
}

.web-td__check {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 2px solid var(--mt-text-secondary);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  font-size: 11px;
  cursor: pointer;
}

.web-td__check:hover {
  border-color: var(--mt-accent);
  color: var(--mt-accent-text);
}

.web-td__check--sm {
  width: 16px;
  height: 16px;
  font-size: 9px;
}

.is-done > .web-td__check,
.web-td__dtitle.is-done > .web-td__check,
.web-td__step.is-done > .web-td__check {
  border-color: var(--mt-accent);
  background: var(--mt-accent);
  color: var(--mt-on-accent);
}

.web-td__body {
  flex: 1 1 auto;
  min-width: 0;
}

.web-td__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-td__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 2px;
  color: var(--mt-text-secondary);
  font-size: 11.5px;
}

.web-td__meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.web-td__meta .icon {
  font-size: 11px;
}

.web-td__meta .is-over {
  color: var(--mt-danger);
  font-weight: 600;
}

.web-td__meta .is-today {
  color: var(--mt-accent-text);
  font-weight: 600;
}

.web-td__listname {
  color: var(--c);
}

.web-td__star {
  display: grid;
  place-items: center;
  padding: 3px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--mt-text-secondary);
  cursor: pointer;
}

.web-td__star.is-on {
  color: var(--mt-accent-text);
}

.web-td__donetoggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mt-text-secondary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.web-td__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 20px;
  color: var(--mt-text-secondary);
  text-align: center;
}

.web-td__empty > .icon {
  font-size: 40px;
  opacity: 0.45;
}

.web-td__empty p {
  margin: 0;
}

.web-td__detail {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: min(360px, 100%);
  border-left: 1px solid var(--mt-border);
  background: var(--mt-surface);
  box-shadow: -14px 0 36px rgba(0, 0, 0, 0.22);
}

.web-td__detail[hidden] {
  display: none;
}

.web-td__dscroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px;
  overflow: auto;
}

.web-td__dbox {
  border: 1px solid var(--mt-border);
  border-radius: var(--td-radius);
  background: var(--mt-bg);
}

.web-td__dtitle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
}

.web-td__dtitle textarea {
  flex: 1 1 auto;
  min-height: 24px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--mt-text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  resize: none;
  field-sizing: content;
}

.web-td__dtitle.is-done textarea {
  text-decoration: line-through;
}

.web-td__step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-top: 1px solid var(--mt-rule);
}

.web-td__step span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.web-td__step.is-done span {
  color: var(--mt-text-secondary);
  text-decoration: line-through;
}

.web-td__stepx {
  opacity: 0;
}

.web-td__step:hover .web-td__stepx,
.web-td__stepx:focus-visible {
  opacity: 1;
}

.web-td__addstep {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--mt-rule);
  color: var(--mt-accent-text);
}

.web-td__addstep input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--mt-text);
  font: inherit;
}

.web-td__drow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--mt-rule);
  background: transparent;
  color: var(--mt-text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.web-td__dbox > .web-td__drow:first-child {
  border-top: 0;
}

.web-td__drow:hover {
  background: var(--mt-hover);
}

.web-td__drow.is-on {
  color: var(--mt-accent-text);
}

.web-td__drow input,
.web-td__drow select {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.web-td__notes {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--mt-text);
  font: inherit;
  resize: vertical;
}

.web-td__dfoot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--mt-border);
  color: var(--mt-text-secondary);
  font-size: 12px;
}

.web-td__listsel {
  display: none;
  width: auto;
  min-height: 32px;
}

@media (max-width: 860px) {
  .web-td__side {
    display: none;
  }

  .web-td__listsel {
    display: block;
  }

  .web-td__board {
    grid-auto-columns: auto;
    grid-auto-flow: row;
  }

  .web-td__search {
    order: 10;
    width: 100%;
  }
}

/* Sender check badge and lookalike warning */
.web-auth {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 11px;
  line-height: 16px;
  vertical-align: middle;
}

.web-auth--ok {
  color: #2e7d32;
}

.web-auth--bad {
  color: var(--mt-danger);
}

.web-auth--unknown {
  color: var(--mt-text-secondary);
}

.web-security--warning {
  border-left-color: var(--mt-warning-border);
  background: var(--mt-warning-bg);
  color: var(--mt-warning-text);
}

/* Attachment preview and message source */
.web-viewer {
  width: min(960px, 100%);
}

.web-viewer__body {
  display: flex;
  justify-content: center;
}

.web-viewer__content {
  max-width: 100%;
  max-height: calc(100vh - 160px);
}

iframe.web-viewer__content {
  width: 100%;
  height: calc(100vh - 160px);
  border: 0;
}

.web-viewer__source {
  width: 100%;
  max-height: calc(100vh - 160px);
  margin: 0;
  overflow: auto;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Print only the open message */
.web-reading__text.web-print-only {
  display: none;
}

@media print {
  .web-reading__text.web-print-only {
    display: block;
  }

  .web-print-hide,
  .web-topbar,
  .web-commandbar,
  .web-nav,
  .web-listpane,
  .web-reading__close,
  .web-reading__subjectactions,
  .web-reading__blocked,
  .web-reading__content > .mt-btn,
  .web-compose,
  .web-launcher,
  #web-dialog-host,
  .mt-toast-host,
  .mt-visually-hidden {
    display: none !important;
  }

  html,
  body,
  .web-app,
  .web-main,
  .web-readingpane,
  .web-reading,
  .web-reading__content {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    position: static !important;
  }
}

/* Device setup QR codes: black on white so they scan in the dark theme too. */
.web-qr {
  display: block;
  margin: 8px 0;
  background: #fff;
  border-radius: 4px;
}
