:root {
    --bg: #0f1117;
    --panel: #1a1d27;
    --panel-border: #2a2e3a;
    --text: #e8eaed;
    --text-muted: #9aa0a6;
    --accent: #22c55e;
    --accent-hover: #16a34a;
    --input-bg: #12141c;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

.app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.15rem;
}

.logo-icon {
    color: var(--accent);
    font-size: 1.4rem;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

.hero {
    margin-bottom: 28px;
}

.hero h1 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.hero-lead {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 100%;
    line-height: 1.55;
}

.hero-lead strong {
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .hero-lead strong {
        white-space: normal;
    }
}

.main {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
}

@media (max-width: 800px) {
    .main {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        font-size: 1.4rem;
    }
}

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    padding: 28px 24px;
}

.panel h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

select,
input[type="text"],
input[type="url"],
textarea,
.search-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

select:focus,
input:focus,
textarea:focus,
.search-input:focus {
    border-color: var(--accent);
}

select:disabled,
.search-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.search-select {
    position: relative;
}

.search-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 20;
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}

.search-option {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(42,46,58,0.6);
}

.search-option:last-child {
    border-bottom: none;
}

.search-option:hover,
.search-option.active {
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent);
}

.search-option .meta {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.search-empty {
    padding: 12px 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--panel-border);
    color: var(--text);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

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

.request-box {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--panel-border);
    text-align: center;
}

.request-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.result.empty {
    color: var(--text-muted);
    text-align: center;
    padding: 40px 20px;
    font-size: 0.95rem;
}

.timeline {
    list-style: none;
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--panel-border);
}

.timeline-item {
    position: relative;
    padding: 12px 0 12px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 18px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: transparent;
    border: 3px solid var(--accent);
    box-shadow: none;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.timeline-item.done::before {
    background: var(--accent);
    border-color: var(--panel);
    box-shadow: 0 0 0 2px var(--accent);
}

.timeline-item.current::before {
    background: #3b82f6;
    border-color: var(--panel);
    box-shadow: 0 0 0 2px #3b82f6;
}

.ver-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ver-number {
    font-weight: 600;
    font-size: 1rem;
}

.ver-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent);
    white-space: nowrap;
}

.summary {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--panel-border);
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.result-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.btn-copy {
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--panel-border);
    color: var(--text);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-copy:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-copy.copied {
    border-color: var(--accent);
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent);
}

.error {
    color: #f87171;
    padding: 16px;
    background: rgba(248, 113, 113, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
}

/* SEO content — full width like calculator */
.seo-content {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--panel-border);
    width: 100%;
    max-width: none;
}

.seo-content h2 {
    font-size: 1.25rem;
    margin: 28px 0 14px;
    font-weight: 600;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content p {
    color: var(--text-muted);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.seo-content strong {
    color: var(--text);
}

.seo-content ol,
.seo-content ul {
    margin: 0 0 14px 1.25rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.seo-content li {
    margin-bottom: 6px;
}

/* FAQ accordion */
.faq {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
    width: 100%;
}

.faq-item {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item[open] {
    border-color: rgba(34, 197, 94, 0.35);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 44px 14px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    color: var(--text);
    user-select: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary:hover {
    color: var(--accent);
}

.faq-body {
    padding: 0 16px 16px;
}

.faq-body p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.site-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--panel-border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
}

.modal-card h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.modal-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.request-msg {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.request-msg.ok {
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent);
}

.request-msg.err {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
}
