#tool-baby-kaup-index-calculator {
    --bki-bg: #faf9f7;
    --bki-surface: #ffffff;
    --bki-border: #e8e4dc;
    --bki-text: #2d2a26;
    --bki-muted: #5f5a56;
    --bki-accent: #b8860b;
    --bki-accent-light: #fbf7eb;
    --bki-accent-mid: #eadfb8;
    --bki-warn: #c77700;
    --bki-danger: #b24b3f;
    --bki-good: #5f8f52;
    --bki-mono: 'Courier New', Courier, monospace;
    --bki-sans: Helvetica, Arial, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
    --bki-radius: 10px;
    --bki-shadow: 0 1px 4px rgba(45, 42, 38, 0.06), 0 0 0 1px rgba(45, 42, 38, 0.04);
    font-family: var(--bki-sans);
    color: var(--bki-text);
}

#tool-baby-kaup-index-calculator * {
    box-sizing: border-box;
}

.bki-tool {
    display: grid;
    gap: 0;
    min-width: 0;
}

.bki-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.bki-title-block {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.bki-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--bki-accent-light);
    color: var(--bki-accent);
    border: 1px solid var(--bki-accent-mid);
    flex: 0 0 auto;
}

.bki-title-block h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.bki-title-block p {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--bki-muted);
}

.bki-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid var(--bki-border);
    background: #fffdf8;
    color: #6f5420;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.bki-main-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.bki-panel {
    min-width: 0;
    background: var(--bki-surface);
    border: 1px solid var(--bki-border);
    border-radius: var(--bki-radius);
    box-shadow: var(--bki-shadow);
}

.bki-input-panel {
    padding: 14px;
    overflow: hidden;
}

.bki-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.bki-eyebrow {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bki-accent);
}

.bki-panel-head h3 {
    margin: 0;
    font-size: 16px;
    letter-spacing: -0.02em;
}

.bki-panel-note {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--bki-bg);
    color: var(--bki-muted);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.bki-input-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
}

.bki-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.bki-field label {
    font-size: 13px;
    font-weight: 700;
    color: var(--bki-text);
}

.bki-input-box {
    position: relative;
    min-width: 0;
}

.bki-input-box input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 44px 0 12px;
    border: 1px solid var(--bki-border);
    border-radius: 9px;
    background: #fff;
    color: var(--bki-text);
    font-family: var(--bki-mono);
    font-size: 15px;
    font-weight: 700;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.bki-input-box input:hover {
    border-color: #d4c67a;
}

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

.bki-input-box input::placeholder {
    color: #c4c0bc;
    font-weight: 400;
}

.bki-unit {
    position: absolute;
    top: 50%;
    right: 11px;
    transform: translateY(-50%);
    color: var(--bki-muted);
    font-size: 12px;
    font-weight: 800;
    pointer-events: none;
}

.bki-helper-card {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 10px;
    padding: 10px;
    border-radius: 9px;
    background: var(--bki-accent-light);
    border: 1px solid var(--bki-accent-mid);
    color: #6f5420;
}

.bki-helper-card i {
    margin-top: 1px;
    color: var(--bki-accent);
    flex: 0 0 auto;
}

.bki-helper-card p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.bki-sample-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.bki-sample-label {
    color: var(--bki-muted);
    font-size: 12px;
    font-weight: 800;
}

.bki-sample-btn,
.bki-reset-btn {
    border: 1px solid var(--bki-border);
    border-radius: 999px;
    background: #fff;
    color: var(--bki-text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.bki-sample-btn {
    padding: 6px 8px;
}

.bki-sample-btn:hover,
.bki-reset-btn:hover {
    border-color: #d4af37;
    background: #fffaf0;
    transform: translateY(-1px);
}

.bki-reset-btn {
    width: 100%;
    margin-top: 10px;
    padding: 9px 10px;
}

.bki-validation {
    min-height: 18px;
    margin: 8px 0 0;
    color: var(--bki-danger);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.bki-result-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.bki-waiting {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fffdf8;
    border: 1px dashed var(--bki-accent-mid);
}

.bki-hidden {
    display: none !important;
}

.bki-waiting-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--bki-accent-light);
    color: var(--bki-accent);
    flex: 0 0 auto;
}

.bki-waiting-title {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
}

.bki-waiting-desc {
    margin: 1px 0 0;
    color: var(--bki-muted);
    font-size: 12px;
    line-height: 1.4;
}

.bki-result-stack {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.bki-main-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--bki-accent-mid);
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    box-shadow: 0 8px 20px rgba(184, 134, 11, 0.12);
}

.bki-main-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.bki-main-label {
    color: #6f5420;
    font-size: 12px;
    font-weight: 800;
}

.bki-main-value {
    font-family: var(--bki-mono);
    font-size: clamp(36px, 7vw, 56px);
    line-height: 0.95;
    font-weight: 800;
    letter-spacing: -0.06em;
    color: var(--bki-text);
}

.bki-main-value small {
    margin-left: 5px;
    font-family: var(--bki-sans);
    font-size: 14px;
    letter-spacing: 0;
    color: var(--bki-muted);
}

.bki-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid var(--bki-accent-mid);
    background: #fff;
    color: #6f5420;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.bki-status-badge.is-low {
    border-color: #e6c79d;
    color: #9a5b00;
    background: #fff7ec;
}

