/* tempmailOBM - Disposable Email Client */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* Light Theme (Modern oklch Color Space) */
  --bg-app: oklch(98.8% 0.002 260);
  --bg-sidebar: oklch(96.6% 0.004 260);
  --bg-card: oklch(100% 0 0);
  --bg-hover: oklch(95.4% 0.004 260);
  --bg-input: oklch(100% 0 0);
  --border-subtle: oklch(92.5% 0.006 260);
  --border-card: oklch(91.5% 0.006 260);
  --border-focus: oklch(54.6% 0.215 262.8);
  
  --text-primary: oklch(18.2% 0.008 260);
  --text-secondary: oklch(44.3% 0.012 260);
  --text-muted: oklch(64.5% 0.008 260);
  --text-faint: oklch(76.2% 0.006 260);
  
  --sidebar-active: oklch(92.2% 0.006 260);
  --sidebar-active-text: oklch(18.2% 0.008 260);
  --sidebar-hover: oklch(94.0% 0.005 260);
  
  --pill-active-bg: oklch(22.8% 0.010 265);
  --pill-active-text: oklch(100% 0 0);
  --pill-inactive-bg: transparent;
  --pill-inactive-text: oklch(44.3% 0.012 260);
  --pill-hover-bg: oklch(94.0% 0.005 260);
  
  --chip-bg: oklch(96.8% 0.003 260);
  --chip-border: oklch(92.0% 0.005 260);
  --chip-hover: oklch(93.8% 0.005 260);
  
  --accent-blue: oklch(54.6% 0.215 262.8);
  --accent-blue-light: oklch(97.0% 0.035 250);
  --accent-red: oklch(62.8% 0.225 29.2);
  --accent-red-light: oklch(93.5% 0.065 25);
  --accent-green: oklch(69.6% 0.170 162.4);
  --accent-green-light: oklch(97.2% 0.040 160);
  --accent-purple: oklch(58.5% 0.233 293.0);
  --accent-purple-light: oklch(96.8% 0.030 295);
  --accent-telegram: oklch(58.0% 0.155 242.0);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-card: 0 1px 3px oklch(0% 0 0 / 0.03), 0 2px 8px -2px oklch(0% 0 0 / 0.04);
  --shadow-float: 0 12px 30px -4px oklch(0% 0 0 / 0.10), 0 6px 16px -4px oklch(0% 0 0 / 0.06);
  --shadow-drawer: -4px 0 28px oklch(0% 0 0 / 0.10);

  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  /* Dark Theme (Modern oklch Color Space) */
  --bg-app: oklch(14.8% 0.008 260);
  --bg-sidebar: oklch(17.5% 0.009 260);
  --bg-card: oklch(20.5% 0.011 260);
  --bg-hover: oklch(24.5% 0.013 260);
  --bg-input: oklch(20.5% 0.011 260);
  --border-subtle: oklch(26.0% 0.015 260);
  --border-card: oklch(28.0% 0.016 260);
  --border-focus: oklch(62.3% 0.188 259.8);
  
  --text-primary: oklch(96.6% 0.004 260);
  --text-secondary: oklch(70.5% 0.015 260);
  --text-muted: oklch(55.2% 0.012 260);
  --text-faint: oklch(44.3% 0.012 260);
  
  --sidebar-active: oklch(25.0% 0.014 260);
  --sidebar-active-text: oklch(100% 0 0);
  --sidebar-hover: oklch(21.5% 0.012 260);
  
  --pill-active-bg: oklch(96.6% 0.004 260);
  --pill-active-text: oklch(18.2% 0.008 260);
  --pill-inactive-bg: transparent;
  --pill-inactive-text: oklch(70.5% 0.015 260);
  --pill-hover-bg: oklch(24.5% 0.013 260);
  
  --chip-bg: oklch(23.5% 0.013 260);
  --chip-border: oklch(29.5% 0.015 260);
  --chip-hover: oklch(27.0% 0.014 260);
  
  --shadow-card: 0 1px 3px oklch(0% 0 0 / 0.40), 0 2px 8px -2px oklch(0% 0 0 / 0.30);
  --shadow-float: 0 12px 30px -4px oklch(0% 0 0 / 0.60);
  --shadow-drawer: -4px 0 28px oklch(0% 0 0 / 0.45);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  letter-spacing: -0.011em;
  background-color: var(--bg-app);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* Modern Text Wrapping (Baseline / Modern Web Guidance) */
h1, h2, h3, h4, h5, h6,
.page-title,
.section-title,
.drawer-title,
.modal-title,
.auth-modal-title,
.empty-state-title,
.user-profile-username {
  text-wrap: balance;
}

p,
.empty-state-desc,
.auth-instruction,
.auth-modal-subtitle,
.modal-subtitle,
.drawer-body-text,
.task-subject-snippet {
  text-wrap: pretty;
}

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================================================
   LEFT SIDEBAR
   ========================================================================== */
