:root {
  color-scheme: light;
  --ink: #15212f;
  --muted: #5e6875;
  --line: #d8dee8;
  --panel: #ffffff;
  --wash: #f3f7fb;
  --brand: #006fb9;
  --brand-dark: #004f86;
  --accent: #f2b544;
  --ok: #167a4a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
}

button,
select,
input {
  font: inherit;
}

a {
  color: inherit;
}

.home-shell,
.app-shell {
  min-height: 100vh;
}

.home-hero,
.app-header,
.workspace,
.legal {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.home-hero {
  padding: 64px 0;
}

.eyebrow {
  color: var(--brand);
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(32px, 6vw, 68px);
  line-height: 1.03;
  letter-spacing: 0;
  margin: 0;
  max-width: 820px;
}

.lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 720px;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.country-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 22px;
  text-decoration: none;
}

.country-card:hover {
  border-color: var(--brand);
}

.flag {
  align-items: center;
  background: var(--brand);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.country-card strong {
  font-size: 24px;
}

.country-card small {
  color: var(--muted);
  line-height: 1.45;
}

.app-header {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 18px 0;
}

.brand {
  align-items: center;
  display: flex;
  gap: 10px;
  font-weight: 850;
  text-decoration: none;
}

.brand-mark {
  background: var(--brand);
  border-radius: 6px;
  color: white;
  display: inline-grid;
  height: 34px;
  place-items: center;
  width: 34px;
}

.controls {
  display: flex;
  gap: 10px;
}

.select {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 12px;
}

.workspace {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(280px, 410px) 1fr;
  padding: 18px 0 42px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.panel h2 {
  font-size: 20px;
  margin: 0 0 14px;
}

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

.purpose {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  min-height: 64px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.purpose[aria-pressed="true"] {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 111, 185, .12);
}

.purpose-icon {
  background: #eaf4fb;
  border-radius: 8px;
  color: var(--brand);
  display: grid;
  flex: 0 0 42px;
  height: 42px;
  place-items: center;
}

.purpose strong,
.purpose small {
  display: block;
}

.purpose small,
.hint,
.status {
  color: var(--muted);
}

.dropzone {
  align-items: center;
  border: 2px dashed #b7c3d2;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  justify-items: center;
  min-height: 172px;
  padding: 18px;
  text-align: center;
}

.dropzone input {
  max-width: 100%;
}

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

.preview-wrap {
  align-items: center;
  background: #dce7ef;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-height: 420px;
  padding: 18px;
}

canvas {
  background: white;
  display: block;
  max-height: 68vh;
  max-width: 100%;
}

.toolbar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tool {
  display: grid;
  gap: 6px;
}

.tool label {
  color: var(--muted);
  font-size: 13px;
}

.swatches {
  display: flex;
  gap: 8px;
}

.swatch {
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  height: 34px;
  width: 34px;
}

.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 3px rgba(0, 111, 185, .2);
}

.btn {
  align-items: center;
  background: var(--brand);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  text-decoration: none;
}

.btn.secondary {
  background: #e9eef5;
  color: var(--ink);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.checkout {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
}

.price {
  color: var(--ok);
  font-size: 24px;
  font-weight: 850;
}

.legal-links {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 12px;
}

.legal {
  padding: 42px 0;
}

.legal h1 {
  font-size: clamp(34px, 5vw, 56px);
  margin-bottom: 12px;
}

.legal h2 {
  font-size: 22px;
  margin: 0 0 14px;
}

.legal-section {
  margin-top: 28px;
}

.legal-table {
  background: white;
  border: 1px solid var(--line);
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.legal-table th,
.legal-table td {
  border-bottom: 1px solid var(--line);
  line-height: 1.55;
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  background: #f7f9fc;
  color: var(--ink);
  font-weight: 800;
  width: 30%;
}

.legal-table tr:last-child th,
.legal-table tr:last-child td {
  border-bottom: 0;
}

.legal-table a {
  color: var(--brand);
  font-weight: 750;
}

@media (max-width: 820px) {
  .country-grid,
  .workspace,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .preview-wrap {
    min-height: 320px;
  }

  .legal-table,
  .legal-table tbody,
  .legal-table tr,
  .legal-table th,
  .legal-table td {
    display: block;
    width: 100%;
  }

  .legal-table th {
    border-bottom: 0;
    padding-bottom: 6px;
  }

  .legal-table td {
    padding-top: 6px;
  }
}
