:root {
  color-scheme: light;
  --bg: oklch(97.5% 0.005 170);
  --surface: oklch(99.6% 0.002 170);
  --soft: oklch(96% 0.007 170);
  --line: oklch(89% 0.008 170);
  --strong-line: oklch(77% 0.012 170);
  --text: oklch(26% 0.015 170);
  --muted: oklch(49% 0.018 170);
  --accent: oklch(45% 0.083 170);
  --accent-hover: oklch(38% 0.078 170);
  --accent-soft: oklch(93% 0.026 170);
  --on-accent: oklch(99% 0.004 170);
  --danger: oklch(48% 0.17 25);
  --danger-soft: oklch(96% 0.022 25);
  --warning: oklch(45% 0.095 65);
  --warning-soft: oklch(97% 0.035 85);
  --shadow: 0 12px 40px oklch(24% 0.02 170 / 0.12);
  --radius: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: oklch(18% 0.008 170);
  --surface: oklch(22% 0.01 170);
  --soft: oklch(26% 0.013 170);
  --line: oklch(33% 0.015 170);
  --strong-line: oklch(49% 0.017 170);
  --text: oklch(93% 0.007 170);
  --muted: oklch(72% 0.014 170);
  --accent: oklch(77% 0.11 170);
  --accent-hover: oklch(83% 0.095 170);
  --accent-soft: oklch(30% 0.035 170);
  --on-accent: oklch(20% 0.02 170);
  --danger: oklch(78% 0.12 25);
  --danger-soft: oklch(28% 0.04 25);
  --warning: oklch(83% 0.11 85);
  --warning-soft: oklch(29% 0.03 65);
  --shadow: 0 12px 40px oklch(10% 0.005 170 / 0.2);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button,
a,
input,
select,
textarea,
summary {
  outline-offset: 3px;
}
*:focus-visible {
  outline: 2px solid var(--accent);
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 1.85rem;
  line-height: 1.35;
  letter-spacing: -0.035em;
  font-weight: 650;
}
h2 {
  font-size: 1.25rem;
  line-height: 1.4;
  font-weight: 650;
}
h3 {
  font-size: 1rem;
  font-weight: 650;
}
small,
.small-text {
  font-size: 0.86rem;
}
svg {
  width: 20px;
  height: 20px;
  flex: none;
}
button svg {
  width: 17px;
  height: 17px;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
[hidden] {
  display: none !important;
}
::selection {
  background: var(--accent-soft);
}
.muted,
.quiet {
  color: var(--muted);
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wrap-anywhere {
  overflow-wrap: anywhere;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  background: var(--surface);
  padding: 12px;
  z-index: 600;
}
.skip-link:focus {
  top: 8px;
}
.app-shell {
  min-height: 100dvh;
}
.sidebar {
  display: flex;
  flex-direction: column;
  width: 224px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 300;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 30px 16px 16px;
  transform: translateX(-100%);
  transition: transform 180ms var(--ease);
}
body.nav-open .sidebar {
  transform: translateX(0);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 10px 40px;
  letter-spacing: -0.025em;
}
.brand:hover {
  text-decoration: none;
}
.brand small {
  display: block;
  font-size: 0.73rem;
  font-weight: 450;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.brand-symbol {
  height: 38px;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 11px;
  font-size: 22px;
  letter-spacing: -3px;
  padding-right: 3px;
  font-weight: 600;
}
.brand-symbol span {
  font-size: 18px;
}
.nav-label {
  color: var(--muted);
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  padding: 0 12px 12px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 3px 0;
  padding: 10px 12px;
  color: var(--muted);
  border-radius: 7px;
  font-weight: 500;
  transition: background 150ms;
}
.nav-item:hover {
  background: var(--soft);
  text-decoration: none;
  color: var(--text);
}
.nav-item[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}
.nav-item .nav-count {
  margin-left: auto;
  font-size: 0.78rem;
}
.nav-divider {
  height: 1px;
  background: var(--line);
  margin: 20px 12px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 40px;
}
.connection {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 20px;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex: none;
}
.profile {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 16px 8px 0;
  color: var(--text);
  font-size: 0.86rem;
}
.profile > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--soft);
  font-size: 0.85rem;
  font-weight: 650;
}
.nav-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: oklch(15% 0.01 170 / 0.35);
  z-index: 250;
}
.workspace {
  min-width: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 200;
}
.topbar-leading,
.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.breadcrumb {
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
}
.breadcrumb span {
  margin: 0 8px;
  color: var(--strong-line);
}
.breadcrumb strong {
  font-weight: 550;
  color: var(--text);
}
.desktop-only {
  display: none;
}
.topbar-actions {
  gap: 8px;
}
.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex: none;
}
.icon-button:hover {
  background: var(--soft);
  color: var(--text);
}
#main {
  width: 100%;
  min-width: 0;
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  flex: 1;
}
#main:focus {
  outline: none;
}
.workspace-footer {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  font-size: 0.73rem;
  color: var(--muted);
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}
.page-head p.subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 8px;
}
.eyebrow {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  font-weight: 650;
  margin-bottom: 8px;
}
.page-head .button-row {
  flex-shrink: 0;
}
.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.button-row.end {
  justify-content: flex-end;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  min-height: 38px;
  padding: 8px 13px;
  font-weight: 550;
  font-size: 0.86rem;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background 150ms,
    border-color 150ms;
}
.button:hover {
  background: var(--soft);
  border-color: var(--strong-line);
  text-decoration: none;
}
.button:active {
  background: var(--line);
}
.button.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.button.primary:hover {
  background: var(--accent-hover);
}
.button.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in oklch, var(--danger) 25%, var(--line));
}
.button.ghost {
  border-color: transparent;
  background: transparent;
}
.button.small {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 0.8rem;
}
.button[aria-busy="true"] {
  opacity: 0.7;
}
.text-button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-align: left;
}
.text-button:hover {
  text-decoration: underline;
}
.link-mail {
  font-weight: 550;
  color: var(--text);
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}
.row-secondary {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
  overflow: clip;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.panel-content {
  padding: 24px;
}
.section-gap {
  margin-top: 24px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.toolbar .search {
  flex: 1;
  min-width: 180px;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 120px;
  font-size: 0.75rem;
  color: var(--muted);
}
.filter-field input,
.filter-field select {
  min-height: 36px;
  font-size: 0.86rem;
}
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}
.filter-tags:empty {
  display: none;
}
.search-wrap {
  position: relative;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 11px;
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.search-wrap input {
  padding-left: 37px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text);
  font-size: 0.86rem;
  min-width: 0;
}
.field small {
  color: var(--muted);
  font-weight: 400;
}
.field input,
.field select,
.field textarea {
  width: 100%;
}
input:not([type="checkbox"]),
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 11px;
  min-width: 0;
  max-width: 100%;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--strong-line);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex: none;
  cursor: pointer;
}
textarea {
  resize: vertical;
  min-height: 84px;
}
.form-grid {
  display: grid;
  gap: 20px;
}
.form-stack {
  display: grid;
  gap: 20px;
}
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 4px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  cursor: pointer;
}
.form-error {
  color: var(--danger);
  font-size: 0.86rem;
  background: var(--danger-soft);
  padding: 12px 14px;
  border-radius: 7px;
  overflow-wrap: anywhere;
}
.form-error:empty {
  display: none;
}
.inline-result {
  font-size: 0.86rem;
  padding: 12px;
  background: var(--accent-soft);
  border-radius: 7px;
  color: var(--accent);
}
.notice {
  padding: 14px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.notice.warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.notice.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
#networkBanner {
  margin: 12px 16px 0;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--soft);
  color: var(--muted);
}
.status.good {
  background: var(--accent-soft);
  color: var(--accent);
}
.status.bad {
  background: var(--danger-soft);
  color: var(--danger);
}
.status.warn {
  background: var(--warning-soft);
  color: var(--warning);
}
.status::before {
  content: "";
  height: 5px;
  width: 5px;
  border-radius: 50%;
  background: currentColor;
}
.status.plain::before {
  display: none;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
th {
  background: var(--soft);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  padding: 12px 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 17px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: color-mix(in oklch, var(--soft) 50%, var(--surface));
}
tbody tr.selected {
  background: var(--accent-soft);
}
.check-cell {
  width: 42px;
  padding-right: 0;
}
.actions-cell {
  width: 145px;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.api-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}
.api-indicator.on .status-dot {
  background: var(--accent);
}
.api-indicator.off .status-dot {
  background: var(--strong-line);
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.pager select {
  padding: 5px 8px;
}
.pager-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.batch-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--accent-soft);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}
.batch-toolbar strong {
  color: var(--accent);
  margin-right: 6px;
}
.code-chip {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.08em;
  font-weight: 650;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 9px;
  background: var(--accent-soft);
  color: var(--accent);
}
.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  max-width: 600px;
  margin: auto;
}
.empty svg {
  width: 32px;
  height: 32px;
  opacity: 0.65;
  margin-bottom: 12px;
}
.empty h3 {
  color: var(--text);
  font-size: 1.08rem;
  margin-bottom: 8px;
}
.empty p {
  font-size: 0.86rem;
  max-width: 48ch;
  margin: 0 auto 20px;
}
.skeleton-list {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.skeleton-list i {
  display: block;
  height: 75px;
  background: var(--soft);
  animation: pulse 1.6s ease-in-out infinite alternate;
}
@keyframes pulse {
  to {
    opacity: 0.45;
  }
}
.mailbox-statistics {
  margin-bottom: 20px;
}
.source-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 20px 24px;
  gap: 16px;
}
.source-summary dt {
  color: var(--muted);
  font-size: 0.82rem;
}
.source-summary dd {
  margin: 6px 0 0;
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.source-summary dd span {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}
.source-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
}
.source-counts .button {
  padding: 3px 0;
  min-height: 30px;
  font-size: 0.78rem;
  color: var(--muted);
}
.source-counts strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.source-breakdown {
  border-top: 1px solid var(--line);
  padding: 12px 24px;
}
.source-breakdown summary {
  cursor: pointer;
  font-size: 0.85rem;
}
.source-breakdown ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.source-breakdown li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 20px;
  border-top: 1px solid var(--line);
  padding: 8px 0;
}
.source-account {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.source-account .button {
  white-space: normal;
  overflow-wrap: anywhere;
  padding-left: 0;
}
.source-account strong {
  font-size: 0.85rem;
}
.source-note,
.account-legend,
.filtered-counts {
  margin: 0;
  padding: 0 24px 14px;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}
.account-table .account-state {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}
.account-table .row-secondary {
  white-space: normal;
}
.account-source-cell {
  min-width: 140px;
}
.account-source-cell .source-counts {
  flex-direction: column;
  align-items: flex-start;
}
@media (max-width: 600px) {
  .source-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
  }
  .source-breakdown {
    padding: 12px 16px;
  }
  .source-note,
  .account-legend,
  .filtered-counts {
    padding: 0 16px 12px;
  }
  .account-table td.mobile-inline {
    align-items: flex-start;
  }
  .account-table td.mobile-inline::before {
    min-width: 68px;
    padding-top: 4px;
  }
  .account-source-cell .source-counts {
    flex-direction: row;
  }
}
.stat-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 28px;
  overflow: hidden;
}
.stat {
  padding: 20px 24px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}
