:root {
  --bg-1: #041127;
  --bg-2: #0a2254;
  --bg-3: #103b8d;
  --panel: rgba(12, 31, 74, 0.64);
  --panel-strong: rgba(8, 23, 56, 0.82);
  --panel-soft: rgba(255, 255, 255, 0.08);
  --panel-line: rgba(255, 255, 255, 0.12);
  --text-main: #f6f9ff;
  --text-soft: #c9d6f5;
  --text-muted: #8ea7d7;
  --success: #4fe0b6;
  --warning: #ffcf67;
  --warning-strong: #ff9f5c;
  --danger: #ff708a;
  --info: #67d1ff;
  --radius-panel: 30px;
  --radius-soft: 22px;
  --shadow-deep: 0 28px 70px rgba(1, 7, 22, 0.46);
  --shadow-soft: 0 18px 40px rgba(8, 19, 45, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: "Aptos", "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 18% 12%, rgba(115, 212, 255, 0.16), transparent 24%),
    radial-gradient(circle at 88% 14%, rgba(70, 139, 255, 0.18), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(49, 91, 205, 0.28), transparent 36%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 44%, var(--bg-3));
  overflow-x: hidden;
}

body::before {
  content: "IDRALOCK";
  position: fixed;
  left: 50%;
  top: 10%;
  transform: translateX(-50%) rotate(-18deg);
  font-family: "Bahnschrift", "Segoe UI Variable Display", "Aptos Display", sans-serif;
  font-size: clamp(4.8rem, 24vw, 11rem);
  letter-spacing: 0.7rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 14% 82%, rgba(103, 209, 255, 0.08), transparent 18%),
    radial-gradient(circle at 82% 72%, rgba(255, 255, 255, 0.04), transparent 22%);
  pointer-events: none;
  z-index: 0;
}

.app-frame {
  position: relative;
  z-index: 1;
  width: min(100%, 27rem);
  margin: 0 auto;
  padding: 0.64rem 0.72rem 1.2rem;
}

.auth-screen {
  min-height: calc(100svh - 1.84rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  padding: 1.1rem 0.96rem 1rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 206, 255, 0.18), transparent 34%),
    linear-gradient(155deg, rgba(18, 53, 122, 0.82), rgba(6, 20, 47, 0.9)),
    var(--panel-strong);
}

.auth-loading-card {
  text-align: center;
}

.auth-card-copy {
  margin-bottom: 0.95rem;
}

.auth-title {
  font-size: clamp(2rem, 10vw, 2.55rem);
}

.auth-subtitle {
  margin: 0.28rem 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.35;
}

.auth-form {
  display: grid;
  gap: 0.7rem;
}

.auth-field {
  display: grid;
  gap: 0.34rem;
}

.auth-password-wrap {
  position: relative;
}

.auth-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03rem;
  text-transform: uppercase;
}

.auth-input {
  appearance: none;
  width: 100%;
  padding: 0.88rem 0.94rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.auth-input-password {
  padding-right: 3.35rem;
}

.auth-input::placeholder {
  color: rgba(201, 214, 245, 0.5);
}

.auth-input:focus {
  outline: none;
  border-color: rgba(122, 224, 255, 0.42);
  box-shadow:
    0 0 0 3px rgba(91, 166, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.password-toggle {
  appearance: none;
  position: absolute;
  top: 50%;
  right: 0.34rem;
  transform: translateY(-50%);
  width: 2.55rem;
  height: 2.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    opacity 0.16s ease;
}

.password-toggle:hover:not(:disabled) {
  transform: translateY(-50%) scale(1.03);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.password-toggle:active:not(:disabled) {
  transform: translateY(-50%) scale(0.98);
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(122, 224, 255, 0.78);
  outline-offset: 2px;
}

.password-toggle.is-active {
  background: rgba(103, 209, 255, 0.14);
  color: #eefbff;
}

.password-toggle:disabled {
  opacity: 0.68;
  cursor: wait;
}

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

.auth-submit {
  appearance: none;
  border: 0;
  min-height: 3rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #7ae0ff, #5691ff);
  color: #05132d;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    opacity 0.16s ease;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.auth-submit:disabled {
  opacity: 0.72;
  cursor: wait;
}

.auth-error {
  margin: 0;
  padding: 0.72rem 0.82rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 112, 138, 0.24);
  background: rgba(255, 112, 138, 0.12);
  color: #fff1f5;
  font-size: 0.8rem;
  line-height: 1.35;
}

.hidden {
  display: none !important;
}

.glass-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-panel);
  border: 1px solid var(--panel-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow: var(--shadow-deep);
  backdrop-filter: blur(26px);
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 52%);
  pointer-events: none;
}

.hero-panel {
  padding: 0.72rem 0.78rem 0.64rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 206, 255, 0.2), transparent 34%),
    linear-gradient(155deg, rgba(31, 88, 202, 0.82), rgba(6, 20, 47, 0.84)),
    var(--panel-strong);
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 13rem;
  height: 13rem;
  right: -5rem;
  bottom: -7rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(103, 209, 255, 0.2), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}

