.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 100%;
}

/* Glassmorphism úprava pre auth karty nad AI pozadím */
.auth-card {
  background: color-mix(in srgb, var(--panel, #ffffff) 75%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid color-mix(in srgb, var(--line, #e2e8f0) 50%, transparent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 1;
}

.page-shell {
  width: min(calc(100% - 32px), var(--content-width));
  margin: 0 auto;
  padding: var(--space-6) 0 var(--space-8);
}

.page-shell--wide {
  width: min(calc(100% - 32px), var(--content-wide-width));
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.menu-toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.menu-toggle:hover {
  background: var(--panel-muted);
}

.menu-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
}

.menu-drawer.is-open {
  display: block;
}

.menu-drawer[hidden] {
  display: none !important;
}

.menu-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(3px);
}

.menu-drawer__panel {
  position: relative;
  width: min(340px, calc(100vw - 28px));
  height: 100%;
  padding: 18px;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: 20px 0 50px rgba(15, 23, 42, 0.18);
  animation: menu-drawer-in 0.18s ease-out;
}

.menu-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.menu-drawer__head strong {
  display: block;
  font-size: 1.15rem;
}

.menu-drawer__head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.menu-drawer__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--panel-muted);
  color: var(--text);
  cursor: pointer;
  font-size: 1.55rem;
  line-height: 1;
}

.menu-drawer__links {
  display: grid;
  gap: 6px;
  padding-top: 18px;
}