.sidebar {
  width: 250px;
  min-width: 250px;
  height: 100%;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  transition: width var(--transition-normal), transform var(--transition-normal);
  z-index: 30;
}

.sidebar.collapsed {
  width: 68px;
  min-width: 68px;
  padding: 16px 10px;
}

.sidebar.collapsed .team-selector-wrapper,
.sidebar.collapsed .team-name,
.sidebar.collapsed .dropdown-arrow,
.sidebar.collapsed .header-actions,
.sidebar.collapsed .nav-link span:not(.nav-icon),
.sidebar.collapsed .nav-counter,
.sidebar.collapsed .theme-label,
.sidebar.collapsed .server-status-pill,
.sidebar.collapsed .alias-dropdown {
  display: none !important;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  gap: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  height: 36px;
  position: relative;
  min-width: 0;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.icon-btn:hover {
  background-color: var(--sidebar-hover);
  color: var(--text-primary);
}

/* Dropdown Selector */
.team-selector-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

.team-selector {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-align: left;
  anchor-name: --alias-trigger;
}

.team-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.team-selector:hover, .team-selector.open {
  background-color: var(--sidebar-hover);
}

.dropdown-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.team-selector:has(+ .alias-dropdown:popover-open) .dropdown-arrow,
.team-selector.open .dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Menu (Native Popover & CSS Anchor Positioning) */
.alias-dropdown {
  position-anchor: --alias-trigger;
  position-area: block-end span-inline-start;
  position-try-fallbacks: flip-block, flip-inline;
  top: anchor(bottom);
  left: anchor(left);
  inset: auto;
  margin: 6px 0 0 0;
  width: 270px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  color: var(--text-primary);
  padding: 0;
  display: none;
  pointer-events: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  /* Top Layer Transitions */
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.2s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  transition-behavior: allow-discrete;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
}

:is(.alias-dropdown:popover-open, .alias-dropdown.open):where(:not([data-closing])) {
  display: flex;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);

  @starting-style {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}

.alias-dropdown:not(:popover-open):not(.open) {
  display: none !important;
  pointer-events: none !important;
}

@supports not (anchor-name: --test) {
  .alias-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    margin: 0;
  }
}

.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.dropdown-header-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
}

.dropdown-count-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background-color: rgba(0, 0, 0, 0.05);
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .dropdown-count-pill {
  background-color: rgba(255, 255, 255, 0.08);
}

.alias-dropdown-list {
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}

.alias-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.alias-dropdown-item:hover {
  background-color: var(--bg-hover);
}

.alias-dropdown-item.active {
  background-color: var(--chip-bg);
}

