/* Pimp My GPX – all rules are scoped to .pmg-root so they will not leak into your theme. */
.pmg-root {
  --pmg-bg: #f7f4ee;
  --pmg-card: #fbfaf7;
  --pmg-ink: #14201a;
  --pmg-muted: #5d6b63;
  --pmg-green: #1f4a3a;
  --pmg-green-dark: #163527;
  --pmg-accent: #b8623a;
  --pmg-line: #e2dccf;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--pmg-ink);
  background: var(--pmg-bg);
  text-align: left;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  max-width: 100%;
}
/* Full-bleed: the script measures the theme's offset and sets exact width/margin (see fitFullWidth in the JS). */
.pmg-root--full { width: 100%; }
html:has(.pmg-root--full) { overflow-x: clip; }
.pmg-root *, .pmg-root *::before, .pmg-root *::after { box-sizing: border-box; }
.pmg-root [hidden] { display: none !important; }
.pmg-root h1, .pmg-root h2, .pmg-root h3, .pmg-root p, .pmg-root ul { margin: 0; padding: 0; }
.pmg-root ul { list-style: none; }
.pmg-root svg { max-width: none; }
.pmg-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.pmg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; }

/* Type */
.pmg-root .pmg-h1 { overflow-wrap: break-word; font-size: clamp(2.5rem, 8vw, 4.4rem); line-height: 1; font-weight: 800; letter-spacing: -0.035em; color: var(--pmg-ink); }
.pmg-root .pmg-h2 { font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; color: var(--pmg-ink); }
.pmg-eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; color: var(--pmg-green); margin-bottom: 14px !important; }
.pmg-lead { font-size: 1.1rem; color: #33443b; max-width: 34em; margin-top: 18px !important; }
.pmg-sub { color: var(--pmg-muted); margin-top: 10px !important; max-width: 36em; }
.pmg-note {
  display: inline-block; position: relative; margin-top: 18px !important;
  font-family: "Bradley Hand", "Segoe Print", "Chalkboard SE", "Comic Sans MS", cursive;
  font-size: 1.6rem; line-height: 1.15; color: var(--pmg-ink); transform: rotate(-3deg); transform-origin: left center;
}
.pmg-note svg { display: block; width: 100%; height: 10px; color: var(--pmg-green); margin-top: 2px; }

/* Buttons and links */
.pmg-root .pmg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--pmg-green); color: #fff; border: 2px solid var(--pmg-green); border-radius: 12px;
  padding: 14px 26px; font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2;
  cursor: pointer; text-decoration: none; text-transform: none; letter-spacing: 0; box-shadow: none;
  transition: background-color 0.15s, transform 0.15s;
}
.pmg-root .pmg-btn:hover { background: var(--pmg-green-dark); color: #fff; }
.pmg-root .pmg-btn:active { transform: translateY(1px); }
.pmg-root .pmg-btn:focus-visible, .pmg-root .pmg-link:focus-visible, .pmg-root .pmg-style:focus-visible { outline: 3px solid var(--pmg-accent); outline-offset: 3px; }
.pmg-root .pmg-btn[disabled] { opacity: 0.65; cursor: progress; }
.pmg-root .pmg-btn--lg { padding: 18px 30px; font-size: 1.1rem; width: 100%; max-width: 560px; }
.pmg-root .pmg-btn--block { width: 100%; }
.pmg-root .pmg-btn--ghost { background: transparent; color: var(--pmg-green); }
.pmg-root .pmg-btn--ghost:hover { background: rgba(31, 74, 58, 0.08); color: var(--pmg-green); }
.pmg-root .pmg-link {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0; margin: 0;
  font-family: inherit; font-size: 1rem; font-weight: 500; color: var(--pmg-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; box-shadow: none;
}
.pmg-root .pmg-link:hover { color: var(--pmg-green); background: none; }

/* Optional header bar */
.pmg-bar { background: var(--pmg-bg); border-bottom: 1px solid var(--pmg-line); }
.pmg-bar__inner { display: flex; align-items: center; gap: 14px; padding-top: 14px; padding-bottom: 14px; }
.pmg-bar__brand { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.pmg-bar__tag { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 4px; }

/* Hero */
.pmg-hero { position: relative; overflow: hidden; padding: 40px 0 48px; background: #f0cfa8; }
.pmg-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.pmg-hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; }
.pmg-hero__copy, .pmg-drop { min-width: 0; }
.pmg-acts {
  display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px !important; padding: 12px 18px !important;
  width: max-content; max-width: 100%; border-radius: 16px; background: rgba(251, 250, 247, 0.78);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pmg-acts li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.88rem; font-weight: 600; margin: 0; }

/* Upload card */
.pmg-drop { background: rgba(251, 250, 247, 0.97); border-radius: 22px; padding: 14px; box-shadow: 0 24px 60px rgba(20, 32, 26, 0.25); transition: box-shadow 0.2s; }
.pmg-drop__zone { text-align: center; border: 1.5px dashed #b4ad9e; border-radius: 14px; padding: 30px 18px 22px; cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.pmg-drop.is-over .pmg-drop__zone { border-color: var(--pmg-green); background: #eaf1ec; }
.pmg-drop__zone .pmg-icon { display: block; margin: 0 auto 8px; color: var(--pmg-ink); }
.pmg-root .pmg-drop__title { font-size: 1.5rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
.pmg-drop__hint { color: var(--pmg-muted); margin: 6px 0 18px !important; }
.pmg-drop__fine { color: var(--pmg-muted); font-size: 0.85rem; margin-top: 16px !important; }
.pmg-drop__example { text-align: center; margin-top: 12px !important; }
.pmg-error { margin: 12px 4px 0 !important; padding: 10px 14px; border-radius: 10px; background: #fbe9e3; color: #8a2a12; font-size: 0.92rem; }

/* Style picker */
.pmg-styles { padding: 44px 0 56px; background: var(--pmg-card); border-radius: 28px 28px 0 0; margin-top: -24px; position: relative; z-index: 2; }
.pmg-styles__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.pmg-root .pmg-style {
  display: block; min-width: 0; width: 100%; background: transparent; border: 2px solid transparent; border-radius: 12px; padding: 6px; margin: 0;
  font-family: inherit; color: var(--pmg-ink); text-align: center; cursor: pointer; box-shadow: none; transition: border-color 0.15s, background-color 0.15s;
}
.pmg-root .pmg-style:hover { background: #fff; }
.pmg-root .pmg-style[aria-pressed="true"] { border-color: var(--pmg-green); background: #fff; }
.pmg-style canvas { display: block; width: 100%; max-width: 100%; min-width: 0; height: auto; aspect-ratio: 3 / 4; border-radius: 4px; box-shadow: 0 2px 10px rgba(20, 32, 26, 0.18); }
.pmg-style span { display: block; margin-top: 8px; font-size: 0.9rem; font-weight: 600; }
.pmg-cta { margin-top: 30px !important; }

/* Studio */
.pmg-studio { padding: 48px 0 56px; background: #fff; border-top: 1px solid var(--pmg-line); border-bottom: 1px solid var(--pmg-line); }
.pmg-studio__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.pmg-controls, .pmg-preview { min-width: 0; }
.pmg-preview { order: -1; }
.pmg-root .pmg-preview__h { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.pmg-paper { background: #ebe6db; padding: 16px; border-radius: 16px; margin-bottom: 14px; }
.pmg-paper canvas { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 3 / 4; box-shadow: 0 6px 24px rgba(20, 32, 26, 0.25); background: #fff; }
.pmg-preview .pmg-btn + .pmg-btn { margin-top: 10px; }
.pmg-preview__note { color: var(--pmg-muted); font-size: 0.85rem; margin-top: 12px !important; text-align: center; }
.pmg-step { padding: 20px 0; border-top: 1px solid var(--pmg-line); }
.pmg-step:first-child { border-top: 0; padding-top: 0; }
.pmg-root .pmg-step__h { display: flex; align-items: baseline; gap: 10px; font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; }
.pmg-step__n { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; color: #6a7b8a; font-weight: 500; }
.pmg-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: #efeadf; border: 1px solid var(--pmg-line); border-radius: 10px; }
.pmg-file__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pmg-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px !important; color: var(--pmg-muted); font-size: 0.9rem; }
.pmg-meta strong { color: var(--pmg-ink); font-weight: 700; }
.pmg-styles__row--small { margin-top: 0; }
.pmg-field { display: block; margin-bottom: 14px; }
.pmg-field span, .pmg-colors span { display: block; font-size: 0.85rem; font-weight: 600; color: var(--pmg-muted); margin-bottom: 6px; }
.pmg-root .pmg-field input, .pmg-root .pmg-field select {
  display: block; width: 100%; height: 46px; padding: 0 14px; margin: 0; font-family: inherit; font-size: 16px; color: var(--pmg-ink);
  background: #fff; border: 1px solid #cfc8b8; border-radius: 10px; box-shadow: none;
}
.pmg-root .pmg-field input:focus, .pmg-root .pmg-field select:focus { outline: 3px solid rgba(31, 74, 58, 0.25); border-color: var(--pmg-green); }
.pmg-check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.pmg-check input { width: 20px; height: 20px; accent-color: var(--pmg-green); margin: 0; }
.pmg-colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 12px; }
.pmg-root .pmg-colors input[type="color"] { display: block; width: 100%; height: 46px; padding: 3px; margin: 0; background: #fff; border: 1px solid #cfc8b8; border-radius: 10px; cursor: pointer; }

/* Benefits */
.pmg-benefits { padding: 36px 0 48px; background: var(--pmg-card); }
.pmg-benefits__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
.pmg-benefits__list li { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.pmg-benefits__list .pmg-icon { color: var(--pmg-green); margin-bottom: 8px; }
.pmg-benefits__list strong { font-weight: 700; }
.pmg-benefits__list span { color: var(--pmg-muted); font-size: 0.9rem; }
.pmg-noscript { padding: 16px 20px; text-align: center; background: #fbe9e3; }

/* Larger screens */
@media (min-width: 640px) {
  .pmg-styles__row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
  .pmg-benefits__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .pmg-hero { padding: 88px 0 104px; }
  .pmg-hero__inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: center; gap: 64px; }
  .pmg-note { position: absolute; right: 0; top: -56px; width: 8.5em; margin: 0 !important; transform-origin: center; transform: rotate(-6deg); }
  .pmg-styles { border-radius: 0; margin-top: 0; padding: 72px 0 80px; }
  .pmg-studio__grid { grid-template-columns: minmax(0, 1fr) 440px; gap: 56px; align-items: start; }
  .pmg-preview { order: 0; position: sticky; top: 24px; }
  .pmg-styles__row--small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .pmg-root * { transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 380px) {
  .pmg-wrap { padding: 0 16px; }
  .pmg-styles__row { gap: 8px; }
  .pmg-acts { gap: 8px 14px; padding: 10px 12px !important; }
}
