/* ===========================================
   Simulator v5.0 - style.css (WordPress/SWELL)
   oshi-denki.jp — Full Redesign with SVG Icons
   Dashboard layout for PC
   =========================================== */

:root {
  --sim-primary: #FF6B35;
  --sim-primary-light: #FFF0E8;
  --sim-primary-dark: #E55A2B;
  --sim-accent: #1B998B;
  --sim-accent-light: #E6F7F5;
  --sim-dark: #2D3142;
  --sim-gray: #6B7280;
  --sim-gray-light: #F3F4F6;
  --sim-white: #FFFFFF;
  --sim-shadow: 0 4px 24px rgba(45,49,66,0.08);
  --sim-shadow-lg: 0 8px 40px rgba(45,49,66,0.12);
  --sim-radius: 16px;
  --sim-radius-sm: 10px;
  --sim-warn: #F59E0B;
  --sim-warn-light: #FFFBEB;
  --sim-bg: #F7F8FB;
  --sim-card-border: rgba(0,0,0,0.05);
}

/* --- Container --- */
.sim-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--sim-dark);
  line-height: 1.7;
  background: var(--sim-bg);
  border-radius: 24px;
}
.sim-container * { box-sizing: border-box; }

/* --- SVG Icon Utilities --- */
.sim-container svg { vertical-align: middle; flex-shrink: 0; }
.step-ico { color: var(--sim-primary); margin-right: 4px; vertical-align: -3px; }
.hero-icon { margin-bottom: 10px; animation: simFadeUp 0.4s cubic-bezier(0.22,1,0.36,1) 0.2s both; }
.hero-icon svg { color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15)); }
.chart-card h3 svg,
.monthly-card h3 svg,
.company-section h3 svg,
.cta-banner-title svg,
.conditions-card-title svg { vertical-align: -3px; margin-right: 4px; color: var(--sim-primary); }
.warn-banner svg { vertical-align: -2px; margin-right: 2px; color: var(--sim-warn); }
.btn-retry svg,
.restart-btn svg { vertical-align: -2px; }

/* --- Simulator Header --- */
.sim-header { text-align: center; margin-bottom: 28px; }
.header-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--sim-primary), #FF8C5A);
  color: white; font-size: 11px; font-weight: 700; padding: 5px 16px;
  border-radius: 20px; margin-bottom: 10px; letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255,107,53,0.3);
}
.sim-title {
  font-family: 'M PLUS Rounded 1c', sans-serif !important;
  font-size: 22px !important; font-weight: 800 !important;
  color: var(--sim-dark) !important; line-height: 1.4 !important;
  margin: 0 !important; padding: 0 !important;
  border: none !important; background: none !important;
}
.sim-title span { color: var(--sim-primary); }
.header-sub { font-size: 13px; color: var(--sim-gray); margin-top: 6px; }

/* --- Progress Bar --- */
.progress-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 28px; padding: 0 8px;
}
.progress-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  position: relative; z-index: 1;
}
.progress-num {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; background: #E5E7EB; color: #9CA3AF;
  transition: all 0.4s ease; border: 2px solid transparent;
}
.progress-label {
  font-size: 10px; font-weight: 600; color: #9CA3AF;
  transition: color 0.4s ease;
}
.progress-connector {
  flex: 1; height: 3px; background: #E5E7EB; min-width: 24px;
  margin: 0 -2px; margin-bottom: 18px; transition: background 0.4s ease;
}

/* Step states */
.progress-step.active .progress-num {
  background: var(--sim-primary); color: white; border-color: var(--sim-primary);
  box-shadow: 0 0 0 4px rgba(255,107,53,0.2); animation: simPulse 2s ease-in-out infinite;
}
@keyframes simPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,107,53,0.2); }
  50% { box-shadow: 0 0 0 8px rgba(255,107,53,0.08); }
}
.progress-step.active .progress-label { color: var(--sim-primary); font-weight: 700; }
.progress-step.done .progress-num { background: var(--sim-accent); color: white; border-color: var(--sim-accent); }
.progress-step.done .progress-label { color: var(--sim-accent); }
.progress-connector.done { background: var(--sim-accent); }

