﻿:root {
  color-scheme: dark;
  --bg-page: #040510;
  --bg-surface: #080b1c;
  --bg-surface-strong: #0b1026;
  --bg-elevated: rgba(13, 18, 42, 0.92);
  --bg-muted: rgba(20, 26, 54, 0.78);
  --surface-highlight: rgba(34, 40, 80, 0.75);
  --border-soft: rgba(129, 140, 248, 0.22);
  --border-strong: rgba(99, 102, 241, 0.48);
  --text-primary: #e8ebff;
  --text-secondary: rgba(232, 235, 255, 0.7);
  --accent-primary: #6366f1;
  --accent-primary-soft: rgba(99, 102, 241, 0.18);
  --accent-secondary: #f97316;
  --accent-secondary-soft: rgba(249, 115, 22, 0.2);
  --accent-tertiary: #22d3ee;
  --focus-ring: rgba(129, 140, 248, 0.38);
  --success-soft: rgba(34, 197, 94, 0.22);
  --success-strong: #bbf7d0;
  --error-soft: rgba(248, 113, 113, 0.2);
  --error-strong: #fecaca;
  --card-gradient: var(--surface-gradient-primary);
  --transition: 180ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 18% 20%, rgba(88, 132, 255, 0.22), transparent 58%),
    radial-gradient(circle at 82% 18%, rgba(48, 196, 255, 0.16), transparent 55%),
    radial-gradient(circle at 70% 84%, rgba(60, 120, 235, 0.14), transparent 60%),
    var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

body.has-mobile-nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4.5rem;
}

.page > * + * {
  margin-top: 2.75rem;
}

/* Global navigation reused from theme */
.global-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  --nav-padding: clamp(1.5rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: clamp(0.6rem, 1vw, 1rem);
  padding: 1rem var(--nav-padding);
  background: linear-gradient(135deg, rgba(14, 20, 48, 0.96), rgba(24, 30, 68, 0.92));
  border-bottom: 1px solid rgba(129, 140, 248, 0.28);
  box-shadow: 0 20px 40px rgba(3, 7, 18, 0.55);
  backdrop-filter: blur(16px);
}

.global-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.7rem, 1vw, 1rem);
  margin-right: clamp(0.65rem, 2vw, 1.5rem);
  text-decoration: none;
  flex: 0 1 auto;
  min-width: 0;
}

.global-nav__menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: rgba(12, 16, 36, 0.85);
  color: #f8faff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
  margin-left: auto;
}

.global-nav__menu-toggle:hover,
.global-nav__menu-toggle:focus-visible {
  outline: none;
  background: rgba(18, 22, 48, 0.95);
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.25);
}

.global-nav__menu-toggle-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform var(--transition), background var(--transition);
}

.global-nav__menu-toggle-icon::before,
.global-nav__menu-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform var(--transition), opacity var(--transition);
}

.global-nav__menu-toggle-icon::before {
  transform: translateY(-6px);
}

.global-nav__menu-toggle-icon::after {
  transform: translateY(6px);
}

.global-nav--menu-open .global-nav__menu-toggle-icon {
  background: transparent;
}

.global-nav--menu-open .global-nav__menu-toggle-icon::before {
  transform: rotate(45deg);
}

.global-nav--menu-open .global-nav__menu-toggle-icon::after {
  transform: rotate(-45deg);
}

.global-nav__logo {
  height: clamp(44px, 8vw, 58px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(3, 7, 18, 0.55));
}

.global-nav__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.global-nav__overline {
  font-size: clamp(0.6rem, 0.7vw, 0.72rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(232, 235, 255, 0.62);
}

.global-nav__title {
  font-size: clamp(0.98rem, 1.1vw + 0.7rem, 1.35rem);
  font-weight: 600;
  color: #f8faff;
  white-space: normal;
}

.global-nav__menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: auto;
  right: var(--nav-padding);
  width: min(360px, calc(100% - 2 * var(--nav-padding)));
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 1.1rem 1.4rem 1.6rem;
  background: linear-gradient(135deg, rgba(14, 20, 48, 0.96), rgba(24, 30, 68, 0.92));
  border: 1px solid rgba(129, 140, 248, 0.32);
  border-radius: 20px;
  box-shadow: 0 26px 48px rgba(5, 9, 24, 0.6);
  backdrop-filter: blur(12px);
  z-index: 120;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.global-nav--menu-open .global-nav__menu {
  display: flex;
}

.global-nav__item {
  position: relative;
  width: 100%;
}

.global-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem clamp(0.85rem, 1.2vw, 1.2rem);
  border-radius: 999px;
  font-size: clamp(0.85rem, 0.55vw + 0.7rem, 1.05rem);
  font-weight: 500;
  color: rgba(232, 235, 255, 0.9);
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  text-align: left;
}

