.my-button.account-avatar-link {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
}

.my-button.account-avatar-link:hover,
.my-button.account-avatar-link.active { background: transparent; }
.account-avatar {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 50%;
  border: 1px solid #d7d7dc;
  color: #515154;
  background: #ededf0;
  vertical-align: middle;
}

.account-avatar > span {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
}

.account-avatar.account-avatar-member {
  padding: 3px;
  border: 0;
  color: #e8d4a3;
  background: #b59759;
  box-shadow: 0 0 0 1px #8c733d, 0 0 0 3px #efe8db, 0 3px 7px rgba(53, 40, 17, .12);
}

.account-avatar-member > span {
  border: 1px solid #121315;
  background: #42434a;
  box-shadow: inset 0 0 0 1px #55565f;
}

.account-avatar.account-avatar-large { width: 78px; height: 78px; }
.account-avatar-large > span { font-size: 19px; letter-spacing: .08em; }
.account-avatar-large.account-avatar-member { padding: 4px; }
.profile-identity { display: flex; min-width: 0; align-items: center; gap: 20px; }
.profile-identity > div { min-width: 0; }
.profile-identity h1 { overflow-wrap: anywhere; }
.member-identity-label { color: #87652e; font-size: 12px; font-weight: 600; letter-spacing: .08em; }

.membership-layout {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin: 32px 0 64px;
}

.membership-status,
.profile-membership {
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.membership-status p,
.profile-membership p {
  margin: 6px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.membership-plan {
  padding: 32px;
  border: 1px solid var(--ink);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.membership-plan h2 { margin: 22px 0 6px; }
.membership-mode {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 600;
}

.membership-price { display: flex; align-items: baseline; gap: 7px; margin: 8px 0; }
.membership-price strong { font-size: 64px; line-height: 1.15; letter-spacing: -3px; }
.membership-price span { color: var(--muted); }
.membership-purchase { margin-top: 26px; }
.membership-purchase .button,
.membership-continue { width: 100%; white-space: normal; text-align: center; }
.membership-continue { margin-top: 16px; }
.membership-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.membership-benefits { padding-top: 16px; }
.membership-benefits h2 { margin: 0 0 18px; }
.membership-benefits ul { padding-left: 22px; }
.membership-benefits li { margin: 16px 0; padding-left: 6px; }
.membership-benefits li::marker { color: var(--ink); }
.membership-benefits > p { max-width: 50ch; margin-top: 28px; }
.profile-membership { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 24px 0; }
.profile-membership h2 { margin: 0; font-size: 20px; }
.profile-membership small { display: block; margin-top: 8px; color: var(--muted); }
.profile-membership .button { flex-shrink: 0; }

@media (max-width: 700px) {
  .membership-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .membership-plan { padding: 24px; }
  .membership-status, .profile-membership { padding: 20px; }
  .profile-membership { flex-direction: column; align-items: stretch; }
  .membership-benefits { padding: 12px 4px; }
  .membership-page .site-nav .nav-user { display: none; }
}

.membership-promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 32px;
  margin: 0 0 30px;
  border: 1px solid #333438;
  border-radius: 20px;
  color: #f5f2eb;
  background: linear-gradient(120deg, #292a2e, #151619);
}
.membership-promo-kicker { color: #c9ad77; font-size: 10px; font-weight: 650; letter-spacing: .2em; }
.membership-promo h2 { margin: 8px 0; font-size: 24px; line-height: 1.35; letter-spacing: -.03em; }
.membership-promo p { margin: 0; color: #d5d5d9; }
.membership-promo small { display: block; margin-top: 8px; color: #a3a4ab; font-size: 11px; }
.membership-promo .button { flex-shrink: 0; background: #eee2c7; color: #29251e; border-color: transparent; font-weight: 650; }
.membership-promo .button:hover { background: #fff0cd; color: #29251e; }
.membership-status { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.membership-status small { display: block; color: var(--muted); margin-top: 6px; }
.membership-status-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.membership-status-actions form { margin: 0; }
.membership-simulation { color: var(--muted); font-size: 12px; margin: 18px 0 24px; }
.membership-plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 28px 0 40px; }
.membership-plan.membership-plan-option { display: flex; flex-direction: column; padding: 24px 20px; border-color: var(--line); box-shadow: none; border-radius: 18px; }
.membership-plan-option h2 { margin: 20px 0 12px; font-size: 21px; line-height: 1.4; }
.membership-plan-option .membership-price { flex-wrap: wrap; gap: 5px; margin: 8px 0 16px; }
.membership-plan-option .membership-price strong { font-size: 48px; letter-spacing: -2px; }
.membership-plan-option .membership-price span { font-size: 12px; }
.membership-plan-tag { align-self: flex-start; padding: 4px 8px; border-radius: 6px; color: var(--muted); background: var(--surface-soft); font-size: 11px; font-weight: 600; }
.membership-plan.membership-plan-recurring { border-color: #ccb786; background: linear-gradient(160deg, #fffefb, #faf8f2); }
.membership-plan-recurring .membership-plan-tag { color: #795c2e; background: #f0e7d3; }
.membership-plan-copy { color: var(--muted); font-size: 13px; min-height: 3.2em; margin: 0 0 12px; }
.membership-plan-features { padding-left: 18px; margin: 8px 0 26px; font-size: 13px; }
.membership-plan-features li { margin: 10px 0; }
.membership-plan-option .membership-purchase { margin-top: auto; }
.membership-plan-option .membership-purchase .button { padding: 10px 8px; font-size: 13px; }
.membership-shared-benefits { padding: 24px 0 40px; }
.membership-shared-benefits ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.membership-shared-benefits > p { max-width: 90ch; }
.profile-avatar-tools { padding: 22px 0 30px; border-bottom: 1px solid var(--line); }
.profile-avatar-tools h2 { font-size: 16px; margin: 0 0 6px; }
.profile-avatar-tools p { font-size: 12px; max-width: 65ch; margin: 0 0 18px; }
.avatar-upload-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.avatar-upload-actions .avatar-remove-form { margin: 0; }
.avatar-upload-form input[type="file"] { background: var(--surface); border: 1px solid var(--line); padding: 8px; border-radius: 10px; }
.avatar-upload-form input::file-selector-button { padding: 5px 9px; margin-right: 8px; border: 0; border-radius: 5px; background: var(--surface-soft); color: var(--text); font: inherit; }
.summary-model-settings { margin: 26px 0; padding: 26px 0; }
.summary-model-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; max-width: 600px; }
.summary-model-form label { flex: 1 1 240px; }
.summary-model-settings > p { font-size: 13px; }
@media (max-width: 1000px) {
  .membership-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .membership-promo { flex-direction: column; align-items: stretch; padding: 23px; gap: 18px; }
  .membership-promo h2 { font-size: 22px; }
  .membership-status { flex-direction: column; align-items: stretch; }
  .membership-status-actions { justify-content: flex-start; }
  .membership-plans { grid-template-columns: minmax(0, 1fr); }
  .membership-plan.membership-plan-option { padding: 26px; }
  .membership-plan-copy { min-height: 0; }
  .membership-shared-benefits ul { grid-template-columns: minmax(0, 1fr); }
  .avatar-upload-form { max-width: 100%; }
}

.membership-plan.membership-plan-option.membership-plan-annual,
.profile-membership.profile-membership-annual {
  color: #f3ecff;
  border-color: #635078;
  background: linear-gradient(145deg, #30213f 0%, #19131f 48%, #100e15 100%);
  box-shadow: inset 0 1px 0 rgba(231, 208, 255, .07), 0 8px 28px rgba(33, 17, 50, .07);
}
.membership-plan-annual .membership-plan-tag { color: #ddc8f5; background: rgba(174, 135, 219, .14); }
.membership-plan-annual h2,
.profile-membership-annual h2 { color: #f3ecff; }
.membership-plan-annual .membership-price span,
.membership-plan-annual .membership-plan-copy,
.membership-plan-annual .membership-plan-features,
.profile-membership.profile-membership-annual p,
.profile-membership.profile-membership-annual small { color: #c4b7d6; }
.membership-plan-annual .button,
.profile-membership-annual .button { border-color: transparent; color: #2a1b38; background: #e3d5f2; }
.membership-plan-annual .button:hover,
.profile-membership-annual .button:hover { color: #20132b; background: #f0e6fc; }
.member-identity-label.member-identity-annual { display: inline-block; padding: 3px 9px; border: 1px solid #5f4776; border-radius: 5px; color: #e1c9f8; background: linear-gradient(120deg, #30213f, #18121e); font-size: 10px; letter-spacing: .08em; }
.membership-status.membership-status-annual { border-color: #b9a2cf; background: linear-gradient(120deg, #f5effb, #fff); }
.membership-status-annual .status-good { color: #5b3976; background: #e9def3; }

:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #f0f0f2;
  --surface-elevated: rgba(255, 255, 255, 0.82);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.18);
  --ink: #1d1d1f;
  --ink-dark: #000000;
  --ink-soft: #e8e8ed;
  --green: #248a3d;
  --green-dark: #17652a;
  --green-soft: #eaf7ed;
  --amber: #8a5a00;
  --amber-soft: #fff5df;
  --red: #d70015;
  --red-soft: #fff0f1;
  --blue: #0071e3;
  --blue-soft: #eaf4ff;
  --focus: rgba(0, 113, 227, 0.18);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.09);
  --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 22px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover {
  color: var(--blue);
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
summary,
select {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 252, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.header-inner {
  width: min(1120px, calc(100% - 48px));
  min-height: 56px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-primary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.brand {
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand img {
  display: block;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
}

.brand:hover {
  text-decoration: none;
}

.back-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.back-button:hover {
  color: #fff;
  background: var(--ink);
  text-decoration: none;
}

.my-button {
  display: inline-flex;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.my-button:hover,
.my-button.active {
  color: #fff;
  background: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.language-form {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.language-form label {
  display: block;
}

.language-form select {
  width: 112px;
  min-height: 34px;
  padding: 5px 28px 5px 9px;
  border-color: transparent;
  background-color: var(--surface-soft);
  font-size: 13px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-nav a,
.link-button {
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 8px;
  color: #515154;
  font-size: 14px;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.active,
.link-button:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.055);
  text-decoration: none;
}

.site-nav a.active {
  font-weight: 650;
}

.nav-user {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-form {
  margin: 0;
}

.link-button {
  border: 0;
  background: transparent;
}

.link-button:hover {
  color: var(--text);
}

.page-shell {
  width: min(1120px, calc(100% - 48px));
  min-height: calc(100vh - 130px);
  margin: 0 auto;
  padding: 50px 0 76px;
}

.site-footer {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.16;
}

h2 {
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.25;
}

h3 {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 650;
}

h4 {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 650;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.muted,
label small,
td small {
  color: var(--muted);
}

.notice {
  margin-bottom: 24px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-elevated);
}

.notice-success {
  border-color: #a8d1bd;
  color: var(--green-dark);
  background: var(--green-soft);
}

.authorization-success {
  display: grid;
  gap: 3px;
}

.authorization-success strong {
  color: #111111;
}

.notice-error {
  border-color: #e5b8b4;
  color: var(--red);
  background: var(--red-soft);
}

.email-binding-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
  padding: 18px 20px;
  border: 1px solid #000000;
  border-radius: 8px;
  color: #ffffff;
  background: #111111;
}

.email-binding-prompt-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.email-binding-prompt-copy strong {
  font-size: 15px;
}

.email-binding-prompt-copy span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.email-binding-prompt .button {
  flex: 0 0 auto;
  border-color: #ffffff;
  color: #111111;
  background: #ffffff;
}

.email-binding-prompt .button:hover {
  border-color: #e8e8ed;
  color: #000000;
  background: #e8e8ed;
}

.auth-page .page-shell {
  display: grid;
  place-items: start center;
  padding-top: 72px;
}

.auth-panel {
  width: min(100%, 460px);
  padding: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel-wide {
  width: min(100%, 640px);
}

.auth-panel .button-primary {
  width: 100%;
}

.auth-help-row {
  margin-top: -6px;
  text-align: right;
  font-size: 13px;
}

.auth-back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.auth-intro {
  margin: -8px 0 24px;
  line-height: 1.65;
}

.privacy-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.verification-complete {
  text-align: center;
}

.verification-complete .button {
  margin-top: 10px;
}

.success-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-size: 25px;
  font-weight: 700;
  line-height: 44px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: -10px 0 30px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.auth-tabs a {
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
}

.auth-tabs a.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

.auth-tabs a:hover {
  text-decoration: none;
}

.form-stack {
  display: grid;
  gap: 18px;
}

.form-grid,
.inline-form,
.settings-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: #3a3a3c;
  font-size: 14px;
  font-weight: 600;
}

label small {
  font-size: 12px;
  font-weight: 400;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: var(--surface-soft);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

input:focus,
select:focus {
  border-color: var(--blue);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--focus);
}

input[type="file"] {
  padding: 6px;
}

input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 10px;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.check-row {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  font-weight: 500;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin: 3px 0 0;
  accent-color: var(--ink);
}

.button {
  display: inline-flex;
  width: fit-content;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.button:hover {
  border-color: rgba(0, 0, 0, 0.32);
  color: var(--text);
  box-shadow: var(--shadow-small);
  text-decoration: none;
  transform: translateY(-1px);
}

.button-primary {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}

.button-primary:hover {
  border-color: var(--ink-dark);
  background: var(--ink-dark);
  color: #fff;
}

.button-danger {
  border-color: #d9aaa7;
  color: var(--red);
  background: #fff;
}

.button-small {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

button:active,
.button:active {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.42);
  outline-offset: 2px;
}

.page-heading,
.summary-header,
.section-heading,
.panel-heading,
.category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.page-heading {
  margin-bottom: 34px;
}

.page-heading h1,
.panel-heading h2,
.section-heading h2,
.category-heading h3 {
  margin-bottom: 0;
}

.heading-status,
.admin-status {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.status-dot,
.mini-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 3px 9px;
  border: 0;
  border-radius: 999px;
  color: #4f5954;
  background: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.status-good,
.badge-good {
  color: var(--green-dark);
  background: var(--green-soft);
}

.status-warn,
.badge-warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-error,
.badge-error {
  color: #fff;
  background: var(--red);
}

.admin-alert-settings .notice-inline {
  margin: 16px 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.admin-alert-settings .notice-inline strong {
  color: var(--text);
}

.alert-status-table {
  margin-top: 22px;
}

.alert-status-table td {
  vertical-align: middle;
}

.status-muted,
.badge-muted {
  color: var(--muted);
  background: var(--surface-soft);
}

.summary-status[data-summary-state="generating"]::before {
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: summary-spin 0.8s linear infinite;
}

.summary-status {
  gap: 6px;
}

.summary-status[data-summary-state="completed"]::before {
  content: "✓";
  font-size: 13px;
  line-height: 1;
}

@keyframes summary-spin {
  to { transform: rotate(360deg); }
}

.summary-band {
  margin-bottom: 40px;
  padding: 10px 0 8px;
}

.mailbox-summary-notice {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid;
  border-radius: 8px;
}

.mailbox-summary-failed {
  border-color: #e5b8b4;
  background: var(--red-soft);
}

.mailbox-summary-pending {
  border-color: #ead3a6;
  background: var(--amber-soft);
}

.mailbox-summary-notice h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.mailbox-summary-notice p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.mailbox-summary-notice ul {
  min-width: min(100%, 330px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.mailbox-summary-notice li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mailbox-summary-notice li:last-child {
  border-bottom: 0;
}

.mailbox-summary-notice li div {
  min-width: 0;
}

.mailbox-summary-notice li strong,
.mailbox-summary-notice li span:not(.mini-badge) {
  display: block;
  overflow-wrap: anywhere;
}

.mailbox-summary-notice li span:not(.mini-badge) {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.mailbox-authorization-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 15px 18px;
  border: 1px solid #e5b8b4;
  border-radius: 8px;
  background: var(--red-soft);
}

.mailbox-authorization-notice h2 {
  margin: 0 0 4px;
  font-size: 15px;
}

.mailbox-authorization-notice p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.mailbox-authorization-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.mailbox-reconnect-button {
  max-width: 190px;
  white-space: normal;
  text-align: center;
}

.digest-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 18px;
  padding: 0;
}

.digest-form {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.digest-form label {
  width: 190px;
}

.digest-form .button {
  min-width: 104px;
}

.digest-history {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 34px;
  padding: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.digest-history > div {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  padding: 4px;
  border-radius: 8px;
  background: #e8e8ed;
}

.digest-history a {
  min-height: 32px;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}

.digest-history a:hover,
.digest-history a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.62);
  text-decoration: none;
}

.digest-history a.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.summary-header {
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.summary-header h2 {
  margin-bottom: 0;
  font-size: 28px;
}

.summary-counts {
  display: flex;
  gap: 24px;
  color: var(--muted);
}

.summary-counts strong {
  color: var(--text);
  font-size: 24px;
  font-weight: 650;
}

.digest-category {
  margin-bottom: 34px;
}

.category-heading {
  margin-bottom: 12px;
}

.category-heading span {
  min-width: 28px;
  height: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.digest-advertising .category-heading h3 {
  color: var(--amber);
}

.digest-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.digest-item {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.digest-item-link {
  display: block;
  color: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.digest-item-link:hover,
.digest-item-link:focus-visible {
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.09);
  text-decoration: none;
  transform: translateY(-1px);
}

.digest-item-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.digest-advertising .digest-item {
  border-left: 3px solid #d8a33a;
}

.digest-normal .digest-item {
  border-left: 3px solid var(--blue);
}

.digest-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.digest-meta span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.digest-source {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 650;
}

.digest-item h4,
.digest-item p {
  overflow-wrap: anywhere;
}

.digest-item p {
  margin-bottom: 0;
  color: #515154;
}

.message-heading {
  align-items: flex-start;
}

.message-heading > div:first-child {
  min-width: 0;
  flex: 1 1 480px;
}

.message-heading h1 {
  max-width: 760px;
  overflow-wrap: anywhere;
  font-size: 34px;
  line-height: 1.2;
}

.message-actions {
  display: flex;
  flex: 0 1 450px;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.translation-form {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  gap: 9px;
}

.translation-form label {
  min-width: 150px;
  margin: 0;
}

.translation-form label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.translation-form select {
  min-height: 40px;
  padding: 7px 32px 7px 10px;
}

.message-metadata {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr) minmax(100px, 0.5fr);
  gap: 0;
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
  overflow: hidden;
}

.message-metadata > div {
  min-width: 0;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.message-metadata > div:last-child {
  border-right: 0;
}

.message-metadata span,
.message-metadata strong {
  display: block;
  overflow-wrap: anywhere;
}

.message-metadata span {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
}

.message-content {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.message-content + .message-content {
  margin-top: 18px;
}

.message-content .section-heading {
  align-items: flex-end;
  margin-bottom: 20px;
}

.message-content h2 {
  overflow-wrap: anywhere;
  font-size: 24px;
}

.message-translation {
  border-top: 3px solid var(--blue);
}

.mail-body {
  max-width: 920px;
  color: #3a3a3c;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.8;
}

.mail-html-shell {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mail-html-frame {
  display: block;
  width: 100%;
  min-width: 0;
  height: clamp(620px, 76vh, 980px);
  border: 0;
  background: #fff;
  overscroll-behavior: contain;
}

@media (max-width: 600px) {
  .message-original {
    padding: 14px;
  }

  .message-original .section-heading {
    margin-bottom: 14px;
  }

  .mail-html-frame {
    height: 72vh;
    height: 72dvh;
    min-height: 540px;
  }
}

.category-empty,
.empty-state {
  color: var(--muted);
}

.empty-state {
  padding: 48px 24px 62px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
  text-align: center;
}

.empty-state h2 {
  color: var(--text);
}

.profile-heading {
  margin-bottom: 24px;
}

.profile-overview,
.profile-section {
  padding: 28px 0 34px;
}

.profile-overview {
  border-bottom: 1px solid var(--line);
}

.profile-section {
  border-bottom: 1px solid var(--line);
}

.profile-overview .section-heading,
.profile-section .section-heading {
  margin-bottom: 18px;
}

.profile-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.profile-fact {
  min-width: 0;
  padding: 4px 24px 4px 0;
  border-right: 1px solid var(--line);
}

.profile-fact + .profile-fact {
  padding-left: 24px;
}

.profile-fact:last-child {
  padding-right: 0;
  border-right: 0;
}

.profile-fact span,
.profile-fact strong {
  display: block;
}

.profile-fact span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.profile-fact strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.account-email-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.account-email-copy {
  min-width: 0;
}

.account-email-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.account-email-value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.account-email-value strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.account-email-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-email-summary .button {
  flex: 0 0 auto;
}

#mailbox-connections,
#notification-email {
  scroll-margin-top: 76px;
}

.profile-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  border-bottom: 1px solid var(--line);
}

.profile-settings-grid .profile-section {
  border-bottom: 0;
}

.profile-settings-grid .account-panel {
  margin-top: 0;
}

.notification-panel {
  grid-column: 1 / -1;
}

.notification-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  max-width: 1060px;
}

.notification-address,
.pending-address {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.notification-address span,
.pending-address span {
  color: var(--muted);
  font-size: 12px;
}

.notification-address strong,
.pending-address strong {
  overflow-wrap: anywhere;
}

.pending-address strong {
  color: #8a6500;
}

.notification-email-form {
  margin-top: 10px;
}

.notification-code-form {
  margin: 18px 0 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.verification-code-input {
  width: min(100%, 220px);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.recovery-resend-form {
  margin-top: 18px;
  text-align: center;
}

.password-verification-copy {
  margin-bottom: 14px;
}

.password-code-request {
  margin-bottom: 20px;
}

.password-change-form {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.password-email-required {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.password-email-required p {
  margin-bottom: 14px;
  color: var(--muted);
}

.notification-delivery {
  padding-left: 40px;
  border-left: 1px solid var(--line);
}

.account-email-heading {
  margin-bottom: 18px;
}

.account-email-intro {
  max-width: 760px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 16px;
}

.account-email-content {
  max-width: none;
  padding: 28px 0 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.account-email-section {
  min-width: 0;
}

.account-email-section .section-heading {
  margin-bottom: 18px;
}

.compact-notice {
  margin: 0 0 18px;
  padding: 11px 13px;
  font-size: 13px;
}

.account-email-empty {
  min-height: 180px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
}

.account-email-empty h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.account-email-empty p {
  margin: 0;
  color: var(--muted);
}

.account-email-footer {
  margin: 22px 0 0;
  font-size: 14px;
}

.provider-help-content {
  max-width: 900px;
  margin: 0 auto;
}

.provider-help-heading {
  max-width: 900px;
  margin-right: auto;
  margin-left: auto;
}

.provider-help-heading h1 {
  max-width: 760px;
}

.help-copy {
  padding-bottom: 38px;
}

.help-intro {
  margin: 0 0 24px;
  color: #3a3a3c;
  font-size: 17px;
  line-height: 1.75;
}

.help-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding-left: 28px;
}

.help-steps li {
  padding: 13px 8px 13px 6px;
  border-bottom: 1px solid var(--line);
  color: #3a3a3c;
  line-height: 1.75;
}

.help-steps li::marker {
  color: var(--text);
  font-weight: 700;
}

.help-warning {
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
}

.help-warning strong {
  display: block;
  margin-bottom: 3px;
}

.help-warning p {
  margin: 0;
  color: #5b4a26;
}

.help-source {
  margin: 20px 0 0;
}

.help-source a {
  color: var(--blue);
  font-weight: 600;
}

.help-image-section {
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.help-image-section .section-heading {
  margin-bottom: 16px;
}

.help-guide-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.help-image-empty {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.46);
  text-align: center;
}

.help-image-empty p {
  max-width: 560px;
  margin: 0;
}

.profile-form {
  max-width: 520px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.mailbox-connect-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.mailbox-connect-action p {
  flex: 1 1 260px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.mailbox-panel {
  grid-column: 1 / -1;
}

.mailbox-panel .panel-heading p {
  margin: 5px 0 0;
}

.mailbox-list {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.mailbox-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.mailbox-card-main {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 10px;
}

.mailbox-card-main strong {
  overflow-wrap: anywhere;
}

.mailbox-card-main small {
  color: var(--muted);
}

.mailbox-card-main .inline-error {
  width: 100%;
  font-size: 12px;
}

.mailbox-card-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.mailbox-card-actions form {
  margin: 0;
}

.provider-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.provider-google {
  color: #8c4a00;
  background: #fff0d9;
}

.provider-qq {
  color: #165a87;
  background: #e8f4fc;
}

.mailbox-provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.provider-connect {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.provider-connect h3,
.provider-connect p {
  margin-bottom: 6px;
}

.provider-connect > p,
.provider-connect > small {
  color: var(--muted);
  font-size: 12px;
}

.provider-connect > small {
  display: block;
  margin-top: 10px;
}

.inline-help-link {
  margin-left: 4px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}

.inline-help-link:hover {
  text-decoration: underline;
}

.compact-form {
  gap: 10px;
  margin-top: 10px;
}

.compact-form input {
  min-height: 36px;
  padding: 6px 9px;
}

.panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.panel-heading {
  margin-bottom: 18px;
}

.detail-list {
  margin: 0 0 18px;
}

.detail-list div {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.inline-error,
.error-text {
  color: var(--red);
}

.account-panel {
  margin-top: 20px;
}

.inline-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
}

.admin-status {
  margin: -14px 0 24px;
}

.privacy-boundary {
  max-width: 380px;
  margin-bottom: 0;
  color: var(--muted);
  text-align: right;
}

.admin-settings {
  margin-bottom: 30px;
}

.admin-email-settings {
  margin-bottom: 30px;
}

.smtp-endpoint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.smtp-endpoint span {
  color: var(--muted);
  font-size: 13px;
}

.smtp-test-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.mail-queue-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

.mail-queue-stats strong {
  color: var(--text);
}

.admin-settings .settings-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-upload {
  margin-bottom: 30px;
}

.admin-help-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.help-upload-slot {
  min-width: 0;
  padding: 20px;
  border-left: 1px solid var(--line);
}

.help-upload-slot:first-child {
  border-left: 0;
}

.help-upload-heading {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.help-upload-preview,
.help-upload-placeholder {
  width: 100%;
  height: 180px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.help-upload-preview {
  display: block;
  object-fit: contain;
}

.help-upload-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.help-image-upload-form {
  gap: 12px;
}

.help-image-upload-form input[type="file"] {
  font-size: 12px;
}

.admin-help-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 4px 22px 4px 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.admin-settings fieldset:last-child {
  padding-right: 0;
  border-right: 0;
}

fieldset legend {
  padding: 0 0 12px;
  color: var(--text);
  font-weight: 700;
}

fieldset label + label {
  margin-top: 14px;
}

fieldset > small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.button-row {
  display: flex;
  gap: 10px;
}

.secondary-action {
  margin-top: 14px;
}

.secondary-action + form {
  margin-top: 10px;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading span {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

th {
  color: #515154;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
}

td {
  font-size: 13px;
}

td strong,
td small {
  display: block;
}

td .mini-badge {
  display: inline-flex;
  margin-top: 6px;
}

tr:last-child td {
  border-bottom: 0;
}

.row-actions {
  display: grid;
  justify-items: start;
  gap: 7px;
}

.row-actions form {
  margin: 0;
}

details summary {
  color: var(--ink);
  font-size: 12px;
}

.reset-form {
  display: grid;
  width: 190px;
  gap: 7px;
  margin-top: 8px;
}

.reset-form input {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.legal-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-content h2 {
  margin-top: 28px;
  margin-bottom: 8px;
  font-size: 17px;
}

.legal-content p {
  color: #515154;
}

.error-page {
  max-width: 560px;
  padding: 60px 0;
}

@media (max-width: 820px) {
  .header-inner,
  .page-shell,
  .site-footer {
    width: min(100% - 28px, 1120px);
  }

  .digest-list,
  .settings-grid,
  .settings-columns,
  .admin-settings .settings-columns,
  .mailbox-provider-grid,
  .notification-settings-grid,
  .admin-help-upload-grid,
  .inline-form,
  .profile-settings-grid {
    grid-template-columns: 1fr;
  }

  .message-heading {
    flex-direction: column;
  }

  .message-heading > div:first-child,
  .message-actions {
    width: 100%;
    flex-basis: auto;
  }

  .message-actions {
    justify-content: flex-start;
  }

  .message-metadata {
    grid-template-columns: 1fr 1fr;
  }

  .message-metadata > div:nth-child(2) {
    border-right: 0;
  }

  .message-metadata > div:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .profile-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 22px;
  }

  .profile-fact:nth-child(2) {
    padding-right: 0;
    border-right: 0;
  }

  .profile-fact:nth-child(3) {
    padding-left: 0;
  }

  .account-email-summary {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .account-email-summary .button {
    align-self: flex-start;
  }

  .profile-settings-grid {
    gap: 0;
  }

  .notification-settings-grid {
    gap: 24px;
  }

  .notification-delivery {
    padding: 24px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .help-upload-slot,
  .help-upload-slot:first-child {
    padding: 20px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .help-upload-slot:first-child {
    border-top: 0;
  }

  .admin-help-upload-grid {
    border-bottom: 0;
  }

  .profile-settings-grid .account-panel {
    border-top: 1px solid var(--line);
  }

  .inline-form {
    align-items: stretch;
  }

  .admin-settings fieldset,
  .admin-settings fieldset:last-child {
    padding: 4px 0 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-settings fieldset:last-child {
    padding-bottom: 4px;
    border-bottom: 0;
  }

  .page-heading {
    align-items: flex-start;
  }

  .privacy-boundary {
    max-width: 280px;
  }
}

@media (max-width: 600px) {
  .site-header {
    position: sticky;
  }

  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 8px;
    width: calc(100% - 24px);
    padding: 10px 0;
  }

  .header-primary {
    gap: 9px;
  }

  .header-inner.has-back .header-primary {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .header-inner.has-back .site-nav {
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
    justify-content: flex-start;
  }

  .header-inner.has-back .language-form {
    grid-column: 2;
    grid-row: 2;
  }

  .my-button {
    min-height: 32px;
    padding: 4px 9px;
  }

  .back-button {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 21px;
  }

  .header-actions {
    display: contents;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 3px;
  }

  .language-form {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .language-form select {
    width: 112px;
    min-height: 32px;
    font-size: 16px;
  }

  .nav-user {
    display: none;
  }

  .page-shell {
    width: calc(100% - 24px);
    padding: 32px 0 52px;
  }

  .email-binding-prompt {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
    padding: 16px;
  }

  .email-binding-prompt .button {
    align-self: flex-start;
  }

  .auth-page .page-shell {
    padding-top: 32px;
  }

  .auth-panel,
  .panel,
  .legal-content {
    padding: 22px;
  }

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

  .smtp-test-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .smtp-endpoint {
    align-items: flex-start;
    flex-direction: column;
  }

  input,
  select {
    font-size: 16px;
  }

  .page-heading,
  .summary-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .privacy-boundary {
    max-width: none;
    text-align: left;
  }

  .summary-counts {
    width: 100%;
    flex-wrap: wrap;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    background: var(--surface-soft);
  }

  .summary-counts span {
    min-width: 0;
    text-align: center;
  }

  .summary-counts strong {
    display: block;
    font-size: 22px;
  }

  .digest-toolbar,
  .digest-form {
    width: 100%;
  }

  .digest-toolbar {
    padding: 0;
  }

  .digest-form {
    padding: 12px;
  }

  .digest-history {
    align-items: flex-start;
    flex-direction: column;
  }

  .digest-history > div {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .digest-history a {
    min-width: 0;
    padding-inline: 5px;
    overflow: hidden;
    font-size: 11px;
    text-align: center;
    text-overflow: ellipsis;
  }

  .digest-form {
    align-items: stretch;
    flex-direction: column;
  }

  .message-heading h1 {
    font-size: 28px;
  }

  .message-actions,
  .translation-form {
    width: 100%;
  }

  .translation-form {
    align-items: stretch;
    flex-direction: column;
  }

  .translation-form label,
  .translation-form .button,
  .message-actions > .button {
    width: 100%;
  }

  .message-metadata {
    grid-template-columns: 1fr;
  }

  .message-metadata > div,
  .message-metadata > div:nth-child(2),
  .message-metadata > div:last-child {
    grid-column: auto;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .message-metadata > div:first-child {
    border-top: 0;
  }

  .message-content {
    padding: 20px;
  }

  .provider-help-heading h1 {
    font-size: 28px;
  }

  .help-intro {
    font-size: 16px;
  }

  .help-copy {
    padding-bottom: 30px;
  }

  .help-image-section {
    padding-top: 28px;
  }

  .help-upload-preview,
  .help-upload-placeholder {
    height: 150px;
  }

  .digest-form label,
  .digest-form .button {
    width: 100%;
  }

  .digest-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .digest-meta span {
    max-width: 100%;
  }

  .digest-source {
    margin-left: 0;
  }

  .mailbox-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .mailbox-card-actions,
  .mailbox-card-actions .button {
    width: 100%;
  }

  .mailbox-card-actions {
    align-items: stretch;
  }

  .profile-facts {
    grid-template-columns: 1fr;
    row-gap: 0;
  }

  .profile-fact,
  .profile-fact + .profile-fact,
  .profile-fact:nth-child(3) {
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-fact:last-child {
    border-bottom: 0;
  }

  h1 {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
