* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 920px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 32px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-header h1 {
    color: #333;
    font-size: 2em;
    margin-bottom: 6px;
}

.subtitle {
    color: #666;
    font-size: 0.95em;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    background: #667eea;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #5568d3;
}

.search-section {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

.field-group--full,
.actions {
    grid-column: 1 / -1;
}

.field-label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.mode-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.mode-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    color: #333;
    cursor: pointer;
}

.search-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.search-button,
.clear-button {
    padding: 12px 22px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.search-button {
    background: #667eea;
    color: #fff;
}

.search-button:hover {
    background: #5568d3;
}

.clear-button {
    background: #6c757d;
    color: #fff;
}

.clear-button:hover {
    background: #5a6268;
}

.is-hidden {
    display: none !important;
}

.hint {
    margin-top: 14px;
    color: #6c757d;
    font-size: 0.85em;
}

.hint code {
    background: #eef1f6;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.92em;
}

.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.alert-error {
    background: #fdecea;
    color: #b42318;
    border: 1px solid #f5c2c0;
}

.result-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 22px;
    background: #fff;
}

.result-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.result-top h2 {
    color: #333;
    font-size: 1.35em;
    margin-bottom: 4px;
}

.result-meta {
    color: #666;
    font-size: 0.95em;
}

.klass-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.8em;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px 18px;
}

.result-grid dt {
    font-size: 0.78em;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.result-grid dd {
    color: #222;
    font-size: 1em;
    word-break: break-word;
}

@media (max-width: 640px) {
    .container {
        padding: 20px;
    }

    .search-form {
        grid-template-columns: 1fr;
    }
}
