:root {
  color-scheme: dark;
  --page-bg: #07111f;
  --page-bg-2: #0d1b2d;
  --panel-bg: rgba(8, 18, 34, 0.72);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-soft: rgba(255, 255, 255, 0.68);
  --accent: #7cc4ff;
  --accent-strong: #4ea6ff;
}

html, body {
  min-height: 100%;
}

body.inbox-page,
body.editor-page {
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at top left, rgba(78, 166, 255, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(124, 196, 255, 0.12), transparent 24%),
    linear-gradient(145deg, var(--page-bg), var(--page-bg-2));
  color: #fff;
}

.click-cont {
  min-height: 100vh;
}

.auth-shell {
  position: relative;
  overflow: hidden;
}

.auth-glow {
  position: absolute;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.28;
  pointer-events: none;
}

.auth-glow-left {
  top: -6rem;
  left: -6rem;
  background: rgba(78, 166, 255, 0.25);
}

.auth-glow-right {
  right: -4rem;
  bottom: -7rem;
  background: rgba(124, 196, 255, 0.18);
}

.eyebrow {
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.feature-pill {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
}

.auth-panel {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 1.5rem;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.status-message {
  padding: 0.85rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(124, 196, 255, 0.22);
  background: rgba(124, 196, 255, 0.08);
  color: #d6ecff;
}

.status-message-success {
  border-color: rgba(124, 196, 255, 0.22);
  background: rgba(124, 196, 255, 0.08);
  color: #d6ecff;
}

.status-message-error {
  border-color: rgba(255, 124, 124, 0.24);
  background: rgba(255, 124, 124, 0.08);
  color: #ffd8d8;
}

.auth-input {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-radius: 0.95rem;
  padding: 0.95rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.auth-input:focus {
  outline: none;
  border-color: rgba(124, 196, 255, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(78, 166, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.auth-button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.95rem;
  padding: 0.95rem 1rem;
  background: linear-gradient(135deg, #3f91ff, #8fd0ff);
  color: #04101c;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
  transition: box-shadow 0.15s ease;
  box-shadow: 0 12px 24px rgba(78, 166, 255, 0.24);
}

.auth-button:hover {
  box-shadow: 0 16px 28px rgba(78, 166, 255, 0.3);
}

.auth-button:focus-visible {
  outline: 3px solid rgba(124, 196, 255, 0.4);
  outline-offset: 3px;
}

.form-label {
  letter-spacing: 0.02em;
}

.inbox-page {
  color: #fff;
}

.inbox-shell {
  position: relative;
  overflow: hidden;
  height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(78, 166, 255, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(124, 196, 255, 0.1), transparent 22%),
    linear-gradient(145deg, var(--page-bg), var(--page-bg-2));
}

.inbox-shell > .container-fluid,
.editor-shell > .container-fluid {
  height: 100%;
  box-sizing: border-box;
}

.inbox-glow {
  position: absolute;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.24;
  pointer-events: none;
}

.inbox-glow-left {
  top: -7rem;
  left: -6rem;
  background: rgba(78, 166, 255, 0.24);
}

.inbox-glow-right {
  right: -5rem;
  bottom: -8rem;
  background: rgba(124, 196, 255, 0.14);
}

.inbox-layout {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
}

.inbox-sidebar,
.inbox-content {
  background: rgba(8, 18, 34, 0.68);
  border: 1px solid var(--panel-border);
  border-radius: 1.5rem;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.inbox-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding-block: 1.35rem;
  overflow: hidden;
}

.inbox-sidebar-scroll,
.table-shell-scroll,
.editor-workspace-scroll {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.34) transparent;
}

.inbox-sidebar-scroll {
  overflow: auto;
}

.inbox-sidebar-scroll-inner {
  min-height: 100%;
  padding-top: 0.15rem;
  padding-inline: 1.15rem;
}

.inbox-sidebar-scroll::-webkit-scrollbar,
.table-shell-scroll::-webkit-scrollbar,
.editor-workspace-scroll::-webkit-scrollbar,
.pdf-thumbnail-strip::-webkit-scrollbar,
.pdf-render-shell::-webkit-scrollbar {
  width: 0.7rem;
  height: 0.7rem;
}

.inbox-sidebar-scroll::-webkit-scrollbar-track,
.table-shell-scroll::-webkit-scrollbar-track,
.editor-workspace-scroll::-webkit-scrollbar-track,
.pdf-thumbnail-strip::-webkit-scrollbar-track,
.pdf-render-shell::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

.inbox-sidebar-scroll::-webkit-scrollbar-thumb,
.table-shell-scroll::-webkit-scrollbar-thumb,
.editor-workspace-scroll::-webkit-scrollbar-thumb,
.pdf-thumbnail-strip::-webkit-scrollbar-thumb,
.pdf-render-shell::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  border: 0;
  background-clip: padding-box;
}

.inbox-sidebar-scroll::-webkit-scrollbar-thumb:hover,
.table-shell-scroll::-webkit-scrollbar-thumb:hover,
.editor-workspace-scroll::-webkit-scrollbar-thumb:hover,
.pdf-thumbnail-strip::-webkit-scrollbar-thumb:hover,
.pdf-render-shell::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.46);
}

.sidebar-nav {
  margin-bottom: 1.25rem;
}

.inbox-page .sidebar-nav,
.editor-page .sidebar-nav {
  margin-top: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 0.95rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.15s ease, border-color 0.15s ease;
  min-width: 0;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 196, 255, 0.16);
}

.sidebar-link span,
.folder-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.5);
}

