:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #17202a;
  --muted: #607080;
  --line: #dde4eb;
  --primary: #166534;
  --primary-2: #22c55e;
  --accent: #f97316;
  --danger: #b91c1c;
  --shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #e6f5eb, transparent 30rem), var(--bg);
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 2rem clamp(1rem, 3vw, 3rem) 1rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

h2 {
  font-size: 1.12rem;
  margin-bottom: 1rem;
}

.subtitle {
  margin: 0.65rem 0 0;
  max-width: 52rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.status-pill {
  white-space: nowrap;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-weight: 700;
}

.status-pill.ok {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.status-pill.bad {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 0 clamp(1rem, 3vw, 3rem) 3rem;
}

.mode-switch {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 clamp(1rem, 3vw, 3rem) 1rem;
}

.mode-tab {
  border: 1px solid #cbd5df;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.mode-tab.active {
  color: #ffffff;
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.mode-description {
  color: var(--muted);
  font-size: 0.92rem;
}

.user-guide {
  order: 5;
  border-color: #bbf7d0;
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(255, 255, 255, 0.95));
}

.user-guide p {
  margin: 0;
  color: #334155;
  line-height: 1.55;
}

.tool-scope {
  order: 4;
  border-color: #bfdbfe;
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.96));
}

.tool-about summary {
  display: grid;
  grid-template-columns: minmax(10rem, 0.28fr) minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.tool-about summary::-webkit-details-marker {
  display: none;
}

.summary-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: #0f172a;
}

.summary-preview {
  color: #334155;
  line-height: 1.45;
}

.summary-action {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
  white-space: nowrap;
}

.tool-about[open] .summary-action {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0;
}

.tool-about[open] .summary-action::before {
  content: "Suskleisti aprašymą";
  font-size: 0.92rem;
}

.about-copy {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #bfdbfe;
  max-width: 78rem;
}

.about-copy p {
  margin: 0 0 0.85rem;
  color: #334155;
  line-height: 1.58;
}

.about-copy p:last-child {
  margin-bottom: 0;
  color: #0f172a;
  font-weight: 700;
}

body.user-mode .deep-only,
body.user-mode .deep-field,
body.user-mode .workflow-basic .form-grid > label:not(.user-field) {
  display: none !important;
}

body.user-mode .deep-result-col {
  display: none !important;
}

body.deep-mode .user-only {
  display: none !important;
}

body.public-ui .mode-switch {
  display: none;
}

body.user-mode .workflow-basic .form-grid {
  grid-template-columns: repeat(4, minmax(12rem, 1fr));
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.wide {
  grid-column: 1 / -1;
}

.workflow-auth {
  order: 0;
}

.workflow-basic {
  order: 10;
}

.workflow-load {
  order: 20;
}

.workflow-user-tariff {
  order: 15;
}

.workflow-user-s3-cost {
  order: 16;
}

.workflow-load-addons {
  order: 25;
}

.workflow-user-advanced {
  order: 37;
}

.workflow-scenarios {
  order: 30;
}

.workflow-costs {
  order: 34;
}

.workflow-grid {
  order: 36;
}

.workflow-actions {
  order: 40;
}

.workflow-analytics {
  order: 42;
}

.workflow-user-cashflow {
  order: 45;
}

.post-payment-import-chart {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.post-payment-import-chart h3 {
  margin: 0;
  font-size: 1rem;
}

.workflow-analytics .curve-controls {
  align-items: flex-end;
}

.workflow-analytics .inline-control {
  display: grid;
  gap: 0.25rem;
  min-width: 10.5rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(11rem, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.analytics-metric {
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.85rem;
  background: rgba(248, 250, 252, 0.72);
}

.analytics-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}

.analytics-metric strong {
  display: block;
  color: var(--text);
  font-size: clamp(1.35rem, 2.2vw, 2rem);
}

.analytics-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(18rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.analytics-panels h3 {
  margin: 0 0 0.5rem;
}

.analytics-chart {
  min-height: 18rem;
  border: 1px dashed #b6c2cf;
  border-radius: 0.9rem;
  display: grid;
  place-items: center;
  padding: 0.7rem;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.72));
  overflow: hidden;
}

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

.feedback-panel {
  display: grid;
  grid-template-columns: minmax(14rem, 0.75fr) minmax(18rem, 1.4fr);
  gap: 1rem;
  align-items: stretch;
}

.feedback-copy,
.feedback-form {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.82), rgba(239, 246, 255, 0.64));
}

.feedback-copy h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.feedback-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.feedback-form {
  display: grid;
  gap: 0.8rem;
}

.feedback-textarea {
  min-height: 9.5rem;
  line-height: 1.45;
  resize: vertical;
}

