:root {
  color-scheme: dark;
  --bg: #050812;
  --bg-2: #080d1b;
  --panel: rgba(14, 20, 36, 0.88);
  --panel-strong: rgba(18, 25, 43, 0.96);
  --field: rgba(12, 18, 32, 0.88);
  --line: rgba(119, 140, 190, 0.16);
  --line-strong: rgba(139, 158, 220, 0.28);
  --text: #eef4ff;
  --muted: #8492b6;
  --muted-2: #647092;
  --accent: #7c5cff;
  --accent-2: #2c7bff;
  --accent-3: #8fe8ff;
  --success: #35d6c4;
  --danger: #ff6b8a;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f9ff;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --field: rgba(255, 255, 255, 0.96);
  --line: rgba(26, 55, 96, 0.13);
  --line-strong: rgba(34, 84, 157, 0.24);
  --text: #111827;
  --muted: #64748b;
  --muted-2: #7b8aa2;
  --accent: #1677ff;
  --accent-2: #0f6be8;
  --accent-3: #0aa6dc;
  --success: #0f9f8e;
  --danger: #d92d4f;
  --shadow: 0 18px 48px rgba(44, 75, 125, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 70% 0%, rgba(44, 123, 255, 0.18), transparent 32%),
    radial-gradient(circle at 15% 22%, rgba(124, 92, 255, 0.18), transparent 24%),
    linear-gradient(180deg, #050812 0%, #070b15 100%);
  color: var(--text);
}

body.access-locked {
  overflow: hidden;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 66% 8%, rgba(22, 119, 255, 0.12), transparent 32%),
    radial-gradient(circle at 18% 20%, rgba(124, 92, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #fbfdff 0%, #f7fbff 100%);
}

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

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 35%, rgba(124, 92, 255, 0.24), transparent 36%),
    rgba(4, 7, 15, 0.82);
  backdrop-filter: blur(18px);
}

.access-card {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.access-mark {
  width: 46px;
  height: 46px;
}

.access-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.access-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.access-message {
  min-height: 20px;
}

.access-message.error {
  color: var(--danger);
}

.access-message.done {
  color: var(--success);
}

.app-shell {
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
  overflow-x: hidden;
}

.query-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 24, 0.74);
  box-shadow: var(--shadow);
}

.query-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.brand-shell {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 64px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(150, 136, 255, 0.5);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(82, 104, 255, 0.95), rgba(138, 83, 255, 0.9));
  color: #ffffff;
  box-shadow: 0 0 24px rgba(124, 92, 255, 0.42);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-shell h1 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.brand-shell p,
.quick-card p,
.status-card p,
.result-toolbar p,
.empty-state p,
.recipients {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.query-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-card,
.settings-panel,
.status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 24, 41, 0.9), rgba(12, 18, 32, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.quick-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px 14px;
}

.quick-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.3;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #2b61ff, #6428e9);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(72, 76, 255, 0.34);
}

.primary-action:hover {
  filter: brightness(1.08);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.68;
}

.primary-action svg {
  width: 16px;
  height: 16px;
}

.settings-panel {
  overflow: hidden;
}

.settings-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.settings-panel summary::-webkit-details-marker {
  display: none;
}

.settings-panel summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid #8d99bd;
  border-bottom: 2px solid #8d99bd;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.settings-panel[open] summary::after {
  transform: rotate(225deg);
}

.settings-panel small {
  flex: 1;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.summary-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.summary-title i {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--accent);
}

.summary-title svg {
  width: 17px;
  height: 17px;
}

