:root {
  font-family: 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--page);
  font-size: 16px;
  font-synthesis: none;
  --blue: #334bdb;
  --line: #dce3ed;
  --muted: #5e7087;
}
.setup-notice {
  padding: 16px 20px;
  border: 1px solid var(--notice-line);
  background: var(--notice-bg);
  border-radius: 7px;
  color: var(--notice-text);
  line-height: 1.6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  border: 1px solid var(--control-border);
  border-radius: 7px;
  padding: 10px 15px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}
button:hover {
  background: var(--surface-hover);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}
.primary:hover {
  background: #293ab9;
}
.danger {
  background: #ad2938;
  color: white;
  border-color: var(--danger-text);
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  letter-spacing: -0.055em;
  line-height: 1.04;
  font-weight: 600;
}
h2 {
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}
small,
.hint {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}
.topbar {
  height: 84px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 700;
  white-space: nowrap;
  color: inherit;
  letter-spacing: -0.04em;
}
.brand strong {
  font-weight: 500;
  color: var(--blue);
}
.mark {
  display: block;
  width: 37px;
  height: 37px;
  flex-shrink: 0;
}
.product-label {
  font-size: 0.875rem;
  border-left: 1px solid var(--line);
  padding-left: 28px;
  color: var(--muted);
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  font-size: 0.875rem;
}
.quiet {
  border: 0;
  background: none;
}
.connect {
  max-width: 1120px;
  margin: 110px auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 90px;
  padding: 0 32px;
}
.connect h1 {
  font-size: clamp(3rem, 5vw, 4.7rem);
  margin: 25px 0;
}
.connect > div > p {
  max-width: 430px;
  line-height: 1.8;
  font-size: 1.125rem;
  color: var(--muted);
}
.route-label {
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
  color: var(--blue);
}
.capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 32px;
}
.capabilities span:before {
  content: '✓';
  margin-right: 7px;
  color: var(--success-text);
}
.connect-panel {
  padding: 32px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  background: var(--surface);
  border-radius: 10px;
  align-self: start;
}
.connect-panel p {
  line-height: 1.7;
  color: var(--muted);
}
form {
  display: grid;
  gap: 12px;
}
label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 7px;
}
input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
textarea {
  resize: vertical;
}
form > .primary {
  margin-top: 8px;
}
.connect-panel .hint {
  margin: 22px 0;
}
code {
  font:
    0.875rem ui-monospace,
    monospace;
}
.workspace {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 84px);
}
aside {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
}
.workspace-name {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 4px 6px 40px;
  min-width: 0;
}
.workspace-name strong,
.workspace-name small {
  display: block;
  overflow-wrap: anywhere;
}
.avatar {
  background: var(--selected);
  color: var(--blue);
  padding: 10px 14px;
  font-weight: 600;
  border-radius: 8px;
}
.nav-item {
  display: flex;
  justify-content: space-between;
  text-align: left;
  border: 0;
  background: none;
  margin: 4px 0;
  padding: 13px;
  font-size: 0.9375rem;
}
.nav-item.active {
  background: var(--selected);
  color: var(--blue);
}
.sidebar-bottom {
  margin-top: auto;
  padding: 30px 10px 0;
  font-size: 0.8125rem;
  color: var(--muted);
}
.sidebar-bottom p {
  margin-top: 12px;
  line-height: 1.65;
}
.dot {
  display: inline-block;
  background: #047b78;
  width: 7px;
  height: 7px;
  border-radius: 100%;
  margin-right: 7px;
}
.workarea {
  padding: 34px 38px;
  min-width: 0;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.context {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.page-head h1 {
  font-size: 2.1rem;
  margin: 0;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.mail-grid {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 560px;
  display: grid;
  grid-template-columns: 250px 1fr;
  overflow: hidden;
}
.mailbox-column {
  border-right: 1px solid var(--line);
  padding: 20px 10px;
}
.mailbox-column h2 {
  padding: 0 12px;
  font-size: 0.875rem;
  color: var(--muted);
  margin: 3px 0 20px;
}
.mailbox-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 6px;
  margin-bottom: 5px;
  padding: 14px 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.mailbox-item.selected {
  background: var(--surface-hover);
  box-shadow: inset 3px 0 var(--blue);
}
.mailbox-item strong,
.mailbox-item small {
  display: block;
}
.mailbox-item strong {
  font-size: 0.9375rem;
}
.mailbox-item small {
  font-size: 0.8125rem;
  margin-top: 4px;
}
.message-column {
  min-width: 0;
}
.inbox-head {
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.inbox-head > div {
  margin-right: auto;
  min-width: 0;
}
.inbox-head strong,
.inbox-head small {
  display: block;
  overflow-wrap: anywhere;
}
.inbox-head small {
  margin-top: 3px;
}
.message-row {
  display: block;
  background: var(--surface);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 20px 22px;
  width: 100%;
  text-align: left;
  font-weight: 400;
}
.message-row .row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.message-row strong {
  display: block;
  margin: 9px 0;
  font-size: 1rem;
  font-weight: 600;
}
.message-row .preview {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.875rem;
  color: var(--muted);
}
.message-row .status {
  color: var(--success-text);
}
.empty {
  padding: 90px 28px;
  text-align: center;
  color: var(--muted);
}
.empty h3 {
  color: var(--ink);
  font-size: 1.1rem;
}
.empty p {
  line-height: 1.7;
  max-width: 380px;
  margin: auto;
}
.section-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
  line-height: 1.65;
}
.section-intro p {
  margin: 0;
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
th,
td {
  padding: 17px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-weight: 500;
}
tr:last-child td {
  border-bottom: 0;
}
.event-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 20px;
  padding: 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.event-row small {
  font-size: 0.8125rem;
}
dialog {
  width: 520px;
  max-width: calc(100vw - 32px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  color: inherit;
  box-shadow: 0 24px 80px #172c4733;
}
dialog::backdrop {
  background: #14253e77;
}
.dialog-head {
  display: flex;
  align-items: start;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 18px;
}
.dialog-head h2 {
  margin: 5px 0;
}
.dialog-head button {
  border: 0;
  font-size: 1.2rem;
  padding: 2px 8px;
}
.email-input {
  display: flex;
  gap: 8px;
  align-items: center;
}
.email-input input {
  min-width: 0;
}
.email-input span {
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}
dialog p {
  line-height: 1.7;
}
#new-secret {
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  margin: 12px 0;
  word-break: break-all;
}
.reader {
  width: 720px;
}
.reader pre {
  font:
    1rem/1.8 'Avenir Next',
    Avenir,
    'Segoe UI',
    sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  max-height: 50vh;
  overflow: auto;
}
.reader #attachments {
  display: grid;
  gap: 10px;
  margin: 15px 0;
}
#feedback {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 15px 22px;
  background: #16304e;
  color: white;
  border-radius: 8px;
  max-width: 90vw;
  box-shadow: 0 8px 30px #14253e33;
  z-index: 100;
}
#load-more {
  margin: 18px;
}
#connect-screen[hidden],
#workspace[hidden],
[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 210px 1fr;
  }
  .workarea {
    padding: 26px 20px;
  }
  .mail-grid {
    grid-template-columns: 200px 1fr;
  }
  .product-label {
    display: none;
  }
  .connect {
    gap: 35px;
    margin-top: 70px;
  }
  .inbox-head button {
    font-size: 0.8125rem;
    padding: 8px 10px;
  }
}
@media (max-width: 760px) {
  .topbar {
    padding: 0 18px;
    height: 72px;
  }
  .topbar nav {
    gap: 12px;
  }
  .topbar nav a:last-of-type {
    display: none;
  }
  .brand {
    font-size: 1.2rem;
  }
  .connect {
    display: block;
    margin: 40px auto;
  }
  .connect-panel {
    margin-top: 35px;
  }
  .connect h1 {
    font-size: 3rem;
  }
  .workspace {
    display: block;
  }
  aside {
    padding: 12px;
    flex-direction: row;
    gap: 4px;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .workspace-name {
    width: 100%;
    margin: 8px 5px 12px;
  }
  .nav-item {
    padding: 10px;
    font-size: 0.875rem;
    gap: 12px;
  }
  .sidebar-bottom {
    display: none;
  }
  .page-head {
    align-items: start;
    flex-direction: column;
  }
  .mail-grid {
    display: block;
    min-height: 450px;
  }
  .mailbox-column {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #mailbox-list {
    display: flex;
    overflow: auto;
  }
  .mailbox-item {
    min-width: 200px;
    width: auto;
  }
  .mailbox-column h2 {
    margin-bottom: 8px;
  }
  .event-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .section-intro {
    align-items: start;
    flex-direction: column;
  }
  .workarea {
    padding: 24px 16px;
  }
  .inbox-head {
    padding: 18px;
  }
  .inbox-head > div {
    width: 100%;
    margin-bottom: 10px;
  }
  .dialog-head h2 {
    overflow-wrap: anywhere;
  }
}

.domain-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
}
.dns-records {
  display: grid;
  gap: 20px;
  margin: 24px 0;
}
.dns-record {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--page);
}
.dns-record h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}
.dns-value {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
}
.dns-value > div {
  min-width: 0;
}
.dns-value small {
  display: block;
}
.dns-value code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.dns-value button {
  flex-shrink: 0;
}
.domain-guide {
  display: inline-block;
  margin-top: 20px;
}
#domain-status {
  color: var(--blue);
  font-weight: 600;
}
#domain-rows td:first-child {
  overflow-wrap: anywhere;
}
.email-input {
  min-width: 0;
}
#address-suffix {
  overflow-wrap: anywhere;
}
@media (max-width: 560px) {
  .domain-dialog {
    padding: 20px;
  }
  .dns-record {
    padding: 12px;
  }
  .dns-value {
    gap: 8px;
  }
  .email-input {
    flex-wrap: wrap;
  }
}