.feedback-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.feedback-counter {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.feedback-counter.near-limit {
  color: #b45309;
}

.feedback-privacy-note {
  margin: -0.2rem 0 0;
}

.feedback-status {
  min-height: 1.35rem;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.feedback-status.done {
  color: #059669;
}

.feedback-status.error {
  color: #dc2626;
}

.workflow-results {
  order: 50;
}

.workflow-analysis {
  order: 60;
}

.workflow-advanced {
  order: 70;
}

.workflow-requisites {
  order: 90;
}

.workflow-feedback {
  order: 95;
}

.technical-hidden {
  display: none !important;
}

label {
  display: grid;
  gap: 0.35rem;
  color: #273444;
  font-size: 0.92rem;
  font-weight: 600;
}

.roof-tilt-field {
  display: grid;
  gap: 0.45rem;
  color: #273444;
  font-size: 0.92rem;
  font-weight: 700;
}

.field-label-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.75rem;
  flex-wrap: wrap;
}

.field-label-inline {
  display: block;
  margin: 0;
  color: #273444;
  font-size: 0.92rem;
  font-weight: 700;
  min-width: 0;
  flex: 1 1 12rem;
}

.roof-angle-help-button {
  justify-self: end;
  min-height: auto;
  padding: 0.34rem 0.58rem;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
  line-height: 1.15;
  flex: 0 0 auto;
}

.roof-angle-help-button:hover:not(:disabled) {
  border-color: #93c5fd;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5df;
  border-radius: 0.55rem;
  padding: 0.58rem 0.65rem;
  background: #fff;
  color: var(--text);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #e5e7eb;
  color: #64748b;
}

.payment-locked-field {
  opacity: 0.62;
}

.input-warning {
  border-color: #f97316 !important;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.18);
}

.input-warning-label {
  color: #9a3412;
}

select {
  background: linear-gradient(180deg, #fff7ed, #fffbeb);
  border-color: #fdba74;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.08) inset;
  cursor: pointer;
}

.readonly-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  border: 1px solid #cbd5df;
  border-radius: 0.55rem;
  padding: 0.58rem 0.65rem;
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
  color: #334155;
  font-weight: 700;
}

label:has(select) {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 0.75rem;
  padding: 0.55rem;
}

select:focus {
  outline: 2px solid rgba(249, 115, 22, 0.35);
  outline-offset: 2px;
}

button {
  border: 0;
  border-radius: 0.65rem;
  padding: 0.72rem 0.9rem;
  background: #e5e7eb;
  color: #111827;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease, background 0.15s ease;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button.primary {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

button.secondary {
  background: #eef2ff;
  color: #3730a3;
}

.button-row,
.button-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.button-grid button {
  flex: 1 1 11rem;
}

.hint,
.work-status {
  color: var(--muted);
  margin: 0.8rem 0 0;
  font-size: 0.9rem;
}

.hint.warning {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 0.75rem;
  padding: 0.75rem 0.85rem;
}

.work-status.busy {
  color: #9a3412;
  font-weight: 800;
}

.work-status.done {
  color: var(--primary);
  font-weight: 800;
}

.work-status.error {
  color: var(--danger);
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(9rem, 1fr));
  gap: 0.85rem;
}

.form-grid.compact {
  grid-template-columns: repeat(4, minmax(9rem, 1fr));
}

.basic-field-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: start;
  padding: 0.8rem;
  border: 1px solid #dbe4ef;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.72);
}

.basic-field-group label,
.basic-field-group .roof-tilt-field {
  min-width: 0;
}

.basic-group-title {
  grid-column: 1 / -1;
  margin-bottom: -0.25rem;
  color: #0f172a;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.basic-group-wide {
  grid-column: 1 / -1;
}

.basic-project-group {
  grid-column: span 2;
  border-color: #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.roof-geometry-group {
  grid-column: span 3;
  border-color: #cbd5e1;
  background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.roof-cost-group {
  grid-column: span 2;
  border-color: #fed7aa;
  background: linear-gradient(135deg, #fff7ed, #ffffff);
}

body.user-mode .basic-project-group,
body.user-mode .roof-geometry-group,
body.user-mode .roof-cost-group {
  grid-column: span 2;
}

.span-all {
  grid-column: 1 / -1;
}

.priority-select {
  border-color: #f97316 !important;
  background: #ffedd5 !important;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3.1rem;
}

.check-row input {
  width: auto;
}

.top-gap {
  margin-top: 0.95rem;
}

.deep-collapsible {
  display: grid;
  gap: 0.85rem;
}

.deep-collapsible > summary {
  list-style: none;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  padding: 0.2rem 0;
}

.deep-collapsible > summary::-webkit-details-marker {
  display: none;
}

.deep-collapsible > summary::before {
  content: "▸";
  display: inline-block;
  width: 1.25rem;
  color: #2563eb;
  transition: transform 0.15s ease;
}

.deep-collapsible[open] > summary::before {
  transform: rotate(90deg);
}

.deep-collapsible .table-wrap,
.deep-collapsible .form-grid {
  margin-top: 0.65rem;
}

.collapsible-body-head {
  margin-top: 0.75rem;
}

.workflow-basic .form-grid,
.workflow-load > .form-grid,
.workflow-load-addons .form-grid,
.workflow-user-tariff .form-grid,
.workflow-user-advanced .form-grid,
.workflow-scenarios .form-grid,
.workflow-costs .form-grid,
.workflow-grid .form-grid,
.workflow-advanced .form-grid,
.workflow-requisites .form-grid {
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 0.9rem;
}

.tariff-subsidy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.42fr);
  gap: 1rem;
  align-items: stretch;
}

