/**
 * drsoft-store - VIGI 저장 용량 계산기
 * 쇼핑몰 공통 토큰은 mall.css의 --ml-* 변수를 사용한다.
 */

.ml-tool {
    background: #fff;
    color: var(--ml-ink);
    font-family: var(--ml-font);
    word-break: keep-all;
}

.ml-tool *,
.ml-tool *::before,
.ml-tool *::after {
    box-sizing: border-box;
}

.ml-tool [hidden] {
    display: none !important;
}

.ml-tool__wrap {
    padding-top: 18px;
    padding-bottom: 72px;
}

.ml-tool__crumb {
    margin-bottom: 24px;
}

.ml-tool__crumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #6b6b6b;
    font-size: 12px;
}

.ml-tool__crumb-list li + li::before {
    content: '›';
    margin-right: 6px;
    color: #aaa;
}

.ml-tool__crumb-list a {
    color: #666;
    text-decoration: none;
}

.ml-tool__crumb-list a:hover {
    text-decoration: underline;
}

.ml-tool__crumb-list a:focus-visible,
.ml-tool__tab:focus-visible,
.ml-tool__reset:focus-visible,
.ml-tool__segment input:focus-visible + span,
.ml-tool__field input:focus-visible,
.ml-tool__field select:focus-visible,
.ml-tool__primary:focus-visible,
.ml-tool__secondary:focus-visible,
.ml-tool__formula summary:focus-visible {
    outline: 2px solid var(--ml-blue);
    outline-offset: 2px;
}

.ml-tool__header {
    max-width: 900px;
    margin-bottom: 30px;
}

.ml-tool__eyebrow,
.ml-tool__step {
    margin: 0 0 7px;
    color: var(--ml-blue-d);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .02em;
}

.ml-tool__header h1 {
    margin: 0;
    color: #111;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.3;
}

.ml-tool__header > p:last-child {
    max-width: 820px;
    margin: 12px 0 0;
    color: #555;
    font-size: 16px;
    line-height: 1.75;
}

.ml-tool__tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(620px, 100%);
    margin: 0 0 22px;
    padding: 4px;
    border: 1px solid var(--ml-line);
    border-radius: 10px;
    background: var(--ml-tile);
}

.ml-tool__tab {
    min-height: 48px;
    padding: 8px 16px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #555;
    font: 700 15px/1.35 var(--ml-font);
    cursor: pointer;
}

.ml-tool__tab:hover {
    color: #111;
}

.ml-tool__tab.is-active {
    background: var(--ml-ink);
    color: #fff;
}

.ml-tool__layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(330px, 2fr);
    align-items: start;
    gap: 24px;
}

.ml-tool__input-card,
.ml-tool__result-card {
    min-width: 0;
    border: 1px solid var(--ml-line);
    border-radius: 12px;
}

.ml-tool__input-card {
    padding: 30px;
    background: #fff;
}

.ml-tool__card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ml-line);
}

.ml-tool__card-head h2,
.ml-tool__result-card h2 {
    margin: 0;
    color: #111;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.35;
}

.ml-tool__reset {
    flex: 0 0 auto;
    min-width: 72px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font: 700 13px var(--ml-font);
    cursor: pointer;
}

.ml-tool__reset:hover {
    border-color: #333;
}

.ml-tool__form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 20px;
}

.ml-tool__field,
.ml-tool__mode-panel {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.ml-tool__field--wide,
.ml-tool__basis-panel {
    grid-column: 1 / -1;
}

.ml-tool__basis-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 20px;
    padding: 22px;
    border: 1px solid #ededed;
    border-radius: 10px;
    background: var(--ml-tile);
}

.ml-tool__basis-panel > .ml-tool__field:first-child:last-child {
    grid-column: 1 / -1;
}

.ml-tool__field > label,
.ml-tool__field > legend {
    display: block;
    width: 100%;
    margin: 0 0 9px;
    padding: 0;
    color: #222;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
}

.ml-tool__field input[type='number'],
.ml-tool__field select {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 13px;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    background-color: #fff;
    color: #222;
    font: 500 15px var(--ml-font);
}

.ml-tool__field select {
    padding-right: 36px;
    cursor: pointer;
}

.ml-tool__field input[type='number']:hover,
.ml-tool__field select:hover {
    border-color: #999;
}

.ml-tool__field input[type='number']:focus,
.ml-tool__field select:focus {
    border-color: var(--ml-blue-d);
    outline: 0;
}

