:root {
    --bg: #07110d;
    --bg-2: #0c1a14;
    --surface: #10231b;
    --card: #13281f;
    --line: rgba(61, 220, 151, 0.16);
    --mint: #3ddc97;
    --mint-2: #1f8f62;
    --amber: #e8b86d;
    --ink: #e8f6ee;
    --muted: #87a396;
    --danger: #ef6b6b;
    --ok: #3ddc97;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    min-height: 100vh;
}
h1, h2, h3 {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-weight: 650;
}
body.market, body.plain, body.app {
    background:
        radial-gradient(900px 480px at 12% -10%, rgba(61, 220, 151, 0.12), transparent 55%),
        radial-gradient(700px 420px at 100% 8%, rgba(232, 184, 109, 0.08), transparent 50%),
        var(--bg);
}
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono {
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
input, select, button, .btn, .m-nav, .side nav, .kicker, .pills, .badge {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.orb {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
    opacity: 0.35;
}
.orb-a { width: 280px; height: 280px; left: -80px; top: 120px; background: #1f8f62; }
.orb-b { width: 220px; height: 220px; right: -40px; top: 40px; background: #8a6230; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: 0.04em;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.brand:hover { text-decoration: none; color: #fff; }
.logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 6px rgba(61, 220, 151, 0.15);
}
.center-brand { justify-content: center; margin-bottom: 18px; }

.m-top, .m-foot {
    position: relative;
    z-index: 2;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.m-top { padding: 22px 0 8px; }
.m-nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.m-nav a { color: var(--muted); }
.m-nav a:hover { color: var(--ink); text-decoration: none; }

.hero, .band {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}
.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    padding: 48px 0 72px;
    align-items: center;
}
.kicker {
    color: var(--mint);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 12px;
    margin: 0 0 10px;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.12; margin: 0 0 16px; font-weight: 600; }
h1 em { font-style: italic; color: var(--amber); }
h2 { font-size: 1.55rem; margin: 0 0 20px; }
h3 { margin: 8px 0; }
.lead { font-size: 1.15rem; color: #c6ddd1; max-width: 36rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0; }
.hero-points { margin: 0; padding-left: 18px; color: var(--muted); }

.hero-stage { position: relative; min-height: 420px; }
.radar {
    position: absolute;
    inset: 20px 10px;
    border-radius: 50%;
    background:
        repeating-radial-gradient(circle at 50% 50%, transparent 0 28px, rgba(61,220,151,0.08) 29px 30px);
    mask-image: radial-gradient(circle, #000 40%, transparent 72%);
}
.phone {
    position: relative;
    width: min(340px, 100%);
    margin-left: auto;
    background: #0a1611;
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 18px 16px 22px;
    box-shadow: var(--shadow);
}
.phone-bar {
    width: 86px;
    height: 8px;
    border-radius: 99px;
    background: #1c3329;
    margin: 0 auto 16px;
}
.note {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.note span { color: var(--muted); font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.note strong { display: block; margin: 4px 0; }
.note p { margin: 0; color: #b7cfc3; font-size: 14px; }
.note.dim { opacity: 0.72; transform: scale(0.98); }

.band { padding: 24px 0 64px; }
.band.tight { padding-top: 0; }
.steps, .plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.steps article, .plan, .card, .stat, .auth-card, .box {
    background: rgba(19, 40, 31, 0.86);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    backdrop-filter: blur(10px);
}
.steps span {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    color: var(--amber);
    font-size: 13px;
}
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pills span {
    border: 1px solid var(--line);
    padding: 8px 14px;
    border-radius: 999px;
    background: #10231b;
}
.plans { grid-template-columns: 1fr 1fr; }
.plan-tag { margin: 0; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; }
.price { font-size: 2rem; margin: 4px 0 12px; }
.plan ul { padding-left: 18px; color: #c6ddd1; }
.plan.featured {
    border-color: rgba(61, 220, 151, 0.4);
    box-shadow: 0 0 0 1px rgba(61, 220, 151, 0.15), var(--shadow);
}

.m-foot {
    padding: 28px 0 48px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    margin-top: 20px;
}
.m-foot-links { display: flex; gap: 16px; }

.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: var(--mint);
    color: #062117;
    padding: 10px 16px;
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    font-weight: 700;
}
.btn:hover, button:hover { filter: brightness(1.05); text-decoration: none; }
.btn-ghost, .btn-tiny.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}
.btn-tiny { padding: 6px 10px; font-size: 12px; }
.btn-danger, button.btn-danger { background: #7a2d2d; color: #fff; }

.plain-wrap { width: min(460px, calc(100% - 32px)); margin: 72px auto; position: relative; z-index: 1; }
.plain-wrap:has(.wide) { width: min(640px, calc(100% - 32px)); }
.auth-card { padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 2rem; }
.auth-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted); word-break: break-all; }

.form label { display: block; margin-bottom: 12px; font-size: 14px; color: #c6ddd1; }
.form input, .form select, .form textarea, input, select, textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #0c1a14;
    color: var(--ink);
    font: inherit;
}
.form button { width: 100%; margin-top: 6px; }
.inline-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline-form label { flex: 1; min-width: 160px; }
.inline-form button { width: auto; }
.grid-2, .grid-3, .grid-form { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-form { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; margin: 0; }

.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 18px;
    border-right: 1px solid var(--line);
    background: rgba(8, 18, 13, 0.92);
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.side nav { display: flex; flex-direction: column; gap: 6px; }
.side nav a {
    color: var(--muted);
    padding: 8px 10px;
    border-radius: 10px;
}
.side nav a:hover, .side nav a.on {
    background: rgba(61, 220, 151, 0.1);
    color: var(--ink);
    text-decoration: none;
}
.side-user { margin-top: auto; color: var(--muted); font-size: 13px; }
.side-user strong { display: block; color: var(--ink); }
.app-main { padding: 28px; width: min(1120px, 100%); }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
}
.page-head h1 { font-size: 2rem; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; font-size: 1.6rem; }
.stat small { font-size: 0.9rem; color: var(--muted); }
.meter { height: 6px; background: #0c1a14; border-radius: 99px; margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--mint); }

.card { margin-bottom: 16px; }
.card.highlight { border-color: rgba(232, 184, 109, 0.35); }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.addr-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.addr-row code, .code-pill {
    background: #0c1a14;
    border: 1px solid var(--line);
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--mint);
    word-break: break-all;
    overflow-wrap: anywhere;
}
.secret-full {
    display: block;
    width: 100%;
    font-size: clamp(1.2rem, 2.6vw, 1.85rem);
    line-height: 1.4;
    word-break: break-all;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    background: #0c1a14;
    border: 1px solid var(--line);
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--mint);
}
#bark-key {
    font-size: 1.35rem;
    line-height: 1.4;
    min-height: 4.2em;
    word-break: break-all;
    overflow-wrap: anywhere;
    resize: vertical;
}
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 16px;
}
.check-row input { width: auto; margin: 0; }
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.tabs a {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
}
.tabs a.on, .tabs a:hover {
    background: rgba(61, 220, 151, 0.12);
    color: var(--mint);
    text-decoration: none;
}
.pager {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 16px;
    color: var(--muted);
}
.add-wrap { margin: 0 0 16px; }
.pattern-form { margin: 0; }
.pattern-form label { min-width: 220px; }
.pattern-form input { min-width: 200px; }
.box-link { display: block; color: inherit; }
.box-link:hover { text-decoration: none; }
.alias-line { display: flex; flex-wrap: wrap; gap: 6px; }
.box-lines { display: flex; flex-direction: column; }
.box-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px 14px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}
.box-line:last-child { border-bottom: 0; }
.box-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.box-addr {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    color: var(--mint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
a.box-addr:hover { text-decoration: none; color: #fff; }
.box-line .muted { font-size: 12px; white-space: nowrap; }
@media (max-width: 800px) {
    .box-line { grid-template-columns: 1fr auto; }
    .box-line .muted { grid-column: 1 / -1; white-space: normal; }
}
.warn { color: var(--amber); }
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(61, 220, 151, 0.12);
    color: var(--mint);
    font-size: 12px;
}
.badge.gold { background: rgba(232, 184, 109, 0.15); color: var(--amber); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; }
.actions, td.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form, .mini { display: inline; }
.mini select { width: auto; margin: 0; padding: 6px 8px; }

.box-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.box.is-default { border-color: rgba(61, 220, 151, 0.4); }
.box-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.hidden { display: none; }
.mail-card { padding: 8px 20px 16px; }
.empty-mail { padding: 18px 4px; }
.mail-list { display: flex; flex-direction: column; }
.mail-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.mail-row:last-child { border-bottom: 0; }
.mail-row time {
    color: var(--muted);
    font-size: 12px;
    padding-top: 3px;
    font-variant-numeric: tabular-nums;
}
.mail-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.mail-line strong { font-size: 15px; font-weight: 650; }
.mail-meta { margin: 2px 0 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row details { margin-top: 4px; }
.mail-row summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 12px;
    list-style: none;
}
.mail-row summary::-webkit-details-marker { display: none; }
.mail-body {
    margin: 8px 0 0;
    color: #c6ddd1;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.mail-ops { display: flex; gap: 6px; flex-wrap: nowrap; }
.mail-ops .btn { white-space: nowrap; }
.code-pill.tight { padding: 2px 8px; font-size: 12px; }
@media (max-width: 700px) {
    .mail-row { grid-template-columns: 52px 1fr; }
    .mail-ops { grid-column: 1 / -1; }
}
.flash-wrap { width: min(1120px, calc(100% - 32px)); margin: 12px auto 0; position: relative; z-index: 2; }
.flash { padding: 10px 12px; border-radius: 12px; margin-bottom: 14px; }
.flash-ok { background: rgba(61, 220, 151, 0.12); color: var(--ok); }
.flash-error { background: rgba(239, 107, 107, 0.12); color: var(--danger); }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 10, 8, 0.72);
}
.modal.is-open { display: flex; }
.modal-card {
    width: min(420px, 100%);
    background: #13281f;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--shadow);
}
.modal-card label { display: block; margin: 12px 0 16px; font-size: 14px; color: #c6ddd1; }
.modal-card input {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #0c1a14;
    color: var(--ink);
    font: inherit;
}

@media (max-width: 900px) {
    .hero, .steps, .plans, .stats, .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .app { grid-template-columns: 1fr; }
    .side { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .side nav { flex-direction: row; flex-wrap: wrap; }
    .m-nav a:not(.btn) { display: none; }
    .m-nav .lang-switch { display: inline-flex; }
    .m-nav .lang-switch a { display: inline; }
}

.lang-switch { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; }
.lang-switch a { color: var(--muted); }
.lang-switch a.on, .lang-switch a:hover { color: var(--mint); text-decoration: none; }
.side-user .lang-switch { display: flex; margin: 8px 0; }
.auth-card .lang-switch { margin-top: 16px; }
.chan-guide {
    margin: 12px 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #0c1a14;
}
.guide-kicker { color: var(--mint); margin: 0 0 6px; font-size: 13px; }
.guide-links { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 8px 0 12px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.guide-grid h3, .guide-fold h3 { font-size: 13px; margin: 10px 0 6px; }
.chan-guide ol, .guide-fold ol { margin: 0; padding-left: 18px; color: var(--muted); }
.chan-guide li, .guide-fold li { margin: 4px 0; }
.guide-list { display: flex; flex-direction: column; gap: 8px; }
.guide-fold {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
    background: #0c1a14;
}
.guide-fold summary { cursor: pointer; color: var(--ink); font-weight: 600; }
@media (max-width: 900px) {
    .guide-grid { grid-template-columns: 1fr; }
}
