/**
 * Unified Styles for KO Business Calculators
 * High-contrast, mobile-first design matching KevinOcasio.com design tokens
 */

.ko-calc-wrapper,
.ko-calc-wrapper * {
    box-sizing: border-box;
}

#calculator.ko-calc-wrapper {
    scroll-margin-top: 100px;
}

.ko-calc-wrapper {
    background-color: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 16px;
    padding: 30px 32px;
    margin: 40px auto;
    max-width: 680px;
    box-shadow: 0 10px 30px -4px rgba(11, 19, 41, 0.08), 0 2px 6px -1px rgba(11, 19, 41, 0.04);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #0f172a;
}

/* Header */
.ko-calc-header {
    text-align: center;
    margin-top: 0 !important;
    margin-bottom: 24px !important;
    padding-top: 0 !important;
    padding-bottom: 18px !important;
    border-bottom: 1px solid #cbd5e1;
}

body.single .entry-content .ko-calc-wrapper h3.ko-calc-title,
body:not(.home) .entry-content .ko-calc-wrapper h3.ko-calc-title,
.ko-calc-wrapper h3.ko-calc-title {
    font-size: 26px !important;
    font-weight: 800 !important;
    color: #0b1329 !important;
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.025em !important;
    text-align: center !important;
}

body.single .entry-content .ko-calc-wrapper p.ko-calc-subtitle,
body:not(.home) .entry-content .ko-calc-wrapper p.ko-calc-subtitle,
.ko-calc-wrapper p.ko-calc-subtitle {
    font-size: 17px !important;
    color: #475569 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.6 !important;
    max-width: 580px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    text-wrap: balance !important;
}

/* Card & Inputs */
.ko-calc-card {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.ko-calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
}

.ko-calc-field {
    display: flex;
    flex-direction: column;
}

.ko-field-label-group {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    margin-bottom: 8px;
}

.ko-field-label-group label {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

/* Tooltips */
.ko-tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    line-height: 1;
}

.ko-tip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background-color: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    font-family: inherit;
    line-height: 1;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    transform: translateY(1px);
}

.ko-tooltip-trigger:hover .ko-tip-badge,
.ko-tooltip-trigger:focus .ko-tip-badge,
.ko-tooltip-trigger.is-active .ko-tip-badge {
    background-color: #0b1329;
    color: #ffffff;
    border-color: #0b1329;
    transform: translateY(1px) scale(1.08);
}

.ko-tooltip-box {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background-color: #0b1329;
    color: #f8fafc;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    padding: 12px 14px;
    border-radius: 10px;
    width: max-content;
    max-width: 270px;
    min-width: 180px;
    text-align: left;
    text-wrap: balance;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    box-shadow: 0 12px 28px -4px rgba(11, 19, 41, 0.4), 0 4px 10px -2px rgba(11, 19, 41, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 100;
}

.ko-tooltip-box::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #0b1329 transparent transparent transparent;
}