/* --- Cards --- */
.sim-card {
  background: var(--sim-white); border-radius: var(--sim-radius); box-shadow: var(--sim-shadow);
  padding: 28px 24px; margin-bottom: 16px; animation: simFadeUp 0.3s ease;
  border: 1px solid var(--sim-card-border);
  border-top: 3px solid var(--sim-primary);
  position: relative;
}
@keyframes simFadeUp { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
.step-label {
  font-size: 11px; font-weight: 700; color: var(--sim-primary);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px;
  background: var(--sim-primary-light); display: inline-block; padding: 3px 12px; border-radius: 12px;
}
.step-title {
  font-family: 'M PLUS Rounded 1c', sans-serif !important;
  font-size: 18px !important; font-weight: 800 !important; margin-bottom: 18px !important;
  line-height: 1.4 !important; color: var(--sim-dark) !important;
  border: none !important; padding: 0 !important; background: none !important;
}

/* --- Options --- */
.sim-container .options { display: flex; flex-direction: column; gap: 10px; }
.sim-container .option-btn {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border: 2px solid #E5E7EB; border-radius: var(--sim-radius-sm); background: white;
  cursor: pointer; transition: all 0.2s ease; font-size: 15px; font-weight: 500;
  color: var(--sim-dark); text-align: left; width: 100%;
}
.sim-container .option-btn:hover { border-color: var(--sim-primary); background: var(--sim-primary-light); transform: translateY(-1px); }
.sim-container .option-btn.selected { border-color: var(--sim-primary); background: var(--sim-primary-light); box-shadow: 0 0 0 3px rgba(255,107,53,0.15); }
.sim-container .option-btn .icon {
  flex-shrink: 0; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--sim-primary-light); border-radius: 10px; color: var(--sim-primary);
  transition: all 0.2s ease;
}
.sim-container .option-btn:hover .icon,
.sim-container .option-btn.selected .icon { background: var(--sim-primary); color: #fff; }
.sim-container .option-btn .label { flex: 1; }
.sim-container .option-btn .sub { font-size: 12px; color: var(--sim-gray); display: block; margin-top: 2px; }
.sim-container .options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sim-container .options-grid .option-btn { flex-direction: column; text-align: center; padding: 16px 12px; gap: 8px; }
.sim-container .options-grid .option-btn .icon { width: 48px; height: 48px; border-radius: 12px; margin: 0 auto; }
/* Center orphan (last odd) button in 2-col grid */
.sim-container .contract-options .option-btn:last-child:nth-child(odd) {
  grid-column: 1 / -1; max-width: calc(50% - 5px); justify-self: center;
}

/* --- Checkboxes --- */
.checkbox-options { display: flex; flex-direction: column; gap: 8px; }
.check-btn {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border: 2px solid #E5E7EB; border-radius: var(--sim-radius-sm); background: white;
  cursor: pointer; transition: all 0.2s ease; font-size: 14px; font-weight: 500;
}
.check-btn:hover { border-color: var(--sim-accent); transform: translateY(-1px); }
.check-btn.checked { border-color: var(--sim-accent); background: var(--sim-accent-light); box-shadow: 0 0 0 3px rgba(27,153,139,0.12); }
.check-btn .checkbox {
  width: 22px; height: 22px; border: 2px solid #D1D5DB; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; flex-shrink: 0;
}
.check-btn.checked .checkbox { background: var(--sim-accent); border-color: var(--sim-accent); }
.check-btn.checked .checkbox::after { content: '\2713'; color: white; font-size: 14px; font-weight: 700; }
.check-btn span svg { color: var(--sim-accent); vertical-align: -2px; margin-right: 2px; }

/* --- kWh Input --- */
.kwh-input-wrap { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.kwh-input-wrap input {
  width: 120px; padding: 10px 14px; border: 2px solid #E5E7EB; border-radius: var(--sim-radius-sm);
  font-size: 18px; font-weight: 700; text-align: center; color: var(--sim-dark); font-family: inherit; outline: none;
}
.kwh-input-wrap input:focus { border-color: var(--sim-primary); box-shadow: 0 0 0 3px rgba(255,107,53,0.15); }
.kwh-input-wrap span { font-size: 15px; font-weight: 500; color: var(--sim-gray); }

/* --- Buttons --- */
.nav-buttons { display: flex; gap: 10px; margin-top: 20px; }
.sim-container .btn {
  flex: 1; padding: 14px; border: none; border-radius: var(--sim-radius-sm);
  font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s ease; font-family: inherit;
}
.btn-back { background: var(--sim-gray-light); color: var(--sim-gray); }
.btn-back:hover { background: #E5E7EB; }
.btn-next { background: linear-gradient(135deg, var(--sim-primary), #FF8C5A); color: white; box-shadow: 0 3px 12px rgba(255,107,53,0.3); }
.btn-next:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(255,107,53,0.4); }

/* --- Warning Banner --- */
.warn-banner {
  background: var(--sim-warn-light); border: 2px solid var(--sim-warn); border-radius: var(--sim-radius-sm);
  padding: 14px 16px; margin-bottom: 16px; font-size: 13px; line-height: 1.6;
}
.warn-banner strong { color: #B45309; }

/* --- Results --- */
.result-hero {
  text-align: center; padding: 36px 20px;
  background: linear-gradient(135deg, var(--sim-primary) 0%, #FF8C5A 100%);
  border-radius: var(--sim-radius); color: white; margin-bottom: 16px; animation: simHeroAppear 0.5s cubic-bezier(0.22,1,0.36,1) 0.1s both;
  box-shadow: 0 8px 32px rgba(255,107,53,0.25); position: relative; overflow: hidden;
}
@keyframes simHeroAppear {
  from { opacity:0; transform:translateY(16px) scale(0.97); }
  to { opacity:1; transform:translateY(0) scale(1); }
}
.result-hero::before {
  content: ''; position: absolute; top: -50%; right: -50%;
  width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}
.result-hero .savings-label { font-size: 13px; opacity: 0.9; margin-bottom: 4px; }
.result-hero .savings-amount { font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 44px; font-weight: 900; line-height: 1.1; }
.result-hero .savings-amount small { font-size: 18px; }
.result-hero .savings-period { font-size: 13px; opacity: 0.85; margin-top: 4px; }

/* --- Conditions Card --- */
.conditions-card {
  background: var(--sim-white); border-radius: var(--sim-radius); box-shadow: var(--sim-shadow);
  padding: 20px; margin-bottom: 16px; border: 1px solid var(--sim-card-border);
  border-left: 4px solid var(--sim-accent);
  animation: simFadeUp 0.45s cubic-bezier(0.22,1,0.36,1) 0.3s both;
}
.conditions-card-title {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 14px; font-weight: 800; color: var(--sim-dark); margin-bottom: 10px;
}
.conditions { font-size: 12px; color: var(--sim-gray); line-height: 1.8; }
.conditions strong { color: var(--sim-dark); }
.conditions-actions {
  display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #E5E7EB;
}
.btn-retry {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; background: var(--sim-gray-light); border: 2px solid #E5E7EB;
  border-radius: var(--sim-radius-sm); font-size: 13px; font-weight: 700;
  color: var(--sim-gray); cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.btn-retry:hover { border-color: var(--sim-primary); color: var(--sim-primary); background: var(--sim-primary-light); }

/* --- Monthly Card (with inline formula accordion) --- */
.monthly-card {
  background: var(--sim-white); border-radius: var(--sim-radius); box-shadow: var(--sim-shadow);
  padding: 20px; margin-bottom: 16px; border: 1px solid var(--sim-card-border);
  animation: simFadeUp 0.45s cubic-bezier(0.22,1,0.36,1) 0.45s both;
}
.monthly-card h3 { font-size: 15px; font-weight: 700; text-align: center; margin-bottom: 14px; }
.monthly-grid { display: flex; flex-direction: column; gap: 0; }
.monthly-item { border-radius: var(--sim-radius-sm); overflow: hidden; margin-bottom: 8px; }
.monthly-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--sim-gray-light); border-radius: var(--sim-radius-sm);
  cursor: pointer; transition: background 0.15s, filter 0.15s;
}
.monthly-row:hover { filter: brightness(0.97); }
.monthly-row.current { background: #F3F4F6; }
.monthly-row.best { background: var(--sim-accent-light); border: 2px solid var(--sim-accent); }
.monthly-row.expanded { border-radius: var(--sim-radius-sm) var(--sim-radius-sm) 0 0; }
.monthly-row .rank { font-weight: 900; font-size: 16px; width: 28px; text-align: center; flex-shrink: 0; line-height: 1; }
.monthly-row .rank svg { width: 22px; height: 22px; }
.monthly-row .info { flex: 1; min-width: 0; }
.monthly-row .name { font-weight: 700; font-size: 13px; }
.monthly-row .plan { font-size: 11px; color: var(--sim-gray); }
.monthly-row .price { font-family: 'M PLUS Rounded 1c', sans-serif; font-weight: 800; font-size: 16px; text-align: right; flex-shrink: 0; }
.monthly-row .price small { font-size: 12px; font-weight: 500; }
.monthly-row.best .price { color: var(--sim-accent); }
.monthly-row .diff { font-size: 11px; color: var(--sim-accent); text-align: right; font-weight: 600; }
.monthly-row .unit-price { font-size: 10px; color: #9CA3AF; text-align: right; font-weight: 500; }
.row-toggle {
  font-size: 14px; color: var(--sim-gray); transition: transform 0.3s; flex-shrink: 0;
}
.monthly-row.expanded .row-toggle { transform: rotate(180deg); }
.row-tag {
  display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 10px;
  background: #E0F2F1; color: var(--sim-accent); font-weight: 600; margin-left: 4px;
  vertical-align: middle;
}
.row-formula {
  max-height: 0; overflow: hidden; transition: max-height 0.4s ease;
  background: #FAFBFC; border-top: 0 solid transparent;
}
.row-formula.open { max-height: 3000px; border-top: 1px solid #E5E7EB; }
.monthly-hint {
  text-align: center; font-size: 11px; color: #9CA3AF; margin-top: 8px;
}
/* Formula content (reused inside row-formula) */
.formula-content { padding: 14px 20px 18px; font-size: 13px; line-height: 1.9; }
.formula-content .line { display: flex; justify-content: space-between; padding: 2px 0; }
.formula-content .line-label { color: var(--sim-gray); }
.formula-content .line-value { font-weight: 700; text-align: right; }
.formula-content .divider { border-top: 1px dashed #D1D5DB; margin: 8px 0; }
.formula-content .total-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 16px; font-weight: 900; }
.formula-content .total-line .accent { color: var(--sim-accent); }
.formula-content .total-line .current-color { color: var(--sim-gray); }
.formula-content .section-head { font-weight: 700; color: var(--sim-dark); margin-top: 10px; margin-bottom: 4px; font-size: 13px; }
.formula-content .note { font-size: 11px; color: #9CA3AF; margin-top: 6px; line-height: 1.5; }
.formula-content .sub-line { text-align: right; font-size: 12px; color: #6B7280; margin-top: -4px; margin-bottom: 4px; }
/* --- Chart Cards --- */
.chart-card {
  background: var(--sim-white); border-radius: var(--sim-radius); box-shadow: var(--sim-shadow);
  padding: 20px 16px; margin-bottom: 16px; border: 1px solid var(--sim-card-border);
  animation: simFadeUp 0.45s cubic-bezier(0.22,1,0.36,1) 0.6s both; overflow: hidden;
}
.chart-card h3 { font-size: 14px; font-weight: 700; text-align: center; margin-bottom: 12px; margin: 0; }
.chart-card h3:first-child { margin-bottom: 10px; }

/* Period Buttons */
.period-btns {
  display: flex; justify-content: center; gap: 6px; margin: 12px 0 14px;
}
.period-btn {
  padding: 7px 16px; border: 2px solid #E5E7EB; border-radius: 20px;
  background: transparent; font-size: 13px; font-weight: 700; color: var(--sim-gray);
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.period-btn.active {
  background: var(--sim-primary); border-color: var(--sim-primary); color: white;
}
.period-btn:hover:not(.active) { border-color: var(--sim-primary); color: var(--sim-primary); }
.chart-wrap { position: relative; width: 100%; overflow: hidden; }
.chart-wrap canvas { display: block; }

/* --- Donut Charts --- */
.donut-grid {
  display: flex; align-items: center; justify-content: center; gap: 0; margin: 8px 0 4px;
}
.donut-col { flex: 1; text-align: center; max-width: 180px; }
.donut-vs {
  font-family: 'M PLUS Rounded 1c', sans-serif; font-weight: 900; font-size: 16px;
  color: var(--sim-gray); padding: 0 4px; flex-shrink: 0;
}
.donut-label {
  font-size: 12px; font-weight: 700; color: var(--sim-dark); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.donut-label.best-label { color: var(--sim-accent); }
.donut-selector { margin-bottom: 4px; }
.donut-selector select {
  padding: 4px 24px 4px 8px; border: 2px solid var(--sim-accent); border-radius: 8px;
  font-size: 11px; font-weight: 700; color: var(--sim-accent); background: var(--sim-accent-light);
  font-family: inherit; cursor: pointer; appearance: none; max-width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%231B998B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
}
.donut-wrap { position: relative; width: 100%; max-width: 150px; margin: 0 auto; }
.donut-wrap canvas { display: block; }
.donut-total {
  font-family: 'M PLUS Rounded 1c', sans-serif; font-weight: 900; font-size: 18px;
  color: var(--sim-dark); margin-top: 4px;
}
.donut-total small { font-size: 12px; font-weight: 500; }
.donut-total.best-total { color: var(--sim-accent); }
.donut-legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #F3F4F6;
}
.donut-legend-item {
  display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--sim-gray);
}
.donut-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

/* --- Company Cards --- */
.company-section { animation: simFadeUp 0.45s cubic-bezier(0.22,1,0.36,1) 0.75s both; }
.company-section h3 { font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 16px; font-weight: 800; margin-bottom: 12px; text-align: center; }
.company-card {
  background: var(--sim-white); border-radius: var(--sim-radius); box-shadow: var(--sim-shadow);
  padding: 20px; margin-bottom: 12px; display: flex; align-items: center; gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s; border: 1px solid var(--sim-card-border);
  position: relative; overflow: hidden;
}
.company-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--sim-primary), var(--sim-accent));
}
.company-card:hover { transform: translateY(-2px); box-shadow: var(--sim-shadow-lg); }
.company-rank { font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 20px; font-weight: 900; color: var(--sim-primary); flex-shrink: 0; width: 36px; text-align: center; line-height: 1; }
.company-info { flex: 1; }
.company-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.company-plan { font-size: 12px; color: var(--sim-gray); }
.company-saving { text-align: right; flex-shrink: 0; }
.company-saving .amount { font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 18px; font-weight: 800; color: var(--sim-accent); }
.company-saving .per { font-size: 11px; color: var(--sim-gray); }
.company-link {
  display: block; text-align: center; padding: 12px;
  background: linear-gradient(135deg, var(--sim-primary), #FF8C5A);
  color: white !important; text-decoration: none; border-radius: var(--sim-radius-sm);
  font-size: 14px; font-weight: 700; margin-top: 10px; transition: all 0.2s;
  box-shadow: 0 3px 12px rgba(255,107,53,0.2);
}
.company-link:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(255,107,53,0.3); color: white !important; }

/* --- Misc --- */
.restart-btn {
  display: block; width: 100%; padding: 16px; background: var(--sim-white);
  color: var(--sim-primary); border: 2px solid var(--sim-primary); border-radius: var(--sim-radius-sm);
  font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 20px; font-family: inherit;
  transition: all 0.2s; box-shadow: 0 2px 8px rgba(255,107,53,0.1);
  animation: simFadeUp 0.45s cubic-bezier(0.22,1,0.36,1) 1.0s both;
}
.restart-btn:hover { background: var(--sim-primary); color: white; box-shadow: 0 4px 16px rgba(255,107,53,0.3); transform: translateY(-1px); }
.sim-container .disclaimer {
  font-size: 11px; color: #9CA3AF; line-height: 1.6; margin-top: 20px;
  padding: 16px; background: var(--sim-white); border-radius: var(--sim-radius-sm); border: 1px solid var(--sim-card-border);
  animation: simFadeUp 0.45s cubic-bezier(0.22,1,0.36,1) 1.05s both;
}
.sim-container .disclaimer a { color: var(--sim-primary); }
.sim-container .hidden { display: none !important; }

/* --- CTA Banner --- */
.cta-banner {
  background: linear-gradient(135deg, #2D3142 0%, #3D4157 100%);
  border-radius: var(--sim-radius); padding: 24px 20px; margin-top: 20px;
  text-align: center; color: white; animation: simFadeUp 0.45s cubic-bezier(0.22,1,0.36,1) 0.9s both;
}
.cta-banner-title { font-family: 'M PLUS Rounded 1c', sans-serif; font-size: 15px; font-weight: 800; margin-bottom: 6px; }
.cta-banner-sub { font-size: 12px; opacity: 0.7; margin-bottom: 14px; }
.cta-banner-btn {
  display: inline-block; padding: 10px 28px; background: var(--sim-primary);
  color: white !important; text-decoration: none; border-radius: var(--sim-radius-sm);
  font-size: 14px; font-weight: 700; transition: all 0.2s;
  box-shadow: 0 3px 12px rgba(255,107,53,0.3);
}
.cta-banner-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(255,107,53,0.4); color: white !important; }

/* --- Loading --- */
.loading-overlay {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center;
}
.loading-spinner {
  width: 40px; height: 40px; border: 4px solid var(--sim-gray-light);
  border-top-color: var(--sim-primary); border-radius: 50%;
  animation: simSpin 0.8s linear infinite; margin-bottom: 16px;
}
@keyframes simSpin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: var(--sim-gray); }
.error-card {
  background: #FEF2F2; border: 2px solid #FCA5A5; border-radius: var(--sim-radius);
  padding: 24px; text-align: center; color: #991B1B;
}
.data-version { text-align: center; font-size: 11px; color: #9CA3AF; margin-top: 12px; }

/* --- Contract Type Tabs --- */
.contract-tabs {
  display: flex; gap: 0; margin-bottom: 4px; grid-column: 1 / -1;
  background: var(--sim-gray-light); border-radius: var(--sim-radius-sm); padding: 3px;
}
.contract-tab {
  flex: 1; padding: 10px 8px; border: none; background: transparent;
  font-size: 13px; font-weight: 700; color: var(--sim-gray); cursor: pointer;
  border-radius: 8px; transition: all 0.2s ease; font-family: inherit;
  white-space: nowrap;
}
.contract-tab.active {
  background: var(--sim-white); color: var(--sim-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.contract-tab:hover:not(.active) { color: var(--sim-dark); }
.kva-custom-wrap {
  grid-column: 1 / -1;
}

/* --- PC Dashboard Layout (results only) --- */
.sim-container.dash-expanded {
  max-width: 1080px;
  transition: max-width 0.35s ease;
  background: var(--sim-bg);
}
/* Override SWELL theme grid on results container */
.sim-container.dash-expanded #results {
  display: block !important;
}

/* Dashboard grid rows */
.dash-row {
  display: block; /* mobile default: stack */
}

/* Company grid */
.dash-company-grid {
  display: block; /* mobile default */
}
.dash-company-col {
  margin-bottom: 16px;
}
.dash-company-col .company-card {
  margin-bottom: 10px;
}
.dash-company-col .company-link {
  margin-bottom: 0;
}

@media (min-width: 900px) {
  /* Top row: conditions (fixed) + monthly comparison (flexible) */
  .dash-row-top {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }

  /* Chart row: donut (1fr) + cumulative bar (1fr) */
  .dash-row-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }
  .dash-row-charts .chart-card {
    margin-bottom: 0;
    min-width: 0;
  }
  .dash-row-charts > :only-child {
    grid-column: 1 / -1;
  }

  /* Company cards: 3-column grid */
  .dash-company-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .dash-company-col {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
  }
  .dash-company-col .company-card {
    flex: 1;
    flex-direction: column;
    text-align: center;
    gap: 10px;
    margin-bottom: 8px;
  }
  .dash-company-col .company-card .company-rank {
    width: auto;
  }
  .dash-company-col .company-card .company-saving {
    text-align: center;
  }
  .dash-company-col .company-link {
    margin-top: auto;
  }

  /* Let conditions card fill height */
  .dash-row-top .conditions-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    min-width: 0;
  }
  .dash-row-top .conditions-card .conditions-actions {
    margin-top: auto;
  }
  .dash-row-top .monthly-card {
    margin-bottom: 0;
    min-width: 0;
  }

  /* Monthly row text overflow protection */
  .monthly-row .name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Result hero wider style */
  .result-hero .savings-amount {
    font-size: 52px;
  }

  /* Section spacing on PC */
  .dash-row {
    margin-bottom: 16px;
  }
  .company-section {
    margin-top: 8px;
  }

  /* CTA & restart row on PC */
  .cta-banner {
    margin-top: 24px;
  }
  .restart-btn {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .sim-container { padding: 20px 12px 32px; }
  .sim-card { padding: 22px 18px; }
  .result-hero .savings-amount { font-size: 36px; }
  .progress-num { width: 28px; height: 28px; font-size: 12px; }
  .progress-label { font-size: 9px; }
  .conditions-actions { flex-direction: column; }
  .monthly-row { padding: 8px 10px; gap: 8px; }
  .monthly-row .price { font-size: 14px; }
  .formula-content { padding: 12px 14px 14px; }
  .formula-content .total-line { font-size: 14px; }
  .donut-col { max-width: 140px; }
  .donut-total { font-size: 15px; }
  .donut-label { font-size: 11px; }
  .period-btns { gap: 4px; }
  .period-btn { padding: 6px 12px; font-size: 12px; }
}