/* Console: quiet navigation, useful data, and a single blue action color. */
@font-face {
  font-family: Manrope;
  src: url('/fonts/manrope-variable.ttf') format('truetype');
  font-weight: 400 800;
  font-display: swap;
}
:root {
  font-family: Manrope, 'Segoe UI', sans-serif;
  background: var(--page);
}
[hidden] {
  display: none !important;
}
.topbar {
  height: 72px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.workspace {
  min-height: calc(100vh - 72px);
  grid-template-columns: 232px minmax(0, 1fr);
}
.workarea {
  min-width: 0;
  padding: 36px 40px;
  max-width: 1700px;
  width: 100%;
}
.workarea h1 {
  font-size: 32px;
  margin-bottom: 0;
  letter-spacing: -0.045em;
}
.context {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}
.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 28px;
}
.auth-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.auth-tabs .active {
  background: var(--surface);
  color: var(--blue);
  box-shadow: 0 1px 4px #172c4710;
}
.connect {
  margin-top: 72px;
  gap: 80px;
  align-items: center;
}
.connect-panel {
  border-top: 1px solid var(--line);
  padding: 30px;
  box-shadow: 0 16px 70px #172c4707;
}
.connect-panel h2 {
  font-size: 26px;
  line-height: 1.2;
  margin-bottom: 12px;
}
.connect-panel .hint {
  margin: 12px 0;
  font-size: 12px;
}
.connect-panel .quiet {
  margin-top: 12px;
  padding-left: 0;
  font-size: 12px;
}
.checkbox-label {
  display: flex;
  gap: 9px;
  align-items: start;
  font-size: 12px;
  line-height: 1.7;
  font-weight: 400;
}
.checkbox-label input {
  width: 16px;
  height: 16px;
  margin: 4px 0 0;
  flex: none;
}
.legacy-access {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
  font-size: 12px;
}
.legacy-access summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--muted);
}
.legacy-access p {
  margin-top: 15px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  margin: 24px 0 18px;
}
.metrics > div {
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}
.metrics > div:last-child {
  border: 0;
}
.metrics span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.metrics strong {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.activity-panel {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 35px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 30px;
}
.activity-panel h2,
.log-heading h2 {
  font-size: 15px;
  margin-bottom: 6px;
}
.activity-panel .hint {
  font-size: 11px;
}
.chart-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  margin: 20px 0 0;
}
.outbound-dot,
.inbound-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--chart-outbound);
  border-radius: 2px;
}
.inbound-dot {
  background: var(--chart-received);
  margin-left: 8px;
}
.activity-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
}
.chart-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.chart-bars {
  height: 80px;
  width: 100%;
  display: flex;
  gap: 3px;
  align-items: end;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(0deg, transparent 49%, var(--chart-grid) 50%, transparent 51%);
}
.chart-bar {
  width: 12px;
  max-width: 35%;
  border-radius: 3px 3px 0 0;
  background: var(--chart-outbound);
}
.chart-bar.received {
  background: var(--chart-received);
}
.chart-day small {
  font-size: 10px;
}
.mail-log {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.log-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 24px 4px;
}
.filters {
  display: grid;
  grid-template-columns:
    minmax(180px, 2fr) minmax(130px, 1fr) minmax(110px, 1fr) minmax(110px, 1fr)
    auto;
  align-items: end;
  gap: 10px;
  padding: 0 24px 20px;
}
.filters label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 5px;
}
.filters input,
.filters select,
.filters button {
  height: 38px;
  padding: 8px 10px;
  font-size: 12px;
}
.message-table {
  min-width: 700px;
  table-layout: fixed;
  width: 100%;
}
.message-table th:first-child {
  width: 35%;
}
.message-table th:nth-child(2) {
  width: 22%;
}
.message-table th:nth-child(3) {
  width: 13%;
}
.message-table th:nth-child(4) {
  width: 14%;
}
.message-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  background: var(--surface-soft);
  padding: 13px 18px;
}
.message-table td {
  padding: 17px 18px;
  font-size: 11px;
  overflow-wrap: anywhere;
  vertical-align: middle;
}
.message-table td small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  margin-top: 5px;
}
.message-table td strong {
  font-weight: 600;
}
.subject-link {
  border: 0;
  background: transparent !important;
  padding: 0;
  color: var(--ink);
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.subject-link:hover {
  color: var(--blue);
  text-decoration: underline;
}
.status-badge {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}
.status-badge.success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-line);
}
.status-badge.attention {
  background: var(--attention-bg);
  color: var(--attention-text);
  border-color: var(--attention-line);
}
.empty {
  padding: 64px 24px;
  text-align: center;
  max-width: 600px;
  margin: auto;
}
.empty h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.035em;
  margin-top: 14px;
}
.empty p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 1px solid var(--line);
  color: var(--blue);
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: 0 4px 9px #172c4708;
  background: var(--surface);
}
#log-more {
  margin: 18px 24px;
}
.reader {
  width: min(1050px, 95vw);
  max-width: none;
  padding: 28px;
}
.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 225px;
  gap: 24px;
  margin: 24px 0;
}
.reader-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.reader-tabs button {
  font-size: 11px;
  padding: 6px 12px;
}
#message-body {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 24px;
  min-height: 250px;
  max-height: 55vh;
  overflow: auto;
  font:
    14px/1.8 Manrope,
    sans-serif;
}
#message-html {
  border: 1px solid var(--line);
  background: var(--surface);
  width: 100%;
  height: 450px;
}
.message-details {
  border: 0;
  border-left: 1px solid var(--line);
  padding: 10px 0 0 22px;
}
.message-details h3 {
  font-size: 12px;
}
.message-details .hint {
  font-size: 10px;
  overflow-wrap: anywhere;
}
#message-timeline {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
#message-timeline li {
  border-left: 2px solid var(--line);
  padding: 0 0 20px 15px;
  position: relative;
  font-size: 11px;
}
#message-timeline li:before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chart-outbound);
  left: -4px;
  top: 4px;
}
#message-timeline small {
  display: block;
  font-size: 10px;
}
.settings-section {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(260px, 1fr);
  gap: 60px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.settings-section h2 {
  font-size: 18px;
  margin-bottom: 10px;
}
.settings-section .hint {
  font-size: 12px;
  max-width: 420px;
}
.settings-section form {
  max-width: 450px;
}
.settings-section > button {
  justify-self: start;
}
.danger-zone h2 {
  color: var(--danger-text);
}
.request-history article {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px;
  margin: 15px 0;
  font-size: 12px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.request-history small {
  display: block;
  margin: 8px 0;
}
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 24px 0;
  font-size: 12px;
}
.legal-page {
  max-width: 900px;
  margin: 64px auto 100px;
  padding: 0 28px;
}
.legal-page h1 {
  font-size: 48px;
  line-height: 1.14;
  max-width: 800px;
}
.legal-lead {
  font-size: 20px;
  color: var(--muted);
}
.legal-page article {
  font-size: 14px;
  line-height: 1.9;
}
.legal-page h2 {
  margin: 38px 0 14px;
  font-size: 23px;
}
.legal-page table {
  font-size: 12px;
  width: 100%;
  border-collapse: collapse;
}
.legal-page th,
.legal-page td {
  padding: 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.legal-footer {
  border-top: 1px solid var(--line);
  padding: 25px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
@media (min-width: 1500px) {
  .workarea {
    padding-inline: 56px;
  }
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .workarea {
    padding: 28px 22px;
  }
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filters > div:first-child {
    grid-column: 1/-1;
  }
  .filters > button {
    height: 38px;
  }
  .activity-panel {
    grid-template-columns: 160px 1fr;
    gap: 20px;
  }
  .metrics > div {
    padding: 18px;
  }
  .connect {
    gap: 36px;
  }
  .reader-layout {
    grid-template-columns: minmax(0, 1fr) 190px;
  }
}
@media (max-width: 760px) {
  .topbar {
    padding: 0 18px;
    height: 64px;
  }
  .topbar nav {
    gap: 12px;
  }
  .topbar nav > a:nth-child(2),
  .product-label {
    display: none;
  }
  .workspace {
    display: block;
  }
  .workspace > aside {
    display: flex;
    flex-direction: row;
    overflow: auto;
    gap: 6px;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .workspace-name,
  .sidebar-bottom {
    display: none;
  }
  .nav-item {
    white-space: nowrap;
    font-size: 11px;
    gap: 10px;
    padding: 10px;
  }
  .workarea {
    padding: 22px 16px;
  }
  .workarea h1 {
    font-size: 26px;
  }
  .page-head {
    align-items: center;
    gap: 14px;
  }
  .page-head .actions {
    gap: 6px;
  }
  .page-head button {
    font-size: 11px;
    padding: 9px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .metrics > div:nth-child(2) {
    border-right: 0;
  }
  .metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .metrics strong {
    font-size: 28px;
  }
  .activity-panel {
    display: block;
    padding: 18px;
  }
  .activity-panel > div:first-child {
    margin-bottom: 22px;
  }
  .chart-legend {
    margin-top: 8px;
  }
  .filters {
    padding: 0 16px 16px;
  }
  .log-heading {
    padding: 20px 16px 4px;
  }
  .log-heading .hint {
    font-size: 10px;
  }
  .settings-section {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 26px 0;
  }
  .settings-section form {
    max-width: none;
  }
  .reader-layout {
    grid-template-columns: 1fr;
  }
  .message-details {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
  }
  .reader {
    padding: 20px;
  }
  .connect {
    display: block;
    margin: 40px auto;
    padding: 0 20px;
    max-width: 520px;
  }
  .connect > div {
    display: none;
  }
  .connect-panel {
    padding: 24px;
  }
  .legal-page {
    margin-top: 40px;
    padding: 0 20px;
  }
  .legal-page h1 {
    font-size: 36px;
  }
  .legal-page article {
    overflow-x: auto;
  }
  .legal-page td {
    min-width: 135px;
  }
  .legal-footer {
    gap: 20px;
  }
  .setup-notice {
    font-size: 12px;
    padding: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 420px) {
  .topbar {
    gap: 12px;
  }
  .topbar .brand {
    gap: 7px;
    font-size: 1.05rem;
  }
  .topbar .mark {
    width: 30px;
    height: 30px;
  }
  .topbar nav {
    font-size: 0.75rem;
    gap: 8px;
  }
}

/* Consistent, accessible controls and responsive workspace layouts. */
:root {
  --blue: #2f59db;
  --muted: #53657d;
}
button,
select {
  min-height: 44px;
}
input:not([type='checkbox']),
textarea {
  min-height: 44px;
}
p a,
.hint a,
.legal-page article a,
.legal-footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dialog-head button {
  min-width: 44px;
  min-height: 44px;
}
.inline-button {
  background: none;
  border: 0;
  color: var(--blue);
  padding: 0;
  min-height: 24px;
  text-decoration: underline;
  font-size: inherit;
  font-weight: inherit;
}
.mobile-workspace-nav,
.mobile-agent-label,
.mobile-agent-switcher {
  display: none;
}
#registration-notice p {
  margin: 0 0 14px;
}
#registration-notice a {
  font-weight: 650;
  text-decoration: underline;
}
.activity-details {
  margin: 18px 0 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.activity-details > summary,
.filter-details > summary {
  padding: 16px 24px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  min-height: 48px;
}
.activity-details .activity-panel {
  border: 0;
  margin: 0;
  padding-top: 8px;
}
.filter-details > summary {
  color: var(--muted);
}
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filters {
  grid-template-columns: minmax(140px, 2fr) repeat(3, minmax(100px, 1fr)) auto;
}
.filters > div {
  min-width: 0;
}
.filters button {
  min-height: 44px;
}
.empty-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 12px;
}
.empty-guide {
  display: inline-block;
  font-size: 14px;
  margin-top: 8px;
  text-decoration: underline;
}
.key-filter {
  margin: 4px 0 20px;
  width: fit-content;
}
.technical-details {
  font-size: 12px;
  margin: 16px 0;
}
.technical-details summary {
  cursor: pointer;
  padding: 8px 0;
}
#message-delivery-note {
  font-size: 13px;
  line-height: 1.65;
}
#copy-address {
  display: block;
  padding: 0;
  min-height: 32px;
  color: var(--blue);
  text-decoration: underline;
}
@media (max-width: 1100px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filter-actions {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  .workspace > aside {
    display: none;
  }
  .mobile-workspace-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .topbar nav button {
    font-size: inherit;
    padding: 8px;
  }
  .mobile-workspace-nav label {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
  }
  .mobile-workspace-nav select {
    width: auto;
    flex: 1;
    margin: 0;
    min-width: 0;
  }
  .page-head {
    text-align: left;
    align-items: flex-start;
  }
  .page-head .actions {
    justify-content: flex-start;
  }
  .page-head button {
    font-size: 12px;
    padding: 10px 12px;
  }
  .metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .metrics > div {
    padding: 12px 8px;
    border-bottom: 0 !important;
    border-right: 1px solid var(--line) !important;
  }
  .metrics > div:last-child {
    border-right: 0 !important;
  }
  .metrics span {
    min-height: 32px;
    font-size: 10px;
    line-height: 1.4;
  }
  .metrics strong {
    font-size: 23px;
  }
  .activity-details {
    margin: 12px 0 20px;
  }
  .activity-details > summary,
  .filter-details > summary {
    padding: 14px 16px;
  }
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filters > div:first-child,
  .filter-actions {
    grid-column: 1/-1;
  }
  .filters button {
    width: auto;
    font-size: 13px;
  }
  .mail-log .table-wrap {
    border: 0;
    overflow: visible;
  }
  .message-table {
    display: block;
    min-width: 0;
    table-layout: auto;
  }
  .message-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .message-table tbody {
    display: block;
  }
  .message-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 16px;
    border-top: 1px solid var(--line);
    gap: 10px 12px;
  }
  .message-table td {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0;
  }
  .message-table td:first-child,
  .message-table td:nth-child(2),
  .message-table td:last-child {
    grid-column: 1 / -1;
  }
  .message-table td small,
  .message-table td strong {
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .message-table td:nth-child(2) small {
    display: none;
  }
  .subject-link {
    min-height: 44px;
    text-align: left;
    overflow-wrap: anywhere;
    white-space: normal;
    line-height: 1.5;
  }
  .message-table td:last-child {
    color: var(--muted);
    font-size: 11px;
  }
  .mobile-agent-label {
    display: block;
    margin: 0 0 8px;
  }
  .mobile-agent-switcher {
    display: block;
    width: 100%;
    margin: 0;
  }
  .mailbox-column {
    padding: 16px;
  }
  .mailbox-column h2,
  #mailbox-list {
    display: none;
  }
  .inbox-head {
    padding: 16px;
    gap: 12px;
  }
  .inbox-head > div {
    width: 100%;
  }
  .inbox-head button {
    font-size: 13px;
  }
  #selected-address {
    overflow-wrap: anywhere;
  }
  .empty {
    padding: 36px 20px;
  }
  .empty h3 {
    font-size: 22px;
  }
  .empty-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .message-details {
    padding-top: 12px;
  }
}
