:root {
  --bg: #f3f6f1;
  --panel: #ffffff;
  --ink: #111a16;
  --muted: #617065;
  --line: #dbe3d9;
  --line-strong: #c8d6cd;
  --accent: #08705b;
  --accent-2: #2457a6;
  --accent-soft: #e7f3ed;
  --warn: #ad6a00;
  --danger: #aa2f2f;
  --ok: #16734c;
  --shadow: 0 24px 70px rgba(18, 33, 26, 0.12);
  --shadow-soft: 0 12px 34px rgba(18, 33, 26, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 16% 8%, rgba(8, 112, 91, 0.08), transparent 30%),
    linear-gradient(135deg, #f7faf4 0%, var(--bg) 50%, #edf3ef 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  background: linear-gradient(180deg, #112219 0%, #14271f 58%, #0d1a14 100%);
  color: #eef5ee;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

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

.brand span:last-child,
.side-note p {
  color: #b8c8bc;
}

.logo {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: contain;
  background: #0c0f0d;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.steps li {
  padding: 10px 12px;
  border-radius: 8px;
  color: #b8c8bc;
  font-weight: 650;
}

.steps li.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.steps li.done::after {
  content: "Done";
  float: right;
  color: #e7f35c;
  font-size: 12px;
}

.side-note {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.privacy-note {
  margin-top: 0;
  background: rgba(255, 255, 255, 0.05);
}

.side-note h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.side-note p {
  margin: 0;
  line-height: 1.5;
  font-size: 14px;
}

.workspace {
  padding: 34px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}

h1 {
  margin: 0;
  max-width: 860px;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.lead {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.panel {
  display: none;
  background: var(--panel);
  border: 1px solid rgba(200, 214, 205, 0.86);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.panel.active {
  display: block;
}

.platform-grid,
.summary-grid,
.export-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

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

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

.choice-heading {
  margin: 12px 0 10px;
  font-size: 15px;
  color: var(--accent);
}

.secondary-heading {
  margin-top: 22px;
  color: var(--muted);
}

.need-grid,
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.need-grid div,
.preset-card,
.form-help,
.responsible-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  padding: 14px;
}

.need-grid strong,
.need-grid span,
.preset-card strong,
.preset-card span,
.form-help strong,
.form-help span {
  display: block;
}

.need-grid span,
.preset-card span,
.form-help span {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 5px;
}

.platform,
.download-card,
.summary-card {
  text-align: left;
  border: 1px solid rgba(200, 214, 205, 0.92);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.download-card:disabled {
  background: #f4f6f3;
}

.platform {
  cursor: pointer;
  min-height: 150px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.platform-grid.compact .platform {
  min-height: 110px;
}

.platform:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 38px rgba(18, 33, 26, 0.11);
}

.preset-card {
  cursor: pointer;
  text-align: left;
}

.preset-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(12, 107, 88, 0.16);
}

.platform.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #ffffff 0%, #f5fbf7 100%);
  box-shadow: inset 0 0 0 2px rgba(8, 112, 91, 0.16), 0 18px 42px rgba(8, 112, 91, 0.13);
}

.platform-top,
.download-card strong {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.platform-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shop-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}

.fallback-logo {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #e7f3ed, #f7faf4);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.platform small,
.download-card span {
  color: var(--muted);
  line-height: 1.45;
}

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

.primary,
.secondary,
.ghost,
.chip {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  cursor: pointer;
}

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

.primary {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(8, 112, 91, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary:hover:not(:disabled) {
  background: #075f4e;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(8, 112, 91, 0.25);
}

.secondary {
  background: #eef4ec;
  color: var(--ink);
  border-color: var(--line);
}

.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.upload-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  gap: 10px;
  min-height: 150px;
  border: 1px dashed #a9b9ad;
  border-radius: 8px;
  background: #f8faf7;
  text-align: center;
}

.upload-zone input {
  max-width: 280px;
}

.upload-zone span {
  display: block;
  color: var(--muted);
}

.sample-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.status-strip {
  padding: 12px 14px;
  border-radius: 8px;
  background: #eef4ec;
  color: var(--muted);
}

.preview-wrap {
  margin-top: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 280px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  min-width: 140px;
}

th {
  background: #f3f6f2;
  text-align: left;
  position: sticky;
  top: 0;
}

.mapping-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.compact {
  margin-top: 14px;
}

.form-help {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.responsible-panel {
  margin-top: 14px;
}

.responsible-panel h3 {
  margin: 0 0 6px;
}

.responsible-panel p {
  margin: 0;
  color: var(--muted);
}

.responsible-panel.optional {
  opacity: 0.72;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.summary-card {
  display: grid;
  gap: 8px;
}

.summary-card strong {
  font-size: 28px;
}

.summary-card span {
  color: var(--muted);
}

.chip {
  background: #fff;
  border-color: var(--line);
}

.chip.active {
  background: var(--ink);
  color: #fff;
}

.result-list {
  display: grid;
  gap: 12px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
}

.result-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.result-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.badge {
  justify-self: end;
  align-self: start;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ready_for_review {
  background: #e8f7ef;
  color: var(--ok);
}

.missing_information {
  background: #fff4df;
  color: var(--warn);
}

.manual_review_needed,
.out_of_scope {
  background: #fdecec;
  color: var(--danger);
}

.issues {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.issue {
  border-left: 3px solid var(--warn);
  padding-left: 10px;
  color: var(--muted);
}

.import-guide {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.import-guide h3 {
  margin-top: 0;
}

.import-guide li {
  margin: 8px 0;
}

.app-footer {
  margin-top: 18px;
  display: grid;
  gap: 8px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.app-footer p {
  margin: 0;
}

.app-footer strong {
  color: var(--ink);
}

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

  .sidebar {
    min-height: auto;
  }

  .platform-grid,
  .summary-grid,
  .export-grid,
  .need-grid,
  .preset-grid,
  .mapping-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .result-card {
    grid-template-columns: 1fr;
  }

  .badge {
    justify-self: start;
  }
}
