/* ==========================================================================
   Temp Mail - Modern UI layer
   Loaded after style.css and vibe.css. Pure override: no markup or JS change
   is required for anything in this file.
   ========================================================================== */

:root {
  --tm-bg: #f6f6fb;
  --tm-surface: #ffffff;
  --tm-surface-2: #fbfbfe;
  --tm-ink: #14141c;
  --tm-ink-soft: #5c5c70;
  --tm-ink-faint: #8b8b9e;
  --tm-line: #e6e6f0;
  --tm-line-soft: #eeeef6;
  --tm-accent: #5b4bff;
  --tm-accent-2: #9a6bff;
  --tm-accent-soft: #eeebff;
  --tm-accent-ink: #ffffff;
  --tm-ok: #12b886;
  --tm-danger: #f0506e;
  --tm-radius: 18px;
  --tm-radius-sm: 12px;
  --tm-shadow: 0 22px 50px -30px rgba(30, 24, 90, .45);
  --tm-shadow-sm: 0 8px 22px -16px rgba(30, 24, 90, .5);
}

@media (prefers-color-scheme: dark) {
  :root {
    --tm-bg: #0d0d14;
    --tm-surface: #16161f;
    --tm-surface-2: #1b1b26;
    --tm-ink: #ececf4;
    --tm-ink-soft: #a3a3b8;
    --tm-ink-faint: #7b7b92;
    --tm-line: #262634;
    --tm-line-soft: #20202c;
    --tm-accent: #7c6bff;
    --tm-accent-2: #b08bff;
    --tm-accent-soft: #201d3a;
    --tm-shadow: 0 24px 60px -34px rgba(0, 0, 0, .9);
    --tm-shadow-sm: 0 10px 26px -18px rgba(0, 0, 0, .85);
  }
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 480px at 8% -10%, rgba(91, 75, 255, .10), transparent 62%),
    radial-gradient(900px 420px at 96% 2%, rgba(154, 107, 255, .10), transparent 60%),
    var(--tm-bg) !important;
  color: var(--tm-ink) !important;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

body, p, li, a, span, div, input, button { letter-spacing: -0.005em; }

h1, h2, h3, h4, h5 { color: var(--tm-ink) !important; letter-spacing: -0.025em; }
p { color: var(--tm-ink-soft); }
a { color: var(--tm-accent); }

.container { max-width: 1080px; }

.section { padding: 34px 0 !important; }

/* ------------------------------------------------------- privacy banner */

.tm-privacy-banner {
  background: linear-gradient(90deg, var(--tm-accent), var(--tm-accent-2)) !important;
  padding: 7px 0 !important;
}
.tm-privacy-banner-text {
  font-size: 12px !important;
  font-weight: 500;
  color: #fff !important;
  text-align: center;
  letter-spacing: .01em;
  opacity: .95;
}

/* ------------------------------------------------------------------ nav */

.nav {
  background: transparent !important;
  padding: 14px 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 18px;
}
.tm-brand-logo { height: 34px; width: auto; }
.nav-menu a,
.nav-menu-button,
.nav-actions-sm a,
.nav-actions-sm i {
  color: var(--tm-ink) !important;
  font-weight: 500;
  font-size: 14px;
}
.nav-menu a:hover { color: var(--tm-accent) !important; }

/* ---------------------------------------------------------------- hero */

.header {
  position: relative;
  padding-bottom: 6px;
}

.header-wrapper { padding: 8px 0 0 !important; }

.mail-wrapper { display: block; }

.mail-selection { text-align: center; }

.tm-address-title {
  font-size: clamp(21px, 3.4vw, 32px) !important;
  font-weight: 800 !important;
  line-height: 1.2;
  margin: 10px 0 18px !important;
  color: var(--tm-ink) !important;
}

/* address pill */
.mail-select {
  display: flex;
  justify-content: center;
  width: 100%;
}

.mail-input {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: var(--tm-surface) !important;
  border: 1.5px solid var(--tm-line) !important;
  border-radius: 16px !important;
  padding: 7px 7px 7px 18px !important;
  box-shadow: var(--tm-shadow) !important;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.mail-input:focus-within {
  border-color: var(--tm-accent) !important;
  box-shadow: 0 0 0 4px var(--tm-accent-soft), var(--tm-shadow) !important;
}

#mainEmail {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  padding: 8px 0 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: clamp(14px, 2.6vw, 19px) !important;
  font-weight: 600 !important;
  color: var(--tm-ink) !important;
  text-align: left;
  outline: none !important;
  box-shadow: none !important;
  text-overflow: ellipsis;
}
#mainEmail::selection { background: var(--tm-accent-soft); }

.mail-input-copy,
.mail-input .btn-copy {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: 44px;
  height: 44px;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: 11px !important;
  background: linear-gradient(135deg, var(--tm-accent), var(--tm-accent-2)) !important;
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 22px -14px rgba(91, 75, 255, .95) !important;
  transition: transform .1s ease, filter .16s ease;
}
.mail-input-copy:hover { filter: brightness(1.08); }
.mail-input-copy:active { transform: translateY(1px); }
.mail-input-copy i { font-size: 14px; }
.mail-input-copy .tm-copy-svg { display: none; }