.stat span {
  font-size: 0.8rem;
  color: var(--muted);
}
.stat strong {
  display: block;
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin: 5px 0;
}
.stat small {
  font-size: 0.75rem;
  color: var(--muted);
}
.split-grid {
  display: grid;
  gap: 24px;
  align-items: start;
}
.detail-list {
  display: grid;
  gap: 0;
  margin: 0;
}
.detail-list > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}
.detail-list dt {
  color: var(--muted);
}
.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.list-item {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.list-item:last-child {
  border: 0;
}
.list-item > div {
  min-width: 0;
}
.list-item p {
  font-size: 0.83rem;
  color: var(--muted);
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.list-item strong {
  font-size: 0.9rem;
}
.account-cell {
  display: flex;
  gap: 12px;
  align-items: center;
}
.account-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}
.account-state {
  display: grid;
  gap: 5px;
  justify-items: start;
}
.account-picker {
  max-height: 270px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.account-option {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.account-option:last-child {
  border: 0;
}
.account-option > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.account-option small {
  display: block;
  color: var(--muted);
  font-size: 0.77rem;
}
.steps {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  font-size: 0.8rem;
  color: var(--muted);
}
.step {
  flex: 1;
  border-bottom: 2px solid var(--line);
  padding: 0 0 10px;
}
.step.active {
  color: var(--accent);
  border-color: var(--accent);
}
.step span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  margin-right: 5px;
}
.advanced {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.advanced summary {
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}
.advanced[open] summary {
  margin-bottom: 20px;
}
.otp-input {
  font-size: 1.7rem;
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  width: min(580px, 100%);
  max-width: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: oklch(15% 0.01 170 / 0.3);
}
.drawer[open] {
  display: flex;
  flex-direction: column;
  animation: drawer-in 180ms var(--ease);
}
@keyframes drawer-in {
  from {
    transform: translateX(24px);
    opacity: 0.4;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
.drawer-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
}
.drawer-head h2 {
  font-size: 1.14rem;
  overflow-wrap: anywhere;
}
.drawer-body {
  padding: 24px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.drawer-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.drawer-section h3 {
  margin-bottom: 16px;
}
.drawer .button-row {
  margin-top: 16px;
}
.confirm-dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 28px;
  max-width: min(440px, calc(100% - 32px));
  box-shadow: var(--shadow);
}
.confirm-dialog p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 14px 0 24px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 600;
  display: grid;
  gap: 8px;
  max-width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
.toast.error {
  border-color: var(--danger);
  color: var(--danger);
}
.toast button {
  border: 0;
  background: none;
  color: inherit;
  font-size: 20px;
}
.tab-bar {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.tab-bar a,
.tab-bar button {
  padding: 10px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-weight: 550;
  font-size: 0.86rem;
}
.tab-bar .active {
  border-color: var(--accent);
  color: var(--accent);
}
.inbox-layout {
  display: grid;
  min-height: 560px;
  min-width: 0;
}
.message-list {
  min-width: 0;
}
.message-item {
  display: block;
  width: 100%;
  padding: 20px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.message-item:hover {
  background: var(--soft);
}
.message-item.active {
  background: var(--accent-soft);
}
.message-item .message-top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.message-item strong {
  font-size: 0.92rem;
  display: block;
  overflow-wrap: anywhere;
}
.message-item p {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 5px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.message-reader {
  padding: 28px;
  min-width: 0;
  border-top: 1px solid var(--line);
}
.message-reader h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
.mail-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.8;
  margin: 24px 0;
  max-width: 75ch;
}
.message-code {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: var(--accent-soft);
  padding: 16px;
  border-radius: 8px;
  margin: 24px 0;
}
.message-code strong {
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.timeline {
  display: grid;
  gap: 0;
}
.timeline-entry {
  padding: 14px 0;
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid var(--line);
}
.timeline-entry .status-dot {
  margin-top: 7px;
}
.timeline-entry p {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
.timeline-entry small {
  color: var(--muted);
  display: block;
  margin-top: 5px;
}
.timeline-entry.error .status-dot {
  background: var(--danger);
}
.schedule-summary {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.schedule-summary div {
  display: grid;
  gap: 4px;
}
.schedule-summary small {
  color: var(--muted);
}
.schedule-summary strong {
  font-size: 1.4rem;
  font-weight: 600;
}
.result-list {
  font-size: 0.86rem;
}
.result-list > div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.result-list .bad {
  color: var(--danger);
}
.settings-layout {
  max-width: 960px;
}
.settings-section {
  display: grid;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.settings-description p {
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 8px;
  max-width: 42ch;
}
.segment {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  background: var(--surface);
  gap: 3px;
}
.segment button {
  border: 0;
  padding: 7px 12px;
  background: transparent;
  color: var(--muted);
  border-radius: 5px;
  font-size: 0.86rem;
}
.segment button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}
.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-wrap {
  width: 100%;
  max-width: 400px;
}
.auth-wrap .brand {
  margin: 0 0 48px;
}
.auth-wrap h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}
.auth-wrap .form-stack {
  margin-top: 28px;
}
.auth-wrap .button.primary {
  width: 100%;
  min-height: 44px;
}
.auth-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
.auth-note {
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.filter-field .search-wrap {
  display: block;
  width: 100%;
}
.filter-field .search-wrap input {
  width: 100%;
  padding-left: 37px;
}
.search-wrap svg {
  pointer-events: none;
}
body:has(dialog[open]),
body.nav-open {
  overflow: hidden;
}
.sidebar {
  overflow-y: auto;
}
@media (max-width: 699px) {
  .page-head {
    flex-wrap: wrap;
  }
  .page-head > div:first-child {
    flex: 1;
    min-width: 140px;
  }
}
:root[data-density="compact"] td {
  padding-top: 11px;
  padding-bottom: 11px;
}
:root[data-density="compact"] .message-item {
  padding: 14px 20px;
}
@media (min-width: 700px) {
  #main {
    padding: 32px 28px 56px;
  }
  .topbar {
    padding: 0 28px;
  }
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid .full {
    grid-column: 1/-1;
  }
  .stat-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .stat {
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .stat:last-child {
    border-right: 0;
  }
  .desktop-only {
    display: initial;
  }
  .inbox-layout {
    grid-template-columns: minmax(260px, 36%) minmax(0, 1fr);
  }
  .message-list {
    border-right: 1px solid var(--line);
  }
  .message-reader {
    border-top: 0;
  }
  .settings-section {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}
@media (min-width: 1080px) {
  .sidebar {
    transform: none;
  }
  .workspace {
    margin-left: 224px;
  }
  .mobile-menu {
    display: none;
  }
  .split-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
  #main {
    padding: 36px 36px 64px;
  }
  .topbar {
    padding: 0 36px;
  }
}
@media (max-width: 699px) {
  .page-head {
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 12px;
  }
  .page-head h1 {
    font-size: 1.5rem;
  }
  .page-head .eyebrow {
    display: none;
  }
  .page-head p.subtitle {
    font-size: 0.8rem;
  }
  .page-head .button-row .button {
    padding: 8px 10px;
  }
  .page-head .button-row {
    gap: 5px;
    justify-content: flex-end;
  }
  .page-head .button-row .secondary-action {
    display: none;
  }
  .toolbar {
    padding: 12px;
    gap: 8px;
  }
  .toolbar .search {
    flex-basis: 100%;
  }
  .filter-field {
    flex: 1;
    min-width: 110px;
  }
  .panel-content,
  .panel-header {
    padding: 20px 16px;
  }
  .stat {
    padding: 16px;
  }
  .stat strong {
    font-size: 1.5rem;
  }
  .responsive-table thead {
    display: none;
  }
  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
  }
  .responsive-table tr {
    padding: 16px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 9px 10px;
    border-bottom: 1px solid var(--line);
  }
  .responsive-table tr:last-child {
    border-bottom: 0;
  }
  .responsive-table td {
    padding: 0;
    border: 0;
    grid-column: 2;
    min-width: 0;
  }
  .responsive-table td.check-cell {
    grid-column: 1;
    grid-row: 1/5;
    width: auto;
    padding-top: 3px;
  }
  .responsive-table td.mobile-inline {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .responsive-table td.mobile-inline::before {
    content: attr(data-label);
    font-size: 0.77rem;
    color: var(--muted);
  }
  .responsive-table td.mobile-hide {
    display: none;
  }
  .responsive-table .actions-cell {
    width: auto;
    grid-column: 2;
  }
  .responsive-table.no-check tr {
    grid-template-columns: minmax(0, 1fr);
  }
  .responsive-table.no-check td {
    grid-column: 1;
  }
  .row-actions {
    justify-content: flex-start;
  }
  .row-actions .button {
    min-height: 36px;
  }
  .drawer-head,
  .drawer-body {
    padding: 20px;
  }
  .message-reader {
    padding: 20px;
  }
  .message-reader:has(.empty) {
    display: none;
  }
  .inbox-layout:has(.message-reader[data-open="true"]) .message-list {
    display: none;
  }
  .inbox-layout:has(.message-reader[data-open="true"]) .message-reader {
    border-top: 0;
  }
  .inbox-back {
    margin-bottom: 16px;
  }
  .pager {
    padding: 12px;
  }
  .detail-list > div {
    grid-template-columns: 95px minmax(0, 1fr);
  }
  .topbar {
    height: 58px;
  }
  .topbar-leading,
  .topbar-actions {
    gap: 4px;
  }
  .breadcrumb {
    font-size: 0.78rem;
  }
  .breadcrumb span {
    margin: 0 4px;
  }
  .toasts {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
  }
  .button,
  .icon-button {
    min-height: 40px;
  }
  .filter-field input,
  .filter-field select {
    font-size: 16px;
  }
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }
}
@media (min-width: 700px) {
  .inbox-back {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