.global-nav__link:hover,
.global-nav__link:focus-visible {
  color: #f8faff;
  background: rgba(129, 140, 248, 0.2);
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.25);
  outline: none;
}

.global-nav__link--active {
  background: rgba(129, 140, 248, 0.25);
  border-color: rgba(129, 140, 248, 0.6);
  color: #f8faff;
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.3);
}

.global-nav__toggle {
  background: none;
  cursor: pointer;
}

.global-nav__caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(232, 235, 255, 0.8);
  transition: transform 0.2s ease;
  margin-top: 2px;
  margin-left: auto;
}

.global-nav__item--open .global-nav__caret {
  transform: rotate(-180deg);
}

.global-nav__dropdown {
  display: none;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.6rem;
  background: rgba(10, 14, 34, 0.9);
  border: 1px solid rgba(129, 140, 248, 0.22);
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(3, 7, 18, 0.4);
}

.global-nav__item--open .global-nav__dropdown {
  display: flex;
}

.global-nav__dropdown-link {
  display: block;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  font-size: 0.9rem;
  color: rgba(232, 235, 255, 0.92);
  transition: background 0.18s ease, color 0.18s ease;
}

.global-nav__dropdown-link:hover,
.global-nav__dropdown-link:focus-visible {
  background: rgba(129, 140, 248, 0.25);
  color: #f8faff;
  outline: none;
}

/* Hero */
/* Cards */
.card {
  background: var(--card-gradient);
  border-radius: 22px;
  padding: 2rem clamp(1.25rem, 3vw, 2.5rem);
  box-shadow: 0 28px 60px rgba(3, 7, 18, 0.65);
  border: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
}

.card__header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: clamp(1.25rem, 2.2vw, 1.75rem);
}

.card__header h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  color: #f8faff;
}

.card__header p {
  margin: 0;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.8rem;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: rgba(129, 140, 248, 0.18);
  color: #f8faff;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn:hover:not(:disabled) {
  background: rgba(129, 140, 248, 0.28);
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 18px 32px rgba(12, 16, 36, 0.45);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-hero {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.45);
}

.btn-ghost {
  background: rgba(12, 16, 36, 0.65);
  border-color: rgba(129, 140, 248, 0.25);
}

.btn-primary {
  background: rgba(34, 211, 238, 0.2);
  border-color: rgba(34, 211, 238, 0.45);
}

.btn-secondary {
  background: rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.45);
  color: #ffe0c7;
}

.btn-success {
  background: var(--success-soft);
  border-color: rgba(34, 197, 94, 0.45);
  color: var(--success-strong);
}

.btn-slate {
  background: rgba(20, 26, 54, 0.85);
  border-color: rgba(129, 140, 248, 0.25);
}

/* Instructions card */
.instructions-list {
  margin: 0;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.instructions-list strong {
  color: var(--text-primary);
}

.instructions-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: clamp(1.75rem, 2.6vw, 2.2rem);
}

.instructions-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.instructions-footnote {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.callout {
  margin-top: clamp(1.5rem, 2.6vw, 2rem);
  padding: 1rem 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: rgba(20, 26, 54, 0.65);
  color: var(--text-secondary);
}

.callout strong {
  color: #f8faff;
}

.file-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.file-input {
  display: none;
}

/* Info panel */
.card--info {
  display: none;
}

.card--info[style*="block"],
.card--info[style*="flex"],
.card--info[style*="inline"] {
  display: block;
}

.sheet-info-card {
  background: rgba(12, 16, 36, 0.82);
  border: 1px solid rgba(129, 140, 248, 0.22);
  border-radius: 20px;
  padding: clamp(1.25rem, 2.2vw, 1.75rem);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: clamp(0.75rem, 2vw, 1.25rem);
}

.sheet-info-card .stats-table-container {
  margin: 0;
  padding: 0;
}

.sheet-info-table th {
  white-space: nowrap;
}

.sheet-info-table td {
  white-space: normal;
  vertical-align: top;
}

.sheet-info-table {
  table-layout: auto;
  min-width: 100%;
}

.sheet-info-table th,
.sheet-info-table td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  font-variant-numeric: normal;
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
}

.sheet-info-table th:nth-child(-n + 5),
.sheet-info-table td:nth-child(-n + 5) {
  white-space: nowrap;
}

.sheet-info-table tbody td:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

.sheet-info-table tbody td:last-child {
  line-height: 1.45;
}

.sheet-info-table th:nth-child(1),
.sheet-info-table td:nth-child(1) {
  width: auto;
}

.sheet-info-table th:nth-child(2),
.sheet-info-table td:nth-child(2) {
  width: auto;
}

