﻿:root {
  --bg: #f6efe3;
  --panel: rgba(255, 252, 246, 0.82);
  --panel-strong: rgba(255, 249, 240, 0.96);
  --ink: #1b1f17;
  --muted: #5f6557;
  --accent: #c7681e;
  --accent-soft: #f2b36d;
  --green: #2f8f63;
  --green-soft: rgba(47, 143, 99, 0.16);
  --red: #a54434;
  --red-soft: rgba(165, 68, 52, 0.14);
  --line: rgba(27, 31, 23, 0.08);
  --shadow: 0 24px 60px rgba(73, 48, 17, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

body[data-theme='dark'] {
  --bg: #12120f;
  --panel: rgba(27, 24, 20, 0.9);
  --panel-strong: rgba(23, 20, 17, 0.98);
  --ink: #f4efe6;
  --muted: #d8d0c0;
  --accent: #f2b36d;
  --accent-soft: #f0c78f;
  --green: #57c58b;
  --green-soft: rgba(87, 197, 139, 0.18);
  --red: #ef7b6b;
  --red-soft: rgba(239, 123, 107, 0.16);
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(240, 171, 90, 0.4), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(47, 143, 99, 0.2), transparent 22%),
    linear-gradient(180deg, #fffaf2 0%, var(--bg) 55%, #efe2cf 100%);
  transition: background 220ms ease, color 220ms ease;
}

body[data-platform='native'] {
  font-family: Roboto, 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(33, 150, 243, 0.14), transparent 30%),
    linear-gradient(180deg, #f6f8fb 0%, #eef2f7 54%, #e3e8ef 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.24) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent);
  pointer-events: none;
  transition: opacity 220ms ease;
}

body[data-theme='dark'] {
  background:
    radial-gradient(circle at top left, rgba(174, 114, 33, 0.16), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(69, 183, 126, 0.12), transparent 22%),
    linear-gradient(180deg, #151410 0%, var(--bg) 55%, #0e0d0b 100%);
}

body[data-platform='native']::before {
  opacity: 0.12;
  background-size: 44px 44px;
}

body[data-theme='dark']::before {
  opacity: 0.35;
}

body[data-theme='dark'] .hero {
  color: #1b1f17;
}

body[data-theme='dark'] .hero h1,
body[data-theme='dark'] .hero .stat-price,
body[data-theme='dark'] .hero .stat-card {
  color: #1b1f17;
}

body[data-theme='dark'] .hero .stat-label,
body[data-theme='dark'] .hero .stat-detail,
body[data-theme='dark'] .hero .panel-meta {
  color: rgba(27, 31, 23, 0.84);
}

body[data-theme='dark'] .hero .stat-detail-strong {
  color: #c7681e;
}

body[data-theme='dark'] .hero-chart-panel {
  color: var(--ink);
}

body[data-theme='dark'] .hero-chart-panel .panel-kicker,
body[data-theme='dark'] .hero-chart-panel .panel-meta,
body[data-theme='dark'] .hero-chart-panel .price-chart-bar-label {
  color: #ece6db;
}

body[data-theme='dark'] .hero-chart-panel .panel-meta {
  background: rgba(24, 22, 18, 0.94);
  color: #f5efe4;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-theme='dark'] .hero-chart-panel .panel-meta strong {
  background: rgba(87, 197, 139, 0.18);
  color: #86efac;
  text-shadow: none;
}

body[data-theme='dark'] .hero-chart-panel h3 {
  color: var(--ink);
}

body[data-theme='dark'] .hero-chart-panel .empty-state {
  color: #ece6db;
}

body[data-theme='dark'] .hero-chart-panel .price-chart-scroll {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 18px;
}

body[data-theme='dark'] .layout .panel,
body[data-theme='dark'] .layout .hour-card,
body[data-theme='dark'] .layout .appliance-row,
body[data-theme='dark'] .layout .appliance-builder,
body[data-theme='dark'] .layout .appliance-card {
  color: #f4efe6;
}

body[data-theme='dark'] .layout .panel-head h3,
body[data-theme='dark'] .layout .hour-time,
body[data-theme='dark'] .layout .appliance-name,
body[data-theme='dark'] .layout .appliance-price {
  color: #fff7ee;
}

body[data-theme='dark'] .layout .panel-meta,
body[data-theme='dark'] .layout .appliance-use,
body[data-theme='dark'] .layout .appliance-price-note,
body[data-theme='dark'] .layout .appliance-meta-row,
body[data-theme='dark'] .layout .hour-badge,
body[data-theme='dark'] .layout .appliance-field,
body[data-theme='dark'] .layout .appliance-field span {
  color: #efe7d8;
}

body[data-theme='dark'] .layout .favorite-toggle {
  color: #efe7d8;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.native-app-bar,
.mobile-tab-bar {
  display: none;
}

body[data-platform='native'] .page-shell {
  width: min(100%, 1120px);
  padding: 12px 0 96px;
}

body[data-platform='native'] .hero,
body[data-platform='native'] .panel,
body[data-platform='native'] .stat-card,
body[data-platform='native'] .hour-card {
  border-radius: 22px;
  box-shadow: 0 14px 30px rgba(30, 42, 56, 0.08);
}

body[data-platform='native'] .hero,
body[data-platform='native'] .panel {
  backdrop-filter: none;
}

body[data-platform='native'] .hero {
  border: 1px solid rgba(120, 138, 156, 0.14);
  background: rgba(255, 255, 255, 0.78);
}

body[data-platform='native'] .stat-card {
  border: 1px solid rgba(120, 138, 156, 0.12);
  background: rgba(255, 255, 255, 0.92);
}

body[data-platform='native'] .panel {
  border: 1px solid rgba(120, 138, 156, 0.12);
  background: rgba(255, 255, 255, 0.92);
}

body[data-platform='native'] .native-app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
  margin-bottom: 14px;
  padding: 10px 2px 12px;
  background: linear-gradient(180deg, rgba(246, 248, 251, 0.98), rgba(246, 248, 251, 0.86));
  backdrop-filter: blur(12px);
}

body[data-platform='native'] .native-app-bar-copy {
  min-width: 0;
}

body[data-platform='native'] .native-app-bar-kicker {
  margin: 0;
  color: #5b6674;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-platform='native'] .native-app-bar-title {
  margin: 4px 0 0;
  color: #142033;
  font-size: 1.35rem;
  line-height: 1.1;
}

body[data-platform='native'] .native-app-bar-subtitle {
  margin: 4px 0 0;
  color: #607082;
  font-size: 0.88rem;
}

body[data-platform='native'] .native-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #2d6df6, #1a56db);
  color: #fff;
  font: inherit;
  font-size: 1.2rem;
  box-shadow: 0 12px 24px rgba(26, 86, 219, 0.25);
}


.page-shell,
.hero,
.panel,
.stat-card,
.summary-grid,
.window-grid,
.hours-list,
.appliance-grid,
.price-chart,
.price-chart-scroll {
  min-width: 0;
}

.hero,
.panel,
.stat-card,
.hour-card {
  backdrop-filter: blur(14px);
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255, 250, 242, 0.94), rgba(255, 245, 230, 0.74));
  box-shadow: var(--shadow);
  animation: rise 700ms ease;
}

