/* ── ATM to mmHg Converter ──────────────────────────────────────── */

.atm-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    margin: 2rem auto;
    background: #fffbeb;
    border: 1.5px solid #fcd34d;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 32px rgba(146,64,14,0.13);
    color: #1c1917;
    box-sizing: border-box;
}
.atm-wrap *, .atm-wrap *::before, .atm-wrap *::after { box-sizing: border-box; }

/* ── Header ── */
.atm__header {
    background: linear-gradient(135deg, #1c0a00 0%, #78350f 35%, #b45309 65%, #d97706 85%, #f59e0b 100%);
    padding: clamp(1.4rem, 4vw, 2rem) clamp(1.2rem, 4vw, 2rem);
}
.atm__header h2 {
    font-size: clamp(1.3rem, 4vw, 1.8rem) !important;
    font-weight: 900 !important; color: #fff !important;
    margin: 0 0 0.25rem 0 !important; letter-spacing: -0.01em;
}
.atm__header p { font-size: 0.9rem; color: #fde68a; margin: 0; }

/* ── Body ── */
.atm__body { display: flex; align-items: flex-start; }
.atm__card {
    flex: 1; padding: clamp(1.2rem, 3vw, 1.75rem);
    background: #fff; display: flex; flex-direction: column; gap: 0.85rem;
}
.atm__card-label {
    font-size: 0.78rem; font-weight: 800;
    letter-spacing: 2px; text-transform: uppercase;
    color: #b45309; border-bottom: 2px solid #fef3c7;
    padding-bottom: 0.5rem;
}
.atm__label { display: block; font-size: 0.82rem; font-weight: 600; color: #1c1917; margin-bottom: 0.4rem; }

/* ── Inputs ── */
.atm__field-group { display: flex; flex-direction: column; gap: 0.2rem; }
.atm__input-row {
    display: flex; align-items: center;
    border: 2px solid #fcd34d; border-radius: 10px;
    overflow: hidden; transition: border-color 0.2s;
}
.atm__input-row:focus-within {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217,119,6,0.15);
}
.atm__input {
    flex: 1; border: none; outline: none;
    padding: 0.7rem 0.75rem; font-size: 1.1rem;
    color: #1c1917; background: transparent;
    font-weight: 700; font-family: inherit; width: 100%;
}
.atm__input::placeholder { color: #94a3b8; font-weight: 400; font-size: 0.9rem; }
.atm__unit {
    background: #fef3c7; color: #b45309;
    padding: 0.7rem 0.9rem; font-size: 0.88rem;
    font-weight: 800; white-space: nowrap; flex-shrink: 0;
}

/* ── Arrow ── */
.atm__arrow { text-align: center; font-size: 1.4rem; color: #d97706; line-height: 1; }

/* ── Result box ── */
.atm__result-box {
    background: #fffbeb; border: 2px solid #fcd34d;
    border-radius: 10px; padding: 0.85rem 1rem;
    min-height: 62px; display: flex; flex-direction: column; gap: 4px;
    transition: background 0.2s, border-color 0.2s;
}
.atm__result-box.atm--has-value { background: #fef3c7; border-color: #f59e0b; }
.atm__result-main { display: flex; align-items: baseline; gap: 0.4rem; }
.atm__result-val {
    font-size: 1.85rem; font-weight: 900; color: #78350f;
    font-variant-numeric: tabular-nums; line-height: 1;
}
.atm__result-unit { font-size: 0.95rem; font-weight: 800; color: #b45309; }
.atm__result-sub { font-size: 0.78rem; color: #b45309; font-weight: 600; font-style: italic; }

/* ── Also row (other units) ── */
.atm__also-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.atm__also-item {
    background: #fef9c3; border: 1.5px solid #fde68a;
    border-radius: 8px; padding: 5px 8px; text-align: center;
}
.atm__also-label { display: block; font-size: 10px; font-weight: 800; color: #92400e; letter-spacing: 0.5px; text-transform: uppercase; }
.atm__also-val { display: block; font-size: 0.88rem; font-weight: 700; color: #78350f; margin-top: 2px; }

/* ── Formula ── */
.atm__formula {
    font-size: 0.75rem; color: #64748b; line-height: 1.6;
    background: #f8fafc; border-left: 3px solid #fcd34d;
    padding: 0.5rem 0.75rem; border-radius: 0 6px 6px 0;
}

/* ── Clear button ── */
.atm__clear-btn {
    align-self: flex-start; background: none;
    border: 1.5px solid #cbd5e1; border-radius: 7px;
    padding: 0.35rem 0.85rem; font-size: 0.78rem;
    color: #64748b; cursor: pointer; transition: all 0.15s;
    font-weight: 600; font-family: inherit;
}
.atm__clear-btn:hover { border-color: #ef4444; color: #ef4444; background: #fff5f5; }

/* ── Divider ── */
.atm__divider {
    display: flex; align-items: center; justify-content: center;
    width: 48px; min-width: 48px; background: #fffbeb;
    font-size: 0.7rem; font-weight: 800; letter-spacing: 1px; color: #b45309;
    border-left: 1px solid #fef3c7; border-right: 1px solid #fef3c7;
}

/* ── Tables ── */
.atm__table-section {
    padding: clamp(1rem, 3vw, 1.5rem);
    background: #fff; border-top: 1.5px solid #fef3c7;
}
.atm__table-section--alt { background: #fffdf5; }
.atm__table-title {
    font-size: clamp(0.9rem, 2.5vw, 1rem) !important;
    font-weight: 800 !important; color: #1c1917 !important;
    margin: 0 0 0.85rem !important;
}
.atm__table-wrap { overflow-x: auto; }
.atm__table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.atm__table thead tr { background: linear-gradient(90deg, #1c0a00, #b45309); }
.atm__table thead th {
    color: #fff; padding: 0.6rem 1rem; text-align: left;
    font-weight: 700; font-size: 0.82rem; white-space: nowrap;
}
.atm__table tbody tr:nth-child(even) { background: #fffbeb; }
.atm__table tbody tr:hover { background: #fef3c7; }
.atm__table tbody td {
    padding: 0.5rem 1rem; color: #1c1917;
    font-weight: 500; border-bottom: 1px solid #fef3c7;
}
.atm__mmhg-cell { color: #78350f; font-weight: 800; font-size: 0.95rem; }
.atm__tr--highlight td { background: #fffbeb !important; }
.atm__tr--highlight:hover td { background: #fef3c7 !important; }

/* Category badges */
.atm__badge {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 700; white-space: nowrap;
}
.atm__badge--science   { background: #f3f4f6; color: #374151; }
.atm__badge--medicine  { background: #fce7f3; color: #9d174d; }
.atm__badge--weather   { background: #dbeafe; color: #1e40af; }
.atm__badge--reference { background: #fef9c3; color: #854d0e; }
.atm__badge--diving    { background: #cffafe; color: #164e63; }

/* ── Note ── */
.atm__note {
    background: #fffbeb; border-top: 1.5px solid #fcd34d;
    padding: 0.85rem clamp(1rem, 3vw, 1.5rem);
    font-size: 0.82rem; color: #1c1917; line-height: 1.65;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .atm__body { flex-direction: column; }
    .atm__divider {
        width: 100%; min-width: unset; height: 36px;
        border-left: none; border-right: none;
        border-top: 1px solid #fef3c7; border-bottom: 1px solid #fef3c7;
    }
    .atm__card { padding: 1rem; }
    .atm__also-row { grid-template-columns: repeat(2, 1fr); }
}
