/**
 * Milestone Birthday Calculator Styles
 * 환갑·칠순·팔순 계산기 전용 스타일
 *
 * @package Zipper
 */

.mbcalc-hidden,
.mbcalc-waiting[hidden],
.mbcalc-mode-panel[hidden] {
    display: none !important;
}

.mbcalc-shell {
    display: grid;
    gap: 18px;
    padding: 24px;
    border: 1px solid #d8d0c3;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(45, 42, 38, 0.04);
}

.mbcalc-shell::before {
    content: none;
}

.mbcalc-intro-card {
    display: grid;
    gap: 12px;
    padding: 0 0 18px;
    border: 0;
    border-bottom: 1px solid #e5ddd1;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.mbcalc-intro-copy {
    display: grid;
    gap: 14px;
    justify-items: center;
    text-align: center;
}

.mbcalc-intro-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #e0d6c7;
    background: #fff;
    color: #8a6500;
    font-size: 13px;
    font-weight: 700;
}

.mbcalc-intro-title {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.mbcalc-intro-title i {
    color: #d4af37;
    font-size: 0.82em;
}

.mbcalc-lead {
    margin: 0;
    max-width: 780px;
    font-size: 15px;
    line-height: 1.75;
    color: #5f5a56;
}

.mbcalc-intro-pill-row,
.mbcalc-intro-highlight {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.mbcalc-highlight-title {
    display: none;
}

.mbcalc-intro-pill,
.mbcalc-highlight-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #e5ddd1;
    background: #fff;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 600;
}

.mbcalc-highlight-item {
    max-width: none;
}

.mbcalc-highlight-item strong,
.mbcalc-highlight-item span {
    display: inline;
    font-size: 13px;
    color: inherit;
    line-height: 1.5;
}

.mbcalc-highlight-item strong::after {
    content: ' · ';
    color: #b8afa0;
}

.mbcalc-layout {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.mbcalc-input-column,
.mbcalc-result-column {
    min-width: 0;
}

.mbcalc-input-column {
    display: grid;
    gap: 14px;
}

.mbcalc-result-column {
    display: grid;
    gap: 16px;
}

.mbcalc-section,
.mbcalc-note-card,
.mbcalc-result-stage {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid #ddd4c7;
    border-radius: 20px;
    background: #fff;
    box-shadow: none;
}

.mbcalc-section-elevated,
.mbcalc-example-section,
.mbcalc-tip-section {
    background: #fffdfa;
}

.mbcalc-section-title,
.mbcalc-range-title,
.mbcalc-milestone-header .mbcalc-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #2d2a26;
}

.mbcalc-section-title i,
.mbcalc-range-title i,
.mbcalc-milestone-header .mbcalc-section-title i {
    color: #d4af37;
}

.mbcalc-basis-help,
.mbcalc-field-hint,
.mbcalc-note-text,
.mbcalc-validation-note,
.mbcalc-age-note,
.mbcalc-side-note,
.mbcalc-milestone-header .mbcalc-field-hint,
.mbcalc-range-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.78;
    color: #6f6964;
}

.mbcalc-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.mbcalc-field-grid-single {
    grid-template-columns: 1fr;
}

.mbcalc-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.mbcalc-label,
.mbcalc-section-subtitle {
    font-size: 13px;
    font-weight: 800;
    color: #5f5a56;
}

.mbcalc-mode-tabs,
.mbcalc-basis-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.mbcalc-mode-tab,
.mbcalc-basis-tab,
.mbcalc-example-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 12px 16px;
    border: 1px solid #ded5c8;
    border-radius: 16px;
    background: #fff;
    color: #5f5a56;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.mbcalc-mode-tab:hover,
.mbcalc-mode-tab:focus,
.mbcalc-basis-tab:hover,
.mbcalc-basis-tab:focus,
.mbcalc-example-btn:hover,
.mbcalc-example-btn:focus {
    outline: none;
    transform: translateY(-1px);
    border-color: #d4af37;
    color: #8a6500;
}

.mbcalc-mode-tab.is-active,
.mbcalc-basis-tab.is-active {
    background: #d8a814;
    border-color: #d8a814;
    color: #fff;
}

.mbcalc-mode-panel {
    display: grid;
    gap: 14px;
}

.mbcalc-range-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid #eadfb8;
    background: #fffaf0;
}

.mbcalc-input,
.mbcalc-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 1px solid #ddd4c7;
    border-radius: 16px;
    background: #fff;
    color: #2d2a26;
    font-size: 15px;
    font-weight: 600;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mbcalc-input:hover,
.mbcalc-select:hover {
    border-color: #d4c67a;
}

.mbcalc-input:focus,
.mbcalc-select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.mbcalc-check-card,
.mbcalc-radio-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid #e5ddd1;
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.mbcalc-check-card:hover,
.mbcalc-radio-card:hover {
    transform: translateY(-1px);
    border-color: #d4af37;
}