.hero-compact {
  padding-bottom: 20px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-brand {
  min-width: 0;
}

.app-title {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-kicker,
.stat-label,
.hero-panel-label,
.hour-period,
.panel-meta,
.stat-detail,
.hour-badge {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-kicker,
.hero-panel-label {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
}

.hero h1 {
  margin: 0;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(31, 30, 21, 0.95), rgba(43, 43, 28, 0.88));
  color: #f9f3e9;
}

.hero-panel-value {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.15;
}

.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #f5b24a, #d96a24);
  color: #241606;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 12px 24px rgba(217, 106, 36, 0.22);
}

.primary-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.theme-toggle {
  min-width: 0;
  width: 46px;
  height: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  flex-shrink: 0;
}

.theme-toggle-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.layout {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.hero-summary-grid {
  margin-top: 4px;
}

.stat-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 40px rgba(82, 57, 22, 0.09);
  animation: rise 760ms ease both;
}

.stat-card-highlight {
  background: linear-gradient(135deg, var(--summary-base, rgba(22, 163, 74, 0.34)), var(--summary-soft, rgba(245, 158, 11, 0.18)));
  border-color: var(--summary-border, rgba(22, 163, 74, 0.22));
  box-shadow: 0 18px 40px rgba(22, 163, 74, 0.08);
}

.stat-card-tone {
  background: linear-gradient(135deg, var(--summary-base, rgba(22, 163, 74, 0.34)), var(--summary-soft, rgba(245, 158, 11, 0.18)));
  border-color: var(--summary-border, rgba(22, 163, 74, 0.22));
  box-shadow: 0 18px 40px rgba(22, 163, 74, 0.08);
}

.stat-card-cheapest {
  background: linear-gradient(135deg, var(--summary-base, rgba(22, 163, 74, 0.42)), var(--summary-soft, rgba(134, 239, 172, 0.34)));
  border-color: var(--summary-border, rgba(22, 163, 74, 0.28));
  box-shadow: 0 18px 40px rgba(22, 163, 74, 0.14);
}

.stat-label {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.stat-card h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.02;
}

.stat-price,
.hour-price {
  margin: 10px 0 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.3rem;
  line-height: 1.25;
}

.stat-detail {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.stat-detail-strong {
  color: var(--accent);
  font-weight: 700;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 24px 54px rgba(83, 58, 29, 0.1);
  animation: rise 840ms ease both;
}

.hero-chart-panel {
  margin-top: 0;
}

.hero-chart-panel .panel-head {
  margin-bottom: 14px;
}

.hero-chart-panel .price-chart {
  margin-top: 0;
}.price-reference-meta {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.price-reference-current {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(27, 31, 23, 0.08);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 24px rgba(82, 57, 22, 0.05);
}

.price-reference-kicker {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.price-reference-current strong {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.7rem;
  line-height: 1.1;
}

.price-reference-current span:last-child {
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.92rem;
}

.price-slider-shell {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.price-slider-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.price-hour-slider {
  width: 100%;
  accent-color: var(--accent);
}

.price-hour-slider:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(196, 104, 30, 0.18);
}

.price-slider-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
}

.price-focus-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.focus-hour-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.focus-hour-card > div {
  width: 100%;
  min-width: 0;
}

.focus-hour-card .hour-time {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.1;
  white-space: nowrap;
}

.focus-hour-card .hour-period,
.focus-hour-card .hour-badge {
  margin-top: 6px;
  white-space: nowrap;
}

.focus-hour-card:hover,
.focus-hour-card:focus-visible {
  transform: translateY(-2px);
}

.focus-hour-card.is-selected {
  outline: 2px solid rgba(199, 104, 30, 0.38);
}

body[data-theme='dark'] .price-reference-current {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme='dark'] .price-reference-kicker,
body[data-theme='dark'] .price-slider-label,
body[data-theme='dark'] .price-slider-axis,
body[data-theme='dark'] .focus-hour-card .focus-hour-label {
  color: #d7d0c4;
}

.focus-hour-card .hour-price {
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
}

.focus-hour-card .hour-badge {
  text-align: left;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.appliance-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.appliance-controls label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.appliance-controls select {
  min-width: 220px;
  border: 1px solid rgba(27, 31, 23, 0.12);
  border-radius: 999px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
  box-shadow: 0 10px 24px rgba(82, 57, 22, 0.06);
}

.panel-head h3 {
  margin: 0;
  font-size: clamp(1.6rem, 2.6vw, 1.9rem);
}

.panel-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.appliance-panel {
  position: relative;
  overflow: hidden;
}

.appliance-panel::after {
  content: '';
  position: absolute;
  inset: auto -10% -35% auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(22, 163, 74, 0.22), transparent 70%);
  pointer-events: none;
}

.tomorrow-panel {
  position: relative;
  overflow: hidden;
}

.tomorrow-panel::after {
  content: '';
  position: absolute;
  inset: -20% auto auto -10%;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.16), transparent 70%);
  pointer-events: none;
}

.tomorrow-summary {
  margin-top: 14px;
}

.tomorrow-hours {
  margin-top: 18px;
}

.tomorrow-stat {
  min-height: 100%;
}

.tomorrow-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.45);
}

