:root {
  --navy: #102a43;
  --turq: #19b6b2;
  --turq2: #58d6cf;
  --cream: #f7f5ef;
  --ink: #14212b;
  --muted: #687781;
  --line: #d7e0e4;
  --soft: #eef7f6;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --focus: #0b57d0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Montserrat, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

header {
  padding: 24px max(20px, 5vw);
  background: var(--navy);
  color: #fff;
  border-bottom: 5px solid var(--turq);
}
header .eyebrow { color: #b9d7d5; }
header .headerTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
header h1 { margin: 6px 0 8px; font-size: clamp(28px, 4vw, 44px); font-weight: 750; }
header h1 span { color: var(--turq2); }
header p { margin: 0; max-width: 720px; color: #dce8ed; }

.eyebrow {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #65747e;
  font-weight: 700;
}

#installBtn {
  display: none;
  border: 2px solid var(--turq2);
  background: transparent;
  color: #fff;
  padding: 11px 16px;
  font-weight: 700;
  white-space: nowrap;
}
#installBtn.visible { display: inline-flex; align-items: center; gap: 8px; }
#installBtn:hover { background: rgba(255,255,255,.08); }

#iosHelp {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  font-size: 13px;
  line-height: 1.6;
  max-width: 720px;
}
#iosHelp.visible { display: block; }
#iosHelp button {
  background: transparent;
  border: 1px solid rgba(255,255,255,.5);
  color: #fff;
  padding: 4px 10px;
  font-size: 11px;
  margin-top: 8px;
}

main {
  max-width: 1180px;
  margin: 30px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 24px;
}

.panel { background: #fff; border: 1px solid var(--line); padding: 24px; }

.section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; }

.field { margin: 14px 0; }

label, .groupLabel { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }

textarea, select, input[type=text] {
  width: 100%;
  border: 1px solid #b9c5cc;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
}
textarea { min-height: 82px; resize: vertical; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

.field-error {
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
  display: none;
}
.field-error.visible { display: block; }
.field.has-error textarea,
.field.has-error input[type=text] {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.swatch { border: 1px solid var(--line); padding: 10px; background: #fff; }
.swatch label { font-size: 11px; }
.colorline { display: flex; gap: 7px; }
.colorline input[type=color] { width: 44px; height: 44px; border: 1px solid #b9c5cc; padding: 2px; background: #fff; }
.colorline input[type=text] { min-width: 0; padding: 8px; }

.stylegrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shapegrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.shapebtn, .stylebtn {
  border: 1px solid #b9c5cc;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  min-height: 44px;
  padding: 9px 5px;
}
.shapebtn.active, .stylebtn.active {
  border: 2px solid var(--turq);
  background: var(--soft);
  padding: 8px 4px;
}
.shapebtn[aria-pressed="true"], .stylebtn[aria-pressed="true"] {
  border: 2px solid var(--turq);
  background: var(--soft);
}
.stylebtn { padding: 10px 6px; font-size: 12px; }
.shapeicon, .doticon { display: block; font-size: 22px; height: 28px; line-height: 28px; }
.doticon { display: grid; place-items: center; font-size: 24px; height: 28px; line-height: 1; }

.filebtn, button {
  border: 0;
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  min-height: 44px;
}
button:disabled { opacity: .6; cursor: not-allowed; }
.filebtn { display: inline-flex; align-items: center; }
.filebtn input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.secondary { background: #e8eff1; color: var(--navy); }

.logoRow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.logoPreviewBox {
  margin-top: 10px;
  min-height: 60px;
  border: 1px dashed #b9c5cc;
  background: #fafcfc;
  padding: 9px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.logoPreview { max-width: 210px; max-height: 54px; width: auto; height: auto; object-fit: contain; display: none; }

.range { display: flex; align-items: center; gap: 12px; }
.range input { width: 100%; min-height: 32px; }
.range span { width: 48px; text-align: right; font-size: 12px; }

.qrstage {
  min-height: 430px;
  display: grid;
  place-items: center;
  background: #fafcfc;
  border: 1px solid var(--line);
  padding: 28px;
  overflow: auto;
}
#qrcode { display: grid; place-items: center; max-width: 100%; }
#qrcode canvas, #qrcode svg { max-width: 100%; height: auto; }

.status {
  margin-top: 14px;
  padding: 11px 13px;
  border-left: 4px solid var(--turq);
  background: var(--soft);
  font-size: 12px;
  line-height: 1.5;
}
.status.warn { border-left-color: var(--danger); background: var(--danger-soft); }

.actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.small { font-size: 11px; color: var(--muted); line-height: 1.5; }
.pill { display: inline-block; padding: 4px 7px; background: var(--soft); font-size: 10px; font-weight: 700; margin: 4px 4px 0 0; }

footer.siteFooter {
  max-width: 1180px;
  margin: 0 auto 28px;
  padding: 0 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
footer.siteFooter a { color: var(--navy); font-weight: 700; text-decoration: underline; }

@media (max-width: 820px) {
  main { grid-template-columns: 1fr; }
  .colors { grid-template-columns: 1fr 1fr; }
  .qrstage { min-height: 340px; }
}
@media (max-width: 500px) {
  .row, .colors { grid-template-columns: 1fr; }
  .stylegrid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-contrast: more) {
  .shapebtn, .stylebtn, .filebtn, button { border-width: 2px; }
}