.subsidy-panel {
  background: linear-gradient(135deg, #f0fdf4, #ecfeff);
  border: 1px solid #bbf7d0;
  border-radius: 1rem;
  padding: 0.9rem;
}

.subsidy-panel h3 {
  margin: 0 0 0.6rem;
  color: #14532d;
}

.pay-button {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  border-color: #c2410c;
}

.payment-hint {
  margin: 0.75rem 0 0;
  color: #475569;
  font-weight: 700;
}

.paywall-actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.season-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(11rem, 1fr));
  gap: 0.85rem;
}

.season-card {
  position: relative;
  display: grid;
  gap: 0.65rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 1rem;
  padding: 0.9rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.season-card::after {
  position: absolute;
  right: 0.55rem;
  bottom: -0.9rem;
  opacity: 0.13;
  font-size: 4.2rem;
  pointer-events: none;
}

.season-title {
  position: relative;
  z-index: 1;
  font-weight: 900;
  color: #0f172a;
}

.season-card label {
  position: relative;
  z-index: 1;
}

.season-monthly {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.55rem;
  margin-top: 0.2rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(148, 163, 184, 0.32);
}

.season-monthly input[type="range"] {
  padding: 0;
  accent-color: var(--primary);
}

.slider-hints {
  position: relative;
  min-height: 1.55rem;
  margin-top: -0.35rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
}

.slider-hints span {
  position: absolute;
  top: 0.34rem;
  white-space: nowrap;
}

.slider-hints span:first-child {
  left: 0;
}

.slider-hints span:last-child {
  right: 0;
}

.constant-load-mark {
  left: 66.667%;
  transform: translateX(-50%);
  color: #047857;
  text-align: center;
}

.constant-load-mark::before {
  content: "";
  display: block;
  width: 0;
  height: 0.55rem;
  margin: -0.4rem auto 0.05rem;
  border-left: 2px solid #047857;
}

.season-input-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.season-input-label-row > span:first-child {
  min-width: 0;
}

.season-power-hint {
  color: #065f46;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.split-label {
  color: #334155;
  font-size: 0.84rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0.65rem;
  padding: 0.45rem 0.55rem;
}

.conditional-block {
  margin-top: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.season-spring {
  background: linear-gradient(135deg, #ecfdf5, #dcfce7);
}

.season-spring::after {
  content: "🌱";
}

.season-summer {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
}

.season-summer::after {
  content: "☀️";
}

.season-autumn {
  background: linear-gradient(135deg, #fff7ed, #fed7aa);
}

.season-autumn::after {
  content: "🍂";
}

.season-winter {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.season-winter::after {
  content: "❄️";
}

.form-stack {
  display: grid;
  gap: 0.75rem;
}

.scenario-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.scenario-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.75rem;
  border: 1px solid #bbf7d0;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  color: #14532d;
  font-weight: 800;
}

.scenario-tile.inactive {
  opacity: 0.62;
  background: #f8fafc;
}

.scenario-tile label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
}

.scenario-list input {
  width: auto;
}

.scenario-config-toggle {
  width: auto;
  min-width: 6.2rem;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #bae6fd;
  background: #e0f2fe;
  color: #075985;
  font-size: 0.78rem;
  font-weight: 900;
}

.scenario-config-toggle.active {
  background: #0369a1;
  color: #ffffff;
  border-color: #0369a1;
}

.scenario-config-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.scenario-config-grid {
  display: grid;
  gap: 1rem;
}

.scenario-config {
  border: 1px solid #cbd5e1;
  border-radius: 1rem;
  padding: 1rem;
  background: #f8fafc;
}

.scenario-config legend {
  padding: 0 0.55rem;
  color: #0f172a;
  font-weight: 900;
}

.scenario-config-s1 {
  border-color: #fed7aa;
  background: linear-gradient(135deg, #fff7ed, #ffffff);
}

.scenario-config-s2 {
  border-color: #bbf7d0;
  background: linear-gradient(135deg, #f0fdf4, #ffffff);
}

.scenario-config-s3 {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fff1f2, #ffffff);
}

.scenario-config-s4 {
  border-color: #ddd6fe;
  background: linear-gradient(135deg, #f5f3ff, #ffffff);
}

.recommendation {
  padding: 1.1rem;
  background: linear-gradient(135deg, #f0fdf4, #eff6ff);
  border: 2px solid #86efac;
  border-radius: 0.95rem;
  color: #0f172a;
  font-size: 1.18rem;
  line-height: 1.45;
  font-weight: 900;
  margin-bottom: 1rem;
}

.locked-result {
  text-align: center !important;
  color: #92400e;
  background: #fffbeb;
  font-weight: 900;
  white-space: normal;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.7rem;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  background: #f1f5f9;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.investment-cell {
  display: grid;
  gap: 0.18rem;
  justify-items: end;
}

.scenario-result-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.capex-row-toggle,
.capex-row-spacer {
  width: 1.65rem;
  height: 1.65rem;
  flex: 0 0 auto;
}

.capex-row-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bae6fd;
  border-radius: 0.55rem;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 1000;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.capex-chevron {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.capex-row-toggle[aria-expanded="true"] .capex-chevron {
  transform: translateY(-2px);
}

.capex-row-toggle:hover,
.capex-row-toggle:focus-visible {
  background: #bae6fd;
  border-color: #38bdf8;
}

.result-row-expanded td {
  background: #f0f9ff;
}

.capex-breakdown-row td {
  padding: 0;
  text-align: left;
  white-space: normal;
  background: #f0f9ff;
}

.capex-breakdown-panel {
  border-top: 1px solid #bae6fd;
  border-bottom: 1px solid #bae6fd;
  background: #ffffff;
  padding: 0.9rem 1rem 1rem 3.4rem;
  position: sticky;
  left: 0;
  max-width: min(96rem, calc(100vw - 4rem));
}

.capex-breakdown-title {
  color: #075985;
  font-weight: 900;
  background: #e0f2fe;
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
}

.capex-breakdown {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.capex-line {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  align-items: start;
  padding: 0.65rem 0.75rem;
  border-radius: 0.55rem;
  background: #f8fafc;
}

.capex-name {
  font-weight: 800;
  color: #0f172a;
}

.capex-formula {
  color: #475569;
}

.capex-value {
  color: #0f172a;
  font-weight: 900;
  text-align: left;
  font-size: 1.02rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.curve-controls {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.curve-controls select,
.curve-controls input {
  width: 8rem;
}

.inline-control {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid #cbd5df;
  border-radius: 0.55rem;
  background: #fff;
  white-space: nowrap;
}

.inline-control input {
  width: auto;
}

.chart-box {
  min-height: 24rem;
  border: 1px dashed #b6c2cf;
  border-radius: 0.8rem;
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
  background: #fff;
}

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

.chart-box.has-chart {
  cursor: zoom-in;
}

.chart-box.has-chart:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.chart-modal.hidden {
  display: none;
}

.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
}

.chart-modal-panel {
  width: min(98vw, 1560px);
  height: min(94vh, 980px);
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.38);
  overflow: hidden;
}

.chart-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.chart-modal-head h2 {
  margin: 0;
}

.chart-modal-body {
  min-height: 0;
  padding: 0.75rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: stretch;
  justify-items: stretch;
  overflow: auto;
  background: #fff;
}

.chart-modal-body.image-modal-body {
  grid-template-rows: minmax(0, 1fr);
  padding: 1rem;
}

.chart-modal-figure {
  min-height: 0;
  display: grid;
  place-items: center;
}

.image-modal-figure {
  height: 100%;
}

.chart-modal-body svg,
.chart-modal-figure svg {
  width: 100%;
  height: 100%;
  max-height: calc(94vh - 5.5rem);
  display: block;
}

.modal-guide-image {
  display: block;
  max-width: 100%;
  max-height: calc(94vh - 5.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.75rem;
}

.modal-legend {
  justify-content: center;
  padding: 0.35rem 0.5rem;
  margin: 0;
  border-bottom: 1px solid #e2e8f0;
}

body.modal-open {
  overflow: hidden;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr));
  gap: 1rem;
}

.overview-chart {
  min-height: 20rem;
}

.baseline-row {
  background: #f8fafc;
  color: #334155;
}

.baseline-row td:first-child {
  font-weight: 800;
}

.legend {
  display: flex;
  gap: 0.95rem;
  flex-wrap: wrap;
  margin: 0.2rem 0 0.8rem;
  color: #334155;
  font-size: 1rem;
  line-height: 1.35;
}

.range-panel {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.35rem;
}

.range-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.year-slider {
  width: 100%;
  accent-color: var(--primary);
}

.curve-season-scale {
  position: relative;
  display: flex;
  overflow: visible;
  min-height: 2.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.8rem;
  background: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.curve-season-segment {
  flex: 0 0 var(--season-width);
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0.38rem 0.2rem;
  color: #0f172a;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  border-right: 1px solid rgba(15, 23, 42, 0.12);
}

.curve-season-segment:first-of-type {
  border-radius: 0.75rem 0 0 0.75rem;
}

.curve-season-segment:last-of-type {
  border-right: none;
  border-radius: 0 0.75rem 0.75rem 0;
}

.curve-season-segment small {
  display: block;
  margin-top: 0.18rem;
  color: #475569;
  font-size: 0.62rem;
  font-weight: 800;
}

.curve-season-winter {
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
}

.curve-season-spring {
  background: linear-gradient(135deg, #dcfce7, #ecfdf5);
}

.curve-season-summer {
  background: linear-gradient(135deg, #fef3c7, #fff7ed);
}

.curve-season-autumn {
  background: linear-gradient(135deg, #fed7aa, #ffedd5);
}

.curve-season-pointer {
  position: absolute;
  z-index: 3;
  top: -0.48rem;
  left: 50%;
  width: 0;
  height: calc(100% + 0.62rem);
  border-left: 3px solid #0f172a;
  transform: translateX(-1.5px);
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.28));
  pointer-events: none;
}

.curve-season-pointer::before {
  content: "";
  position: absolute;
  top: -0.02rem;
  left: -0.42rem;
  border-left: 0.42rem solid transparent;
  border-right: 0.42rem solid transparent;
  border-top: 0.52rem solid #0f172a;
}

.curve-season-now {
  color: #334155;
  font-weight: 800;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  font-weight: 600;
}

.legend-swatch {
  width: 1.15rem;
  height: 0.22rem;
  border-radius: 999px;
  background: var(--swatch-color, currentColor);
  flex: 0 0 auto;
}

.legend-swatch.dashed {
  width: 1.65rem;
  height: 0;
  border-top: 0.22rem dashed var(--swatch-color, currentColor);
  background: transparent !important;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .form-grid.compact {
    grid-template-columns: repeat(2, minmax(9rem, 1fr));
  }

  .season-grid,
  .scenario-list {
    grid-template-columns: repeat(2, minmax(11rem, 1fr));
  }

  .tariff-subsidy-layout {
    grid-template-columns: 1fr;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .feedback-panel {
    grid-template-columns: 1fr;
  }

  .tool-about summary {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .summary-action {
    justify-self: start;
  }

  body.user-mode .workflow-basic .form-grid {
    grid-template-columns: repeat(2, minmax(12rem, 1fr));
  }

  .basic-project-group,
  .roof-geometry-group,
  .roof-cost-group,
  body.user-mode .basic-project-group,
  body.user-mode .roof-geometry-group,
  body.user-mode .roof-cost-group {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .app-header {
    flex-direction: column;
  }

  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .season-grid,
  .scenario-list {
    grid-template-columns: 1fr;
  }

  .tariff-subsidy-layout {
    grid-template-columns: 1fr;
  }

  .summary-action {
    white-space: normal;
    text-align: center;
  }

  body.user-mode .workflow-basic .form-grid {
    grid-template-columns: 1fr;
  }

  .basic-field-group {
    grid-template-columns: 1fr;
  }

  .curve-controls,
  .button-row,
  .button-grid {
    display: grid;
  }

  .curve-controls select,
  .curve-controls input {
    width: 100%;
  }
}

/* Vartotojo skilties B kryptis: premium / energy dashboard.
   Classic baseline išsaugotas: backend/static/style-baselines/v106-classic/. */
body.user-mode {
  color-scheme: dark;
  --bg: #060a14;
  --card: rgba(10, 18, 32, 0.84);
  --text: #e7eef8;
  --muted: #9aa8bb;
  --line: rgba(148, 163, 184, 0.22);
  --primary: #22c55e;
  --primary-2: #f59e0b;
  --accent: #8b5cf6;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  min-height: 100vh;
  isolation: isolate;
  background:
    radial-gradient(circle at 78% 3%, rgba(245, 158, 11, 0.23), transparent 16rem),
    radial-gradient(circle at 16% 7%, rgba(139, 92, 246, 0.25), transparent 23rem),
    radial-gradient(circle at 45% 42%, rgba(14, 165, 233, 0.10), transparent 25rem),
    linear-gradient(135deg, #050814 0%, #08111f 48%, #0d1626 100%);
}

body.user-mode::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 46%, rgba(250, 204, 21, 0.10) 46.2%, transparent 50%),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.045) 0 1px, transparent 1px 5.2rem),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, 0.035) 0 1px, transparent 1px 4.4rem);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.56));
}

body.user-mode::after {
  content: "";
  position: fixed;
  right: -6rem;
  bottom: -9rem;
  width: 36rem;
  height: 24rem;
  z-index: 0;
  pointer-events: none;
  opacity: 0.24;
  transform: rotate(-9deg);
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(56, 189, 248, 0.16) 8% 9%, transparent 9% 18%, rgba(56, 189, 248, 0.16) 18% 19%, transparent 19%),
    linear-gradient(0deg, transparent 0 15%, rgba(56, 189, 248, 0.12) 15% 16%, transparent 16% 31%, rgba(56, 189, 248, 0.12) 31% 32%, transparent 32% 47%, rgba(56, 189, 248, 0.12) 47% 48%, transparent 48%),
    linear-gradient(135deg, rgba(14, 165, 233, 0.20), rgba(15, 23, 42, 0));
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: 1.5rem;
}

body.user-mode > .app-header,
body.user-mode > .mode-switch,
body.user-mode > .layout {
  position: relative;
  z-index: 1;
}

body.user-mode .app-header {
  padding-top: 2.4rem;
  padding-bottom: 1.3rem;
}

body.user-mode .app-header > div:first-child {
  max-width: 70rem;
}

body.user-mode .eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 0.42rem 0.72rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.10);
  color: #fcd34d;
  letter-spacing: 0.12em;
}

body.user-mode h1 {
  max-width: 58rem;
  color: #f8fafc;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

body.user-mode h2,
body.user-mode h3 {
  color: #f8fafc;
  letter-spacing: -0.018em;
}

body.user-mode .subtitle {
  max-width: 55rem;
  color: #aab7c8;
}

body.user-mode .status-pill {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.10);
  color: #fcd34d;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

body.user-mode .status-pill.ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

body.user-mode .status-pill.bad {
  border-color: rgba(251, 113, 133, 0.40);
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
}

body.user-mode .mode-switch {
  margin: 0 clamp(1rem, 3vw, 3rem) 1rem;
  padding: 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.20);
  border-radius: 999px;
  background: rgba(8, 13, 25, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 42px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

body.user-mode .mode-tab {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.68);
  color: #cbd5e1;
  box-shadow: none;
}

body.user-mode .mode-tab.active {
  border-color: rgba(34, 197, 94, 0.38);
  color: #f8fafc;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(14, 165, 233, 0.88));
  box-shadow: 0 10px 28px rgba(14, 165, 233, 0.18);
}

body.user-mode .mode-description {
  color: #9aa8bb;
}

body.user-mode .layout {
  gap: 1.1rem;
}

body.user-mode .card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.20);
  border-radius: 1.35rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(10, 18, 32, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

body.user-mode .card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.10), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.10), transparent 14rem);
}