.alias-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.alias-active-check {
  color: var(--accent-blue);
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alias-active-check svg,
.alias-active-check i {
  width: 14px;
  height: 14px;
  stroke-width: 1.75;
}

.alias-item-text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.alias-item-copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.alias-item-copy-btn svg,
.alias-item-copy-btn i {
  width: 14px;
  height: 14px;
  stroke-width: 1.75;
}

.alias-item-copy-btn:hover {
  color: var(--text-primary);
  background-color: var(--border-subtle);
}

.dropdown-footer {
  padding: 6px;
  border-top: 1px solid var(--border-subtle);
}

.dropdown-new-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.dropdown-new-btn svg,
.dropdown-new-btn i {
  width: 14px;
  height: 14px;
  stroke-width: 1.75;
}

.dropdown-new-btn:hover {
  background-color: var(--sidebar-hover);
  color: var(--text-primary);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.notif-wrapper {
  position: relative;
  flex-shrink: 0;
}

.notif-btn {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  background-color: var(--accent-red);
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.notif-badge.active {
  opacity: 1;
}

.avatar-container {
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}

.avatar svg {
  width: 100%;
  height: 100%;
}

.sidebar-nav {
  flex: 1;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-link-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-icon {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.nav-item:hover .nav-link {
  background-color: var(--sidebar-hover);
  color: var(--text-primary);
}

.nav-item:hover .nav-icon {
  color: var(--text-primary);
}

.nav-item.active .nav-link {
  background-color: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 600;
}

.nav-item.active .nav-icon {
  color: var(--sidebar-active-text);
}

.nav-counter:empty {
  display: none;
}

.nav-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background-color: rgba(0, 0, 0, 0.05);
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .nav-counter:empty {
  display: none;
}

.nav-counter {
  background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.server-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background-color: rgba(0, 0, 0, 0.03);
  font-size: 12px;
  color: var(--text-muted);
}

[data-theme="dark"] .server-status-pill {
  background-color: rgba(255, 255, 255, 0.04);
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.theme-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.theme-toggle:hover {
  background-color: var(--sidebar-hover);
  color: var(--text-primary);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 32px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.content-container {
  width: 100%;
  max-width: 680px;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Page Header */
.page-header {
  margin-bottom: 24px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab {
  background-color: var(--pill-inactive-bg);
  color: var(--pill-inactive-text);
  border: none;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-tab:hover:not(.active) {
  background-color: var(--pill-hover-bg);
  color: var(--text-primary);
}

.filter-tab.active {
  background-color: var(--pill-active-bg);
  color: var(--pill-active-text);
}

/* Command / Address Card (Container Query Root) */
.command-card {
  container-type: inline-size;
  container-name: command-card;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.command-card:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-card), 0 0 0 3px oklch(54.6% 0.215 262.8 / 0.12);
}

.input-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}

.mail-display-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.mail-icon-prefix {
  color: var(--accent-blue);
  display: flex;
  align-items: center;
}

.mail-input-active {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-main-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--pill-active-bg);
  color: var(--pill-active-text);
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  white-space: nowrap;
}

.copy-main-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.copy-main-btn:active {
  transform: translateY(0);
}

/* Quick Action Chips */
.quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.quick-actions::-webkit-scrollbar {
  display: none;
}

.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.action-chip:hover {
  background-color: var(--chip-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.action-chip:active {
  transform: translateY(0);
}

.chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.new-icon { color: var(--accent-blue); }
.refresh-icon { color: #0284c7; }
.simulate-icon { color: var(--accent-purple); }
.delete-icon { color: var(--accent-red); }

.spinning {
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Container Query: Command Card Size-Aware Styling */
@container command-card (max-width: 540px) {
  .command-card {
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    box-shadow: none;
  }

  .input-wrapper {
    margin-bottom: 10px;
  }

  .mail-display-row {
    gap: 8px;
  }

  .mail-input-active {
    font-size: 13.5px;
  }

  .copy-main-btn {
    padding: 4px 10px;
    font-size: 11.5px;
  }

  .quick-actions {
    gap: 6px;
  }

  .action-chip {
    padding: 4px 10px;
    font-size: 11.5px;
  }
}

/* ==========================================================================
   EMAIL LIST SECTION
   ========================================================================== */
.tasks-section {
  display: flex;
  flex-direction: column;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.section-title:hover {
  color: var(--accent-blue);
}

.chevron-inline {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.section-title:hover .chevron-inline {
  transform: translateX(2px);
}

.section-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.task-list {
  container-type: inline-size;
  container-name: task-list;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-item {
  display: flex;
  align-items: center;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background-color: transparent;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.task-item:hover {
  background-color: var(--bg-hover);
}

.task-main {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.task-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.task-subject-snippet {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.task-unread-dot-col {
  width: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  margin-right: 2px;
}

.task-item.unread .task-title {
  font-weight: 600;
  color: var(--text-primary);
}

.task-item.unread .task-subject-snippet {
  font-weight: 600;
  color: var(--text-primary);
}

.task-item.read .task-title {
  font-weight: 400;
  color: var(--text-secondary);
}

.task-item.read .task-subject-snippet {
  font-weight: 400;
  color: var(--text-muted);
}

.task-timestamp {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 12px;
}

.task-unread-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-blue);
  border-radius: 50%;
  transition: opacity var(--transition-fast);
}

.task-unread-dot.hidden {
  opacity: 0;
}

.task-chevron {
  color: var(--text-faint);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.task-item:hover .task-chevron {
  color: var(--text-muted);
  transform: translateX(3px);
}

/* Container Query: Task / Email Cards Size-Aware Styling */
@container task-list (max-width: 580px) {
  .task-item {
    padding: 9px 8px;
    gap: 8px;
    border-radius: var(--radius-sm);
  }

  .task-main {
    gap: 6px;
  }

  .task-title {
    font-size: 13px;
    max-width: 120px;
  }

  .task-subject-snippet {
    font-size: 12.5px;
  }

  .task-timestamp {
    font-size: 11.5px;
  }

  .task-meta {
    margin-left: 6px;
    gap: 6px;
  }
}

@container task-list (max-width: 380px) {
  .task-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .task-title {
    max-width: 100%;
  }
}

/* ==========================================================================
   VIEW 2: MIS ALIAS GRID
   ========================================================================== */
.aliases-grid {
  container-type: inline-size;
  container-name: aliases-grid;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alias-card {
  cursor: pointer;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.alias-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.alias-card.is-current {
  background-color: var(--sidebar-active);
  border-color: var(--border-card);
}

.alias-card-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.alias-card-address {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.alias-active-badge {
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background-color: var(--accent-green-light);
  color: #047857;
}

[data-theme="dark"] .alias-active-badge {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.alias-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.alias-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Container Query: Alias Cards Size-Aware Styling */
@container aliases-grid (max-width: 540px) {
  .alias-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
  }

  .alias-card-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ==========================================================================
   VIEW 4: ESTADO DEL SERVICIO (HEALTHCHECK)
   ========================================================================== */
.status-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.status-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
}

.status-badge.operative {
  color: #047857;
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .status-badge.operative {
  color: #34d399;
  background-color: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

.status-badge.degraded {
  color: #b45309;
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-badge.down {
  color: var(--accent-red);
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-meta-text {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.status-components-list {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13.5px;
}

.status-row:last-child {
  border-bottom: none;
}

.status-component-name {
  font-weight: 500;
  color: var(--text-primary);
}

.status-component-state {
  font-size: 13px;
  font-weight: 500;
}

.status-component-state.operative {
  color: #047857;
}

[data-theme="dark"] .status-component-state.operative {
  color: #34d399;
}

.status-component-state.no-data {
  color: var(--text-muted);
}

.status-component-state.degraded {
  color: #b45309;
}

.status-component-state.down {
  color: var(--accent-red);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state-subtitle {
  font-size: 13px;
}

/* ==========================================================================
   DETAIL DRAWER (Full Email Viewer)
   ========================================================================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  z-index: 50;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 740px;
  max-width: 96vw;
  height: 100vh;
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-card);
  box-shadow: var(--shadow-drawer);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  z-index: 60;
  display: flex;
  flex-direction: column;
}

.detail-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 16px;
}

.drawer-header-left {
  flex: 1;
  min-width: 0;
}

.drawer-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-blue-light);
  color: var(--accent-blue);
  margin-bottom: 6px;
}

[data-theme="dark"] .drawer-badge {
  background-color: rgba(59, 130, 246, 0.2);
}

.drawer-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.drawer-body {
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
}


/* Compact Discreet OTP Bar */
.otp-compact-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 20px 0;
  padding: 6px 12px;
  background-color: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: var(--radius-md);
  height: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.otp-compact-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.otp-compact-icon {
  width: 14px;
  height: 14px;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.otp-compact-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.otp-compact-code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  background-color: rgba(37, 99, 235, 0.15);
  color: var(--accent-blue);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.8px;
}

.otp-compact-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.otp-compact-btn i {
  width: 12px;
  height: 12px;
}

.otp-compact-btn:hover {
  background-color: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

/* OTP Code Feature Card */
.otp-card {
  background: linear-gradient(in oklch 135deg, oklch(54.6% 0.215 262.8 / 0.08), oklch(58.5% 0.233 293 / 0.08));
  border: 1px solid oklch(54.6% 0.215 262.8 / 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.otp-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.otp-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.otp-code {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.otp-copy-btn {
  background-color: var(--accent-blue);
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.otp-copy-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.drawer-meta-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  row-gap: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  padding: 14px 16px;
  background-color: var(--bg-app);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.drawer-meta-label {
  color: var(--text-muted);
  font-weight: 500;
}

.drawer-meta-value {
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-all;
}

.drawer-email-body {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
  background-color: var(--bg-card);
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  white-space: pre-wrap;
  word-break: break-word;
}

.drawer-actions-row {
  margin-top: 24px;
  display: flex;
  gap: 10px;
}

/* Toast */
.toast-popup {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background-color: var(--pill-active-bg);
  color: var(--pill-active-text);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
  z-index: 100;
}

.toast-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    height: 100%;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    padding: 24px 16px;
  }
}

/* ==========================================================================
   LUCIDE OUTLINE ICON SYSTEM (Consistent 1.75px stroke, no fill, clean geometry)
   ========================================================================== */
svg.lucide, i[data-lucide] svg {
  stroke-width: 1.75px !important;
  fill: none !important;
  stroke: currentColor;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-btn svg.lucide {
  width: 17px;
  height: 17px;
}

.nav-icon svg.lucide, .nav-icon.lucide {
  width: 17px;
  height: 17px;
}

.dropdown-arrow svg.lucide, .dropdown-arrow.lucide {
  width: 13px;
  height: 13px;
}

.avatar-outline {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: transparent;
  transition: border-color var(--transition-fast), color var(--transition-fast);
  overflow: hidden;
  padding: 0;
}

.avatar-outline img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.avatar-outline:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.avatar-outline svg.lucide {
  width: 15px;
  height: 15px;
}

.mail-icon-prefix svg.lucide {
  width: 17px;
  height: 17px;
}

.copy-main-btn svg.lucide {
  width: 14px;
  height: 14px;
}

.action-chip svg.lucide {
  width: 14px;
  height: 14px;
}

.chevron-inline svg.lucide, .chevron-inline.lucide {
  width: 15px;
  height: 15px;
}

.task-chevron svg.lucide, .task-chevron.lucide {
  width: 14px;
  height: 14px;
}

.task-checkbox svg.lucide {
  width: 12px;
  height: 12px;
  stroke: #ffffff !important;
}

.task-tag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: transparent !important;
  color: var(--accent-red);
  flex-shrink: 0;
}

.task-tag-badge svg.lucide {
  width: 14px;
  height: 14px;
  stroke: var(--accent-red) !important;
}

.server-icon-badge svg.lucide {
  width: 18px;
  height: 18px;
}

.alias-active-check svg.lucide {
  width: 13px;
  height: 13px;
  stroke: var(--accent-blue) !important;
}

.alias-item-copy-btn svg.lucide {
  width: 13px;
  height: 13px;
}

.dropdown-new-btn svg.lucide {
  width: 14px;
  height: 14px;
}

.status-live-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--accent-green-light);
  color: #047857;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
}

[data-theme="dark"] .status-live-banner {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

/* ==========================================================================
   NOTIFICATIONS POPOVER & BROWSER PERMISSIONS
   ========================================================================== */
.notif-wrapper {
  position: relative;
}

#notifBtn {
  anchor-name: --notif-trigger;
}

#mobileNotifBtn {
  anchor-name: --mobile-notif-trigger;
}

/* Global Notifications Popover (Native Popover API & CSS Anchor Positioning) */
.notif-popover {
  position-anchor: --notif-trigger;
  position-area: block-end span-inline-end;
  position-try-fallbacks: flip-block, flip-inline;
  top: anchor(bottom);
  right: anchor(right);
  inset: auto;
  margin: 8px 0 0 0;
  width: 330px;
  max-width: calc(100vw - 28px);
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  color: var(--text-primary);
  padding: 0;
  display: none;
  pointer-events: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  /* Top Layer Transitions */
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.2s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  transition-behavior: allow-discrete;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

:is(.notif-popover:popover-open, .notif-popover.open):where(:not([data-closing])) {
  display: flex;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);

  @starting-style {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.notif-popover:not(:popover-open):not(.open) {
  display: none !important;
  pointer-events: none !important;
}

@supports not (anchor-name: --test) {
  .notif-popover {
    position: fixed;
    top: 54px;
    left: 140px;
    margin: 0;
  }
}

.notif-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.notif-popover-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.notif-popover-bell-icon {
  width: 15px;
  height: 15px;
  color: var(--accent-blue);
}

.notif-popover-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.notif-clear-btn {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}

.notif-clear-btn:hover {
  color: var(--text-primary);
}

.notif-toggle-btn.granted {
  background-color: var(--chip-bg);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.notif-items-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notif-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background-color: transparent;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.notif-item:hover {
  background-color: var(--bg-hover);
}

.notif-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.notif-item-sender {
  font-weight: 600;
  color: var(--text-primary);
}

.notif-item-time {
  font-size: 11px;
  color: var(--text-muted);
}

.notif-item-subject {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-empty {
  padding: 20px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE ARCHITECTURE
   ========================================================================== */
.main-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

.mobile-top-bar {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   TABLET & MOBILE RESPONSIVE DESIGN (Pixel-perfect & clean)
   ========================================================================== */

/* Tablets (max-width: 1024px) */
@media (max-width: 1024px) {
  .detail-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(640px, 92vw);
    max-width: 85vw;
    z-index: 70;
  }

  .content-container {
    max-width: 100%;
  }

  .aliases-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* Mobile & Small Tablets Viewport Layout (max-width: 768px) */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }

  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 12px;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    z-index: 30;
  }

  .mobile-top-alias {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    letter-spacing: -0.01em;
  }

  .mobile-top-alias:active {
    opacity: 0.65;
  }

  .mobile-actions {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 80vw;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-drawer);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    padding: 16px 14px 40px;
    height: calc(100vh - 48px);
    justify-content: flex-start;
  }

  .content-container {
    width: 100%;
    max-width: 100%;
  }

  .page-header {
    margin-bottom: 16px;
  }

  .page-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
  }

  .filter-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .filter-tab {
    padding: 4px 12px;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .tasks-section .section-header {
    margin-bottom: 8px;
  }

  .section-title {
    font-size: 14px;
  }

  .detail-drawer {
    width: 100vw;
    max-width: 100vw;
    border-left: none;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .drawer-header {
    height: 48px;
    padding: 0 16px;
  }

  .drawer-body {
    padding: 0 0 24px;
    overflow-x: hidden;
  }

  .notif-popover {
    left: auto;
    right: 10px;
    top: 52px;
    width: min(320px, calc(100vw - 20px));
    border-radius: 8px;
  }

  .alias-dropdown {
    width: 250px;
  }
}

@keyframes rowFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-6px);
    background-color: rgba(37, 99, 235, 0.12);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    background-color: transparent;
  }
}

.task-item.just-arrived {
  animation: rowFadeIn 0.7s ease-out;
}


/* ==========================================================================
   GMAIL-STYLE EMAIL VIEWER
   ========================================================================== */
.drawer-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gmail-header {
  padding: 16px 24px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
}

.gmail-sender-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.gmail-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--accent-blue);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gmail-sender-info {
  flex: 1;
  min-width: 0;
}

.gmail-sender-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.gmail-sender-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.gmail-from-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 6px;
  font-weight: 400;
}

.gmail-date {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.gmail-to-recipient {
  font-size: 12px;
  color: var(--text-secondary);
}

.gmail-body-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  background-color: #ffffff;
}

.gmail-body-iframe {
  width: 100%;
  height: 100%;
  min-height: 520px;
  flex: 1;
  border: none;
  background-color: #ffffff;
}

.gmail-plain-body {
  padding: 24px;
  font-size: 14px;
  line-height: 1.65;
  color: #202124;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background-color: #ffffff;
  flex: 1;
}

.drawer-actions-bar {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

/* ==========================================================================
   TELEGRAM AUTH & USER PROFILE MODAL (Native <dialog> Element)
   ========================================================================== */
dialog:not([open]) {
  display: none !important;
}

dialog.auth-modal {
  width: 100%;
  max-width: 420px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  padding: 22px 20px 20px;
  margin: auto;
  color: var(--text-primary);
  flex-direction: column;
  gap: 16px;
  /* Top layer transitions */
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.22s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  transition-behavior: allow-discrete;
  opacity: 0;
  transform: scale(0.96) translateY(6px);
}

dialog.auth-modal[open] {
  display: flex;
}

dialog.auth-modal[open]:where(:not([data-closing])) {
  opacity: 1;
  transform: scale(1) translateY(0);

  @starting-style {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
}

dialog.auth-modal::backdrop {
  background-color: oklch(0% 0 0 / 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: 0.22s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  transition-behavior: allow-discrete;
}

dialog.auth-modal[open]:where(:not([data-closing]))::backdrop {
  background-color: oklch(0% 0 0 / 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  @starting-style {
    background-color: oklch(0% 0 0 / 0);
    backdrop-filter: blur(0px);
  }
}

.auth-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-header-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: #2481cc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-header-icon svg {
  width: 17px;
  height: 17px;
}

.auth-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.auth-modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

.auth-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Telegram Direct Button */
.tg-login-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2481cc;
  color: #ffffff;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(36, 129, 204, 0.25);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.tg-login-btn:hover {
  opacity: 0.93;
  transform: translateY(-1px);
}

.tg-login-btn:active {
  transform: translateY(0);
}

.tg-login-btn-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tg-btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.tg-btn-texts {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.tg-btn-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
}

.tg-btn-sub {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 400;
}

.tg-btn-arrow {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}

/* Waiting pulse box */
.auth-waiting-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

.auth-waiting-text {
  font-weight: 500;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 2px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 10px;
}

/* Code section */
.auth-code-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-instruction {
  font-size: 12px;
  color: var(--text-muted);
}

.auth-instruction code {
  font-family: var(--font-mono);
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 11.5px;
}

.auth-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-code-input {
  flex: 1;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-align: center;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-code-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.auth-code-submit-btn {
  height: 38px;
  padding: 0 16px;
  cursor: pointer;
  white-space: nowrap;
}

.auth-error-msg {
  font-size: 12px;
  color: var(--accent-red);
  min-height: 16px;
}

/* Auth Navigation Tabs (Telegram vs Web User) */
/* Auth Navigation Tabs (Unified Segmented Control) */
.auth-nav-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  margin-bottom: 8px;
}

.auth-nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: inherit;
  outline: none;
}

.auth-nav-tab:hover:not(.active) {
  color: var(--text-primary);
  background-color: var(--chip-hover);
}

.auth-nav-tab.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px oklch(0% 0 0 / 0.08), 0 1px 2px oklch(0% 0 0 / 0.04);
}

[data-theme="dark"] .auth-nav-tab.active {
  box-shadow: 0 1px 3px oklch(0% 0 0 / 0.35);
}

.auth-nav-tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

@media (max-width: 400px) {
  .auth-nav-tab {
    font-size: 11.5px;
    padding: 6px 2px;
    gap: 4px;
  }
  .auth-nav-tab svg {
    width: 13px;
    height: 13px;
  }
}

/* Semantic Form Elements */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.auth-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.auth-input-text {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-family: inherit;
}

.auth-input-text::placeholder {
  color: var(--text-muted);
  font-size: 13px;
}

.auth-input-text:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px oklch(54.6% 0.215 262.8 / 0.12);
}

/* Password with Toggle */
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrap .auth-input-text {
  padding-right: 38px;
}

.toggle-password-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.toggle-password-btn:hover {
  color: var(--text-primary);
}

.toggle-password-btn svg {
  width: 16px;
  height: 16px;
}

.auth-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  margin-top: 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--accent-blue);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 2px 8px oklch(54.6% 0.215 262.8 / 0.25);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  font-family: inherit;
}

.auth-submit-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.auth-submit-btn svg {
  width: 16px;
  height: 16px;
}

/* Auth Footer Switch Link */
.auth-form-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 2px;
}

.auth-inline-link {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity var(--transition-fast);
}

.auth-inline-link:hover {
  opacity: 0.8;
}

/* User Profile Logged-in View (Container Query Root) */
.user-profile-card {
  container-type: inline-size;
  container-name: profile-card;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #2481cc;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  overflow: hidden;
}

.user-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.user-profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-profile-username {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 0;
  background: transparent !important;
  border: none !important;
}

.user-role-badge.admin {
  background: transparent !important;
  color: var(--text-secondary);
  border: none !important;
}

.user-role-badge.admin svg,
.user-role-badge.admin i {
  color: #f59e0b;
  width: 14px;
  height: 14px;
}

[data-theme="dark"] .user-role-badge.admin {
  background: transparent !important;
  color: var(--text-secondary);
  border: none !important;
}

[data-theme="dark"] .user-role-badge.admin svg,
[data-theme="dark"] .user-role-badge.admin i {
  color: #fbbf24;
}

.user-role-badge.vip {
  background: transparent !important;
  color: var(--text-secondary);
  border: none !important;
}

.user-role-badge.vip svg,
.user-role-badge.vip i {
  color: var(--accent-purple);
  width: 14px;
  height: 14px;
}

[data-theme="dark"] .user-role-badge.vip {
  background: transparent !important;
  color: var(--text-secondary);
  border: none !important;
}

.user-role-badge.standard {
  background: transparent !important;
  color: var(--text-muted);
  border: none !important;
}

.user-role-badge.standard svg,
.user-role-badge.standard i {
  color: var(--accent-green);
  width: 14px;
  height: 14px;
}

[data-theme="dark"] .user-role-badge.standard {
  background: transparent !important;
  color: var(--text-muted);
  border: none !important;
}

.user-profile-id {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.user-profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.profile-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 4px;
}

.profile-stat-box .stat-number {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.profile-stat-box .stat-label {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 1px;
}

/* Container Query: User Profile Card Size-Aware Styling */
@container profile-card (max-width: 380px) {
  .user-profile-stats-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .user-profile-header {
    gap: 10px;
  }
}

.profile-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.profile-sync-btn, .profile-logout-btn {
  cursor: pointer;
  font-size: 12px;
}

/* Avatar Logged In Indicator */
.avatar-outline.logged-in {
  border-color: #2481cc;
  background-color: rgba(36, 129, 204, 0.1);
  color: #2481cc;
  font-weight: 700;
  font-size: 12px;
}

[data-theme="dark"] .avatar-outline.logged-in {
  background-color: rgba(36, 129, 204, 0.2);
  color: #60a5fa;
  border-color: #3b82f6;
}

/* ==========================================================================
   PLANS & SUBSCRIPTION STYLING (Whop Integration)
   ========================================================================== */

.sub-header-badge-row {
  margin-bottom: 8px;
}

.sub-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: oklch(93% 0.05 260);
  color: var(--accent-blue);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.sub-tag-pill svg {
  width: 13px;
  height: 13px;
}

[data-theme="dark"] .sub-tag-pill {
  background-color: oklch(25% 0.06 260);
  color: oklch(75% 0.15 255);
}

.nav-badge-pro {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: auto;
  letter-spacing: 0.5px;
}

.sub-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 14px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.sub-status-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-status-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--chip-bg);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sub-status-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.sub-status-detail {
  font-size: 12px;
  color: var(--text-muted);
}

/* Modality Toggle Tabs */
.pricing-mode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 28px 0 24px;
  gap: 10px;
}

.pricing-mode-tabs {
  display: inline-flex;
  background-color: var(--chip-bg);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.pricing-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pricing-mode-btn svg {
  width: 14px;
  height: 14px;
}

.pricing-mode-btn:hover {
  color: var(--text-primary);
}

.pricing-mode-btn.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.pricing-mode-explainer {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  max-width: 500px;
  line-height: 1.4;
  text-wrap: pretty;
}

/* Pricing Cards Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.pricing-card {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-blue);
}

.pricing-card.popular {
  border: 2px solid var(--accent-blue);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
}

.pricing-card.vip {
  border: 2px solid #8b5cf6;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.03) 0%, transparent 100%), var(--bg-card);
}

.pricing-popular-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent-blue);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-vip-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-card-header {
  margin-bottom: 20px;
}

.pricing-card-tier {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.pricing-card-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 8px;
}

.pricing-card-price .currency {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.pricing-card-price .amount {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.pricing-card-price .period {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 4px;
}

.pricing-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  min-height: 36px;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.pricing-features li svg {
  color: var(--accent-green);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pricing-card-footer {
  margin-top: auto;
}

.pricing-buy-btn {
  width: 100%;
  padding: 10px 16px;
  background-color: var(--chip-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.pricing-buy-btn svg {
  width: 15px;
  height: 15px;
}

.pricing-buy-btn:hover {
  background-color: var(--sidebar-hover);
  border-color: var(--border-focus);
}

.pricing-buy-btn.popular-btn {
  background-color: var(--accent-blue);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.pricing-buy-btn.popular-btn:hover {
  opacity: 0.92;
}

.pricing-buy-btn.vip-btn {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.pricing-buy-btn.vip-btn:hover {
  opacity: 0.92;
}

/* Manual License Redemption Card */
.redeem-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.redeem-card-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.redeem-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.redeem-icon-wrap svg {
  width: 20px;
  height: 20px;
}

.redeem-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.redeem-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0;
}

.redeem-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.redeem-input {
  flex: 1;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  text-transform: uppercase;
}

.redeem-input:focus {
  border-color: var(--border-focus);
}

.redeem-submit-btn {
  padding: 10px 20px;
  background-color: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity var(--transition-fast);
}

.redeem-submit-btn svg {
  width: 15px;
  height: 15px;
}

.redeem-submit-btn:hover {
  opacity: 0.92;
}

/* Whop Checkout Modal */
.checkout-modal[open] {
  display: block;
}

.checkout-modal {
  width: 440px;
  max-width: calc(100vw - 32px);
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-float);
  color: var(--text-primary);
  margin: auto;
}

.checkout-modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

.checkout-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.checkout-modal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkout-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkout-badge-icon svg {
  width: 18px;
  height: 18px;
}

.checkout-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.checkout-modal-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.checkout-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkout-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
}

.checkout-help {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.checkout-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.checkout-input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.checkout-email-input {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 38px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

.checkout-email-input:focus {
  border-color: var(--border-focus);
}

.checkout-tg-status {
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.checkout-pay-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #ff5e3a, #ff2a6d);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(255, 94, 58, 0.3);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.checkout-pay-btn:hover {
  opacity: 0.93;
  transform: translateY(-1px);
}

.checkout-guarantee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-faint);
}

.checkout-guarantee svg {
  width: 13px;
  height: 13px;
}

/* Checkout Proration & Extra Key Elements */
.checkout-proration-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0;
}

.checkout-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.4;
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
}

.checkout-info-banner.warning {
  border-color: rgba(234, 179, 8, 0.35);
  background-color: rgba(234, 179, 8, 0.08);
  color: var(--text-primary);
}

.checkout-info-banner.warning .banner-icon {
  color: #eab308;
}

.checkout-info-banner.info {
  border-color: rgba(37, 99, 235, 0.35);
  background-color: rgba(37, 99, 235, 0.08);
  color: var(--text-primary);
}

.checkout-info-banner.info .banner-icon {
  color: var(--accent-blue);
}

.checkout-info-banner .banner-icon svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 1px;
}

.checkout-info-banner .banner-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}

.checkout-info-banner .banner-desc {
  color: var(--text-secondary);
  font-size: 12px;
}

.checkout-upgrade-card {
  background-color: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upgrade-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upgrade-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.upgrade-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.upgrade-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.upgrade-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upgrade-option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.upgrade-option-label:hover {
  border-color: var(--border-focus);
}

.upgrade-option-label.selected {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

.upgrade-option-label input[type="radio"] {
  cursor: pointer;
  accent-color: var(--accent-blue);
}

.upgrade-option-label .option-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.upgrade-option-label .option-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.upgrade-option-label .option-math {
  font-size: 11px;
  color: var(--text-muted);
}

.upgrade-option-label .option-price {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}


/* ==========================================================================
   VIEW 5: RECEIPT & PROOF OF FULFILLMENT
   ========================================================================== */
.receipt-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
}

.receipt-card {
  width: 100%;
  max-width: 760px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.receipt-success-pill {
  background: rgba(46, 160, 67, 0.15) !important;
  color: #3fb950 !important;
  border: 1px solid rgba(46, 160, 67, 0.35) !important;
}

.receipt-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.receipt-badge-delivered {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(46, 160, 67, 0.15);
  border: 1px solid rgba(46, 160, 67, 0.35);
  color: #3fb950;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.receipt-date-id {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 12px;
  color: var(--text-muted);
}

.receipt-id-tag {
  font-family: monospace;
  font-size: 12.5px;
  color: var(--text-primary);
  font-weight: 600;
}

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.receipt-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.receipt-item-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.receipt-item-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.receipt-item-value.highlight {
  color: var(--accent-blue);
  font-size: 15px;
}

.receipt-item-value.monospace {
  font-family: monospace;
  font-size: 13px;
}

.receipt-license-section {
  padding: 18px;
  background: rgba(88, 166, 255, 0.05);
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.receipt-license-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.receipt-license-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-blue);
}

.receipt-license-status {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(46, 160, 67, 0.15);
  color: #3fb950;
  font-weight: 600;
}

.receipt-license-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.receipt-license-code {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  color: #58a6ff;
  letter-spacing: 1.5px;
}

.receipt-license-help {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.receipt-audit-box {
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.receipt-audit-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.receipt-audit-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.receipt-audit-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-primary);
}

.receipt-audit-list .check-icon {
  width: 14px;
  height: 14px;
  color: #3fb950;
  flex-shrink: 0;
}

.receipt-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
}

@media print {
  body * {
    visibility: hidden;
  }
  #viewReceipt, #viewReceipt * {
    visibility: visible;
  }
  #viewReceipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .receipt-actions {
    display: none !important;
  }
}

.domain-selector {
  appearance: auto;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background-color: var(--chip-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.domain-selector:hover,
.domain-selector:focus {
  border-color: var(--accent-blue);
}
