:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #252527;
  background: #f5f5f7;
  font-size: 13px;
  line-height: 1.45;
  --accent: #007aff;
  --muted: #727277;
  --border: #dedee2;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #007aff80; outline-offset: 3px; }
button {
  min-height: 28px;
  padding: 4px 12px;
  border: 1px solid #d1d1d5;
  border-radius: 6px;
  background: #fff;
  color: #303033;
  box-shadow: 0 1px 2px #00000008;
  cursor: pointer;
  white-space: nowrap;
}
button:hover { background: #f5f5f7; }
button:active { background: #e9e9ed; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: #0070eb; color: #fff; }
button.primary:hover { background: #006ee6; }
button.danger { color: #c42b31; }
a { color: #006bdd; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; letter-spacing: -.45px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
.muted, .section-note, .panel-note, .field-note { color: var(--muted); }
.small, small { font-size: 12px; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brandmark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(#53a5ff, #0878ef); color: #fff; box-shadow: inset 0 0 0 1px #0000000d; }
.brandmark .icon { width: 25px; height: 25px; }
aside { position: fixed; inset: 0 auto 0 0; width: 236px; padding: 28px 14px 16px; background: #eaeaec; border-right: 1px solid #d9d9de; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: inherit; font-size: 14px; font-weight: 600; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-weight: 400; }
nav { display: grid; gap: 3px; margin-top: 30px; }
nav a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; color: inherit; border-radius: 6px; }
nav a:hover { background: #dedee2; }
nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.nav-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 6px; color: #fff; box-shadow: inset 0 0 0 1px #0000000c; flex: none; }
.nav-icon .icon { width: 18px; height: 18px; }
.gray { background: #8b8b92; }
.blue { background: #1689ed; }
.purple { background: #9256d9; }
.red { background: #ee5861; }
.aside-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding: 14px 10px 0; color: var(--muted); font-size: 12px; }
.text-button { color: #006bdd; background: none; border: 0; box-shadow: none; padding: 4px; }
main { margin-left: 236px; min-height: 100vh; }
header { min-height: 78px; display: flex; align-items: center; gap: 14px; padding: 20px 32px; border-bottom: 1px solid var(--border); }
header button { margin-left: auto; }
.preview-label { color: var(--muted); font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; }
.content { max-width: 900px; margin: 0 auto; padding: 28px 32px 60px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 28px; padding: 16px 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0 10px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat .value { font-size: 23px; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: 12px; }
.group-title { margin: 24px 0 10px; font-size: 13px; }
.panel, .provider-card, .recipient { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 58px; padding: 14px 16px; }
.setting-row + .setting-row { border-top: 1px solid #e8e8ed; }
.setting-row label { margin: 0; flex-shrink: 0; }
.setting-row label span { display: block; font-weight: 400; margin-top: 2px; }
.control-group { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; max-width: 380px; }
.control-group select { flex: 1; }
.active-row { font-size: 12px; min-height: 46px; }
#active-server { text-align: right; overflow-wrap: anywhere; }
.section-note { font-size: 12px; margin: 10px 2px 0; line-height: 1.55; }
.help-details { margin-top: 24px; color: var(--muted); font-size: 12px; }
summary { cursor: pointer; }
.help-details p { margin-top: 10px; line-height: 1.6; max-width: 650px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.provider-grid { display: grid; gap: 16px; }
.ping-settings { margin-bottom: 16px; }
.ping-settings .setting-row { flex-wrap: wrap; }
.ping-settings input { min-width: 80px; }
.provider-card { padding: 18px 18px 0; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; color: #267544; font-size: 11px; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; background: currentColor; border-radius: 50%; flex: none; }
.badge.warning { color: #926219; }
.badge.error { color: #c42b31; }
.badge.inactive { color: var(--muted); }
.provider-host { color: var(--muted); font-size: 12px; margin: 3px 0 16px; overflow-wrap: anywhere; }
.provider-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.provider-card > .actions { margin-bottom: 16px; }
.provider-card details { border-top: 1px solid #e8e8ed; margin: 0 -18px; padding: 0 18px; }
.provider-card summary { padding: 12px 0; color: #55555b; font-size: 12px; }
.node { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #ededf0; }
.node span:first-child { min-width: 0; overflow-wrap: anywhere; }
.node small { display: block; color: var(--muted); margin-top: 2px; }
.node .switch { flex-shrink: 0; }
.error-message { color: #b2232b; background: #fff1f1; padding: 10px; border-radius: 6px; margin-bottom: 12px; overflow-wrap: anywhere; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.recipient { padding: 18px; margin-bottom: 16px; }
.recipient-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.recipient-heading p { margin-top: 3px; font-size: 12px; overflow-wrap: anywhere; }
.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.link-box { padding: 14px; background: #f5f5f7; border-radius: 7px; }
.link-box h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.link-box p { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.link-box a { display: inline-flex; align-items: center; min-height: 28px; font-size: 12px; }
.panel-note { padding: 0 16px 16px; font-size: 12px; line-height: 1.6; }
.mail-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 14px 16px; font-size: 12px; }
.mail-row + .mail-row { border-top: 1px solid #ededf0; }
.mail-row time { color: var(--muted); }
.mail-list > p { padding: 26px 16px; text-align: center; }
label { display: grid; gap: 5px; margin-bottom: 18px; }
input, select { width: 100%; min-width: 0; min-height: 30px; padding: 5px 9px; border: 1px solid #cfcfd5; border-radius: 6px; background: #fff; color: inherit; }
select { text-overflow: ellipsis; }
input[type="checkbox"] { width: 15px; height: 15px; min-height: 0; margin: 0; accent-color: var(--accent); flex: none; }
input.switch { appearance: none; width: 32px; height: 20px; padding: 2px; border: 0; border-radius: 20px; background: #c7c7cc; cursor: pointer; }
input.switch::before { content: ''; display: block; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px #0003; transition: transform .15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::before { transform: translateX(12px); }
.check { display: flex; align-items: center; gap: 8px; margin: 0; }
.optional { color: var(--muted); font-size: 11px; }
.full { width: 100%; }
dialog { width: calc(100% - 32px); max-width: 440px; max-height: calc(100dvh - 40px); padding: 24px; border: 1px solid #c9c9ce; border-radius: 12px; background: #f5f5f7; color: inherit; box-shadow: 0 24px 80px #0004; }
dialog::backdrop { background: #0003; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.dialog-heading h2 { font-size: 17px; }
.close { border: none; background: #e6e6ea; box-shadow: none; border-radius: 50%; padding: 0; width: 26px; min-height: 26px; font-size: 21px; line-height: 1; color: #717177; }
.note { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 16px; }
.field-note { margin: -10px 0 18px; font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.dialog-actions button { min-width: 92px; }
.login { max-width: 360px; margin: 16vh auto 0; padding: 28px; text-align: center; }
.login .brandmark { width: 60px; height: 60px; border-radius: 15px; margin: 0 auto 20px; }
.login .brandmark .icon { width: 38px; height: 38px; }
.login h1 { font-size: 24px; margin-bottom: 6px; }
.login form { text-align: left; margin-top: 28px; }
#toast { position: fixed; bottom: 24px; left: calc(50% + 118px); transform: translateX(-50%); max-width: min(520px, calc(100% - 32px)); padding: 12px 18px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 28px #0002; z-index: 10; }
[hidden] { display: none !important; }
@media (max-width: 1050px) {
  aside { width: 210px; padding-inline: 10px; }
  main { margin-left: 210px; }
  header { padding-inline: 24px; }
  .content { padding-inline: 24px; }
  header { flex-wrap: wrap; }
  .preview-label { order: 3; flex-basis: 100%; border: 0; padding: 0; }
  .server-setting { align-items: stretch; flex-direction: column; gap: 12px; }
  .control-group { max-width: none; }
  #toast { left: calc(50% + 105px); }
}
@media (max-width: 700px) {
  aside { position: static; width: auto; padding: 16px 12px 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0 4px; }
  .brandmark { width: 32px; height: 32px; border-radius: 8px; }
  .brand small { display: none; }
  nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 16px; }
  nav a { flex-direction: column; justify-content: center; gap: 5px; padding: 8px 2px; font-size: 10px; text-align: center; }
  .aside-bottom { position: absolute; right: 16px; top: 11px; padding: 0; }
  .aside-bottom > span { display: none; }
  main { margin: 0; min-height: auto; }
  header { padding: 18px 16px; min-height: 76px; flex-wrap: wrap; gap: 10px; }
  header h1 { font-size: 18px; }
  header button { font-size: 12px; padding-inline: 10px; }
  .content { padding: 20px 16px 40px; }
  button, input, select, .link-box a { min-height: 44px; }
  input, select { font-size: 16px; }
  .stats { padding: 14px 0; margin-bottom: 24px; }
  .stat .label { font-size: 11px; }
  .stat .value { font-size: 22px; }
  .setting-row { padding: 14px; gap: 12px; }
  .setting-row label { flex-shrink: 1; }
  .active-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  #active-server { text-align: left; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .card-heading { align-items: flex-start; flex-wrap: wrap; gap: 6px; }
  .provider-card { padding: 16px 16px 0; }
  .provider-card details { margin-inline: -16px; padding-inline: 16px; }
  .provider-card summary { padding-block: 15px; }
  .recipient { padding: 16px; }
  .link-grid { grid-template-columns: 1fr; }
  .recipient-heading { gap: 12px; }
  .recipient-heading .actions { gap: 6px; }
  .recipient-heading button { font-size: 12px; }
  .switch { touch-action: manipulation; }
  dialog { padding: 20px; }
  .close { width: 32px; min-height: 32px; }
  #toast { left: 16px; right: 16px; bottom: 16px; transform: none; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
