* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(160deg, #2b2c4e 0%, #681660 55%, #1a1a2e 100%);
    color: #1a1a1a;
    padding: 24px 16px 48px;
}

a {
    color: #1762EE;
}

.wrap {
    max-width: 680px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    color: #fff;
}

html[data-lang="en"]:not(.i18n-ready) body {
    opacity: 0;
}

.brand a {
    color: #fff;
    text-decoration: none;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    overflow: hidden;
}

.lang-switch .lang-ico {
    display: flex;
    align-items: center;
    padding: 0 4px 0 10px;
    color: #fff;
    opacity: 0.85;
}

.lang-switch button {
    border: none;
    background: transparent;
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    padding: 8px 11px;
    cursor: pointer;
    opacity: 0.65;
    line-height: 1;
}

.lang-switch button:hover {
    opacity: 1;
}

.lang-switch button.is-active {
    background: rgba(255, 255, 255, 0.24);
    opacity: 1;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-sub {
    font-size: 0.8rem;
    opacity: 0.78;
    margin-top: 2px;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.nav a {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.nav a:hover,
.nav a.is-active {
    background: rgba(255, 255, 255, 0.24);
}

.card {
    background: #f4f4f6;
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    font-weight: 600;
    color: #222;
}

h2 {
    margin: 28px 0 10px;
    font-size: 1.15rem;
    font-weight: 650;
    color: #222;
}

h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 650;
    color: #222;
}

.lead {
    margin: 0 0 24px;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.45;
}

p, li {
    line-height: 1.5;
    color: #333;
}

.muted {
    color: #666;
    font-size: 0.9rem;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    text-align: center;
}

.btn-primary {
    background: #1762EE;
    color: #fff;
}

.btn-primary:hover { background: #1250c4; color: #fff; }

.btn-auth {
    background: #5c2d91;
    color: #fff;
}

.btn-auth:hover { background: #4a2474; color: #fff; }

.btn-store {
    background: #111;
    color: #fff;
}

.btn-store:hover { background: #000; color: #fff; }

.btn-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
}

.btn-secondary:hover { background: #f0f0f0; }

.hint {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: #666;
    line-height: 1.4;
}

.choice {
    display: block;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 16px 14px;
    text-decoration: none;
    color: inherit;
}

.choice:hover {
    border-color: #1762EE;
}

.choice .kicker {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5c2d91;
    margin-bottom: 4px;
}

.choice p {
    margin: 6px 0 0;
    color: #555;
    font-size: 0.9rem;
}

.steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps > li {
    position: relative;
    margin: 0 0 14px;
    padding: 14px 14px 14px 52px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e6e6ea;
}

.steps > li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 14px;
    top: 14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #1762EE;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.steps p {
    margin: 0 0 8px;
}

.steps p:last-child {
    margin-bottom: 0;
}

.callout {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.callout.info { background: #e8f0fe; color: #12336b; }
.callout.ok { background: #d4edda; color: #155724; }
.callout.warn { background: #fff3cd; color: #6b4e00; }
.callout.danger { background: #f8d7da; color: #721c24; }

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.92rem;
}

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

th {
    background: #ececf1;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #555;
}

code, .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88em;
    background: #ececf1;
    padding: 1px 6px;
    border-radius: 4px;
}

.divider {
    margin: 28px 0 20px;
    border: none;
    border-top: 1px solid #ddd;
}

.tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 14px;
}

.tab {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 8px;
    font-weight: 650;
    cursor: pointer;
}

.tab.is-active {
    background: #1762EE;
    border-color: #1762EE;
    color: #fff;
}

.pane { display: none; }
.pane.is-active { display: block; }

.foot {
    margin-top: 20px;
    text-align: center;
    font-size: 0.85rem;
}

.foot a { color: #c5d4ff; }

.store-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.store-row .btn {
    width: auto;
    flex: 1;
    min-width: 180px;
}

.meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 18px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #ececf1;
    color: #444;
    font-size: 0.75rem;
    font-weight: 650;
}

ul.plain {
    margin: 8px 0 0;
    padding-left: 18px;
}

.toc a {
    text-decoration: none;
}

@media (max-width: 480px) {
    .card { padding: 22px 16px; }
    h1 { font-size: 1.35rem; }
    .btn { min-height: 48px; }
}
