:root {
  color-scheme: light;
  --bg: #fff8f1;
  --panel: rgba(255, 252, 248, 0.94);
  --panel-strong: #fffdf9;
  --ink: #1f1715;
  --muted: #705b53;
  --line: rgba(62, 38, 28, 0.1);
  --line-strong: rgba(62, 38, 28, 0.18);
  --accent: #FF7A1A;
  --accent-2: #f52d7e;
  --shadow: 0 22px 64px rgba(50, 27, 16, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 122, 26, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(214, 165, 70, 0.12), transparent 24%),
    linear-gradient(180deg, #fff8f1 0%, #f9eee3 100%);
}

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

button {
  cursor: pointer;
}

.page-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 250, 241, 0.82), rgba(244, 239, 230, 0.72));
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

h1 {
  font-family: var(--font-display);
  font-size: 54px;
}

h2 {
  font-size: 24px;
}

.lede {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.step-list {
  display: grid;
  gap: 10px;
}

.step-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  padding: 14px 16px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.step-pill:hover {
  transform: translateY(-1px);
}

.step-pill.active {
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.15), rgba(255, 255, 255, 0.82));
  border-color: rgba(255, 122, 26, 0.28);
}

.step-pill-title {
  display: block;
  font-weight: 800;
}

.step-pill-desc {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-card,
.topbar,
.progress-card,
.wizard-card,
.card-item,
.summary-card,
.callout {
  box-shadow: var(--shadow);
}

.sidebar-card {
  margin-top: auto;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(21, 39, 31, 0.08);
}

.sidebar-card-title {
  margin: 0 0 10px;
  font-weight: 800;
}

.sidebar-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.main {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border-radius: var(--radius-xl);
  background: rgba(255, 252, 245, 0.88);
  border: 1px solid rgba(21, 39, 31, 0.08);
}

.topbar-actions,
.final-actions,
.bottom-actions,
.toggle-row,
.switch-row,
.inline-head {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bottom-actions {
  margin-top: 12px;
  justify-content: flex-end;
}

.progress-card,
.wizard-card {
  margin-top: 18px;
  border-radius: var(--radius-xl);
  background: var(--panel);
  border: 1px solid rgba(21, 39, 31, 0.08);
}

.progress-card {
  padding: 20px 24px;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(21, 39, 31, 0.08);
  overflow: hidden;
}

.progress-fill {
  width: 16%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.wizard-card {
  padding: 24px;
}

.panel-head {
  margin-bottom: 18px;
}

.panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.step-panel {
  animation: fade-in 160ms ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 23, 21, 0.46);
}

.auth-card {
  width: min(420px, 100%);
  padding: 26px;
  border-radius: var(--radius-xl);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.auth-copy {
  margin: 12px 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-error {
  margin: 0;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 600;
}

.auth-actions {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  font-size: 13px;
  font-weight: 700;
  color: #28443a;
}

.field input,
.field select,
.field textarea,
.card-item input,
.card-item select,
.card-item textarea {
  width: 100%;
  border: 1px solid rgba(21, 39, 31, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field textarea,
.card-item textarea {
  resize: vertical;
  min-height: 96px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.card-item input:focus,
.card-item select:focus,
.card-item textarea:focus {
  border-color: rgba(255, 122, 26, 0.45);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.12);
}

.field-stack {
  display: grid;
  gap: 12px;
}

.upload-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: start;
}

.toggle-btn,
.ghost-btn,
.primary-btn,
.remove-btn {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.toggle-btn,
.ghost-btn {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(21, 39, 31, 0.12);
  color: var(--ink);
}

.toggle-btn.active {
  background: rgba(255, 122, 26, 0.12);
  border-color: rgba(255, 122, 26, 0.24);
}

.ghost-btn.active {
  background: rgba(255, 122, 26, 0.12);
  border-color: rgba(255, 122, 26, 0.24);
  color: var(--accent);
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.remove-btn {
  background: rgba(255, 237, 237, 0.92);
  border-color: rgba(185, 28, 28, 0.16);
  color: #8f1e1e;
  justify-self: start;
}

.toggle-btn:hover,
.ghost-btn:hover,
.primary-btn:hover,
.remove-btn:hover {
  transform: translateY(-1px);
}

.switch-row {
  margin: 18px 0;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(21, 39, 31, 0.12);
  font-weight: 700;
}

.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hint code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255, 122, 26, 0.08);
}

.submit-log {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(21, 39, 31, 0.08);
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.5;
}

.submit-log:empty {
  display: none;
}

.submit-log-item {
  margin: 0;
}

.submit-log-item[data-kind='info'] {
  color: var(--ink);
}

.submit-log-item[data-kind='success'] {
  color: var(--accent);
  font-weight: 700;
}

.submit-log-item[data-kind='error'] {
  color: #b42318;
  font-weight: 700;
}

.callout {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(214, 165, 70, 0.15), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(214, 165, 70, 0.2);
}

.callout p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(21, 39, 31, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.checkbox-pill input {
  accent-color: var(--accent);
}

.stack {
  display: grid;
  gap: 14px;
}

.card-item {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(21, 39, 31, 0.08);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.reports-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.reports-filter {
  margin: 0;
}

.reports-metric {
  min-width: 140px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(21, 39, 31, 0.08);
}

.reports-metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.reports-list,
.competitions-list {
  display: grid;
  gap: 14px;
}

.competition-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(21, 39, 31, 0.08);
  box-shadow: var(--shadow);
}

.competition-card h4 {
  font-size: 18px;
}

.push-form {
  display: grid;
  gap: 18px;
  max-width: 720px;
}

.push-actions {
  justify-content: flex-start;
}

.report-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(21, 39, 31, 0.08);
}

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

.report-card-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.report-delete-btn {
  padding: 10px 14px;
}

.report-type {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.report-card h4 {
  font-size: 18px;
}

.report-date {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.report-field,
.report-message {
  margin: 10px 0 0;
  color: var(--ink);
  line-height: 1.6;
}

.report-field a {
  color: var(--accent);
  word-break: break-all;
}

.report-screenshot-link {
  display: block;
  margin-top: 14px;
}

.report-screenshot {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(21, 39, 31, 0.08);
}

.summary-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(21, 39, 31, 0.08);
}

.summary-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-value {
  margin: 8px 0 0;
  font-weight: 800;
  line-height: 1.45;
}

#specPreview {
  min-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.mode-section {
  margin-top: 16px;
}

@media (max-width: 1180px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 820px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .progress-card,
  .wizard-card {
    border-radius: 22px;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .checkbox-grid,
  .summary-grid,
  .upload-grid,
  .reports-toolbar {
    grid-template-columns: 1fr;
  }

  .competition-card {
    align-items: stretch;
    flex-direction: column;
  }

  .span-2 {
    grid-column: auto;
  }

  h1 {
    font-size: 44px;
  }
}