.settings-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.field,
.field-group {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.field span,
.field-group legend,
.filter-field span,
.toolbar-field span,
.toolbar-scope legend {
  color: #8b96b7;
  font-size: 11px;
  font-weight: 700;
}

.field-group {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
}

.field input,
.field textarea,
.filter-field input,
.toolbar-field input,
.toolbar-field select,
.toolbar-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input,
.filter-field input,
.toolbar-field input,
.toolbar-field select {
  height: 32px;
  padding: 0 10px;
}

.field textarea,
.toolbar-field textarea {
  min-height: 68px;
  padding: 9px 10px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
.filter-field input::placeholder,
.toolbar-field input::placeholder,
.toolbar-field textarea::placeholder {
  color: #66708f;
}

.field input:focus,
.field textarea:focus,
.filter-field input:focus,
.toolbar-field input:focus,
.toolbar-field select:focus,
.toolbar-field textarea:focus {
  border-color: rgba(124, 92, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.14);
}

.two-col,
.auth-options,
.full-field,
#folderWrap,
.saved-note {
  grid-column: 1 / -1;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
}

.auth-options {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(12, 18, 32, 0.72);
  color: #cfd8f3;
  font-size: 11px;
  font-weight: 700;
}

.check-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.text-action {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(12, 18, 32, 0.72);
  color: #cfd8f3;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.text-action:hover {
  border-color: rgba(124, 92, 255, 0.65);
  color: #ffffff;
}

.text-action:disabled {
  cursor: not-allowed;
  color: #5f6a86;
}

.saved-note {
  min-height: 18px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.45;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(10, 15, 28, 0.76);
}

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

.segmented span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border-radius: 6px;
  color: #8d96b4;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.segmented input:checked + span {
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.36), rgba(85, 62, 212, 0.22));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.5);
}

.status-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
}

.status-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.status-heading strong {
  font-size: 13px;
}

.status-detail {
  grid-column: 2;
  color: #dfe7ff;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.progress-panel {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 13, 26, 0.54);
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.progress-copy strong {
  color: var(--text);
  font-size: 12px;
}

.progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(71, 84, 120, 0.28);
}

.progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.28);
  transition: width 0.28s ease;
}

.progress-panel.running .progress-track span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: progress-shine 1.15s linear infinite;
}

.progress-panel.done .progress-track span {
  background: linear-gradient(90deg, #15b8a6, var(--success));
}

.progress-panel.error .progress-track span {
  background: linear-gradient(90deg, #ff829d, var(--danger));
}

@keyframes progress-shine {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #424c69;
  box-shadow: 0 0 0 5px rgba(124, 92, 255, 0.07);
}

.status-dot.running {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(124, 92, 255, 0.16), 0 0 22px rgba(124, 92, 255, 0.45);
}

.status-dot.done {
  background: var(--success);
}

.status-dot.error {
  background: var(--danger);
}

.status-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.status-stats div {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 56px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 13, 26, 0.74);
}

.status-stats svg {
  width: 15px;
  height: 15px;
  color: var(--accent-3);
}

.status-stats strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1;
}

.status-stats span {
  color: var(--muted);
  font-size: 10px;
}

.result-panel {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(9, 14, 27, 0.94), rgba(6, 9, 18, 0.97)),
    #080c17;
}

.result-panel::before {
  content: "";
  position: absolute;
  inset: 134px 0 0;
  background:
    linear-gradient(180deg, rgba(5, 8, 18, 0.12), rgba(5, 8, 18, 0.72)),
    url("/static/assets/dark-mail-stage.png") center center / cover no-repeat;
  opacity: 0.72;
  pointer-events: none;
}

.result-toolbar,
.folder-strip,
.empty-state,
.table-wrap {
  position: relative;
  z-index: 1;
}

.result-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 134px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 21, 0.58);
  backdrop-filter: blur(14px);
}

.result-toolbar h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.25;
}

.toolbar-actions {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  width: min(760px, 68vw);
  max-width: 780px;
}

