/* ─────────────────────────────────────────────
   PowerBanks 防災診断ツール — CSS
   すべてのセレクタに .pb-disaster-tool プレフィックスを付与し
   Emanon Premium との干渉を回避
   ───────────────────────────────────────────── */

/* ── Reset & Base ── */
.pb-disaster-tool {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
    color: #1f2937;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    box-sizing: border-box;
}
.pb-disaster-tool *, .pb-disaster-tool *::before, .pb-disaster-tool *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Header ── */
.pb-disaster-tool .pb-header {
    text-align: center;
    margin-bottom: 28px;
}
.pb-disaster-tool .pb-header-sub {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 4px;
}
.pb-disaster-tool .pb-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.4;
    margin: 0;
    border: none;
    padding: 0;
    background: none;
}
.pb-disaster-tool .pb-header h2 span {
    color: #ea580c;
}
.pb-disaster-tool .pb-header-desc {
    font-size: 13px;
    color: #6b7280;
    margin-top: 8px;
    line-height: 1.6;
}
.pb-disaster-tool .pb-header-instruction {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #ea580c;
    margin-top: 12px;
    padding: 8px 20px;
    background: #fff7ed;
    border: 1.5px solid #fed7aa;
    border-radius: 24px;
    line-height: 1.4;
}
.pb-disaster-tool .pb-header-guide {
    font-size: 13px;
    color: #6b7280;
    margin-top: 14px;
    line-height: 1.7;
    text-align: left;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.pb-disaster-tool .pb-header-guide strong {
    color: #374151;
    font-weight: 600;
}

/* ── Category Section ── */
.pb-disaster-tool .pb-category {
    margin-bottom: 20px;
}
.pb-disaster-tool .pb-category-label {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid currentColor;
}

/* ── Appliance Card ── */
.pb-disaster-tool .pb-appliance {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    -webkit-user-select: none;
    margin-bottom: 8px;
}
.pb-disaster-tool .pb-appliance:last-child {
    margin-bottom: 0;
}
.pb-disaster-tool .pb-appliance.is-selected {
    background: var(--pb-cat-bg, rgba(59,130,246,0.04));
    border-color: var(--pb-cat-color, #3b82f6);
}
.pb-disaster-tool .pb-appliance-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}
.pb-disaster-tool .pb-appliance-info {
    flex: 1;
    min-width: 0;
}
.pb-disaster-tool .pb-appliance-name {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}
.pb-disaster-tool .pb-appliance-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* ── Hours Control ── */
.pb-disaster-tool .pb-hours-control {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.pb-disaster-tool .pb-hours-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    line-height: 1;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.15s;
}
.pb-disaster-tool .pb-hours-btn:active {
    background: #e5e7eb;
}
.pb-disaster-tool .pb-hours-value {
    font-size: 13px;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
    color: #374151;
}

/* ── Preferences Box ── */
.pb-disaster-tool .pb-preferences {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}
.pb-disaster-tool .pb-preferences-title {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
}
.pb-disaster-tool .pb-pref-group {
    margin-bottom: 12px;
}
.pb-disaster-tool .pb-pref-group:last-child {
    margin-bottom: 0;
}
.pb-disaster-tool .pb-pref-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}
.pb-disaster-tool .pb-pref-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pb-disaster-tool .pb-pref-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    font-weight: 400;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.15s;
    font-family: inherit;
}
.pb-disaster-tool .pb-pref-btn.is-active {
    border: 2px solid #ea580c;
    background: #fff7ed;
    color: #ea580c;
    font-weight: 600;
}

/* ── Requirement Summary ── */
.pb-disaster-tool .pb-summary {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
    color: #fff;
    display: none;
}
.pb-disaster-tool .pb-summary.is-visible {
    display: block;
}
.pb-disaster-tool .pb-summary-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 8px;
    font-weight: 500;
}
.pb-disaster-tool .pb-summary-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.pb-disaster-tool .pb-summary-num {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}
.pb-disaster-tool .pb-summary-unit {
    font-size: 13px;
    font-weight: 400;
}
.pb-disaster-tool .pb-summary-sub {
    font-size: 11px;
    color: #94a3b8;
}

/* ── Diagnose Button ── */
.pb-disaster-tool .pb-diagnose-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: #fff;
    margin-bottom: 12px;
    transition: all 0.2s;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    background: #d1d5db;
    box-shadow: none;
}
.pb-disaster-tool .pb-diagnose-btn.is-ready {
    background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    box-shadow: 0 4px 14px rgba(234,88,12,0.3);
    cursor: pointer;
}
.pb-disaster-tool .pb-diagnose-btn.is-ready:active {
    transform: scale(0.98);
}

/* ── Reset Button ── */
.pb-disaster-tool .pb-reset-btn {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    margin-bottom: 24px;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    display: none;
}
.pb-disaster-tool .pb-reset-btn.is-visible {
    display: block;
}

/* ── Results Section ── */
.pb-disaster-tool .pb-results {
    display: none;
}
.pb-disaster-tool .pb-results.is-visible {
    display: block;
}
.pb-disaster-tool .pb-results-title {
    text-align: center;
    margin: 24px 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}