/* description */
.header-text {
  max-width: 640px;
  margin: 20px auto 0 !important;
  text-align: center;
  font-size: 14px !important;
  line-height: 1.65 !important;
  color: var(--tm-ink-soft) !important;
}

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

.tm-actions-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 20px auto 8px !important;
  max-width: 640px;
}

.mail-action,
.tm-actions-bar .btn {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  padding: 9px 15px !important;
  border-radius: 11px !important;
  border: 1px solid var(--tm-line) !important;
  background: var(--tm-surface) !important;
  color: var(--tm-ink) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  box-shadow: var(--tm-shadow-sm) !important;
  transition: border-color .15s ease, color .15s ease, transform .1s ease;
}
.mail-action:hover,
.tm-actions-bar .btn:hover {
  border-color: var(--tm-accent) !important;
  color: var(--tm-accent) !important;
  background: var(--tm-surface) !important;
}
.mail-action:active { transform: translateY(1px); }
.mail-action i { font-size: 13px; opacity: .85; }
.mail-action-text { white-space: nowrap; }

/* ------------------------------------------------------------- mailbox card */

.tm-inbox-section { padding-top: 6px !important; }

.mailbox-container {
  display: block !important;
  max-width: 860px;
  margin: 0 auto;
}

.mail-content { width: 100%; }

.mailbox {
  background: var(--tm-surface) !important;
  border: 1px solid var(--tm-line) !important;
  border-radius: var(--tm-radius) !important;
  box-shadow: var(--tm-shadow) !important;
  overflow: hidden;
}

.mailbox-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px !important;
  background: var(--tm-surface-2) !important;
  border-bottom: 1px solid var(--tm-line) !important;
  margin: 0 !important;
}
.mailbox-header-item {
  flex: 1;
  min-width: 0;
}
.mailbox-header-item:last-child {
  flex: 0 0 118px;
  text-align: right !important;
}
.mailbox-header-item p {
  margin: 0 !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: .09em !important;
  text-transform: uppercase;
  color: var(--tm-ink-faint) !important;
}

.mailbox-body {
  position: relative;
  min-height: 232px;
  padding: 0 !important;
}

/* rows */
.mailbox-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 14px 20px !important;
  border-bottom: 1px solid var(--tm-line-soft) !important;
  background: transparent !important;
  cursor: pointer;
  transition: background .13s ease;
}
.mailbox-item:last-child { border-bottom: 0 !important; }
.mailbox-item:hover { background: var(--tm-accent-soft) !important; }

.mailbox-item-col {
  flex: 1;
  min-width: 0;
  margin: 0 !important;
}
.mailbox-item-col:last-of-type {
  flex: 0 0 118px;
  text-align: right;
}
.mailbox-item-col a { text-decoration: none !important; }

.mailbox-item-col p {
  margin: 0 !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--tm-ink) !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mailbox-item-col p.small {
  margin-top: 2px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  color: var(--tm-ink-faint) !important;
}
.mailbox-item-col .link,
.mailbox-item-col a.link-primary {
  display: block;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: var(--tm-ink-soft) !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mailbox-item:hover .mailbox-item-col .link { color: var(--tm-accent) !important; }

.mailbox-item-col time {
  font-size: 11.5px !important;
  color: var(--tm-ink-faint) !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.is_seen_message {
  flex: none;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff !important;
  background: var(--tm-accent) !important;
  border-radius: 999px;
  padding: 3px 8px !important;
  margin-left: 4px;
}

/* empty state */
.mailbox.empty .mailbox-body { display: flex; align-items: center; justify-content: center; }
.mailbox-body .empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  padding: 42px 24px !important;
}
.mailbox-body .empty h2 {
  font-size: 16px !important;
  font-weight: 700 !important;
  margin: 14px 0 4px !important;
  color: var(--tm-ink) !important;
}
.mailbox-body .empty p {
  font-size: 13px !important;
  color: var(--tm-ink-faint) !important;
  margin: 0 !important;
}
.mailbox-body .empty-icon svg { width: 84px; height: auto; opacity: .9; }
.mailbox.empty .mailbox-body .empty { display: flex !important; }
.mailbox:not(.empty) .mailbox-body .empty { display: none !important; }

/* --------------------------------------------------------------- footer */

.footer {
  margin-top: 44px;
  background: transparent !important;
  border-top: 1px solid var(--tm-line) !important;
  padding: 0 !important;
}
.footer-upper { padding: 26px 0 18px !important; }
.footer-lower { padding: 0 0 26px !important; }
.footer-links a {
  color: var(--tm-ink-soft) !important;
  font-size: 13px !important;
  font-weight: 500;
  text-decoration: none;
  margin-left: 16px;
}
.footer-links a:hover { color: var(--tm-accent) !important; }
.tm-copy-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  text-align: center;
}
.tm-copy-line {
  font-size: 11.5px !important;
  color: var(--tm-ink-faint) !important;
  margin: 0 !important;
}
.tm-copy-line a { color: var(--tm-ink-soft) !important; text-decoration: none; }
.tm-copy-line a:hover { color: var(--tm-accent) !important; }

