:root {
  --tc-icon-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3l14 9-6 1.5L10 19z' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-group: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 5h14v10H9l-4 4z M8 9h8m-8 3h5' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-sliders: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h6m4 0h6M4 12h10m4 0h2M4 18h3m4 0h9M10 4v4m4 2v4m-7 2v4' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-refresh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 10a8 8 0 0 0-13.7-4.7L4 8m0-4v4h4m-4 6a8 8 0 0 0 13.7 4.7L20 16m0 4v-4h-4' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-reply: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m10 5-6 6 6 6M4 11h9a6 6 0 0 1 6 6v2' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-reply-all: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m8 5-6 6 6 6m5-12-6 6 6 6m-6-6h9a5 5 0 0 1 5 5v3' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-forward: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m14 5 6 6-6 6m6-6h-9a6 6 0 0 0-6 6v2' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-trash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h18M6 6l1 14h10l1-14M9 6V3h6v3m-5 4v6m4-6v6' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-tag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h8l8 8-8 8-8-8z M8 8h.01' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-more: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h.01M12 12h.01M19 12h.01' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16.5 16.5 21 21m-3-10.5a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0z' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-unread: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 4H4a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-7M3 7l9 6 4-3m5-5a2 2 0 1 1-4 0 2 2 0 0 1 4 0z' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m15 6-6 6 6 6' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 6 6 6-6 6' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-first: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 6v12m13-12-6 6 6 6' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-last: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 6v12M6 6l6 6-6 6' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 6 12 12M18 6 6 18' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 11v5m0-8h.01m9 4a9 9 0 1 1-18 0 9 9 0 0 1 18 0z' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m8 12 3 3 5-6m5 3a9 9 0 1 1-18 0 9 9 0 0 1 18 0z' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-warn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 4a1 1 0 0 1 2 0l8 14a1 1 0 0 1-1 2H4a1 1 0 0 1-1-2zm1 5v4m0 3h.01' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-error: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 7v6m0 4h.01m9-5a9 9 0 1 1-18 0 9 9 0 0 1 18 0z' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --tc-icon-progress: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 12a9 9 0 1 1-9-9' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

html:root body #layout :is(.header, .toolbar, .pagenav, .searchbar) a:is(
    .select, .threads, .options, .refresh, .reply, .reply-all, .forward, .delete, .markmessage, .more,
    .dropdown, .unread, .reset, .firstpage, .prevpage, .nextpage, .lastpage
  )::before,
html:root body #layout .searchbar form::before,
html:root body #messagestack > .ui.alert > i.icon::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  margin: 0;
  vertical-align: middle;
  background: currentColor;
  mask: var(--tc-control-icon, var(--tc-icon-more)) center / contain no-repeat;
}

#layout .toolbar a.select { --tc-control-icon: var(--tc-icon-cursor); }
#layout .toolbar a.threads { --tc-control-icon: var(--tc-icon-group); }
#layout :is(.header, .toolbar) a.options { --tc-control-icon: var(--tc-icon-sliders); }
#layout .header a.refresh { --tc-control-icon: var(--tc-icon-refresh); }
#layout .toolbar a.reply { --tc-control-icon: var(--tc-icon-reply); }
#layout .toolbar a.reply-all { --tc-control-icon: var(--tc-icon-reply-all); }
#layout .toolbar a.forward { --tc-control-icon: var(--tc-icon-forward); }
#layout .toolbar a.delete { --tc-control-icon: var(--tc-icon-trash); }
#layout .toolbar a.markmessage { --tc-control-icon: var(--tc-icon-tag); }
#layout .toolbar a.more { --tc-control-icon: var(--tc-icon-more); }
#layout a.dropdown,
#layout .searchbar a.options { --tc-control-icon: var(--tc-icon-down); }
#layout .searchbar form { --tc-control-icon: var(--tc-icon-search); }
#layout .searchbar a.unread { --tc-control-icon: var(--tc-icon-unread); }
#layout .searchbar a.reset { --tc-control-icon: var(--tc-icon-close); }
#layout .pagenav a.firstpage { --tc-control-icon: var(--tc-icon-first); }
#layout .pagenav a.prevpage { --tc-control-icon: var(--tc-icon-left); }
#layout .pagenav a.nextpage { --tc-control-icon: var(--tc-icon-right); }
#layout .pagenav a.lastpage { --tc-control-icon: var(--tc-icon-last); }

html:root body #layout .searchbar form::before {
  align-self: center;
  flex: 0 0 18px;
  margin-inline-start: 12px;
  color: var(--tc-muted);
}

html:root body #layout .searchbar {
  gap: 2px;
  padding-inline-end: 5px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

