/* fatsecret-infographic — оформление оболочки приложения. */

:root {
  --bg: #0b0e14;
  --bg-soft: #10131a;
  --surface: #161b26;
  --surface-alt: #1d2433;
  --border: #262e40;
  --text: #f4f6fb;
  --text-muted: #a5aec4;
  --text-faint: #6b7590;
  --accent: #f5a524;
  --accent-soft: rgba(245, 165, 36, 0.16);
  --danger: #ff5c7a;
  --positive: #4ade80;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(245, 165, 36, 0.09), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(78, 168, 255, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

p {
  margin: 0;
}

a {
  color: var(--accent);
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 14, 20, 0.72);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-sub {
  color: var(--text-faint);
  font-size: 13px;
}

.session {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.session .who {
  color: var(--text-muted);
  font-size: 14px;
}

/* ------------------------------------------------------------------ buttons */

button,
.primary,
.ghost {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover:not(:disabled),
.primary:hover,
.ghost:hover {
  border-color: rgba(245, 165, 36, 0.5);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.primary {
  background: linear-gradient(180deg, #ffb84d, #f5a524);
  border-color: transparent;
  color: #1a1204;
}

.primary.disabled {
  opacity: 0.6;
}

.ghost {
  background: transparent;
}

/* ------------------------------------------------------------------- layout */

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 24px;
  padding: 24px 32px 8px;
  align-items: start;
}

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

.controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 92px;
}

@media (max-width: 1000px) {
  .controls {
    position: static;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 700;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--surface-alt);
}

.chip[data-active='true'] {
  background: var(--accent-soft);
  border-color: rgba(245, 165, 36, 0.55);
  color: #ffd189;
}

.custom-range {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.custom-range label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

input[type='date'],
input[type='number'],
select {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  width: 100%;
}

input:focus,
select:focus {
  outline: 2px solid rgba(245, 165, 36, 0.45);
  outline-offset: 1px;
}

.templates {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-weight: 500;
}

.template-card strong {
  font-size: 15px;
  font-weight: 650;
}

.template-card span {
  font-size: 12.5px;
  color: var(--text-faint);
  font-weight: 400;
}

.template-card[data-active='true'] {
  border-color: rgba(245, 165, 36, 0.6);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.params {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.row.actions {
  justify-content: stretch;
}

.row.actions button {
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 120px;
}

.field label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.hint {
  font-size: 12.5px;
  color: var(--text-faint);
}

/* -------------------------------------------------------------------- stage */

.stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.stage-head h2 {
  font-size: 18px;
}

.stage-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  min-height: 260px;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview[data-loading='true']::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.preview svg {
  display: block;
  width: 100%;
  height: 100%;
}

.locked {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  max-width: 620px;
}

.locked h3 {
  font-size: 20px;
}

.locked p,
.locked li {
  color: var(--text-muted);
  font-size: 14.5px;
}

.locked ol {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legend-item strong {
  font-size: 18px;
  font-weight: 700;
}

.legend-item span {
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ------------------------------------------------------------------ banner */

.banner {
  margin: 16px 32px 0;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  background: rgba(255, 92, 122, 0.12);
  border: 1px solid rgba(255, 92, 122, 0.4);
  color: #ffb3c1;
}

.banner[data-kind='info'] {
  background: var(--accent-soft);
  border-color: rgba(245, 165, 36, 0.4);
  color: #ffd189;
}

@media (max-width: 1000px) {
  .banner {
    margin: 12px 16px 0;
  }
}

/* ------------------------------------------------------------------ footer */

.footer {
  padding: 20px 32px 32px;
  color: var(--text-faint);
  font-size: 12.5px;
  max-width: 900px;
}

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 40;
  max-width: min(90vw, 560px);
}

.toast[data-kind='error'] {
  border-color: rgba(255, 92, 122, 0.5);
  color: #ffb3c1;
}
