/* E-Temp Mail — modern UI layer (works with default + groot themes) */

:root {
  --tm-font: "Inter", "Poppins", system-ui, -apple-system, sans-serif;
  --tm-radius: 14px;
  --tm-radius-sm: 10px;
  --tm-radius-lg: 20px;
  --tm-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.08);
  --tm-shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --tm-surface: #ffffff;
  --tm-bg: #f1f5f9;
  --tm-text: #0f172a;
  --tm-muted: #64748b;
  --tm-border: #e2e8f0;
  --tm-primary: #2563eb;
  --tm-secondary: #0d9488;
  --tm-tertiary: #f59e0b;
  --tm-primary-rgb: 37, 99, 235;
}

.default-theme,
.groot-theme {
  font-family: var(--tm-font);
  color: var(--tm-text);
  -webkit-font-smoothing: antialiased;
}

/* —— Layout —— */
.tm-app {
  min-height: 100vh;
  background: var(--tm-bg);
}

.tm-sidebar {
  background: linear-gradient(
    165deg,
    var(--tm-primary) 0%,
    color-mix(in srgb, var(--tm-primary) 75%, #0f172a) 100%
  );
  position: relative;
  overflow: hidden;
}

.tm-sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 20% 10%,
    rgba(255, 255, 255, 0.12) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.tm-sidebar-inner {
  position: relative;
  z-index: 1;
}

.tm-main {
  background: var(--tm-bg);
  min-height: 100vh;
}

.tm-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

@media (min-width: 1024px) {
  .tm-content {
    padding: 0 1.5rem 2.5rem;
  }
}

[x-cloak] {
  display: none !important;
}

/* —— Nav —— */
.tm-nav {
  background: var(--tm-surface);
  border-bottom: 1px solid var(--tm-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 0;
  z-index: 40;
}

.tm-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  border-radius: var(--tm-radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.tm-nav-link:hover,
.tm-nav-link.is-active {
  background: #f1f5f9;
  color: var(--tm-text);
}

.tm-nav-link--auth {
  color: var(--tm-primary);
  font-weight: 600;
}

.groot-theme .tm-nav-link {
  color: #cbd5e1;
}

.groot-theme .tm-nav-bar {
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(12px);
  border: none;
}

.groot-theme .tm-nav-link {
  color: rgba(255, 255, 255, 0.9);
}

.groot-theme .tm-nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.groot-theme .tm-nav-link.is-active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 600;
}

.tm-nav-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--tm-radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.default-theme .tm-nav-dropdown__trigger {
  color: #475569;
}

.default-theme .tm-nav-dropdown__trigger:hover {
  background: #f1f5f9;
  color: var(--tm-text);
}

.groot-theme .tm-nav-dropdown__trigger {
  color: rgba(255, 255, 255, 0.9);
}

.groot-theme .tm-nav-dropdown__trigger:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.tm-nav-dropdown__menu {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  min-width: 11rem;
  padding: 0.35rem;
  background: var(--tm-surface);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  box-shadow: var(--tm-shadow-lg);
  z-index: 50;
}

.tm-nav-dropdown__link {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  border-radius: var(--tm-radius-sm);
  transition: background 0.12s ease, color 0.12s ease;
}

.tm-nav-dropdown__link:hover {
  background: #f1f5f9;
  color: var(--tm-text);
}

.tm-nav-admin {
  border: 1px dashed #f87171;
  color: #ef4444 !important;
}

.tm-nav-admin:hover {
  background: #fef2f2 !important;
}

.groot-theme .tm-nav-admin {
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca !important;
}

.groot-theme .tm-nav-admin:hover {
  background: rgba(239, 68, 68, 0.2) !important;
}

.tm-nav-socials {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tm-nav-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--tm-radius-sm);
  color: #64748b;
  transition: background 0.15s ease, color 0.15s ease;
}

.tm-nav-socials a:hover {
  background: #f1f5f9;
  color: var(--tm-primary);
}

.groot-theme .tm-header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem 1.25rem;
  padding-top: 1.25rem;
  padding-bottom: 0.75rem;
}

.groot-theme .tm-header-grid__left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-self: start;
}

.groot-theme .tm-header-grid__center {
  display: flex;
  justify-content: center;
  justify-self: center;
}

.groot-theme .tm-header-grid__center .max-w-logo {
  max-height: 3.5rem;
  width: auto;
  height: auto;
}

.groot-theme .tm-header-grid__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
}

