/* ===== Базовые ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 50% -100px, #1c2130 0%, #0f1115 60%) fixed, #0f1115;
    color: #e6e8ee;
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: #8fa7ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #23262f; padding: 1px 6px; border-radius: 5px; font-size: 0.9em; }
h1 { font-size: 1.45em; margin: 0 0 10px; }
h2 { font-size: 1.15em; margin: 0 0 10px; }
.muted { color: #9aa1b0; }
.small { font-size: 0.85em; }
.empty {
    padding: 40px 16px;
    text-align: center;
    color: #9aa1b0;
    background: #171a21;
    border: 1px dashed #2b2f3a;
    border-radius: 12px;
}

/* ===== Карточки ===== */
.card {
    max-width: 680px;
    margin: 40px auto;
    padding: 28px 26px;
    background: #171a21;
    border: 1px solid #242834;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.card-404 { text-align: center; }

/* ===== Публичная страница ===== */
.card-wide { max-width: 1040px; }
.card-title { font-size: 1.5em; }
.card-desc { color: #b6bcc9; margin-bottom: 6px; white-space: pre-line; }
.section-title { font-size: 1.25em; margin: 0 0 14px; }

.public-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 34px;
    margin-top: 22px;
}
@media (max-width: 860px) {
    .public-grid { grid-template-columns: 1fr; gap: 26px; }
    .col-qr { order: 2; }
    .col-apps { order: 1; }
}

.block { margin-top: 26px; }
.block-label {
    font-size: .8em;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #8b93a5;
    margin-bottom: 8px;
}

/* Табы платформ */
.ptabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    border-bottom: 1px solid #2b2f3a;
    margin-bottom: 18px;
}
.ptab {
    appearance: none;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #9aa1b0;
    font: inherit;
    font-weight: 600;
    padding: 10px 12px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.ptab:hover { color: #e6e8ee; }
.ptab.active {
    color: #e6e8ee;
    border-bottom-color: #4f6ef7;
}

/* Чипы приложений */
.app-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.chip {
    appearance: none;
    font: inherit;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid #2b2f3a;
    background: #1d212b;
    color: #e6e8ee;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--app-color, #4f6ef7); }
.chip.active {
    background: var(--app-color, #4f6ef7);
    border-color: var(--app-color, #4f6ef7);
    color: #fff;
}

/* Шаги */
.steps { display: flex; flex-direction: column; }
.step {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #2b2f3a;
}
.step:last-child { border-bottom: none; }
.step-num {
    font-size: 1.3em;
    font-weight: 700;
    color: #4ade80;
    min-width: 22px;
    line-height: 1.4;
}
.step-body { flex: 1; min-width: 0; }
.step-title { font-size: 1.08em; margin: 0 0 6px; }
.step-text { margin: 0 0 12px; color: #b6bcc9; }
.step-hint { margin: 10px 0 0; font-size: .85em; color: #798193; }
.btn-step { min-width: 220px; text-align: center; }
.btn-outline {
    border-color: #2b2f3a;
    background: #1d212b;
}
.btn-outline:hover { border-color: #3a4256; }

/* Копирование ссылки */
.copybox {
    position: relative;
    cursor: pointer;
    border-radius: 10px;
}
.copybox textarea {
    width: 100%;
    resize: none;
    font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: #dfe3ec;
    background: #10131a;
    border: 1px solid #2b2f3a;
    border-radius: 10px;
    padding: 12px 12px 28px;
    min-height: 60px;
    overflow: hidden;
}
.copy-hint {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: .8em;
    color: #798193;
    transition: color .2s;
}
.copy-hint.copied { color: #4ade80; }

.qr-wrap { text-align: center; margin-bottom: 14px; }
#qrcode {
    display: inline-block;
    padding: 10px;
    background: #fff;
    border-radius: 12px;
}
#qrcode img, #qrcode canvas { display: block; }
.qr-hint { margin-top: 8px; font-size: .85em; color: #9aa1b0; }
.qr-note { font-size: .85em; color: #798193; margin: 10px 0 0; }

.btn-copy {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.btn-copy.copied {
    border-color: #245c3c;
    color: #7ee2a8;
}
.btn {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid #2b2f3a;
    border-radius: 10px;
    background: #1d212b;
    color: #e6e8ee;
    font: inherit;
    cursor: pointer;
    text-align: center;
    transition: background .15s, border-color .15s;
}
.btn:hover { background: #242936; text-decoration: none; }
.btn-primary {
    background: #4f6ef7;
    border-color: #4f6ef7;
    color: #fff;
}
.btn-primary:hover { background: #3d5ce6; }
.btn-ghost { background: transparent; }
.btn-danger {
    background: transparent;
    border-color: #5c2b33;
    color: #ff8a97;
}
.btn-danger:hover { background: #2a1a1e; }
.btn-small { padding: 5px 10px; font-size: .85em; border-radius: 8px; }
.btn-app {
    background: var(--app-color, #4f6ef7);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}
.btn-app:hover { filter: brightness(1.12); background: var(--app-color, #4f6ef7); }

/* ===== Скриншоты ===== */
.shots {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}
.shots img {
    height: 110px;
    border-radius: 8px;
    border: 1px solid #2b2f3a;
    display: block;
}
.shots-admin img { height: 90px; }

/* ===== Главная ===== */
.home { max-width: 680px; margin: 40px auto; padding: 0 16px; }
.home-header { margin-bottom: 24px; }
.home-list { list-style: none; margin: 0; padding: 0; }
.home-list li { margin-bottom: 10px; }
.home-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    padding: 14px 18px;
    background: #171a21;
    border: 1px solid #242834;
    border-radius: 12px;
}
.home-list a:hover { border-color: #3a4256; text-decoration: none; }
.home-title { font-weight: 600; }
.home-slug { color: #8b93a5; font-size: .85em; font-family: ui-monospace, Consolas, monospace; }
.admin-link { margin-top: 24px; text-align: right; }

/* ===== Формы ===== */
label { display: block; margin-bottom: 14px; font-weight: 500; }
input[type="text"], input[type="password"], input[type="url"], textarea, input[type="file"] {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    font: inherit;
    color: #e6e8ee;
    background: #10131a;
    border: 1px solid #2b2f3a;
    border-radius: 10px;
}
input:focus, textarea:focus { outline: none; border-color: #4f6ef7; }
textarea { resize: vertical; }

.auth { display: flex; align-items: center; justify-content: center; min-height: 80vh; padding: 16px; }
.auth-card { width: 100%; max-width: 380px; margin: 0; }

/* ===== Админка ===== */
.admin { max-width: 960px; margin: 32px auto 60px; padding: 0 16px; }
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.admin-header h1 { margin: 0; }
.admin-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline { display: inline; }

.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }
.alert-ok { background: #12291c; border: 1px solid #245c3c; color: #7ee2a8; }
.alert-err { background: #2b1519; border: 1px solid #5c2b33; color: #ff9aa5; }

.table {
    width: 100%;
    border-collapse: collapse;
    background: #171a21;
    border: 1px solid #242834;
    border-radius: 12px;
    overflow: hidden;
}
.table th, .table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #22262f;
    vertical-align: top;
}
.table th {
    font-size: .78em;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #8b93a5;
    background: #1b1f28;
}
.table tr:last-child td { border-bottom: none; }
.table-actions { white-space: nowrap; }
.table-actions .btn { margin-left: 6px; }

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: .78em;
    font-weight: 600;
    color: #fff;
    background: var(--app-color, #555);
}
.badge + .badge { margin-left: 5px; }

.form-card {
    max-width: 640px;
    background: #171a21;
    border: 1px solid #242834;
    border-radius: 14px;
    padding: 22px 22px 18px;
    margin-bottom: 20px;
}
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.apps-fieldset {
    border: 1px solid #2b2f3a;
    border-radius: 10px;
    padding: 12px 16px 4px;
    margin: 0 0 14px;
}
.apps-fieldset legend {
    padding: 0 8px;
    font-size: .82em;
    color: #8b93a5;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 400;
}
.check input { width: auto; margin: 0; }

.shot-item {
    display: inline-block;
    text-align: center;
    margin: 0 10px 10px 0;
}

@media (max-width: 620px) {
    .card { margin: 16px auto; padding: 20px 16px; }
    .table { display: block; overflow-x: auto; }
    .ptab { padding: 8px 9px; font-size: .9em; }
    .btn-step { min-width: 0; width: 100%; }
}