body.user-mode .card > * {
  position: relative;
  z-index: 1;
}

body.user-mode .user-guide {
  border-color: rgba(34, 197, 94, 0.30);
  background:
    linear-gradient(135deg, rgba(22, 163, 74, 0.18), rgba(14, 165, 233, 0.08)),
    rgba(10, 18, 32, 0.84);
}

body.user-mode .tool-scope {
  border-color: rgba(96, 165, 250, 0.26);
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(139, 92, 246, 0.08)),
    rgba(10, 18, 32, 0.84);
}

body.user-mode .user-guide p,
body.user-mode .about-copy p,
body.user-mode .summary-preview,
body.user-mode .hint,
body.user-mode .work-status {
  color: #aab7c8;
}

body.user-mode .about-copy {
  border-color: rgba(148, 163, 184, 0.22);
}

body.user-mode .about-copy p:last-child,
body.user-mode .summary-title {
  color: #f8fafc;
}

body.user-mode .summary-action {
  background: rgba(96, 165, 250, 0.14);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.22);
}

body.user-mode .tool-about[open] .summary-action {
  background: rgba(14, 165, 233, 0.14);
  color: #bae6fd;
}

body.user-mode label,
body.user-mode .roof-tilt-field,
body.user-mode .field-label-inline {
  color: #dbe7f3;
}