.menu-drawer__link {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.menu-drawer__link:hover {
  background: var(--panel-muted);
}

.menu-drawer__link.is-active {
  background: var(--primary);
  color: var(--primary-contrast);
}

body.menu-drawer-open {
  overflow: hidden;
}

@keyframes menu-drawer-in {
  from {
    transform: translateX(-18px);
    opacity: 0.7;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Úprava tlačidiel v hlavičke pre vzhľad menu (desktop) */
.page-header .button-row,
.page-header > div:last-child {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 22px;
  padding-top: 4px;
}

.page-header .button {
  position: relative;
  min-height: 36px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0;
  white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.page-header .button:hover {
  transform: none;
  background: transparent;
  color: var(--text);
}

.page-header .button--primary {
  background: transparent;
  color: var(--text);
}

.page-header .button--primary::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
}

.page-header .button--primary:hover {
  background: transparent;
  color: var(--text);
}

.page-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.1;
}

.page-text {
  margin: var(--space-3) 0 20px 0;
  color: var(--muted);
  line-height: 1.55;
}

.page-text--compact {
  margin: 15px 0 15px 0;
}

.eyebrow {
  margin-bottom: var(--space-3);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.button-row--stretch > * {
  flex: 1 1 220px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 48px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.button--primary {
  background: var(--primary);
  color: var(--primary-contrast);
}

.button--secondary {
  background: var(--secondary);
  color: var(--secondary-text);
}

.button--danger {
  background: #ff0000;
  color: #ffffff;
}

.stack-form {
  display: grid;
  gap: var(--space-4);
}

.field {
  display: grid;
  gap: 8px;
}

.field--top-gap {
  margin-top: var(--space-3);
}

.field-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field__label {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 15px 0 15px 0;
}

.field__label--danger {
  color: var(--color-error, #CF418A);
}

.field__help {
  font-size: 0.85rem;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.field__help--block {
  margin: 0 0 4px 0;
}

.field__help--warning {
  color: #92400e;
}

.field__input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  padding: 14px 16px;
  max-width: 100%;
}

.field__textarea {
  min-height: 0;
  height: auto;
  resize: none;
  overflow-y: hidden;
}

.field--checkbox {
  display: block;
}

.field__checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field__checkbox-row input[type="checkbox"] {
  margin: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.alert {
  margin-bottom: var(--space-4);
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
}

.alert--success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #bbf7d0;
}

.alert--error {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: #fecaca;
}

.alert--info {
  background: #eff6ff;
  color: #1e3a8a;
  border-color: #bfdbfe;
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}

.message-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 18px 22px;
  line-height: 1.6;
  font-size: 0.96rem;
  word-break: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
  width: 100%;
  box-sizing: border-box;
}

.message-box > :first-child {
  margin-top: 0;
}

.message-box > :last-child {
  margin-bottom: 0;
}

.message-box p {
  margin: 0 0 1.1em;
}

.message-box ul,
.message-box ol {
  margin: 0 0 1.1em 1.4em;
  padding: 0;
}

.message-box li + li {
  margin-top: 0.35em;
}

.message-box--mail-body {
  white-space: pre-line;
}

.message-box--attachment-group {
  white-space: normal;
}

.message-box--muted {
  background: var(--panel-muted);
}

.text-document {
  padding: 32px;
}

.text-document h2 {
  margin-top: 24px;
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.text-document p,
.text-document ul {
  margin-bottom: 16px;
  line-height: 1.6;
}

.text-document ul {
  padding-left: 24px;
}

.text-document hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}

.history-card--collapsible,
.mail-card--collapsible {
  padding-bottom: 0;
}

.mail-card--spaced {
  margin-bottom: var(--space-4);
}

.history-card__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  outline: none;
  margin-bottom: 0;
  padding: 1.5rem;
  list-style: none;
  gap: 1rem;
}

.history-card__summary::-webkit-details-marker {
  display: none;
}

.history-card__summary::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

details[open] .history-card__summary::after {
  transform: rotate(45deg);
  border-color: var(--primary);
}

.history-card__header-wrap {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-card__title {
  margin: 0;
}

.history-card__title--inline {
  display: block;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-card__meta {
  margin-top: 0.5rem;
  word-break: break-word;
}

.history-card__content {
  padding: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9em;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.history-card__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-5);
}

.history-section__stack {
  display: grid;
  gap: var(--space-3);
}

.history-section__stack + .history-section__stack {
  margin-top: var(--space-5);
}

.history-attachments {
  display: grid;
  gap: var(--space-3);
}

.history-attachments__title {
  font-weight: 600;
}

.history-attachments__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-3);
}

.history-attachments__item {
  display: grid;
  gap: 8px;
}

.history-attachments__file {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.history-attachments__name {
  font-weight: 600;
  word-break: break-word;
}

.history-attachments__meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.history-attachments__image {
  display: block;
  max-width: 100%;
  max-height: 400px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
}

.mail-card__ignore-form {
  margin-top: var(--space-5);
  margin-bottom: var(--space-5);
}

.field__control {
  position: relative;
}

.field__control .field__input {
  margin: 0;
}

.field__control--password .field__input {
  padding-right: 52px;
}

.field__toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 10px;
  padding: 0;
  line-height: 1;
}

.field__toggle-password:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.field__toggle-password:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.field__toggle-password.is-active {
  color: var(--text);
}

/* Floating labels izolované len na príslušné prvky */
.field--floating .field__control {
  position: relative;
}

.field--floating .field__input {
  padding: 24px 16px 8px 16px;
  height: 56px;
}

.field--floating .field__label {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
  pointer-events: none;
  transition: top 0.2s ease, font-size 0.2s ease, color 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.field--floating .field__input:focus ~ .field__label,
.field--floating .field__input:not(:placeholder-shown) ~ .field__label,
.field--floating .field__input:-webkit-autofill ~ .field__label {
  top: 14px;
  font-size: 0.75rem;
  color: var(--primary);
  transform: translateY(0);
}

/* Izolované štýly odkazov pre auth stránky */
.auth-link-row {
  margin-top: var(--space-4);
  text-align: center;
}

.auth-link-row.stack-form {
  gap: 8px;
}

.auth-link-row a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-link-row a:hover {
  text-decoration: underline;
}

.auth-link-row a.auth-link-secondary {
  font-weight: normal;
	color: var(--color-error, #CF418A);
  text-decoration: none;
}

.auth-link-row a.auth-link-secondary:hover {
  color: var(--color-error, #CF418A);
  text-decoration: none;
}

.auth-small-text {
  font-size: 0.85rem;
}

/* Settings Panel */
.settings-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  padding: 24px;
  background: var(--panel-muted, #f8f9fa);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.settings-panel .field {
  margin: 0;
}

.settings-panel .field__label {
  margin-top: 0;
  margin-bottom: 8px;
  display: block;
}

.settings-backup-card {
  padding: 18px;
}

.settings-backup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 22px;
  align-items: center;
}

.settings-backup__title {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
}

.settings-backup__text {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.settings-backup__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.settings-backup__actions .button {
  width: 100%;
}

.settings-backup__upload {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
}

.settings-backup__upload-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.settings-backup__file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.settings-backup__file-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel, #ffffff);
  color: var(--text);
  overflow: hidden;
}

.settings-backup__file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text, #111827) 7%, transparent);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 750;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease;
}

.settings-backup__file-name {
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-backup__file-control:hover .settings-backup__file-button {
  background: color-mix(in srgb, var(--primary, #2563eb) 12%, transparent);
}

.settings-backup__file-control:focus-within {
  border-color: color-mix(in srgb, var(--primary, #2563eb) 60%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #2563eb) 14%, transparent);
}

/* AI Background CSS */
.ai-background-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  background-color: #f4f7fb;
  background-image: linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.ai-blob {
  position: absolute;
  filter: blur(100px);
  opacity: 0.6;
  animation: blob-float 15s infinite ease-in-out alternate, blob-morph 12s infinite ease-in-out alternate;
  mix-blend-mode: multiply;
}

.ai-blob--1 {
  width: 55vw;
  height: 55vw;
  background: rgba(6, 182, 212, 0.5); /* Cyan */
  top: -10vw;
  left: -10vw;
  animation-delay: 0s;
}

.ai-blob--2 {
  width: 45vw;
  height: 45vw;
  background: rgba(139, 92, 246, 0.4); /* Violet */
  bottom: -15vw;
  right: -10vw;
  animation-delay: -4s;
}

.ai-blob--3 {
  width: 40vw;
  height: 40vw;
  background: rgba(236, 72, 153, 0.3); /* Pink */
  top: 30vh;
  left: 20vw;
  animation-delay: -8s;
}

@keyframes blob-float {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(60px, -40px) scale(1.1) rotate(5deg); }
  100% { transform: translate(-20px, 50px) scale(0.9) rotate(-5deg); }
}

@keyframes blob-morph {
  0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
  33% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
  66% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
  100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

.ai-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

/* Landing Page Styles */
.landing-layout {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-shell {
  width: min(calc(100% - 48px), 1200px);
  margin: 0 auto;
  padding: 0;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Modernizovaná Hero Sekcia */
.hero-section {
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  width: 100%;
}

/* OBRÁZOK AKO PODKLAD VEDĽA TEXTU */
.hero-image-wrapper {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  
  /* CSS Premenné na posúvanie a zmenu veľkosti - upravuj tu */
  --offset-x: ;  /* Kladné číslo posúva doľava, záporné doprava */
  --offset-y: -7%;    /* Kladné číslo posúva nadol, záporné nahor */
  --scale: 1;     /* Veľkosť (1 = 100%, 0.5 = 50% atď.) */
  --opacity: 0.4;    /* Priehľadnosť (0.0 až 1.0) */

  right: var(--offset-x);
  top: var(--offset-y);
  transform: scale(var(--scale));
  opacity: var(--opacity);
  
  width: 1000px;
  max-width: none;
}

.hero-image {
  width: 100%;
  height: auto;
  display: block;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: color-mix(in srgb, var(--panel, #ffffff) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 32px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.hero-badge__icon {
  color: var(--primary);
}

.hero-title {
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 24px 0;
  letter-spacing: -0.03em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary, #4f46e5) 0%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--muted);
  line-height: 1.6;
  max-width: 650px;
  margin: 0 auto 40px auto;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.button--glow {
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 40%, transparent);
}

.button--glass {
  background: color-mix(in srgb, var(--panel, #ffffff) 60%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid color-mix(in srgb, var(--line, #e2e8f0) 60%, transparent);
  color: var(--text);
}

.button--glass:hover {
  background: color-mix(in srgb, var(--panel, #ffffff) 90%, transparent);
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  .page-shell,
  .page-shell--wide {
    width: min(calc(100% - 24px), var(--content-width));
  }

  .field-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: start;
    gap: 12px;
  }

  .menu-toggle {
    justify-self: end;
  }

  .button-row,
  .button-row--stretch {
    display: grid;
    grid-template-columns: 1fr;
  }

  .history-card__summary {
    padding: 1rem;
  }

  .history-card__content {
    padding: 1rem;
  }

  .history-card__title--inline {
    white-space: normal;
  }

  .text-document {
    padding: 20px;
  }

  .settings-panel {
    grid-template-columns: 1fr;
    padding: 16px;
  }

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

  .settings-backup-card {
    padding: 16px;
  }
  
  .hero-image-wrapper {
    /* Prestavenie pevnej šírky na percentuálnu pre vycentrovanie na mobile */
    width: 140%;
    right: -20%;
    top: 16%;
    transform: none;
    opacity: 0.35;
    
    /* Vytvorenie masky pre okraje do stratena */
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  }
}

select[name="auto_reply_enabled"],
select[name="reply_format"],
select[name="reply_sender_email"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 52px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
}

.button--ghost {
  background: transparent;
  color: var(--secondary-text);
  border-color: var(--line);
}

.button--small {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
}

.mail-card--filters {
  margin-bottom: var(--space-4);
}

.message-box-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.message-box-toolbar--end {
  justify-content: flex-end;
}

.message-box-toolbar--section-head {
  margin-top: 0;
  margin-bottom: 16px;
}

.message-box-toolbar--foot {
  margin-top: 12px;
  margin-bottom: 0;
}

.message-box-toolbar__title {
  font-weight: 600;
}

.history-section__title {
  margin: 0 0 12px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-attachments__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-attachments__preview-link {
  display: inline-block;
}

.history-attachments__preview-link:hover .history-attachments__image {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.copy-feedback {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2000;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #bbf7d0;
  background: var(--success-bg);
  color: var(--success-text);
  box-shadow: var(--shadow);
}

@media (max-width: 760px) {
  .message-box-toolbar,
  .quick-actions,
  .history-attachments__actions {
    align-items: stretch;
  }

  .message-box-toolbar .button,
  .quick-actions .button,
  .history-attachments__actions .button {
    width: 100%;
  }
}

.reply-editor {
  position: relative;
}

.reply-editor__textarea {
  position: relative;
  z-index: 1;
  min-height: 290px;
}

.reply-editor__loading {
  position: absolute;
  inset: 1px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.96));
  backdrop-filter: blur(3px);
}

.reply-editor__loading[hidden] {
  display: none;
}

.reply-editor__loading-inner {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  max-width: 320px;
}

.reply-editor__spinner {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 3px solid rgba(15, 23, 42, 0.10);
  border-top-color: var(--primary);
  border-right-color: rgba(59, 130, 246, 0.35);
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: reply-editor-spin 0.85s linear infinite;
}

.reply-editor__loading-text {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

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


.button--is-loading {
  position: relative;
  pointer-events: none;
}

.button__loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.button__loading-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: button-spinner-rotate 0.8s linear infinite;
  flex: 0 0 16px;
}

@keyframes button-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.app-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(248, 250, 252, 0.78);
  backdrop-filter: blur(10px);
}

.app-loading-overlay[hidden] {
  display: none;
}

.app-loading-overlay__panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(360px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel, #ffffff);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  text-align: center;
}

.app-loading-overlay__spinner {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 3px solid rgba(15, 23, 42, 0.12);
  border-top-color: var(--primary, #2563eb);
  animation: button-spinner-rotate 0.8s linear infinite;
}

.app-loading-overlay__title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.app-loading-overlay__text {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