.hero-copy,
.hero-actions {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  margin: 0 0 0.22rem;
  color: var(--text-soft);
  font-size: 0.58rem;
  letter-spacing: 0.14rem;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-family: "Bahnschrift", "Segoe UI Variable Display", "Aptos Display", sans-serif;
  font-size: clamp(1.82rem, 8.1vw, 2.45rem);
  line-height: 0.96;
  letter-spacing: 0.05rem;
}

.hero-subtitle {
  margin: 0.24rem 0 0.48rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.3;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.dashboard-refresh-bar {
  margin-top: 0.48rem;
  padding: 0.62rem 0.78rem;
  border-radius: 24px;
  display: grid;
  gap: 0.34rem;
}

.dashboard-refresh-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.dashboard-refresh-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.03rem;
  text-transform: uppercase;
}

.dashboard-refresh-value {
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02rem;
}

.dashboard-refresh-warning {
  margin: 0;
  padding: 0.48rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 207, 103, 0.22);
  background: rgba(255, 207, 103, 0.12);
  color: #fff8e1;
  font-size: 0.73rem;
  line-height: 1.3;
}

.ghost-action,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.62rem;
  padding: 0.26rem 0.58rem;
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.025rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.ghost-action {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
}

.ghost-action-button {
  appearance: none;
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    opacity 0.16s ease;
}

.ghost-action-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.ghost-action-button:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.ghost-action-button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.status-pill {
  border: 1px solid transparent;
}

.status-control {
  appearance: none;
  position: relative;
  gap: 0.45rem;
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease,
    opacity 0.16s ease;
}

.status-control:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 22px rgba(4, 12, 34, 0.24);
}

.status-control:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.status-control:focus-visible {
  outline: 2px solid rgba(122, 224, 255, 0.78);
  outline-offset: 2px;
}

.status-control:disabled {
  cursor: not-allowed;
}

.status-control.is-disabled {
  opacity: 0.74;
}

.status-control.is-loading {
  opacity: 0.78;
}

.status-control.is-loading::after {
  content: "";
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.75s linear infinite;
}

.tone-success {
  background: rgba(79, 224, 182, 0.15);
  border-color: rgba(79, 224, 182, 0.28);
  color: #edfff8;
}

.tone-warning {
  background: rgba(255, 207, 103, 0.16);
  border-color: rgba(255, 207, 103, 0.28);
  color: #fff9e6;
}

.tone-warning-strong {
  background: rgba(255, 159, 92, 0.17);
  border-color: rgba(255, 159, 92, 0.3);
  color: #fff3e8;
}

.tone-danger {
  background: rgba(255, 112, 138, 0.16);
  border-color: rgba(255, 112, 138, 0.28);
  color: #fff2f6;
}

.tone-info {
  background: rgba(103, 209, 255, 0.16);
  border-color: rgba(103, 209, 255, 0.28);
  color: #eefbff;
}

.tone-neutral {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.13);
  color: var(--text-main);
}

.glass-panel.tone-success {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    linear-gradient(145deg, rgba(79, 224, 182, 0.12), rgba(8, 23, 56, 0.82));
  border-color: rgba(79, 224, 182, 0.18);
}