.editor-page .sidebar-link {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  white-space: normal;
}

.editor-page .sidebar-link span {
  width: 100%;
  color: rgba(255, 255, 255, 0.72);
  text-overflow: clip;
  white-space: normal;
}

.editor-page .sidebar-link span:last-child {
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.8rem;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 1rem 0 1.25rem;
}

.sidebar-label {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.46);
}

.folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.1rem;
  color: rgba(255, 255, 255, 0.82);
  min-width: 0;
}

.editor-page .folder-row {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.25rem;
  padding: 0.85rem 0.1rem;
}

.editor-page .folder-row span {
  width: 100%;
  color: rgba(255, 255, 255, 0.82);
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.editor-page .folder-row span:first-child {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.46);
}

.editor-page .folder-row span:last-child {
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.45;
  word-break: break-word;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1.15rem 1.15rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.account-menu {
  position: relative;
}

.account-menu-trigger {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.account-menu-trigger:focus-visible {
  outline: none;
}

.account-menu-trigger-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
}

.account-menu-trigger-label {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.72rem;
  font-weight: 700;
}

.account-menu-trigger-email {
  font-size: 0.92rem;
  line-height: 1.35;
  word-break: break-word;
}

.account-menu-trigger-icon {
  flex: none;
  color: rgba(255, 255, 255, 0.66);
  font-size: 1rem;
  line-height: 1;
}

.account-menu-popover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.45rem);
  display: grid;
  gap: 0.7rem;
  padding: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 1rem;
  background: rgba(8, 18, 34, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  z-index: 5;
}

.account-menu.is-open .account-menu-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.account-menu-popover-label {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 700;
}

.account-menu-settings,
.account-menu-theme,
.account-menu-logout {
  width: 100%;
  box-sizing: border-box;
}

.account-menu-settings,
.account-menu-theme {
  height: 3.25rem;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.account-menu-settings:hover,
.account-menu-settings:focus-visible,
.account-menu-theme:hover,
.account-menu-theme:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 196, 255, 0.16);
}

.inbox-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.inbox-header,
.inbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.meta-pill,
.compose-link,
.search-shell,
.message-tag {
  border-radius: 999px;
}

.meta-pill,
.compose-link {
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
}

.compose-link {
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.55);
}

.search-icon {
  font-size: 1rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.45);
}

.message-list {
  margin-top: 0.25rem;
}

.message-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1rem 1rem 0.85rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.message-row:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 196, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.message-row.unread .message-subject,
.message-row.unread .message-topline strong {
  color: #fff;
}

.message-status {
  width: 10px;
  height: 10px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 196, 255, 0.12);
}

.message-status.muted {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: none;
}

.message-main {
  min-width: 0;
}

.message-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.92rem;
}

.message-subject {
  margin-top: 0.35rem;
  margin-bottom: 0.3rem;
  font-size: 1.02rem;
  color: rgba(255, 255, 255, 0.88);
}