html:root body #layout .searchbar:focus-within {
  border-color: var(--tc-focus);
  box-shadow: inset 0 0 0 1px var(--tc-focus);
}

html:root body #layout .searchbar form {
  align-items: center;
  min-width: 0;
}

html:root body #layout .searchbar input {
  min-width: 0;
  padding: 8px 7px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

html:root body #layout .searchbar input:focus-visible {
  outline: 0;
}

html:root body #layout .searchbar a:is(.options, .unread),
html:root body #layout .searchbar.active a.reset {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
  place-items: center;
  border-radius: 8px;
  line-height: 1;
}

html:root body #layout .searchbar a:is(.options, .unread, .reset):hover,
html:root body #layout .searchbar a:is(.options, .unread, .reset):focus-visible,
html:root body #layout .searchbar a.selected {
  background: var(--tc-brand-soft);
  color: var(--tc-brand-strong);
}

html:root body #layout .searchbar a::before {
  margin: 0;
}

html:root body #layout .searchbar.open a.options::before {
  transform: rotate(180deg);
}

html:root body #layout .pagenav a::before {
  margin-inline: 3px;
}

@media (min-width: 769px) {
  html:root body #layout :is(.header, .toolbar) a:is(
      .select, .threads, .options, .refresh, .reply, .reply-all, .forward, .delete, .markmessage, .more
    )::before {
    display: block;
    margin: 0 auto 4px;
  }

  html:root body #layout .toolbar a.dropdown::before {
    width: 13px;
    height: 13px;
  }
}

html:root body #messagestack {
  position: fixed;
  inset: auto max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) auto;
  width: min(360px, calc(100% - 40px));
  max-height: min(78vh, 620px);
  overflow: auto;
  padding: 6px;
  margin: -6px;
}

html:root body #messagestack > .ui.alert {
  --tc-toast-accent: #38586a;
  --tc-toast-tile: #eaf2f7;
  --tc-control-icon: var(--tc-icon-info);
  gap: 11px;
  min-height: 52px;
  margin: 0 0 8px;
  padding: 10px 13px 10px 10px;
  border: 1px solid var(--tc-line);
  border-radius: 16px;
  background: var(--tc-canvas);
  color: var(--tc-ink);
  opacity: 1;
  box-shadow: 0 10px 23px -13px rgb(25 43 33 / 38%), 0 2px 4px rgb(25 43 33 / 6%);
  font: 650 .875rem / 1.45 var(--tc-ui);
  overflow-wrap: anywhere;
}

html:root body #messagestack > .ui.alert:last-child {
  margin-bottom: 0;
}

html:root body #messagestack > .ui.alert-success {
  --tc-toast-accent: #14632d;
  --tc-toast-tile: #eaf3ed;
  --tc-control-icon: var(--tc-icon-check);
}

html:root body #messagestack > .ui.alert-warning {
  --tc-toast-accent: #815409;
  --tc-toast-tile: #fff2d7;
  --tc-control-icon: var(--tc-icon-warn);
}

html:root body #messagestack > .ui.alert-danger {
  --tc-toast-accent: #a3281e;
  --tc-toast-tile: #fcecea;
  --tc-control-icon: var(--tc-icon-error);
}

html:root body #messagestack > .ui.loading {
  --tc-control-icon: var(--tc-icon-progress);
}

html:root body.task-login #messagestack > .ui.alert {
  --tc-canvas: #fff;
  --tc-ink: #171a18;
  --tc-line: #e3e8e4;
}

html:root.dark-mode body:not(.task-login) #messagestack > .ui.alert {
  --tc-toast-accent: #b3d9e9;
  --tc-toast-tile: #233640;
}

html:root.dark-mode body:not(.task-login) #messagestack > .ui.alert-success {
  --tc-toast-accent: #aedebc;
  --tc-toast-tile: #253e2d;
}

html:root.dark-mode body:not(.task-login) #messagestack > .ui.alert-warning {
  --tc-toast-accent: #f2d297;
  --tc-toast-tile: #47391e;
}

html:root.dark-mode body:not(.task-login) #messagestack > .ui.alert-danger {
  --tc-toast-accent: #f3b4ad;
  --tc-toast-tile: #472d26;
}

html:root body #messagestack > .ui.alert > i.icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  margin: 0;
  place-items: center;
  border-radius: 10px;
  background: var(--tc-toast-tile);
  color: var(--tc-toast-accent);
}

html:root body #messagestack > .ui.alert > i.icon::before {
  color: inherit;
}

html:root body #messagestack > .ui.alert > span {
  min-width: 0;
}

@media (max-width: 480px) {
  html:root body #messagestack {
    inset: auto max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:root body #messagestack > .ui.alert > i.icon::before {
    animation: none;
  }
}