.groot-theme .tm-header-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
}

.tm-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.tm-header-btn:hover {
  transform: translateY(-1px);
}

.tm-header-btn--ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.tm-header-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tm-header-btn--accent {
  background: #00c495;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 196, 149, 0.35);
}

.tm-header-btn--accent:hover {
  background: #00b085;
}

.tm-header-btn--api img {
  display: block;
  height: 1.75rem;
  width: auto;
  border-radius: 6px;
}

/* —— Locale switcher —— */
.tm-locale-switcher {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  vertical-align: middle;
  z-index: 50;
}

.tm-locale-switcher.is-open .tm-locale-switcher__chevron {
  transform: rotate(180deg);
}

.tm-locale-switcher__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  min-width: 0;
  max-width: 10rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  color: #334155;
  background: #f8fafc;
  border: 1px solid var(--tm-border);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.tm-locale-switcher--header .tm-locale-switcher__trigger {
  max-width: 9.5rem;
}

.tm-locale-switcher__trigger:hover {
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.tm-locale-switcher--header .tm-locale-switcher__trigger {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
}

.tm-locale-switcher--header .tm-locale-switcher__trigger:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

.tm-locale-switcher__flag {
  font-size: 1.125rem;
  line-height: 1;
  flex-shrink: 0;
}

.tm-locale-switcher__label {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-locale-switcher__chevron {
  font-size: 0.625rem;
  line-height: 1;
  width: auto;
  height: auto;
  max-width: 0.75rem;
  opacity: 0.7;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.tm-locale-switcher__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 13.5rem;
  max-height: min(20rem, 70vh);
  overflow-y: auto;
  padding: 0.35rem;
  margin: 0;
  background: var(--tm-surface);
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  box-shadow: var(--tm-shadow-lg);
  z-index: 200;
}

.tm-locale-switcher__menu[hidden] {
  display: none !important;
}

.tm-locale-switcher__option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--tm-radius-sm);
  text-decoration: none;
  color: var(--tm-text);
  transition: background 0.12s ease;
}

.tm-locale-switcher__option:hover {
  background: #f1f5f9;
}

.tm-locale-switcher__option.is-active {
  background: color-mix(in srgb, var(--tm-primary) 12%, #fff);
}

.tm-locale-switcher__option-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.tm-locale-switcher__option-label {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
}

.tm-locale-switcher__option-code {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--tm-muted);
  letter-spacing: 0.04em;
}

.tm-locale-switcher__check {
  font-size: 0.75rem;
  color: var(--tm-primary);
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .groot-theme .tm-header-grid {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo logo"
      "left right";
  }

  .groot-theme .tm-header-grid__center {
    grid-area: logo;
  }

  .groot-theme .tm-header-grid__left {
    grid-area: left;
  }

  .groot-theme .tm-header-grid__right {
    grid-area: right;
  }

  .groot-theme .tm-header-btn--api {
    display: none;
  }
}

.tm-mobile-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--tm-radius-sm);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tm-mobile-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.default-theme .tm-mobile-nav-toggle {
  color: var(--tm-text);
}

.default-theme .tm-mobile-nav-toggle:hover {
  background: #f1f5f9;
}

.default-theme .tm-nav .tm-nav-link {
  color: #fff;
}

.default-theme .tm-nav .tm-nav-link:hover,
.default-theme .tm-nav .tm-nav-link.is-active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.groot-theme .socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--tm-radius-sm);
  transition: background 0.15s ease;
}

.groot-theme .socials a:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* —— Email card (sidebar) —— */
.tm-email-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--tm-radius-lg);
  padding: 1.25rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.tm-email-card__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  margin-bottom: 1rem;
}

.tm-email-row {
  display: flex;
  gap: 0.625rem;
  align-items: stretch;
}

.tm-email-slot {
  min-height: 3.25rem;
}

.tm-email-slot .tm-email-field:not(.tm-loading) {
  width: 100%;
}

.tm-email-field {
  flex: 1;
  min-height: 3.25rem;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: var(--tm-radius) !important;
  color: #fff !important;
  font-size: 0.9375rem !important;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-all;
}

.tm-email-field.tm-loading {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 400 !important;
  font-size: 0.875rem !important;
}