.toolbar-line {
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.search-line {
  display: grid;
  grid-template-columns: minmax(110px, 148px) minmax(220px, 1fr) auto;
  gap: 8px;
}

.range-line {
  display: grid;
  grid-template-columns: minmax(174px, 208px) 126px 126px 108px 108px auto;
  gap: 8px;
}

.toolbar-field,
.toolbar-scope {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.toolbar-scope {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}

.compact-segmented span {
  min-height: 32px;
}

.keyword-field {
  width: 100%;
}

.filter-field {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 6px;
}

.date-field {
  width: 100%;
}

.folder-control textarea {
  min-height: 48px;
}

.export-field {
  width: 100%;
}

.download-link,
.export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #cbd5f4;
  background: rgba(15, 22, 40, 0.88);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.export-button {
  gap: 6px;
  min-width: 82px;
  cursor: pointer;
}

.export-button svg {
  width: 15px;
  height: 15px;
}

.download-link:not(.disabled):hover,
.export-button:hover {
  border-color: rgba(124, 92, 255, 0.66);
  color: #ffffff;
}

.download-link.disabled,
.export-button:disabled {
  pointer-events: none;
  color: #5f6a86;
  cursor: not-allowed;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(15, 22, 40, 0.88);
  color: #cbd5f4;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.theme-toggle:hover {
  border-color: rgba(124, 92, 255, 0.66);
  color: #ffffff;
}

.theme-icon {
  width: 15px;
  height: 15px;
}

.moon-icon {
  display: none;
}

.folder-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  padding: 10px 20px 0;
}

.folder-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(124, 92, 255, 0.26);
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.12);
  color: #dfe5ff;
  font-size: 11px;
  font-weight: 800;
}

.empty-state {
  display: grid;
  flex: 1;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 520px;
  padding: 48px 22px;
  text-align: center;
}

.empty-icon {
  display: none;
}

.empty-state h3 {
  margin: 230px 0 0;
  color: #c8d2ff;
  font-size: 22px;
  text-shadow: 0 0 20px rgba(124, 92, 255, 0.46);
}

.empty-state p {
  max-width: 520px;
  color: #9aa5c8;
}

.table-wrap {
  min-height: 0;
  overflow: auto;
  padding: 12px 20px 22px;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  table-layout: fixed;
  background: rgba(8, 13, 26, 0.74);
  backdrop-filter: blur(12px);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(13, 19, 34, 0.96);
  color: #8d96b4;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  vertical-align: top;
}

th:nth-child(1),
td:nth-child(1) {
  width: 158px;
}

th:nth-child(3),
td:nth-child(3) {
  width: 230px;
}

th:nth-child(4),
td:nth-child(4) {
  width: 120px;
}

th:nth-child(5),
td:nth-child(5) {
  width: 110px;
}

.date-cell,
.from-cell,
.folder-cell,
.attach-cell {
  color: #aab4d2;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.subject-button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: #f2f6ff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.subject-button:hover {
  color: #b9c4ff;
}

