:root {
  --red: #df000b;
  --red-dark: #b80008;
  --ink: #171717;
  --muted: #626773;
  --line: #e5e7eb;
  --soft: #f6f7f9;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: var(--white);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
}

.brand img {
  display: block;
  width: min(390px, 52vw);
  height: auto;
}

nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
  font-weight: 800;
}

nav a[aria-current="page"] {
  color: var(--red);
}

.nav-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 900;
}

.nav-button,
.button.secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--white);
}

.button.primary {
  color: var(--white);
  border: 1px solid var(--red);
  background: var(--red);
  box-shadow: 0 14px 30px rgba(223, 0, 11, .18);
}

.full {
  width: 100%;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  align-items: center;
  gap: 54px;
  max-width: 1200px;
  min-height: 68vh;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 82px);
  line-height: .98;
}

h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.04;
}

h3 {
  margin: 0;
  font-size: 24px;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 620px;
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.hero-copy .tagline {
  margin-top: -12px;
  color: var(--ink);
  font-weight: 900;
}

.page-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 70px 24px 56px;
}

.page-hero h1 {
  max-width: 880px;
}

.page-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.page-hero .hero-actions {
  margin-top: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 24px 60px rgba(17, 17, 17, .08);
}

.hero-panel img {
  width: 96px;
  height: 96px;
}

.hero-panel div {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.hero-panel span {
  color: var(--muted);
  font-weight: 800;
}

.hero-panel strong {
  font-size: 36px;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  position: relative;
  padding: 9px 0 9px 24px;
  color: var(--muted);
  line-height: 1.35;
}

li::before {
  position: absolute;
  left: 0;
  color: var(--red);
  content: "+";
  font-weight: 900;
}

.plans-section,
.automation-section,
.split-section,
.support-section {
  padding: 72px 24px;
}

.page-section {
  padding-top: 56px;
}

.plans-section {
  border-top: 1px solid var(--line);
  background: var(--soft);
}

.section-heading,
.plans,
.automation-section,
.split-section,
.support-section {
  max-width: 1200px;
  margin: 0 auto;
}

.section-heading {
  margin-bottom: 28px;
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 500px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.plan.featured {
  border-color: rgba(223, 0, 11, .5);
  box-shadow: 0 22px 50px rgba(223, 0, 11, .12);
}

.badge {
  align-self: flex-start;
  padding: 7px 10px;
  color: var(--white);
  background: var(--red);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.price {
  margin: 0;
  font-size: 48px;
  font-weight: 900;
}

.price span {
  color: var(--muted);
  font-size: 18px;
}

.plan-note {
  min-height: 52px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.plan ul {
  flex: 1;
}

.automation-section {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 34px;
  border-top: 1px solid var(--line);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.steps article {
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  color: var(--white);
  background: var(--red);
  border-radius: 50%;
  font-weight: 900;
}

.steps p {
  color: var(--muted);
  line-height: 1.55;
}

.split-section {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 42px;
}

.launch-grid {
  display: grid;
  gap: 16px;
}

.launch-grid article {
  padding: 24px;
  border-left: 5px solid var(--red);
  background: var(--soft);
}

.launch-grid p,
.support-section p {
  color: var(--muted);
  line-height: 1.6;
}

.support-section {
  border-top: 1px solid var(--line);
}

.support-section p {
  max-width: 680px;
  margin: 20px 0 28px;
  font-size: 19px;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.site-footer p {
  margin: 6px 0 0;
  line-height: 1.5;
}

.site-footer address {
  display: grid;
  gap: 6px;
  font-style: normal;
  font-weight: 800;
}

.site-footer a:hover {
  color: var(--red);
}

@media (max-width: 900px) {
  .site-header,
  .hero,
  .automation-section,
  .split-section {
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .brand img {
    width: min(390px, 86vw);
  }

  .plans {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .plan {
    min-height: auto;
  }

  .site-footer {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
}

body.mail-app {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: #f3f2f1;
}

body.auth-locked .mail-shell,
body.auth-locked .compose-dialog,
body.auth-locked .toast {
  display: none;
}

.login-screen {
  display: none;
}

body.auth-locked .login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(18, 18, 18, .96), rgba(223, 0, 11, .82)),
    url("assets/logo.svg?v=20260620-ineedmail");
  background-position: center;
  background-size: cover;
}

.login-panel {
  display: grid;
  gap: 18px;
  width: min(430px, 100%);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}

.login-brand {
  color: #151922;
}

.login-panel h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
}

.login-panel label {
  display: grid;
  gap: 7px;
  color: #42526a;
  font-size: 13px;
  font-weight: 900;
}

.login-panel input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #d7dee8;
  border-radius: 2px;
  outline: 0;
  color: #18202c;
  background: #ffffff;
  font: inherit;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: #42526a;
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: #df000b;
  background: #fff1f2;
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(223, 0, 11, .32);
  outline-offset: 2px;
}

.password-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.password-icon-eye-off,
.password-toggle.is-visible .password-icon-eye {
  display: none;
}

.password-toggle.is-visible .password-icon-eye-off {
  display: block;
}

.login-panel input:focus {
  border-color: #df000b;
  box-shadow: 0 0 0 2px rgba(223, 0, 11, .16);
}

.login-note {
  margin: 0;
  color: #657286;
  font-size: 13px;
  line-height: 1.45;
}

.form-alert {
  padding: 11px 12px;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  color: #323130;
  background: #f3f2f1;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.form-alert[hidden] {
  display: none;
}

.form-alert-error {
  color: #8f0007;
  border-color: #f5b8bd;
  background: #fff1f2;
}

.form-alert-info {
  color: #323130;
  border-color: #d7dee8;
  background: #f8fafc;
}

.mail-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  color: #242424;
}

.mail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 10px;
  color: #242424;
  background: #f3f2f1;
  border-right: 1px solid #d2d0ce;
}

.mail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 8px;
  font-size: 20px;
  font-weight: 900;
}

.mail-brand img {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 4px;
  background: #ffffff;
}

.compose-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  width: 100%;
  border: 0;
  border-radius: 2px;
  color: #ffffff;
  background: #df000b;
  box-shadow: none;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.compose-launch span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .18);
}