.mbcalc-check-card input,
.mbcalc-radio-card input {
    margin-top: 4px;
    flex-shrink: 0;
}

.mbcalc-check-content,
.mbcalc-radio-content {
    display: grid;
    gap: 4px;
}

.mbcalc-check-content strong,
.mbcalc-radio-content strong {
    font-size: 14px;
    color: #2d2a26;
}

.mbcalc-check-content small,
.mbcalc-radio-content small {
    color: #6f6964;
    line-height: 1.55;
}

@supports selector(:has(*)) {
    .mbcalc-check-card:has(input:checked),
    .mbcalc-radio-card:has(input:checked) {
        border-color: #d4af37;
        background: #fff7e1;
    }
}

.mbcalc-radio-grid,
.mbcalc-example-list,
.mbcalc-story-grid {
    display: grid;
    gap: 10px;
}

.mbcalc-example-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mbcalc-example-btn {
    justify-content: flex-start;
    border-radius: 16px;
}

.mbcalc-btn-group {
    display: flex;
    gap: 10px;
}

.mbcalc-btn-group .tool-btn {
    flex: 1 1 0;
    min-height: 54px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 800;
}

#mbcalcCalculateBtn.tool-btn {
    background: #2fad5b;
    border: 1px solid #279a50;
    color: #fff;
    box-shadow: none;
}

#mbcalcCalculateBtn.tool-btn:hover,
#mbcalcCalculateBtn.tool-btn:focus {
    background: #279a50;
}

#mbcalcResetBtn.tool-btn {
    background: #fff;
    border: 1px solid #ddd4c7;
    color: #5f5a56;
}

.mbcalc-tip-list {
    margin: 0;
    padding-left: 20px;
    color: #5f5a56;
    font-size: 14px;
    line-height: 1.8;
}

.mbcalc-intro-pill-row,
.mbcalc-intro-highlight,
.mbcalc-tip-section,
.mbcalc-stage-orbit {
    display: none;
}

.mbcalc-waiting {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 18px 20px;
    border: 1px solid #eadfb8;
    border-radius: 20px;
    background: #fffaf0;
    color: #7a5d18;
}

.mbcalc-waiting i {
    font-size: 20px;
    color: #d4af37;
    margin-top: 2px;
}

.mbcalc-waiting p {
    margin: 0;
    line-height: 1.7;
}

.mbcalc-result-stage {
    gap: 16px;
    padding: 0;
    border: 0;
    background: transparent;
}

.mbcalc-stage-orbit {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.mbcalc-stage-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #e3dbcf;
    background: #fff;
    color: #7a5d18;
    font-size: 12px;
    font-weight: 700;
}

.mbcalc-result-hero {
    display: grid;
    gap: 14px;
    padding: 24px;
    border: 1px solid #ddd4c7;
    border-radius: 20px;
    background: #fff;
}

.mbcalc-result-hero::after {
    content: none;
}

.mbcalc-hero-main,
.mbcalc-hero-side {
    display: grid;
    gap: 12px;
}

.mbcalc-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mbcalc-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.mbcalc-status-badge.is-neutral {
    background: rgba(138, 101, 0, 0.1);
    color: #8a6500;
}

.mbcalc-status-badge.is-valid {
    background: rgba(35, 143, 91, 0.14);
    color: #1b7f4f;
}

.mbcalc-status-badge.is-warning {
    background: rgba(189, 92, 0, 0.14);
    color: #a85300;
}

.mbcalc-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #ddd4c7;
    border-radius: 999px;
    background: #fff;
    color: #8a6500;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.mbcalc-copy-btn:hover,
.mbcalc-copy-btn:focus {
    outline: none;
    transform: translateY(-1px);
    border-color: #d4af37;
}

.mbcalc-hero-label-top,
.mbcalc-hero-label {
    font-size: 14px;
    color: #7a756d;
}

.mbcalc-hero-label {
    color: #8a6500;
    font-weight: 700;
}

.mbcalc-hero-value {
    font-size: clamp(38px, 5vw, 68px);
    line-height: 1.02;
    font-weight: 900;
    color: #2d2a26;
    letter-spacing: -0.05em;
}

.mbcalc-hero-summary {
    margin: 0;
    font-size: 15px;
    line-height: 1.8;
    color: #5f5a56;
}

.mbcalc-formula-box {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #e8dfd2;
    background: #fff;
    font-size: 13px;
    line-height: 1.72;
    color: #5f5a56;
}

.mbcalc-hero-side {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mbcalc-side-card {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid #e5ddd1;
    background: #fff;
}

.mbcalc-side-card--crest {
    display: none;
}

.mbcalc-side-label,
.mbcalc-age-label {
    font-size: 12px;
    font-weight: 800;
    color: #8a857f;
}

.mbcalc-side-value,
.mbcalc-age-value,
.mbcalc-kpi-value {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 800;
    color: #2d2a26;
    letter-spacing: -0.02em;
}

.mbcalc-age-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.mbcalc-age-item {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid #ddd4c7;
    border-radius: 18px;
    background: #fff;
}

.mbcalc-milestone-section {
    display: grid;
    gap: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5ddd1;
}

.mbcalc-milestone-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.mbcalc-kpi-grid {
    display: grid;
    gap: 10px;
}

.mbcalc-kpi-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid #ddd4c7;
    border-radius: 16px;
    background: #fff;
    box-shadow: none;
    transition: border-color 0.2s ease;
}