body.user-mode input,
body.user-mode select,
body.user-mode textarea,
body.user-mode .readonly-pill {
  border-color: rgba(148, 163, 184, 0.30);
  background: rgba(3, 7, 18, 0.58);
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.user-mode input::placeholder,
body.user-mode textarea::placeholder {
  color: #64748b;
}

body.user-mode input:focus,
body.user-mode select:focus,
body.user-mode textarea:focus {
  outline: 2px solid rgba(14, 165, 233, 0.45);
  outline-offset: 2px;
}

body.user-mode input:disabled,
body.user-mode select:disabled,
body.user-mode textarea:disabled {
  background: rgba(30, 41, 59, 0.74);
  color: #94a3b8;
}

body.user-mode select {
  border-color: rgba(245, 158, 11, 0.40);
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.13), rgba(15, 23, 42, 0.88)),
    rgba(3, 7, 18, 0.68);
  color: #fff7ed;
}

body.user-mode label:has(select),
body.user-mode .priority-select {
  border-color: rgba(245, 158, 11, 0.26) !important;
  background: rgba(245, 158, 11, 0.08) !important;
}

body.user-mode button {
  background: rgba(30, 41, 59, 0.92);
  color: #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.user-mode button.primary {
  color: #051019;
  background: linear-gradient(135deg, #34d399, #fbbf24);
  box-shadow: 0 18px 38px rgba(245, 158, 11, 0.20);
}

body.user-mode button.secondary,
body.user-mode .roof-angle-help-button {
  border-color: rgba(96, 165, 250, 0.30);
  background: rgba(59, 130, 246, 0.13);
  color: #bfdbfe;
}

body.user-mode .pay-button {
  color: #111827;
  background: linear-gradient(135deg, #facc15, #fb923c);
  box-shadow: 0 18px 40px rgba(251, 146, 60, 0.24);
}

body.user-mode .payment-hint {
  color: #fcd34d;
}

body.user-mode .workflow-basic .form-grid,
body.user-mode .workflow-load > .form-grid,
body.user-mode .workflow-load-addons .form-grid,
body.user-mode .workflow-user-tariff .form-grid,
body.user-mode .workflow-user-advanced .form-grid,
body.user-mode .workflow-scenarios .form-grid,
body.user-mode .workflow-costs .form-grid,
body.user-mode .workflow-grid .form-grid,
body.user-mode .workflow-advanced .form-grid,
body.user-mode .workflow-requisites .form-grid,
body.user-mode .basic-field-group,
body.user-mode .tariff-subsidy-layout,
body.user-mode .subsidy-panel {
  border-color: rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.040), rgba(255, 255, 255, 0.018)),
    rgba(15, 23, 42, 0.54);
}