.ko-tooltip-trigger:hover .ko-tooltip-box,
.ko-tooltip-trigger:focus .ko-tooltip-box,
.ko-tooltip-trigger.is-active .ko-tooltip-box {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Inputs & Select Elements */
.ko-input-affix {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.ko-affix-prefix {
    position: absolute;
    left: 14px;
    font-size: 17px;
    font-weight: 700;
    color: #64748b;
    pointer-events: none;
    z-index: 2;
}

.ko-input-affix input[type="number"],
.ko-input-affix select,
.ko-calc-field select {
    width: 100%;
    height: 52px;
    padding: 10px 14px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    background-color: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    box-sizing: border-box;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    font-family: inherit;
}

.ko-input-affix select,
.ko-calc-field select {
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 36px;
    appearance: none;
    -webkit-appearance: none;
}

.ko-input-affix input[type="number"]::-webkit-outer-spin-button,
.ko-input-affix input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ko-input-affix input[type="number"]#ko-core-price,
.ko-input-affix input[type="number"]#ko-bump-price {
    padding-left: 32px;
}

.ko-input-affix input[type="number"]:focus,
.ko-input-affix select:focus,
.ko-calc-field select:focus {
    outline: none;
    border-color: #0b1329;
    box-shadow: 0 0 0 3.5px rgba(11, 19, 41, 0.12);
    background-color: #ffffff;
}

.ko-input-affix input[type="number"]:hover:not(:focus),
.ko-input-affix select:hover:not(:focus),
.ko-calc-field select:hover:not(:focus) {
    border-color: #94a3b8;
}

.ko-input-affix input[type="number"]::placeholder {
    color: #94a3b8;
    font-size: 17px;
    font-weight: 700;
}

/* Results Panel */
.ko-calc-result-box {
    margin-top: 24px;
    background-color: #ffffff;
    color: #0f172a;
    border-radius: 12px;
    padding: 24px;
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 4px 16px -2px rgba(11, 19, 41, 0.06);
    animation: koSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes koSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ko-result-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: flex-start;
    gap: 16px;
    text-align: center;
}

.ko-result-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.ko-col-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    line-height: 1;
}

.ko-col-val {
    font-size: 28px;
    font-weight: 800;
    color: #0b1329;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.ko-savings-accent {
    color: #16a34a !important;
}

.ko-plus-accent {
    color: #0b1329;
    font-weight: 800;
}

.ko-col-sub {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.2;
}

.ko-col-divider {
    width: 1px;
    align-self: stretch;
    background-color: #e2e8f0;
    margin: 2px 0 4px 0;
}

/* Hero Result Panel for Savings Calculator */
.ko-hero-result-box {
    text-align: center;
    padding: 26px 20px 22px;
}

.ko-hero-result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ko-hero-savings-badge {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    line-height: 1;
}

.ko-hero-savings-val {
    font-size: 42px;
    font-weight: 800;
    color: #16a34a;
    line-height: 1.05;
    letter-spacing: -0.03em;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}

.ko-hero-savings-val #ko-total-savings {
    color: #16a34a;
    font-weight: 800;
}

.ko-hero-savings-val .ko-plus-accent {
    color: #0b1329;
    font-weight: 800;
}

.ko-hero-year-unit {
    font-size: 19px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: -0.01em;
}

.ko-hero-contrast-strip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 14px;
    padding: 9px 18px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    font-size: 14px;
    color: #334155;
    font-weight: 500;
}

.ko-contrast-item strong {
    color: #0f172a;
    font-weight: 700;
}

.ko-contrast-arrow {
    color: #94a3b8;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.ko-hero-tier-tag {
    display: inline-block;
    background-color: #e2e8f0;
    color: #0f172a;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    margin-left: 3px;
    line-height: 1.3;
}

/* Commercial CTA Button in Results */
.ko-calc-cta-wrap {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ko-hero-result-box .ko-calc-cta-wrap {
    border-top: none;
    margin-top: 20px;
    padding-top: 0;
}

body .entry-content a.ko-calc-cta-btn,
body:not(.home) .entry-content a.ko-calc-cta-btn,
.ko-calc-cta-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #e11d48 !important;
    color: #ffffff !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    padding: 14px 28px !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px -1px rgba(225, 29, 72, 0.35) !important;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
    letter-spacing: -0.01em !important;
}

body .entry-content a.ko-calc-cta-btn:hover,
body:not(.home) .entry-content a.ko-calc-cta-btn:hover,
body .entry-content a.ko-calc-cta-btn:focus,
body:not(.home) .entry-content a.ko-calc-cta-btn:focus,
.ko-calc-cta-btn:hover,
.ko-calc-cta-btn:focus {
    background-color: #be123c !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px -1px rgba(225, 29, 72, 0.45) !important;
}

