/**
 * AHI Calculator Styles
 * 무호흡-저호흡 지수(AHI) 계산기 전용 스타일
 *
 * @package Zipper
 */

#ahiTool {
    color: #2d2a26;
}

#ahiTool .ahi-lead {
    margin: 10px 0 18px;
    color: #5f5a56;
    font-size: 15px;
    line-height: 1.7;
}

#ahiTool .ahi-main-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 18px;
    align-items: start;
}

#ahiTool .ahi-input-col,
#ahiTool .ahi-result-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

#ahiTool .ahi-input-col {
    position: sticky;
    top: 20px;
}

#ahiTool .ahi-panel,
#ahiTool .ahi-result-hero,
#ahiTool .ahi-summary-card,
#ahiTool .ahi-disclaimer {
    border: 1px solid #e2dccf;
    border-radius: 16px;
    background: #fffdf8;
    box-shadow: 0 10px 24px rgba(45, 42, 38, 0.06);
}

#ahiTool .ahi-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

#ahiTool .ahi-panel-title,
#ahiTool .ahi-result-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1816;
}

#ahiTool .ahi-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

#ahiTool .ahi-panel-title i,
#ahiTool .ahi-result-title i {
    color: #d4af37;
}

#ahiTool .ahi-input-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#ahiTool .ahi-input-item,
#ahiTool .ahi-sleep-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

#ahiTool .ahi-input-item-span {
    grid-column: 1 / -1;
}

#ahiTool .ahi-label-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#ahiTool .ahi-label,
#ahiTool .ahi-mini-note,
#ahiTool .ahi-help,
#ahiTool .ahi-validation-message,
#ahiTool .ahi-note-list,
#ahiTool .ahi-caution-text,
#ahiTool .ahi-scale-note,
#ahiTool .ahi-range-label,
#ahiTool .ahi-summary-label,
#ahiTool .ahi-eyebrow,
#ahiTool .ahi-result-summary,
#ahiTool .ahi-disclaimer,
#ahiTool .ahi-formula-box {
    font-size: 13px;
}

#ahiTool .ahi-label {
    color: #2d2a26;
    font-weight: 600;
}

#ahiTool .ahi-sub-label {
    color: #5f5a56;
}

#ahiTool .ahi-mini-note,
#ahiTool .ahi-help,
#ahiTool .ahi-range-label,
#ahiTool .ahi-scale-note,
#ahiTool .ahi-result-summary,
#ahiTool .ahi-eyebrow,
#ahiTool .ahi-note-list,
#ahiTool .ahi-caution-text,
#ahiTool .ahi-disclaimer {
    color: #5f5a56;
    line-height: 1.6;
}

#ahiTool .ahi-mini-note {
    white-space: nowrap;
}

#ahiTool .ahi-input-with-unit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

#ahiTool .ahi-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #ddd7cb;
    border-radius: 10px;
    background: #fff;
    color: #2d2a26;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#ahiTool .ahi-input::placeholder {
    color: #ada59a;
}

#ahiTool .ahi-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
    background: #fffdf8;
}

#ahiTool .ahi-unit-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #e1d6bf;
    border-radius: 10px;
    background: #f8f1e1;
    color: #6a5c3a;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

#ahiTool .ahi-sleep-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#ahiTool .ahi-action-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

#ahiTool .ahi-action-row .tool-btn {
    width: 100%;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 10px;
}

#ahiTool .ahi-validation-message {
    min-height: 20px;
    margin: 0;
    color: #c05621;
    font-weight: 600;
}

#ahiTool .ahi-note-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

#ahiTool .ahi-result-hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    background: linear-gradient(135deg, #fff8e9 0%, #f6ebd2 100%);
    border-color: #e2d2a7;
}

#ahiTool .ahi-result-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

#ahiTool .ahi-eyebrow {
    margin: 0 0 4px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

#ahiTool .ahi-severity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}

#ahiTool .ahi-severity-badge.pending {
    background: #fffdf8;
    border-color: #ddd7cb;
    color: #6a6258;
}

#ahiTool .ahi-severity-badge.normal {
    background: #edf8ef;
    border-color: #8fca9a;
    color: #21693d;
}

#ahiTool .ahi-severity-badge.mild {
    background: #fff6df;
    border-color: #e3bf63;
    color: #8a6510;
}

#ahiTool .ahi-severity-badge.moderate {
    background: #fff0df;
    border-color: #eda96f;
    color: #a85616;
}

