.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--text-dim);
  text-decoration: none; margin-bottom: 20px; padding: 6px 12px;
  border-radius: 8px; border: 1px solid var(--border); transition: all .15s;
}
.back-link:hover { color: var(--text); background: var(--surface-2); }

.name {
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 22px;
}
.label { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.big { font-family: var(--font-mono); font-size: 56px; font-weight: 600; letter-spacing: -2px; line-height: 1; }
.unit { font-family: var(--font-ui); font-size: 16px; font-weight: 400; color: var(--text-dim); margin-left: 4px; }
.time { font-size: 13px; color: var(--text-dim); margin-top: 8px; }
.green { color: var(--good); }
.red { color: var(--danger); }

.price-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-trend {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  padding: 4px 9px; border-radius: 999px;
}
.price-trend svg { width: 12px; height: 12px; }
.price-trend.trend-up { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.price-trend.trend-down { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.price-trend.trend-flat { color: var(--text-dim); background: var(--surface); }

.price-insight {
  font-size: 13px; margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.price-insight.tone-good { color: var(--good); }
.price-insight.tone-bad { color: var(--danger); }
.price-insight.tone-warn { color: var(--warn); }
.price-insight.tone-neutral { color: var(--text-dim); }

.row2 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 28px; }
.box { padding: 18px; background: var(--surface); border-radius: 10px; }
.box .label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.box .big { font-size: 28px; letter-spacing: -0.5px; }
.box .time { margin-top: 8px; }

.cheap-window {
  margin-top: 16px; padding: 20px; border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.cheap-window.exp-window {
  background: color-mix(in srgb, var(--danger) 6%, var(--bg));
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}
.cheap-window-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.cheap-window svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.cheap-window.exp-window svg { color: var(--danger); }
.cheap-window-label { font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; flex: 1; }
.cheap-window-body { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cheap-window-value { font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.cheap-window-toggle { margin-left: auto; }

.notice {
  font-size: 13px; color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  border-radius: 10px; padding: 14px 16px;
}
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.section-title-row .section-title { margin-bottom: 0; }
.section-title-row .toggle-btn { padding: 5px 10px; font-size: 12px; }

.price-table { width: 100%; border-collapse: collapse; }
.price-table th {
  text-align: right; font-size: 11px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.price-table th:first-child, .price-table td:first-child { text-align: left; }
.price-table td {
  padding: 9px 10px; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  font-size: 13px; text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.price-table td.hour-cell { font-family: var(--font-ui); font-weight: 500; }
.price-table td.avg-cell { font-weight: 700; }
.price-table td.q-cell { color: var(--text-dim); font-size: 12px; }
.price-table td.q-cell.q-now { color: var(--text); font-weight: 700; background: var(--now-bg); border-left: 2px solid var(--now-border); }
.price-table td.q-cell.q-cheap { background: color-mix(in srgb, var(--good) 10%, transparent); }
.price-table td.q-cell.q-exp { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.price-table td.empty-cell { color: var(--border); font-family: var(--font-ui); }
.price-table tr.now-row td { background: var(--now-bg); }
.price-table tr.now-row td.hour-cell { border-left: 3px solid var(--now-border); }
.price-table tr.min-row td.hour-cell, .price-table tr.min-row td.avg-cell {
  border-left: 3px solid var(--good); background: color-mix(in srgb, var(--good) 12%, transparent);
}
.price-table tr.max-row td.hour-cell, .price-table tr.max-row td.avg-cell {
  border-left: 3px solid var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent);
}
.price-table tr.future-row td { opacity: 0.5; }
.price-table tr.past-row td { opacity: 0.5; }
.price-table td.cheap-window-row { background: color-mix(in srgb, var(--good) 12%, transparent); }
.price-table td.exp-window-row { background: color-mix(in srgb, var(--danger) 10%, transparent); }

.ctrls-row { display: flex; gap: 8px; margin-bottom: 18px; align-items: center; flex-wrap: wrap; }
.ctrls-row > .toggle:first-child { margin-right: auto; }

.price-chart-wrap { width: 100%; overflow-x: auto; position: relative; -webkit-overflow-scrolling: touch; }
.price-chart { width: 100%; height: 320px; display: block; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis-label { font-family: var(--font-mono); font-size: 11px; fill: var(--text-dim); }
.chart-avg-line { stroke: var(--warn); stroke-width: 1.5; stroke-dasharray: 6 4; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.chart-now-line { stroke: var(--now-border); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart-guide { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; pointer-events: none; }
.chart-hit { cursor: crosshair; touch-action: none; }
.chart-tooltip {
  position: absolute; display: none; pointer-events: none; z-index: 5;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.14); white-space: nowrap;
}
.chart-tooltip-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); margin-bottom: 3px; }
.chart-tooltip-price { font-family: var(--font-mono); font-size: 14px; font-weight: 700; }

@media (max-width: 640px) {
  .big { font-size: 42px; }
  .box .big { font-size: 28px; }
  .container { padding: 20px 14px 48px; }
  .card { padding: 20px 16px; }
  .row2 { grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
  .cheap-window { padding: 16px; }
  .cheap-window-head { flex-wrap: wrap; gap: 8px; }
  .cheap-window-toggle { margin-left: 0; }
  .cheap-window-body { gap: 10px; }
  .cheap-window-value { font-size: 14px; }
  .price-table th { font-size: 11px; padding: 8px 6px; }
  .price-table td { font-size: 13px; padding: 10px 6px; }
  .price-table { display: block; overflow-x: auto; }
  .price-chart-wrap { overflow-x: auto; }
  .price-chart { width: auto; height: auto; }
  .chart-axis-label { font-size: 12px; }
  .ctrls-row { gap: 6px; }
  .section-title { font-size: 14px; }
}