/* --------------------------------------------------------------- mobile */

@media (max-width: 767px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .nav { padding: 10px 0 !important; }
  .tm-brand-logo { height: 28px; }

  .tm-address-title { margin: 4px 0 14px !important; }

  .mail-input { padding: 6px 6px 6px 14px !important; border-radius: 14px !important; }
  #mainEmail { font-size: 14.5px !important; }
  .mail-input-copy, .mail-input .btn-copy {
    min-width: 42px; height: 42px; padding: 0 13px !important;
  }
  .mail-input-copy .mail-action-text { display: none; }

  .header-text { font-size: 13px !important; margin-top: 16px !important; }

  .tm-actions-bar { gap: 6px; margin-top: 16px !important; }
  .mail-action, .tm-actions-bar .btn {
    flex: 1 1 calc(33.333% - 6px);
    justify-content: center;
    padding: 10px 8px !important;
    font-size: 12px !important;
  }
  .mail-action-text { font-size: 11.5px; }

  /* stacked rows on small screens */
  .mailbox-header { display: none !important; }
  .mailbox-item {
    flex-wrap: wrap;
    padding: 13px 16px !important;
    gap: 4px 10px;
  }
  .mailbox-item-col { flex: 1 1 100%; }
  .mailbox-item-col:last-of-type {
    flex: 1 1 100%;
    text-align: left;
  }
  .mailbox-item-col time { font-size: 11px; }
  .is_seen_message { order: -1; margin-left: 0; }
  .mailbox-body { min-height: 200px; }
  .mailbox-body .empty { padding: 34px 18px !important; }
  .footer { margin-top: 30px; }
}

@media (max-width: 400px) {
  .mail-action, .tm-actions-bar .btn { flex: 1 1 calc(50% - 6px); }
}

/* keep adverts from breaking the new grid */
.mail-wrapper > .ad { display: none !important; }

/* ==========================================================================
   Higher-specificity overrides for the shipped style.css
   (style.css declares .header, .mail-selection and .mail-input-copy with
   their own !important and deep selectors, so these must out-weigh them)
   ========================================================================== */

body .header {
  background: none !important;
  background-image: none !important;
  overflow: visible !important;
}

body .header .header-wrapper { padding: 6px 0 0 !important; }

body .mail-wrapper .mail-selection {
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 auto !important;
  max-width: 100% !important;
  background: transparent !important;
  box-shadow: none !important;
}

body .mail-wrapper .mail-selection .mail-select { position: static !important; }

body .mail-wrapper .mail-selection .mail-select .mail-input {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 640px !important;
  margin: 0 auto !important;
  padding: 7px 7px 7px 18px !important;
  background: var(--tm-surface) !important;
  border: 1.5px solid var(--tm-line) !important;
  border-radius: 16px !important;
  box-shadow: var(--tm-shadow) !important;
  height: auto !important;
  min-height: 0 !important;
}

body .mail-wrapper .mail-selection .mail-select .mail-input input#mainEmail {
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 8px 0 !important;
  margin: 0 !important;
  width: 100% !important;
  height: auto !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: clamp(14px, 2.6vw, 19px) !important;
  font-weight: 600 !important;
  color: var(--tm-ink) !important;
  text-align: left !important;
}

body .mail-wrapper .mail-selection .mail-select .mail-input .mail-input-copy {
  position: static !important;
  right: auto !important;
  top: auto !important;
  flex: none !important;
  width: auto !important;
  min-width: 46px !important;
  height: 44px !important;
  padding: 0 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 11px !important;
  background: linear-gradient(135deg, var(--tm-accent), var(--tm-accent-2)) !important;
  color: #fff !important;
  box-shadow: 0 10px 22px -14px rgba(91, 75, 255, .95) !important;
}

body .header .header-wrapper .header-text,
body .header-text {
  color: var(--tm-ink-soft) !important;
  text-shadow: none !important;
  opacity: 1 !important;
  font-weight: 400 !important;
  max-width: 640px !important;
  margin: 20px auto 0 !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
  text-align: center !important;
}

body .header .tm-address-title {
  color: var(--tm-ink) !important;
  text-shadow: none !important;
  margin: 10px 0 18px !important;
}

body .tm-actions-bar { display: flex !important; }

