@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/space-grotesk-400.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/space-grotesk-500.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/space-grotesk-700.woff2") format("woff2");
}

:root {
  --background: #080b12;
  --foreground: #f0f2f7;
  --border: #1e2535;
  --input: #111827;
  --primary: #4af0c4;
  --primary-foreground: #080b12;
  --secondary: #0f1a2e;
  --secondary-foreground: #4af0c4;
  --muted: #1e2535;
  --muted-foreground: #6b7a99;
  --accent: #1c3252;
  --accent-foreground: #a8d4ff;
  --surface: #0d1320;
  --surface-foreground: #c8d0e0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --font: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-xl: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; max-width: 100%; overflow-x: hidden; background: var(--background); color: var(--foreground); font-family: var(--font); font-size: var(--text-sm); }
#app { height: 100%; max-width: 100%; overflow-x: hidden; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button, input, select { font: inherit; }

.mn-app { height: 100%; display: flex; flex-direction: column; background: var(--background); }
.mn-top {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; padding: 10px 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.mn-brand { display: flex; align-items: center; gap: 10px; }
.mn-mark {
  width: 20px; height: 20px; border-radius: var(--radius-sm);
  background: var(--primary); color: var(--primary-foreground);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 10px;
}
.mn-title { font-weight: 700; font-size: var(--text-sm); letter-spacing: -0.02em; }
.mn-ver { color: var(--muted-foreground); font-size: var(--text-xs); margin-left: 4px; }
.mn-admin {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: var(--radius-sm);
  background: var(--accent); border: 1px solid var(--border);
  color: var(--muted-foreground); font-size: var(--text-xs);
}
.mn-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--primary); flex-shrink: 0; }
.mn-dot-sm { width: 6px; height: 6px; }

.mn-shell { display: flex; flex: 1; min-height: 0; min-width: 0; }
.mn-nav {
  width: 168px; min-width: 168px; padding: 16px 8px;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.mn-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-md);
  color: var(--muted-foreground); font-size: var(--text-xs); font-weight: 500;
}
.mn-nav a.on, .mn-nav a:hover { background: var(--accent); color: var(--primary); }
.mn-nav svg { flex-shrink: 0; }

.mn-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mn-content { flex: 1; overflow: auto; padding: 28px; min-width: 0; }
.mn-page { display: flex; flex-direction: column; gap: 28px; }
.mn-page.w-640 { max-width: 640px; }
.mn-page.w-700 { max-width: 700px; }
.mn-page.w-740 { max-width: 740px; }
.mn-page.w-860 { max-width: 860px; }
.mn-page.w-900 { max-width: 900px; }
.mn-page.w-940 { max-width: 940px; }
.mn-page.w-960 { max-width: 960px; }
.mn-page.w-3xl { max-width: 48rem; }

.mn-foot {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 8px 28px; display: flex; align-items: center; gap: 24px;
  color: var(--muted-foreground); font-size: var(--text-xs);
}

h1 {
  font-size: var(--text-xl); font-weight: 700; margin: 0 0 4px;
}
h1.mono { font-family: var(--mono); }
.lede { margin: 0; color: var(--muted-foreground); font-size: var(--text-xs); line-height: 1.5; }
.section-label {
  margin: 0 0 12px; color: var(--muted-foreground);
  font-size: var(--text-xs); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
}

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
}
.strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
}
.strip .ml { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: var(--text-xs); }
.notice {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--muted-foreground); font-size: var(--text-xs);
}
.notice.warn { color: var(--accent-foreground); }

.kv { display: flex; align-items: baseline; gap: 12px; }
.kv span:first-child { width: 7rem; flex-shrink: 0; color: var(--muted-foreground); font-size: var(--text-xs); }
.kv span:last-child { color: var(--surface-foreground); font-size: var(--text-xs); }
.kv.mono span:last-child { font-family: var(--mono); }

.crumb { display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--muted-foreground); }
.crumb .here { color: var(--surface-foreground); }
.crumb .here.mono { font-family: var(--mono); }

