/* ============================================================
   邮件管理 · 内部工具
   浅色为主，深色跟随系统；无外部字体与图片依赖。
   ============================================================ */

:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
             "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
               "Liberation Mono", monospace;

  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --surface-3: #eef2f6;
  --rail: #243240;
  --rail-ink: #93a4b8;
  --rail-ink-strong: #e9eff6;
  --rail-active: rgba(255, 255, 255, .07);

  --ink: #16202b;
  --ink-2: #475569;
  --muted: #64748b;
  --line: #e2e7ee;
  --line-soft: #eef1f5;
  --line-strong: #cbd5e1;

  --accent: #3d5a7d;
  --accent-strong: #314a68;
  --accent-soft: #edf2f8;
  --accent-ink: #ffffff;

  --ok: #2f7d5a;
  --ok-soft: #e9f3ed;
  --warn: #a16207;
  --warn-dot: #d97706;
  --warn-soft: #fbf3e2;
  --danger: #b42318;
  --danger-soft: #fbeeec;
  --danger-line: #f3cec9;

  --focus: #5b82ad;
  --ring: rgba(61, 90, 125, .24);

  --log-bg: #fbfcfd;
  --log-ink: #334155;
  --shadow-card: 0 16px 40px -26px rgba(22, 32, 43, .45);
  --shadow-pop: 0 24px 60px -28px rgba(10, 16, 24, .55);
  --shadow-toast: 0 10px 28px -16px rgba(10, 16, 24, .4);

  color-scheme: light dark;
}

/* ---------- 基础 ---------- */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }

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

button { -webkit-tap-highlight-color: transparent; }

a { color: var(--accent); }

::selection { background: rgba(91, 130, 173, .22); }

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

.mono { font-family: var(--font-mono); }

.ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -3px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: top .15s ease;
}
.skip:focus { top: 12px; }

.noscript-note { padding: 24px; font: 14px/1.6 var(--font-ui); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn:active:not(:disabled) { background: var(--surface-3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .ico { width: 14px; height: 14px; }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
}
.btn--primary:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--accent-ink);
}
.btn--primary:active:not(:disabled) { background: #2a4059; }

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
}
.btn--ghost:hover:not(:disabled) { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

.btn--icon {
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn--icon:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }

.btn--sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn--block { width: 100%; height: 38px; font-size: 13.5px; }

.btn--danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  font-weight: 500;
}
.btn--danger:hover:not(:disabled) { background: #971c13; border-color: #971c13; color: #fff; }

.btn.is-busy {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.is-busy .ico { visibility: hidden; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 13px;
  height: 13px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn--primary.is-busy::after,
.btn--danger.is-busy::after {
  border-color: rgba(255, 255, 255, .38);
  border-top-color: #fff;
}

.btn.is-copied {
  color: var(--ok);
  border-color: #cfe5d8;
  background: var(--ok-soft);
}
.alias-copy.is-copied { opacity: 1; color: var(--ok); }

/* ---------- 表单 ---------- */

.input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input::placeholder { color: var(--muted); opacity: .75; }
.input:hover:not(:disabled) { border-color: #b6c2d1; }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
.input:disabled,
.input[readonly] {
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: default;
}
.input--mono { font-family: var(--font-mono); font-size: 12.5px; }
.input--lg { height: 38px; font-size: 14px; }

.select-wrap { position: relative; display: inline-flex; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select {
  appearance: none;
  -webkit-appearance: none;
  height: 30px;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  cursor: pointer;
}
.select:hover { border-color: #b6c2d1; }
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
.select--sm { height: 26px; font-size: 12px; padding-left: 7px; }

.field { margin-bottom: 15px; }
.field > label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--ink-2);
}
.field .req { color: var(--danger); font-size: 12px; }
.field .opt { margin-left: auto; font-size: 11px; color: var(--muted); }
.field.is-invalid .input,
.field.is-invalid .suffix-input { border-color: var(--danger); }
.field.is-invalid .suffix-input:focus-within { box-shadow: 0 0 0 3px rgba(180, 35, 24, .14); }

.hint {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}

.field__err {
  margin-top: 4px;
  font-size: 11px;
  color: var(--danger);
}

.suffix-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.suffix-input:hover { border-color: #b6c2d1; }
.suffix-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
.suffix-input .input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.suffix-input .input:focus { box-shadow: none; }
.suffix {
  display: flex;
  align-items: center;
  padding: 0 9px;
  border-left: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  user-select: none;
}

.form-err {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 14px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--danger-line);
  border-radius: 4px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}
.form-err .ico { margin-top: 1px; }

.form-msg {
  flex: 0 0 100%;
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--danger);
}

/* ---------- 启动态 ---------- */

.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.boot__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.boot__text { color: var(--muted); font-size: 12.5px; max-width: 380px; line-height: 1.6; }
.boot__text.is-error { color: var(--danger); }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner--lg { width: 22px; height: 22px; border-width: 2.5px; }

/* ---------- 登录 ---------- */

.login {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 20px;
  overflow: hidden;
}
.login::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(61, 90, 125, .055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(61, 90, 125, .055) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 68% 58% at 50% 44%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 68% 58% at 50% 44%, #000 0%, transparent 78%);
  pointer-events: none;
}

.login__card {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  padding: 26px 26px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  animation: rise .32s cubic-bezier(.22, 1, .36, 1) both;
}
.login__card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 3px;
  border-radius: 8px 8px 0 0;
  background: var(--accent);
}

.login__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.login__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
}
.login__mark .ico { width: 19px; height: 19px; }
.login__brandtext { display: flex; flex-direction: column; gap: 1px; }
.login__eyebrow {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  color: var(--muted);
}
.login__brandname { font-size: 13px; font-weight: 600; letter-spacing: .02em; }

.login__title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 5px;
}
.login__lede {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 20px;
}