.tm-btn-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  padding: 0 1rem;
  border: none;
  border-radius: var(--tm-radius);
  background: var(--tm-secondary) !important;
  color: #fff;
  font-size: 1.125rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.tm-btn-copy:hover:not(.email-pending) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.tm-btn-copy.email-pending {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Timed mail pages (5 / 10 / 15 / 20 / 30 min) */
.tm-email-row--timed .tm-email-field,
.tm-email-row--timed #email_id {
  padding-right: 7.75rem !important;
}

.tm-timer-box {
  position: absolute;
  top: 3px;
  bottom: 3px;
  right: 3px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
  min-width: 7rem;
  background: var(--tm-secondary) !important;
  border-radius: var(--tm-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tm-timer-countdown {
  min-width: 4.25rem;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1;
  color: #fff;
  text-align: center;
}

.tm-timer-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.92;
  transition: opacity 0.15s ease;
}

.tm-timer-reset:hover {
  opacity: 1;
}

/* —— Action grid —— */
.tm-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
  margin-top: 1rem;
}

.default-theme .tm-actions {
  grid-template-columns: repeat(2, 1fr);
}

.groot-theme .tm-actions--groot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
  width: 100%;
}

@media (min-width: 640px) {
  .groot-theme .tm-actions--groot {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tm-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  min-height: 4.5rem;
  border-radius: var(--tm-radius);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
  width: 100%;
}

.tm-action-btn--row {
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.625rem 0.75rem;
  white-space: nowrap;
}

.tm-action-btn--row i {
  font-size: 1rem;
  flex-shrink: 0;
}

.tm-action-btn--row span {
  font-size: 0.8125rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-action-btn--link {
  text-decoration: none;
  background: var(--tm-secondary) !important;
  border-color: transparent;
}

.tm-action-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.tm-action-btn--link:hover {
  background: color-mix(in srgb, var(--tm-secondary) 85%, #000) !important;
}

.tm-action-btn i {
  font-size: 1.25rem;
  opacity: 0.95;
}

/* —— Form inputs (create email) —— */
.tm-form-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--tm-radius-lg);
  padding: 1.25rem;
}

.tm-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: var(--tm-radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.9375rem;
}

.tm-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.tm-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.tm-btn-primary,
.tm-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.25rem;
  border: none;
  border-radius: var(--tm-radius);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tm-btn-primary {
  background: var(--tm-secondary) !important;
  color: #fff;
}

.tm-btn-secondary {
  background: var(--tm-tertiary) !important;
  color: #fff;
}

.tm-btn-primary:hover,
.tm-btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: var(--tm-shadow);
}

/* —— Create email panel (groot horizontal layout) —— */
.tm-create-panel {
  margin-bottom: 0;
}

.tm-create-form {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.tm-create-form__fields {
  flex: 1;
  min-width: 0;
}

.tm-create-form__actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex-shrink: 0;
  justify-content: center;
}

.tm-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  min-height: 3.25rem;
  border: none;
  border-radius: var(--tm-radius);
  color: #fff;
  font-size: 1.125rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.tm-btn-icon--primary {
  background: var(--tm-secondary) !important;
}

.tm-btn-icon--secondary {
  background: var(--tm-tertiary) !important;
}

.tm-btn-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.tm-back-link,
.tm-cancel-link {
  text-decoration: none;
  border: none;
  background: rgba(255, 255, 255, 0.12);
}

.tm-cancel-link {
  justify-content: center;
}

.tm-create-form--stacked {
  flex-direction: column;
}

.tm-create-form--stacked .tm-create-form__actions {
  flex-direction: row;
}

.tm-create-form--stacked .tm-btn-icon {
  flex: 1;
  width: auto;
}

.tm-create-form--stacked .tm-btn-primary-full {
  width: 100%;
  margin-top: 0.75rem;
}

@media (max-width: 480px) {
  .tm-create-form:not(.tm-create-form--stacked) {
    flex-direction: column;
  }

  .tm-create-form:not(.tm-create-form--stacked) .tm-create-form__actions {
    flex-direction: row;
    justify-content: stretch;
  }

  .tm-create-form:not(.tm-create-form--stacked) .tm-btn-icon {
    flex: 1;
    width: auto;
  }
}

/* —— Mailbox —— */
.tm-mailbox {
  background: var(--tm-surface);
  border-radius: var(--tm-radius-lg);
  box-shadow: var(--tm-shadow);
  border: 1px solid var(--tm-border);
  overflow: hidden;
  min-height: 420px;
}