.ml-tool__field input[aria-invalid='true'] {
    border-color: var(--ml-red);
}

.ml-tool__segments {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ml-tool__segments--compact {
    gap: 6px;
}

.ml-tool__segment {
    position: relative;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.ml-tool__segment input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.ml-tool__segment span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 8px 12px;
    border: 1px solid #d4d4d4;
    border-radius: 7px;
    background: #fff;
    color: #444;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

.ml-tool__segment:hover span {
    border-color: #777;
}

.ml-tool__segment input:checked + span {
    border-color: var(--ml-blue-d);
    background: #eef6ff;
    color: #0d4f97;
    box-shadow: 0 0 0 1px var(--ml-blue-d) inset;
}

.ml-tool__segment input:disabled + span {
    border-color: #e3e3e3;
    background: #f1f1f1;
    color: #9a9a9a;
    cursor: not-allowed;
}

.ml-tool__segment:has(input:disabled) {
    cursor: not-allowed;
}

.ml-tool__help,
.ml-tool__error {
    margin: 7px 0 0;
    font-size: 12px;
    line-height: 1.55;
}

.ml-tool__help {
    color: #6b6b6b;
}

.ml-tool__error {
    min-height: 19px;
    color: #c62828;
    font-weight: 600;
}

.ml-tool__control-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 8px;
}

.ml-tool__control-row--select {
    grid-template-columns: minmax(0, 1fr) 94px;
}

.ml-tool__suffix {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background: #f5f5f5;
    color: #555;
    font-size: 14px;
    font-weight: 700;
}

.ml-tool__result-card {
    position: sticky;
    top: 18px;
    padding: 30px;
    background: var(--ml-tile);
}

.ml-tool__result-number {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin: 25px 0 7px;
    padding: 12px 0;
    color: #111;
    line-height: 1;
}

.ml-tool__result-number strong {
    font-size: clamp(50px, 4.2vw, 64px);
    font-weight: 800;
    letter-spacing: -.055em;
}

.ml-tool__result-number span {
    color: #333;
    font-size: 24px;
    font-weight: 800;
}

.ml-tool__result-number.is-updated {
    animation: ml-tool-result-pulse .34s ease-out;
}

.ml-tool__result-status {
    min-height: 23px;
    margin: 0 0 21px;
    color: #666;
    font-size: 13px;
    line-height: 1.6;
}

.ml-tool__capacity-extra {
    margin: 0 0 22px;
}

.ml-tool__reserve {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 13px 14px;
    border: 1px solid #cfe2f6;
    border-radius: 8px;
    background: #eef6ff;
    color: #234a73;
    font-size: 13px;
}

.ml-tool__reserve strong {
    color: #0d4f97;
    font-size: 17px;
}

.ml-tool__recommend {
    margin-top: 10px;
    padding: 15px;
    border: 1px solid #dedede;
    border-radius: 8px;
    background: #fff;
}

.ml-tool__recommend > span,
.ml-tool__recommend > strong,
.ml-tool__recommend > small {
    display: block;
}

.ml-tool__recommend > span {
    margin-bottom: 4px;
    color: #666;
    font-size: 12px;
    font-weight: 700;
}

.ml-tool__recommend > strong {
    color: var(--ml-red);
    font-size: 20px;
    font-weight: 800;
}

.ml-tool__recommend > small {
    margin-top: 7px;
    color: #777;
    font-size: 11px;
    line-height: 1.55;
}

.ml-tool__summary {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #dedede;
}

.ml-tool__summary h3 {
    margin: 0 0 12px;
    color: #222;
    font-size: 14px;
    font-weight: 800;
}

.ml-tool__summary dl {
    margin: 0;
}

.ml-tool__summary dl > div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    padding: 6px 0;
    font-size: 13px;
    line-height: 1.45;
}

.ml-tool__summary dt {
    color: #777;
    font-weight: 500;
}

.ml-tool__summary dd {
    min-width: 0;
    margin: 0;
    color: #222;
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}

.ml-tool__notice {
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid #dedede;
    color: #6b6b6b;
    font-size: 12px;
    line-height: 1.65;
}

.ml-tool__actions {
    display: grid;
    gap: 9px;
    margin-top: 20px;
}

.ml-tool__primary,
.ml-tool__secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}