.glass-panel.tone-warning {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    linear-gradient(145deg, rgba(255, 207, 103, 0.12), rgba(8, 23, 56, 0.82));
  border-color: rgba(255, 207, 103, 0.18);
}

.glass-panel.tone-warning-strong {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    linear-gradient(145deg, rgba(255, 159, 92, 0.14), rgba(8, 23, 56, 0.82));
  border-color: rgba(255, 159, 92, 0.2);
}

.glass-panel.tone-danger {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    linear-gradient(145deg, rgba(255, 112, 138, 0.13), rgba(8, 23, 56, 0.82));
  border-color: rgba(255, 112, 138, 0.18);
}

.glass-panel.tone-info {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    linear-gradient(145deg, rgba(103, 209, 255, 0.13), rgba(8, 23, 56, 0.82));
  border-color: rgba(103, 209, 255, 0.18);
}

.glass-panel.tone-neutral {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    var(--panel);
  border-color: var(--panel-line);
}

.loading-panel,
.error-panel {
  margin-top: 0.56rem;
  padding: 0.9rem;
  text-align: center;
}

.loading-ring {
  width: 2.4rem;
  height: 2.4rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: rgba(103, 209, 255, 0.95);
  animation: spin 0.85s linear infinite;
}

.loading-title,
.error-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.loading-text,
.error-text {
  margin: 0.7rem 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.error-badge {
  display: inline-flex;
  margin-bottom: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 112, 138, 0.26);
  background: rgba(255, 112, 138, 0.14);
  color: #fff1f5;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06rem;
}

.retry-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  margin-top: 0.95rem;
  padding: 0.8rem 1.1rem;
  background: linear-gradient(135deg, #7ae0ff, #5691ff);
  color: #05132d;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.dashboard-grid {
  display: grid;
  gap: 0.56rem;
  margin-top: 0.56rem;
  align-items: stretch;
}

.hero-card {
  order: 1;
}

.plant-card {
  order: 2;
}

.consumption-combo-card {
  order: 3;
}

.learning-card {
  order: 4;
}

.consumption-summary-card {
  order: 5;
}

.average-card {
  order: 6;
}

.content-card {
  padding: 0.78rem;
  height: 100%;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.52rem;
}

.section-head-centered {
  justify-content: center;
}

.section-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01rem;
}

.message-ribbon {
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  line-height: 1.34;
  font-size: 0.8rem;
}

.primary-metric {
  margin-top: 0.5rem;
}