.login__form { display: block; }
.login__labelrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.login__toggle {
  border: 0;
  background: none;
  padding: 0;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
}
.login__toggle:hover { color: var(--accent); }

.login__form .input { margin-bottom: 12px; }

.login__err {
  margin: -4px 0 10px;
  padding: 7px 9px;
  border: 1px solid var(--danger-line);
  border-radius: 4px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11.5px;
  line-height: 1.5;
}

.login__domain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .01em;
}
.login__domain .ico { width: 13px; height: 13px; }

.login__foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.login__foot .ico { width: 12px; height: 12px; opacity: .8; }

/* ---------- 主框架 ---------- */

.shell {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
  animation: fadein .22s ease both;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 0 9px;
  background: var(--rail);
  color: var(--rail-ink);
  z-index: 20;
}
.rail__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .07);
  color: #cfe0f2;
}
.rail__mark .ico { width: 18px; height: 18px; }

.rail__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 46px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--rail-ink);
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease;
}
.rail__item:hover { background: rgba(255, 255, 255, .05); color: var(--rail-ink-strong); }
.rail__item .ico { width: 19px; height: 19px; }
.rail__label { font-size: 10px; letter-spacing: .03em; line-height: 1; }
.rail__item.is-active {
  background: var(--rail-active);
  color: var(--rail-ink-strong);
}
.rail__item.is-active::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 1px;
  background: #8fb3d9;
}
.rail__spacer { flex: 1 1 auto; }
.rail__item--foot { color: #8395a9; }
.rail__item--foot:hover { color: #d8e4f0; }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 7px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: 0 0 auto;
}
.topbar__id { min-width: 0; }
.topbar__title:focus { outline: none; }
.topbar__title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  line-height: 1.35;
}
.topbar__sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__sub .mono { font-size: 10.5px; letter-spacing: .01em; }
.dotsep { color: var(--line-strong); }
.topbar__actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.topbar__actions .btn--ghost { padding: 0 8px; }
.topbar__actions .btn--primary { height: 31px; }

.health { display: flex; align-items: center; gap: 10px; margin-right: 6px; }
.hchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--muted);
}
.hchip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}
.hchip--ok .hchip__dot { background: var(--ok); }
.hchip--off { color: var(--danger); }
.hchip--off .hchip__dot { background: var(--danger); }

.scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 22px 22px;
  display: flex;
  flex-direction: column;
  scrollbar-gutter: stable;
}
.scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--bg);
  border-radius: 6px;
}
.scroll::-webkit-scrollbar-thumb:hover { background: #b3c0cf; }
.scroll::-webkit-scrollbar-track { background: transparent; }

.view { flex: 0 0 auto; min-width: 0; padding-top: 14px; }
.view .panel + .panel { margin-top: 14px; }

/* ---------- 统计条 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1px 6px;
  min-width: 0;
  padding: 9px 14px 10px;
  border-left: 1px solid var(--line-soft);
  animation: rise .26s cubic-bezier(.22, 1, .36, 1) both;
}
.stat:nth-child(1) { animation-delay: .02s; }
.stat:nth-child(2) { animation-delay: .06s; }
.stat:nth-child(3) { animation-delay: .1s; }
.stat:nth-child(4) { animation-delay: .14s; }
.stat:first-child { border-left: 0; }
.stat__k {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  letter-spacing: .05em;
  color: var(--muted);
}
.stat__v {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat__u { font-size: 10.5px; color: var(--muted); }
.stat__flag {
  margin-left: auto;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 10px;
  line-height: 1.55;
  white-space: nowrap;
}
.stat.is-alert .stat__v { color: var(--danger); }
.stat.is-alert .stat__k::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
}
.stat.is-alert .stat__k { color: var(--danger); }

/* ---------- 面板 / 工具栏 ---------- */

.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 10px;
}
.panel__title { font-size: 13.5px; font-weight: 600; }
.panel__desc { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.panel__head .count { margin-top: 2px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.search { position: relative; flex: 1 1 240px; max-width: 340px; min-width: 160px; }
.search .ico {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 30px;
  padding: 0 30px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input::placeholder { color: var(--muted); opacity: .8; }
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
.search kbd {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 15px;
  pointer-events: none;
}
.search:focus-within kbd { display: none; }

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
}
.seg button {
  height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.seg button:hover { color: var(--ink); }
.seg button.is-on {
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 1px rgba(22, 32, 43, .07);
}

.toolbar__meta { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pagesize {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.pagesize .select { height: 26px; }

.progress {
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 2px;
  z-index: 5;
  overflow: hidden;
  border-radius: 6px 6px 0 0;
  background: var(--accent-soft);
}
.progress::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34%;
  background: var(--accent);
  animation: slidebar 1.1s ease-in-out infinite;
}

/* ---------- 表格 ---------- */

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.col-email { width: 25%; }
.col-app { width: 15%; }
.col-appid { width: 12%; }
.col-num { width: 8%; }
.col-actions { width: 24%; }
.col-alias { width: 34%; }
.col-target { width: 48%; }
.col-alias-actions { width: 18%; }

.table-wrap { width: 100%; }
.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.table th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .05em;
  text-align: left;
  white-space: nowrap;
}
.table td {
  height: 34px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.table tbody tr { transition: background-color .1s ease; scroll-margin-top: 34px; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:focus-within { background: var(--accent-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody.is-entering tr {
  animation: rowin .2s ease both;
  animation-delay: calc(var(--i, 0) * 12ms);
}

.c-email {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ink);
}
.c-app { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.c-app.is-unbound { color: var(--warn); }
.c-app.is-partial { color: var(--muted); }
.c-appid {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .01em;
  color: var(--muted);
}
.c-quota {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.c-time {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.c-empty { color: var(--line-strong); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: 0 0 auto;
}
.status--ok .status__dot { background: var(--ok); }
.status--off { color: var(--muted); }
.status--off .status__dot { background: #9aa7b6; }
.status--warn {
  padding: 0 6px;
  border-radius: 3px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11.5px;
  line-height: 20px;
}
.status--warn .status__dot { background: var(--warn-dot); }

.row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: -6px;
}
.row-btn {
  height: 24px;
  padding: 0 6px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .1s ease, color .1s ease;
}
.row-btn:hover { background: var(--accent-soft); color: var(--accent); }
.row-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }

.empty-row td {
  height: auto;
  padding: 46px 16px 50px;
  border-bottom: 0;
  white-space: normal;
  text-align: center;
}
.empty { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.empty__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}
.empty__icon .ico { width: 17px; height: 17px; }
.empty__title { font-size: 12.5px; color: var(--ink-2); }
.empty__text { font-size: 11.5px; color: var(--muted); }
.empty__action { margin-top: 10px; }

.sk {
  display: block;
  height: 9px;
  border-radius: 2px;
  background: var(--line);
  animation: pulse 1.3s ease-in-out infinite;
}
.sk--w60 { width: 60%; }
.sk--w40 { width: 40%; }
.sk--w80 { width: 80%; }

/* ---------- 分页 ---------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
}
.pager__info {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pager__btns { display: flex; align-items: center; gap: 5px; }
.pager__page {
  min-width: 58px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* ---------- 别名 ---------- */

.alias-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 13px;
  border-bottom: 1px solid var(--line);
}
.afield { flex: 1 1 220px; min-width: 180px; }
.afield label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  color: var(--muted);
}
.afield .input { font-family: var(--font-mono); font-size: 12px; height: 31px; }
.afield .input.is-invalid { border-color: var(--danger); }
.afield .input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .13); }
.alias-arrow {
  align-self: center;
  margin: 16px 0 0;
  color: var(--line-strong);
}
.alias-submit { margin-bottom: 0; }

.table--aliases td { height: 38px; }
.table--aliases .c-alias { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.alias-target {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.alias-target code {
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
}
.alias-copy {
  border: 0;
  background: none;
  padding: 2px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 3px;
  opacity: 0;
  transition: opacity .12s ease, color .12s ease;
}
.alias-copy .ico { width: 13px; height: 13px; }
tr:hover .alias-copy, .alias-copy:focus-visible { opacity: 1; }
.alias-copy:hover { color: var(--accent); }

/* ---------- 日志 ---------- */

#view-logs { flex: 1 1 auto; display: flex; min-height: 320px; }

.panel--logs {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.logs-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.inline-field .select { height: 27px; font-size: 12px; }
.logs-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.log {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 12px 14px 18px;
  overflow: auto;
  background: var(--log-bg);
  color: var(--log-ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.62;
  white-space: pre;
  tab-size: 4;
  scrollbar-width: thin;
}
.log:focus-visible { outline-offset: -2px; }
.log__idle { color: var(--muted); }
.log--err { color: var(--danger); white-space: pre-wrap; }
.log--empty { color: var(--muted); }
.log::-webkit-scrollbar { width: 10px; height: 10px; }
.log::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--log-bg);
  border-radius: 6px;
}

/* ---------- 抽屉 ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 32, .4);
  animation: fadein .18s ease both;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(430px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px -40px rgba(10, 16, 24, .6);
  animation: drawerin .24s cubic-bezier(.22, 1, .36, 1) both;
}
.drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--line);
}
.drawer__eyebrow {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .06em;
  color: var(--muted);
}
.drawer__title { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 24px;
}
.drawer__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

/* ---------- 创建结果 ---------- */

.result { animation: rise .24s ease both; }
.result__banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid #cfe5d8;
  border-left: 3px solid var(--ok);
  border-radius: 4px;
  background: var(--ok-soft);
}
.result__icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  flex: 0 0 auto;
}
.result__icon .ico { width: 12px; height: 12px; }
.result__title { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.result__text { margin-top: 2px; font-size: 11.5px; line-height: 1.55; color: var(--ink-2); }

.cred {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  margin-bottom: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
}
.cred__k {
  grid-column: 1 / -1;
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--muted);
}
.cred__v {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  word-break: break-all;
  align-self: center;
  user-select: all;
}
.cred--big { padding: 10px 11px 11px; background: var(--surface); }
.cred--big .cred__v { font-size: 14.5px; font-weight: 500; letter-spacing: -.01em; }
.cred--pass .cred__v { font-size: 15px; letter-spacing: .02em; }
.cred .btn { background: var(--surface); }

.result__actions { display: flex; gap: 6px; margin: 10px 0 14px; }
.result__hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.result__hint .ico { margin-top: 1px; width: 13px; height: 13px; }

/* ---------- 提示块 ---------- */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
}
.notice .ico { margin-top: 2px; }
.notice--warn {
  border-color: #efdcb8;
  background: var(--warn-soft);
  color: #7c5008;
}
.notice--danger {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: #8f1d14;
}

/* ---------- 弹窗 ---------- */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 32, .44);
  animation: fadein .16s ease both;
}
.modal {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  animation: pop .18s cubic-bezier(.22, 1, .36, 1) both;
}
.modal__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 15px 14px 9px 16px;
}
.modal__head > div { flex: 1 1 auto; min-width: 0; }
.modal__title { font-size: 14.5px; font-weight: 600; }
.modal__sub {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}
.modal__body {
  padding: 4px 16px 16px;
  overflow-y: auto;
  font-size: 12px;
  color: var(--ink-2);
}
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 8px 8px;
}
.modal__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }

.confirm-line { margin: 14px 0 5px; font-size: 11.5px; color: var(--muted); }
.confirm-email {
  display: block;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  word-break: break-all;
  user-select: all;
}
.confirm-target { margin-bottom: 12px; }
.confirm-ok { margin-top: 10px; }
.modal .field { margin: 12px 0 0; }
.modal .field > label { font-size: 11px; color: var(--muted); }

/* ---------- Toast ---------- */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
  transition: right .2s ease, width .2s ease;
}
/* 抽屉打开时把提示移到抽屉左侧，避免盖住底部按钮 */
body.has-drawer .toasts {
  right: calc(min(430px, 100vw) + 16px);
  width: min(330px, calc(100vw - 462px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow-toast);
  color: var(--ink);
  font-size: 12px;
  pointer-events: auto;
  animation: toastin .22s cubic-bezier(.22, 1, .36, 1) both;
}
.toast.is-out { animation: toastout .16s ease both; }
.toast--ok { border-left-color: var(--ok); }
.toast--err { border-left-color: var(--danger); }
.toast--info { border-left-color: var(--accent); }
.toast__icon { margin-top: 1px; color: var(--muted); }
.toast__icon .ico { width: 14px; height: 14px; }
.toast--ok .toast__icon { color: var(--ok); }
.toast--err .toast__icon { color: var(--danger); }
.toast--info .toast__icon { color: var(--accent); }
.toast__msg { flex: 1 1 auto; line-height: 1.5; word-break: break-word; }
.toast__x {
  flex: 0 0 auto;
  padding: 0;
  margin-top: 1px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
}
.toast__x .ico { width: 12px; height: 12px; }
.toast__x:hover { color: var(--ink); }

/* ---------- 动画 ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes rowin { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes drawerin { from { opacity: .4; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(4px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes slidebar {
  0% { left: -34%; }
  100% { left: 100%; }
}

/* ---------- 深色 ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --surface: #161c23;
    --surface-2: #1b232b;
    --surface-3: #222c36;
    --rail: #0b1015;
    --rail-ink: #8b9aac;
    --rail-ink-strong: #e6edf5;
    --rail-active: rgba(255, 255, 255, .06);

    --ink: #e4eaf1;
    --ink-2: #b3c0ce;
    --muted: #8b98a8;
    --line: #263039;
    --line-soft: #202932;
    --line-strong: #38444f;

    --accent: #6f92b8;
    --accent-strong: #83a5c9;
    --accent-soft: #1c2733;
    --accent-ink: #0e1620;

    --ok: #5fb08a;
    --ok-soft: #16281f;
    --warn: #d3a24c;
    --warn-dot: #e0a63e;
    --warn-soft: #2a2114;
    --danger: #e08077;
    --danger-soft: #2a1c1b;
    --danger-line: #4a2b28;

    --focus: #87a9cd;
    --ring: rgba(135, 169, 205, .28);

    --log-bg: #0d1318;
    --log-ink: #c5d0dc;
    --shadow-card: 0 18px 44px -26px rgba(0, 0, 0, .8);
    --shadow-pop: 0 26px 64px -28px rgba(0, 0, 0, .85);
    --shadow-toast: 0 12px 30px -16px rgba(0, 0, 0, .8);
  }

  .login::before {
    background-image:
      linear-gradient(to right, rgba(160, 190, 220, .05) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(160, 190, 220, .05) 1px, transparent 1px);
  }
  .login__card::before { background: var(--accent); }
  .result__banner { border-color: #23402f; }
  .notice--warn { border-color: #4b3a1c; color: #e4ba6b; }
  .notice--danger { border-color: #4a2b28; color: #f0a39b; }
  .btn--primary:hover:not(:disabled) { color: #0e1620; }
  .status--off .status__dot { background: #5d6b7a; }
  .scroll::-webkit-scrollbar-thumb { border-color: var(--bg); }
  .scroll::-webkit-scrollbar-thumb:hover { background: #4c5a68; }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1100px) {
  .health { display: none; }
  .topbar { padding: 7px 16px; }
  .scroll { padding: 0 16px 20px; }
  .topbar__sub .mono { max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 1024px) {
  /* 表格转卡片列表 */
  .table, .table tbody { display: block; width: 100%; }
  .table colgroup, .table thead { display: none; }
  .table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px 16px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
  }
  .table tbody tr:hover { background: transparent; }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td {
    display: block;
    height: auto;
    padding: 0;
    border: 0;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }
  .table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 1px;
    font-size: 9.5px;
    letter-spacing: .05em;
    color: var(--muted);
  }
  .table td.cell-email { grid-column: 1 / -1; padding-bottom: 4px; }
  .table td.cell-email::before { display: none; }
  .cell-email .c-email {
    font-size: 13px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
  }
  .table td.cell-appid .c-appid,
  .table td.cell-time .c-time,
  .table td.cell-quota .c-quota { font-size: 11.5px; }
  .table td.cell-actions {
    grid-column: 1 / -1;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--line-soft);
  }
  .table td.cell-actions::before { display: none; }
  .row-actions { margin-left: 0; flex-wrap: wrap; gap: 5px; }
  .row-btn {
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 11.5px;
  }
  .table tr.empty-row { display: block; }
  .empty-row td { padding: 40px 14px; }
  .pager { padding: 8px 14px; }

  .toolbar { padding: 8px 14px; }
  .search { max-width: none; flex-basis: 100%; }
  .toolbar__meta { margin-left: auto; }
  .table--aliases td.cell-alias,
  .table--aliases td.cell-target { grid-column: 1 / -1; }
  .table--aliases td.cell-target { padding-bottom: 4px; }
  .alias-copy { opacity: 1; }
}

