/* cryps.info v3 — same palette as the current site (gold header/footer,
   white content) per the site owner's request to keep the existing
   look and just improve usability, not redesign from scratch. */

:root {
    --gold: #fdbc01;
    --text: #222;
    --muted: #666;
    --border: #ddd;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: #fff;
    line-height: 1.5;
}

.site-header, .site-footer {
    background: var(--gold);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.site-header .logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: #000;
    text-decoration: none;
}

/* User-requested: 150+ languages don't fit as a row of links — a
   searchable native <select> instead (browsers give this free
   type-ahead search + keyboard nav, no custom JS widget needed). */
.lang-switch select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: .9rem;
    max-width: 220px;
}

.lang-switch-nojs {
    font-size: .85rem;
    color: #000;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

main {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

h1 {
    font-size: 1.4rem;
    margin: 0 0 4px;
}

h2 {
    font-size: 1.05rem;
    color: var(--muted);
    font-weight: 400;
    margin: 0 0 20px;
}

.calculator {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
}

.calc-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calc-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* User-requested: currency/unit autocomplete under the code inputs. */
.calc-autocomplete {
    position: relative;
}

.calc-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    margin: 2px 0 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    max-height: 260px;
    overflow-y: auto;
}

.calc-suggestion {
    padding: 8px 12px;
    font-size: .9rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calc-suggestion.active, .calc-suggestion:hover {
    background: var(--gold);
}

.calc-field input, .calc-field output {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.calc-field output {
    background: #fafafa;
    font-weight: 600;
}

#calc-swap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 6px;
}

#calc-swap:hover { background: var(--gold); }

.calc-summary {
    text-align: center;
    margin: 16px 0 0;
    font-size: 1.05rem;
}

.related p a {
    display: inline-block;
    margin: 0 10px 8px 0;
    color: #333;
    font-size: .9rem;
}

[dir="rtl"] .calc-row { flex-direction: row-reverse; }

@media (max-width: 480px) {
    .calc-row { flex-direction: column; }
    #calc-swap { align-self: center; transform: rotate(90deg); }
}