.tm-mailbox-layout {
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

@media (min-width: 1024px) {
  .tm-mailbox-layout {
    flex-direction: row;
    min-height: calc(100vh - 12rem);
  }
}

.tm-inbox-list {
  flex: 0 0 auto;
  max-height: 40vh;
  overflow-y: auto;
  border-bottom: 1px solid var(--tm-border);
}

@media (min-width: 1024px) {
  .tm-inbox-list {
    flex: 0 0 36%;
    max-height: none;
    border-bottom: none;
    border-right: 1px solid var(--tm-border);
  }
}

.tm-inbox-item {
  padding: 1rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid var(--tm-border);
  transition: background 0.12s ease;
}

.tm-inbox-item:hover {
  background: #f8fafc;
}

.tm-inbox-item.is-selected,
.tm-inbox-item[data-selected="true"] {
  background: color-mix(in srgb, var(--tm-primary) 8%, white);
  border-left: 3px solid var(--tm-primary);
  padding-left: calc(1.25rem - 3px);
}

.tm-inbox-item:last-child {
  border-bottom: none;
}

.tm-inbox-item__from {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--tm-text);
}

.tm-inbox-item__email {
  font-size: 0.75rem;
  color: var(--tm-muted);
  margin-top: 0.125rem;
}

.tm-inbox-item__subject {
  font-size: 0.8125rem;
  color: var(--tm-muted);
  margin-top: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-inbox-item__time {
  font-size: 0.75rem;
  color: var(--tm-muted);
  flex-shrink: 0;
}

.tm-message-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fafbfc;
}

.tm-message-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--tm-muted);
}

.tm-message-empty__icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

/* Mailbox empty / loading states */
.tm-mailbox-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.groot-theme .tm-mailbox-empty {
  min-height: min(420px, 55vh);
}

.tm-mailbox-empty__visual {
  margin-bottom: 1.25rem;
}

.tm-mailbox-empty__icon {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--tm-primary);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.tm-mailbox-empty__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--tm-text);
  letter-spacing: -0.02em;
}

.tm-mailbox-empty__text {
  margin: 0;
  max-width: 22rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--tm-muted);
}

/* Animated mailbox illustration */
.tm-mailbox-anim {
  position: relative;
  width: 11rem;
  height: 8.8rem;
  margin: 0 auto;
}

.tm-mailbox-anim__svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.tm-mailbox-anim__shadow {
  transform-origin: 100px 138px;
  animation: tm-mail-shadow 2.4s ease-in-out infinite;
}

.tm-mailbox-anim__orbit {
  transform-origin: 100px 76px;
  animation: tm-mail-orbit 3s linear infinite;
}

.tm-mailbox-anim__orbit--rev {
  animation-name: tm-mail-orbit-rev;
  animation-duration: 4.5s;
}

.tm-mailbox-anim__envelope {
  transform-origin: 100px 90px;
  animation: tm-mail-envelope-float 2.2s ease-in-out infinite;
}

.tm-mailbox-anim__flap {
  transform-origin: 100px 70px;
  animation: tm-mail-flap 2.2s ease-in-out infinite;
}

.tm-mailbox-anim--waiting .tm-mailbox-anim__envelope {
  animation-duration: 2.8s;
}

.tm-mailbox-anim--waiting .tm-mailbox-anim__orbit {
  animation-duration: 5s;
}