.ko-calc-cta-sub {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

/* Embed Drawer */
.ko-calc-embed-wrap {
    margin-top: 18px;
    text-align: center;
}

body.single .entry-content .ko-calc-wrapper button.ko-calc-embed-toggle-btn,
body:not(.home) .entry-content .ko-calc-wrapper button.ko-calc-embed-toggle-btn,
.ko-calc-embed-toggle-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 8px 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    color: #64748b !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: color 0.18s ease !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
}

.ko-calc-embed-toggle-btn svg {
    stroke: #64748b !important;
    transition: stroke 0.18s ease !important;
}

.ko-calc-embed-toggle-btn:hover,
.ko-calc-embed-toggle-btn:focus {
    color: #0b1329 !important;
    text-decoration: underline !important;
}

.ko-calc-embed-toggle-btn:hover svg,
.ko-calc-embed-toggle-btn:focus svg {
    stroke: #0b1329 !important;
}

.ko-calc-embed-drawer {
    margin-top: 14px;
    text-align: left;
    animation: koSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.ko-embed-drawer-card {
    background-color: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 24px 26px;
    box-shadow: 0 4px 16px -2px rgba(11, 19, 41, 0.06);
}

.ko-embed-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ko-embed-drawer-title {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #0b1329 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.015em !important;
}

.ko-embed-close-btn {
    background: transparent !important;
    border: none !important;
    font-size: 24px !important;
    line-height: 1 !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    transition: color 0.18s ease, background-color 0.18s ease !important;
}

.ko-embed-close-btn:hover {
    color: #0b1329 !important;
    background-color: #f1f5f9 !important;
}

p.ko-embed-pitch {
    font-size: 17px !important;
    color: #475569 !important;
    line-height: 1.6 !important;
    margin: 0 0 18px 0 !important;
}

.ko-embed-code-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ko-embed-code-label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.ko-embed-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ko-embed-code-input {
    flex: 1;
    height: 48px !important;
    padding: 10px 14px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
    background-color: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}

.ko-embed-copy-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    height: 48px !important;
    width: 130px !important;
    background-color: #0b1329 !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    padding: 0 !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    transition: all 0.18s ease !important;
}

.ko-embed-copy-btn svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0 !important;
    stroke: #ffffff !important;
    display: inline-block !important;
}

.ko-embed-copy-btn:hover {
    background-color: #1e293b !important;
    transform: translateY(-1px) !important;
}

.ko-embed-copy-btn:active {
    transform: translateY(0) !important;
}

.ko-embed-copy-btn.ko-btn-copied {
    background-color: #0b1329 !important;
    color: #ffffff !important;
}

.ko-calc-embed-credit {
    font-size: 12px !important;
    text-align: center !important;
    margin-top: 18px !important;
    color: #94a3b8 !important;
}

.ko-calc-embed-credit a {
    color: #94a3b8 !important;
    text-decoration: none !important;
}

.ko-calc-embed-credit a:hover {
    color: #0b1329 !important;
    text-decoration: underline !important;
}

/* Mobile Responsive */
@media (max-width: 620px) {
    .ko-calc-wrapper {
        padding: 22px 18px;
    }
    .ko-calc-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    body.single .entry-content .ko-calc-wrapper h3.ko-calc-title,
    body:not(.home) .entry-content .ko-calc-wrapper h3.ko-calc-title,
    .ko-calc-wrapper h3.ko-calc-title {
        font-size: 22px !important;
    }
    .ko-result-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .ko-col-divider {
        width: 100%;
        height: 1px;
        margin: 0;
    }
    .ko-col-val {
        font-size: 26px;
    }
    .ko-hero-savings-val {
        font-size: 34px;
    }
    .ko-hero-year-unit {
        font-size: 16px;
    }
    .ko-hero-contrast-strip {
        border-radius: 10px;
        padding: 9px 12px;
        font-size: 13px;
        gap: 6px 8px;
    }
    .ko-embed-input-row {
        flex-direction: column;
        align-items: stretch;
    }
    .ko-embed-code-input,
    .ko-embed-copy-btn {
        width: 100% !important;
    }
}