body .tm-actions-bar .mail-action,
body .tm-actions-bar .mail-action.btn-light {
  background: var(--tm-surface) !important;
  background-image: none !important;
  border: 1px solid var(--tm-line) !important;
  color: var(--tm-ink) !important;
  box-shadow: var(--tm-shadow-sm) !important;
  padding: 9px 15px !important;
  border-radius: 11px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
body .tm-actions-bar .mail-action:hover {
  border-color: var(--tm-accent) !important;
  color: var(--tm-accent) !important;
}

body .mailbox {
  background: var(--tm-surface) !important;
  border: 1px solid var(--tm-line) !important;
  border-radius: var(--tm-radius) !important;
  box-shadow: var(--tm-shadow) !important;
}

body .mailbox .mailbox-header {
  background: var(--tm-surface-2) !important;
  border-bottom: 1px solid var(--tm-line) !important;
}

body .mailbox .mailbox-item {
  background: transparent !important;
  border-bottom: 1px solid var(--tm-line-soft) !important;
}
body .mailbox .mailbox-item:hover { background: var(--tm-accent-soft) !important; }

@media (max-width: 767px) {
  body .mail-wrapper .mail-selection .mail-select .mail-input { padding: 6px 6px 6px 14px !important; }
  body .mail-wrapper .mail-selection .mail-select .mail-input .mail-input-copy {
    min-width: 44px !important; height: 42px !important; padding: 0 13px !important;
  }
  body .tm-actions-bar .mail-action { flex: 1 1 calc(50% - 6px); justify-content: center; }
}

/* row internals: the shipped theme pads every column and pins the badge to the
   corner; both fight the new layout */
body .mailbox .mailbox-item-col {
  padding: 0 !important;
  margin: 0 !important;
}
body .mailbox .is_seen_message {
  position: static !important;
  top: auto !important;
  right: auto !important;
  order: 5;
  align-self: center;
}
body .mailbox-body { min-height: 0 !important; }
body .mailbox.empty .mailbox-body { min-height: 236px !important; }
body .mailbox .mailbox-item { min-height: 0 !important; }

@media (max-width: 767px) {
  body .mailbox .is_seen_message { order: -1; margin: 0 0 2px 0; }
  body .mailbox .mailbox-item { align-items: flex-start !important; }
}

/* the shipped theme paints the message list white; keep it on the theme surface
   so dark mode works */
body .mailbox,
body .mailbox .mailbox-body,
body .mailbox .mailbox-item,
body .mailbox .mailbox-item-col {
  background-color: var(--tm-surface) !important;
  background-image: none !important;
}
body .mailbox .mailbox-header {
  background-color: var(--tm-surface-2) !important;
}
body .mailbox .mailbox-item:hover { background-color: var(--tm-accent-soft) !important; }

body .mailbox .mailbox-item-col p,
body .mailbox .mailbox-item-col p.small,
body .mailbox .mailbox-item-col .link,
body .mailbox .mailbox-item-col a {
  color: inherit !important;
}
body .mailbox .mailbox-item-col p { color: var(--tm-ink) !important; }
body .mailbox .mailbox-item-col p.small { color: var(--tm-ink-faint) !important; }
body .mailbox .mailbox-item-col .link { color: var(--tm-ink-soft) !important; }
body .mailbox .mailbox-item-col time { color: var(--tm-ink-faint) !important; }

body .mailbox.empty .mailbox-body { min-height: 0 !important; }
body .mailbox .mailbox-body .empty {
  padding: 40px 24px !important;
  min-height: 0 !important;
}

body .mailbox time { display: inline-block !important; }

@media (max-width: 767px) {
  body .mailbox .mailbox-item-col time {
    display: inline-block !important;
    margin-top: 4px;
    font-size: 11px !important;
  }
  body .mailbox .mailbox-item-col .link { white-space: normal !important; }
  body .mailbox .mailbox-item-col p { white-space: normal !important; }
  body .mailbox .mailbox-body .empty { padding: 34px 18px !important; }
}

/* the shipped theme fixes the list height and hides the date column on phones */
body .mailbox .mailbox-body {
  height: auto !important;
  min-height: 0 !important;
}
body .mailbox.empty .mailbox-body { height: 300px !important; }
body .mailbox:not(.empty) .mailbox-body { height: auto !important; }

@media (max-width: 767px) {
  body .mailbox .mailbox-item-col.small {
    display: block !important;
    flex: 1 1 100% !important;
    height: auto !important;
  }
  body .mailbox.empty .mailbox-body { height: 260px !important; }
}

/* ==========================================================================
   Mail-themed background art (SVG, no external images)
   ========================================================================== */

body {
  background-image:
    radial-gradient(1100px 480px at 8% -10%, rgba(91, 75, 255, .12), transparent 62%),
    radial-gradient(900px 420px at 96% 2%, rgba(154, 107, 255, .12), transparent 60%),
    url("../img/mail-pattern.svg") !important;
  background-repeat: no-repeat, no-repeat, repeat !important;
  background-position: 0 0, 0 0, 0 0 !important;
  background-size: auto, auto, 260px 260px !important;
  background-attachment: scroll, scroll, fixed !important;
  background-color: var(--tm-bg) !important;
}

@media (prefers-color-scheme: dark) {
  body {
    background-image:
      radial-gradient(1100px 480px at 8% -10%, rgba(124, 107, 255, .16), transparent 62%),
      radial-gradient(900px 420px at 96% 2%, rgba(176, 139, 255, .12), transparent 60%),
      url("../img/mail-pattern-dark.svg") !important;
  }
}

/* the illustration behind the hero */
body .header-wrapper { position: relative; }

body .header-wrapper::before {
  content: "";
  position: absolute;
  inset: -34px 0 auto 0;
  height: 460px;
  background: url("../img/mail-hero.svg") no-repeat center -18px / min(700px, 98%) auto;
  opacity: .26;
  pointer-events: none;
  z-index: 0;
}

body .header-wrapper > .container {
  position: relative;
  z-index: 1;
}

@media (prefers-color-scheme: dark) {
  body .header-wrapper::before { opacity: .26; }
}

@media (max-width: 767px) {
  body .header-wrapper::before {
    background-size: 118% auto;
    background-position: center -14px;
    opacity: .16;
  }
}

/* ==========================================================================
   Footer: brand highlight + copyright block inside the brand
   ========================================================================== */

body .tm-brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

body .tm-brand-hl {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px 8px 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(91, 75, 255, .14), rgba(154, 107, 255, .07));
  border: 1px solid rgba(91, 75, 255, .22);
  box-shadow: 0 12px 26px -20px rgba(91, 75, 255, .9);
  transition: border-color .16s ease, transform .1s ease;
}
body .tm-brand-hl:hover { border-color: var(--tm-accent); }
body .tm-brand-hl::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -7px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--tm-accent), var(--tm-accent-2));
  opacity: .85;
}
body .tm-brand-hl .tm-brand-logo { height: 30px; width: auto; }