.app-switcher {
  display: grid;
  gap: 4px;
  font-size: 14px;
  font-weight: 800;
}

.app-view-button {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: #323130;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.app-view-button.active,
.app-view-button:hover {
  color: #201f1e;
  border-color: #d2d0ce;
  background: #ffffff;
}

.mailbox-nav {
  display: grid;
  gap: 2px;
  font-size: 14px;
  font-weight: 600;
}

.mailbox-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: #323130;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.mailbox-link.active,
.mailbox-link:hover {
  color: #201f1e;
  border-color: #f8d7da;
  background: #fff1f2;
}

.mailbox-link strong {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 2px;
  color: #605e5c;
  background: transparent;
  font-size: 12px;
  text-align: center;
}

.mail-account {
  margin-top: auto;
  padding: 16px;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  background: #ffffff;
}

.mail-account span,
.mail-account strong {
  display: block;
}

.mail-account span {
  margin-bottom: 6px;
  color: #605e5c;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.mail-account strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.signout-button {
  width: 100%;
  min-height: 34px;
  margin-top: 14px;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  color: #323130;
  background: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.signout-button:hover {
  color: #df000b;
  border-color: #f8d7da;
  background: #fff6f7;
}

.mail-main {
  display: grid;
  grid-template-rows: 52px 48px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
}

.mail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 52px;
  padding: 8px 16px;
  border-bottom: 0;
  color: #ffffff;
  background: #171717;
}

.mail-kicker {
  display: none;
  margin: 0;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.mail-topbar h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, 48vw);
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 2px;
  background: #ffffff;
}

.search-box span {
  color: #605e5c;
  font-size: 13px;
  font-weight: 900;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #242424;
  font: inherit;
}

.command-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  padding: 6px 12px;
  border-bottom: 1px solid #d2d0ce;
  background: #ffffff;
}

.command-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: #323130;
  background: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.button:disabled,
.command-button:disabled {
  opacity: .62;
  cursor: not-allowed;
}

.command-button:hover {
  border-color: #edebe9;
  background: #f3f2f1;
}

.primary-command {
  color: #ffffff;
  border-color: #df000b;
  background: #df000b;
}

.primary-command:hover {
  color: #ffffff;
  border-color: #b80008;
  background: #b80008;
}

