@font-face {
  font-family: 'Vazir Local';
  src: url('/assets/fonts/Vazir-Bold.woff') format('woff');
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
}

:root {
  --brand-950: #06271c;
  --brand-900: #0a3b2c;
  --brand-800: #0d563c;
  --brand-700: #117c4f;
  --brand-600: #159463;
  --brand-500: #32ad7a;
  --mint-100: #eef9f3;
  --mint-200: #dff2e8;
  --mint-300: #c4e8d5;
  --ink-950: #12251c;
  --ink-800: #274137;
  --ink-600: #5c7067;
  --ink-500: #75877f;
  --ink-400: #9baa9f;
  --line: #e5eee9;
  --line-strong: #d4e2da;
  --surface: #ffffff;
  --surface-soft: #f9fcfa;
  --canvas: #f2f7f4;
  --warning: #d28a1c;
  --danger: #d55757;
  --shadow-sm: 0 5px 18px rgba(15, 66, 45, 0.06);
  --shadow-md: 0 16px 50px rgba(9, 58, 39, 0.1);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --font: 'Vazir Local', Vazirmatn, Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--canvas);
  color: var(--ink-950);
  direction: rtl;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(21, 148, 99, 0.22);
  outline-offset: 2px;
}

::selection {
  background: var(--mint-300);
  color: var(--brand-950);
}

.icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
}

.icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

/* Login */

.login-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 12%, rgba(50, 173, 122, 0.23), transparent 28%),
    radial-gradient(circle at 84% 82%, rgba(17, 124, 79, 0.28), transparent 33%),
    var(--brand-950);
  padding: 28px;
}

.login-page::before,
.login-page::after {
  position: absolute;
  content: '';
  pointer-events: none;
}

.login-page::before {
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(211, 244, 228, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(211, 244, 228, 0.12) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
  transform: perspective(700px) rotateX(58deg) translateY(-34%);
  transform-origin: top center;
}

.login-page::after {
  width: 440px;
  height: 440px;
  top: -220px;
  left: -120px;
  border: 1px solid rgba(208, 247, 227, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(208, 247, 227, 0.02), 0 0 0 84px rgba(208, 247, 227, 0.018);
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1110px, 100%);
  min-height: 650px;
  overflow: hidden;
  border: 1px solid rgba(220, 248, 234, 0.18);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 32px 100px rgba(0, 19, 12, 0.36);
  grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.08fr);
  animation: rise-in 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(18, 148, 98, 0.33), transparent 44%),
    linear-gradient(30deg, var(--brand-950), var(--brand-900) 58%, var(--brand-800));
  color: #f5fff9;
  padding: 38px 40px 32px;
}

.login-brand::before,
.login-brand::after {
  position: absolute;
  content: '';
  pointer-events: none;
}

.login-brand::before {
  inset: 0;
  opacity: 0.62;
  background:
    linear-gradient(140deg, transparent 0 46%, rgba(178, 238, 207, 0.07) 46.15% 46.35%, transparent 46.5%),
    linear-gradient(140deg, transparent 0 63%, rgba(178, 238, 207, 0.05) 63.15% 63.35%, transparent 63.5%),
    repeating-linear-gradient(0deg, transparent 0 62px, rgba(213, 250, 229, 0.04) 62px 63px);
}

.login-brand::after {
  width: 380px;
  height: 380px;
  right: -155px;
  bottom: -144px;
  border: 1px solid rgba(211, 247, 228, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(211, 247, 228, 0.035), 0 0 0 76px rgba(211, 247, 228, 0.025);
}

.login-brand-content,
.login-brand-footer,
.login-brand-header {
  position: relative;
  z-index: 1;
}

.login-brand-header {
  display: flex;
  align-items: center;
  gap: 13px;
}

.logo-box {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(17, 124, 79, 0.18);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 23, 14, 0.17);
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
}

.brand-wordmark {
  display: grid;
  gap: 1px;
}

.brand-wordmark strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-wordmark span {
  color: rgba(236, 255, 245, 0.62);
  font-size: 11px;
  letter-spacing: 0.4px;
}

.login-brand-content {
  display: grid;
  gap: 24px;
  margin: auto 0;
  padding: 62px 0 46px;
}

.login-brand-content h1 {
  max-width: 370px;
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 850;
  letter-spacing: -1.5px;
  line-height: 1.32;
}

.login-brand-content p {
  max-width: 360px;
  margin: 0;
  color: rgba(234, 252, 242, 0.68);
  font-size: 14px;
  line-height: 2;
}

.login-highlights {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.highlight {
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(246, 255, 250, 0.84);
  font-size: 13px;
}

.highlight .icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border: 1px solid rgba(198, 242, 216, 0.18);
  border-radius: 10px;
  background: rgba(142, 229, 182, 0.12);
  color: #93e7b8;
}

.login-brand-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: rgba(223, 250, 235, 0.5);
  font-size: 11px;
}

.domain-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(199, 243, 217, 0.16);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.055);
}

.domain-chip .icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
  color: #9be8bc;
}

.login-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  background: #fff;
  padding: 48px clamp(28px, 5vw, 76px);
}

.login-form-wrap {
  width: min(380px, 100%);
}

.login-form-wrap .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.login-form-wrap .eyebrow::before {
  width: 22px;
  height: 2px;
  border-radius: 5px;
  background: var(--brand-500);
  content: '';
}

.login-form-wrap h2 {
  margin: 0 0 11px;
  color: var(--ink-950);
  font-size: 29px;
  font-weight: 850;
  letter-spacing: -0.8px;
}

.login-form-wrap .form-intro {
  margin: 0 0 30px;
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.9;
}

.form-field {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

.form-field label {
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 700;
}

.input-wrap {
  position: relative;
}

.input-wrap > .icon {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 18px;
  height: 18px;
  color: var(--ink-400);
  pointer-events: none;
  transform: translateY(-50%);
}

.input-wrap input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  outline: 0;
  background: var(--surface-soft);
  padding: 0 45px 0 16px;
  transition: 160ms ease;
}

.input-wrap input::placeholder {
  color: #a7b4ad;
}

.input-wrap input:focus {
  border-color: rgba(21, 148, 99, 0.7);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(21, 148, 99, 0.09);
}

.input-wrap .password-toggle {
  position: absolute;
  top: 50%;
  left: 11px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-400);
  transform: translateY(-50%);
}

.input-wrap .password-toggle:hover {
  background: var(--mint-100);
  color: var(--brand-700);
}

.form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 22px;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-600);
  cursor: pointer;
  font-size: 12px;
}

.check-label input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--brand-600);
}

.text-button {
  background: transparent;
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 700;
}

.text-button:hover {
  color: var(--brand-900);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.primary-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-800));
  box-shadow: 0 11px 22px rgba(17, 124, 79, 0.2);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  transition: 180ms ease;
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  box-shadow: 0 14px 28px rgba(17, 124, 79, 0.26);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.form-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 16px;
  border-radius: 10px;
  background: #fff2f2;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.8;
  padding: 10px 12px;
}

.form-error .icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

/* App shell */

.app-shell {
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  background: var(--canvas);
  grid-template-columns: var(--sidebar-width, 266px) minmax(0, 1fr);
}

.app-sidebar {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 26px 16px 18px;
}

.app-sidebar::after {
  position: absolute;
  right: -82px;
  bottom: -75px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(50, 173, 122, 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(50, 173, 122, 0.035), 0 0 0 56px rgba(50, 173, 122, 0.02);
  content: '';
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 1px 8px 28px;
}

.sidebar-brand .logo-box {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 12px;
  box-shadow: 0 5px 12px rgba(17, 124, 79, 0.12);
}

.sidebar-brand .logo-box img {
  padding: 6px;
}

.sidebar-brand strong {
  display: block;
  color: var(--brand-900);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.3;
}

.sidebar-brand span {
  display: block;
  margin-top: 3px;
  color: var(--ink-400);
  font-size: 10px;
}

.compose-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 47px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  border-radius: 13px;
  background: var(--brand-700);
  box-shadow: 0 10px 20px rgba(17, 124, 79, 0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  transition: 160ms ease;
}

.compose-button:hover {
  background: var(--brand-800);
  box-shadow: 0 13px 25px rgba(17, 124, 79, 0.24);
  transform: translateY(-1px);
}

.compose-button .icon {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

.sidebar-section-label {
  position: relative;
  z-index: 1;
  margin: 28px 11px 10px;
  color: var(--ink-400);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.sidebar-nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
}

.sidebar-nav button {
  display: flex;
  min-height: 41px;
  align-items: center;
  gap: 11px;
  width: 100%;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-600);
  font-size: 12px;
  text-align: right;
  padding: 0 11px;
  transition: 160ms ease;
}

.sidebar-nav button:hover {
  background: var(--mint-100);
  color: var(--brand-700);
}

.sidebar-nav button.is-active {
  background: var(--mint-100);
  color: var(--brand-800);
  font-weight: 800;
}

.sidebar-nav button.is-active .nav-icon {
  background: transparent;
  color: var(--brand-700);
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 9px;
  color: var(--ink-500);
  transition: 160ms ease;
}

.nav-icon .icon {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

.nav-count {
  min-width: 21px;
  margin-right: auto;
  border-radius: 7px;
  color: var(--ink-400);
  font-size: 10px;
  text-align: center;
}

.nav-count.has-unread {
  background: var(--brand-600);
  color: #fff;
  font-weight: 800;
  padding: 3px 5px;
}

.sidebar-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 8px;
  transition: 160ms ease;
}

.profile-card:hover {
  background: var(--surface-soft);
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 12px;
  background: var(--brand-700);
  box-shadow: 0 0 0 1px var(--mint-300);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.profile-copy {
  min-width: 0;
}

.profile-copy strong,
.profile-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy strong {
  color: var(--ink-800);
  font-size: 11px;
}

.profile-copy span {
  margin-top: 3px;
  color: var(--ink-400);
  direction: ltr;
  font-size: 10px;
  text-align: right;
}

.profile-more {
  display: grid;
  width: 26px;
  height: 26px;
  margin-right: auto;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-400);
}

.profile-more:hover {
  background: var(--mint-100);
  color: var(--brand-700);
}

.app-main {
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
}

.desktop-header {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(242, 247, 244, 0.86);
  padding: 0 38px;
}

.header-greeting {
  display: grid;
  gap: 4px;
}

.header-greeting strong {
  color: var(--ink-950);
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.3px;
}

.header-greeting span {
  color: var(--ink-400);
  font-size: 11px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.search-zone {
  position: relative;
  z-index: 25;
  width: min(370px, 34vw);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: min(270px, 27vw);
  width: 100%;
}

.search-box > .icon {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 17px;
  height: 17px;
  color: var(--ink-400);
  pointer-events: none;
  transform: translateY(-50%);
}

.search-box input {
  width: auto;
  min-width: 0;
  flex: 1;
  min-height: 41px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: rgba(255, 255, 255, 0.8);
  padding: 0 39px 0 42px;
  font-size: 11px;
  transition: 160ms ease;
}

.search-box input:focus {
  border-color: var(--mint-300);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(50, 173, 122, 0.08);
}

.search-box input::placeholder {
  color: var(--ink-400);
}

.search-filter-button {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  margin-left: 5px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-400);
}

.search-filter-button:hover,
.search-filter-button.is-active {
  border-color: var(--mint-300);
  background: var(--mint-100);
  color: var(--brand-700);
}

.filter-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  gap: 15px;
  width: min(365px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 20px 55px rgba(9, 58, 39, 0.16);
  padding: 16px;
  animation: modal-in 180ms ease both;
}

.filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-950);
  font-size: 12px;
}

.filter-panel-head .icon-button {
  width: 27px;
  height: 27px;
  border-color: transparent;
  background: transparent;
}

.filter-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.filter-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.filter-grid label:first-child {
  grid-column: 1 / -1;
}

.filter-grid span {
  color: var(--ink-500);
  font-size: 10px;
}

.filter-grid input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  background: var(--surface-soft);
  padding: 0 9px;
  font-size: 10px;
}

.filter-grid input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(50, 173, 122, 0.09);
}

.filter-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--ink-600);
  font-size: 10px;
}

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

.filter-checks input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--brand-600);
}

.filter-apply {
  display: inline-flex;
  min-height: 37px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  background: var(--brand-700);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.filter-apply:hover {
  background: var(--brand-800);
}

.sync-control {
  display: flex;
  max-width: 205px;
  min-height: 35px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink-500);
  font-size: 9px;
  padding: 0 5px 0 9px;
  white-space: nowrap;
}

.sync-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(50, 173, 122, 0.12);
}

.sync-control.is-error .sync-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(213, 87, 87, 0.12);
}

.sync-control.is-live .sync-dot {
  background: var(--brand-700);
  box-shadow: 0 0 0 3px rgba(17, 124, 79, 0.16);
}

.sync-control.is-syncing .sync-dot {
  animation: sync-pulse 1.1s ease-in-out infinite;
}

.sync-button {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-400);
}

.sync-button:hover {
  background: var(--mint-100);
  color: var(--brand-700);
}

.sync-control.is-syncing .sync-button .icon {
  animation: spin 1s linear infinite;
}

/* Persistent offline state: the cached SPA remains usable, while this
   banner stays visible until the server health probe succeeds again. */
.connection-banner {
  position: fixed;
  z-index: 120;
  top: 14px;
  left: 50%;
  display: flex;
  width: min(500px, calc(100vw - 28px));
  min-height: 51px;
  align-items: center;
  gap: 10px;
  border: 1px solid #f0a3a3;
  border-radius: 13px;
  background: #fff4f4;
  box-shadow: 0 14px 32px rgba(151, 38, 38, 0.16);
  color: #9e3030;
  padding: 8px 12px;
  transform: translateX(-50%);
  animation: connection-banner-in 240ms ease both;
}

.connection-banner-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 9px;
  background: #ffe0e0;
  color: #c33b3b;
}

.connection-banner-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.connection-banner-copy strong {
  color: #9e3030;
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: .2px;
  text-align: left;
}

.connection-banner-copy span {
  color: #b24b4b;
  font-size: 10px;
  line-height: 1.6;
  text-align: right;
}

@keyframes connection-banner-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.icon-button {
  display: grid;
  width: 41px;
  height: 41px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-500);
  transition: 160ms ease;
}

.icon-button:hover {
  border-color: var(--mint-300);
  background: var(--mint-100);
  color: var(--brand-700);
}

.notification-button {
  position: relative;
}

.notification-button::after {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 5px;
  height: 5px;
  border: 2px solid var(--canvas);
  border-radius: 50%;
  background: var(--brand-500);
  content: '';
}

.page-body {
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px 38px 42px;
}

.mobile-header {
  display: none;
}

.page-topline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}

.page-title-wrap {
  display: grid;
  gap: 6px;
}

.page-title-wrap .eyebrow {
  color: var(--brand-600);
  font-size: 10px;
  font-weight: 800;
}

.page-title-wrap h1 {
  margin: 0;
  color: var(--ink-950);
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -0.9px;
}

.page-title-wrap p {
  margin: 0;
  color: var(--ink-500);
  font-size: 12px;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-500);
  font-size: 11px;
  padding: 9px 12px;
}

.date-pill .icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
  color: var(--brand-600);
}

.mail-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.mail-toolbar {
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
}

.toolbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.toolbar-title h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 14px;
  font-weight: 850;
}

.toolbar-title span {
  display: inline-flex;
  min-width: 21px;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--mint-100);
  color: var(--brand-700);
  font-size: 10px;
  font-weight: 800;
  padding: 0 6px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.toolbar-actions .icon-button {
  width: 33px;
  height: 33px;
  border-color: transparent;
  background: transparent;
}

.toolbar-actions .icon-button:hover {
  border-color: var(--line);
}

.bulk-divider {
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: var(--line);
}

.toolbar-actions .danger-action:hover {
  border-color: rgba(213, 87, 87, 0.22);
  background: #fff1f1;
  color: var(--danger);
}

.mail-area {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(310px, 0.78fr) minmax(0, 1.22fr);
}

.message-list {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #fbfdfc;
}

.message-list-header {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-400);
  font-size: 10px;
  padding: 0 15px;
}

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

.select-all input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--brand-600);
}

.message-list-header button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--ink-400);
  font-size: 10px;
}

.message-list-header button:hover {
  color: var(--brand-700);
}

.message-row {
  position: relative;
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  padding: 15px 16px 14px;
  transition: 160ms ease;
}

.message-row:hover {
  background: #f4fbf7;
}