.sheet-info-table th:nth-child(3),
.sheet-info-table td:nth-child(3) {
  width: 15%;
}

.sheet-info-table th:nth-child(4),
.sheet-info-table td:nth-child(4) {
  width: 15%;
}

.sheet-info-table th:nth-child(5),
.sheet-info-table td:nth-child(5) {
  width: 15%;
}

.sheet-info-table th:nth-child(6),
.sheet-info-table td:nth-child(6) {
  width: auto;
  white-space: normal;
  word-break: break-word;
}

/* Config */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(1rem, 2vw, 1.75rem);
  margin-bottom: clamp(1.6rem, 2.4vw, 2rem);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.control-group label {
  font-size: 0.95rem;
  color: #f8faff;
  font-weight: 600;
}

.control-group select {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(8, 11, 28, 0.8);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.control-group select:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px var(--focus-ring);
  background: rgba(12, 16, 36, 0.95);
}

.forecast-section {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.forecast-section h3 {
  margin: 0;
  color: #f8faff;
  font-size: 1.25rem;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(1rem, 2vw, 1.75rem);
}

.forecast-info {
  border-radius: 16px;
  border: 1px solid rgba(129, 140, 248, 0.25);
  background: rgba(12, 16, 36, 0.78);
  padding: 1rem 1.25rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Tabs & Charts */
.card--charts {
  display: none;
}

.card--charts[style*="block"],
.card--charts[style*="flex"],
.card--charts[style*="inline"] {
  display: block;
}

.tabs-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: clamp(1.5rem, 2.4vw, 2rem);
}

.tab-button {
  background: rgba(12, 16, 36, 0.7);
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 14px;
  color: var(--text-secondary);
  padding: 0.55rem 1.35rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.tab-button:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 140, 248, 0.45);
}

.tab-button.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.55);
  color: #f8faff;
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: clamp(1.75rem, 2.8vw, 2.25rem);
}

.tab-content.active {
  display: flex;
}

.chart-card {
  background: rgba(12, 16, 36, 0.82);
  border-radius: 20px;
  border: 1px solid rgba(129, 140, 248, 0.18);
  padding: clamp(1.2rem, 2.2vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chart-title {
  font-weight: 600;
  color: #f8faff;
  font-size: 1.1rem;
}

.custom-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.25);
  background: rgba(12, 16, 36, 0.7);
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    opacity var(--transition);
}

.legend-item:hover,
.legend-item:focus-visible {
  outline: none;
  background: rgba(18, 22, 50, 0.85);
  border-color: rgba(129, 140, 248, 0.45);
}

.legend-item--inactive {
  opacity: 0.45;
}

.legend-marker {
  --legend-color: rgba(255, 255, 255, 0.85);
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid var(--legend-color);
  background: var(--legend-color);
  box-shadow: 0 0 0 1px rgba(4, 5, 16, 0.6);
  flex-shrink: 0;
}

.legend-marker--forecast {
  background: transparent;
  border-style: dashed;
}

.legend-marker--inactive {
  background: transparent;
  border-color: rgba(148, 163, 235, 0.4);
}

.legend-text {
  color: var(--text-secondary);
  white-space: nowrap;
}

.chart-canvas-container {
  position: relative;
  width: 100%;
  height: 420px;
}

.analytics-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
}