#ahiTool .ahi-severity-badge.severe {
    background: #fde7e4;
    border-color: #ea8d82;
    color: #b32f22;
}

#ahiTool .ahi-value-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

#ahiTool .ahi-value {
    font-size: 52px;
    line-height: 1;
    color: #7b5a0c;
}

#ahiTool .ahi-value-unit {
    color: #5f5a56;
    font-size: 16px;
    font-weight: 700;
    padding-bottom: 7px;
}

#ahiTool .ahi-result-summary,
#ahiTool .ahi-formula-box {
    margin: 0;
}

#ahiTool .ahi-formula-box {
    padding: 12px 14px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    color: #4b453e;
    line-height: 1.6;
}

#ahiTool .ahi-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

#ahiTool .ahi-summary-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
}

#ahiTool .ahi-summary-label {
    color: #5f5a56;
    font-weight: 600;
}

#ahiTool .ahi-summary-value {
    font-size: 20px;
    font-weight: 700;
    color: #1f1c18;
    line-height: 1.35;
}

#ahiTool .ahi-panel-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#ahiTool .ahi-scale-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#ahiTool .ahi-scale-bar {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 2fr 3fr 6fr;
    gap: 0;
    overflow: hidden;
    border-radius: 999px;
    min-height: 42px;
    border: 1px solid #e1d8c7;
}

#ahiTool .ahi-scale-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #2d2a26;
}

#ahiTool .ahi-scale-normal {
    background: #ebf7ee;
}

#ahiTool .ahi-scale-mild {
    background: #fff5da;
}

#ahiTool .ahi-scale-moderate {
    background: #ffe9cf;
}

#ahiTool .ahi-scale-severe {
    background: #fde5e2;
}

#ahiTool .ahi-scale-marker {
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 999px;
    background: #2d2a26;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
    left: 1%;
    transform: translateX(-50%);
}

#ahiTool .ahi-scale-labels {
    display: grid;
    grid-template-columns: 1fr 2fr 3fr 6fr;
    gap: 10px;
    color: #5f5a56;
    font-size: 13px;
    line-height: 1.5;
}

#ahiTool .ahi-table-wrap {
    overflow-x: auto;
}

#ahiTool .ahi-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

#ahiTool .ahi-table th,
#ahiTool .ahi-table td {
    padding: 11px 12px;
    border: 1px solid #ece4d6;
    font-size: 14px;
    line-height: 1.55;
    text-align: left;
    vertical-align: top;
}

#ahiTool .ahi-table thead th {
    background: #f8f3e8;
    color: #2d2a26;
    font-weight: 700;
}

#ahiTool .ahi-table tbody tr.is-active {
    background: #fff7df;
}

#ahiTool .ahi-table tbody tr.is-active th,
#ahiTool .ahi-table tbody tr.is-active td {
    color: #1f1c18;
    font-weight: 600;
}

#ahiTool .ahi-caution-text {
    margin: 0;
}

#ahiTool .ahi-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding: 14px 16px;
    background: #fcfaf5;
}

#ahiTool .ahi-disclaimer i {
    color: #d4af37;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

@media (max-width: 900px) {
    #ahiTool .ahi-main-layout {
        grid-template-columns: 1fr;
    }

    #ahiTool .ahi-input-col {
        position: static;
    }

    #ahiTool .ahi-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    #ahiTool .ahi-input-grid,
    #ahiTool .ahi-sleep-grid,
    #ahiTool .ahi-summary-grid,
    #ahiTool .ahi-action-row {
        grid-template-columns: 1fr;
    }

    #ahiTool .ahi-result-top,
    #ahiTool .ahi-panel-heading-row,
    #ahiTool .ahi-label-group {
        flex-direction: column;
        align-items: flex-start;
    }

    #ahiTool .ahi-value {
        font-size: 44px;
    }

    #ahiTool .ahi-scale-bar,
    #ahiTool .ahi-scale-labels {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    #ahiTool .ahi-scale-segment,
    #ahiTool .ahi-scale-labels {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    #ahiTool .ahi-panel,
    #ahiTool .ahi-result-hero,
    #ahiTool .ahi-summary-card,
    #ahiTool .ahi-disclaimer {
        padding: 14px;
        border-radius: 14px;
    }

    #ahiTool .ahi-value-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    #ahiTool .ahi-value {
        font-size: 38px;
    }

    #ahiTool .ahi-value-unit {
        padding-bottom: 0;
    }

    #ahiTool .ahi-table {
        min-width: 560px;
    }
}
