:root {
    --line: rgba(80, 150, 255, 0.2);
    --panel: rgba(11, 21, 48, 0.86);
    --soft-border: rgba(122, 165, 245, 0.28);
    --text: #f5f7ff;
    --muted: #b5c4e8;
    --accent: #ff8b2c;
}

body {
    color: var(--text);
    min-height: 100vh;
    background: radial-gradient(circle at center, #0a1a35 0%, #071022 52%, #020617 100%);
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    z-index: -2;
    background:
        linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 64px,
        linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 64px 100%;
    opacity: 0.2;
}

body::after {
    z-index: -1;
    background:
        radial-gradient(circle at 16% 18%, rgba(65, 118, 255, 0.22), transparent 34%),
        radial-gradient(circle at 86% 14%, rgba(255, 139, 44, 0.16), transparent 34%),
        radial-gradient(circle at 50% 84%, rgba(40, 155, 255, 0.14), transparent 42%);
}

.page {
    max-width: 1120px;
    margin: 26px auto 36px;
    padding: 0 16px;
}

.title {
    text-align: center;
    font-size: clamp(2rem, 3.5vw, 2.9rem);
    margin: 18px 0 10px;
    color: #edf3ff;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.subtitle {
    text-align: center;
    max-width: 860px;
    margin: 0 auto 22px;
    line-height: 1.55;
    font-size: 1.05rem;
    color: var(--muted);
}

.card {
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid var(--soft-border);
    border-radius: 18px;
    background: var(--panel);
    padding: 18px;
    box-shadow: 0 18px 36px rgba(5, 12, 32, 0.36);
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(122, 165, 245, 0.26);
    padding-bottom: 10px;
}

.tab {
    border: 1px solid rgba(122, 165, 245, 0.32);
    background: rgba(10, 22, 50, 0.78);
    color: #d8e6ff;
    cursor: pointer;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 0.96rem;
}

.tab.active {
    background: rgba(255, 138, 61, 0.14);
    border-color: rgba(255, 138, 61, 0.72);
    color: #ffe1cc;
}

.panel {
    display: none;
    padding-top: 16px;
}

.panel.active {
    display: block;
}

.converter-block {
    padding: 8px 0;
}

.converter-block h2 {
    text-align: center;
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    margin: 12px 0;
    color: #edf3ff;
}

.controls-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.controls-row select,
.controls-row input {
    border: 1px solid rgba(122, 165, 245, 0.42);
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 0.98rem;
    background: rgba(6, 13, 30, 0.84);
    color: #f4f8ff;
}

.controls-row select:focus,
.controls-row input:focus {
    outline: none;
    border-color: rgba(255, 138, 61, 0.72);
    box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.12);
}

#to-gregorian-month,
#to-ethiopian-month,
#calc-month {
    min-width: 240px;
}

.controls-row.narrow #calc-operation {
    min-width: 120px;
}

.input-group {
    display: inline-flex;
    border: 1px solid rgba(122, 165, 245, 0.42);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(6, 13, 30, 0.84);
}

.input-group input {
    width: 74px;
    border: none;
    border-right: 1px solid rgba(122, 165, 245, 0.32);
    border-radius: 0;
    text-align: center;
    box-shadow: none;
}

.input-group span {
    padding: 8px 10px;
    font-size: 0.95rem;
    color: #d5e3ff;
}

.action-row {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.action-row button {
    border: 1px solid var(--accent);
    background: rgba(255, 138, 61, 0.08);
    color: #ffd4b2;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.action-row button:hover {
    background: rgba(255, 138, 61, 0.2);
}

hr {
    border: none;
    border-top: 1px solid rgba(122, 165, 245, 0.26);
    margin: 14px 0;
}

.result-card {
    max-width: 100%;
    margin: 14px auto 0;
    background: rgba(16, 35, 74, 0.95);
    border: 1px solid rgba(122, 165, 245, 0.34);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.result-card span {
    flex: 1;
    text-align: center;
    font-size: 1.08rem;
    color: #edf3ff;
    line-height: 1.35;
}

.result-lines {
    flex: 1;
    text-align: center;
}

.line-am {
    font-size: 1.05rem;
    color: #edf3ff;
    line-height: 1.35;
    font-family: "Abyssinica SIL", "Noto Sans Ethiopic", sans-serif;
}

.line-en {
    font-size: 1rem;
    color: #bdd2f8;
    margin-top: 4px;
    line-height: 1.35;
}

.result-actions {
    display: flex;
    gap: 6px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 138, 61, 0.9);
    border-radius: 10px;
    background: rgba(255, 138, 61, 0.12);
    color: #ffe4cf;
    cursor: pointer;
    font-size: 1rem;
}

.icon-btn:hover {
    background: rgba(255, 138, 61, 0.24);
}

.error {
    margin-top: 12px;
    border: 1px solid rgba(255, 123, 123, 0.45);
    background: rgba(95, 22, 22, 0.3);
    color: #ffb4b4;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.95rem;
}

.hidden {
    display: none;
}

@media (max-width: 860px) {
    .page {
        margin-top: 18px;
        padding: 0 12px;
    }

    .title {
        font-size: clamp(1.65rem, 8vw, 2.15rem);
    }

    .subtitle,
    .tab,
    .controls-row select,
    .controls-row input,
    .action-row button,
    .error {
        font-size: 0.95rem;
    }

    .converter-block h2 {
        font-size: 1.2rem;
    }

    .result-card {
        flex-direction: column;
        align-items: stretch;
    }

    .result-card span,
    .line-am,
    .line-en {
        font-size: 0.98rem;
    }

    .result-actions {
        justify-content: center;
    }
}
