/* Base Layout */
.flame-pricing-wrapper {
    max-width: 800px;
    margin: 20px auto;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.flame-pricing-wrapper * {
    box-sizing: border-box;
}

.flame-title {
    text-align: center;
    color: #555;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.1em;
}

.flame-simulation-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Reduced gap */
}

/* Header Group (Badge + Inputs) */
.flame-header-group {
    text-align: center;
    margin-bottom: 0;
}

.flame-guarantee-badge {
    display: inline-block;
    background: #ffeef1 !important;
    color: #ff5c8a !important;
    padding: 6px 15px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    /* Increased size */
    font-weight: bold !important;
    /* Added bold */
    margin: 0 0 15px 0 !important;
    border: 1px solid #ffb6c1 !important;
    /* Explicit border for visibility */
    box-shadow: 0 2px 5px rgba(255, 182, 193, 0.3) !important;
    /* Pop effect */
    white-space: nowrap;
    line-height: normal !important;
}

/* Inputs - Inline */
.flame-input-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

/* Inputs - Trigger Style */
.flame-input-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: flex-end;
    /* Align bottom to match labels */
    margin-bottom: 20px;
}

.flame-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.flame-input-group label {
    font-size: 13px;
    color: #666;
    margin: 0;
    font-weight: bold;
}

.flame-picker-trigger {
    width: 80px;
    padding: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
}

.flame-picker-trigger:active {
    background: #f5f5f5;
}

/* Modal Styles */
#flame-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    backdrop-filter: blur(2px);
}

#flame-picker-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 999999;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
    padding-bottom: env(safe-area-inset-bottom);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.flame-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.flame-picker-header button {
    background: none;
    border: none;
    color: #ff5c8a;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 5px;
}

#flame-picker-cancel {
    color: #999;
    font-weight: normal;
}

#flame-picker-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.flame-picker-body {
    padding: 30px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    background: #fff;
}

/* Drum Styles in Modal */
/* Drum Styles in Modal */
.flame-drum-wrapper {
    position: relative;
    width: 120px;
    height: 180px;
    /* 5 items visible (36px * 5) */
    overflow: hidden;
    /* masks content outside */
    margin-right: 10px;
    background: #fff;
    /* wrapper bg */
}

.flame-drum-window {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    z-index: 2;
    /* Scroll interaction layer */
    background: transparent;
}

.flame-drum-window::-webkit-scrollbar {
    display: none;
}

.flame-drum-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
    padding-top: 72px;
    /* 36 * 2 spacer */
    padding-bottom: 72px;
}

.flame-drum-list li {
    height: 36px;
    line-height: 36px;
    scroll-snap-align: center;
    font-size: 20px;
    color: #ccc;
    /* Default inactive color */
    font-weight: 400;
    transition: all 0.2s;
    opacity: 0.5;
    /* Add opacity for clearer distinction */
}

.flame-drum-list li.flame-drum-active {
    color: #333;
    font-weight: bold;
    transform: scale(1.2);
    /* Slightly larger */
    opacity: 1;
}

/* Highlight Bar (Overlay) - Background Pill Style */
.flame-drum-highlight {
    position: absolute;
    top: 50%;
    left: 5px;
    right: 5px;
    height: 36px;
    margin-top: -18px;
    border: none;
    background: #f2f2f2;
    /* Light gray selection background */
    border-radius: 6px;
    pointer-events: none;
    z-index: 1;
    /* Behind text */
}

.flame-unit-label {
    position: absolute;
    top: 50%;
    right: 15px;
    /* Positioned to the right inside the 120px wrapper */
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: bold;
    color: #333;
    pointer-events: none;
    z-index: 4;
    /* On top of highlight */
}

/* Visual Section - Compact */
.flame-visual-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* Align bottom */
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px;
    position: relative;
    /* Added padding-top to allow toggle to sit nicely above if needed, but it's separate block */
    height: auto !important;
    min-height: 350px;
}

.flame-model-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 130px;
    /* Reduced specific width */
    position: relative;
    height: auto !important;
}