.message-row.is-selected {
  background: var(--mint-100);
  box-shadow: inset -3px 0 0 var(--brand-600);
}

.message-row.is-checked {
  background: #f2faf5;
  box-shadow: inset 3px 0 0 var(--brand-500);
}

.message-select {
  position: relative;
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  cursor: pointer;
}

.message-select input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.message-select span {
  display: block;
  width: 15px;
  height: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  transition: 140ms ease;
}

.message-select input:checked + span {
  border-color: var(--brand-600);
  background: var(--brand-600);
  box-shadow: inset 0 0 0 3px var(--surface);
}

.message-select input:focus-visible + span {
  outline: 3px solid rgba(21, 148, 99, 0.2);
  outline-offset: 2px;
}

.message-row.is-unread .message-sender,
.message-row.is-unread .message-subject {
  color: var(--ink-950);
  font-weight: 850;
}

.message-row-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.sender-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 10px;
  background: var(--avatar, var(--mint-200));
  color: var(--avatar-text, var(--brand-800));
  font-size: 10px;
  font-weight: 850;
}

.message-sender-wrap {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.message-sender {
  overflow: hidden;
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-time {
  flex: 0 0 auto;
  color: var(--ink-400);
  direction: ltr;
  font-size: 9px;
}

.message-row-middle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.message-subject {
  overflow: hidden;
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-indicator {
  display: inline-flex;
  margin-right: 6px;
  color: var(--brand-600);
  vertical-align: middle;
}

.message-star {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #b2beb8;
}

.message-star:hover,
.message-star.is-starred {
  color: #d18a22;
}

.message-star.is-starred svg {
  fill: currentColor;
}

.message-preview-line {
  overflow: hidden;
  color: var(--ink-400);
  font-size: 10px;
  line-height: 1.7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-labels {
  display: flex;
  gap: 5px;
  min-height: 17px;
}

.label-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  background: var(--mint-100);
  color: var(--brand-700);
  font-size: 8px;
  padding: 3px 6px;
}

.empty-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: var(--ink-400);
  padding: 34px 20px;
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  width: 55px;
  height: 55px;
  place-items: center;
  border-radius: 18px;
  background: var(--mint-100);
  color: var(--brand-600);
}

.empty-state strong {
  color: var(--ink-600);
  font-size: 12px;
}

.empty-state span {
  max-width: 230px;
  font-size: 10px;
  line-height: 1.8;
}

.message-preview {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.preview-empty {
  display: grid;
  min-height: 100%;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--ink-400);
  padding: 50px;
  text-align: center;
}

.preview-empty .preview-empty-graphic {
  position: relative;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border-radius: 27px;
  background: var(--mint-100);
  color: var(--brand-600);
}

.preview-empty .preview-empty-graphic::after {
  position: absolute;
  inset: -9px;
  border: 1px dashed var(--mint-300);
  border-radius: 33px;
  content: '';
}

.preview-empty strong {
  color: var(--ink-600);
  font-size: 13px;
}

.preview-empty span {
  max-width: 230px;
  font-size: 10px;
  line-height: 1.9;
}

.preview-header {
  display: grid;
  gap: 17px;
  border-bottom: 1px solid var(--line);
  padding: 23px 25px 20px;
}

.preview-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preview-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}

.preview-tools .icon-button {
  width: 31px;
  height: 31px;
  border-color: transparent;
  background: transparent;
}

.preview-tools .icon-button:hover {
  border-color: var(--line);
}

.preview-subject {
  margin: 0;
  color: var(--ink-950);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.4px;
  line-height: 1.55;
}

.preview-meta {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.preview-meta .sender-avatar {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 12px;
  font-size: 12px;
}

.preview-sender-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.preview-sender-copy strong {
  overflow: hidden;
  color: var(--ink-800);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-sender-copy span {
  overflow: hidden;
  color: var(--ink-400);
  direction: ltr;
  font-size: 10px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-date {
  margin-right: auto;
  color: var(--ink-400);
  direction: ltr;
  font-size: 10px;
  white-space: nowrap;
}

.preview-content {
  flex: 1;
  overflow: auto;
  padding: 27px 29px 32px;
}

.preview-content p {
  max-width: 680px;
  margin: 0;
  color: var(--ink-800);
  font-size: 13px;
  line-height: 2.3;
  white-space: pre-wrap;
}

.preview-attachments {
  display: grid;
  gap: 9px;
  margin-top: 29px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.attachment-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 750;
}

.attachment-section-title .icon {
  color: var(--brand-600);
}

.attachment-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 8px;
}

.attachment-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 9px 10px;
  transition: 160ms ease;
}

.attachment-card:hover {
  border-color: var(--mint-300);
  background: var(--mint-100);
  transform: translateY(-1px);
}

.attachment-card-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 9px;
  background: var(--surface);
  color: var(--brand-600);
}

.attachment-card-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.attachment-card-copy strong,
.attachment-card-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-card-copy strong {
  color: var(--ink-700);
  font-size: 10px;
}

.attachment-card-copy small {
  color: var(--ink-400);
  font-size: 8px;
}

.attachment-card-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
}

.attachment-action-button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--brand-700);
  cursor: pointer;
  font-size: 8px;
  font-weight: 750;
  padding: 0 6px;
  transition: 160ms ease;
}

.attachment-action-button:hover {
  border-color: var(--mint-300);
  background: var(--surface);
}

.attachment-action-button .icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink-600);
  font-size: 10px;
  padding: 8px 10px;
}

.attachment-chip .icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  color: var(--brand-600);
}

/* Compose */

.modal-backdrop {
  position: fixed;
  z-index: 50;
  display: grid;
  inset: 0;
  place-items: center;
  background: rgba(4, 27, 18, 0.48);
  backdrop-filter: blur(5px);
  padding: 20px;
  animation: fade-in 180ms ease both;
}

.compose-modal {
  display: flex;
  width: min(650px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(218, 241, 228, 0.5);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 100px rgba(0, 25, 16, 0.28);
  animation: modal-in 250ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.compose-header {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #fff, var(--mint-100));
  padding: 0 20px;
}

.compose-header-copy {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compose-header-copy > div {
  display: grid;
  gap: 3px;
}

.compose-header-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--brand-700);
  color: #fff;
}

.compose-header-copy .icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--brand-700);
  color: #fff;
}

.compose-header-copy strong {
  color: var(--ink-950);
  font-size: 13px;
}

.compose-autosave-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-400);
  font-size: 9px;
  font-weight: 500;
}

.compose-autosave-status .icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
  color: var(--brand-600);
}

.compose-header .icon-button {
  width: 31px;
  height: 31px;
  border-color: transparent;
  background: transparent;
}

.compose-form {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-color: var(--mint-300) transparent;
  scrollbar-width: thin;
  padding: 17px 21px 20px;
}

.compose-line {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.compose-line label {
  min-width: 55px;
  color: var(--ink-400);
  font-size: 11px;
}

.recipient-line {
  align-items: flex-start;
  min-height: 51px;
  padding: 6px 0;
}

.recipient-line > label {
  flex: 0 0 85px;
  padding-top: 7px;
}

.recipient-field {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.recipient-chips {
  display: flex;
  min-height: 31px;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.recipient-chips input {
  min-width: 130px;
  flex: 1 1 145px;
  min-height: 30px;
}

.recipient-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--mint-300);
  border-radius: 999px;
  background: var(--mint-100);
  color: var(--brand-800);
  font-size: 10px;
  padding: 5px 7px 5px 5px;
}

.recipient-chip button {
  display: grid;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-500);
}

.recipient-chip button:hover {
  background: rgba(213, 87, 87, 0.12);
  color: var(--danger);
}

.recipient-hint,
.attachment-hint {
  color: var(--ink-400);
  font-size: 8px;
}

.compose-recipient-options {
  min-height: 28px;
  border-bottom: 1px solid var(--line);
  padding: 2px 0 7px 95px;
}

.compose-recipient-options .text-button {
  font-size: 10px;
}

.compose-line input,
.compose-line textarea {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.compose-line input::placeholder,
.compose-line textarea::placeholder {
  color: #a9b6af;
}

.compose-subject input {
  font-weight: 700;
}

.compose-body {
  min-height: 220px;
  align-items: flex-start;
  padding-top: 16px;
}

.compose-body textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 2;
}

.compose-editor-shell {
  display: grid;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.compose-editor-toolbar {
  display: flex;
  min-height: 38px;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 4px 6px;
}

.compose-tool-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.compose-tool-divider {
  width: 1px;
  height: 21px;
  margin: 0 2px;
  background: var(--line);
}

.compose-tool,
.compose-block-select {
  display: inline-grid;
  min-width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  outline: 0;
  background: transparent;
  color: var(--ink-600);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  transition: 150ms ease;
}

.compose-tool:hover,
.compose-tool:focus-visible,
.compose-block-select:hover,
.compose-block-select:focus-visible {
  border-color: var(--mint-300);
  background: var(--mint-100);
  color: var(--brand-700);
}

.compose-tool-letter {
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.compose-block-select {
  min-width: 82px;
  color: var(--ink-500);
  cursor: pointer;
  font-size: 9px;
}

.compose-editor {
  min-height: 220px;
  overflow-y: auto;
  outline: 0;
  color: var(--ink-800);
  font-size: 12px;
  line-height: 2;
  padding: 11px 13px;
  text-align: start;
  unicode-bidi: plaintext;
  overflow-wrap: anywhere;
}

.compose-editor:empty::before {
  color: var(--ink-400);
  content: 'پیام خود را بنویسید…';
  pointer-events: none;
}

.compose-editor h1,
.compose-editor h2,
.compose-editor h3,
.compose-editor h4,
.compose-editor h5,
.compose-editor h6,
.compose-editor p,
.compose-editor div,
.compose-editor blockquote,
.compose-editor pre {
  margin: 0 0 7px;
}

.compose-editor blockquote {
  border-inline-start: 3px solid var(--mint-300);
  color: var(--ink-500);
  padding-inline-start: 10px;
}

.compose-editor pre {
  overflow-x: auto;
  border-radius: 7px;
  background: var(--surface-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.7;
  padding: 8px 10px;
  white-space: pre-wrap;
}

.compose-editor-source {
  display: none !important;
}

.compose-attachment-line {
  align-items: flex-start;
  min-height: 0;
  padding: 13px 0 4px;
}

.compose-attachment-line > label {
  flex: 0 0 85px;
  padding-top: 8px;
}

.attachment-area {
  display: grid;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.compose-attachment-list {
  display: grid;
  gap: 6px;
}

.compose-attachment {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  padding: 5px 7px;
}

.attachment-file-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 7px;
  background: var(--mint-100);
  color: var(--brand-600);
}

.compose-attachment-copy {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.compose-attachment-copy strong {
  overflow: hidden;
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-attachment-copy small {
  color: var(--ink-400);
  font-size: 8px;
}

.compose-attachment .icon-button {
  width: 26px;
  height: 26px;
  border-color: transparent;
  background: transparent;
}

.attachment-empty {
  color: var(--ink-400);
  font-size: 9px;
}

.attachment-picker {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  border: 1px dashed var(--mint-300);
  border-radius: 8px;
  background: var(--mint-100);
  color: var(--brand-700);
  cursor: pointer;
  font-size: 10px;
  padding: 0 9px;
}

.attachment-picker:hover {
  border-color: var(--brand-500);
  background: var(--mint-200);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 16px;
}

.compose-footer-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-400);
  font-size: 10px;
}

.compose-footer-note .icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
  color: var(--brand-600);
}

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

.secondary-button,
.send-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  padding: 0 13px;
  font-size: 11px;
  font-weight: 800;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-600);
}

.secondary-button:hover {
  border-color: var(--mint-300);
  background: var(--mint-100);
  color: var(--brand-700);
}

.send-button {
  background: var(--brand-700);
  color: #fff;
}

.send-button:hover {
  background: var(--brand-800);
}

.send-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

/* Command palette */

.command-backdrop {
  z-index: 70;
  align-items: flex-start;
  padding-top: clamp(70px, 14vh, 150px);
}

.command-modal {
  display: grid;
  width: min(570px, 100%);
  max-height: min(620px, calc(100vh - 100px));
  gap: 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(0, 25, 16, 0.28);
  padding: 19px;
  animation: modal-in 250ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.command-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.command-heading h2 {
  margin: 4px 0 0;
  color: var(--ink-950);
  font-size: 17px;
  font-weight: 850;
}

.command-heading .eyebrow {
  color: var(--brand-600);
  font-size: 9px;
  font-weight: 800;
}

.command-heading .icon-button {
  width: 31px;
  height: 31px;
  border-color: transparent;
  background: transparent;
}

.command-search {
  display: flex;
  min-height: 45px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--ink-400);
  padding: 0 13px;
}

.command-search:focus-within {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(50, 173, 122, 0.09);
}

.command-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.command-list {
  display: grid;
  max-height: 370px;
  gap: 4px;
  overflow-y: auto;
  padding-left: 2px;
  scrollbar-color: var(--mint-300) transparent;
  scrollbar-width: thin;
}

.command-item {
  display: flex;
  min-height: 47px;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-800);
  font-size: 11px;
  text-align: right;
  padding: 0 8px;
}

.command-item:hover {
  background: var(--mint-100);
  color: var(--brand-800);
}

.command-item-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--brand-600);
}

.command-item kbd,
.command-footer kbd {
  margin-right: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--ink-400);
  direction: ltr;
  font-family: inherit;
  font-size: 8px;
  padding: 4px 6px;
}

.command-empty {
  color: var(--ink-400);
  font-size: 11px;
  padding: 26px 10px;
  text-align: center;
}

.command-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  border-top: 1px solid var(--line);
  color: var(--ink-400);
  font-size: 9px;
  padding-top: 13px;
}

.command-footer .icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

/* Settings */

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

.settings-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.settings-card h3 {
  margin: 0 0 8px;
  color: var(--ink-950);
  font-size: 14px;
}

.settings-card > p {
  margin: 0 0 20px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.8;
}

.settings-card textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: 0;
  background: var(--surface-soft);
  font-size: 12px;
  line-height: 2;
  padding: 12px;
  resize: vertical;
}

.settings-card textarea:focus {
  border-color: var(--mint-300);
  box-shadow: 0 0 0 4px rgba(50, 173, 122, 0.08);
}

.settings-save {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  border-radius: 10px;
  background: var(--brand-700);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 0 13px;
}

.settings-save:hover {
  background: var(--brand-800);
}

.setting-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row-copy {
  display: grid;
  gap: 4px;
}

.setting-row-copy strong {
  color: var(--ink-800);
  font-size: 11px;
}

.setting-row-copy span {
  color: var(--ink-400);
  font-size: 10px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  align-items: center;
  border-radius: 999px;
  background: #dce7e0;
  cursor: pointer;
  transition: 160ms ease;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch::after {
  width: 16px;
  height: 16px;
  margin: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(20, 64, 42, 0.15);
  content: '';
  transition: 160ms ease;
}

.switch:has(input:checked) {
  background: var(--brand-600);
}

.switch:has(input:checked)::after {
  transform: translateX(-16px);
}

/* Toast / loading */

.toast-stack {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 9px;
  width: min(330px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(8, 49, 32, 0.16);
  color: var(--ink-700);
  font-size: 11px;
  line-height: 1.75;
  padding: 12px 13px;
  animation: toast-in 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toast.success .toast-icon {
  background: var(--mint-100);
  color: var(--brand-700);
}

.toast.error .toast-icon {
  background: #fff1f1;
  color: var(--danger);
}

.toast-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 8px;
}

.loading-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--canvas);
}

.loading-mark {
  display: grid;
  place-items: center;
  gap: 14px;
  color: var(--ink-500);
  font-size: 11px;
}

.loading-mark .logo-box {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
  border-radius: 17px;
  animation: pulse 1.4s ease-in-out infinite;
}

/* Dark theme */

body[data-theme='dark'] {
  --ink-950: #ecf8f1;
  --ink-800: #d1e5da;
  --ink-600: #a3bcaf;
  --ink-500: #89a397;
  --ink-400: #6b8779;
  --line: #203b2e;
  --line-strong: #2b4e3d;
  --surface: #11281e;
  --surface-soft: #0e2119;
  --canvas: #091b13;
  --mint-100: #143c2a;
  --mint-200: #1a4c35;
  --mint-300: #246445;
}