.mbcalc-kpi-card:hover {
    border-color: #d4af37;
}

.mbcalc-kpi-card--hwangap {
    background: #fff;
    border-left: 4px solid #c8a331;
}

.mbcalc-kpi-card--chilsun {
    background: #fff;
    border-left: 4px solid #5aa0d8;
}

.mbcalc-kpi-card--palsun {
    background: #fff;
    border-left: 4px solid #62ad78;
}

.mbcalc-kpi-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    min-height: auto;
    padding: 0;
    border-radius: 0;
    background: none;
    border: 0;
    color: #6c6455;
    font-size: 12px;
    font-weight: 800;
}

.mbcalc-kpi-ribbon i {
    color: #c19013;
}

.mbcalc-kpi-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.mbcalc-kpi-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(138, 101, 0, 0.08);
    color: #8a6500;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.mbcalc-kpi-chip.is-upcoming {
    background: rgba(35, 143, 91, 0.14);
    color: #1b7f4f;
}

.mbcalc-kpi-chip.is-today {
    background: rgba(212, 175, 55, 0.2);
    color: #8a6500;
}

.mbcalc-kpi-chip.is-past {
    background: rgba(97, 90, 86, 0.12);
    color: #5f5a56;
}

.mbcalc-kpi-chip.is-unavailable {
    background: rgba(189, 92, 0, 0.14);
    color: #a85300;
}

.mbcalc-kpi-meta {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #5f5a56;
}

.mbcalc-compare-section {
    gap: 14px;
    padding: 18px 0 0;
    border: 0;
    border-top: 1px solid #e5ddd1;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.mbcalc-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.mbcalc-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    font-size: 14px;
}

.mbcalc-table th,
.mbcalc-table td {
    padding: 13px 10px;
    border-bottom: 1px solid #eee7db;
    vertical-align: top;
    text-align: left;
    line-height: 1.7;
}

.mbcalc-table thead th {
    font-size: 12px;
    font-weight: 800;
    color: #8a857f;
    background: #faf7f0;
}

.mbcalc-table tbody th {
    color: #2d2a26;
    font-weight: 800;
    white-space: nowrap;
}

.mbcalc-story-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mbcalc-note-card {
    position: relative;
    padding: 14px 0 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.mbcalc-note-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #d4af37;
}

.mbcalc-note-title {
    font-size: 14px;
    font-weight: 800;
    color: #2d2a26;
}

@media (max-width: 1200px) {
    .mbcalc-layout {
        grid-template-columns: 1fr;
    }

    .mbcalc-age-strip,
    .mbcalc-story-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .mbcalc-input,
    .mbcalc-select,
    input[type="date"].mbcalc-input {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .mbcalc-shell {
        padding: 18px;
    }

    .mbcalc-field-grid,
    .mbcalc-mode-tabs,
    .mbcalc-basis-tabs,
    .mbcalc-example-list,
    .mbcalc-age-strip,
    .mbcalc-story-grid {
        grid-template-columns: 1fr;
    }

    .mbcalc-btn-group,
    .mbcalc-kpi-top,
    .mbcalc-hero-top,
    .mbcalc-milestone-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mbcalc-hero-value {
        font-size: 34px;
    }
}

@media (max-width: 480px) {
    .tool-section,
    .tool-layout-split,
    .tool-layout-input,
    .tool-layout-result {
        max-width: 100%;
        overflow-x: hidden;
    }

    .mbcalc-shell,
    .mbcalc-section,
    .mbcalc-note-card,
    .mbcalc-result-stage,
    .mbcalc-result-hero,
    .mbcalc-age-item,
    .mbcalc-kpi-card {
        padding-left: 16px;
        padding-right: 16px;
    }

    .mbcalc-mode-tab,
    .mbcalc-basis-tab,
    .mbcalc-example-btn {
        width: 100%;
    }

    .mbcalc-table {
        min-width: 440px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mbcalc-mode-tab,
    .mbcalc-basis-tab,
    .mbcalc-example-btn,
    .mbcalc-copy-btn,
    .mbcalc-kpi-card,
    .mbcalc-check-card,
    .mbcalc-radio-card,
    .mbcalc-input,
    .mbcalc-select {
        transition: none !important;
    }

    .mbcalc-mode-tab:hover,
    .mbcalc-basis-tab:hover,
    .mbcalc-example-btn:hover,
    .mbcalc-copy-btn:hover,
    .mbcalc-kpi-card:hover,
    .mbcalc-check-card:hover,
    .mbcalc-radio-card:hover {
        transform: none !important;
    }
}