.flame-svg-wrapper {
    width: 100%;
    height: 280px !important;
    /* Fixed height for alignment */
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.flame-svg-wrapper svg {
    height: 100%;
    width: auto;
    max-height: 100%;
    filter: drop-shadow(0 0 8px rgba(255, 182, 193, 0.3));
}

.flame-label {
    position: absolute;
    top: -25px;
    /* Moved up outside container flow or relative? Let's keep absolute but aligned to top of visual section? */
    /* Wait, if visual section is relative, top: 5px works. But if container height varies... */
    /* Let's put label relative too? No, label is "BEFORE/AFTER" at top. */
    /* Let's make label relative at start of flex column */
    position: relative !important;
    top: auto !important;
    margin-bottom: 5px !important;
    font-size: 11px;
    color: #4d4d4d;
    letter-spacing: 0.1em;
    font-weight: bold;
}

.flame-weight-display {
    position: relative !important;
    bottom: auto !important;
    margin-top: -15px !important;
    /* Slight overlap upwards into SVG area */
    background: rgba(255, 255, 255, 0.95);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 0;
    font-family: 'Georgia', serif;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.flame-weight-display span {
    font-size: 18px;
    color: #333;
}

.flame-center-info {
    height: 280px;
    /* Match SVG wrapper height for centering arrow */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-bottom: 0;
    min-width: 30px;
    width: 30px;
    z-index: 5;
    margin-top: 25px;
    /* Account for label height approx */
}

.flame-arrow {
    background: #fff0f5;
    color: #ff5c8a;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    /* More space for text below */
    box-shadow: 0 2px 5px rgba(255, 92, 138, 0.15);
}

.flame-arrow svg {
    width: 18px;
    height: 18px;
    /* Removed drop-shadow on svg path itself, box shadow handles depth */
}

.flame-image-note-center {
    font-size: 10px;
    /* Adjusted slightly */
    color: #999;
    margin: 0;
    white-space: nowrap;
    /* No vertical text! Back to horizontal if we have space? */
    /* Wait, space is tight. Let's keep vertical if needed, or try horizontal stacking? */
    /* User said "design... readable layout". Vertical is readable if clear. */
    /* Let's stick to vertical but cleaner font? Or back to horizontal "※イメージ" if it fits under the circle? */
    /* With 32px circle, "※イメージ" (4 chars) fits horizontally? No 130px container width - 200px svg. */
    /* The center container width is small (30px). Vertical is safest. */
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.1em;
    font-weight: normal;
}

/* Controls Wrapper (Slider + Price) */
.flame-controls-wrapper {
    background: #fffbfb;
    border: 1px solid #ffeef1;
    border-radius: 15px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
    /* Center badge */
}

/* Slider */
.flame-slider-section {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

/* Ticks on the line (new) */
.flame-slider-ticks {
    position: absolute;
    bottom: 3px;
    left: 2px;
    right: 2px;
    height: 0;
    border-top: 2px dotted #ffcbd6;
    z-index: 5;
    pointer-events: none;
}

.flame-slider-label {
    color: #333;
    margin-bottom: 22px;
    /* Increased gap */
    display: block;
    font-weight: bold;
}

#target-loss-display {
    font-size: 22px;
    color: #ff6b8b;
    font-weight: bold;
    margin: 0 4px;
}

input[type=range] {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 8px !important;
    /* Slightly thicker track */
    background: #fff0f5 !important;
    border-radius: 5px !important;
    outline: none !important;
    margin: 0 auto !important;
    cursor: grab !important;
    transition: background 0.1s;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    border: none !important;
    padding: 0 !important;
    display: block !important;
    position: relative;
    z-index: 1;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    height: 30px !important;
    width: 80px !important;
    /* Wide thumb to include arrows */
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='30' viewBox='0 0 80 30'%3E%3Cpath d='M10 15 L20 8 L20 22 Z' fill='%23ffb6c1'/%3E%3Ccircle cx='40' cy='15' r='11' fill='%23ff5c8a' stroke='white' stroke-width='3'/%3E%3Cpath d='M70 15 L60 8 L60 22 Z' fill='%23ffb6c1'/%3E%3C/svg%3E") no-repeat center center !important;
    background-position: center center !important;
    cursor: grab !important;
    border: none !important;
    box-shadow: none !important;
    /* Shadow handled effectively by design or skipped for clean look */
    transition: transform 0.1s;
    margin-top: -11px !important;
    /* Centering calculation: Track 8px, Thumb 30px. (8-30)/2 = -11px. */
    /* Previous value of -5px was visually tweaked, but stick to calc for robustness against themes */
}

input[type=range]::-moz-range-thumb {
    height: 30px !important;
    width: 80px !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='30' viewBox='0 0 80 30'%3E%3Cpath d='M10 15 L20 8 L20 22 Z' fill='%23ffb6c1'/%3E%3Ccircle cx='40' cy='15' r='11' fill='%23ff5c8a' stroke='white' stroke-width='3'/%3E%3Cpath d='M70 15 L60 8 L60 22 Z' fill='%23ffb6c1'/%3E%3C/svg%3E") no-repeat center center !important;
    border: none !important;
    cursor: grab !important;
    margin-top: -11px !important;
}

/* Remove old hint styles */
.flame-slider-hint {
    display: none;
}

/* Price */
.flame-price-section {
    text-align: center;
    border-top: 1px dashed #ffdce5;
    padding-top: 20px;
    margin-top: 20px;
}

.flame-price-label {
    font-size: 13px;
    color: #4d4d4d;
    /* Darker as requested */
    margin: 0 0 5px 0;
}

.flame-price-value {
    margin: 0;
    font-size: 32px;
    font-weight: bold;
    font-family: 'Helvetica Neue', sans-serif;
    /* Clean san-serif for price numbers */
    color: #333;
    letter-spacing: -1px;
}

/* Campaign Layout */
.flame-price-row {
    display: flex !important;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.flame-regular-reference {
    font-size: 16px;
    /* Increased by 1 step */
    text-decoration: line-through;
    color: #4d4d4d;
    font-weight: 600;
    /* Increased weight */
}

.flame-campaign-value {
    font-size: 42px;
    font-weight: bold;
    color: #ff5c8a;
    font-family: 'Helvetica Neue', sans-serif;
}

.flame-payment-note {
    font-size: 13px;
    /* Increased for readability */
    color: #4d4d4d;
    /* Darker as requested */
    margin-top: 8px;
}

/* Mobile Specific "One Screen" Tweaks */
@media (max-width: 600px) {
    .flame-pricing-wrapper {
        margin: 5px;
        padding: 12px;
        border-radius: 15px;
    }

    .flame-title {
        display: none;
    }

    .flame-guarantee-badge {
        font-size: 14px !important;
        /* Increased 2 sizes (10->14) */
        margin-bottom: 8px !important;
        padding: 4px 10px !important;
    }

    .flame-visual-section {
        height: auto !important;
        min-height: 310px;
        gap: 0;
        /* No gap, prevent wrap */
        justify-content: space-between;
        /* Space out elements */
    }

    .flame-model-container {
        width: 125px;
        /* Extremely safe width for iPhone SE */
    }

    .flame-svg-wrapper {
        height: 260px !important;
    }

    .flame-svg-wrapper svg {
        max-height: 100%;
    }

    .flame-center-info {
        height: 260px;
        margin-top: 20px;
    }

    .flame-weight-display {
        background: rgba(255, 255, 255, 0.95);
        font-size: 11px;
        padding: 2px 8px;
        margin-top: -10px !important;
        bottom: auto !important;
    }

    .flame-weight-display span {
        font-size: 16px;
    }

    .flame-controls-wrapper {
        padding: 12px;
        margin-top: 10px;
    }

    .flame-slider-section {
        margin-bottom: 10px;
    }

    .flame-price-value {
        font-size: 30px;
    }

    /* Stack price for better readability on mobile */
    .flame-price-row {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0 !important;
    }

    .flame-regular-reference {
        font-size: 15px;
        /* Larger on mobile too */
        color: #aaa;
        margin-bottom: 2px;
    }

    .flame-campaign-value {
        font-size: 46px;
        /* Even bigger on mobile for impact */
        line-height: 1.2;
    }
}

.flame-image-note {
    text-align: right;
    font-size: 10px;
    color: #aaa;
    margin: -5px 0 15px 0;
    padding-right: 20px;
}

/* Price List Section */
.flame-pricelist-section {
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid #ffeef1;
    padding-top: 15px;
}

.flame-btn-secondary {
    background: #fff !important;
    border: 1px solid #ffb6c1 !important;
    color: #ff5c8a !important;
    padding: 10px 20px !important;
    border-radius: 30px !important;
    font-size: 14px !important;
    cursor: pointer;
    transition: all 0.3s;
    outline: none !important;
    box-shadow: none !important;
    display: inline-block !important;
    width: auto !important;
}

.flame-btn-secondary:hover {
    background: #fff0f5 !important;
}

.flame-pricelist-container {
    margin-top: 15px;
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.03);
}

.flame-table-scroll {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    /* smooth scroll ios */
}

.flame-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
    /* Prevent wrapping for horizontal scroll */
}

.flame-price-table th,
.flame-price-table td {
    border: 1px solid #eee;
    padding: 8px 12px;
    text-align: center;
}

.flame-price-table th {
    background: #ffeef1;
    color: #555;
    font-weight: normal;
    position: sticky;
    left: 0;
    z-index: 1;
    /* Keep header visible if needed, strictly sticky column logic might need more work but simple scroll is fine */
}

/* If we want the first column (Labels) to sticky, we need sticky on th:first-child */
.flame-price-table th:first-child,
.flame-price-table td:first-child {
    background: #fffbfb;
    position: sticky;
    left: 0;
    z-index: 2;
    font-weight: bold;
    color: #ff5c8a;
    border-right: 2px solid #ffeef1;
}

.flame-price-table th:first-child {
    background: #ffe0e9;
    /* Match header tone but darker/distinct */
    z-index: 3;
}

.flame-scroll-hint {
    font-size: 10px;
    color: #999;
    text-align: center;
    margin-bottom: 5px;
    display: none;
    /* Hidden by default, shown on mobile */
}

@media (max-width: 600px) {
    .flame-scroll-hint {
        display: block;
    }
}