.danger-command {
  color: #df000b;
}

.mail-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 1px;
  min-height: 0;
  overflow: hidden;
  background: #d2d0ce;
}

.app-view-panel {
  grid-column: 1;
  grid-row: 2 / 4;
  min-height: 0;
  overflow: auto;
  background: #ffffff;
}

.calendar-view,
.settings-view,
body.view-calendar .command-bar,
body.view-calendar .mail-workspace,
body.view-settings .command-bar,
body.view-settings .mail-workspace,
body.view-calendar .search-box,
body.view-settings .search-box {
  display: none;
}

body.view-calendar .calendar-view,
body.view-settings .settings-view {
  display: grid;
}

.calendar-view {
  grid-template-rows: auto minmax(0, 1fr);
  padding: 22px;
}

.calendar-header,
.settings-panel {
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  background: #ffffff;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px;
}

.calendar-heading {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.calendar-header h2,
.settings-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.calendar-view-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  background: #f3f2f1;
}

.calendar-view-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 2px;
  color: #323130;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.calendar-view-tabs button.active,
.calendar-view-tabs button:hover {
  color: #ffffff;
  background: #df000b;
}

.calendar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-grid {
  display: grid;
  min-width: 680px;
  overflow: hidden;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  background: #d2d0ce;
}

.calendar-month-grid {
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  grid-auto-rows: minmax(88px, 1fr);
}

.calendar-weekday,
.calendar-day {
  min-width: 0;
  border: 0;
  background: #ffffff;
}

.calendar-weekday {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  color: #605e5c;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-day {
  padding: 10px;
  border-top: 1px solid #edebe9;
  border-left: 1px solid #edebe9;
  color: #242424;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.calendar-day:hover {
  background: #fff8f8;
}

.calendar-day.muted {
  color: #8a8886;
  background: #f8fafc;
}

.calendar-day time {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  font-weight: 800;
}

.calendar-day.today time {
  color: #ffffff;
  background: #df000b;
}

.calendar-schedule-grid {
  grid-template-columns: 72px repeat(var(--calendar-days), minmax(120px, 1fr));
  grid-auto-rows: minmax(54px, auto);
  align-content: start;
}

.calendar-day-grid {
  min-width: min(520px, 100%);
}

.calendar-corner,
.calendar-slot-header,
.calendar-time-label,
.calendar-time-slot {
  min-width: 0;
  border: 0;
  background: #ffffff;
}

.calendar-corner {
  border-right: 1px solid #edebe9;
  border-bottom: 1px solid #edebe9;
}

.calendar-slot-header {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 10px;
  border-bottom: 1px solid #edebe9;
  border-left: 1px solid #edebe9;
}

.calendar-slot-header span {
  color: #605e5c;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-slot-header strong {
  color: #242424;
  font-size: 15px;
}

.calendar-slot-header.today strong {
  color: #df000b;
}

.calendar-time-label {
  display: flex;
  align-items: start;
  justify-content: end;
  padding: 8px 10px;
  border-top: 1px solid #edebe9;
  color: #605e5c;
  font-size: 12px;
  font-weight: 800;
}

.calendar-time-slot {
  position: relative;
  min-height: 54px;
  border-top: 1px solid #edebe9;
  border-left: 1px solid #edebe9;
  color: #242424;
  cursor: pointer;
}

.calendar-time-slot:hover {
  background: #fff8f8;
}

.calendar-time-slot.today-column {
  background: #fffafa;
}

.calendar-time-slot span {
  position: absolute;
  inset: 50% 10px auto;
  height: 1px;
  background: rgba(210, 208, 206, .65);
}

.settings-view {
  align-content: start;
  padding: 22px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(360px, 720px);
  gap: 18px;
  align-items: start;
}

.settings-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  background: #f3f2f1;
}

.segmented-control button {
  min-height: 38px;
  border: 0;
  border-radius: 2px;
  color: #323130;
  background: transparent;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.segmented-control button.active,
.segmented-control button:hover {
  color: #ffffff;
  background: #df000b;
}

.signature-panel label {
  display: grid;
  gap: 7px;
  color: #42526a;
  font-size: 13px;
  font-weight: 900;
}

.settings-textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  padding: 12px;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  outline: 0;
  color: #242424;
  background: #ffffff;
  font: inherit;
  line-height: 1.5;
}

