:root {
    --bg-card: #ffffff;
    --bg-button: #eef1f4;
    --border: rgba(15, 23, 42, 0.08);
    --text-main: #171a21;
    --text-muted: #8c95a3;
    --accent: #3d9c72;
    --accent-hover: #2f805d;
    --accent-warm: #f59e0b;
    --shadow: 0 30px 80px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    padding: 26px 18px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 1200px;
}

header {
    position: sticky;
    top: 0;
    z-index: 40;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(120%) blur(8px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 68px;
}

.header-title {
    margin: 0;
}

.header-title-link {
    color: var(--text-main);
    text-decoration: none;
}

.header-title-link:hover {
    text-decoration: none;
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

h1 {
    margin: 0 0 6px 0;
    font-size: clamp(1.65rem, 2.8vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

button {
    padding: 11px 16px;
    border: none;
    border-radius: 14px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 10px 24px rgba(61, 156, 114, 0.18);
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.header-help-btn {
    background: transparent;
    color: var(--text-main);
    box-shadow: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 14px;
    white-space: nowrap;
}

.header-help-btn:hover {
    background: var(--bg-button);
}

.hidden {
    display: none !important;
}

#error-message {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 16px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 100%;
}

#loader {
    text-align: center;
    padding: 16px;
    font-style: italic;
    color: var(--text-muted);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.46);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 20px;
    max-width: 540px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-title {
    margin-top: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.modal-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
}

.help-example {
    margin: 12px 0;
    padding: 11px 12px;
    border-left: 4px solid transparent;
    border-radius: 0 8px 8px 0;
}

.help-example h4 {
    margin: 0 0 4px 0;
}

.help-example p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.help-example-spectacular {
    border-left-color: #f97316;
    background: rgba(249, 115, 22, 0.08);
}

.help-example-spectacular h4 {
    color: #f97316;
}

.help-example-clear {
    border-left-color: #06b6d4;
    background: rgba(6, 182, 212, 0.08);
}

.help-example-clear h4 {
    color: #06b6d4;
}

.help-example-dynamic {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.help-example-dynamic h4 {
    color: #10b981;
}

.help-example-poor {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.help-example-poor h4 {
    color: #ef4444;
}

.modal-close-btn {
    width: 100%;
    margin-top: 12px;
}

@media (max-width: 500px) {
    body {
        padding: 18px 14px 32px;
    }

    .header-row {
        min-height: 60px;
    }
}