body[data-theme='dark'] .app-sidebar,
body[data-theme='dark'] .message-preview,
body[data-theme='dark'] .login-card,
body[data-theme='dark'] .compose-modal,
body[data-theme='dark'] .command-modal,
body[data-theme='dark'] .filter-panel,
body[data-theme='dark'] .toast,
body[data-theme='dark'] .mail-card,
body[data-theme='dark'] .settings-card {
  background: var(--surface);
}

body[data-theme='dark'] .desktop-header {
  background: rgba(9, 27, 19, 0.86);
}

body[data-theme='dark'] .message-list {
  background: #0e2119;
}

body[data-theme='dark'] .message-row:hover {
  background: #143524;
}

body[data-theme='dark'] .search-box input,
body[data-theme='dark'] .icon-button,
body[data-theme='dark'] .date-pill,
body[data-theme='dark'] .secondary-button,
body[data-theme='dark'] .settings-card textarea,
body[data-theme='dark'] .filter-grid input,
body[data-theme='dark'] .command-search,
body[data-theme='dark'] .compose-attachment,
body[data-theme='dark'] .command-item-icon {
  background: #0e2119;
}

body[data-theme='dark'] .sync-control {
  background: rgba(14, 33, 25, 0.86);
}

body[data-theme='dark'] .connection-banner {
  border-color: #7e3b3b;
  background: #321b1b;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .32);
}

body[data-theme='dark'] .connection-banner-icon {
  background: #4a2525;
  color: #ff9b9b;
}

body[data-theme='dark'] .connection-banner-copy strong {
  color: #ffb0b0;
}

body[data-theme='dark'] .connection-banner-copy span {
  color: #e8a1a1;
}

body[data-theme='dark'] .message-row.is-checked {
  background: #143524;
}

body[data-theme='dark'] .recipient-chip,
body[data-theme='dark'] .attachment-picker {
  background: var(--mint-100);
}

body[data-theme='dark'] .compose-header {
  background: linear-gradient(90deg, var(--surface), #143c2a);
}

body[data-theme='dark'] .input-wrap input {
  background: #f5faf7;
}

/* Motion */

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 5px 18px rgba(17, 124, 79, 0.12); transform: scale(1); }
  50% { box-shadow: 0 8px 26px rgba(17, 124, 79, 0.23); transform: scale(1.03); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes sync-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes notification-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(204, 61, 78, 0); }
  45% { box-shadow: 0 0 0 4px rgba(204, 61, 78, 0.14); }
}

@keyframes page-switch-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes page-content-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-transition-enter {
  animation: page-switch-in 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}

.page-transition-enter .mail-card,
.page-transition-enter .settings-card {
  animation: page-content-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page-transition-enter .mail-card { animation-delay: 80ms; }
.page-transition-enter .settings-card:nth-child(2) { animation-delay: 70ms; }

@media (min-width: 721px) {
  html,
  body,
  #app {
    height: 100%;
    min-height: 0;
  }

  body {
    overflow: hidden;
  }

  .app-shell {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .app-sidebar {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .app-main {
    display: flex;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
  }

  .desktop-header {
    flex: 0 0 82px;
  }

  .page-body {
    display: flex;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--mint-300) transparent;
    scrollbar-width: thin;
  }

  .page-topline {
    flex: 0 0 auto;
  }

  .mail-card {
    display: flex;
    min-height: 320px;
    flex: 1 1 auto;
    flex-direction: column;
  }

  .mail-toolbar {
    flex: 0 0 67px;
  }

  .mail-area {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .message-list,
  .message-preview {
    min-height: 0;
  }

  .message-preview .preview-content {
    min-height: 0;
  }
}

@media (min-width: 721px) and (max-height: 760px) {
  .app-sidebar {
    padding: 18px 14px 12px;
  }

  .sidebar-brand {
    padding-bottom: 18px;
  }

  .compose-button {
    min-height: 42px;
  }

  .sidebar-section-label {
    margin-top: 16px;
    margin-bottom: 7px;
  }

  .sidebar-nav {
    gap: 2px;
  }

  .sidebar-nav button {
    min-height: 35px;
  }

  .nav-icon {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
  }

  .sidebar-footer {
    padding-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1150px) {
  .app-shell {
    grid-template-columns: minmax(220px, var(--sidebar-width, 266px)) minmax(0, 1fr);
  }

  .desktop-header,
  .page-body {
    padding-right: 25px;
    padding-left: 25px;
  }

  .mail-area {
    grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  }

  .search-zone {
    width: min(330px, 32vw);
  }

  .sync-control > span:not(.sync-dot) {
    display: none;
  }

  .sync-control {
    gap: 4px;
    padding-right: 5px;
  }
}

@media (min-width: 721px) and (max-width: 1350px) {
  .search-zone {
    width: min(320px, 30vw);
  }

  .sync-control > span:not(.sync-dot) {
    display: none;
  }

  .sync-control {
    gap: 4px;
    padding-right: 5px;
  }
}

@media (max-width: 900px) {
  .login-page {
    padding: 18px;
  }

  .login-shell {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 330px;
    padding: 27px 28px 23px;
  }

  .login-brand-content {
    display: block;
    padding: 35px 0 20px;
  }

  .login-brand-content h1 {
    max-width: 600px;
    font-size: 32px;
  }

  .login-brand-content p {
    max-width: 570px;
  }

  .login-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 22px;
  }

  .login-brand-footer {
    margin-top: 12px;
  }

  .login-card {
    min-height: 430px;
    padding: 43px 28px 48px;
  }

  .header-greeting span {
    display: none;
  }

  .header-greeting strong {
    font-size: 14px;
  }
}

@media (max-width: 720px) {
  .connection-banner {
    top: 10px;
    width: calc(100vw - 20px);
  }

  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, calc(100vw - 52px));
    min-height: 100vh;
    border-left: 1px solid var(--line);
    box-shadow: -20px 0 60px rgba(5, 32, 20, 0.16);
    transform: translateX(110%);
    transition: transform 220ms ease;
  }

  .app-shell.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-open::after {
    position: fixed;
    z-index: 9;
    inset: 0;
    background: rgba(3, 25, 16, 0.34);
    content: '';
  }

  .desktop-header {
    display: none;
  }

  .mobile-header {
    display: flex;
    min-height: 67px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(242, 247, 244, 0.88);
    padding: 0 16px;
  }

  body[data-theme='dark'] .mobile-header {
    background: rgba(9, 27, 19, 0.88);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
  }

  .mobile-brand .logo-box {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 10px;
  }

  .mobile-brand .logo-box img {
    padding: 5px;
  }

  .mobile-brand strong {
    color: var(--brand-900);
    font-size: 13px;
  }

  body[data-theme='dark'] .mobile-brand strong {
    color: var(--ink-950);
  }

  .mobile-header-actions {
    display: flex;
    gap: 7px;
  }

  .mobile-header .icon-button {
    width: 35px;
    height: 35px;
    background: transparent;
  }

  .page-body {
    padding: 22px 14px 35px;
  }

  .page-topline {
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .page-title-wrap h1 {
    font-size: 22px;
  }

  .date-pill {
    display: none;
  }

  .mail-card {
    border-radius: 14px;
  }

  .mail-toolbar {
    min-height: 59px;
    padding: 0 13px;
  }

  .toolbar-actions {
    max-width: 64%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .toolbar-actions::-webkit-scrollbar {
    display: none;
  }

  .mail-area {
    display: block;
    min-height: 0;
  }

  .message-list {
    border-left: 0;
  }

  .message-list.is-hidden-mobile {
    display: none;
  }

  .message-preview {
    min-height: 480px;
  }

  .message-preview.is-hidden-mobile {
    display: none;
  }

  .preview-header {
    padding: 18px 16px 16px;
  }

  .preview-content {
    padding: 22px 18px 28px;
  }

  .preview-subject {
    font-size: 16px;
  }

  .preview-date {
    font-size: 9px;
  }

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

  .compose-modal {
    max-height: calc(100vh - 20px);
    border-radius: 16px;
  }

  .compose-form {
    padding: 12px 14px 15px;
  }

  .compose-header {
    padding: 0 14px;
  }

  .recipient-line > label,
  .compose-attachment-line > label {
    flex-basis: 68px;
  }

  .compose-recipient-options {
    padding-right: 78px;
    padding-left: 0;
  }

  .recipient-hint,
  .attachment-hint {
    line-height: 1.6;
  }

  .compose-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .compose-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .command-backdrop {
    padding: 12px;
    padding-top: 72px;
  }

  .command-modal {
    max-height: calc(100vh - 84px);
    padding: 14px;
  }

  .toast-stack {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 460px) {
  .login-page {
    display: block;
    min-height: 100vh;
    padding: 0;
  }

  .login-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .login-brand {
    min-height: 315px;
    padding: 25px 22px 20px;
  }

  .login-brand-content {
    padding: 30px 0 18px;
  }

  .login-brand-content h1 {
    font-size: 28px;
  }

  .login-brand-content p {
    font-size: 12px;
  }

  .highlight {
    font-size: 11px;
  }

  .login-card {
    min-height: 0;
    align-items: flex-start;
    padding: 38px 22px 40px;
  }

  .login-form-wrap h2 {
    font-size: 25px;
  }

  .form-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .message-row {
    padding-right: 12px;
    padding-left: 12px;
  }

  .compose-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .compose-actions {
    width: 100%;
  }

  .compose-actions button {
    flex: 1;
  }
}

/* Conversation, quick filters, notifications and touch affordances */

.skip-link {
  position: fixed;
  z-index: 120;
  top: 12px;
  right: 12px;
  border-radius: 9px;
  background: var(--brand-800);
  box-shadow: var(--shadow-md);
  color: #fff;
  font-size: 11px;
  padding: 9px 13px;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.notification-button::after {
  display: none;
}

.notification-button.has-notifications::after {
  display: block;
}

.notification-button.is-open,
.notification-button[aria-expanded='true'] {
  border-color: var(--mint-300);
  background: var(--mint-100);
  color: var(--brand-700);
}

.notification-button.has-notifications .notification-badge {
  animation: notification-badge-pulse 2.4s ease-in-out infinite;
}

.notification-badge {
  position: absolute;
  top: -4px;
  left: -5px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  border: 2px solid var(--canvas);
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 8px;
  font-weight: 850;
  line-height: 1;
}

.quick-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: -7px 0 16px;
}

.quick-filter-label {
  margin-left: 3px;
  color: var(--ink-400);
  font-size: 10px;
  font-weight: 700;
}

.quick-filter {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-500);
  font-size: 10px;
  padding: 0 10px;
  transition: 160ms ease;
}

.quick-filter:hover,
.quick-filter.is-active {
  border-color: var(--mint-300);
  background: var(--mint-100);
  color: var(--brand-700);
}

.quick-filter.is-active {
  box-shadow: 0 0 0 2px rgba(50, 173, 122, 0.08);
  font-weight: 800;
}

.quick-filter .icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.quick-filter-settings {
  margin-right: auto;
  border-style: dashed;
}

.saved-filters-section {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.saved-filters-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.saved-filters-heading div {
  display: grid;
  gap: 3px;
}

.saved-filters-heading strong {
  color: var(--ink-800);
  font-size: 11px;
}

.saved-filters-heading span,
.saved-filter-empty {
  color: var(--ink-400);
  font-size: 9px;
}

.saved-filter-save {
  display: flex;
  align-items: center;
  gap: 6px;
}

.saved-filter-save input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  background: var(--surface-soft);
  font-size: 10px;
  padding: 0 9px;
}

.saved-filter-save input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(50, 173, 122, 0.09);
}

.saved-filter-save .icon-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-color: var(--mint-300);
  background: var(--mint-100);
  color: var(--brand-700);
}

.saved-filter-list {
  display: grid;
  gap: 4px;
  max-height: 128px;
  overflow-y: auto;
  scrollbar-color: var(--mint-300) transparent;
  scrollbar-width: thin;
}

.saved-filter-item {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.saved-filter-apply {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-600);
  font-size: 10px;
  text-align: right;
  padding: 6px 7px;
}

.saved-filter-apply:hover {
  background: var(--mint-100);
  color: var(--brand-700);
}

.saved-filter-apply > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-filter-dot {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  place-items: center;
  border-radius: 7px;
  background: var(--mint-100);
  color: var(--brand-600);
}

.saved-filter-dot .icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}

.saved-filter-delete {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-400);
}

.saved-filter-delete:hover {
  background: #fff1f1;
  color: var(--danger);
}

.thread-stack {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.thread-message {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  transition: 180ms ease;
}

.thread-message.is-expanded {
  border-color: var(--mint-300);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(9, 58, 39, 0.05);
}

.thread-message-head {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 9px;
  background: transparent;
  color: var(--ink-600);
  padding: 11px 12px;
  text-align: right;
}

.thread-message-head:hover {
  background: var(--mint-100);
}

.thread-message-head .sender-avatar {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 9px;
}

.thread-message-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.thread-message-copy strong,
.thread-message-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-message-copy strong {
  color: var(--ink-800);
  font-size: 11px;
}

.thread-message-copy span,
.thread-message-head time {
  color: var(--ink-400);
  direction: ltr;
  font-size: 9px;
  text-align: right;
}

.thread-message-head time {
  flex: 0 0 auto;
  white-space: nowrap;
}

.thread-message-chevron {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 7px;
  color: var(--ink-400);
}

.thread-message-body {
  border-top: 1px solid var(--line);
  padding: 17px 18px 20px;
}

.thread-message-body p {
  max-width: none;
}

.thread-message-summary {
  display: block;
  width: 100%;
  overflow: hidden;
  background: transparent;
  color: var(--ink-400);
  font-size: 10px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 52px 13px;
}

.thread-message-summary:hover {
  color: var(--brand-700);
}

.thread-loading {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--ink-400);
  font-size: 10px;
}

.thread-loading .icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
  animation: spin 1s linear infinite;
}

.thread-count {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border-radius: 6px;
  background: var(--mint-100);
  color: var(--brand-700);
  font-size: 8px;
  font-weight: 850;
  vertical-align: middle;
}

.inline-reply-collapsed {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 760px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.inline-reply-collapsed > span {
  color: var(--ink-400);
  font-size: 9px;
}

.inline-reply-trigger {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--mint-300);
  border-radius: 10px;
  background: var(--mint-100);
  color: var(--brand-700);
  font-size: 10px;
  font-weight: 800;
  padding: 0 12px;
}

.inline-reply-trigger:hover {
  background: var(--mint-200);
}

.inline-reply {
  display: grid;
  max-width: 760px;
  gap: 12px;
  margin-top: 24px;
  border: 1px solid var(--mint-300);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 13px;
}

.inline-reply-heading,
.inline-reply-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inline-reply-heading strong {
  color: var(--ink-800);
  font-size: 11px;
}

.inline-reply-heading .icon-button {
  width: 27px;
  height: 27px;
  border-color: transparent;
  background: transparent;
}

.inline-reply textarea {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  background: var(--surface);
  color: var(--ink-800);
  font-size: 11px;
  line-height: 2;
  padding: 10px 11px;
  resize: vertical;
}

.inline-reply textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(50, 173, 122, 0.09);
}

.inline-reply-footer > span {
  overflow: hidden;
  color: var(--ink-400);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-reply-footer .send-button {
  min-height: 34px;
  flex: 0 0 auto;
  font-size: 10px;
}

.notifications-panel {
  position: fixed;
  z-index: 45;
  top: 76px;
  left: 24px;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  max-height: min(570px, calc(100vh - 100px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 24px 65px rgba(9, 58, 39, 0.2);
  animation: modal-in 190ms ease both;
}

.notifications-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 15px 16px 13px;
}

.notifications-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.notifications-heading .eyebrow {
  color: var(--brand-600);
  font-size: 9px;
  font-weight: 800;
}

.notifications-heading h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 15px;
  font-weight: 850;
}

.notifications-heading-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.notifications-heading-actions .text-button {
  font-size: 9px;
}

.notifications-heading-actions .text-button:disabled {
  cursor: default;
  color: var(--ink-400);
  text-decoration: none;
}

.notifications-heading-actions .icon-button {
  width: 28px;
  height: 28px;
  border-color: transparent;
  background: transparent;
}

.notifications-list {
  min-height: 80px;
  overflow-y: auto;
  scrollbar-color: var(--mint-300) transparent;
  scrollbar-width: thin;
}

.notification-item {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink-600);
  padding: 12px 14px;
  text-align: right;
  transition: 160ms ease;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item:hover,
.notification-item.is-unread {
  background: var(--mint-100);
}

.notification-item-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  border-radius: 9px;
  background: var(--surface);
  color: var(--brand-600);
}