.statistics-card,
.metrics-card {
  background: rgba(12, 16, 36, 0.82);
  border: 1px solid rgba(129, 140, 248, 0.22);
  border-radius: 20px;
  padding: clamp(1.25rem, 2.2vw, 1.75rem);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.statistics-card h3,
.metrics-card h3 {
  margin: 0;
  color: #f8faff;
  font-size: 1.2rem;
}

.statistics-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.metrics-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.metrics-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(129, 140, 248, 0.4);
  background: rgba(12, 16, 36, 0.8);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.metrics-help-btn:hover,
.metrics-help-btn:focus-visible {
  background: rgba(18, 22, 50, 0.9);
  border-color: rgba(129, 140, 248, 0.65);
  transform: translateY(-1px);
  outline: none;
}

.metrics-help-btn:active {
  transform: translateY(1px);
}

.statistics-controls {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

.custom-range {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-end;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.metrics-grid > div {
  background: rgba(12, 16, 36, 0.9);
  border: 1px solid rgba(129, 140, 248, 0.18);
  border-radius: 14px;
  padding: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
}

.stats-table-container {
  width: 100%;
  overflow-x: auto;
  margin: 0;
  padding: 0.25rem 0;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  table-layout: fixed;
}

.stats-table th,
.stats-table td {
  padding: 0.45rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid rgba(129, 140, 248, 0.12);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-table th:first-child,
.stats-table td:first-child {
  width: 17%;
  white-space: normal;
  overflow: visible;
}

.stats-table td:first-child {
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.35;
}

.stats-table th {
  font-weight: 600;
  color: #f8faff;
  background: rgba(16, 20, 46, 0.65);
}

.stats-table tbody tr:hover {
  background: rgba(37, 42, 88, 0.22);
}

.stats-tip {
  margin-top: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(18, 22, 48, 0.55);
  border: 1px solid rgba(129, 140, 248, 0.16);
  display: grid;
  gap: 0.1rem;
  color: var(--text-secondary);
}

.stats-tip-icon {
  font-size: 1rem;
  color: var(--accent-tertiary);
}

.stats-tip-text {
  font-weight: 600;
  color: var(--text-primary);
}

.stats-tip-secondary {
  font-size: 0.8rem;
}

.metrics-summary {
  background: rgba(20, 26, 54, 0.75);
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Help modal */
.help-modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
  background: rgba(4, 6, 18, 0.72);
  backdrop-filter: blur(12px);
  z-index: 1000;
  overflow-y: auto;
}

.help-modal__content {
  position: relative;
  background: rgba(12, 16, 36, 0.95);
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: 24px;
  width: min(880px, 100%);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  box-shadow: 0 34px 68px rgba(3, 7, 18, 0.65);
  color: var(--text-primary);
  display: grid;
  gap: 1.5rem;
}

.help-modal__content h3 {
  margin: 0;
  font-size: 1.6rem;
}

.modal-close-x {
  position: absolute;
  top: 5.5rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(129, 140, 248, 0.3);
  background: rgba(10, 14, 32, 0.7);
  color: #f8faff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.modal-close-x:hover {
  background: rgba(18, 22, 48, 0.9);
  transform: scale(1.05);
}

.help-section {
  color: var(--text-secondary);
  line-height: 1.6;
}

.help-section h4 {
  margin: 0 0 0.6rem 0;
  color: #f8faff;
  font-size: 1.1rem;
}

.help-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.help-range {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(12, 16, 36, 0.85);
  border: 1px solid rgba(129, 140, 248, 0.25);
  color: var(--text-primary);
}

.help-range.excellent {
  border-color: rgba(34, 197, 94, 0.6);
  color: var(--success-strong);
}

.help-range.good {
  border-color: rgba(249, 115, 22, 0.6);
  color: #ffd8b3;
}

.help-range.poor {
  border-color: rgba(248, 113, 113, 0.6);
  color: var(--error-strong);
}

/* Notification */
.notification-container {
  position: fixed;
  top: 7rem;
  right: 1.5rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
}

.notification {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  border-radius: 16px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: var(--bg-elevated);
  color: var(--text-primary);
  transform: translateX(120%);
  transition: transform var(--transition), opacity var(--transition);
  box-shadow: 0 18px 32px rgba(3, 7, 18, 0.55);
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  border-left: 4px solid rgba(34, 197, 94, 0.65);
  background: var(--success-soft);
  color: var(--success-strong);
}

.notification.error {
  border-left: 4px solid rgba(248, 113, 113, 0.65);
  background: var(--error-soft);
  color: var(--error-strong);
}

.notification.warning {
  border-left: 4px solid rgba(249, 115, 22, 0.7);
  background: var(--accent-secondary-soft);
  color: #ffd8b3;
}

.notification.info {
  border-left: 4px solid rgba(99, 102, 241, 0.6);
  background: rgba(99, 102, 241, 0.18);
}

.notification-icon {
  font-size: 1.25rem;
}

.notification-message {
  flex: 1;
  line-height: 1.45;
}

.notification-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.notification-close:hover {
  opacity: 1;
}

.floating-generate {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: none;
  z-index: 940;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.floating-generate.floating-generate--visible {
  display: block;
}

.floating-generate.floating-generate--inactive {
  opacity: 0.65;
}

.floating-generate .btn {
  background: rgba(99, 102, 241, 0.7);
  border-color: rgba(129, 140, 248, 0.85);
  box-shadow: 0 22px 36px rgba(10, 14, 34, 0.55);
}

.floating-generate .btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.82);
  border-color: rgba(129, 140, 248, 1);
  box-shadow: 0 26px 44px rgba(10, 14, 34, 0.6);
}

.floating-generate .btn:disabled {
  background: rgba(99, 102, 241, 0.35);
  border-color: rgba(129, 140, 248, 0.45);
  cursor: default;
  box-shadow: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(99, 102, 241, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .parameters-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .chart-canvas-container {
    height: 360px;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 2.5rem 1.25rem 3.5rem;
  }

  .instructions-action-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .custom-range {
    flex-direction: column;
    align-items: stretch;
  }

  .notification-container {
    left: 1.25rem;
    right: 1.25rem;
    max-width: none;
  }
}