.settings-textarea:focus {
  border-color: #df000b;
  box-shadow: 0 0 0 2px rgba(223, 0, 11, .14);
}

.message-list-panel,
.reading-pane {
  min-width: 0;
  min-height: 0;
  background: #ffffff;
}

.message-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.message-list-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #edebe9;
  background: #ffffff;
}

.message-list-header h2,
.reading-header h2,
.empty-state h2,
.compose-form h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  color: #323130;
  background: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.message-list {
  display: grid;
  align-content: start;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.message-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  min-height: 80px;
  padding: 12px 10px 12px 0;
  border: 0;
  border-bottom: 1px solid #edebe9;
  border-left: 3px solid transparent;
  background: #ffffff;
  color: #242424;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.message-row:hover,
.message-row.selected {
  border-left-color: #df000b;
  background: #fff8f8;
}

.message-row.unread .message-subject {
  color: #1542bf;
  font-weight: 900;
}

.message-row.unread .message-time {
  color: #153bb3;
  font-weight: 800;
}

.message-row.unread .message-meta strong {
  font-weight: 900;
}

.message-avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.avatar-tone-0 {
  color: #573699;
  background: #dcd1fb;
}

.avatar-tone-1 {
  color: #0b6874;
  background: #c9f0f2;
}

.avatar-tone-2 {
  color: #805000;
  background: #ffe2a8;
}

.avatar-tone-3 {
  color: #21723b;
  background: #c8efcd;
}

.avatar-tone-4 {
  color: #235a9b;
  background: #d2e4ff;
}

.avatar-tone-5 {
  color: #963052;
  background: #ffd6df;
}

.message-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #242424;
  font-size: 14px;
  line-height: 1.2;
}

.message-meta strong {
  min-width: 0;
  overflow: hidden;
  color: #242424;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-time {
  flex: 0 0 auto;
  color: #242424;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.message-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-subject {
  color: #242424;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  white-space: normal;
}

.message-preview {
  color: #55524f;
  font-size: 14px;
  line-height: 1.25;
}

.message-tag {
  justify-self: start;
  margin: 0;
  padding: 5px 8px;
  border-radius: 2px;
  color: #b80008;
  background: #ffe5e7;
  font-size: 12px;
  font-weight: 900;
}

.reading-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.reading-content {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  padding: 24px 28px 18px;
  scrollbar-gutter: stable;
}

.message-list,
.reading-content {
  scrollbar-width: thin;
  scrollbar-color: #8a8886 rgba(0, 0, 0, .08);
}

.message-list::-webkit-scrollbar,
.reading-content::-webkit-scrollbar {
  width: 12px;
}

.message-list::-webkit-scrollbar-track,
.reading-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, .08);
}

.message-list::-webkit-scrollbar-thumb,
.reading-content::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: #8a8886;
  background-clip: content-box;
}

.reading-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid #edebe9;
}

.reading-header h2 {
  margin-top: 10px;
  font-size: clamp(24px, 4vw, 36px);
  max-width: 900px;
}

.star-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  color: #323130;
  background: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.star-button.active {
  color: #b80008;
  border-color: #ffe5e7;
  background: #ffe5e7;
}

.sender-line {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 22px 0;
}

.sender-line > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #ffffff;
  background: #df000b;
  font-weight: 900;
}

.sender-line p {
  margin: 4px 0 0;
  color: #605e5c;
}

.sender-line time {
  color: #605e5c;
  font-size: 14px;
}

.message-body {
  max-width: 780px;
  color: #323130;
  font-size: 18px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.message-body p {
  margin: 0 0 18px;
}

.quick-reply {
  display: grid;
  gap: 10px;
  padding: 14px 28px 16px;
  border-top: 1px solid #edebe9;
  background: #ffffff;
  box-shadow: 0 -8px 20px rgba(15, 23, 42, .06);
}

.quick-reply-inner {
  display: grid;
  gap: 10px;
  max-width: 780px;
}

.quick-reply textarea,
.compose-form input,
.compose-form select,
.compose-editor {
  width: 100%;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  outline: 0;
  background: #ffffff;
  color: #242424;
  font: inherit;
}

.quick-reply textarea,
.compose-editor {
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

.quick-reply textarea {
  min-height: 74px;
  max-height: 28vh;
}

.empty-state,
.no-results {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 24px;
  color: #605e5c;
  text-align: center;
}

.empty-state p {
  margin: 10px 0 0;
}

.compose-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 28px));
  height: min(660px, calc(100vh - 32px));
  min-width: min(540px, calc(100vw - 28px));
  min-height: min(460px, calc(100vh - 32px));
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 32px);
  margin: 0;
  z-index: 20;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 2px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .32);
  transform: translate(-50%, -50%);
}