.metric-caption {
  display: block;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.metric-line {
  display: flex;
  align-items: baseline;
  gap: 0.38rem;
  margin-top: 0.12rem;
}

.metric-number {
  font-family: "Bahnschrift", "Segoe UI Variable Display", "Aptos Display", sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 0.95;
}

.metric-unit {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-list {
  display: grid;
  gap: 0.42rem;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.54rem 0.66rem;
  border-radius: var(--radius-soft);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-label,
.tile-label {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}

.learning-grid .info-tile-wide {
  grid-column: 1 / -1;
  min-height: 4rem;
}

.info-tile {
  min-height: 4.55rem;
  padding: 0.6rem;
  border-radius: var(--radius-soft);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.34rem;
}

.tile-value {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.24;
  word-break: break-word;
}

.consumption-combo-card {
  padding-bottom: 0.7rem;
}

.consumption-combo-layout {
  display: grid;
  gap: 0.36rem;
}

.gauge-wrap {
  position: relative;
  width: min(100%, 10.8rem);
  margin: 0 auto;
}

.gauge-svg {
  display: block;
  width: 100%;
  height: auto;
}

.gauge-shadow,
.gauge-track,
.gauge-progress {
  fill: none;
  stroke-linecap: round;
}

.gauge-shadow {
  stroke-width: 20;
  stroke: rgba(0, 0, 0, 0.14);
}

.gauge-track {
  stroke-width: 15;
  stroke: rgba(255, 255, 255, 0.08);
}

.gauge-progress {
  stroke-width: 12;
  stroke: url(#gaugeGradient);
  filter: drop-shadow(0 0 18px rgba(103, 209, 255, 0.22));
  transition: stroke-dashoffset 0.7s ease, stroke 0.35s ease;
}

.gauge-center {
  position: absolute;
  inset: 50% 0 auto;
  transform: translateY(-28%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.04rem;
}

.gauge-value {
  font-family: "Bahnschrift", "Segoe UI Variable Display", "Aptos Display", sans-serif;
  font-size: 1.52rem;
  font-weight: 800;
  line-height: 0.95;
}

.gauge-unit {
  margin-top: -0.04rem;
  color: var(--text-soft);
  font-size: 0.65rem;
  font-weight: 700;
}

.gauge-label {
  color: var(--text-muted);
  font-size: 0.66rem;
}

.gauge-meta {
  display: flex;
  justify-content: space-between;
  margin-top: -0.58rem;
  color: var(--text-muted);
  font-size: 0.63rem;
}

.consumption-card {
  text-align: center;
}

.consumption-inline {
  display: grid;
  gap: 0.28rem;
  padding: 0.6rem 0.72rem 0.22rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.consumption-inline-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
}

.consumption-summary-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    linear-gradient(145deg, rgba(103, 209, 255, 0.08), rgba(8, 23, 56, 0.82));
}

.history-cta-wrap {
  margin-top: 0.58rem;
}

.history-cta-button {
  appearance: none;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  min-height: 2.8rem;
  padding: 0.74rem 0.92rem;
  border-radius: 999px;
  border: 1px solid rgba(103, 209, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(103, 209, 255, 0.08);
  color: var(--text-main);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    box-shadow 0.16s ease;
}

.history-cta-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 12px 24px rgba(8, 19, 45, 0.26);
}

.history-cta-button:active {
  transform: translateY(0) scale(0.99);
}

.history-cta-icon {
  font-size: 0.92rem;
}

.history-cta-text {
  letter-spacing: 0.01rem;
}

.consumption-list {
  display: grid;
  gap: 0.48rem;
}

.consumption-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.68rem 0.72rem 0.64rem;
  border-radius: var(--radius-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.consumption-label {
  color: var(--text-muted);
  font-size: 0.64rem;
  letter-spacing: 0.03rem;
  text-transform: uppercase;
}

.consumption-value {
  font-family: "Bahnschrift", "Segoe UI Variable Display", "Aptos Display", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  text-align: right;
  line-height: 1;
}

.history-view {
  margin-top: 0.56rem;
  min-width: 0;
}

.history-panel {
  display: grid;
  gap: 0.72rem;
  min-width: 0;
  max-width: 100%;
}

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

.history-panel-title {
  font-size: 1rem;
}

.history-range-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}

.history-range-button {
  appearance: none;
  min-height: 2.55rem;
  padding: 0.68rem 0.72rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.history-range-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.history-range-button.is-active {
  border-color: rgba(103, 209, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(103, 209, 255, 0.12);
  color: var(--text-main);
}

.history-range-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.history-feedback {
  padding: 0.78rem 0.64rem 0.18rem;
  text-align: center;
}

.history-loading-ring {
  margin-bottom: 0.74rem;
}

.history-retry-button {
  margin-top: 0.7rem;
}

.history-content {
  display: grid;
  gap: 0.68rem;
  min-width: 0;
  max-width: 100%;
}

.history-chart-card,
.history-list-card {
  min-width: 0;
  max-width: 100%;
  padding: 0.78rem 0.72rem;
  border-radius: var(--radius-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.history-chart {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(2.45rem, 2.45rem);
  align-items: end;
  gap: 0.48rem;
  width: max-content;
  min-width: 100%;
  max-width: none;
  min-height: 12.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding-bottom: 0.18rem;
  padding-right: 0.18rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(103, 209, 255, 0.42) transparent;
}

.history-chart::-webkit-scrollbar {
  height: 0.4rem;
}

.history-chart::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(103, 209, 255, 0.3);
}

.history-bar {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
  min-width: 2.45rem;
}

.history-bar-top {
  height: 8.9rem;
  display: flex;
  align-items: flex-end;
}

.history-bar-fill {
  width: 100%;
  min-height: 0.32rem;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, #7ae0ff, #4a74ff);
  box-shadow: 0 10px 24px rgba(74, 116, 255, 0.26);
}

.history-bar-fill.is-zero {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.history-bar-value {
  color: var(--text-soft);
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
}

.history-bar-label {
  color: var(--text-muted);
  font-size: 0.62rem;
  text-align: center;
}

.history-list {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
  max-width: 100%;
}

.history-empty {
  margin: 0;
  padding: 1.2rem 0.4rem;
  color: var(--text-soft);
  font-size: 0.8rem;
  text-align: center;
}

.history-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.62rem 0.66rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.history-list-date {
  min-width: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.history-list-value {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: right;
}

.average-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    linear-gradient(145deg, rgba(79, 224, 182, 0.08), rgba(8, 23, 56, 0.82));
}

.average-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.7rem;
  padding: 0.5rem 0.66rem;
  border-radius: var(--radius-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.average-metric {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

.average-value {
  font-family: "Bahnschrift", "Segoe UI Variable Display", "Aptos Display", sans-serif;
  font-size: clamp(1.14rem, 4.8vw, 1.58rem);
  font-weight: 800;
  line-height: 0.95;
}

.average-note {
  max-width: 12rem;
  color: var(--text-soft);
  font-size: 0.65rem;
  line-height: 1.2;
}

.consumption-message {
  margin: 0;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
}

.consumption-pill-wrap {
  margin-top: 0.16rem;
  display: flex;
  justify-content: center;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 52rem) {
  .app-frame {
    width: min(100%, 62rem);
    padding: 1.15rem 1.1rem 2rem;
  }

  .auth-screen {
    min-height: calc(100svh - 3.15rem);
  }

  .auth-card {
    max-width: 25rem;
    padding: 1.3rem 1.2rem 1.15rem;
  }

  .dashboard-refresh-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .dashboard-refresh-warning {
    max-width: 30rem;
    text-align: right;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    grid-template-areas:
      "system system"
      "plant learning"
      "consumption average"
      "summary summary";
  }

  .hero-card {
    grid-area: system;
  }

  .plant-card {
    grid-area: plant;
  }

  .learning-card {
    grid-area: learning;
  }

  .consumption-combo-card {
    grid-area: consumption;
    border-radius: var(--radius-panel);
  }

  .average-card {
    grid-area: average;
  }

  .consumption-summary-card {
    grid-area: summary;
  }

  .consumption-combo-layout {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.56rem;
  }

  .gauge-wrap {
    width: min(100%, 12.2rem);
  }

  .consumption-inline {
    padding: 0.78rem 0.86rem 0.28rem;
  }

  .average-card-body {
    min-height: 5rem;
  }

  .average-value {
    font-size: 1.7rem;
  }

  .average-note {
    font-size: 0.72rem;
  }

  .history-panel {
    gap: 0.88rem;
  }

  .history-panel-head {
    flex-direction: row;
    align-items: center;
  }

  .history-content {
    grid-template-columns: minmax(0, 1.3fr) minmax(18rem, 0.9fr);
    align-items: start;
  }

  .history-chart {
    min-height: 14rem;
    gap: 0.56rem;
    grid-auto-columns: minmax(2.7rem, 2.7rem);
  }

  .history-bar-top {
    height: 10rem;
  }
}

@media (max-width: 26rem) {
  .history-range-switch {
    gap: 0.34rem;
  }

  .history-range-button {
    min-height: 2.35rem;
    padding: 0.56rem 0.5rem;
    font-size: 0.72rem;
  }

  .history-chart-card,
  .history-list-card {
    padding-left: 0.62rem;
    padding-right: 0.62rem;
  }

  .history-chart {
    grid-auto-columns: minmax(2.35rem, 2.35rem);
    gap: 0.42rem;
  }

  .history-list-row {
    gap: 0.62rem;
    padding-left: 0.58rem;
    padding-right: 0.58rem;
  }

  .history-list-date,
  .history-list-value {
    font-size: 0.74rem;
  }
}