@media (max-width: 720px) {
  .topbar { min-height: 50px; padding: 6px 12px; gap: 8px; }
  .topbar { padding-top: calc(6px + env(safe-area-inset-top)); }
  .topbar__title { font-size: 14px; }
  .topbar__sub { font-size: 10.5px; }
  .search kbd { display: none; }
  .seg button { height: 28px; }
  .topbar__actions .btn__text { display: none; }
  .topbar__actions .btn--ghost { width: 28px; padding: 0; border-color: transparent; }
  .topbar__actions .btn--primary { padding: 0 9px; font-size: 12px; }

  .scroll { padding: 0 12px 18px; }
  .view { padding-top: 10px; }

  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 8px 12px 9px; }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .stat__v { font-size: 19px; }

  .toolbar { gap: 8px; }
  .toolbar__meta { width: 100%; margin-left: 0; justify-content: space-between; }
  .seg { width: 100%; }
  .seg button { flex: 1 1 auto; }
  .search { flex-basis: 100%; }

  .table tr { padding: 9px 12px; }
  .pager__info { font-size: 10px; }

  .panel__head { padding: 12px 14px 9px; }
  .alias-form { padding: 0 14px 12px; }
  .afield { flex-basis: 100%; }
  .alias-arrow { display: none; }
  .alias-submit { width: 100%; }

  .logs-bar { gap: 10px; padding: 8px 12px; }
  .logs-meta { width: 100%; margin-left: 0; order: 3; }
  .log { font-size: 11px; padding: 10px 12px 16px; }
  #view-logs { min-height: 0; }
  .panel--logs { min-height: calc(100dvh - 240px); }

  .drawer { width: 100vw; border-left: 0; }
  .drawer__body { padding: 14px 15px 22px; }
  .drawer__head { padding: calc(13px + env(safe-area-inset-top)) 15px 11px; }
  .drawer__foot { padding: 10px 15px calc(10px + env(safe-area-inset-bottom)); }

  .modal-layer { padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); align-items: end; }
  .modal { width: 100%; max-height: calc(100dvh - 24px); border-radius: 8px; }
  .modal__foot { border-radius: 0 0 8px 8px; padding-bottom: calc(11px + env(safe-area-inset-bottom)); }

  .toasts { right: 10px; bottom: calc(72px + env(safe-area-inset-bottom)); width: calc(100vw - 20px); }
  body.has-drawer .toasts { right: 10px; width: calc(100vw - 20px); }
}

@media (max-width: 640px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .main { grid-row: 1; grid-column: 1; height: auto; min-height: 0; }
  .rail {
    grid-row: 2;
    grid-column: 1;
    flex-direction: row;
    justify-content: space-between;
    gap: 0;
    height: auto;
    min-height: 56px;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, .06);
  }
  .rail__mark, .rail__spacer { display: none; }
  .rail__item { flex: 1 1 0; width: auto; height: 48px; }
  .rail__item.is-active::before {
    left: 22%;
    right: 22%;
    top: auto;
    bottom: -1px;
    width: auto;
    height: 2px;
  }
  .rail__label { font-size: 10px; }
  .toasts { bottom: calc(66px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .spinner, .spinner--lg, .btn.is-busy::after {
    animation: none !important;
    border-top-color: currentColor;
    opacity: .8;
  }
}
