:root {
  --bg: #f6f5f8;
  --paper: #ffffff;
  --ink: #1f1a2b;
  --muted: #6e6880;
  --line-c: #e4e0ea;
  --accent: #e2336b;
  --accent-dark: #c4245a;
  --accent-soft: #fdebf1;
  --ok: #1f9d6f;
  --ok-soft: #e3f6ee;
  --bad: #c43c32;
  --bad-soft: #fdecea;
  --warn-soft: #fff6dc;
  --line: 1px solid var(--line-c);
  --shadow: 0 1px 2px rgba(31, 26, 43, .05), 0 4px 16px rgba(31, 26, 43, .05);
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 Rubik, system-ui, sans-serif;
  color: var(--ink); background: var(--bg);
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
}
a { color: var(--accent-dark); }
h1, h2, h3 { font-weight: 600; line-height: 1.25; }
h1 { font-size: clamp(22px, 3.5vw, 28px); margin: 0 0 6px; word-break: break-word; }
h2 { font-size: 17px; margin: 0 0 14px; }
h3 { font-size: 12px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; }
code { font: 13px/1.4 ui-monospace, Consolas, monospace; background: #f1eff5; padding: 2px 6px; border-radius: 5px; word-break: break-all; }
/* ---------- soft floating bubbles ---------- */
.bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bubbles i {
  position: absolute; bottom: -80px; border-radius: 50%;
  border: 1.5px solid rgba(226, 51, 107, .18);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .9), rgba(226, 51, 107, .04) 65%);
  animation: rise linear infinite;
}
.bubbles i:nth-child(1)  { left: 4%;  width: 30px; height: 30px; animation-duration: 24s; }
.bubbles i:nth-child(2)  { left: 14%; width: 16px; height: 16px; animation-duration: 18s; animation-delay: -6s; }
.bubbles i:nth-child(3)  { left: 26%; width: 44px; height: 44px; animation-duration: 30s; animation-delay: -12s; border-color: rgba(110, 104, 128, .18); }
.bubbles i:nth-child(4)  { left: 39%; width: 20px; height: 20px; animation-duration: 21s; animation-delay: -3s; }
.bubbles i:nth-child(5)  { left: 52%; width: 34px; height: 34px; animation-duration: 27s; animation-delay: -17s; }
.bubbles i:nth-child(6)  { left: 63%; width: 12px; height: 12px; animation-duration: 16s; animation-delay: -8s; }
.bubbles i:nth-child(7)  { left: 72%; width: 50px; height: 50px; animation-duration: 34s; animation-delay: -4s; border-color: rgba(110, 104, 128, .18); }
.bubbles i:nth-child(8)  { left: 81%; width: 22px; height: 22px; animation-duration: 22s; animation-delay: -14s; }
.bubbles i:nth-child(9)  { left: 90%; width: 36px; height: 36px; animation-duration: 29s; animation-delay: -9s; }
.bubbles i:nth-child(10) { left: 96%; width: 14px; height: 14px; animation-duration: 19s; animation-delay: -1s; }
.bubbles i:nth-child(11) { left: 33%; width: 10px; height: 10px; animation-duration: 15s; animation-delay: -10s; }
.bubbles i:nth-child(12) { left: 58%; width: 14px; height: 14px; animation-duration: 18s; animation-delay: -5s; }
@keyframes rise {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translate(14px, -55vh); }
  92%  { opacity: 1; transform: translate(-10px, -100vh); }
  100% { transform: translate(-10px, -106vh) scale(1.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .bubbles { display: none; } }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px clamp(16px, 4vw, 40px); background: var(--paper); border-bottom: var(--line);
}
.logo { display: inline-flex; align-items: baseline; gap: 1px; text-decoration: none; color: var(--ink); font: 800 21px/1 Unbounded, Rubik, sans-serif; letter-spacing: -.01em; }
.logo .pop { color: var(--ink); }
.logo .bang { color: var(--accent); }
.logo.big { font-size: 34px; }
nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.nav {
  font: 500 14px Rubik, sans-serif; color: var(--muted); text-decoration: none; cursor: pointer;
  padding: 7px 12px; border-radius: 8px; border: 0; background: none;
}
.nav:hover { color: var(--ink); background: #f1eff5; }
.nav.on { color: var(--ink); background: #f1eff5; }

/* ---------- layout ---------- */
main { position: relative; z-index: 1; flex: 1; width: 100%; }
footer { position: relative; z-index: 1; }
main.wrap { max-width: 1100px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 40px; }
main.solo { display: grid; place-items: center; padding: 24px 16px; }
footer {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px clamp(16px, 4vw, 40px); border-top: var(--line); color: var(--muted); font-size: 13px;
}
.foot-joke { font-style: italic; }
.foot-brand { font: 700 11px Unbounded, sans-serif; letter-spacing: .1em; }

.card { background: var(--paper); border: var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: clamp(16px, 3vw, 22px); margin: 0 0 18px; }
.card.narrow { max-width: 440px; }
.danger-zone { border-color: #f1c9c5; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 18px; }
.head h1 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.inline { display: inline; margin: 0; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 500; color: #4a4458; margin-bottom: 12px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px;
  font: 15px Rubik, sans-serif; color: var(--ink); background: #fff;
  border: 1px solid #d6d1de; border-radius: 8px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226, 51, 107, .15); }
input:disabled { background: #f6f5f8; color: var(--muted); }
label.check { display: inline-flex; align-items: center; gap: 8px; margin: 0 12px 0 0; font-weight: 400; }
label.check input { width: auto; margin: 0; accent-color: var(--accent); }
.addon { display: flex; margin-top: 5px; }
.addon input { flex: 1 1 90px; margin: 0; border-radius: 8px 0 0 8px; min-width: 90px; }
.addon span { flex: 0 0 auto; padding: 9px 11px; border: 1px solid #d6d1de; border-left: 0; border-radius: 0 8px 8px 0; background: #f6f5f8; color: var(--muted); font-size: 14px; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.grid2, .grid3, .grid4, .grid-dns { display: grid; gap: 0 14px; align-items: end; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-dns { grid-template-columns: 1.2fr .9fr .7fr 3fr; }
.grid-dns .end { grid-column: 1 / -1; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span4 { grid-column: span 4; }
.end { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 14px Rubik, sans-serif; color: var(--ink); text-decoration: none; cursor: pointer;
  padding: 9px 16px; background: #fff; border: 1px solid #d6d1de; border-radius: 8px;
  transition: background .12s, border-color .12s; white-space: nowrap;
}
.btn:hover { background: #f6f5f8; }
.btn:active { transform: translateY(1px); }
.btn.pop-btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.pop-btn:hover { background: var(--accent-dark); }
.btn.ghost { background: #fff; }
.btn.danger { background: #fff; color: var(--bad); border-color: #ecc3bf; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.wide { width: 100%; padding: 11px; font-size: 15px; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .chip-btn { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; border: 0; white-space: nowrap; }
.chip.ok, .chip-btn.ok { background: var(--ok-soft); color: var(--ok); }
.chip.no, .chip-btn.no { background: var(--bad-soft); color: var(--bad); }
.chip-btn { cursor: pointer; font-family: Rubik, sans-serif; }

/* ---------- stats & domain cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--paper); border: var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; }
.stat b { display: block; font-size: clamp(20px, 2.6vw, 24px); font-weight: 600; line-height: 1.2; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.c1 b { color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.dcard { display: block; text-decoration: none; color: var(--ink); background: var(--paper); border: var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; transition: border-color .12s; }
.dcard:hover { border-color: #cfc8d9; }
.dcard.off { opacity: .55; }
.dname { font-size: 16px; font-weight: 600; word-break: break-all; margin-bottom: 2px; }
.dmeta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }

/* ---------- tables ---------- */
.tbl { overflow-x: auto; margin: 0 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: var(--line); }
td { padding: 9px 10px; border-bottom: var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.dim td { opacity: .5; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-left: 4px; }
.nowrap { white-space: nowrap; }
table.dns td.val code { white-space: pre-wrap; }
.type { font: 600 11px ui-monospace, monospace; padding: 2px 7px; border-radius: 5px; background: #f1eff5; color: #4a4458; }
.t-SOA { opacity: .6; }
details.pop-menu { display: inline-block; position: relative; }
details.pop-menu summary { list-style: none; }
details.pop-menu summary::-webkit-details-marker { display: none; }
details.pop-menu form {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 4; width: 260px; display: flex; gap: 6px; padding: 10px;
  background: var(--paper); border: var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(31, 26, 43, .12);
}
details.pop-menu form input { margin: 0; padding: 6px 10px; font-size: 14px; }

/* ---------- flash ---------- */
.flash { border-radius: 10px; padding: 11px 14px; margin: 0 0 14px; background: var(--ok-soft); color: #145c42; }
.flash.err { background: var(--bad-soft); color: #8c2a22; }
.flash.warn { background: var(--warn-soft); color: #6b5310; }
.flash.secret { background: #fff; color: var(--ink); border: 1px dashed #cfc8d9; }
.flash code.pw { cursor: pointer; background: var(--accent-soft); color: var(--accent-dark); font-size: 14px; font-weight: 600; }
.flash code.pw[data-copied]::after { content: ' ✓ скопировано'; font-weight: 400; }
.empty { text-align: center; color: var(--muted); padding: 24px; }
.empty.big { font-size: 17px; padding: 50px 16px; }

/* ---------- HDE block ---------- */
.hde dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.hde dt { color: var(--muted); font-size: 13px; }
.hde dd { margin: 0; }

/* ---------- login ---------- */
.login { width: 100%; max-width: 380px; text-align: center; padding: 30px clamp(20px, 5vw, 32px) 24px; }
.login .logo { margin-bottom: 6px; }
.login .sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.login form { text-align: left; }
.quote { margin: 18px 0 0; padding: 12px 0 0; border-top: var(--line); color: var(--muted); font-size: 13px; font-style: italic; cursor: pointer; user-select: none; }
.quote:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid4, .grid-dns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-dns .wide { grid-column: 1 / -1; }
  .grid4 .span4, .grid4 .span2 { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .grid2, .grid3, .grid4, .grid-dns { grid-template-columns: minmax(0, 1fr); }
  .span2, .span3, .span4, .grid4 .span2 { grid-column: auto; }
  .actions { margin-left: 0; }
  details.pop-menu form { width: 220px; }
}

/* ---------- groups, tabs, search ---------- */
[hidden] { display: none !important; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 999px; background: var(--paper); border: var(--line); }
.tab span { font-size: 12px; color: #a39cb2; margin-left: 2px; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab.on span { color: #cfc6dd; }
.tab.add { border-style: dashed; }
.search { width: 240px; max-width: 100%; margin: 0; }
.dgroup { margin: 0 0 22px; }
.gtitle { font-size: 13px; margin: 0 0 10px; }
.gtitle a { color: var(--muted); text-decoration: none; }
.gtitle a:hover { color: var(--accent-dark); }
.gtitle span { background: #ebe7f0; color: var(--muted); border-radius: 999px; padding: 1px 8px; margin-left: 4px; font-size: 11px; }
details.adder > summary { list-style: none; cursor: pointer; }
details.adder > summary::-webkit-details-marker { display: none; }
details.adder > summary h2 { margin: 0; display: inline-block; }
details.adder[open] > summary { margin-bottom: 14px; }
.group-pick { margin: -8px 0 16px; }
.group-pick label { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); }
.group-pick select { width: auto; margin: 0; padding: 5px 10px; font-size: 14px; }
.sound-toggle { font-size: 16px; padding: 6px 9px; }

/* ---------- password field: visible, generate + copy ---------- */
.pwbox { display: flex; margin-top: 5px; }
.pwbox .pwin { flex: 1 1 120px; min-width: 0; margin: 0; border-radius: 8px 0 0 8px; font: 600 15px ui-monospace, Consolas, monospace; letter-spacing: .03em; }
.pwbox .pwin::placeholder { font: 400 14px Rubik, sans-serif; letter-spacing: 0; }
.pwbox .pwin.flash-in { background: #fff8d6; }
.pw-gen, .pw-copy {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; cursor: pointer;
  font: 500 13px Rubik, sans-serif; color: var(--ink); background: #f6f5f8; border: 1px solid #d6d1de; border-left: 0; padding: 0 12px;
}
.pw-gen { color: var(--accent-dark); }
.pw-gen:hover, .pw-copy:hover { background: #ece8f2; }
.pw-copy { border-radius: 0 8px 8px 0; padding: 0 11px; }
.pw-copy.copied, code.pw.copied { color: var(--ok); }
.pw-copy.copied::after { content: '✓'; font-weight: 700; }
.pw-copy.inline-copy { border: 1px solid #d6d1de; border-radius: 6px; padding: 5px 8px; vertical-align: middle; }
details.pop-menu form { width: 380px; align-items: stretch; }
details.pop-menu form .pwbox { margin: 0; flex: 1; }
details.pop-menu form .pwbox .pwin { padding: 6px 10px; font-size: 14px; }
details.pop-menu form .pw-gen span { display: none; }

/* ---------- secret flash ---------- */
.flash.secret { position: relative; background: #fffbea; border: 1px solid #f1d98a; padding-right: 40px; }
.flash-close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.secret-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; }
.secret-row span { min-width: 200px; font-size: 14px; }
.flash.secret code.pw { font: 700 16px ui-monospace, Consolas, monospace; letter-spacing: .04em; background: #fff; color: var(--ink); border: 1px solid #e8d891; padding: 4px 10px; }
.flash code.pw[data-copied]::after { content: none; }
.secret-actions { margin-top: 10px; }
.secret-actions .btn svg { vertical-align: -3px; }
@media (max-width: 600px) {
  .search { width: 100%; }
  details.pop-menu form { width: min(340px, calc(100vw - 40px)); }
  .pw-gen span { display: none; }
}
.pwbox { max-width: 560px; }
.access-pick { margin-bottom: 12px; }
.access-pick .lbl { display: block; font-size: 13px; font-weight: 500; color: #4a4458; margin-bottom: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 4px; }
.access-form { flex-direction: column; align-items: flex-start !important; width: 260px !important; }
.access-form .checks { flex-direction: column; }
.warn-btn { color: var(--bad); border-color: #ecc3bf; }