body .tm-brand-block .tm-copy-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  padding-left: 2px;
}
body .tm-brand-block .tm-copy-line {
  font-size: 11.5px !important;
  line-height: 1.55;
  color: var(--tm-ink-faint) !important;
}
body .tm-brand-block .tm-copy-line a { color: var(--tm-ink-soft) !important; }
body .tm-brand-block .tm-copy-line a:hover { color: var(--tm-accent) !important; }

@media (prefers-color-scheme: dark) {
  body .tm-brand-hl {
    background: linear-gradient(135deg, rgba(124, 107, 255, .18), rgba(176, 139, 255, .08));
    border-color: rgba(124, 107, 255, .28);
  }
}

@media (max-width: 575px) {
  body .tm-brand-block { align-items: center; }
  body .tm-brand-block .tm-copy-stack { align-items: center; text-align: center; }
  body .tm-brand-hl .tm-brand-logo { height: 26px; }
}

/* copyright lines side by side (they wrap on narrow screens) */
body .tm-brand-block .tm-copy-stack {
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px 12px !important;
  text-align: left !important;
  max-width: 100%;
}
body .tm-brand-block .tm-copy-line {
  white-space: nowrap;
  font-size: 11.5px !important;
}
body .tm-brand-block .tm-copy-line + .tm-copy-line::before {
  content: "";
}

@media (max-width: 575px) {
  body .tm-brand-block .tm-copy-stack {
    justify-content: center !important;
    gap: 3px 8px !important;
    text-align: center !important;
  }
  body .tm-brand-block .tm-copy-line { white-space: normal; font-size: 11px !important; }
}