.ml-tool a.ml-tool__primary {
    border: 1px solid var(--ml-blue-d);
    background: var(--ml-blue-d);
    color: #fff;
}

.ml-tool a.ml-tool__primary:hover {
    border-color: #0d47a1;
    background: #0d47a1;
    color: #fff;
    text-decoration: none;
}

.ml-tool a.ml-tool__secondary {
    border: 1px solid #bdbdbd;
    background: #fff;
    color: #222;
}

.ml-tool a.ml-tool__secondary:hover {
    border-color: #333;
    color: #111;
    text-decoration: none;
}

.ml-tool__formula {
    margin-top: 28px;
    border: 1px solid var(--ml-line);
    border-radius: 10px;
    background: #fff;
}

.ml-tool__formula summary {
    position: relative;
    min-height: 56px;
    padding: 17px 50px 17px 20px;
    color: #222;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.ml-tool__formula summary::-webkit-details-marker {
    display: none;
}

.ml-tool__formula summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    color: #555;
    font-size: 22px;
    font-weight: 400;
    transform: translateY(-50%);
}

.ml-tool__formula[open] summary::after {
    content: '−';
}

.ml-tool__formula-body {
    padding: 22px 20px 24px;
    border-top: 1px solid var(--ml-line);
}

.ml-tool__formula-body h2 {
    margin: 0 0 14px;
    color: #222;
    font-size: 20px;
    font-weight: 800;
}

.ml-tool__formula-body p {
    margin: 9px 0 0;
    color: #555;
    font-size: 14px;
    line-height: 1.75;
}

.ml-tool__formula-note {
    padding: 12px 14px;
    border-left: 3px solid var(--ml-blue);
    background: #f4f8fd;
}

@keyframes ml-tool-result-pulse {
    0% { background-color: #dcecff; }
    100% { background-color: transparent; }
}

@media (max-width: 900px) {
    .ml-tool__layout {
        grid-template-columns: 1fr;
    }

    .ml-tool__result-card {
        position: static;
    }
}

@media (max-width: 640px) {
    .ml-tool__wrap {
        padding-top: 14px;
        padding-bottom: 48px;
    }

    .ml-tool__crumb {
        margin-bottom: 18px;
    }

    .ml-tool__header {
        margin-bottom: 22px;
    }

    .ml-tool__header h1 {
        font-size: 27px;
    }

    .ml-tool__header > p:last-child {
        font-size: 14px;
        line-height: 1.7;
    }

    .ml-tool__tabs {
        width: 100%;
        margin-bottom: 14px;
    }

    .ml-tool__tab {
        min-height: 48px;
        padding: 7px 9px;
        font-size: 13px;
    }

    .ml-tool__layout {
        gap: 14px;
    }

    .ml-tool__input-card,
    .ml-tool__result-card {
        padding: 20px 16px;
        border-radius: 10px;
    }

    .ml-tool__card-head {
        align-items: center;
        margin-bottom: 22px;
        padding-bottom: 16px;
    }

    .ml-tool__card-head h2,
    .ml-tool__result-card h2 {
        font-size: 20px;
    }

    .ml-tool__reset {
        min-height: 44px;
    }

    .ml-tool__form,
    .ml-tool__basis-panel {
        grid-template-columns: 1fr;
    }

    .ml-tool__form {
        gap: 20px;
    }

    .ml-tool__basis-panel {
        gap: 20px;
        padding: 16px 12px;
    }

    .ml-tool__segment span,
    .ml-tool__field input[type='number'],
    .ml-tool__field select,
    .ml-tool__suffix {
        min-height: 48px;
    }

    .ml-tool__result-number {
        margin-top: 18px;
    }

    .ml-tool__result-number strong {
        font-size: 42px;
    }

    .ml-tool__result-number span {
        font-size: 20px;
    }

    .ml-tool__summary dl > div {
        grid-template-columns: 105px minmax(0, 1fr);
    }

    .ml-tool__primary,
    .ml-tool__secondary {
        min-height: 50px;
    }

    .ml-tool__formula {
        margin-top: 16px;
    }
}

@media (max-width: 390px) {
    .ml-tool__segments {
        gap: 6px;
    }

    .ml-tool__segment span {
        padding-right: 7px;
        padding-left: 7px;
        font-size: 12px;
    }

    .ml-tool__control-row--select {
        grid-template-columns: minmax(0, 1fr) 82px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ml-tool__result-number.is-updated {
        animation: none;
    }
}