.notification-item-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 4px;
}

.notification-item-copy strong,
.notification-item-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-item-copy strong {
  color: var(--ink-800);
  font-size: 10px;
}

.notification-item-copy span {
  color: var(--ink-500);
  font-size: 9px;
}

.notification-item-copy time {
  color: var(--ink-400);
  font-size: 8px;
}

.notification-unread-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--brand-600);
}

.notification-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: var(--ink-400);
  font-size: 10px;
}

.message-row:focus-visible,
.thread-message-head:focus-visible,
.thread-message-summary:focus-visible,
.notification-item:focus-visible,
.quick-filter:focus-visible,
.saved-filter-apply:focus-visible,
.saved-filter-delete:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(21, 148, 99, 0.25);
  outline-offset: -2px;
}

body[data-theme='dark'] .quick-filter,
body[data-theme='dark'] .notifications-panel,
body[data-theme='dark'] .thread-message,
body[data-theme='dark'] .inline-reply,
body[data-theme='dark'] .saved-filter-save input,
body[data-theme='dark'] .inline-reply textarea {
  background: var(--surface);
}

body[data-theme='dark'] .thread-message.is-expanded,
body[data-theme='dark'] .inline-reply {
  border-color: var(--mint-300);
}

body[data-theme='dark'] .thread-message-head:hover,
body[data-theme='dark'] .notification-item:hover,
body[data-theme='dark'] .notification-item.is-unread {
  background: var(--mint-100);
}

body[data-theme='dark'] .notification-item-icon {
  background: var(--surface-soft);
}

@media (max-width: 720px) {
  .mobile-header {
    position: relative;
  }

  .mobile-filter-panel {
    z-index: 30;
    top: calc(100% + 8px);
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
  }

  .quick-filter-bar {
    flex-wrap: nowrap;
    margin: -4px 0 13px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .quick-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .quick-filter-label {
    flex: 0 0 auto;
  }

  .quick-filter {
    flex: 0 0 auto;
  }

  .quick-filter-settings {
    margin-right: 0;
  }

  .notifications-panel {
    top: 75px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 94px);
  }

  .thread-message-head time {
    display: none;
  }

  .inline-reply-collapsed {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-reply-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-reply-footer .send-button {
    width: 100%;
  }

  .filter-panel {
    max-height: calc(100vh - 88px);
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thread-loading .icon {
    animation: none;
  }
}

/* Minimal message list and focused full-page message mode */

.mail-list-area {
  display: block;
}

.mail-list-area .message-list {
  height: 100%;
  border-left: 0;
}

.message-list-caption {
  color: var(--ink-400);
  font-size: 9px;
}

.message-row {
  gap: 3px;
  padding: 8px 14px 7px;
}

.message-row-top {
  gap: 7px;
}

.message-row .sender-avatar {
  width: 27px;
  height: 27px;
  flex-basis: 27px;
  border-radius: 8px;
  font-size: 9px;
}

.message-sender {
  font-size: 10px;
}

.message-time {
  font-size: 8px;
}

.message-row-middle {
  min-height: 17px;
  gap: 6px;
}

.message-subject {
  font-size: 10px;
}

.message-star {
  width: 19px;
  height: 19px;
  flex-basis: 19px;
}

.message-list-header {
  min-height: 38px;
  padding: 0 14px;
}

.message-page-topline {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.message-page-topline .page-title-wrap {
  min-width: 0;
}

.message-page-topline .page-title-wrap h1 {
  overflow: hidden;
  max-width: min(850px, 70vw);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-page-topline .page-title-wrap p {
  overflow: hidden;
  max-width: 780px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-to-list {
  display: inline-flex;
  min-height: 35px;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-600);
  font-size: 10px;
  padding: 0 10px;
  transition: 160ms ease;
}

.back-to-list:hover {
  border-color: var(--mint-300);
  background: var(--mint-100);
  color: var(--brand-700);
}

.message-page-card {
  display: flex;
  min-height: 320px;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.message-page-card .preview-header {
  flex: 0 0 auto;
  padding: 20px 28px 17px;
}

.message-page-card .preview-content {
  min-height: 0;
  overflow-y: auto;
  padding: 25px 30px 34px;
  scrollbar-color: var(--mint-300) transparent;
  scrollbar-width: thin;
}

.message-page-card .preview-tools {
  flex-wrap: wrap;
}

.message-page-card .preview-back {
  display: none;
}

body[data-theme='dark'] .back-to-list {
  background: var(--surface);
}

@media (max-width: 720px) {
  .message-page-body {
    padding-top: 18px;
  }

  .message-page-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .message-page-topline .page-title-wrap h1,
  .message-page-topline .page-title-wrap p {
    max-width: calc(100vw - 28px);
  }

  .back-to-list {
    min-height: 32px;
  }

  .message-page-card {
    min-height: calc(100dvh - 155px);
    border-radius: 14px;
  }

  .message-page-card .preview-header {
    padding: 15px 15px 14px;
  }

  .message-page-card .preview-content {
    padding: 20px 16px 28px;
  }

  .message-page-card .preview-tools .icon-button {
    width: 29px;
    height: 29px;
  }

  .message-row {
    padding-right: 11px;
    padding-left: 11px;
  }

  .message-list-caption {
    display: none;
  }
}

@media print {
  body {
    background: #fff !important;
  }

  .app-sidebar,
  .desktop-header,
  .mobile-header,
  .message-page-topline,
  .preview-tools,
  .preview-back,
  .inline-reply,
  .inline-reply-collapsed,
  .toast-stack {
    display: none !important;
  }

  .app-shell,
  .app-main,
  .message-page-body,
  .message-page-card,
  .message-page-card .preview-content {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .message-page-card .preview-header,
  .message-page-card .preview-content {
    padding: 12px 0 !important;
  }
}

/* Safe email content: preserve the source layout while keeping the reader
   itself centered and fluid like Gmail's message view. */
.message-page-card .preview-content {
  display: block;
  min-width: 0;
  background: var(--surface);
}

.email-reading-column {
  width: min(100%, 1080px);
  min-width: 0;
  margin: 0 auto;
  color: var(--ink-800);
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
}

.preview-content .email-security-note {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  margin: 0 auto 20px;
  border: 1px solid var(--mint-200);
  border-radius: 999px;
  background: var(--mint-100);
  color: var(--brand-700);
  font-size: 10px;
  line-height: 1;
  padding: 7px 10px;
}

.preview-content .email-html,
.preview-content .email-plain {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  color: inherit;
  font-size: 13px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  text-align: start;
  unicode-bidi: plaintext;
}

.preview-content .email-html,
.preview-content .email-html * {
  box-sizing: border-box;
}

.preview-content .email-html[dir='rtl'],
.preview-content .email-plain[dir='rtl'] {
  direction: rtl;
  text-align: right;
}

.preview-content .email-html[dir='ltr'],
.preview-content .email-plain[dir='ltr'] {
  direction: ltr;
  text-align: left;
}

.preview-content .email-html [dir='rtl'],
.preview-content .email-plain [dir='rtl'] {
  direction: rtl;
  text-align: right;
}

.preview-content .email-html [dir='ltr'],
.preview-content .email-plain [dir='ltr'] {
  direction: ltr;
  text-align: left;
}

.preview-content .email-plain .email-line {
  margin: 0 0 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* These rules apply only to semantic text blocks. Layout divs and table
   cells must keep their original email-client geometry. */
.preview-content .email-html > p,
.preview-content .email-html > blockquote,
.preview-content .email-html > h1,
.preview-content .email-html > h2,
.preview-content .email-html > h3,
.preview-content .email-html > h4,
.preview-content .email-html > h5,
.preview-content .email-html > h6,
.preview-content .email-html > ul,
.preview-content .email-html > ol,
.preview-content .email-html > hr {
  margin-inline: 0;
}

.preview-content .email-html p {
  margin: 0 0 14px;
}

.preview-content .email-html h1,
.preview-content .email-html h2,
.preview-content .email-html h3,
.preview-content .email-html h4,
.preview-content .email-html h5,
.preview-content .email-html h6 {
  margin: 20px 0 9px;
  color: var(--ink-900);
  line-height: 1.45;
}

.preview-content .email-html h1 { font-size: 22px; }
.preview-content .email-html h2 { font-size: 19px; }
.preview-content .email-html h3 { font-size: 16px; }
.preview-content .email-html h4,
.preview-content .email-html h5,
.preview-content .email-html h6 { font-size: 14px; }

.preview-content .email-html ul,
.preview-content .email-html ol {
  margin: 8px 0 15px;
  padding-inline-start: 25px;
}

.preview-content .email-html li {
  margin: 4px 0;
}

.preview-content .email-html a {
  color: var(--brand-700);
  text-decoration: underline;
  text-decoration-color: var(--mint-300);
  text-underline-offset: 3px;
}

.preview-content .email-html blockquote {
  margin: 13px 0;
  border-inline-start: 3px solid var(--mint-300);
  color: var(--ink-600);
  padding: 4px 13px;
}

.preview-content .email-html pre,
.preview-content .email-html code {
  direction: ltr;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.preview-content .email-html pre {
  max-width: 100%;
  overflow: auto;
  border-radius: 9px;
  background: var(--surface-soft);
  padding: 12px 14px;
  white-space: pre-wrap;
}

.preview-content .email-html code {
  border-radius: 4px;
  background: var(--surface-soft);
  padding: 2px 4px;
  font-size: .92em;
}

.preview-content .email-html pre code {
  background: transparent;
  padding: 0;
}

/* Tables are the layout engine used by most real-world email templates. Do
   not add borders, padding or 100% widths to every cell. Keep the source
   widths, then cap only the outer geometry to the reader. */
.preview-content .email-html table {
  max-width: 100%;
  margin: 0 auto;
  border-spacing: 0;
  font-size: inherit;
}

.preview-content .email-html table[width='100%'] {
  width: 100%;
}

.preview-content .email-html td,
.preview-content .email-html th {
  max-width: 100%;
  vertical-align: top;
}

.preview-content .email-html th {
  font-weight: 700;
}

.preview-content .email-html img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  object-fit: contain;
}

.preview-content .email-html hr {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .email-reading-column,
  .preview-content .email-html,
  .preview-content .email-plain {
    font-size: 12px;
  }

  .preview-content .email-html {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .preview-content .email-html table {
    max-width: 100%;
  }

  .preview-content .email-html img {
    max-width: 100%;
  }
}

/* Settings workspace */

/* Glass icon treatment: the existing local SVG set stays crisp, while the
   translucent tile, highlight and blur provide one consistent glass surface
   across the login, mail and settings experiences. */
.icon-glass {
  position: relative;
  width: var(--icon-size, 20px);
  height: var(--icon-size, 20px);
  flex: 0 0 var(--icon-size, 20px);
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .24)),
    rgba(223, 242, 232, .55);
  box-shadow: 0 4px 11px rgba(15, 66, 45, .11);
  color: var(--brand-700);
  line-height: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.icon-glass::before {
  position: absolute;
  z-index: 0;
  top: -55%;
  right: -28%;
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background: rgba(255, 255, 255, .56);
  content: '';
  pointer-events: none;
}

.icon-glass svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 3px;
  filter: drop-shadow(0 1px 1px rgba(8, 65, 42, .13));
}

body[data-theme='dark'] .icon-glass {
  background:
    linear-gradient(145deg, rgba(58, 117, 87, .42), rgba(20, 61, 43, .26)),
    rgba(14, 42, 29, .56);
  box-shadow: 0 4px 13px rgba(0, 0, 0, .24);
  color: #a8e1c1;
}

body[data-theme='dark'] .icon-glass::before {
  background: rgba(218, 255, 234, .11);
}

.settings-page {
  scrollbar-gutter: stable;
}

.settings-overview {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 16px;
  border: 1px solid var(--mint-300);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--mint-100), var(--surface));
  box-shadow: var(--shadow-sm);
  padding: 15px 17px;
}

.settings-overview-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-700);
  color: #fff;
}

.settings-overview > div:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.settings-overview strong {
  color: var(--ink-900);
  font-size: 12px;
}

.settings-overview span {
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.7;
}

.settings-overview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.settings-overview-actions .settings-save,
.settings-overview-actions .secondary-button {
  margin-top: 0;
  white-space: nowrap;
}

.settings-grid-pro {
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-card-wide {
  grid-column: 1 / -1;
}

.settings-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.settings-card-heading h3 {
  margin-bottom: 6px;
}

.settings-card-heading p {
  margin-bottom: 0;
}

.settings-form {
  display: grid;
  gap: 13px;
}

.settings-fields-2,
.settings-fields-3 {
  display: grid;
  gap: 12px;
}

.settings-fields-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-fields-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-field {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 700;
}

.settings-field input,
.settings-field textarea,
.settings-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  background: var(--surface-soft);
  color: var(--ink-900);
  font-size: 11px;
  padding: 8px 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.settings-field textarea {
  min-height: 104px;
  line-height: 1.9;
  resize: vertical;
}

.settings-field input:focus,
.settings-field textarea:focus,
.settings-field select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(50, 173, 122, 0.09);
}

.settings-field input:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.settings-field input[type='time'],
.settings-field input[type='range'],
.settings-field select,
.settings-field input[dir='ltr'] {
  direction: ltr;
  text-align: left;
}

.settings-field input[type='range'] {
  min-height: 25px;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--brand-600);
  padding: 0;
}

.settings-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.range-value {
  color: var(--brand-700);
  font-size: 10px;
  font-weight: 800;
}

.avatar-color-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.avatar-color {
  width: 27px;
  height: 27px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--picker-color);
  box-shadow: 0 0 0 1px var(--line-strong);
  padding: 0;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.avatar-color:hover {
  transform: scale(1.08);
}

.avatar-color.is-selected {
  box-shadow: 0 0 0 2px var(--brand-500), 0 0 0 5px rgba(50, 173, 122, .14);
  transform: scale(1.08);
}

.security-status {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--ink-600);
  font-size: 10px;
  line-height: 1.7;
  padding: 8px 10px;
}

.security-status > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.security-status.is-active {
  border-color: var(--mint-300);
  background: var(--mint-100);
  color: var(--brand-800);
}

.security-status .secondary-button,
.security-status .text-button {
  margin-right: auto;
  white-space: nowrap;
}

.danger-button,
.danger-action {
  color: var(--danger) !important;
}

.danger-button:hover,
.danger-action:hover {
  border-color: rgba(213, 87, 87, .32) !important;
  background: #fff1f1 !important;
}

.danger-text {
  color: var(--danger) !important;
}

.settings-divider {
  height: 1px;
  margin: 17px 0;
  background: var(--line);
}

.settings-form-title {
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 800;
}

.two-factor-setup {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  border: 1px solid var(--mint-300);
  border-radius: 13px;
  background: var(--mint-100);
  padding: 13px;
}

.two-factor-qr {
  display: grid;
  min-height: 140px;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  padding: 7px;
}

.two-factor-qr img {
  display: block;
  width: 126px;
  height: 126px;
}

.two-factor-copy {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.two-factor-copy strong {
  color: var(--ink-900);
  font-size: 11px;
}

.two-factor-copy > span {
  color: var(--ink-600);
  font-size: 10px;
  line-height: 1.8;
}

.two-factor-copy code {
  overflow: auto;
  border: 1px dashed var(--mint-300);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand-800);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 1.2px;
  padding: 8px 9px;
  white-space: nowrap;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline-actions .settings-save,
.inline-actions .secondary-button {
  margin-top: 0;
}

.direction-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--ink-600);
  font-size: 11px;
  padding: 10px 12px;
}

.time-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.signature-hint,
.empty-inline {
  color: var(--ink-400);
  font-size: 10px;
  line-height: 1.8;
}

.filter-settings-link {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  padding: 9px 11px;
}

.filter-settings-link > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.filter-settings-link strong {
  color: var(--ink-800);
  font-size: 11px;
}

.filter-settings-link span {
  color: var(--ink-400);
  font-size: 9px;
}

.filter-settings-link .secondary-button {
  flex: 0 0 auto;
  min-height: 32px;
}

.blocked-form {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(120px, 1fr) auto;
  gap: 8px;
  margin-top: 13px;
}

.blocked-form input {
  width: 100%;
  min-height: 37px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  background: var(--surface-soft);
  color: var(--ink-900);
  font-size: 10px;
  padding: 8px 10px;
}

.blocked-form input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(50, 173, 122, .09);
}