.compose-dialog.is-positioned {
  transform: none;
}

.compose-dialog.is-maximized {
  top: 16px !important;
  left: 16px !important;
  width: calc(100vw - 32px) !important;
  height: calc(100vh - 32px) !important;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  transform: none;
}

.compose-dialog::backdrop {
  background: rgba(15, 23, 42, .52);
}

.compose-form {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  gap: 14px;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 18px;
  background: #ffffff;
}

.compose-form header,
.compose-form footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compose-header {
  cursor: move;
  user-select: none;
}

.compose-window-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compose-window-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  color: #323130;
  background: #ffffff;
  cursor: pointer;
}

.compose-window-button:hover {
  border-color: #b80008;
  color: #b80008;
}

.compose-window-button.maximize::before {
  content: "";
  width: 13px;
  height: 11px;
  border: 2px solid currentColor;
}

.compose-dialog.is-maximized .compose-window-button.maximize::before {
  width: 14px;
  height: 10px;
  box-shadow: -4px 4px 0 -2px #ffffff, -4px 4px 0 0 currentColor;
}

.compose-form label {
  display: grid;
  gap: 7px;
  color: #42526a;
  font-size: 13px;
  font-weight: 900;
}

.compose-form input {
  min-height: 44px;
  padding: 0 12px;
}

.message-body-field {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 7px;
  min-height: 0;
  color: #42526a;
  font-size: 13px;
  font-weight: 900;
}

.compose-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  padding: 6px;
  border: 1px solid #d2d0ce;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  background: #f8fafc;
}

.compose-toolbar select {
  width: auto;
  min-height: 34px;
  padding: 0 30px 0 10px;
  color: #242424;
  font-size: 13px;
  font-weight: 700;
}

.format-button,
.color-control {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  color: #242424;
  background: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.format-button:hover,
.format-button:focus-visible,
.color-control:hover,
.color-control:focus-within {
  border-color: #b80008;
  color: #b80008;
  outline: 0;
}

.underline-icon {
  text-decoration: underline;
}

.color-control {
  position: relative;
  overflow: hidden;
}

.color-control input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.color-control span {
  position: relative;
}

.color-control span::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -4px;
  left: -3px;
  height: 3px;
  background: currentColor;
}

.compose-editor {
  min-height: 180px;
  overflow-y: auto;
  resize: none;
  border-radius: 0 0 2px 2px;
  color: #242424;
  font-size: 14px;
  font-weight: 400;
  font-family: Arial, Helvetica, sans-serif;
}

.compose-editor:empty::before {
  content: attr(data-placeholder);
  color: #8a8886;
  font-weight: 700;
}