body.user-mode .basic-group-title,
body.user-mode .subsidy-panel h3 {
  color: #f8fafc;
}

body.user-mode .feedback-panel {
  align-items: stretch;
}

body.user-mode .feedback-copy,
body.user-mode .feedback-form {
  border-color: rgba(148, 163, 184, 0.20);
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.11), rgba(245, 158, 11, 0.08)),
    rgba(15, 23, 42, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.user-mode .feedback-copy p,
body.user-mode .feedback-counter,
body.user-mode .feedback-status {
  color: #b6c4d6;
}

body.user-mode .feedback-status.done {
  color: #86efac;
}

body.user-mode .feedback-status.error,
body.user-mode .feedback-counter.near-limit {
  color: #fca5a5;
}

body.user-mode .roof-cost-group,
body.user-mode .basic-project-group,
body.user-mode .roof-geometry-group {
  border-color: rgba(245, 158, 11, 0.20);
}

body.user-mode .season-card {
  border-color: rgba(148, 163, 184, 0.21);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(15, 23, 42, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 42px rgba(0, 0, 0, 0.16);
}

body.user-mode .season-spring {
  background:
    radial-gradient(circle at 20% 10%, rgba(34, 197, 94, 0.22), transparent 9rem),
    rgba(15, 23, 42, 0.64);
}

body.user-mode .season-summer {
  background:
    radial-gradient(circle at 18% 10%, rgba(245, 158, 11, 0.24), transparent 9rem),
    rgba(15, 23, 42, 0.64);
}

body.user-mode .season-autumn {
  background:
    radial-gradient(circle at 18% 10%, rgba(249, 115, 22, 0.22), transparent 9rem),
    rgba(15, 23, 42, 0.64);
}

body.user-mode .season-winter {
  background:
    radial-gradient(circle at 18% 10%, rgba(56, 189, 248, 0.22), transparent 9rem),
    rgba(15, 23, 42, 0.64);
}

body.user-mode .season-card::after {
  opacity: 0.10;
}

body.user-mode .season-title {
  color: #f8fafc;
}

body.user-mode .season-monthly {
  border-color: rgba(148, 163, 184, 0.18);
}

body.user-mode input[type="range"] {
  accent-color: #34d399;
}

body.user-mode .slider-hints {
  color: #94a3b8;
}

body.user-mode .constant-load-mark {
  color: #86efac;
}

body.user-mode .constant-load-mark::before {
  border-color: #86efac;
}

body.user-mode .season-power-hint {
  color: #86efac;
}

body.user-mode .scenario-card {
  border-color: rgba(34, 197, 94, 0.24);
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.13), rgba(15, 23, 42, 0.56)),
    rgba(15, 23, 42, 0.68);
}

