:root {
    --bg: #0f172a;
    --bg-soft: #111f3a;
    --card: #ffffff;
    --text: #0f172a;
    --text-soft: #475569;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #334155;
    --border: #e2e8f0;
    --success: #166534;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background: #f1f5f9;
    line-height: 1.45;
}

.container {
    width: min(1100px, 94%);
    margin: 0 auto;
}

.hero {
    background: linear-gradient(120deg, var(--bg), var(--bg-soft));
    color: #fff;
    padding: 2rem 0;
    margin-bottom: 1rem;
}

.hero h1 {
    margin: 0 0 .5rem;
    font-size: clamp(1.5rem, 2vw, 2.2rem);
}

.hero p {
    margin: 0;
    color: #dbeafe;
}

.layout {
    display: grid;
    gap: 1rem;
    padding-bottom: 2rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

h2 {
    margin-top: 0;
    margin-bottom: .75rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
}

@media (max-width: 760px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    font-size: .92rem;
    font-weight: 600;
    margin-bottom: .35rem;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: .55rem .7rem;
    background: #fff;
}

input:focus,
select:focus,
button:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

.search-wrap {
    margin-top: .7rem;
}

.actions {
    margin-top: .9rem;
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}

.btn {
    border: 0;
    border-radius: 8px;
    padding: .6rem 1rem;
    cursor: pointer;
    font-weight: 600;
}

.btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

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

.btn-secondary {
    background: var(--secondary);
    color: #fff;
}

.output {
    background: #0b1220;
    color: #e2e8f0;
    border-radius: 8px;
    border: 1px solid #1e293b;
    padding: .75rem;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 58px;
}

.helper {
    margin: .4rem 0 0;
    color: var(--text-soft);
    font-size: .9rem;
}

.history-list {
    display: grid;
    gap: .7rem;
}

.history-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .7rem;
    background: #f8fafc;
}

.history-item .meta {
    font-size: .84rem;
    color: #64748b;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .18rem .55rem;
    font-size: .78rem;
    border: 1px solid transparent;
}

.badge-base {
    background: #e0f2fe;
    color: #075985;
    border-color: #bae6fd;
}

.badge-adv {
    background: #fee2e2;
    color: #7f1d1d;
    border-color: #fecaca;
}

.footer {
    padding-bottom: 2rem;
    color: #475569;
    font-size: .9rem;
}