.bki-status-badge.is-high {
    border-color: #e4b2ac;
    color: var(--bki-danger);
    background: #fff4f2;
}

.bki-main-meta {
    color: var(--bki-muted);
    font-size: 13px;
    line-height: 1.45;
}

.bki-scale-card {
    display: grid;
    gap: 8px;
}

.bki-scale-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--bki-muted);
    font-size: 12px;
    font-weight: 700;
}

.bki-scale-wrap {
    position: relative;
    padding-top: 9px;
}

.bki-scale-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: linear-gradient(90deg, #e6c79d 0%, #e6c79d 21%, #87a978 21%, #87a978 57%, #e5b060 57%, #e5b060 71%, #d48374 71%, #d48374 100%);
    box-shadow: inset 0 0 0 1px rgba(45, 42, 38, 0.08);
}

.bki-scale-marker {
    position: absolute;
    top: 1px;
    left: 50%;
    width: 4px;
    height: 24px;
    border-radius: 999px;
    background: #2d2a26;
    box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(45, 42, 38, 0.22);
    transform: translateX(-50%);
    transition: left 0.22s ease;
}

.bki-scale-labels {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    color: var(--bki-muted);
    font-size: 11px;
    font-weight: 700;
}

.bki-scale-labels span:nth-child(1) { text-align: left; }
.bki-scale-labels span:nth-child(2),
.bki-scale-labels span:nth-child(3) { text-align: center; }
.bki-scale-labels span:nth-child(4) { text-align: right; }

.bki-support-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.bki-support-card {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--bki-border);
    background: #fff;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.04);
}

.bki-support-label {
    color: var(--bki-muted);
    font-size: 11px;
    font-weight: 800;
}

.bki-support-value {
    font-family: var(--bki-mono);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--bki-text);
}

.bki-support-note {
    color: var(--bki-muted);
    font-size: 11px;
    line-height: 1.35;
}

.bki-table-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
}

.bki-table-card,
.bki-note-card {
    min-width: 0;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--bki-border);
    background: #fff;
}

.bki-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.bki-card-head h3 {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 14px;
    letter-spacing: -0.02em;
}

.bki-card-head p {
    margin: 1px 0 0;
    color: var(--bki-muted);
    font-size: 12px;
    line-height: 1.35;
}

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

.bki-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
    font-size: 12px;
}

.bki-table th,
.bki-table td {
    padding: 7px 6px;
    border-bottom: 1px solid #f0ebe3;
    text-align: left;
    vertical-align: middle;
}

.bki-table th {
    color: var(--bki-muted);
    font-size: 11px;
    font-weight: 800;
    background: #fffdf8;
}

.bki-table td:last-child,
.bki-table th:last-child {
    text-align: right;
}

.bki-table .bki-num {
    font-family: var(--bki-mono);
    font-weight: 800;
}

.bki-table tr.is-active td {
    background: var(--bki-accent-light);
    color: #6f5420;
    font-weight: 800;
}

.bki-note-card {
    display: grid;
    gap: 8px;
    background: #fffdf8;
}

.bki-note-list {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bki-note-list li {
    display: flex;
    gap: 7px;
    align-items: flex-start;
    color: var(--bki-muted);
    font-size: 12px;
    line-height: 1.45;
}

.bki-note-list i {
    margin-top: 1px;
    color: var(--bki-accent);
    flex: 0 0 auto;
}

.bki-disclaimer {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--bki-border);
    background: #fff;
    color: var(--bki-muted);
    font-size: 12px;
    line-height: 1.5;
}

.bki-disclaimer i {
    margin-top: 1px;
    color: var(--bki-accent);
    flex: 0 0 auto;
}

.bki-related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bki-related-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border-radius: 999px;
    border: 1px solid var(--bki-border);
    color: var(--bki-text);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.bki-related-links a:hover {
    background: var(--bki-accent-light);
    border-color: var(--bki-accent-mid);
}

@media (max-width: 1080px) {
    .bki-main-layout {
        grid-template-columns: 320px minmax(0, 1fr);
    }

    .bki-support-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .bki-header,
    .bki-main-top,
    .bki-card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .bki-badge,
    .bki-status-badge {
        width: fit-content;
    }

    .bki-main-layout,
    .bki-table-grid {
        grid-template-columns: 1fr;
    }

    .bki-input-panel,
    .bki-result-panel,
    .bki-result-stack,
    .bki-table-card,
    .bki-note-card {
        min-width: 0;
    }
}

@media (max-width: 560px) {
    #tool-baby-kaup-index-calculator,
    .bki-main-layout,
    .bki-input-panel,
    .bki-result-panel {
        max-width: 100%;
        overflow-x: hidden;
    }

    .bki-title-block h2 {
        font-size: 19px;
    }

    .bki-support-grid {
        grid-template-columns: 1fr;
    }

    .bki-main-card {
        padding: 14px;
    }

    .bki-main-value {
        font-size: 40px;
    }

    .bki-scale-labels {
        font-size: 10px;
    }

    .bki-table th,
    .bki-table td {
        padding: 7px 5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bki-input-box input,
    .bki-sample-btn,
    .bki-reset-btn,
    .bki-scale-marker,
    .bki-related-links a {
        transition: none !important;
    }

    .bki-sample-btn:hover,
    .bki-reset-btn:hover {
        transform: none !important;
    }
}