/* brand pill on the left, all copyright lines beside it */
body .footer-upper .row {
  display: flex !important;
  align-items: center !important;
  gap: 14px 26px !important;
  flex-wrap: wrap !important;
}
body .footer-upper .row > .col:first-child {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
body .footer-upper .row > .col:last-child {
  flex: 0 0 auto !important;
  margin-left: auto !important;
}

body .tm-brand-block {
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px 16px !important;
  width: 100%;
}

body .tm-brand-block .tm-copy-stack {
  flex: 1 1 320px !important;
  min-width: 0 !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 2px 12px !important;
  text-align: left !important;
}

@media (max-width: 767px) {
  body .tm-brand-block {
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
  }
  body .tm-brand-block .tm-copy-stack {
    flex: 0 1 auto !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 2px 8px !important;
  }
  body .footer-upper .row > .col:last-child { margin-left: 0 !important; width: 100%; }
}

/* keep the menu links on the same line: let the copy text take the leftover width */
body .tm-brand-block .tm-copy-stack {
  flex: 1 1 0 !important;
  min-width: 0 !important;
}
body .tm-brand-block .tm-copy-line { font-size: 11px !important; }
body .footer-upper .row { gap: 10px 18px !important; }

/* let the copy lines wrap so the menu links stay on the right of the same row */
body .tm-brand-block .tm-copy-line {
  white-space: normal !important;
  flex: 0 1 auto;
}

/* cap the text column so the menu links fit on the same row */
@media (min-width: 768px) {
  body .tm-brand-block .tm-copy-stack {
    flex: 1 1 auto !important;
    max-width: 620px !important;
  }
}

/* one single line beside the pill: smaller type, no width cap */
@media (min-width: 768px) {
  body .tm-brand-block .tm-copy-stack {
    max-width: none !important;
    flex: 1 1 auto !important;
    gap: 0 9px !important;
  }
  body .tm-brand-block .tm-copy-line {
    font-size: 10.5px !important;
    white-space: nowrap !important;
    line-height: 1.4;
  }
}

/* ==========================================================================
   Manual dark/light switch + security background + brand colour
   ========================================================================== */

/* the switch wins over the system preference */
html[data-theme="dark"] {
  --tm-bg: #0d0d14;
  --tm-surface: #16161f;
  --tm-surface-2: #1b1b26;
  --tm-ink: #ececf4;
  --tm-ink-soft: #a3a3b8;
  --tm-ink-faint: #7b7b92;
  --tm-line: #262634;
  --tm-line-soft: #20202c;
  --tm-accent: #7c6bff;
  --tm-accent-2: #b08bff;
  --tm-accent-soft: #201d3a;
  --tm-shadow: 0 24px 60px -34px rgba(0, 0, 0, .9);
  --tm-shadow-sm: 0 10px 26px -18px rgba(0, 0, 0, .85);
}

html[data-theme="light"] {
  --tm-bg: #f6f6fb;
  --tm-surface: #ffffff;
  --tm-surface-2: #fbfbfe;
  --tm-ink: #14141c;
  --tm-ink-soft: #5c5c70;
  --tm-ink-faint: #8b8b9e;
  --tm-line: #e6e6f0;
  --tm-line-soft: #eeeef6;
  --tm-accent: #5b4bff;
  --tm-accent-2: #9a6bff;
  --tm-accent-soft: #eeebff;
  --tm-shadow: 0 22px 50px -30px rgba(30, 24, 90, .45);
  --tm-shadow-sm: 0 8px 22px -16px rgba(30, 24, 90, .5);
}

/* background art follows the chosen theme */
html[data-theme="light"] body,
html[data-theme="dark"] body {
  background-color: var(--tm-bg) !important;
}
html[data-theme="light"] body {
  background-image:
    radial-gradient(1100px 480px at 8% -10%, rgba(91, 75, 255, .12), transparent 62%),
    radial-gradient(900px 420px at 96% 2%, rgba(154, 107, 255, .12), transparent 60%),
    url("../img/security-pattern.svg") !important;
}
html[data-theme="dark"] body {
  background-image:
    radial-gradient(1100px 480px at 8% -10%, rgba(124, 107, 255, .16), transparent 62%),
    radial-gradient(900px 420px at 96% 2%, rgba(176, 139, 255, .12), transparent 60%),
    url("../img/security-pattern-dark.svg") !important;
}

/* system default keeps working, but with the security art */
@media (prefers-color-scheme: light) {
  html:not([data-theme]) body {
    background-image:
      radial-gradient(1100px 480px at 8% -10%, rgba(91, 75, 255, .12), transparent 62%),
      radial-gradient(900px 420px at 96% 2%, rgba(154, 107, 255, .12), transparent 60%),
      url("../img/security-pattern.svg") !important;
  }
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) body {
    background-image:
      radial-gradient(1100px 480px at 8% -10%, rgba(124, 107, 255, .16), transparent 62%),
      radial-gradient(900px 420px at 96% 2%, rgba(176, 139, 255, .12), transparent 60%),
      url("../img/security-pattern-dark.svg") !important;
  }
}

/* security hero illustration */
body .header-wrapper::before {
  background-image: url("../img/security-hero.svg") !important;
  background-size: min(660px, 96%) auto !important;
  opacity: .30 !important;
}
@media (max-width: 767px) {
  body .header-wrapper::before { opacity: .18 !important; }
}

/* ------------------------------------------------------- theme switch */

body .tm-theme-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 11px;
  border: 1px solid var(--tm-line);
  background: var(--tm-surface);
  color: var(--tm-ink);
  cursor: pointer;
  box-shadow: var(--tm-shadow-sm);
  transition: border-color .15s ease, color .15s ease, transform .1s ease;
}
body .tm-theme-toggle:hover { border-color: var(--tm-accent); color: var(--tm-accent); }
body .tm-theme-toggle:active { transform: translateY(1px); }
body .tm-theme-toggle svg { display: block; }

body .tm-theme-toggle .tm-ic-sun { display: none; }
body .tm-theme-toggle .tm-ic-moon { display: block; }

html[data-theme="dark"] .tm-theme-toggle .tm-ic-sun { display: block; }
html[data-theme="dark"] .tm-theme-toggle .tm-ic-moon { display: none; }
html[data-theme="light"] .tm-theme-toggle .tm-ic-sun { display: none; }
html[data-theme="light"] .tm-theme-toggle .tm-ic-moon { display: block; }

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .tm-theme-toggle .tm-ic-sun { display: block; }
  html:not([data-theme]) .tm-theme-toggle .tm-ic-moon { display: none; }
}

@media (max-width: 575px) {
  body .tm-theme-toggle { width: 34px; height: 34px; border-radius: 10px; }
  body .nav-inner { gap: 10px; }
}

/* --------------------------------------------------- brand colour shift */

/* the shipped logo is blue; rotate its hue into the violet accent */
body .tm-brand-logo {
  filter: hue-rotate(48deg) saturate(1.1) brightness(1.02);
}

/* simple inline nav links (preview / flat menus) */
body .nav-menu > a + a { margin-left: 18px; }

/* ==========================================================================
   Brand: vector mark + coloured wordmark (the old logo.png had the text baked
   in, so it could never be recoloured)
   ========================================================================== */