.tomorrow-empty-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

.tomorrow-empty-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.secondary-button {
  border: 1px solid rgba(27, 31, 23, 0.12);
  border-radius: 999px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.secondary-button:hover {
  transform: translateY(-1px);
}

.secondary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.appliance-builder {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(27, 31, 23, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.6);
}

.appliance-builder-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.appliance-builder-head h4 {
  margin: 0;
  font-size: 1.05rem;
}

.appliance-custom-rows {
  display: grid;
  gap: 12px;
}

.appliance-row {
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(27, 31, 23, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.appliance-row-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(120px, 0.6fr) auto;
  gap: 12px;
  align-items: end;
}

.appliance-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.appliance-field select,
.appliance-field input {
  border: 1px solid rgba(27, 31, 23, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font: inherit;
  width: 100%;
  min-width: 0;
}

body[data-theme='dark'] .stat-card,
body[data-theme='dark'] .panel,
body[data-theme='dark'] .hero,
body[data-theme='dark'] .hour-card,
body[data-theme='dark'] .appliance-row,
body[data-theme='dark'] .appliance-builder {
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme='dark'] .secondary-button,
body[data-theme='dark'] .appliance-controls select,
body[data-theme='dark'] .appliance-field select,
body[data-theme='dark'] .appliance-field input {
  background: rgba(31, 28, 24, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

body[data-theme='dark'] .stat-label,
body[data-theme='dark'] .stat-detail,
body[data-theme='dark'] .panel-meta,
body[data-theme='dark'] .appliance-use,
body[data-theme='dark'] .appliance-price-note,
body[data-theme='dark'] .price-chart-bar-label,
body[data-theme='dark'] .hour-badge,
body[data-theme='dark'] .appliance-field,
body[data-theme='dark'] .appliance-field span,
body[data-theme='dark'] .hour-period {
  color: #ece6db;
}

body[data-theme='dark'] .stat-detail {
  color: #e5dece;
}

body[data-theme='dark'] .panel-meta,
body[data-theme='dark'] .appliance-use,
body[data-theme='dark'] .appliance-price-note,
body[data-theme='dark'] .price-chart-bar-label {
  color: #d9d2c5;
}

body[data-theme='dark'] .appliance-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #f7f2ea;
}

body[data-theme='dark'] .price-chart-bar-track {
  border-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.02);
}

body[data-theme='dark'] .price-chart-bar.is-current .price-chart-bar-track {
  border-color: rgba(242, 179, 109, 0.54);
}

body[data-theme='dark'] .price-chart-bar.is-selected .price-chart-bar-track {
  border-color: rgba(242, 179, 109, 0.82);
  box-shadow: 0 0 0 2px rgba(242, 179, 109, 0.16) inset;
}

body[data-theme='dark'] .price-chart-bar.is-cheapest .price-chart-bar-track {
  border-color: rgba(87, 197, 139, 0.56);
}

body[data-theme='dark'] .price-chart-bar.is-most-expensive .price-chart-bar-track {
  border-color: rgba(239, 123, 107, 0.56);
}

body[data-theme='dark'] .favorite-toggle {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e6dfd3;
}

body[data-theme='dark'] .favorite-toggle.is-favorite {
  background: rgba(245, 189, 85, 0.16);
  color: #fff8ee;
  border-color: rgba(245, 189, 85, 0.3);
}

body[data-theme='dark'] .tomorrow-empty {
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme='dark'] .row-remove-button {
  background: rgba(239, 123, 107, 0.12);
  border-color: rgba(239, 123, 107, 0.24);
}

body[data-theme='dark'] .row-remove-button:hover {
  background: rgba(239, 123, 107, 0.2);
}

.appliance-field-name.is-hidden {
  display: none;
}

.row-remove-button {
  align-self: stretch;
  border: 1px solid rgba(165, 68, 52, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(165, 68, 52, 0.08);
  color: var(--red);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.row-remove-button:hover {
  background: rgba(165, 68, 52, 0.14);
}

.appliance-subsection {
  margin-top: 18px;
}

.appliance-subsection-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.appliance-subsection-copy {
  min-width: 0;
}

.appliance-subsection-copy .panel-kicker {
  margin-bottom: 8px;
}

.appliance-subsection-toggle:hover .appliance-subsection-icon {
  transform: translateY(1px);
}

.appliance-subsection-icon {
  flex-shrink: 0;
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.appliance-subsection-body {
  display: block;
}

.appliance-subsection-body.is-collapsed {
  display: none;
}

.appliance-subhead {
  margin-bottom: 16px;
}

.appliance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.appliance-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--summary-border, rgba(22, 163, 74, 0.22));
  background: linear-gradient(135deg, var(--summary-base, rgba(22, 163, 74, 0.34)), var(--summary-soft, rgba(245, 158, 11, 0.18)));
  box-shadow: 0 16px 32px rgba(82, 57, 22, 0.08);
  overflow: hidden;
}

.appliance-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  border-radius: inherit;
  background: var(--appliance-emphasis, rgba(22, 163, 74, 0.45));
}

.appliance-card.is-favorite {
  box-shadow:
    0 16px 32px rgba(82, 57, 22, 0.08),
    0 0 0 1px rgba(245, 158, 11, 0.18) inset;
}

.appliance-card-head,
.appliance-price-row,
.appliance-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.appliance-card-head {
  align-items: flex-start;
}

.appliance-card-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.appliance-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.appliance-name {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
}

.appliance-use {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.appliance-badge {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.favorite-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(27, 31, 23, 0.12);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.favorite-toggle:hover {
  transform: translateY(-1px);
}

.favorite-toggle.is-favorite {
  background: rgba(245, 158, 11, 0.18);
  color: var(--ink);
  border-color: rgba(245, 158, 11, 0.34);
}

.favorite-toggle span:first-child {
  font-size: 1rem;
  line-height: 1;
}

.appliance-price {
  font-size: 1.7rem;
  font-weight: 700;
}

.appliance-price-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.appliance-meta-row {
  border-top: 1px solid rgba(27, 31, 23, 0.08);
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.text-saving {
  color: var(--green);
}

.text-warning {
  color: var(--red);
}

.window-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.price-chart {
  margin-top: 2px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.price-chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 8px 8px;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  width: 100%;
  max-width: 100%;
}

.price-chart-bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(40px, 44px));
  gap: 10px;
  width: max-content;
  min-width: 100%;
  align-items: end;
}

.price-chart-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  min-width: 0;
  scroll-snap-align: center;
}

.price-chart-bar-track {
  position: relative;
  display: block;
  height: 180px;
  border-radius: 18px;
  border: 1px solid rgba(27, 31, 23, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.1)),
    rgba(255, 255, 255, 0.22);
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.price-chart-bar-value {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  display: none;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(82, 57, 22, 0.12);
}

.price-chart-bar-fill {
  position: absolute;
  inset: auto 0 0;
  border-radius: 18px 18px 14px 14px;
  box-shadow: 0 10px 20px rgba(22, 163, 74, 0.18);
}

.price-chart-bar:hover .price-chart-bar-track,
.price-chart-bar:focus-visible .price-chart-bar-track {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(82, 57, 22, 0.08);
}

.price-chart-bar.is-current .price-chart-bar-track {
  border-color: rgba(196, 104, 30, 0.52);
}

.price-chart-bar.is-selected .price-chart-bar-track {
  border-color: rgba(196, 104, 30, 0.78);
  box-shadow: 0 0 0 2px rgba(196, 104, 30, 0.14) inset;
}

.price-chart-bar.is-selected .price-chart-bar-value,
.price-chart-bar.is-current .price-chart-bar-value {
  display: inline-flex;
}

.price-chart-bar.is-cheapest .price-chart-bar-track {
  border-color: rgba(47, 143, 99, 0.58);
}

.price-chart-bar.is-most-expensive .price-chart-bar-track {
  border-color: rgba(165, 68, 52, 0.58);
}

.price-chart-bar.is-window-best .price-chart-bar-track {
  box-shadow: 0 0 0 2px rgba(47, 143, 99, 0.12) inset;
}

.price-chart-bar-label {
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88rem;
  line-height: 1.25;
  text-align: center;
}

.hours-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hour-card {
  position: relative;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 243, 233, 0.92));
  transition: transform 160ms ease, border-color 160ms ease;
  overflow: hidden;
}

.hour-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  border-radius: inherit;
  opacity: 0.95;
}