body.user-mode .scenario-title {
  color: #dcfce7;
}

body.user-mode .scenario-config {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.58);
}

body.user-mode .scenario-config legend {
  color: #f8fafc;
}

body.user-mode .scenario-config-s1 {
  border-color: rgba(249, 115, 22, 0.34);
}

body.user-mode .scenario-config-s2 {
  border-color: rgba(34, 197, 94, 0.34);
}

body.user-mode .scenario-config-s3 {
  border-color: rgba(244, 63, 94, 0.36);
}

body.user-mode .scenario-config-s4 {
  border-color: rgba(139, 92, 246, 0.38);
}

body.user-mode .hint.warning {
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(245, 158, 11, 0.10);
  color: #fde68a;
}

body.user-mode .work-status.busy {
  color: #fcd34d;
}

body.user-mode .work-status.done {
  color: #86efac;
}

body.user-mode .work-status.error {
  color: #fecdd3;
}

body.user-mode .recommendation {
  border-color: rgba(34, 197, 94, 0.42);
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(14, 165, 233, 0.12)),
    rgba(15, 23, 42, 0.80);
  color: #f8fafc;
  box-shadow: 0 18px 46px rgba(34, 197, 94, 0.12);
}

body.user-mode .table-wrap {
  border-color: rgba(148, 163, 184, 0.20);
  background: rgba(15, 23, 42, 0.74);
}

body.user-mode table {
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
}

body.user-mode th,
body.user-mode td {
  border-color: rgba(148, 163, 184, 0.16);
}

body.user-mode th {
  background: rgba(30, 41, 59, 0.90);
  color: #cbd5e1;
}

body.user-mode .baseline-row,
body.user-mode .result-row-expanded td,
body.user-mode .capex-breakdown-row td {
  background: rgba(15, 23, 42, 0.92);
  color: #dbeafe;
}

body.user-mode .locked-result {
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
}

body.user-mode .capex-row-toggle {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(14, 165, 233, 0.16);
  color: #bae6fd;
}

body.user-mode .capex-row-toggle:hover,
body.user-mode .capex-row-toggle:focus-visible {
  background: rgba(14, 165, 233, 0.24);
}

body.user-mode .capex-breakdown-panel {
  border-color: rgba(56, 189, 248, 0.24);
  background: rgba(8, 13, 25, 0.98);
}

body.user-mode .capex-breakdown-title {
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.15);
}

body.user-mode .capex-line {
  background: rgba(15, 23, 42, 0.80);
}

body.user-mode .capex-name,
body.user-mode .capex-value {
  color: #f8fafc;
}