body .tm-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

body .tm-brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  display: block;
}

body .tm-brand-word {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1;
  background: linear-gradient(120deg, #5b4bff 0%, #8b5cff 45%, #d96bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #6d5efc;
  white-space: nowrap;
}

html[data-theme="dark"] body .tm-brand-word {
  background: linear-gradient(120deg, #b9a6ff 0%, #d3b6ff 45%, #f0a9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) body .tm-brand-word {
    background: linear-gradient(120deg, #b9a6ff 0%, #d3b6ff 45%, #f0a9ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* footer copy of the brand is a touch smaller */
body .tm-brand-block .tm-brand-mark { width: 30px; height: 30px; }
body .tm-brand-block .tm-brand-word { font-size: 17px; }

@media (max-width: 575px) {
  body .tm-brand-mark { width: 30px; height: 30px; }
  body .tm-brand-word { font-size: 16px; }
}

/* ==========================================================================
   Coloured accents: action buttons, address pill, inbox card, empty state
   ========================================================================== */

:root {
  --tm-ring: rgba(91, 75, 255, .28);
  --tm-ring-strong: rgba(91, 75, 255, .55);
  --tm-tint: rgba(91, 75, 255, .07);
  --tm-tint-2: rgba(154, 107, 255, .10);
}

@media (prefers-color-scheme: dark) {
  :root {
    --tm-ring: rgba(150, 132, 255, .30);
    --tm-ring-strong: rgba(168, 150, 255, .62);
    --tm-tint: rgba(140, 120, 255, .10);
    --tm-tint-2: rgba(180, 140, 255, .12);
  }
}
html[data-theme="light"] {
  --tm-ring: rgba(91, 75, 255, .28);
  --tm-ring-strong: rgba(91, 75, 255, .55);
  --tm-tint: rgba(91, 75, 255, .07);
  --tm-tint-2: rgba(154, 107, 255, .10);
}
html[data-theme="dark"] {
  --tm-ring: rgba(150, 132, 255, .30);
  --tm-ring-strong: rgba(168, 150, 255, .62);
  --tm-tint: rgba(140, 120, 255, .10);
  --tm-tint-2: rgba(180, 140, 255, .12);
}

/* action buttons */
body .tm-actions-bar .mail-action,
body .tm-actions-bar .mail-action.btn-light {
  border: 1px solid var(--tm-ring) !important;
  background-image: linear-gradient(180deg, var(--tm-tint), transparent) !important;
  background-color: var(--tm-surface) !important;
  color: var(--tm-ink) !important;
  box-shadow: 0 10px 24px -20px rgba(91, 75, 255, .9) !important;
}
body .tm-actions-bar .mail-action i,
body .tm-actions-bar .mail-action .mail-action-text { color: var(--tm-accent) !important; }
body .tm-actions-bar .mail-action:hover,
body .tm-actions-bar .mail-action.btn-light:hover {
  border-color: var(--tm-ring-strong) !important;
  background-image: linear-gradient(180deg, var(--tm-tint-2), var(--tm-tint)) !important;
  color: var(--tm-accent) !important;
  transform: translateY(-1px);
}
body .tm-actions-bar .mail-action.kill,
body .tm-actions-bar .mail-action#delete {
  border-color: rgba(240, 80, 110, .35) !important;
}
body .tm-actions-bar .mail-action.kill i,
body .tm-actions-bar .mail-action#delete i,
body .tm-actions-bar .mail-action.kill .mail-action-text { color: #f0506e !important; }
body .tm-actions-bar .mail-action.kill:hover {
  border-color: rgba(240, 80, 110, .7) !important;
  background-image: linear-gradient(180deg, rgba(240, 80, 110, .10), transparent) !important;
}

/* address pill */
body .mail-wrapper .mail-selection .mail-select .mail-input {
  border: 1.5px solid var(--tm-ring) !important;
  box-shadow: 0 0 0 5px var(--tm-tint), var(--tm-shadow) !important;
}
body .mail-wrapper .mail-selection .mail-select .mail-input:focus-within {
  border-color: var(--tm-accent) !important;
  box-shadow: 0 0 0 6px var(--tm-tint-2), var(--tm-shadow) !important;
}

/* inbox card + header */
body .mailbox {
  border: 1px solid var(--tm-ring) !important;
  box-shadow: 0 24px 60px -40px rgba(91, 75, 255, .75), var(--tm-shadow) !important;
}
body .mailbox .mailbox-header {
  background-image: linear-gradient(180deg, var(--tm-tint), transparent) !important;
  border-bottom: 1px solid var(--tm-ring) !important;
}
body .mailbox .mailbox-header-item p { color: var(--tm-accent) !important; opacity: .85; }

/* empty state ring + tinted illustration */
body .mailbox .mailbox-body .empty {
  position: relative;
}
body .mailbox.empty .mailbox-body::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 16px;
  border: 1.5px dashed var(--tm-ring);
  background-image: linear-gradient(180deg, var(--tm-tint), transparent 70%);
  pointer-events: none;
}
body .mailbox .mailbox-body .empty-icon svg {
  filter: sepia(1) hue-rotate(205deg) saturate(2.6) brightness(1.02);
  opacity: .9;
}
body .mailbox .mailbox-body .empty h2 { color: var(--tm-accent) !important; }
body .mailbox .mailbox-body .empty p { color: var(--tm-ink-faint) !important; }

/* theme switch + brand pill pick up the same ring */
body .tm-theme-toggle { border-color: var(--tm-ring) !important; }
body .tm-theme-toggle:hover { border-color: var(--tm-accent) !important; }
body .tm-brand-hl { border-color: var(--tm-ring) !important; }

/* ==========================================================================
   Modals (Change Email / QR / History) - the base theme assumed a dark skin
   ========================================================================== */

body .modal-content {
  background: var(--tm-surface) !important;
  color: var(--tm-ink) !important;
  border: 1px solid var(--tm-ring) !important;
  border-radius: 18px !important;
  box-shadow: 0 34px 90px -50px rgba(10, 6, 40, .8) !important;
  padding: 6px;
}

body .modal-content .modal-header {
  border-bottom: 0 !important;
  padding: 14px 16px 6px !important;
}

body .modal-content .modal-title,
body .modal-content .modal-header h5 {
  color: var(--tm-ink) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
}

body .modal-content .modal-body { padding: 8px 16px 18px !important; }

body .modal-content label,
body .modal-content .form-label {
  color: var(--tm-ink-soft) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  margin-bottom: 6px !important;
}

body .modal-content .form-control,
body .modal-content .form-select,
body .modal-content textarea {
  background: var(--tm-bg) !important;
  color: var(--tm-ink) !important;
  border: 1px solid var(--tm-line) !important;
  border-radius: 11px !important;
  font-size: 14px !important;
  padding: 10px 13px !important;
}
body .modal-content .form-control::placeholder { color: var(--tm-ink-faint) !important; }
body .modal-content .form-control:focus,
body .modal-content .form-select:focus {
  border-color: var(--tm-accent) !important;
  box-shadow: 0 0 0 4px var(--tm-tint) !important;
  outline: none !important;
}

body .modal-content .input-group > .form-control { border-radius: 11px 0 0 11px !important; }
body .modal-content .input-group > .btn {
  border-radius: 0 11px 11px 0 !important;
  border: 0 !important;
  background: linear-gradient(135deg, var(--tm-accent), var(--tm-accent-2)) !important;
  color: #fff !important;
  font-weight: 600 !important;
  padding: 0 16px !important;
  white-space: nowrap;
}

body .modal-content .btn-primary,
body .modal-content .btn.kill {
  background: linear-gradient(135deg, var(--tm-accent), var(--tm-accent-2)) !important;
  border: 0 !important;
  color: #fff !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  box-shadow: 0 14px 30px -20px rgba(91, 75, 255, .95) !important;
}
body .modal-content .btn-primary:hover { filter: brightness(1.07); }

body .modal-content .btn-close {
  opacity: .6;
  filter: none;
}
body .modal-content .btn-close:hover { opacity: 1; }

html[data-theme="dark"] body .modal-content .btn-close {
  filter: invert(1) grayscale(1) brightness(2);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) body .modal-content .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
  }
}

body .modal-backdrop.show { opacity: .6 !important; }

/* select2 (Domain dropdown) */
body .modal-content .select2-container .select2-selection--single {
  height: auto !important;
  background: var(--tm-bg) !important;
  border: 1px solid var(--tm-line) !important;
  border-radius: 11px !important;
  padding: 9px 12px !important;
}
body .modal-content .select2-container .select2-selection__rendered {
  color: var(--tm-ink) !important;
  line-height: 1.4 !important;
  padding: 0 !important;
}
body .modal-content .select2-container .select2-selection__arrow { top: 50% !important; transform: translateY(-50%); }
body .select2-dropdown {
  background: var(--tm-surface) !important;
  border: 1px solid var(--tm-ring) !important;
  border-radius: 12px !important;
  color: var(--tm-ink) !important;
}
body .select2-results__option { color: var(--tm-ink) !important; }
body .select2-results__option--highlighted { background: var(--tm-accent) !important; color: #fff !important; }
body .select2-results__group { color: var(--tm-ink-faint) !important; }

/* inline heart icon (replaces the emoji, which rendered as a tofu box on
   tablets and some Android browsers) */
body .tm-heart {
  display: inline-block;
  width: 11px;
  height: 11px;
  vertical-align: -1px;
  margin-left: 1px;
}
body .tm-copy-line { white-space: nowrap; }

/* ==========================================================================
   Header cleanup: the language/hamburger block and the old slide-out drawer
   came from the removed vibe skin - they render as a stray icon box and a
   blank white panel, so they are switched off. Logo + theme switch remain.
   ========================================================================== */

body .nav-actions-sm { display: none !important; }

body .nav-menu { display: none !important; }

/* make sure the theme switch stays reachable in the header */
body .nav-inner { justify-content: space-between; }
body .tm-theme-toggle { margin-left: auto; }
