:root {
  --paper: #f5f2ec;
  --card: #fffdf9;
  --ink: #1c1b18;
  --muted: #6d685e;
  --line: #e2ddd2;
  --accent: #ff5a1f;
  --accent-ink: #ffffff;
  --accent-soft: #ffe7dc;
  --ok: #0f8a5f;
  --ok-soft: #dcf3ea;
  --bad: #c2322b;
  --bad-soft: #fbe3e1;
  --warn: #a8670a;
  --code: #efeae0;
  --radius: 12px;
  --shadow: 0 1px 0 rgba(28, 27, 24, .04), 0 8px 24px -12px rgba(28, 27, 24, .18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141311; --card: #1c1b18; --ink: #f2eee6; --muted: #a39d91; --line: #2f2d28;
    --accent-soft: #3a1f13; --ok-soft: #10291f; --bad-soft: #351816; --code: #26241f;
    --shadow: 0 8px 24px -12px rgba(0, 0, 0, .6);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 2rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.05rem; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--code); padding: .12em .4em; border-radius: 6px; word-break: break-all; }
pre { background: var(--code); padding: 14px 16px; border-radius: 10px; overflow-x: auto; font: 13px/1.6 var(--mono); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

/* nav */
.nav { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 88%, transparent); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); }
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.15rem; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand .mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; font-size: 15px; transform: rotate(-8deg); }
.nav .links { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav .links a, .linkbtn { text-decoration: none; padding: 7px 11px; border-radius: 8px; color: var(--muted); font-weight: 500; background: none; border: 0; font: inherit; cursor: pointer; }
.nav .links a:hover, .linkbtn:hover, .nav .links a.on { color: var(--ink); background: var(--code); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink);
  font: 600 14px/1 var(--font); padding: 11px 16px; border-radius: 10px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--code); }
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.sm { padding: 7px 10px; font-size: 13px; border-radius: 8px; }
.btn.big { padding: 14px 22px; font-size: 16px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
label { display: block; font-weight: 600; font-size: .88rem; margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .grow { flex: 1 1 200px; min-width: 0; }
.check { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }
.hp { position: absolute; left: -9999px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.card.flat { box-shadow: none; }
.page { padding: 32px 0 60px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { margin: 0; }

/* flashes & badges */
.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 12px; background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.badge { display: inline-flex; align-items: center; gap: 5px; font: 600 12px/1 var(--font); padding: 5px 8px; border-radius: 999px; background: var(--code); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--accent-soft); color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.alias { font-family: var(--mono); font-size: .9rem; }
.alias .at { color: var(--muted); }
.arrow { color: var(--accent); font-weight: 700; padding: 0 4px; }
.dest { display: inline-block; font-family: var(--mono); font-size: .82rem; background: var(--code); padding: 3px 7px; border-radius: 6px; margin: 2px 4px 2px 0; word-break: break-all; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
details.edit summary { list-style: none; cursor: pointer; }
details.edit summary::-webkit-details-marker { display: none; }
.disabled-row { opacity: .5; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--accent); }

/* dns records */
.rec { display: grid; grid-template-columns: 70px 140px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rec:last-child { border-bottom: 0; }
.rec .val { font-family: var(--mono); font-size: .82rem; background: var(--code); padding: 8px 10px; border-radius: 8px; word-break: break-all; position: relative; }
.copy { cursor: pointer; border: 0; background: none; color: var(--muted); font: 600 12px var(--font); padding: 4px 6px; }
.copy:hover { color: var(--accent); }
@media (max-width: 720px) { .rec { grid-template-columns: 1fr; gap: 6px; } }

/* domain grid */
.domains { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dcard { display: block; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: transform .12s, border-color .12s; }
.dcard:hover { transform: translateY(-2px); border-color: var(--accent); }
.dcard .name { font-family: var(--display); font-weight: 700; font-size: 1.1rem; word-break: break-all; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* landing */
.hero { padding: 72px 0 40px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.flow { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); font-family: var(--mono); font-size: .85rem; }
.flow .step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--code); margin: 8px 0; }
.flow .step b { color: var(--accent); }
.flow .down { text-align: center; color: var(--accent); font-weight: 700; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 30px 0 50px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; margin-bottom: 10px; }
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 60px; }
.price { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.price.hot { border: 2px solid var(--accent); }
.price ul { padding-left: 18px; color: var(--muted); }
.foot { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .86rem; }
@media (max-width: 820px) { .hero, .features, .pricing { grid-template-columns: 1fr; } .hero { padding-top: 40px; } }

.auth { max-width: 420px; margin: 50px auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .n { font-family: var(--display); font-size: 1.8rem; font-weight: 700; }
.status-sent { color: var(--ok); } .status-bounced, .status-rejected { color: var(--bad); } .status-deferred, .status-queued { color: var(--warn); }
.secret { font-family: var(--mono); background: var(--accent-soft); border: 1px dashed var(--accent); padding: 12px; border-radius: 10px; word-break: break-all; }
.nav .links a.btn { background: var(--accent); color: var(--accent-ink); padding: 8px 12px; }
.nav .links a.btn:hover { background: var(--accent); filter: brightness(1.05); }
.dest, code { word-break: normal; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .nav .wrap { height: auto; padding-top: 10px; padding-bottom: 8px; flex-wrap: wrap; gap: 6px; }
  .nav .links { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .nav .links a, .linkbtn { padding: 6px 9px; white-space: nowrap; }
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table.stack tr:last-child { border-bottom: 0; }
  .table.stack td { border: 0; padding: 4px 0; }
  .table.stack .actions { justify-content: flex-start; }
  .table-scroll { margin: 0; padding: 0; }
}