.blocked-form .settings-save {
  margin-top: 0;
  white-space: nowrap;
}

.template-list,
.blocked-list {
  display: grid;
  gap: 7px;
  margin-top: 17px;
}

.template-item,
.blocked-item {
  display: flex;
  min-height: 47px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 7px 9px;
}

.template-item > div,
.blocked-item > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.template-item strong,
.blocked-item strong {
  overflow: hidden;
  color: var(--ink-800);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-item span,
.blocked-item span {
  overflow: hidden;
  color: var(--ink-400);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blocked-item > span {
  color: var(--ink-800);
  font-size: 10px;
  font-weight: 700;
}

.blocked-item small {
  overflow: hidden;
  color: var(--ink-400);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-item .icon-button,
.blocked-item .icon-button {
  margin-right: auto;
}

.usage-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 13px;
}

.usage-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 13px;
}

.usage-stats > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  border-radius: 11px;
  background: var(--mint-100);
  padding: 10px;
}

.usage-stats strong {
  overflow: hidden;
  color: var(--brand-800);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-stats span {
  color: var(--ink-500);
  font-size: 9px;
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.data-actions .settings-save,
.data-actions .secondary-button {
  margin-top: 0;
}

.usage-stat {
  display: grid;
  gap: 3px;
  border-radius: 11px;
  background: var(--mint-100);
  padding: 11px;
}

.usage-stat strong {
  color: var(--brand-800);
  font-size: 15px;
}

.usage-stat span {
  color: var(--ink-500);
  font-size: 9px;
}

.usage-folders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.usage-folder {
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-600);
  font-size: 9px;
  padding: 5px 8px;
}

.quick-settings-backdrop {
  position: fixed;
  z-index: 75;
  inset: 0;
  background: rgba(3, 25, 16, .28);
  animation: fade-in 180ms ease both;
}

.quick-settings-panel {
  position: absolute;
  top: 74px;
  left: 24px;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(3, 35, 22, .22);
  padding: 15px;
  animation: modal-in 230ms cubic-bezier(.16, 1, .3, 1) both;
}

.quick-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.quick-settings-head h2 {
  margin: 4px 0 0;
  color: var(--ink-950);
  font-size: 15px;
}

.quick-settings-list {
  display: grid;
  gap: 4px;
}

.quick-setting-row,
.quick-setting-select {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-800);
  text-align: right;
  padding: 7px 8px;
}

.quick-setting-row:hover,
.quick-setting-select:hover {
  background: var(--surface-soft);
}

.quick-setting-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 9px;
  background: var(--mint-100);
  color: var(--brand-700);
}

.quick-setting-row > span:nth-child(2),
.quick-setting-select > span {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.quick-setting-row strong,
.quick-setting-select strong {
  font-size: 10px;
}

.quick-setting-row small,
.quick-setting-select small {
  color: var(--ink-400);
  font-size: 9px;
}

.quick-setting-value {
  color: var(--brand-700);
  font-size: 9px;
  font-weight: 800;
}

.quick-setting-select select {
  width: 92px;
  min-height: 31px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink-800);
  font-size: 10px;
  outline: 0;
  padding: 4px 6px;
}

.quick-settings-all {
  display: inline-flex;
  width: 100%;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
  border-radius: 10px;
  background: var(--brand-700);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.quick-settings-all:hover {
  background: var(--brand-800);
}

.settings-icon-button {
  position: relative;
}

.settings-icon-button::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand-500);
  content: '';
}

body.compact-mode .message-row {
  min-height: 54px;
  padding-top: 7px;
  padding-bottom: 7px;
}

body.compact-mode .message-row .message-preview-text,
body.compact-mode .message-row .message-snippet {
  display: none;
}

body.compact-mode .message-row .sender-avatar {
  width: 29px;
  height: 29px;
  flex-basis: 29px;
}