.pb-disaster-tool .pb-results-sub {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* ── Product Card ── */
.pb-disaster-tool .pb-product {
    background: rgba(220,38,38,0.06);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px 20px 16px;
    margin-bottom: 14px;
    position: relative;
}
.pb-disaster-tool .pb-product.score-high {
    background: rgba(5,150,105,0.08);
}
.pb-disaster-tool .pb-product.score-mid {
    background: rgba(217,119,6,0.08);
}
.pb-disaster-tool .pb-product.score-low {
    background: rgba(234,88,12,0.08);
}
.pb-disaster-tool .pb-product.rank-1 {
    border: 2px solid #059669;
}

/* ── Rank Badge ── */
.pb-disaster-tool .pb-rank-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 8px;
    line-height: 1.4;
}
.pb-disaster-tool .pb-rank-1 {
    background: #fbbf24;
    color: #78350f;
}
.pb-disaster-tool .pb-rank-2 {
    background: #9ca3af;
    color: #fff;
}
.pb-disaster-tool .pb-rank-3 {
    background: #d97706;
    color: #fff;
}

/* ── Product Header ── */
.pb-disaster-tool .pb-product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.pb-disaster-tool .pb-product-maker {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 2px;
}
.pb-disaster-tool .pb-product-name {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}
.pb-disaster-tool .pb-product-score-box {
    text-align: right;
    flex-shrink: 0;
    margin-left: 12px;
}
.pb-disaster-tool .pb-product-score-num {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}
.pb-disaster-tool .pb-product-score-label {
    font-size: 11px;
    font-weight: 600;
}

/* ── Spec Summary Row ── */
.pb-disaster-tool .pb-specs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 14px;
    padding: 8px 0;
    border-top: 1px solid rgba(0,0,0,0.06);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* ── Score Bar ── */
.pb-disaster-tool .pb-score-bar {
    margin-bottom: 8px;
}
.pb-disaster-tool .pb-score-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3px;
}
.pb-disaster-tool .pb-score-bar-label {
    font-size: 12px;
    color: #6b7280;
}
.pb-disaster-tool .pb-score-bar-value {
    font-size: 12px;
    font-weight: 600;
}
.pb-disaster-tool .pb-score-bar-track {
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    overflow: hidden;
}
.pb-disaster-tool .pb-score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ── Detail Toggle ── */
.pb-disaster-tool .pb-detail-toggle {
    padding: 6px 12px;
    font-size: 12px;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    font-weight: 500;
    margin-top: 10px;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

/* ── Detail Area ── */
.pb-disaster-tool .pb-detail-area {
    display: none;
    margin-top: 12px;
    font-size: 13px;
    color: #374151;
    line-height: 1.7;
}
.pb-disaster-tool .pb-detail-area.is-open {
    display: block;
}
.pb-disaster-tool .pb-detail-item {
    padding: 6px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    font-size: 12px;
    border-left: 3px solid;
}
.pb-disaster-tool .pb-detail-good {
    background: rgba(5,150,105,0.06);
    border-left-color: #059669;
}
.pb-disaster-tool .pb-detail-warn {
    background: rgba(234,88,12,0.06);
    border-left-color: #ea580c;
}

/* ── Tips Box ── */
.pb-disaster-tool .pb-tips {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(59,130,246,0.06);
    border: 1px solid rgba(59,130,246,0.15);
}
.pb-disaster-tool .pb-tips-title {
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 4px;
}
.pb-disaster-tool .pb-tips-item {
    font-size: 12px;
    color: #374151;
    margin-bottom: 2px;
}

/* ── CTA Button ── */
.pb-disaster-tool .pb-cta {
    display: block;
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(234,88,12,0.2);
    transition: opacity 0.2s;
}
.pb-disaster-tool .pb-cta:hover {
    opacity: 0.9;
    color: #fff;
    text-decoration: none;
}
.pb-disaster-tool .pb-cta-note {
    font-size: 10px;
    color: #9ca3af;
    text-align: center;
    margin-top: 4px;
}

/* ── Notice Box ── */
.pb-disaster-tool .pb-notice {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    font-size: 12px;
    color: #92400e;
    line-height: 1.7;
}
.pb-disaster-tool .pb-notice strong {
    display: block;
    margin-bottom: 2px;
}
.pb-disaster-tool .pb-notice-price {
    margin-top: 10px;
}

/* ── Footer ── */
.pb-disaster-tool .pb-footer {
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 24px;
    padding-bottom: 16px;
}

/* ── Omitted Products Note ── */
.pb-disaster-tool .pb-omitted {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    padding: 16px;
    margin-top: 8px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .pb-disaster-tool {
        padding: 16px 12px;
    }
    .pb-disaster-tool .pb-header h2 {
        font-size: 19px;
    }
    .pb-disaster-tool .pb-summary-num {
        font-size: 20px;
    }
    .pb-disaster-tool .pb-product-name {
        font-size: 14px;
    }
    .pb-disaster-tool .pb-product-score-num {
        font-size: 24px;
    }
    .pb-disaster-tool .pb-summary-grid {
        gap: 12px;
    }
}
