:root {
    --primary-color: #06b6d4; /* Cyan (Medical/Health) */
    --card-bg: rgba(20, 25, 30, 0.9);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --bg-gradient-start: #083344; /* Deep Cyan */
    --bg-gradient-end: #020617;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background-color: #0f172a;
    position: relative;
    overflow-x: hidden;
}

.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 100;
    transition: background 0.3s;
}

.back-link:hover {
    background: rgba(255,255,255,0.2);
}

.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    z-index: -1;
}

.app-container {
    width: 100%;
    max-width: 600px;
    z-index: 10;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

header {
    text-align: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
}

header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* スライダー・トグル部 */
.input-section {
    margin-bottom: 24px;
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.flex-row {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}
.flex-half {
    flex: 1;
}

.input-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.highlight-value {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

input[type="range"] {
    width: 100%;
    height: 14px;
    background: #334155;
    border-radius: 8px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
    margin-bottom: 8px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 4px solid var(--primary-color);
}

/* トグル行 */
.toggle-container {
    display: flex;
    gap: 6px;
}

.toggle-container input[type="radio"] {
    display: none;
}

.toggle-btn {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    padding: 8px 4px;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.2;
}
.income-toggles .toggle-btn {
    font-size: 0.75rem;
}

.toggle-btn small {
    font-size: 0.6rem;
    font-weight: 400;
    opacity: 0.8;
}

.toggle-container input[type="radio"]:checked + .toggle-btn {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}


/* 演出エリア (ブロック敷き詰め) */
.visual-section {
    margin-bottom: 24px;
}

.total-box {
    background: linear-gradient(135deg, rgba(8, 51, 68, 0.6), rgba(0,0,0,0.6));
    border: 2px solid #0891b2;
    border-radius: 16px;
    padding: 20px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(6, 182, 212, 0.1);
}

.total-header {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #67e8f9;
}

.total-number {
    text-align: center;
    margin-top: 4px;
    margin-bottom: 16px;
}
.total-number .number {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 15px rgba(6, 182, 212, 0.6);
    font-variant-numeric: tabular-nums;
}
.total-number .unit {
    font-size: 1.2rem;
    font-weight: 700;
    color: #cffafe;
}

/* タイルブロックコンテナ */
.hospital-blocks-container {
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    padding: 12px;
    min-height: 120px;
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-content: flex-start;
}

/* 個々の手術ブロック */
.illness-block {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%);
    border-radius: 4px;
    border: 1px solid #f87171;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 900;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    
    /* Pop-in animation */
    transform: scale(0);
    animation: pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes pop-in {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.total-footer {
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 12px;
}


/* 結果アラートパネル */
.result-section {
    margin-bottom: 24px;
}

.alert-card {
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid #334155;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.alert-label {
    font-size: 1.1rem;
    font-weight: 900;
    color: #38bdf8;
    margin-bottom: 8px;
}

.count-box {
    margin-top: 16px;
    margin-bottom: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #ef4444;
    border-radius: 12px;
    padding: 16px;
    font-size: 1.1rem;
    color: #fca5a5;
    font-weight: 700;
}
.count-box .huge-count {
    font-size: 3.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
    margin: 0 8px;
    font-variant-numeric: tabular-nums;
}

/* 内訳 */
.breakdown-card {
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.05);
}

.breakdown-card h3 {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-bottom: 12px;
    text-align: center;
}

.cost-hint-list {
    list-style: none;
}

.cost-hint-list li {
    font-size: 0.8rem;
    color: #e2e8f0;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.05);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    line-height: 1.5;
}