.head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.fields { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { color: var(--muted-foreground); font-size: var(--text-xs); }
.sep { color: var(--muted-foreground); font-family: var(--mono); font-size: var(--text-xs); padding-bottom: 6px; }

.mailbox-add { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mailbox-add-addr, .mailbox-add-secret {
  display: flex; align-items: flex-end; gap: 10px; min-width: 0; flex-wrap: wrap;
}
.mailbox-add-local { flex: 0 1 12rem; min-width: 8rem; }
.mailbox-add-domain { flex: 1 1 16rem; min-width: 12rem; }
.mailbox-add-pass { flex: 1 1 14rem; min-width: 10rem; }
.mailbox-add-local input,
.mailbox-add-domain select,
.mailbox-add-pass input { width: 100%; min-width: 0; }
.mailbox-add-domain select { overflow: hidden; text-overflow: ellipsis; }
.mailbox-add-secret button { flex-shrink: 0; }
.vbar { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }

input, select {
  background: var(--input); color: var(--surface-foreground);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 12px; font-size: var(--text-xs); font-family: var(--mono);
  min-height: 28px;
}
input::placeholder { color: var(--muted-foreground); }
input:disabled, select:disabled { opacity: 0.4; }
input.w-36, select.w-36 { width: 9rem; }
input.w-40 { width: 10rem; }
input.w-44, select.w-44 { width: 11rem; }
input.w-52 { width: 13rem; }
input.w-72 { width: 18rem; }

button, .btn {
  background: var(--surface); color: var(--foreground);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 16px; font-size: var(--text-xs); font-weight: 500; cursor: pointer;
}
button.sm { padding: 4px 12px; }
button.danger { color: var(--accent-foreground); }
button:disabled, .btn:disabled { opacity: 0.3; cursor: not-allowed; }
button.busy { position: relative; padding-left: 28px; opacity: 1; cursor: wait; }
button.busy::before {
  content: "";
  position: absolute; left: 8px; top: 50%;
  width: 10px; height: 10px; margin-top: -5px;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%;
  animation: mn-spin 0.7s linear infinite;
}
button.link.busy { padding-left: 18px; }
button.link.busy::before { left: 0; width: 8px; height: 8px; margin-top: -4px; }
@keyframes mn-spin { to { transform: rotate(360deg); } }
.copy-cell { display: inline-flex; align-items: flex-start; gap: 6px; max-width: 100%; }
.copy-cell .copy-v { min-width: 0; }
.copy-cell.wrap .copy-v { white-space: pre-wrap; word-break: break-word; }
button.copy {
  background: none; border: 0; padding: 2px; line-height: 0;
  color: var(--muted-foreground); cursor: pointer; flex-shrink: 0;
}
button.copy:hover { color: var(--foreground); }

.toasts {
  position: fixed; right: 20px; bottom: 28px; z-index: 40;
  display: flex; flex-direction: column; gap: 8px; max-width: 360px;
}
.toast {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--foreground); font-size: var(--text-xs); line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.toast.ok { border-color: #1e5c4c; color: var(--primary); }
.toast.err { border-color: #5c2a2a; color: #ffb4b4; }

.link { color: var(--accent-foreground); font-size: var(--text-xs); background: none; border: 0; padding: 0; font-weight: 400; }
.link:disabled { opacity: 0.3; }

.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: auto; }
table.data {
  width: 100%; border-collapse: collapse; border-spacing: 0;
  font-size: var(--text-xs); margin: 0;
}
table.data th, table.data td {
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border);
  vertical-align: top; white-space: nowrap;
}
table.data th {
  background: var(--surface); color: var(--muted-foreground); font-weight: 500;
}
table.data td { color: var(--surface-foreground); }
table.data tbody tr:nth-child(odd) { background: var(--background); }
table.data tbody tr:nth-child(even) { background: var(--surface); }
table.data .mono { font-family: var(--mono); }
table.data .muted { color: var(--muted-foreground); }
table.data .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data td.wrap, table.data .wrap { white-space: pre-wrap; word-break: break-word; }
table.data td.break { white-space: normal; word-break: break-all; }
.hint { margin: 8px 0 0; color: var(--muted-foreground); font-size: var(--text-xs); }
.hint .mono { color: var(--surface-foreground); }

.ok { color: var(--primary); }
.warn { color: var(--accent-foreground); }
.muted { color: var(--muted-foreground); }
.mono { font-family: var(--mono); }
.empty {
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--muted-foreground); font-size: var(--text-xs);
}

.dkim {
  background: var(--input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-family: var(--mono); font-size: var(--text-xs);
  color: var(--surface-foreground); line-height: 1.5;
  word-break: break-all; white-space: pre-wrap;
}

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-tool {
  padding: 4px 10px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--surface-foreground); font-family: var(--mono); font-size: var(--text-xs);
}
.group-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.group-h .count { opacity: 0.5; }
.groups { display: flex; flex-direction: column; gap: 20px; }

.danger-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.danger-row + .rule { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

.icon { display: inline-block; vertical-align: middle; }

.mn-auth { max-width: 28rem; margin: 4rem auto; padding: 0 28px; display: flex; flex-direction: column; gap: 12px; }

.chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted-foreground); font-size: var(--text-xs); white-space: nowrap;
}
.chip.on, .chip.done { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.chip.waiting-you, .chip.in-progress { background: var(--accent); color: var(--accent-foreground); }
.chip.waiting-server, .chip.not-started { background: var(--surface); }
.chip.not-version { opacity: 0.6; }
.stepper { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.strip-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.harden { display: flex; align-items: flex-start; gap: 24px; }
.catalog {
  min-width: 270px; max-width: 270px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; background: var(--surface);
}
.catalog-h {
  padding: 6px 12px; border-bottom: 1px solid var(--border);
  color: var(--muted-foreground); font-size: var(--text-xs);
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em;
}
.catalog-row {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 10px 12px; border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; background: var(--background); text-align: left;
}
.catalog-row.on { background: var(--secondary); }
.row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.harden-detail { flex: 1; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.harden-detail h2 { margin: 0; font-size: 18px; }
.graph { margin: 0; padding-left: 18px; color: var(--surface-foreground); font-size: var(--text-xs); line-height: 1.7; }
.graph .now { color: var(--primary); font-weight: 500; }
.dim { opacity: 0.7; }
table.data tbody tr.open { background: var(--secondary); }