.compose-resize-handle {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background:
    linear-gradient(135deg, transparent 0 50%, #8a8886 50% 58%, transparent 58%),
    linear-gradient(135deg, transparent 0 68%, #8a8886 68% 76%, transparent 76%);
  cursor: nwse-resize;
}

@supports (height: 100dvh) {
  body.mail-app,
  .mail-shell,
  .mail-main {
    height: 100dvh;
  }

  .compose-dialog,
  .compose-form {
    max-height: calc(100dvh - 32px);
  }
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  border-radius: 8px;
  color: #ffffff;
  background: #323130;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .24);
  font-weight: 800;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

body[data-theme="dark"].mail-app {
  background: #111318;
}

body[data-theme="dark"] .mail-shell {
  color: #f4f7fb;
}

body[data-theme="dark"] .login-panel,
body[data-theme="dark"] .mail-sidebar,
body[data-theme="dark"] .mail-main,
body[data-theme="dark"] .command-bar,
body[data-theme="dark"] .message-list-panel,
body[data-theme="dark"] .reading-pane,
body[data-theme="dark"] .quick-reply,
body[data-theme="dark"] .compose-form,
body[data-theme="dark"] .calendar-view,
body[data-theme="dark"] .settings-view,
body[data-theme="dark"] .calendar-header,
body[data-theme="dark"] .settings-panel {
  color: #f4f7fb;
  background: #111318;
}

body[data-theme="dark"] .mail-sidebar,
body[data-theme="dark"] .command-bar,
body[data-theme="dark"] .message-list-header,
body[data-theme="dark"] .reading-header,
body[data-theme="dark"] .quick-reply,
body[data-theme="dark"] .calendar-header,
body[data-theme="dark"] .calendar-view-tabs,
body[data-theme="dark"] .settings-panel,
body[data-theme="dark"] .mail-account {
  border-color: #2b313b;
}

body[data-theme="dark"] .mail-topbar {
  background: #07090d;
}

body[data-theme="dark"] .mail-workspace,
body[data-theme="dark"] .calendar-grid {
  background: #2b313b;
}

body[data-theme="dark"] .mail-brand,
body[data-theme="dark"] .mail-account strong,
body[data-theme="dark"] .message-meta,
body[data-theme="dark"] .message-meta strong,
body[data-theme="dark"] .message-time,
body[data-theme="dark"] .message-subject,
body[data-theme="dark"] .reading-header h2,
body[data-theme="dark"] .empty-state h2,
body[data-theme="dark"] .compose-form h2,
body[data-theme="dark"] .calendar-header h2,
body[data-theme="dark"] .calendar-slot-header strong,
body[data-theme="dark"] .settings-panel h2,
body[data-theme="dark"] .message-body {
  color: #f4f7fb;
}

body[data-theme="dark"] .mail-account span,
body[data-theme="dark"] .sender-line p,
body[data-theme="dark"] .sender-line time,
body[data-theme="dark"] .message-preview,
body[data-theme="dark"] .empty-state,
body[data-theme="dark"] .no-results,
body[data-theme="dark"] .calendar-weekday,
body[data-theme="dark"] .calendar-slot-header span,
body[data-theme="dark"] .calendar-time-label,
body[data-theme="dark"] .login-note {
  color: #b7c0cf;
}

body[data-theme="dark"] .mail-brand img,
body[data-theme="dark"] .mail-account,
body[data-theme="dark"] .message-list-header,
body[data-theme="dark"] .message-row,
body[data-theme="dark"] .calendar-weekday,
body[data-theme="dark"] .calendar-day,
body[data-theme="dark"] .calendar-corner,
body[data-theme="dark"] .calendar-slot-header,
body[data-theme="dark"] .calendar-time-label,
body[data-theme="dark"] .calendar-time-slot,
body[data-theme="dark"] .search-box,
body[data-theme="dark"] .icon-button,
body[data-theme="dark"] .command-button,
body[data-theme="dark"] .signout-button,
body[data-theme="dark"] .button.secondary,
body[data-theme="dark"] .compose-window-button,
body[data-theme="dark"] .format-button,
body[data-theme="dark"] .color-control,
body[data-theme="dark"] .compose-toolbar,
body[data-theme="dark"] .segmented-control,
body[data-theme="dark"] .calendar-view-tabs,
body[data-theme="dark"] .quick-reply textarea,
body[data-theme="dark"] .compose-form input,
body[data-theme="dark"] .compose-form select,
body[data-theme="dark"] .compose-editor,
body[data-theme="dark"] .settings-textarea,
body[data-theme="dark"] .login-panel input {
  color: #f4f7fb;
  border-color: #2b313b;
  background: #171b22;
}

body[data-theme="dark"] .search-box input {
  color: #f4f7fb;
}

body[data-theme="dark"] .message-row {
  border-bottom-color: #252b34;
}

body[data-theme="dark"] .message-row:hover,
body[data-theme="dark"] .message-row.selected,
body[data-theme="dark"] .calendar-day:hover,
body[data-theme="dark"] .calendar-time-slot:hover,
body[data-theme="dark"] .mailbox-link.active,
body[data-theme="dark"] .mailbox-link:hover,
body[data-theme="dark"] .app-view-button.active,
body[data-theme="dark"] .app-view-button:hover {
  color: #ffffff;
  border-color: #533038;
  background: #24191d;
}

body[data-theme="dark"] .mailbox-link,
body[data-theme="dark"] .app-view-button,
body[data-theme="dark"] .calendar-view-tabs button,
body[data-theme="dark"] .mailbox-link strong,
body[data-theme="dark"] .signature-panel label,
body[data-theme="dark"] .compose-form label,
body[data-theme="dark"] .message-body-field,
body[data-theme="dark"] .login-panel label {
  color: #d8dee9;
}

body[data-theme="dark"] .message-row.unread .message-subject,
body[data-theme="dark"] .message-row.unread .message-time {
  color: #7fb2ff;
}

body[data-theme="dark"] .calendar-day.muted {
  color: #8390a1;
  background: #141820;
}

body[data-theme="dark"] .calendar-time-slot.today-column {
  background: #18151a;
}

body[data-theme="dark"] .calendar-time-slot span {
  background: rgba(75, 85, 99, .65);
}

body[data-theme="dark"] .primary-command,
body[data-theme="dark"] .button.primary,
body[data-theme="dark"] .segmented-control button.active,
body[data-theme="dark"] .segmented-control button:hover,
body[data-theme="dark"] .calendar-view-tabs button.active,
body[data-theme="dark"] .calendar-view-tabs button:hover {
  color: #ffffff;
  border-color: #df000b;
  background: #df000b;
}

body[data-theme="dark"] .form-alert-info {
  color: #d9e7ff;
  border-color: #31507c;
  background: #111d31;
}

body[data-theme="dark"] .form-alert-error {
  color: #ffd5d8;
  border-color: #78323b;
  background: #2a1115;
}

@media (max-width: 980px) {
  body.mail-app {
    height: auto;
    overflow: auto;
  }

  .mail-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .mail-main {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .mail-sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 14px;
  }

  .compose-launch {
    width: auto;
    padding: 0 14px;
  }

  .app-switcher {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mailbox-nav {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .mailbox-link {
    flex: 0 0 auto;
    min-width: 118px;
  }

  .mail-account {
    display: none;
  }

  .mail-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .message-list-panel {
    min-height: 280px;
    max-height: 44vh;
    overflow: hidden;
  }

  .reading-pane {
    height: 72vh;
    min-height: 420px;
    overflow: hidden;
  }

  .app-view-panel {
    grid-row: 2 / 4;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .mail-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .calendar-view,
  .settings-view {
    padding: 14px;
  }

  .calendar-header {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-heading,
  .calendar-view-tabs {
    width: 100%;
  }

  .calendar-view-tabs button {
    flex: 1 1 calc(50% - 4px);
  }

  .calendar-actions {
    justify-content: stretch;
  }

  .calendar-actions .command-button {
    flex: 1 1 0;
  }

  .calendar-schedule-grid {
    grid-template-columns: 62px repeat(var(--calendar-days), minmax(108px, 1fr));
  }

  .calendar-day-grid {
    grid-template-columns: 62px minmax(0, 1fr);
    min-width: 100%;
  }

  .mail-brand span {
    font-size: 20px;
  }

  .reading-content {
    padding: 20px;
  }

  .message-list-panel {
    max-height: 40vh;
  }

  .reading-pane {
    height: 76vh;
  }

  .quick-reply {
    padding: 14px 20px 16px;
  }

  .quick-reply textarea {
    max-height: 20vh;
  }

  .reading-header,
  .compose-form footer {
    align-items: stretch;
    flex-direction: column;
  }

  .compose-dialog,
  .compose-dialog.is-positioned,
  .compose-dialog.is-maximized {
    top: 8px !important;
    left: 8px !important;
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px) !important;
    min-width: 0;
    min-height: 0;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    transform: none;
  }

  .compose-toolbar {
    align-items: stretch;
  }

  .compose-toolbar select {
    flex: 1 1 120px;
  }

  .compose-resize-handle {
    display: none;
  }

  .star-button,
  .compose-form footer .button {
    width: 100%;
  }

  .sender-line {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .sender-line > span {
    width: 42px;
    height: 42px;
  }

  .sender-line time {
    grid-column: 2;
  }
}