.snippet {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: #98a4c4;
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

tr.expanded .snippet {
  display: block;
}

.recipients {
  margin-top: 6px;
}

.hidden {
  display: none !important;
}

html[data-theme="light"] .query-panel,
html[data-theme="light"] .result-panel {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .quick-card,
html[data-theme="light"] .settings-panel,
html[data-theme="light"] .status-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 28px rgba(34, 84, 157, 0.06);
}

html[data-theme="light"] .brand-mark {
  border-color: rgba(22, 119, 255, 0.22);
  background: linear-gradient(135deg, #edf6ff, #6d7cff 34%, #7357f4);
  box-shadow: 0 10px 26px rgba(22, 119, 255, 0.18);
}

html[data-theme="light"] .primary-action {
  background: linear-gradient(90deg, #1677ff, #0966f2);
  box-shadow: 0 10px 22px rgba(22, 119, 255, 0.24);
}

html[data-theme="light"] .settings-panel summary::after {
  border-color: #9aa8bd;
}

html[data-theme="light"] .field span,
html[data-theme="light"] .field-group legend,
html[data-theme="light"] .filter-field span,
html[data-theme="light"] .toolbar-field span,
html[data-theme="light"] .toolbar-scope legend {
  color: #66738a;
}

html[data-theme="light"] .field input,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .filter-field input,
html[data-theme="light"] .toolbar-field input,
html[data-theme="light"] .toolbar-field select,
html[data-theme="light"] .toolbar-field textarea {
  background: var(--field);
  color: var(--text);
}

html[data-theme="light"] .field input::placeholder,
html[data-theme="light"] .field textarea::placeholder,
html[data-theme="light"] .filter-field input::placeholder,
html[data-theme="light"] .toolbar-field input::placeholder,
html[data-theme="light"] .toolbar-field textarea::placeholder {
  color: #9aa8bd;
}

html[data-theme="light"] .check-row,
html[data-theme="light"] .text-action,
html[data-theme="light"] .download-link,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .export-button {
  background: rgba(255, 255, 255, 0.92);
  color: #34445f;
}

html[data-theme="light"] .text-action:hover,
html[data-theme="light"] .download-link:not(.disabled):hover,
html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .export-button:hover {
  border-color: rgba(22, 119, 255, 0.45);
  color: #0b62dc;
}

html[data-theme="light"] .text-action:disabled,
html[data-theme="light"] .download-link.disabled,
html[data-theme="light"] .export-button:disabled {
  color: #a0aec0;
}

html[data-theme="light"] .sun-icon {
  display: none;
}

html[data-theme="light"] .moon-icon {
  display: block;
}

html[data-theme="light"] .saved-note,
html[data-theme="light"] .date-cell,
html[data-theme="light"] .from-cell,
html[data-theme="light"] .folder-cell,
html[data-theme="light"] .attach-cell {
  color: #5d6f89;
}

html[data-theme="light"] .segmented {
  background: rgba(246, 250, 255, 0.9);
}

html[data-theme="light"] .segmented span {
  color: #5f7088;
}

html[data-theme="light"] .segmented input:checked + span {
  background: linear-gradient(180deg, #edf5ff, #dfeeff);
  color: #0b62dc;
  box-shadow: inset 0 0 0 1px rgba(22, 119, 255, 0.28);
}

html[data-theme="light"] .status-detail {
  color: #0b62dc;
}

html[data-theme="light"] .status-stats div,
html[data-theme="light"] .progress-panel,
html[data-theme="light"] table {
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .status-stats svg {
  color: var(--accent);
}

html[data-theme="light"] .result-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 255, 0.98)),
    #ffffff;
}

html[data-theme="light"] .result-panel::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.52)),
    url("/static/assets/light-mail-stage.png") center center / cover no-repeat;
  opacity: 1;
  filter: none;
}

html[data-theme="light"] .result-toolbar {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .folder-pill {
  border-color: rgba(22, 119, 255, 0.22);
  background: rgba(22, 119, 255, 0.08);
  color: #0b62dc;
}

html[data-theme="light"] .empty-state h3 {
  color: #0b62dc;
  text-shadow: none;
}

html[data-theme="light"] .empty-state p,
html[data-theme="light"] .snippet {
  color: #64748b;
}

html[data-theme="light"] th {
  background: rgba(247, 250, 255, 0.96);
  color: #62708a;
}

html[data-theme="light"] .subject-button {
  color: #172033;
}

html[data-theme="light"] .subject-button:hover {
  color: #0b62dc;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .result-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
    max-width: none;
  }

  .filter-field {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .toolbar-actions {
    grid-template-columns: 1fr;
  }

  .search-line {
    grid-template-columns: 1fr;
  }

  .theme-toggle,
  .range-line,
  .folder-control,
  .export-line {
    grid-column: 1;
  }

  .theme-toggle {
    justify-self: stretch;
  }

  .range-line {
    grid-template-columns: 1fr;
  }

  .toolbar-scope,
  .date-field,
  .export-field {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 10px;
  }

  .query-panel,
  .result-toolbar,
  .table-wrap {
    padding: 12px;
  }

  .settings-panel small {
    display: none;
  }

  .settings-body,
  .two-col,
  .segmented,
  .auth-options {
    grid-template-columns: 1fr;
  }

  .status-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