body[data-theme='dark'] .settings-overview,
body[data-theme='dark'] .quick-settings-panel {
  background: linear-gradient(135deg, #143c2a, var(--surface));
}

body[data-theme='dark'] .quick-settings-panel,
body[data-theme='dark'] .settings-field input,
body[data-theme='dark'] .settings-field textarea,
body[data-theme='dark'] .settings-field select,
body[data-theme='dark'] .quick-setting-select select,
body[data-theme='dark'] .security-status,
body[data-theme='dark'] .template-item,
body[data-theme='dark'] .blocked-item,
body[data-theme='dark'] .direction-preview,
body[data-theme='dark'] .usage-folder {
  background: var(--surface-soft);
}

body[data-theme='dark'] .two-factor-qr {
  background: #fff;
}

@media (max-width: 900px) {
  .settings-grid-pro {
    grid-template-columns: 1fr;
  }

  .settings-card-wide {
    grid-column: auto;
  }

  .settings-overview {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .settings-overview-actions {
    width: 100%;
    margin-right: 0;
    padding-right: 55px;
  }
}

@media (max-width: 620px) {
  .settings-fields-2,
  .settings-fields-3,
  .time-range,
  .usage-summary {
    grid-template-columns: 1fr;
  }

  .settings-card {
    padding: 16px;
  }

  .two-factor-setup {
    grid-template-columns: 1fr;
  }

  .two-factor-qr {
    width: 140px;
  }

  .settings-overview-actions {
    padding-right: 0;
  }

  .settings-overview-actions .settings-save,
  .settings-overview-actions .secondary-button {
    flex: 1;
    justify-content: center;
  }

  .blocked-form,
  .usage-stats {
    grid-template-columns: 1fr;
  }

  .filter-settings-link {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-settings-link .secondary-button {
    width: 100%;
    justify-content: center;
  }

  .quick-settings-panel {
    top: 75px;
    right: 16px;
    left: 16px;
    width: auto;
  }
}

/* Gmail-style settings categories */

.settings-layout {
  display: grid;
  min-width: 0;
  align-items: start;
  gap: 16px;
  grid-template-columns: minmax(245px, .38fr) minmax(0, 1fr);
}

.settings-category-panel,
.settings-content-panel {
  min-width: 0;
}

.settings-category-panel {
  position: sticky;
  top: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.settings-category-panel-head {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 18px 17px 15px;
}

.settings-category-panel-head strong {
  color: var(--ink-950);
  font-size: 15px;
}

.settings-category-panel-head > span:last-child {
  color: var(--ink-400);
  font-size: 10px;
  line-height: 1.7;
}

.settings-categories {
  display: grid;
}

.settings-category-row {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 66px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink-800);
  text-align: right;
  padding: 9px 13px;
  transition: background 160ms ease, color 160ms ease, padding 160ms ease;
}

.settings-category-row:last-child {
  border-bottom: 0;
}

.settings-category-row::before {
  position: absolute;
  top: 8px;
  right: 0;
  bottom: 8px;
  width: 3px;
  border-radius: 4px 0 0 4px;
  background: transparent;
  content: '';
  transition: background 160ms ease;
}

.settings-category-row:hover {
  background: var(--surface-soft);
  color: var(--brand-800);
}

.settings-category-row.is-active {
  background: var(--mint-100);
  color: var(--brand-800);
  padding-right: 16px;
}

.settings-category-row.is-active::before {
  background: var(--brand-600);
}

.settings-category-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.settings-category-row.is-active .settings-category-icon {
  border-color: var(--mint-300);
  background: #fff;
}

.settings-category-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 4px;
}

.settings-category-copy strong {
  overflow: hidden;
  color: currentColor;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-category-copy small {
  overflow: hidden;
  color: var(--ink-400);
  font-size: 9px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-category-arrow {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  place-items: center;
  border-radius: 7px;
  color: var(--ink-400);
  opacity: .72;
}

.settings-category-row.is-active .settings-category-arrow {
  background: var(--surface);
  color: var(--brand-700);
  opacity: 1;
}

.settings-content-panel {
  display: grid;
  min-height: 0;
  gap: 12px;
}

.settings-content-toolbar {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--mint-100), var(--surface));
  box-shadow: var(--shadow-sm);
  padding: 12px 15px;
}

.settings-content-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.settings-content-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  place-items: center;
  border: 1px solid var(--mint-300);
  border-radius: 13px;
  background: #fff;
}

.settings-content-title > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.settings-content-title strong {
  color: var(--ink-950);
  font-size: 13px;
}

.settings-content-title > div > span:last-child {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-content-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.settings-content-actions .settings-save,
.settings-content-actions .secondary-button {
  margin-top: 0;
  white-space: nowrap;
}

.settings-content-panel > .settings-card {
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.settings-content-panel > .settings-card-wide {
  grid-column: auto;
}

body[data-theme='dark'] .settings-category-row.is-active .settings-category-icon,
body[data-theme='dark'] .settings-content-icon {
  background: var(--surface);
}

body[data-theme='dark'] .settings-content-toolbar {
  background: linear-gradient(135deg, #143c2a, var(--surface));
}

@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-category-panel {
    position: static;
  }

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

@media (max-width: 620px) {
  .settings-categories {
    grid-template-columns: 1fr;
  }

  .settings-category-row,
  .settings-category-row:nth-child(odd) {
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-category-row:last-child {
    border-bottom: 0;
  }

  .settings-content-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-content-actions {
    width: 100%;
  }

  .settings-content-actions .settings-save,
  .settings-content-actions .secondary-button {
    flex: 1;
    justify-content: center;
  }
}

/* Final icon alignment and scale pass */

.icon-glass {
  transform: scale(1.14);
  transform-origin: center;
  vertical-align: middle;
}

.icon-glass svg {
  padding: 2px;
}

/* The glass icon is the only frame in these settings controls. The parent
   wrappers are transparent so borders do not appear nested. */
.settings-category-icon,
.settings-content-icon,
.quick-setting-icon,
.settings-overview-icon {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.settings-category-icon {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.settings-content-icon {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
}

.quick-setting-icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
}

.settings-category-icon .icon-glass,
.settings-content-icon .icon-glass,
.quick-setting-icon .icon-glass {
  transform: scale(1.18);
}

.settings-category-row,
.settings-content-title,
.quick-setting-row,
.quick-setting-select {
  align-items: center;
}

/* The settings gear gets its own optical centering pass. The standard
   symmetric outline keeps every settings entry aligned across the UI. */
.icon-glass-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: scale(1.08);
  transform-origin: center;
}

.icon-glass-settings svg {
  display: block;
  padding: 1px;
  transform: translateZ(0);
}

.settings-icon-button .icon-glass-settings {
  transform: scale(1.12);
}

.settings-category-icon .icon-glass-settings,
.settings-content-icon .icon-glass-settings {
  transform: scale(1.16);
}

.quick-settings-all .icon-glass-settings {
  transform: scale(1.02);
}

/* This marker made the gear look off-centre and visually crowded. */
.settings-icon-button::after {
  display: none;
}

/* Sidebar navigation icons stay clean and outline-based. Their state is
   communicated by the icon color and a small optical lift, not by a heavy
   green tile behind the glyph. */
.sidebar-nav .nav-icon .icon-glass {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: inherit;
  transform: scale(1);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: color 160ms ease, transform 160ms ease;
}

.sidebar-nav .nav-icon .icon-glass::before {
  display: none;
}

.sidebar-nav .nav-icon .icon-glass svg {
  padding: 0;
  filter: none;
}

.sidebar-nav button:hover .nav-icon,
.sidebar-nav button.is-active .nav-icon {
  background: transparent;
  color: var(--brand-700);
}

.sidebar-nav button:hover .nav-icon .icon-glass,
.sidebar-nav button.is-active .nav-icon .icon-glass {
  transform: scale(1.08);
}

body[data-theme='dark'] .sidebar-nav button:hover .nav-icon,
body[data-theme='dark'] .sidebar-nav button.is-active .nav-icon {
  color: #9be6bb;
}

/* Settings categories switch inside one stable SPA surface. The outer page,
   sidebar and toolbar remain mounted so there is no full-page flash or scroll
   reset when a category changes. */
.settings-category-content {
  min-width: 0;
  min-height: 0;
}

.settings-category-content > .settings-card {
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.settings-category-content.is-switching {
  will-change: opacity, transform;
}

.settings-category-content.is-forward {
  animation: settings-category-switch-forward 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.settings-category-content.is-backward {
  animation: settings-category-switch-backward 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.settings-content-title.is-switching {
  will-change: opacity, transform;
}

.settings-content-title.is-forward {
  animation: settings-title-switch-forward 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.settings-content-title.is-backward {
  animation: settings-title-switch-backward 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes settings-category-switch-forward {
  from { opacity: 0; transform: translate3d(-10px, 7px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes settings-category-switch-backward {
  from { opacity: 0; transform: translate3d(10px, 7px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes settings-title-switch-forward {
  from { opacity: 0; transform: translate3d(-5px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes settings-title-switch-backward {
  from { opacity: 0; transform: translate3d(5px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .settings-category-content.is-switching,
  .settings-content-title.is-switching {
    animation: none !important;
    transform: none !important;
  }
}

/* Mail states, loading feedback and compact action labels. */
.message-row.is-unread {
  background: linear-gradient(90deg, transparent 0%, rgba(223, 242, 232, 0.38) 100%);
  box-shadow: inset -3px 0 0 var(--brand-600);
}

.message-row.is-unread:hover {
  background: linear-gradient(90deg, transparent 0%, rgba(196, 232, 213, 0.58) 100%);
}

.message-row.is-unread.is-selected {
  background: var(--mint-100);
  box-shadow: inset -4px 0 0 var(--brand-700);
}

.message-unread-marker {
  position: absolute;
  z-index: 1;
  top: 10px;
  inset-inline-end: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(50, 173, 122, 0.14);
}

.message-row.is-unread .message-time {
  color: var(--brand-700);
  font-weight: 800;
}

.action-button {
  display: inline-flex;
  min-height: 34px;
  min-width: max-content;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 750;
  padding: 0 9px;
  transition: 160ms ease;
}

.action-button:hover {
  border-color: var(--mint-300);
  background: var(--mint-100);
  color: var(--brand-700);
}

.action-button .icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.toolbar-action-button {
  min-height: 33px;
  border-color: transparent;
  background: transparent;
  padding: 0 8px;
}

.toolbar-action-button:hover {
  border-color: var(--line);
}

.toolbar-action-button.is-busy {
  cursor: wait;
  color: var(--brand-700);
}

.toolbar-actions .toolbar-action-button.danger-action:hover,
.preview-tools .action-button.danger-action:hover {
  border-color: rgba(213, 87, 87, 0.24);
  background: #fff1f1;
  color: var(--danger);
}

.preview-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.preview-tools .action-button {
  min-height: 32px;
  padding: 0 8px;
}

.preview-back {
  flex: 0 0 auto;
}

.message-list-loading,
.loading-skeleton-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-400);
  font-size: 10px;
}

.message-list-loading {
  min-height: 32px;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--mint-100) 52%, transparent);
}

.message-list-loading-bottom {
  border-bottom: 0;
  padding: 8px 0 16px;
}

.loading-spinner {
  display: inline-block;
  width: var(--spinner-size, 15px);
  height: var(--spinner-size, 15px);
  flex: 0 0 var(--spinner-size, 15px);
  border: 2px solid rgba(21, 148, 99, 0.2);
  border-top-color: var(--brand-600);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.message-list-loading-skeleton {
  display: grid;
  background: var(--surface);
}

.skeleton-message-row {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 11px 15px;
}

.skeleton-avatar,
.skeleton-line,
.skeleton-time,
.skeleton-nav-row i,
.skeleton-button,
.skeleton-search,
.skeleton-header-actions,
.skeleton-profile,
.skeleton-toolbar-actions,
.skeleton-content-block,
.skeleton-logo {
  display: block;
  background: linear-gradient(100deg, rgba(226, 238, 231, 0.74) 20%, rgba(246, 252, 248, 0.98) 42%, rgba(226, 238, 231, 0.74) 64%);
  background-size: 240% 100%;
  animation: skeleton-shimmer 1.35s ease-in-out infinite;
}

.skeleton-avatar {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border-radius: 10px;
}

.skeleton-message-copy {
  display: grid;
  flex: 1;
  gap: 8px;
}

.skeleton-line {
  height: 9px;
  border-radius: 999px;
}

.skeleton-copy-wide {
  width: min(78%, 260px);
}

.skeleton-copy-narrow {
  width: min(54%, 180px);
  opacity: 0.72;
}

.skeleton-time {
  width: 34px;
  height: 7px;
  flex: 0 0 34px;
  border-radius: 999px;
  opacity: 0.62;
}

.loading-skeleton-wrap {
  display: grid;
  width: min(1280px, 100%);
  gap: 15px;
}

.loading-skeleton-app {
  display: grid;
  width: 100%;
  height: min(760px, calc(100vh - 70px));
  min-height: 510px;
  overflow: hidden;
  border: 1px solid rgba(212, 226, 218, 0.9);
  border-radius: 25px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  grid-template-columns: minmax(220px, 266px) minmax(0, 1fr);
}

.loading-skeleton-sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 11px;
  border-inline-end: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 25px 17px 18px;
}

.skeleton-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  padding: 0 7px;
}

.skeleton-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
}

.skeleton-brand-line {
  width: 100px;
}

.skeleton-button {
  width: 100%;
  height: 45px;
  border-radius: 13px;
}

.skeleton-section-label {
  width: 51px;
  height: 7px;
  margin: 17px 10px 1px;
  border-radius: 999px;
  background: var(--line-strong);
}

.skeleton-section-label-short {
  margin-top: 12px;
}

.skeleton-nav-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px;
}

.skeleton-nav-row i {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 8px;
}

.skeleton-nav-row b {
  width: 78px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-strong);
}

.skeleton-nav-row em {
  width: 18px;
  height: 7px;
  margin-inline-start: auto;
  border-radius: 999px;
  background: var(--line);
}

.skeleton-profile {
  width: 100%;
  height: 48px;
  margin-top: auto;
  border-radius: 12px;
  background: var(--line);
}

.loading-skeleton-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--canvas);
  padding: 0 35px 30px;
}

.skeleton-header {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.skeleton-header > div {
  display: grid;
  gap: 9px;
  min-width: 155px;
}

.skeleton-greeting {
  width: 120px;
}

.skeleton-subgreeting {
  width: 190px;
  height: 7px;
  opacity: 0.62;
}

.skeleton-search {
  width: min(320px, 36%);
  height: 37px;
  border-radius: 11px;
}

.skeleton-header-actions {
  width: 120px;
  height: 32px;
  border-radius: 10px;
  opacity: 0.7;
}

.skeleton-page-heading {
  display: grid;
  gap: 10px;
  padding: 29px 0 22px;
}

.skeleton-heading {
  width: 150px;
  height: 19px;
}

.skeleton-description {
  width: 250px;
  height: 8px;
  opacity: 0.66;
}

.skeleton-mail-card {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.skeleton-toolbar {
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
}

.skeleton-toolbar-title {
  width: 115px;
  height: 11px;
}

.skeleton-toolbar-actions {
  width: 120px;
  height: 28px;
  border-radius: 8px;
  opacity: 0.64;
}

.skeleton-mail-area {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
}

.skeleton-message-list {
  min-width: 0;
  overflow: hidden;
  border-inline-end: 1px solid var(--line);
}

.skeleton-message-content {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 34px;
}

.skeleton-content-title {
  width: 55%;
  height: 17px;
}

.skeleton-content-meta {
  width: 30%;
  height: 8px;
  opacity: 0.62;
}

.skeleton-content-block {
  width: 92%;
  height: 110px;
  margin-top: 12px;
  border-radius: 12px;
}

.skeleton-content-block-short {
  width: 68%;
  height: 62px;
  margin-top: 0;
}

.loading-skeleton-status {
  justify-content: center;
  color: var(--ink-500);
}

@keyframes skeleton-shimmer {
  0% { background-position: 160% 0; }
  100% { background-position: -60% 0; }
}

/* Floating compose window: the dimming layer remains available for focus, but
   the writer behaves like a lightweight, draggable workspace window. */
.compose-backdrop {
  display: block;
  background: rgba(4, 27, 18, 0.08);
  backdrop-filter: blur(1px);
  padding: 0;
}

.compose-backdrop .compose-modal {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(700px, calc(100vw - 48px));
  max-height: min(780px, calc(100vh - 48px));
  transform: translate3d(var(--compose-x, 0px), var(--compose-y, 0px), 0);
  animation: compose-window-in 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.compose-drag-handle {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.compose-drag-handle:active,
.compose-modal.is-dragging .compose-drag-handle {
  cursor: grabbing;
}

.compose-modal.is-dragging {
  user-select: none;
  transition: none;
}

.compose-modal .compose-header {
  min-height: 58px;
  padding: 0 17px;
}

.compose-modal .compose-form {
  padding: 12px 18px 17px;
}

.compose-modal .compose-line {
  min-height: 42px;
}

.compose-modal .compose-line > label {
  flex: 0 0 57px;
  min-width: 57px;
  font-size: 10px;
  font-weight: 700;
}

.compose-modal .recipient-line > label,
.compose-modal .compose-attachment-line > label {
  flex-basis: 74px;
  min-width: 74px;
}

.compose-modal .recipient-line {
  min-height: 48px;
  padding: 4px 0;
}

.compose-modal .recipient-chips {
  min-height: 30px;
}

.compose-modal .recipient-hint {
  font-size: 8px;
  opacity: 0.82;
}

.compose-modal .compose-recipient-options {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 2px 0 7px 74px;
}

.compose-template-select {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--ink-400);
  font-size: 9px;
}

.compose-template-select select {
  max-width: 180px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface-soft);
  color: var(--ink-600);
  font-size: 9px;
  padding: 0 7px;
}

.compose-modal .compose-line input,
.compose-modal .compose-line textarea {
  color: var(--ink-800);
  font-size: 12px;
}

.compose-modal .compose-subject input {
  font-weight: 750;
}

.compose-modal .compose-body {
  min-height: 238px;
  padding-top: 13px;
}

.compose-modal .compose-body textarea {
  min-height: 238px;
  line-height: 1.95;
}

.compose-modal .compose-editor {
  min-height: 238px;
  line-height: 1.95;
}

.compose-modal .compose-footer {
  padding-top: 13px;
}

.compose-modal .compose-footer-note {
  font-size: 9px;
}

.compose-modal .secondary-button,
.compose-modal .send-button {
  min-height: 36px;
  font-size: 10px;
}

@keyframes compose-window-in {
  from {
    opacity: 0;
    transform: translate3d(var(--compose-x, 0px), calc(var(--compose-y, 0px) + 12px), 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate3d(var(--compose-x, 0px), var(--compose-y, 0px), 0) scale(1);
  }
}

body[data-theme='dark'] .message-row.is-unread {
  background: linear-gradient(90deg, transparent 0%, rgba(20, 60, 42, 0.74) 100%);
}

body[data-theme='dark'] .message-row.is-unread:hover,
body[data-theme='dark'] .message-row.is-unread.is-selected {
  background: var(--mint-100);
}

body[data-theme='dark'] .action-button {
  border-color: var(--line);
  background: var(--surface);
}

body[data-theme='dark'] .toolbar-action-button {
  border-color: transparent;
  background: transparent;
}

body[data-theme='dark'] .toolbar-actions .toolbar-action-button.danger-action:hover,
body[data-theme='dark'] .preview-tools .action-button.danger-action:hover {
  background: #3a2020;
}

body[data-theme='dark'] .compose-backdrop {
  background: rgba(0, 0, 0, 0.22);
}

body[data-theme='dark'] .skeleton-avatar,
body[data-theme='dark'] .skeleton-line,
body[data-theme='dark'] .skeleton-time,
body[data-theme='dark'] .skeleton-nav-row i,
body[data-theme='dark'] .skeleton-button,
body[data-theme='dark'] .skeleton-search,
body[data-theme='dark'] .skeleton-header-actions,
body[data-theme='dark'] .skeleton-profile,
body[data-theme='dark'] .skeleton-toolbar-actions,
body[data-theme='dark'] .skeleton-content-block,
body[data-theme='dark'] .skeleton-logo {
  background: linear-gradient(100deg, rgba(31, 62, 48, 0.85) 20%, rgba(47, 86, 65, 0.98) 42%, rgba(31, 62, 48, 0.85) 64%);
  background-size: 240% 100%;
}

@media (max-width: 720px) {
  .loading-screen {
    align-items: start;
    padding: 16px;
  }

  .loading-skeleton-app {
    height: calc(100vh - 70px);
    min-height: 600px;
    grid-template-columns: 1fr;
  }

  .loading-skeleton-sidebar,
  .skeleton-message-content,
  .skeleton-header > div + .skeleton-search,
  .skeleton-header-actions {
    display: none;
  }

  .loading-skeleton-content {
    padding: 0 14px 18px;
  }

  .skeleton-header {
    min-height: 67px;
  }

  .skeleton-header > div {
    min-width: 120px;
  }

  .skeleton-search {
    width: 118px;
  }

  .skeleton-mail-area {
    grid-template-columns: 1fr;
  }

  .skeleton-message-list {
    border-inline-end: 0;
  }

  .compose-backdrop .compose-modal {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .compose-modal .compose-form {
    padding: 10px 13px 14px;
  }

  .compose-modal .compose-recipient-options {
    padding-inline-start: 74px;
  }

  .compose-modal .compose-body,
  .compose-modal .compose-body textarea,
  .compose-modal .compose-editor {
    min-height: 190px;
  }

  .compose-modal .compose-footer {
    align-items: flex-start;
  }

  .compose-modal .compose-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .toolbar-action-button,
  .preview-tools .action-button {
    padding-inline: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner,
  .skeleton-avatar,
  .skeleton-line,
  .skeleton-time,
  .skeleton-nav-row i,
  .skeleton-button,
  .skeleton-search,
  .skeleton-header-actions,
  .skeleton-profile,
  .skeleton-toolbar-actions,
  .skeleton-content-block,
  .skeleton-logo {
    animation: none;
  }
}

/* Professional login surface — inspired by the local SpotlightCard, DarkVeil and SpecularButton samples. */

.login-page {
  --login-pointer-x: 50%;
  --login-pointer-y: 28%;
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at var(--login-pointer-x) var(--login-pointer-y), rgba(87, 221, 157, 0.18), transparent 23%),
    radial-gradient(circle at 88% 90%, rgba(21, 148, 99, 0.2), transparent 33%),
    linear-gradient(135deg, #03130d 0%, #082419 48%, #04150e 100%);
  padding: clamp(16px, 3.2vw, 44px);
  transition: background 420ms ease;
}

.login-page::before {
  inset: -25%;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(196, 244, 216, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 244, 216, 0.09) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 70%);
  transform: perspective(900px) rotateX(58deg) rotateZ(-4deg) translateY(-28%);
  transform-origin: top center;
  animation: mobaks-login-grid-drift 24s linear infinite;
}

.login-page::after {
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(ellipse at 14% 5%, rgba(178, 248, 211, 0.11), transparent 26%),
    radial-gradient(ellipse at 78% 110%, rgba(58, 191, 130, 0.12), transparent 30%),
    repeating-linear-gradient(125deg, transparent 0 120px, rgba(211, 247, 228, 0.025) 121px, transparent 123px);
  opacity: 0.9;
}

.login-page > .login-shell.login-shell-pro {
  width: min(1180px, 100%);
  min-height: min(724px, calc(100dvh - 64px));
  overflow: hidden;
  border: 1px solid rgba(201, 246, 220, 0.2);
  border-radius: 32px;
  background: rgba(8, 29, 20, 0.74);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(26px) saturate(125%);
  -webkit-backdrop-filter: blur(26px) saturate(125%);
  grid-template-columns: minmax(0, 1.06fr) minmax(410px, 0.94fr);
}

.login-page > .login-shell.login-shell-pro::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at var(--login-pointer-x) var(--login-pointer-y), rgba(139, 244, 190, 0.08), transparent 33%);
  content: '';
  pointer-events: none;
}

.login-page .login-brand {
  min-width: 0;
  padding: clamp(28px, 4vw, 54px) clamp(27px, 5vw, 68px) clamp(25px, 3vw, 42px);
  background:
    radial-gradient(circle at 16% 12%, rgba(63, 205, 140, 0.18), transparent 29%),
    linear-gradient(145deg, rgba(20, 126, 81, 0.25), transparent 43%),
    linear-gradient(155deg, rgba(3, 28, 18, 0.88), rgba(7, 47, 31, 0.96));
}

.login-page .login-brand::before {
  inset: 0;
  opacity: 0.72;
  background:
    linear-gradient(142deg, transparent 0 38%, rgba(184, 244, 209, 0.08) 38.15% 38.3%, transparent 38.55%),
    linear-gradient(142deg, transparent 0 62%, rgba(184, 244, 209, 0.05) 62.1% 62.25%, transparent 62.5%),
    repeating-linear-gradient(0deg, transparent 0 68px, rgba(213, 250, 229, 0.035) 68px 69px),
    radial-gradient(circle at var(--login-pointer-x) var(--login-pointer-y), rgba(116, 242, 174, 0.14), transparent 25%);
  mask-image: linear-gradient(to bottom, black, transparent 94%);
}

.login-page .login-brand::after {
  right: -164px;
  bottom: -158px;
  width: 410px;
  height: 410px;
  border: 1px solid rgba(211, 247, 228, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(211, 247, 228, 0.035), 0 0 0 78px rgba(211, 247, 228, 0.025), 0 0 80px rgba(52, 194, 132, 0.12);
}

.login-page .login-brand-header,
.login-page .login-brand-content,
.login-page .login-brand-footer {
  z-index: 1;
}

.login-page .logo-box {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
  border: 0;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(0, 16, 10, 0.28), 0 0 0 6px rgba(205, 250, 222, 0.06);
}

.login-page .logo-box img {
  padding: 7px;
}

.login-page .brand-wordmark {
  gap: 3px;
}

.login-page .brand-wordmark strong {
  color: #f7fffa;
  font-size: 18px;
  letter-spacing: -0.45px;
}

.login-page .brand-wordmark span {
  color: rgba(236, 255, 245, 0.56);
  font-size: 11px;
  letter-spacing: 0.65px;
}

.login-page .login-brand-content {
  gap: 23px;
  margin: auto 0;
  padding: clamp(48px, 7vh, 84px) 0 clamp(32px, 5vh, 56px);
}

.login-brand-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(221, 252, 234, 0.6);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.login-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #73e2a6;
  box-shadow: 0 0 0 5px rgba(115, 226, 166, 0.11), 0 0 19px rgba(115, 226, 166, 0.8);
  animation: mobaks-login-status-pulse 2.6s ease-in-out infinite;
}

.login-kicker-code {
  margin-inline-start: auto;
  color: rgba(211, 247, 228, 0.34);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 1.4px;
}

.login-page .login-brand-content h1 {
  max-width: 520px;
  color: #fff;
  font-size: clamp(34px, 4.5vw, 58px);
  font-weight: 850;
  letter-spacing: -2px;
  line-height: 1.27;
}

.login-page .login-brand-content h1 span {
  color: #9ae7bb;
}

.login-page .login-hero-copy {
  display: grid;
  gap: 16px;
}

.login-page .login-brand-content p {
  max-width: 470px;
  color: rgba(234, 252, 242, 0.64);
  font-size: 13px;
  line-height: 2.05;
}

.login-spotlight-card {
  --mouse-x: 50%;
  --mouse-y: 50%;
  position: relative;
  min-height: 108px;
  overflow: hidden;
  border: 1px solid rgba(196, 246, 216, 0.14);
  border-radius: 20px;
  background: rgba(1, 15, 9, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 17px 35px rgba(0, 16, 9, 0.16);
  transition: border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.login-spotlight-card::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(174, 250, 204, 0.16), transparent 68%);
  content: '';
  opacity: 0.78;
  pointer-events: none;
  transition: opacity 420ms ease;
}

.login-spotlight-card::after {
  position: absolute;
  top: -70%;
  bottom: -70%;
  left: -20%;
  width: 18%;
  background: linear-gradient(90deg, transparent, rgba(220, 255, 233, 0.2), transparent);
  content: '';
  opacity: 0;
  transform: rotate(18deg) translateX(-180%);
  transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1), opacity 240ms ease;
}

.login-spotlight-card:hover,
.login-spotlight-card:focus-within {
  border-color: rgba(174, 250, 204, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 20px 42px rgba(0, 20, 11, 0.22);
  transform: translateY(-2px);
}

.login-spotlight-card:hover::after,
.login-spotlight-card:focus-within::after {
  opacity: 1;
  transform: rotate(18deg) translateX(720%);
}

.login-spotlight-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 108px;
  align-items: center;
  gap: 13px;
  padding: 17px 18px;
}

.login-spotlight-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 14px;
  background: rgba(111, 227, 164, 0.12);
  color: #9ceabe;
  box-shadow: 0 0 24px rgba(88, 216, 147, 0.13);
}

.login-spotlight-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.login-spotlight-copy strong {
  color: rgba(248, 255, 250, 0.94);
  font-size: 12px;
  font-weight: 800;
}

.login-spotlight-copy > span {
  color: rgba(221, 249, 232, 0.52);
  font-size: 11px;
  line-height: 1.7;
}

.login-spotlight-arrow {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  margin-inline-start: auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(209, 250, 225, 0.08);
  color: #a6edc3;
  transform: rotate(45deg);
}

.login-spotlight-orbit {
  position: absolute;
  border: 1px solid rgba(155, 235, 188, 0.13);
  border-radius: 50%;
  pointer-events: none;
}

.login-spotlight-orbit-one {
  right: -35px;
  bottom: -84px;
  width: 190px;
  height: 190px;
}

.login-spotlight-orbit-two {
  right: 11px;
  bottom: -44px;
  width: 108px;
  height: 108px;
  border-color: rgba(155, 235, 188, 0.09);
}

.login-page .login-highlights {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}

.login-page .highlight {
  align-items: flex-start;
  gap: 8px;
  color: rgba(246, 255, 250, 0.6);
  font-size: 10px;
  line-height: 1.7;
}

.login-page .highlight .icon {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  border: 0;
  border-radius: 8px;
  background: rgba(142, 229, 182, 0.1);
  color: #93e7b8;
}

.login-page .login-brand-footer {
  color: rgba(223, 250, 235, 0.42);
  font-size: 10px;
}

.login-page .domain-chip {
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(236, 255, 245, 0.65);
}

.login-page .login-card {
  min-width: 0;
  border-inline-start: 1px solid rgba(17, 124, 79, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 251, 247, 0.97));
  padding: clamp(34px, 5vw, 72px) clamp(28px, 6vw, 82px);
}

.login-page .login-form-wrap {
  width: min(400px, 100%);
}

.login-form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.login-page .login-form-wrap .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  border-radius: 999px;
  background: var(--mint-100);
  color: var(--brand-700);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.4px;
  padding: 7px 10px;
}

.login-page .login-form-wrap .eyebrow::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-500);
}

.login-page .login-form-wrap h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 850;
  letter-spacing: -1px;
  line-height: 1.25;
}

.login-form-emblem {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, #e6f8ed, #f7fcf9);
  color: var(--brand-600);
  box-shadow: 0 10px 22px rgba(17, 124, 79, 0.1), inset 0 1px 0 #fff;
}

.login-page .login-form-wrap .form-intro {
  max-width: 380px;
  margin: 13px 0 22px;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 2;
}

.login-form-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 27px;
  border-radius: 11px;
  background: #f0faf4;
  color: var(--brand-700);
  font-size: 10px;
  font-weight: 700;
  padding: 10px 11px;
}

.login-form-tip .icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.login-form-tip-code {
  margin-inline-start: auto;
  color: #7da58d;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.9px;
}

.login-page .form-field {
  gap: 8px;
  margin-bottom: 17px;
}

.login-page .form-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 800;
}

.login-page .form-field label small {
  color: var(--ink-400);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.login-page .input-wrap {
  border-radius: 15px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.login-page .input-wrap:focus-within {
  box-shadow: 0 9px 24px rgba(17, 124, 79, 0.08);
  transform: translateY(-1px);
}

.login-page .input-wrap input {
  min-height: 53px;
  border: 1px solid #dbe9e0;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink-950);
  font-size: 12px;
  text-align: left;
  padding-right: 46px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-page .input-wrap input:focus {
  border-color: rgba(21, 148, 99, 0.62);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(21, 148, 99, 0.09);
}

.login-page .input-wrap > .icon {
  right: 15px;
  color: #8da99a;
}

.login-page .input-wrap .password-toggle {
  left: 12px;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #8da99a;
}

.login-page .input-wrap .password-toggle:hover {
  background: #eaf7f0;
  color: var(--brand-700);
}

.login-page .form-meta {
  margin: 4px 0 21px;
}

.login-page .check-label {
  color: var(--ink-600);
  font-size: 11px;
}

.login-page .text-button {
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 800;
}

.login-page .form-error {
  border: 1px solid rgba(213, 87, 87, 0.12);
  background: #fff4f4;
  font-size: 11px;
}

.login-page .primary-button.login-submit-button {
  position: relative;
  isolation: isolate;
  min-height: 54px;
  overflow: hidden;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #159463, #0d6b46 78%);
  box-shadow: 0 14px 28px rgba(17, 124, 79, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  font-size: 12px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.login-page .primary-button.login-submit-button::before {
  position: absolute;
  top: -70%;
  bottom: -70%;
  left: -22%;
  z-index: 0;
  width: 18%;
  background: linear-gradient(90deg, transparent, rgba(225, 255, 237, 0.35), transparent);
  content: '';
  transform: rotate(18deg) translateX(-260%);
  transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.login-page .primary-button.login-submit-button::after {
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 45%);
  content: '';
  pointer-events: none;
}

.login-page .primary-button.login-submit-button > * {
  position: relative;
  z-index: 1;
}

.login-page .primary-button.login-submit-button:hover {
  background: linear-gradient(135deg, #20a66f, #0d774c 78%);
  box-shadow: 0 17px 34px rgba(17, 124, 79, 0.27), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.login-page .primary-button.login-submit-button:hover::before {
  transform: rotate(18deg) translateX(760%);
}

.login-page .primary-button.login-submit-button:active {
  transform: scale(0.985) translateY(0);
}

.login-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 23px;
  color: #9aaca2;
  font-size: 9px;
}

.login-form-footer span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand-700);
  font-weight: 800;
}

.login-form-footer .icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}

.login-two-factor-shell {
  width: min(570px, 100%) !important;
  min-height: min(610px, calc(100dvh - 64px)) !important;
  grid-template-columns: 1fr !important;
}

.login-page .login-two-factor-shell .login-card {
  border-inline-start: 0;
}

.login-back-button {
  display: block;
  margin: 17px auto 0;
}

@keyframes mobaks-login-grid-drift {
  from { transform: perspective(900px) rotateX(58deg) rotateZ(-4deg) translate3d(-1%, -28%, 0); }
  to { transform: perspective(900px) rotateX(58deg) rotateZ(-4deg) translate3d(1%, -23%, 0); }
}

@keyframes mobaks-login-status-pulse {
  0%, 100% { opacity: 0.72; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.12); }
}

@media (max-width: 900px) {
  .login-page {
    min-height: 100dvh;
    overflow: auto;
    padding: 18px;
  }

  .login-page > .login-shell.login-shell-pro {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .login-page .login-brand {
    min-height: 0;
    padding: 29px 31px 25px;
  }

  .login-page .login-brand-content {
    padding: 42px 0 29px;
  }

  .login-page .login-brand-content h1 {
    font-size: clamp(32px, 6vw, 48px);
  }

  .login-page .login-brand-content p {
    max-width: 610px;
  }

  .login-page .login-highlights {
    max-width: 620px;
  }

  .login-page .login-card {
    min-height: 0;
    padding: 46px 31px 50px;
  }

  .login-two-factor-shell {
    min-height: 0 !important;
  }
}

@media (max-width: 620px) {
  .login-page {
    display: block;
    padding: 0;
  }

  .login-page > .login-shell.login-shell-pro {
    width: 100%;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .login-page .login-brand {
    padding: 24px 20px 21px;
  }

  .login-page .login-brand-content {
    gap: 19px;
    padding: 36px 0 25px;
  }

  .login-page .login-brand-content h1 {
    font-size: 31px;
    letter-spacing: -1.1px;
  }

  .login-page .login-brand-content p {
    font-size: 12px;
    line-height: 1.95;
  }

  .login-spotlight-card,
  .login-spotlight-content {
    min-height: 96px;
  }

  .login-spotlight-content {
    padding: 14px;
  }

  .login-page .login-highlights {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .login-page .highlight {
    align-items: center;
  }

  .login-page .login-brand-footer {
    margin-top: 0;
  }

  .login-page .login-card {
    align-items: flex-start;
    padding: 35px 21px 39px;
  }

  .login-page .login-form-wrap h2 {
    font-size: 28px;
  }
}

@media (max-width: 420px) {
  .login-page .login-brand-header .logo-box {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 15px;
  }

  .login-page .brand-wordmark strong {
    font-size: 16px;
  }

  .login-page .login-brand-content h1 {
    font-size: 28px;
  }

  .login-page .login-kicker-code {
    display: none;
  }

  .login-page .login-form-heading {
    gap: 10px;
  }

  .login-page .login-form-emblem {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
  }

  .login-page .form-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .login-form-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-page,
  .login-page::before,
  .login-status-dot,
  .login-spotlight-card,
  .login-page .input-wrap,
  .login-page .primary-button.login-submit-button {
    animation: none;
    transition: none;
  }
}

/* Compact login form and refined button interactions. */

.login-page > .login-shell.login-shell-pro {
  width: min(1040px, 100%);
  min-height: min(620px, calc(100dvh - 52px));
  border-radius: 26px;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.86fr);
}

.login-page .login-brand {
  padding: 30px clamp(26px, 4vw, 50px) 27px;
}

.login-page .login-brand-content {
  gap: 18px;
  padding: clamp(34px, 5vh, 54px) 0 clamp(26px, 4vh, 38px);
}

.login-page .login-brand-content h1 {
  font-size: clamp(31px, 4vw, 48px);
}

.login-page .login-hero-copy {
  gap: 12px;
}

.login-page .login-brand-content p {
  font-size: 12px;
  line-height: 1.9;
}

.login-spotlight-card,
.login-spotlight-content {
  min-height: 90px;
}

.login-spotlight-content {
  padding: 14px 16px;
}

.login-spotlight-icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 12px;
}

.login-spotlight-copy strong {
  font-size: 11px;
}

.login-spotlight-copy > span {
  font-size: 10px;
}

.login-page .login-card {
  padding: 34px clamp(24px, 4.5vw, 56px);
}

.login-page .login-form-wrap {
  width: min(360px, 100%);
}

.login-page .login-form-wrap .eyebrow {
  margin-bottom: 12px;
  padding: 6px 9px;
}

.login-page .login-form-wrap h2 {
  font-size: clamp(27px, 3vw, 31px);
}

.login-page .login-form-wrap .form-intro {
  margin: 10px 0 22px;
  font-size: 11px;
  line-height: 1.9;
}

.login-page .form-field {
  gap: 7px;
  margin-bottom: 14px;
}

.login-page .input-wrap,
.login-page .input-wrap input {
  border-radius: 13px;
}

.login-page .input-wrap input {
  min-height: 49px;
  font-size: 11px;
}

.login-page .form-meta {
  margin: 2px 0 17px;
}

.login-page .primary-button.login-submit-button {
  min-height: 50px;
  border-radius: 13px;
  will-change: transform, box-shadow;
}

.login-page .primary-button.login-submit-button::before {
  transition: transform 560ms cubic-bezier(0.16, 1, 0.3, 1);
}

.login-page .primary-button.login-submit-button .icon {
  transition: transform 180ms ease, opacity 180ms ease;
}

.login-page .primary-button.login-submit-button:hover .icon {
  transform: translateX(-4px);
}

.login-page .primary-button.login-submit-button:focus-visible {
  outline: 3px solid rgba(21, 148, 99, 0.25);
  outline-offset: 3px;
}

.login-page .text-button {
  min-height: 28px;
  border-radius: 8px;
  padding: 0 8px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.login-page .text-button:hover {
  background: #edf8f2;
  color: var(--brand-900);
  text-decoration: none;
  transform: translateY(-1px);
}

.login-page .text-button:active {
  transform: translateY(0) scale(0.98);
}

.login-page .input-wrap .password-toggle {
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.login-page .input-wrap .password-toggle:hover {
  transform: translateY(-50%) scale(1.05);
}

.login-page .input-wrap .password-toggle:active {
  transform: translateY(-50%) scale(0.94);
}

.login-form-tip,
.login-form-footer,
.login-form-emblem {
  display: none;
}

@media (max-width: 900px) {
  .login-page {
    overflow: auto;
    padding: 18px;
  }

  .login-page > .login-shell.login-shell-pro {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .login-page .login-brand {
    padding: 27px 29px 24px;
  }

  .login-page .login-brand-content {
    padding: 37px 0 27px;
  }

  .login-page .login-card {
    min-height: 0;
    padding: 39px 29px 43px;
  }

  .login-two-factor-shell {
    min-height: 0 !important;
  }
}

@media (max-width: 620px) {
  .login-page {
    display: block;
    padding: 0;
  }

  .login-page > .login-shell.login-shell-pro {
    width: 100%;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .login-page .login-brand {
    padding: 23px 20px 20px;
  }

  .login-page .login-brand-content {
    gap: 17px;
    padding: 33px 0 23px;
  }

  .login-page .login-card {
    padding: 32px 21px 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-page .primary-button.login-submit-button .icon,
  .login-page .text-button,
  .login-page .input-wrap .password-toggle {
    transition: none;
  }
}

/* Exact local SpecularButton surface; only the base/line palette is Mobaks green. */

.login-page .specular-button {
  --sb-radius: 18px;
  --sb-tint: #ffffff;
  --sb-tint-opacity: 0;
  --sb-blur: 0px;
  --sb-text-color: #f5fff8;
  --sb-base-color: #117c4f;

  position: relative;
  display: inline-flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: none;
  margin: 0;
  overflow: visible;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--sb-text-color);
  background: var(--sb-base-color);
  border-radius: var(--sb-radius);
  backdrop-filter: blur(var(--sb-blur));
  -webkit-backdrop-filter: blur(var(--sb-blur));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  outline: none;
  transition: transform 0.15s ease;
}

.login-page .specular-button:active {
  transform: scale(0.97);
}

.login-page .specular-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sb-text-color) 60%, transparent);
  outline-offset: 3px;
}

.login-page .specular-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.login-page .specular-button:disabled:active {
  transform: none;
}

.login-page .specular-button--sm {
  font-size: 0.85rem;
  padding: 10px 22px;
}

.login-page .specular-button--md {
  font-size: 1rem;
  padding: 14px 30px;
}

.login-page .specular-button--lg {
  font-size: 1.15rem;
  padding: 18px 40px;
}

.login-page .specular-button__fx {
  position: absolute;
  inset: -20px;
  z-index: 1;
  pointer-events: none;
}

.login-page .specular-button__fx canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.login-page .specular-button__label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.login-page .specular-button__label .icon,
.login-page .specular-button__label .loading-spinner {
  flex: 0 0 auto;
}

.login-page .specular-button::before,
.login-page .specular-button::after {
  display: none;
  content: none;
}

.login-page .specular-button.is-specular-fallback {
  background: var(--sb-base-color);
}

/* Keep the component's exact geometry above the older login-button rules. */

.login-page .primary-button.login-submit-button.specular-button {
  min-height: 0;
  overflow: visible;
  border: none;
  border-radius: var(--sb-radius);
  background: var(--sb-base-color);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.25);
  font-size: 1.15rem;
  font-weight: 500;
  transition: transform 0.15s ease;
}

.login-page .primary-button.login-submit-button.specular-button:hover {
  background: var(--sb-base-color);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.25);
  transform: none;
}

.login-page .primary-button.login-submit-button.specular-button:active {
  transform: scale(0.97);
}

.login-page .primary-button.login-submit-button.specular-button::before,
.login-page .primary-button.login-submit-button.specular-button::after {
  display: none;
  content: none;
}

.login-page .primary-button.login-submit-button.specular-button > .specular-button__fx {
  position: absolute;
  inset: -20px;
  z-index: 1;
  pointer-events: none;
}

.login-page .primary-button.login-submit-button.specular-button > .specular-button__label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.login-page .primary-button.login-submit-button.specular-button:hover .icon {
  transform: none;
}

/* SpotlightCard effect belongs to the login shell, not the page background. */

.login-page {
  background:
    radial-gradient(circle at 12% 10%, rgba(50, 173, 122, 0.16), transparent 27%),
    radial-gradient(circle at 88% 90%, rgba(17, 124, 79, 0.2), transparent 33%),
    linear-gradient(135deg, #03130d 0%, #082419 48%, #04150e 100%);
}

.login-page > .login-shell.login-shell-pro {
  --login-box-x: 50%;
  --login-box-y: 50%;
  --login-box-spotlight-color: rgba(166, 244, 195, 0.08);
  position: relative;
}

.login-page > .login-shell.login-shell-pro::before {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at var(--login-box-x) var(--login-box-y), var(--login-box-spotlight-color), transparent 80%);
  content: '';
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.login-page > .login-shell.login-shell-pro:hover::before,
.login-page > .login-shell.login-shell-pro:focus-within::before,
.login-page > .login-shell.login-shell-pro:focus-visible::before {
  opacity: 0.6;
}

.login-page .login-brand,
.login-page .login-card {
  position: relative;
  z-index: auto;
}

.login-page .login-brand > *,
.login-page .login-card > * {
  position: relative;
  z-index: 3;
}

.login-page .login-brand::before {
  background:
    linear-gradient(142deg, transparent 0 38%, rgba(184, 244, 209, 0.08) 38.15% 38.3%, transparent 38.55%),
    linear-gradient(142deg, transparent 0 62%, rgba(184, 244, 209, 0.05) 62.1% 62.25%, transparent 62.5%),
    repeating-linear-gradient(0deg, transparent 0 68px, rgba(213, 250, 229, 0.035) 68px 69px);
}

.login-page .login-brand-kicker {
  width: max-content;
  margin: 0;
  border: 1px solid rgba(196, 246, 216, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(221, 252, 234, 0.72);
  padding: 7px 11px;
}

.login-page .login-brand-content h1 {
  line-height: 1.18;
  letter-spacing: -1.4px;
}

.login-page .login-brand-content p {
  max-width: 36ch;
  margin: 0;
  line-height: 1.85;
}

.login-page .login-spotlight-card {
  min-height: 0;
  border-color: rgba(196, 246, 216, 0.12);
  background: rgba(1, 15, 9, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.login-page .login-spotlight-card::before {
  background: none;
  opacity: 0;
  transition: none;
}

.login-page .login-spotlight-card::after {
  display: none;
}

.login-page .login-spotlight-card:hover,
.login-page .login-spotlight-card:focus-within {
  border-color: rgba(196, 246, 216, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transform: none;
}

.login-page .login-spotlight-content {
  min-height: 82px;
  padding: 12px 15px 8px;
}

.login-page .login-spotlight-icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 12px;
}

.login-page .login-spotlight-arrow {
  display: none;
}

.login-spotlight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 15px;
  border-top: 1px solid rgba(211, 247, 228, 0.09);
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  padding: 11px 0 13px;
}

.login-spotlight-footer-copy {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.login-footer-status {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #96c8ff;
  box-shadow: 0 0 15px rgba(150, 200, 255, 0.7);
}

.login-dot-row {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
}

.login-dot-row i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #96c8ff;
  box-shadow: 0 0 16px rgba(150, 200, 255, 0.7);
}

.login-dot-row i:nth-child(2) {
  background: #32ad7a;
  box-shadow: 0 0 16px rgba(50, 173, 122, 0.72);
}

.login-dot-row i:nth-child(3) {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.4);
}

@media (max-width: 620px) {
  .login-page .login-brand-kicker {
    padding: 6px 9px;
  }

  .login-page .login-spotlight-content {
    min-height: 76px;
  }

  .login-spotlight-footer {
    margin-inline: 14px;
    font-size: 9px;
  }
}

/* Professional six-digit 2FA input. */

.login-page .login-two-factor-shell {
  width: min(540px, 100%) !important;
  min-height: min(570px, calc(100dvh - 52px)) !important;
}

.login-page .login-two-factor-shell .login-card {
  padding: clamp(34px, 5vw, 58px) clamp(24px, 6vw, 64px);
}

.login-page .login-two-factor-shell .login-form-wrap {
  width: min(390px, 100%);
}

.login-page .login-two-factor-shell .form-intro {
  margin-bottom: 27px;
}

.two-factor-code-field {
  display: grid;
  gap: 13px;
  margin-bottom: 21px;
}

.two-factor-field-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.two-factor-field-head > div {
  display: grid;
  gap: 5px;
}

.two-factor-field-label {
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 850;
}

.two-factor-field-subtitle {
  color: var(--ink-400);
  font-size: 10px;
}

.two-factor-progress {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--ink-400);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.two-factor-progress strong {
  color: var(--brand-700);
  font-size: 15px;
  font-weight: 850;
}

.two-factor-digit-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  direction: ltr;
}

.login-page .two-factor-digit {
  width: 100%;
  height: 58px;
  min-width: 0;
  border: 1px solid #d8e8de;
  border-radius: 15px;
  outline: 0;
  background: #fff;
  color: #123b2b !important;
  caret-color: var(--brand-700);
  -webkit-text-fill-color: #123b2b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 5px 14px rgba(17, 124, 79, 0.035);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

.login-page .two-factor-digit::selection {
  background: rgba(50, 173, 122, 0.22);
  color: #123b2b;
}

.login-page .two-factor-digit:hover {
  border-color: #b9dcc7;
}

.login-page .two-factor-digit.is-focused {
  border-color: rgba(21, 148, 99, 0.78);
  box-shadow: 0 0 0 4px rgba(21, 148, 99, 0.1), 0 8px 19px rgba(17, 124, 79, 0.08);
  transform: translateY(-2px);
}

.login-page .two-factor-digit.is-valid {
  border-color: #41b77b;
  background: linear-gradient(180deg, #fbfffc, #effaf3);
  color: #0c7749 !important;
  -webkit-text-fill-color: #0c7749;
  box-shadow: 0 7px 18px rgba(17, 124, 79, 0.1), inset 0 1px 0 #fff;
}

.login-page .two-factor-digit.is-valid.is-focused {
  border-color: #159463;
  box-shadow: 0 0 0 4px rgba(21, 148, 99, 0.12), 0 8px 19px rgba(17, 124, 79, 0.1);
}

.login-page .two-factor-digit.is-invalid,
.login-page .two-factor-digit.is-required {
  border-color: #d55757;
  background: #fff5f5;
  color: #b33f4b !important;
  -webkit-text-fill-color: #b33f4b;
  box-shadow: 0 7px 18px rgba(213, 87, 87, 0.1);
}

.login-page .two-factor-digit.is-invalid {
  animation: two-factor-shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.login-page .two-factor-digit.is-required {
  animation: two-factor-required-pulse 700ms ease both;
}

.login-page .two-factor-digit.is-entering {
  animation: two-factor-digit-pop 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-page .two-factor-digit-grid.is-complete .two-factor-digit.is-valid {
  box-shadow: 0 8px 22px rgba(17, 124, 79, 0.14), inset 0 1px 0 #fff;
}

.two-factor-field-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-400);
  font-size: 9px;
}

.two-factor-field-hint > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.two-factor-field-hint .icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
  color: var(--brand-600);
}

.two-factor-field-hint > span:last-child {
  color: #9aaca2;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
}

.login-page .two-factor-form-error {
  margin-top: -4px;
  animation: two-factor-error-in 260ms ease both;
}

.login-page .login-two-factor-shell .login-submit-button {
  margin-top: 3px;
}

@keyframes two-factor-digit-pop {
  0% { opacity: 0.45; transform: translateY(5px) scale(0.82); }
  70% { transform: translateY(-2px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes two-factor-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

@keyframes two-factor-required-pulse {
  0%, 100% { box-shadow: 0 7px 18px rgba(213, 87, 87, 0.1); }
  50% { box-shadow: 0 0 0 4px rgba(213, 87, 87, 0.11), 0 8px 20px rgba(213, 87, 87, 0.13); }
}

@keyframes two-factor-error-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .login-page .login-two-factor-shell .login-card {
    padding: 31px 20px 36px;
  }

  .two-factor-digit-grid {
    gap: 6px;
  }

  .login-page .two-factor-digit {
    height: 52px;
    border-radius: 12px;
    font-size: 20px;
  }

  .two-factor-field-hint > span:last-child {
    display: none;
  }
}

@media (max-width: 360px) {
  .two-factor-digit-grid {
    gap: 4px;
  }

  .login-page .two-factor-digit {
    height: 48px;
    font-size: 18px;
  }
}

/* Account avatars: keep the initials fallback visible while remote images load. */
.avatar-media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.avatar-media .avatar-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.avatar-media img {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--avatar, var(--mint-200));
}

.avatar-media img[hidden] {
  display: none;
}

.profile-avatar-editor {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(135deg, var(--surface-soft), var(--surface));
  padding: 13px;
}

.profile-avatar-preview,
.profile-avatar-image {
  display: grid;
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  place-items: center;
}

.profile-avatar-image {
  border-radius: 24px;
  font-size: 22px;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(14, 87, 57, .12);
}

.profile-avatar-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 4px;
}

.profile-avatar-copy strong {
  color: var(--ink-950);
  font-size: 12px;
  font-weight: 850;
}

.profile-avatar-copy span,
.profile-avatar-copy small {
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.8;
}

.profile-avatar-copy small {
  color: var(--ink-400);
  font-size: 9px;
}

.profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.profile-avatar-upload {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.profile-avatar-upload.is-busy {
  cursor: wait;
  opacity: .72;
}

.profile-avatar-upload input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.profile-avatar-upload.is-busy input {
  pointer-events: none;
}

.profile-avatar-remove {
  min-height: 30px;
}

.profile-avatar-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.9;
  padding: 8px 9px;
}

.profile-avatar-note .icon {
  flex: 0 0 auto;
  color: var(--brand-600);
  margin-top: 2px;
}

.message-row .avatar-media,
.preview-meta .avatar-media,
.thread-message-head .avatar-media {
  flex: 0 0 auto;
}

body[data-theme='dark'] .profile-avatar-editor {
  background: linear-gradient(135deg, var(--surface-soft), var(--surface));
}

@media (max-width: 600px) {
  .profile-avatar-editor {
    align-items: flex-start;
    gap: 11px;
    padding: 11px;
  }

  .profile-avatar-preview,
  .profile-avatar-image {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
    border-radius: 19px;
  }

  .profile-avatar-actions {
    align-items: stretch;
  }
}

/* Registration and admin workspace */
.login-register-link {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 13px;
  background: transparent;
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 800;
  transition: color 160ms ease, transform 160ms ease;
}

.login-register-link:hover {
  color: var(--brand-900);
  transform: translateY(-1px);
}

.registration-shell {
  min-height: min(760px, calc(100dvh - 56px));
}

.registration-card {
  min-width: 0;
}

.registration-card .login-form-wrap {
  width: min(100%, 520px);
}

.registration-form {
  display: grid;
  gap: 15px;
}

.registration-code-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 17px;
  background: var(--mint-100);
  color: var(--brand-700);
  box-shadow: inset 0 0 0 1px rgba(17, 124, 79, 0.08);
}

.registration-form-copy {
  display: grid;
  gap: 5px;
}

.registration-form-copy h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(25px, 3vw, 32px);
  letter-spacing: -0.9px;
}

.registration-form-copy p {
  max-width: 480px;
  margin: 0;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 2;
}

.registration-field {
  gap: 7px;
}

.registration-field input,
.registration-fields-grid input {
  min-height: 49px;
}

.registration-code-icon + .registration-form-copy {
  margin-top: -1px;
}

.registration-link-notice,
.registration-security-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid rgba(17, 124, 79, 0.12);
  border-radius: 12px;
  background: var(--mint-100);
  color: var(--brand-800);
  font-size: 10px;
  line-height: 1.9;
  padding: 10px 11px;
}

.registration-link-notice .icon,
.registration-security-note .icon {
  flex: 0 0 auto;
  margin-top: 2px;
}

.registration-security-note {
  border-color: rgba(92, 112, 103, 0.12);
  background: var(--surface-soft);
  color: var(--ink-500);
}

.registration-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.registration-2fa-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 13px;
}

.registration-qr-wrap {
  display: grid;
  width: 142px;
  height: 142px;
  flex: 0 0 142px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.registration-qr-wrap img {
  display: block;
  width: 100%;
  height: 100%;
}

.registration-2fa-copy {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.registration-2fa-copy strong {
  color: var(--ink-950);
  font-size: 11px;
}

.registration-2fa-copy span {
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.8;
}

.registration-2fa-copy code {
  overflow-wrap: anywhere;
  color: var(--brand-800);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 1px;
}

.registration-error {
  margin: 0;
}

.admin-users-settings {
  display: grid;
  gap: 14px;
}

.admin-panel-block {
  display: grid;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  padding: 17px;
}

.admin-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-panel-heading h3 {
  margin: 3px 0 4px;
  color: var(--ink-950);
  font-size: 15px;
}

.admin-panel-heading p {
  max-width: 620px;
  margin: 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.9;
}

.admin-count,
.admin-status,
.admin-role {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  white-space: nowrap;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 800;
  padding: 0 9px;
}

.admin-count {
  color: var(--brand-700);
  background: var(--mint-100);
}

.admin-user-list,
.registration-code-list {
  display: grid;
  gap: 8px;
}

.admin-user-row,
.registration-code-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  padding: 10px 11px;
}

.admin-user-identity {
  display: flex;
  min-width: 0;
  flex: 1 1 240px;
  align-items: center;
  gap: 9px;
}

.admin-user-avatar {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  place-items: center;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 850;
}

.admin-user-identity > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.admin-user-identity strong,
.admin-user-identity span,
.registration-code-row strong,
.registration-code-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-identity strong {
  color: var(--ink-950);
  font-size: 11px;
}

.admin-user-identity span {
  color: var(--ink-500);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.admin-user-meta {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.admin-role.is-admin {
  background: #fff1d9;
  color: #a26713;
}

.admin-status.is-active {
  background: var(--mint-100);
  color: var(--brand-700);
}

.admin-status.is-used {
  background: #edf0ff;
  color: #5b55a8;
}

.admin-status.is-inactive {
  background: #fff1f1;
  color: var(--danger);
}

.admin-2fa-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-500);
  font-size: 9px;
  white-space: nowrap;
}

.admin-2fa-state .icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
  color: var(--brand-600);
}

.admin-edit-button {
  flex: 0 0 auto;
  min-height: 31px;
  padding-inline: 10px;
}

.admin-user-editor {
  display: grid;
  width: 100%;
  gap: 12px;
  border: 1px solid rgba(17, 124, 79, 0.2);
  border-radius: 14px;
  background: var(--mint-100);
  padding: 13px;
  animation: rise-in 220ms ease both;
}

.admin-user-editor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.admin-user-editor-head strong {
  color: var(--ink-950);
  font-size: 12px;
}

.admin-user-editor-head span {
  overflow: hidden;
  color: var(--ink-500);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-active-row {
  margin: 0;
  border-top: 1px solid rgba(17, 124, 79, 0.1);
  padding-top: 10px;
}

.registration-code-result {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(17, 124, 79, 0.2);
  border-radius: 14px;
  background: var(--mint-100);
  padding: 12px;
}

.registration-result-line {
  display: grid;
  min-width: 0;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.registration-result-line > span {
  color: var(--ink-500);
  font-size: 10px;
}

.registration-result-line strong {
  color: var(--brand-800);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  letter-spacing: 1.2px;
}

.registration-result-line input {
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(17, 124, 79, 0.15);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-600);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  padding: 0 8px;
}

.registration-code-result small {
  color: var(--ink-500);
  font-size: 9px;
}

.registration-code-row {
  justify-content: space-between;
}

.registration-code-row > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.registration-code-row strong {
  color: var(--ink-800);
  font-size: 10px;
}

.registration-code-row span {
  color: var(--ink-500);
  font-size: 9px;
}

.registration-code-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.admin-empty-state {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  color: var(--ink-500);
  font-size: 10px;
}

body[data-theme='dark'] .registration-2fa-panel,
body[data-theme='dark'] .admin-user-row,
body[data-theme='dark'] .registration-code-row,
body[data-theme='dark'] .admin-panel-block {
  background: var(--surface);
}

body[data-theme='dark'] .registration-result-line input {
  background: var(--surface-soft);
}

@media (max-width: 720px) {
  .registration-shell {
    min-height: 100dvh;
  }

  .registration-fields-grid {
    grid-template-columns: 1fr;
  }

  .registration-2fa-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .registration-qr-wrap {
    width: 132px;
    height: 132px;
    flex-basis: 132px;
  }

  .admin-panel-heading,
  .admin-user-row,
  .registration-code-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-user-meta {
    justify-content: flex-start;
  }

  .admin-edit-button {
    width: 100%;
    justify-content: center;
  }

  .registration-result-line {
    grid-template-columns: 1fr;
  }

  .registration-result-line .secondary-button {
    justify-self: start;
  }

  .registration-code-row-actions {
    width: 100%;
    justify-content: space-between;
  }
}
