/* 방깎 효율 시뮬레이터 · 2026-10-09 UI
   Scope styles to this tool; model arithmetic lives in defense_sim.js. */
body.defense-efficiency-page {
    color: #0f172a;
    background:
        radial-gradient(circle at 15% 0%, rgba(196,181,253,.22), transparent 32rem),
        linear-gradient(180deg, #fbfaff 0%, #f8fafc 100%);
}
body.defense-efficiency-page .page-wrapper { min-height: 100vh; padding-top: 77px; }
body.defense-efficiency-page .container {
    width: min(calc(100% - 28px), 1050px);
    max-width: 1050px;
    margin-inline: auto;
}
body.defense-efficiency-page .page-header {
    max-width: 780px;
    margin: 0 auto 17px;
    padding: 17px 5px 4px;
    text-align: center;
}
body.defense-efficiency-page .page-title {
    margin: 0 0 10px;
    color: #312e81;
    font-size: clamp(1.75rem, 4.5vw, 2.45rem);
    font-weight: 900;
    line-height: 1.23;
    letter-spacing: -.045em;
}
body.defense-efficiency-page .page-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}
.defense-model-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #64748b;
    font-size: 12px;
    line-height: 1.6;
}
.defense-model-hint > span:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #f5f3ff;
    color: #7c3aed;
    font-weight: 900;
}
.defense-model-hint strong { color: #475569; font-weight: 800; }
.defense-model-hint a {
    margin-left: auto;
    color: #6d28d9;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.sim-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}
body.defense-efficiency-page .input-card,
body.defense-efficiency-page .result-card {
    min-width: 0;
    padding: clamp(16px, 2.3vw, 23px);
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 7px 24px rgba(76,29,149,.045);
}
body.defense-efficiency-page .result-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 13px;
}
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 17px;
}
.section-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #7c3aed;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
}
body.defense-efficiency-page .section-title {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    color: #312e81;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -.035em;
}
.defense-reset-button {
    min-height: 35px;
    padding: 7px 11px;
    border: 1px solid #ddd6fe;
    border-radius: 9px;
    background: #fff;
    color: #6d28d9;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}
.defense-reset-button:hover { background: #f5f3ff; }
body.defense-efficiency-page .control-group {
    margin-bottom: 19px;
    padding-bottom: 17px;
    border-bottom: 1px solid #f1f5f9;
}
.defense-control-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    margin-bottom: 13px;
}
body.defense-efficiency-page .control-label {
    display: block;
    margin: 0;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}
.defense-number-wrap {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 115px;
    padding: 0 9px 0 0;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
}
body.defense-efficiency-page .defense-number {
    width: 78px;
    min-height: 43px;
    padding: 8px 5px 8px 10px;
    border: 0;
    border-radius: 10px;
    outline: none;
    background: transparent;
    color: #1e293b;
    font-family: inherit;
    font-size: 17px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.defense-number-suffix {
    margin-left: 4px;
    color: #64748b;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
}
.defense-number-wrap:focus-within {
    border-color: #8b5cf6;
    outline: 3px solid rgba(139,92,246,.13);
}
body.defense-efficiency-page .defense-number[aria-invalid="true"] {
    color: #b91c1c;
}
.defense-number-wrap:has(.defense-number[aria-invalid="true"]) {
    border-color: #dc2626;
}
body.defense-efficiency-page input[type="range"] {
    display: block;
    width: 100%;
    height: 8px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(to right, #7c3aed 0%, #7c3aed var(--range-progress, 0%), #e2e8f0 var(--range-progress, 0%), #e2e8f0 100%);
    border-radius: 999px;
    cursor: pointer;
}
body.defense-efficiency-page input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #7c3aed;
    box-shadow: 0 2px 9px rgba(109,40,217,.3);
}
body.defense-efficiency-page input[type="range"]::-moz-range-thumb {
    width: 17px;
    height: 17px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #7c3aed;
    box-shadow: 0 2px 9px rgba(109,40,217,.3);
}
.defense-range-labels,
.defense-chart-axis {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}
.defense-input-help,
.defense-chart-note {
    margin: 10px 0 8px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.55;
}
.defense-presets {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.defense-preset-caption {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    margin-right: 2px;
}
.defense-presets button {
    min-height: 35px;
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
    color: #475569;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}
.defense-presets button:hover {
    border-color: #a78bfa;
    background: #faf5ff;
    color: #6d28d9;
}
.defense-presets button.is-active,
.defense-presets button[aria-pressed="true"] {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #a78bfa;
}
.defense-chart-section { margin-top: 2px; }
.defense-chart-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 7px;
    font-size: 12px;
    color: #334155;
}
.defense-chart-heading strong { font-weight: 850; }
.defense-chart-heading span {
    padding: 4px 8px;
    border-radius: 7px;
    background: #f5f3ff;
    color: #6d28d9;
    font-size: 11px;
    font-weight: 800;
}
.efficiency-meter {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 138px;
    margin: 11px 0 0;
    padding: 15px 12px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 11px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    overflow: hidden;
}
.meter-bar {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 3px 3px 0 0;
    background: #c4b5fd;
    transition: height .15s ease, background .15s ease;
}
.meter-bar.active { background: #7c3aed; }
.meter-current-marker {
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    left: 15%;
    width: 2px;
    background: #db2777;
    pointer-events: none;
    opacity: .8;
    transition: left .12s ease;
}
.defense-chart-axis { margin-top: 7px; }
.defense-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 13px;
    margin-top: 10px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
}
.defense-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.defense-legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}
.defense-legend-swatch.is-current { background: #7c3aed; }
.defense-legend-swatch.is-future { background: #c4b5fd; }
.defense-chart-note { margin: 9px 0 0; }
.score-display {
    padding: 16px 13px;
    border: 1px solid #ede9fe;
    border-radius: 13px;
    background: #f8f7ff;
    text-align: center;
}
.def-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 7px;
    color: #fff;
    font-size: 11px;
    font-weight: 850;
}
.def-badge.badge-bad { background: #b91c1c; }
.def-badge.badge-ok { background: #b45309; }
.def-badge.badge-good { background: #047857; }
.def-badge.badge-best { background: #6d28d9; }
.defense-score-label {
    margin-top: 12px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}
.defense-score-number { margin-top: 2px; line-height: 1.16; }
.score-val {
    color: #5b21b6;
    font-size: clamp(40px, 6vw, 50px);
    font-weight: 950;
    letter-spacing: -.06em;
    font-variant-numeric: tabular-nums;
}
.score-unit {
    margin-left: 4px;
    color: #7c3aed;
    font-size: 17px;
    font-weight: 800;
}
.score-desc {
    margin-top: 9px;
    color: #475569;
    font-size: 12px;
    line-height: 1.55;
}
.score-desc strong { color: #be185d; font-weight: 900; }
.defense-comparison {
    display: grid;
    grid-template-columns: minmax(0,1fr) 20px minmax(0,1fr);
    gap: 7px;
    align-items: center;
}
.defense-compare-cell {
    min-width: 0;
    padding: 13px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}
.defense-compare-cell span {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 650;
}
.defense-compare-cell strong {
    color: #334155;
    font-size: 19px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}
.defense-compare-cell:last-child {
    border-color: #ddd6fe;
    background: #faf5ff;
}
.defense-compare-cell:last-child strong { color: #6d28d9; }
.defense-compare-arrow { color: #94a3b8; font-size: 18px; text-align: center; }
.defense-relative-gain {
    margin: -3px 0 0;
    padding: 10px 12px;
    border-radius: 9px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.55;
}
.defense-detail-list {
    display: grid;
    gap: 0;
    border-top: 1px solid #e2e8f0;
}
.defense-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 11px 1px;
    border-bottom: 1px solid #f1f5f9;
    color: #64748b;
    font-size: 12px;
}
.defense-detail-row strong {
    color: #334155;
    font-size: 14px;
    font-weight: 850;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.tips-card {
    padding: 13px 15px;
    border-left: 3px solid #a78bfa;
    border-radius: 9px;
    background: #faf5ff;
}
.tips-title { margin-bottom: 5px; color: #5b21b6; font-size: 12px; font-weight: 850; }
.tips-content { color: #475569; font-size: 12px; line-height: 1.65; }
.defense-formula-details {
    margin-top: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #fff;
}
.defense-formula-details > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 17px;
    list-style: none;
    cursor: pointer;
}
.defense-formula-details > summary::-webkit-details-marker { display: none; }
.defense-formula-details summary strong { display: block; color: #334155; font-size: 13px; font-weight: 850; }
.defense-formula-details summary small { display: block; margin-top: 3px; color: #64748b; font-size: 11px; }
.defense-disclosure-arrow { color: #64748b; font-size: 22px; transition: transform .15s ease; }
.defense-formula-details[open] .defense-disclosure-arrow { transform: rotate(180deg); }
.defense-formula-body { padding: 0 17px 17px; color: #475569; font-size: 13px; line-height: 1.75; }
.defense-formula-body .data-status { font-size: 12px; line-height: 1.6; }
.defense-formula-body p { margin: 12px 0; }
.defense-formula-body ul { margin: 10px 0 12px; padding-left: 20px; }
.defense-formula-body li { margin: 5px 0; }
.defense-formula-body code { padding: 2px 4px; border-radius: 4px; background: #f1f5f9; color: #334155; }
body.defense-efficiency-page button:focus-visible,
body.defense-efficiency-page input:focus-visible,
.defense-formula-details summary:focus-visible {
    outline: 3px solid #a78bfa;
    outline-offset: 3px;
}

@media (max-width: 780px) {
    .sim-grid { grid-template-columns: 1fr; gap: 13px; }
    body.defense-efficiency-page .page-wrapper { padding-top: 72px; }
    body.defense-efficiency-page .container { width: min(calc(100% - 18px), 1050px); }
    body.defense-efficiency-page .page-header { padding: 14px 4px 5px; }
    body.defense-efficiency-page .input-card,
    body.defense-efficiency-page .result-card { padding: 15px; border-radius: 14px; }
    .efficiency-meter { height: 125px; }
    .defense-formula-details { margin-top: 13px; }
}
@media (max-width: 420px) {
    body.defense-efficiency-page .page-title { font-size: clamp(1.54rem, 6.1vw, 1.82rem); }
    body.defense-efficiency-page .page-subtitle { font-size: 12px; }
    .defense-model-hint { padding: 10px 12px; font-size: 11px; }
    .defense-model-hint a { margin-left: 0; }
    .section-heading { gap: 7px; }
    body.defense-efficiency-page .section-title { font-size: 16px; }
    .defense-number-wrap { min-width: 100px; }
    body.defense-efficiency-page .defense-number { width: 66px; font-size: 16px; }
    .defense-presets button { min-height: 37px; }
    .defense-compare-cell { padding: 10px; }
    .defense-compare-cell strong { font-size: 17px; }
    .defense-detail-row { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    .meter-bar,
    .meter-current-marker,
    .defense-disclosure-arrow { transition: none; }
}