body.user-mode .capex-formula {
  color: #aab7c8;
}

body.user-mode .chart-box {
  border-color: rgba(96, 165, 250, 0.26);
  background:
    radial-gradient(circle at 16% 10%, rgba(245, 158, 11, 0.18), transparent 13rem),
    radial-gradient(circle at 84% 12%, rgba(14, 165, 233, 0.16), transparent 15rem),
    linear-gradient(135deg, rgba(8, 13, 25, 0.98), rgba(15, 23, 42, 0.96));
  color: #aab7c8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 20px 48px rgba(0, 0, 0, 0.20);
}

body.user-mode .chart-box.has-chart:hover {
  border-color: rgba(14, 165, 233, 0.72);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}

body.user-mode .legend {
  color: #dbeafe;
}

body.user-mode .post-payment-import-chart {
  border-color: rgba(148, 163, 184, 0.18);
}

body.user-mode .inline-control {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
}

body.user-mode .chart-modal {
  background: rgba(0, 0, 0, 0.78);
}

body.user-mode .chart-modal-panel {
  border: 1px solid rgba(148, 163, 184, 0.20);
  background: #0f172a;
}

body.user-mode .chart-modal-head {
  border-color: rgba(148, 163, 184, 0.18);
  background: #111827;
}

body.user-mode .chart-modal-body {
  background: #0b1120;
}

body.user-mode .modal-legend {
  border-color: rgba(148, 163, 184, 0.18);
}

body.user-mode .chart-modal-body.image-modal-body {
  background:
    radial-gradient(circle at 18% 12%, rgba(245, 158, 11, 0.18), transparent 18rem),
    radial-gradient(circle at 82% 16%, rgba(14, 165, 233, 0.18), transparent 20rem),
    linear-gradient(135deg, #050814, #0b1120 58%, #111827);
}

body.user-mode .image-modal-figure {
  position: relative;
  padding: clamp(0.8rem, 2vw, 1.5rem);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    rgba(15, 23, 42, 0.72);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.user-mode .image-modal-figure::before {
  content: "";
  position: absolute;
  inset: 0.45rem;
  pointer-events: none;
  border-radius: 0.95rem;
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(250, 204, 21, 0.12) 42.4%, transparent 47%),
    repeating-linear-gradient(90deg, rgba(96, 165, 250, 0.06) 0 1px, transparent 1px 4.8rem);
  opacity: 0.72;
}

body.user-mode .modal-guide-image {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.35);
  filter: saturate(1.06) contrast(1.02);
}

body.user-mode .conditional-block {
  border-color: rgba(96, 165, 250, 0.24);
  background:
    radial-gradient(circle at 8% 0%, rgba(14, 165, 233, 0.14), transparent 13rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.020)),
    rgba(15, 23, 42, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px rgba(0, 0, 0, 0.18);
}

body.user-mode .conditional-block .form-grid {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(3, 7, 18, 0.24);
}

body.user-mode .conditional-block .hint {
  color: #9fb0c5;
}

body.user-mode #userAdvancedDetails > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
  cursor: pointer;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(139, 92, 246, 0.12)),
    rgba(15, 23, 42, 0.74);
  color: #f8fafc;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(245, 158, 11, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

body.user-mode #userAdvancedDetails > summary::-webkit-details-marker {
  display: none;
}

body.user-mode #userAdvancedDetails > summary::before {
  content: "▾";
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.14);
  color: #fde68a;
  transition: transform 0.16s ease;
}

body.user-mode #userAdvancedDetails:not([open]) > summary::before {
  transform: rotate(-90deg);
}

body.user-mode #userAdvancedDetails > summary::after {
  content: "Atidaryta";
  margin-left: auto;
  padding: 0.32rem 0.6rem;
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

body.user-mode #userAdvancedDetails:not([open]) > summary::after {
  content: "Paspauskite išskleisti";
  border-color: rgba(250, 204, 21, 0.34);
  background: rgba(250, 204, 21, 0.13);
  color: #fde68a;
}

@media (max-width: 680px) {
  .analytics-grid,
  .analytics-panels {
    grid-template-columns: 1fr;
  }

  body.user-mode .mode-switch {
    border-radius: 1.2rem;
  }

  body.user-mode #userAdvancedDetails > summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  body.user-mode #userAdvancedDetails > summary::after {
    margin-left: 2.3rem;
  }
}
:root { --v6-accent: #9ecbff; }
.stale-notice { border: 1px solid #dc9e43; background: #442e16; color: #ffe2ac; padding: 12px 16px; border-radius: 12px; }
.curve-toggle { border: 1px solid #425269; border-radius: 8px; padding: 6px 9px; background: #172335; color: #dce7f5; font-size: 12px; cursor: pointer; }
.curve-toggle[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.curve-toggle:focus-visible { outline: 2px solid var(--v6-accent); }
.chart-modal-body.hourly-modal-body { display: block; overflow-y: auto; background: #0c1522; }
.hourly-modal-body .chart-modal-figure { display: block; padding-top: 14px; }
.chart-modal-body.hourly-modal-body svg { width: 100%; height: auto; max-height: none; }