.message-snippet {
  color: rgba(255, 255, 255, 0.56);
  line-height: 1.45;
}

.message-tag {
  align-self: start;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(124, 196, 255, 0.16);
  background: rgba(124, 196, 255, 0.08);
  color: #d6ecff;
  font-size: 0.82rem;
  white-space: nowrap;
}

.message-tag.soft {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.75);
}

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

  .inbox-sidebar {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .inbox-content,
  .inbox-sidebar {
    padding: 1.1rem;
  }

  .inbox-header,
  .inbox-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .message-row {
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .message-tag {
    grid-column: 2;
    justify-self: start;
  }
}

.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  color: #04101c;
  background: linear-gradient(135deg, #3f91ff, #8fd0ff);
  border-radius: 0.95rem;
  padding: 0.9rem 1rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(78, 166, 255, 0.24);
  transition: box-shadow 0.15s ease;
}

.logout-link:hover {
  box-shadow: 0 16px 28px rgba(78, 166, 255, 0.3);
}

.table-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-block: 1.35rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.table-shell-scroll {
  overflow: auto;
}

.mail-table {
  width: 100%;
  border-collapse: collapse;
}

.mail-table thead th {
  padding: 0;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sort-trigger {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  padding: 1rem 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: left;
  transition: color 0.15s ease, background 0.15s ease;
}

.sort-trigger:hover,
.sort-trigger.is-sorted {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.sort-trigger:focus-visible {
  outline: 3px solid rgba(124, 196, 255, 0.35);
  outline-offset: -3px;
}

.sort-indicator {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0;
}

.mail-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mail-row {
  transition: background 0.15s ease, transform 0.15s ease;
}

.mail-row[data-href] {
  cursor: pointer;
}

.mail-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.mail-row:focus-visible {
  outline: 2px solid rgba(124, 196, 255, 0.35);
  outline-offset: -2px;
  background: rgba(255, 255, 255, 0.05);
}

.mail-row.unread .mail-subject-cell,
.mail-row.unread .mail-company-cell,
.mail-row.unread .mail-email-cell {
  color: #fff;
  font-weight: 700;
}

.mail-row td {
  padding: 1rem;
  vertical-align: middle;
  color: rgba(255, 255, 255, 0.8);
}

.mail-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 196, 255, 0.12);
}

.mail-dot.muted {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: none;
}

.mail-subject-cell,
.mail-company-cell,
.mail-email-cell,
.mail-confidence-cell,
.mail-received-cell,
.mail-status-cell {
  white-space: nowrap;
}

.mail-subject-cell,
.mail-company-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

.mail-email-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

.mail-title-link {
  color: inherit;
  text-decoration: none;
}

.mail-preview-cell {
  color: rgba(255, 255, 255, 0.56);
}

.mail-received-cell {
  color: rgba(255, 255, 255, 0.62);
}

.mail-confidence-cell {
  color: rgba(255, 255, 255, 0.82);
  font-variant-numeric: tabular-nums;
}

.mail-status-cell {
  width: 1%;
}

@media (max-width: 992px) {
  .mail-table thead {
    display: none;
  }

  .mail-table,
  .mail-table tbody,
  .mail-table tr,
  .mail-table td {
    display: block;
    width: 100%;
  }

  .mail-row {
    padding: 0.5rem 0;
  }

  .mail-row td {
    padding: 0.55rem 1rem;
    white-space: normal;
  }

  .mail-subject-cell::before,
  .mail-company-cell::before,
  .mail-email-cell::before,
  .mail-confidence-cell::before,
  .mail-received-cell::before,
  .mail-status-cell::before {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
  }

  .mail-subject-cell::before { content: 'Subject'; }
  .mail-company-cell::before { content: 'Company'; }
  .mail-email-cell::before { content: 'Broker email'; }
  .mail-confidence-cell::before { content: 'Confidence'; }
  .mail-received-cell::before { content: 'Received'; }
  .mail-status-cell::before { content: 'Status'; }

  .mail-subject-cell,
  .mail-company-cell,
  .mail-email-cell,
  .mail-confidence-cell,
  .mail-received-cell,
  .mail-status-cell {
    display: block;
    max-width: none;
  }
}

.editor-page {
  color: #fff;
}

.editor-shell {
  position: relative;
  overflow: hidden;
  height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(78, 166, 255, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(124, 196, 255, 0.1), transparent 22%),
    linear-gradient(145deg, var(--page-bg), var(--page-bg-2));
}

.editor-content {
  background: rgba(8, 18, 34, 0.68);
  border: 1px solid var(--panel-border);
  border-radius: 1.5rem;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.editor-header-title {
  min-width: 0;
  flex: 1 1 auto;
}

.editor-record-title,
.pdf-current-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-header-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
  min-width: 0;
}

.editor-form {
  margin-top: 0.5rem;
}

.editor-section {
  padding: 1.25rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.section-header h2 {
  letter-spacing: -0.02em;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.editor-field-wide {
  grid-column: 1 / -1;
}

.editor-field {
  display: grid;
  gap: 0.45rem;
}

.editor-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.5);
}

.editor-input,
.editor-textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-radius: 0.95rem;
  padding: 0.95rem 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.editor-input {
  height: 3.25rem;
}

.searchable-select {
  position: relative;
}

.searchable-select-trigger {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  cursor: pointer;
  line-height: 1.2;
}

.searchable-select-trigger-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-trigger-caret {
  flex: none;
  opacity: 0.75;
  transition: transform 0.18s ease;
}

.searchable-select.is-open .searchable-select-trigger-caret {
  transform: rotate(180deg);
}

.searchable-select-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 20;
  padding: 0.9rem;
  background: rgba(8, 18, 34, 0.96);
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.searchable-select-search {
  margin-bottom: 0.75rem;
}

.searchable-select-options {
  display: grid;
  gap: 0.35rem;
  max-height: 16rem;
  overflow: auto;
}

.searchable-select-option {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  border: 0;
  border-radius: 0.85rem;
  padding: 0.8rem 0.95rem;
  background: transparent;
  color: #fff;
  text-align: left;
}

.searchable-select-option:hover,
.searchable-select-option:focus-visible,
.searchable-select-option.is-selected {
  background: rgba(78, 166, 255, 0.14);
  outline: none;
}

.searchable-select-option-label {
  min-width: 0;
}

.searchable-select-option-value {
  flex: none;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.searchable-select-empty {
  padding: 0.85rem 0.95rem 0.3rem;
  color: var(--text-soft);
}

.editor-textarea {
  resize: vertical;
  min-height: 8.5rem;
}

.editor-input::placeholder,
.editor-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.editor-input:focus,
.editor-textarea:focus {
  outline: none;
  border-color: rgba(124, 196, 255, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(78, 166, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
}

.editor-actions .auth-button,
.editor-actions .secondary-action {
  height: 3.25rem;
  padding: 0 1rem;
  box-sizing: border-box;
}

.editor-cancel-btn {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.editor-cancel-btn:hover,
.editor-cancel-btn:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(124, 196, 255, 0.16);
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-weight: 700;
}

.editor-save-button {
  width: auto;
  min-width: 0;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.editor-workspace {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.editor-workspace-scroll {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 1.25rem;
  align-items: stretch;
  width: 100%;
  overflow: auto;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.editor-form-panel,
.pdf-preview-panel {
  padding: 1.25rem;
  height: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(8, 18, 34, 0.68);
  border: 1px solid var(--panel-border);
  border-radius: 1.5rem;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.pdf-preview-panel {
  container-name: pdf-panel;
  container-type: inline-size;
}

.pdf-viewer {
  display: grid;
  gap: 1rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.pdf-preview-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.pdf-preview-header-title {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.pdf-preview-header-title .pdf-current-name {
  display: block;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  line-height: 1.25;
}

.pdf-preview-header-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
  justify-content: stretch;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.pdf-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3.25rem;
  width: fit-content;
  padding: 0 0.8rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  flex: none;
  box-sizing: border-box;
}

.pdf-open-btn,
.pdf-download-btn {
  min-width: 0;
  max-width: 100%;
  min-height: 3.25rem;
  height: auto;
  padding: 0.85rem 1rem;
  text-align: center;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
}

.pdf-open-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.pdf-download-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.pdf-viewer-toolbar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
  gap: 0.85rem;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  min-width: 0;
}

.pdf-step-btn {
  width: 3.25rem;
  min-width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  font-size: 1.6rem;
  line-height: 1;
}

.pdf-footer-count {
  width: 3.25rem;
  min-width: 3.25rem;
}

.pdf-thumbnail-strip {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 0.6rem 0.15rem 0.6rem;
}

.pdf-thumbnail-card {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 10.5rem;
  padding: 0.7rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.pdf-thumbnail-card:hover,
.pdf-thumbnail-card:focus-visible,
.pdf-thumbnail-card.is-active {
  outline: none;
  background: rgba(78, 166, 255, 0.14);
  border-color: rgba(124, 196, 255, 0.45);
  box-shadow: 0 0 0 0.12rem rgba(124, 196, 255, 0.14);
}

.pdf-thumbnail-card:focus-visible {
  transform: translateY(-1px);
}

.pdf-thumbnail-preview {
  display: block;
  position: relative;
  overflow: hidden;
  height: 8.6rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #fff;
}

.pdf-thumbnail-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: none;
  background: #fff;
  transform: scale(0.55);
  transform-origin: top left;
  width: 181%;
  height: 181%;
}

.pdf-thumbnail-name {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.78rem;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-frame-shell {
  border-radius: 1.1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  min-height: 68vh;
  width: 100%;
  max-width: 100%;
}

.pdf-frame {
  width: 100%;
  max-width: 100%;
  height: 68vh;
  border: 0;
  display: block;
  background: #fff;
}

.pdf-empty-state {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.pdf-empty-path {
  display: block;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pdf-source-location,
.pdf-source-path {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.pdf-source-path {
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 992px) {
  .editor-header {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-header-actions {
    justify-content: flex-start;
  }

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

  .editor-field-wide {
    grid-column: auto;
  }

  .editor-workspace {
    flex-direction: column;
  }

  .editor-workspace-scroll {
    grid-template-columns: 1fr;
  }

  .pdf-preview-panel {
    position: static;
  }
}

@media (max-width: 1200px) {
  .editor-workspace-scroll {
    grid-template-columns: 1fr;
  }

  .pdf-preview-panel {
    position: static;
  }

  .pdf-preview-header-actions {
    justify-content: flex-start;
  }

  .pdf-open-btn,
  .pdf-download-btn {
    width: 100%;
  }
}

@container pdf-panel (max-width: 34rem) {
  .pdf-preview-header-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .editor-content {
    padding: 1.1rem;
  }

  .editor-section {
    padding: 1rem;
  }

  .editor-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-save-button,
  .secondary-action {
    width: 100%;
  }

  .pdf-preview-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .pdf-preview-header-actions {
    justify-content: flex-start;
  }

  .pdf-frame-shell,
  .pdf-frame {
    min-height: 52vh;
    height: 52vh;
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --page-bg: #f4f7fb;
  --page-bg-2: #e7eef8;
  --panel-bg: rgba(255, 255, 255, 0.82);
  --panel-border: rgba(15, 23, 42, 0.09);
  --text-soft: rgba(15, 23, 42, 0.65);
  --accent: #2b78d6;
  --accent-strong: #1d67c2;
}

html[data-theme="light"] body {
  color: #122033;
  background:
    radial-gradient(circle at top left, rgba(78, 166, 255, 0.13), transparent 30%),
    radial-gradient(circle at bottom right, rgba(124, 196, 255, 0.16), transparent 24%),
    linear-gradient(145deg, var(--page-bg), var(--page-bg-2));
}

html[data-theme="light"] .text-white {
  color: #122033 !important;
}

html[data-theme="light"] .text-white-50,
html[data-theme="light"] .sidebar-label,
html[data-theme="light"] .account-menu-popover-label,
html[data-theme="light"] .searchable-select-empty,
html[data-theme="light"] .editor-label,
html[data-theme="light"] .account-menu-trigger-label,
html[data-theme="light"] .mail-received-cell,
html[data-theme="light"] .mail-status-cell,
html[data-theme="light"] .pdf-source-location,
html[data-theme="light"] .pdf-empty-state,
html[data-theme="light"] .pdf-thumbnail-name,
html[data-theme="light"] .brand-subtitle {
  color: rgba(18, 32, 51, 0.68) !important;
}

html[data-theme="light"] .inbox-shell,
html[data-theme="light"] .editor-shell,
html[data-theme="light"] .auth-shell {
  background:
    radial-gradient(circle at top left, rgba(78, 166, 255, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(124, 196, 255, 0.12), transparent 22%),
    linear-gradient(145deg, var(--page-bg), var(--page-bg-2));
}

html[data-theme="light"] .inbox-sidebar-scroll,
html[data-theme="light"] .table-shell-scroll,
html[data-theme="light"] .editor-workspace-scroll,
html[data-theme="light"] .pdf-thumbnail-strip,
html[data-theme="light"] .pdf-render-shell {
  scrollbar-color: rgba(15, 23, 42, 0.28) transparent;
}

html[data-theme="light"] .inbox-sidebar-scroll::-webkit-scrollbar-thumb,
html[data-theme="light"] .table-shell-scroll::-webkit-scrollbar-thumb,
html[data-theme="light"] .editor-workspace-scroll::-webkit-scrollbar-thumb,
html[data-theme="light"] .pdf-thumbnail-strip::-webkit-scrollbar-thumb,
html[data-theme="light"] .pdf-render-shell::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.28);
}

html[data-theme="light"] .inbox-sidebar-scroll::-webkit-scrollbar-thumb:hover,
html[data-theme="light"] .table-shell-scroll::-webkit-scrollbar-thumb:hover,
html[data-theme="light"] .editor-workspace-scroll::-webkit-scrollbar-thumb:hover,
html[data-theme="light"] .pdf-thumbnail-strip::-webkit-scrollbar-thumb:hover,
html[data-theme="light"] .pdf-render-shell::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.42);
}

html[data-theme="light"] .auth-panel,
html[data-theme="light"] .inbox-sidebar,
html[data-theme="light"] .inbox-content,
html[data-theme="light"] .table-shell,
html[data-theme="light"] .editor-content,
html[data-theme="light"] .editor-section,
html[data-theme="light"] .editor-form-panel,
html[data-theme="light"] .pdf-preview-panel,
html[data-theme="light"] .pdf-frame-shell,
html[data-theme="light"] .account-menu-popover,
html[data-theme="light"] .searchable-select-panel {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.09);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .feature-pill {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .auth-input,
html[data-theme="light"] .editor-input,
html[data-theme="light"] .editor-textarea,
html[data-theme="light"] .search-shell,
html[data-theme="light"] .meta-pill,
html[data-theme="light"] .compose-link,
html[data-theme="light"] .secondary-action,
html[data-theme="light"] .sidebar-link,
html[data-theme="light"] .folder-row,
html[data-theme="light"] .message-tag,
html[data-theme="light"] .searchable-select-trigger,
html[data-theme="light"] .searchable-select-option,
html[data-theme="light"] .pdf-thumbnail-card,
html[data-theme="light"] .pdf-count-pill,
html[data-theme="light"] .pdf-step-btn,
html[data-theme="light"] .pdf-empty-state {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.1);
  color: #122033;
}

html[data-theme="light"] .auth-input::placeholder,
html[data-theme="light"] .editor-input::placeholder,
html[data-theme="light"] .editor-textarea::placeholder {
  color: rgba(18, 32, 51, 0.36);
}

html[data-theme="light"] .search-shell,
html[data-theme="light"] .meta-pill,
html[data-theme="light"] .compose-link,
html[data-theme="light"] .secondary-action,
html[data-theme="light"] .sidebar-link,
html[data-theme="light"] .message-tag,
html[data-theme="light"] .searchable-select-option,
html[data-theme="light"] .pdf-thumbnail-card {
  box-shadow: none;
}

html[data-theme="light"] .sidebar-link span,
html[data-theme="light"] .folder-row span,
html[data-theme="light"] .searchable-select-option-value {
  color: rgba(18, 32, 51, 0.58);
}

html[data-theme="light"] .editor-page .folder-row span:first-child {
  color: rgba(18, 32, 51, 0.5);
}

html[data-theme="light"] .editor-page .folder-row span:last-child {
  color: rgba(18, 32, 51, 0.82);
}

html[data-theme="light"] .account-menu-trigger-icon,
html[data-theme="light"] .search-icon,
html[data-theme="light"] .sort-indicator {
  color: rgba(18, 32, 51, 0.46);
}

html[data-theme="light"] .sidebar-link:hover,
html[data-theme="light"] .sidebar-link.active,
html[data-theme="light"] .searchable-select-option:hover,
html[data-theme="light"] .searchable-select-option:focus-visible,
html[data-theme="light"] .searchable-select-option.is-selected,
html[data-theme="light"] .pdf-thumbnail-card:hover,
html[data-theme="light"] .pdf-thumbnail-card:focus-visible,
html[data-theme="light"] .pdf-thumbnail-card.is-active {
  background: rgba(78, 166, 255, 0.11);
  border-color: rgba(78, 166, 255, 0.22);
}

html[data-theme="light"] .sidebar-link:hover,
html[data-theme="light"] .sidebar-link.active {
  color: #122033;
}

html[data-theme="light"] .search-shell,
html[data-theme="light"] .meta-pill,
html[data-theme="light"] .compose-link {
  color: #122033;
}

html[data-theme="light"] .secondary-action:hover,
html[data-theme="light"] .secondary-action:focus-visible,
html[data-theme="light"] .account-menu-settings:hover,
html[data-theme="light"] .account-menu-settings:focus-visible,
html[data-theme="light"] .account-menu-theme:hover,
html[data-theme="light"] .account-menu-theme:focus-visible {
  color: #122033;
  background: rgba(78, 166, 255, 0.08);
  border-color: rgba(78, 166, 255, 0.22);
}

html[data-theme="light"] .sidebar-divider {
  background: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .sidebar-footer {
  border-top-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .mail-table thead th {
  background: rgba(255, 255, 255, 0.65);
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .sort-trigger {
  color: rgba(18, 32, 51, 0.72);
}

html[data-theme="light"] .sort-trigger:hover,
html[data-theme="light"] .sort-trigger.is-sorted {
  color: #122033;
  background: rgba(78, 166, 255, 0.08);
}

html[data-theme="light"] .mail-row td {
  color: rgba(18, 32, 51, 0.78);
}

html[data-theme="light"] .mail-row.unread .mail-subject-cell,
html[data-theme="light"] .mail-row.unread .mail-company-cell,
html[data-theme="light"] .mail-row.unread .mail-email-cell {
  color: #122033;
}

html[data-theme="light"] .mail-row:hover,
html[data-theme="light"] .mail-row:focus-visible {
  background: rgba(78, 166, 255, 0.06);
}

html[data-theme="light"] .mail-received-cell {
  color: rgba(18, 32, 51, 0.66);
}

html[data-theme="light"] .mail-status-cell {
  width: 1%;
}

html[data-theme="light"] .message-tag.soft {
  background: rgba(18, 32, 51, 0.04);
  border-color: rgba(18, 32, 51, 0.08);
  color: rgba(18, 32, 51, 0.72);
}

html[data-theme="light"] .status-message {
  border-color: rgba(78, 166, 255, 0.18);
  background: rgba(78, 166, 255, 0.08);
  color: #12305a;
}

html[data-theme="light"] .searchable-select-panel {
  background: rgba(255, 255, 255, 0.96);
}

html[data-theme="light"] .searchable-select-option-value {
  color: rgba(18, 32, 51, 0.44);
}

html[data-theme="light"] .editor-textarea,
html[data-theme="light"] .editor-input,
html[data-theme="light"] .auth-input,
html[data-theme="light"] .searchable-select-trigger {
  background: rgba(255, 255, 255, 0.94);
}

html[data-theme="light"] .editor-input:focus,
html[data-theme="light"] .editor-textarea:focus,
html[data-theme="light"] .auth-input:focus {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(78, 166, 255, 0.5);
  box-shadow: 0 0 0 0.25rem rgba(78, 166, 255, 0.14);
}

html[data-theme="light"] .logout-link {
  box-shadow: 0 12px 24px rgba(78, 166, 255, 0.14);
}

html[data-theme="light"] .logout-link:hover {
  box-shadow: 0 16px 28px rgba(78, 166, 255, 0.18);
}
