:root {
    --bg: #f4f5f7;
    --card-bg: #ffffff;
    --text: #1c1f26;
    --text-muted: #5b6270;
    --border: #dfe2e7;
    --accent: #2f6fed;
    --accent-contrast: #ffffff;
    --error-bg: #fdecec;
    --error-text: #a3231f;
    --ok-bg: #eaf6ec;
    --ok-text: #1e6b34;
    --step-bg: #f9fafb;
    --shadow: 0 1px 3px rgba(20, 24, 33, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14161b;
        --card-bg: #1c1f26;
        --text: #e7e9ee;
        --text-muted: #9aa1af;
        --border: #2c303a;
        --accent: #5b8bf0;
        --accent-contrast: #0b0e14;
        --error-bg: #3a1f1f;
        --error-text: #f2a3a0;
        --ok-bg: #1c2f22;
        --ok-text: #8fd6a3;
        --step-bg: #22252d;
        --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    }
}

:root[data-theme="dark"] {
    --bg: #14161b;
    --card-bg: #1c1f26;
    --text: #e7e9ee;
    --text-muted: #9aa1af;
    --border: #2c303a;
    --accent: #5b8bf0;
    --accent-contrast: #0b0e14;
    --error-bg: #3a1f1f;
    --error-text: #f2a3a0;
    --ok-bg: #1c2f22;
    --ok-text: #8fd6a3;
    --step-bg: #22252d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

:root[data-theme="light"] {
    --bg: #f4f5f7;
    --card-bg: #ffffff;
    --text: #1c1f26;
    --text-muted: #5b6270;
    --border: #dfe2e7;
    --accent: #2f6fed;
    --accent-contrast: #ffffff;
    --error-bg: #fdecec;
    --error-text: #a3231f;
    --ok-bg: #eaf6ec;
    --ok-text: #1e6b34;
    --step-bg: #f9fafb;
    --shadow: 0 1px 3px rgba(20, 24, 33, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    padding: 24px 16px 64px;
}

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

h1 {
    font-size: 1.4rem;
    margin: 0 0 4px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 24px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.field {
    margin-bottom: 16px;
}

.field:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-muted);
}

input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

input[type="text"]:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}

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

.row .field {
    flex: 1 1 220px;
}

button {
    appearance: none;
    border: none;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 1rem;
    font-weight: 600;
    padding: 11px 22px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
}

button:hover {
    filter: brightness(1.08);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

#result {
    display: none;
}

#result.visible {
    display: block;
}

.message {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.message.error {
    background: var(--error-bg);
    color: var(--error-text);
}

.message.ok {
    background: var(--ok-bg);
    color: var(--ok-text);
}

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

.steps li {
    counter-increment: step;
    background: var(--step-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    position: relative;
    padding-left: 52px;
}

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

.steps li:last-child {
    border-color: var(--accent);
}

.step-version {
    font-size: 1.05rem;
    font-weight: 700;
}

.step-version a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted var(--text-muted);
}

.step-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.step-meta b {
    color: var(--text);
    font-weight: 600;
}

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    margin-left: 8px;
    vertical-align: middle;
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 32px;
}