.tm-mailbox-anim__dot--1 {
  animation: tm-mail-fly-in 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.tm-mailbox-anim__dot--2 {
  animation: tm-mail-fly-in 2.4s cubic-bezier(0.4, 0, 0.2, 1) 0.35s infinite;
}

.tm-mailbox-anim__letter--1 {
  animation: tm-mail-fly-in 2.6s cubic-bezier(0.4, 0, 0.2, 1) 0.15s infinite;
}

.tm-mailbox-anim__letter--2 {
  animation: tm-mail-fly-in 2.6s cubic-bezier(0.4, 0, 0.2, 1) 0.5s infinite;
}

.tm-mailbox-empty__icon--idle {
  width: 5.5rem;
  height: 5.5rem;
  padding: 0.75rem;
  border-radius: 50%;
  background: linear-gradient(160deg, #f8fafc 0%, #eef2f7 100%);
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tm-mailbox-empty__icon--idle svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tm-mailbox-empty--waiting .tm-mailbox-empty__visual::after,
.tm-mailbox-empty--loading .tm-mailbox-empty__visual::after {
  content: "";
  position: absolute;
  inset: -1rem -0.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.2) 0%, transparent 68%);
  animation: tm-mail-glow-pulse 2.5s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@media (prefers-reduced-motion: reduce) {
  .tm-mailbox-anim__orbit,
  .tm-mailbox-anim__orbit--rev,
  .tm-mailbox-anim__envelope,
  .tm-mailbox-anim__flap,
  .tm-mailbox-anim__shadow,
  .tm-mailbox-anim__dot--1,
  .tm-mailbox-anim__dot--2,
  .tm-mailbox-anim__letter--1,
  .tm-mailbox-anim__letter--2,
  .tm-mailbox-empty--waiting .tm-mailbox-empty__visual::after,
  .tm-mailbox-empty--loading .tm-mailbox-empty__visual::after {
    animation: none;
  }
}

.tm-mailbox-empty__visual {
  position: relative;
}

@keyframes tm-mail-orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tm-mail-orbit-rev {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes tm-mail-envelope-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes tm-mail-flap {
  0%,
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
  50% {
    transform: scaleY(0.92) translateY(2px);
    opacity: 0.85;
  }
}

@keyframes tm-mail-shadow {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 0.55;
  }
  50% {
    transform: scaleX(0.88);
    opacity: 0.35;
  }
}

@keyframes tm-mail-fly-in {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  70% {
    transform: translate(-42px, 52px) scale(0.35);
    opacity: 0.9;
  }
  100% {
    transform: translate(-48px, 58px) scale(0.15);
    opacity: 0;
  }
}

@keyframes tm-mail-glow-pulse {
  0%,
  100% {
    transform: scale(0.95);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.tm-message-header {
  padding: 1.25rem 1.5rem;
  background: var(--tm-surface);
  border-bottom: 1px solid var(--tm-border);
}

.tm-message-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--tm-text);
}

.tm-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
}

.tm-badge--primary {
  background: color-mix(in srgb, var(--tm-primary) 12%, white);
  color: var(--tm-primary);
}

.tm-badge--danger {
  background: #fef2f2;
  color: #b91c1c;
}

/* Groot mailbox table header */
.groot-theme .mailbox .head {
  background: linear-gradient(90deg, #0f172a, #334155) !important;
  border-radius: 0 !important;
}

.groot-theme .mailbox .messages > div[data-id] {
  transition: background 0.12s ease;
}

.groot-theme .mailbox .messages > div[data-id]:hover {
  background: #f1f5f9 !important;
}

/* —— Logo —— */
.tm-logo img {
  max-width: 10rem;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* —— Cookie banner —— */
#cookie.tm-cookie {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 42rem;
  padding: 1rem 1.25rem;
  background: var(--tm-surface);
  color: var(--tm-text);
  border-radius: var(--tm-radius-lg);
  box-shadow: var(--tm-shadow-lg);
  border: 1px solid var(--tm-border);
  align-items: center;
  gap: 1rem;
  z-index: 50;
}

#cookie.tm-cookie.flex {
  display: flex;
}

#cookie_close {
  flex-shrink: 0;
  padding: 0.5rem 1.25rem !important;
  background: var(--tm-primary) !important;
  color: #fff !important;
  border-radius: var(--tm-radius-sm) !important;
  font-weight: 600;
  font-size: 0.875rem;
}

/* —— Auth pages —— */
.tm-auth-card {
  box-shadow: var(--tm-shadow-lg);
  border-radius: var(--tm-radius-lg);
}

/* —— Utilities —— */
.tm-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 1rem 0;
}

.tm-container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.groot-theme header.tm-header {
  padding-top: 1.5rem;
  padding-bottom: 0;
  overflow: visible;
  z-index: 40;
}

.groot-theme header.tm-header .container,
.groot-theme header.tm-header .tm-header-actions {
  overflow: visible;
}

.tm-nav-bar {
  overflow: visible;
  position: relative;
  z-index: 35;
}

.groot-theme footer.tm-sidebar .tm-locale-switcher {
  z-index: 60;
}

.groot-theme .tm-hero-panel {
  padding: 1.5rem 0 2rem;
}

/* Scrollbar */
.tm-inbox-list::-webkit-scrollbar {
  width: 6px;
}

.tm-inbox-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--tm-primary);
  outline-offset: 2px;
}

/* Mobile nav overlay */
@media (max-width: 1023px) {
  .tm-mobile-nav-panel {
    background: var(--tm-surface);
  }
}

/* Mailbox refresh: paused until email is ready / fetch completes */
.pause-spinner {
  animation-play-state: paused;
}