.hour-card:hover {
  transform: translateY(-2px);
}

.hour-card.is-heat {
  background: linear-gradient(135deg, var(--heat-base), var(--heat-soft));
  border-color: var(--heat-border);
}

.hour-card[data-price-band='verde'] {
  color: inherit;
}

.hour-card[data-price-band='verde']::before {
  background: linear-gradient(180deg, #16a34a, #22c55e);
}

.hour-card[data-price-band='ambar'] {
  color: inherit;
}

.hour-card[data-price-band='ambar']::before {
  background: linear-gradient(180deg, #f59e0b, #facc15);
}

.hour-card[data-price-band='rojo'] {
  color: inherit;
}

.hour-card[data-price-band='rojo']::before {
  background: linear-gradient(180deg, #dc2626, #fb7185);
}

.hour-card.is-highlight {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 10px 24px rgba(31, 41, 55, 0.08);
}

.hour-card.is-current {
  outline: 2px solid rgba(199, 104, 30, 0.34);
}

.hour-time {
  margin: 0;
  font-size: 1.48rem;
  font-weight: 700;
}

.hour-period,
.hour-badge {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.hour-period {
  display: none;
}

.hour-card[data-price-band='verde'] .hour-badge {
  color: var(--green);
}

.hour-card[data-price-band='ambar'] .hour-badge {
  color: #b7791f;
}

.hour-card[data-price-band='rojo'] .hour-badge {
  color: var(--red);
}

.hour-badge {
  text-align: right;
}

.empty-state {
  margin: 0;
  padding: 12px 0;
  color: var(--muted);
}

body.is-loading .stat-label,
body.is-loading .stat-card h2,
body.is-loading .stat-price,
body.is-loading .stat-detail,
body.is-loading .panel-meta,
body.is-loading #fecha-datos,
body.is-loading #fuente-datos,
body.is-loading #appliance-hint,
body.is-loading #appliance-custom-note,
body.is-loading .appliance-field span,
body.is-loading .hour-time,
body.is-loading .hour-price,
body.is-loading .hour-badge,
body.is-loading .appliance-name,
body.is-loading .appliance-use,
body.is-loading .appliance-price,
body.is-loading .appliance-price-note,
body.is-loading .appliance-meta-row strong {
  color: transparent !important;
  background: linear-gradient(90deg, rgba(224, 217, 204, 0.25), rgba(255, 255, 255, 0.95), rgba(224, 217, 204, 0.25));
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 999px;
}

body.is-loading .stat-card h2 {
  min-height: 2.5rem;
}

body.is-loading .stat-price {
  min-height: 1.2rem;
}

body.is-loading .stat-detail {
  min-height: 2.1rem;
}

body.is-loading .panel-meta,
body.is-loading #fecha-datos,
body.is-loading #fuente-datos,
body.is-loading #appliance-hint,
body.is-loading #appliance-custom-note {
  min-height: 1rem;
}

body.is-loading .hour-time,
body.is-loading .appliance-name,
body.is-loading .appliance-price {
  min-height: 1.25rem;
}

body.is-loading .hour-badge,
body.is-loading .hour-price,
body.is-loading .appliance-use,
body.is-loading .appliance-price-note,
body.is-loading .appliance-meta-row strong {
  min-height: 0.95rem;
}

.skeleton-card {
  position: relative;
  overflow: hidden;
}

.skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 15%, rgba(255, 255, 255, 0.55) 35%, transparent 55%);
  transform: translateX(-120%);
  animation: shimmer 1.35s ease-in-out infinite;
  pointer-events: none;
}

.skeleton-line {
  display: block;
  background: linear-gradient(90deg, rgba(214, 207, 194, 0.48), rgba(255, 255, 255, 0.96), rgba(214, 207, 194, 0.48));
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-line-sm {
  height: 0.7rem;
}

.skeleton-line-md {
  height: 0.9rem;
}

.skeleton-line-lg {
  height: 1.1rem;
}

.skeleton-line-xl {
  height: 1.5rem;
}

.skeleton-pill {
  height: 2.55rem;
  border-radius: 999px;
}

.skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 920px) {
  .appliance-grid,
  .window-grid,
  .hours-list,
  .tomorrow-summary {
    grid-template-columns: 1fr;
  }

  .hero-top {
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
  }

  .theme-toggle {
    width: 100%;
  }

  .panel-head {
    align-items: start;
    flex-direction: column;
  }

  .appliance-builder-head,
  .appliance-row-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .appliance-builder-head {
    align-items: start;
  }

  .appliance-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .appliance-card-actions {
    width: 100%;
    align-items: flex-start;
  }

  .appliance-controls {
    align-items: flex-start;
    width: 100%;
  }

  .appliance-controls select {
    width: 100%;
    min-width: 0;
  }

  .appliance-price-row,
  .appliance-meta-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .price-chart-bars {
    grid-template-columns: repeat(24, minmax(38px, 40px));
    min-width: 100%;
  }

  .hour-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .hour-badge {
    text-align: left;
  }
}

@media (max-width: 640px) {
  body[data-platform='native'] .native-app-bar {
    display: flex;
  }

  body[data-platform='native'] .mobile-tab-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 40;
    padding: 8px;
    border-radius: 20px;
    border: 1px solid rgba(120, 138, 156, 0.18);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 32px rgba(20, 32, 51, 0.14);
    backdrop-filter: blur(12px);
  }

  body[data-platform='native'] .mobile-tab-bar button {
    border: 0;
    border-radius: 14px;
    padding: 12px 8px;
    background: rgba(31, 111, 235, 0.08);
    color: #173052;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
  }

  .page-shell {
    width: min(100% - 20px, 1120px);
    padding: 18px 0 36px;
  }

  .hero,
  .panel {
    padding: 14px;
    border-radius: 20px;
  }

  .hero {
    gap: 8px;
  }

  .hero-top {
    flex-direction: row;
    align-items: center;
  }

  .hero-actions {
    width: auto;
  }

  .hero-chart-panel {
    padding: 12px;
  }

  .hero h1 {
    font-size: 1.05rem;
    max-width: 100%;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero-summary-grid {
    margin-top: 2px;
  }

  .stat-card {
    padding: 10px 10px 11px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .stat-card h2 {
    margin-bottom: 4px;
    font-size: clamp(1.15rem, 5vw, 1.55rem);
  }

  .stat-price {
    margin-top: 12px;
    font-size: 1.08rem;
    line-height: 1.15;
    white-space: nowrap;
  }

  .stat-label {
    margin-bottom: 6px;
    font-size: 0.64rem;
    line-height: 1.1;
  }

  .stat-detail {
    display: none;
  }

  .panel-head {
    margin-bottom: 10px;
  }

  .panel-head > div,
  .appliance-builder-head > div,
  .appliance-card-copy,
  .appliance-card-actions,
  .appliance-field,
  .appliance-row-grid,
  .appliance-price-row,
  .appliance-meta-row,
  .hour-card,
  .stat-card,
  .tomorrow-empty {
    min-width: 0;
  }

  .panel-head h3 {
    font-size: 1.08rem;
  }

  .panel-meta {
    font-size: 0.72rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .hero-chart-panel .panel-kicker,
  .hero-chart-panel .panel-meta {
    display: block;
  }

  .hero-chart-panel .panel-kicker {
    display: none;
  }

  .hero-chart-panel .panel-meta {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    color: #1b1f17;
    font-size: 0.82rem;
  }

  .hero-chart-panel .panel-meta strong {
    display: inline-block;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.14);
    color: #0f6b33;
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  }

  body[data-theme='dark'] .hero-chart-panel .panel-meta {
    background: rgba(255, 248, 235, 0.94);
    color: #1b1f17;
    border: 1px solid rgba(27, 31, 23, 0.08);
  }

  body[data-theme='dark'] .hero-chart-panel .panel-meta strong {
    background: rgba(47, 143, 99, 0.14);
    color: #0f6b33;
  }

  .appliance-panel .panel-head {
    align-items: flex-start;
    margin-bottom: 10px;
  }

  .appliance-panel {
    padding-bottom: 14px;
  }

  .appliance-panel::after {
    display: none;
  }

  .appliance-panel #appliance-grid {
    display: none;
  }

  .appliance-panel .appliance-controls {
    margin-top: 12px;
  }

  .appliance-panel .appliance-subsection {
    margin-top: 12px;
  }

  .appliance-panel .appliance-subsection-body {
    margin-top: 12px;
  }

  .appliance-panel .appliance-subsection .panel-head {
    margin-bottom: 8px;
  }

  .appliance-panel .appliance-subsection .panel-meta {
    display: block;
  }

  .appliance-panel .appliance-builder {
    margin-top: 12px;
  }

  .stat-card-cheapest {
    border: 3px solid rgba(0, 185, 76, 0.95);
    box-shadow:
      0 0 0 3px rgba(0, 185, 76, 0.18),
      0 18px 40px rgba(0, 185, 76, 0.18);
    outline: 2px solid rgba(255, 255, 255, 0.25);
    outline-offset: -7px;
  }

  .stat-card-cheapest::after {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(0, 185, 76, 0.45);
    border-radius: inherit;
    pointer-events: none;
  }

  .appliance-builder,
  .appliance-row {
    padding: 12px;
  }

  .appliance-card {
    padding: 12px;
  }

  .appliance-card-head,
  .appliance-card-actions {
    width: 100%;
  }

  .appliance-card-actions {
    align-items: flex-start;
  }

  .appliance-card-actions .favorite-toggle,
  .appliance-card-actions .appliance-badge,
  .row-remove-button,
  .secondary-button,
  .theme-toggle,
  .appliance-controls select {
    width: 100%;
  }

  .appliance-price-row {
    gap: 6px;
  }

  .appliance-price {
    font-size: 1.08rem;
  }

  .price-chart-bars {
    grid-template-columns: repeat(24, minmax(30px, 34px));
    min-width: 100%;
    gap: 6px;
  }

  .price-chart-bar-track {
    height: 118px;
  }

  .hours-list,
  .appliance-grid {
    gap: 12px;
  }

  .window-grid {
    gap: 12px;
  }

  #appliance-hint,
  #appliance-custom-note,
  #tomorrow-hint,
  .appliance-use,
  .appliance-price-note,
  .tomorrow-empty-text,
  .appliance-meta-row {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #appliance-hint,
  #appliance-custom-note,
  #tomorrow-hint {
    text-transform: none;
    letter-spacing: 0.01em;
  }

  .theme-toggle {
    width: 42px;
    height: 42px;
    padding: 0;
  }

  body[data-platform='native'] .page-shell {
    padding-bottom: 96px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    max-width: 100%;
  }

  .hero-chart-panel {
    padding: 12px;
  }

  .panel-head h3,
  .appliance-builder-head h4 {
    line-height: 1.2;
  }

  .appliance-controls label,
  .panel-meta,
  .stat-label,
  .appliance-field {
    letter-spacing: 0.03em;
  }

  .appliance-builder,
  .appliance-row,
  .appliance-card,
  .stat-card,
  .hour-card,
  .tomorrow-empty {
    border-radius: 18px;
  }

  .stat-card h2 {
    font-size: 1.9rem;
  }

  .appliance-price {
    font-size: 1.26rem;
  }

  .favorite-toggle,
  .row-remove-button,
  .secondary-button {
    justify-content: center;
  }

  .price-chart-bars {
    grid-template-columns: repeat(24, minmax(32px, 36px));
    min-width: 100%;
  }

  .hero-chart-panel .price-chart-bar-track {
    height: 118px;
  }

  .price-chart-bar-value {
    top: 8px;
    padding: 5px 10px;
    font-size: 0.68rem;
    box-shadow: 0 10px 22px rgba(82, 57, 22, 0.18);
  }
}

