:root {
  --paper: #faf7f1;
  --card: #ffffff;
  --ink: #1b2236;
  --muted: #646a78;
  --line: #e7e0d3;
  --navy: #0f1c35;
  --accent: #a8844c;
  --accent-ink: #ffffff;
  --danger: #a23a2c;
  --ok: #2f6b45;
  --radius: 12px;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Montserrat', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); }
a { color: inherit; }
img, canvas { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.25rem; }
button, input, select, textarea { font: inherit; color: inherit; }

/* nagłówek i stopka */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; background: var(--navy); color: #f1e9d8; }
.logo { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; text-decoration: none; letter-spacing: .02em; }
.site-header nav { display: flex; gap: 20px; align-items: center; font-size: .9rem; }
.site-header nav a { text-decoration: none; opacity: .85; }
.site-header nav a:hover { opacity: 1; }
.cart-link { position: relative; padding-right: 4px; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 600; }
.site-footer { margin-top: 64px; padding: 32px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: center; }
.site-footer a { text-decoration: none; }

/* przyciski i pola */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .1s, opacity .2s; }
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-small { padding: 8px 14px; font-size: .85rem; }
.btn-block { width: 100%; }
.field { display: block; margin-bottom: 14px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.field input, .field textarea, .field select { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-weight: 400; font-size: 16px; }
.field textarea { resize: vertical; min-height: 84px; }
.field input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--navy); height: 28px; }
.field input:focus, .field textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--accent); }
.field small, .hint { display: block; margin-top: 4px; font-weight: 400; font-size: .78rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: 9px; margin: 8px 0; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); flex: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.errors { color: var(--danger); font-size: .85rem; margin: 10px 0 0; padding-left: 18px; }
.ok { color: var(--ok); }
.counter { float: right; font-weight: 400; }

/* przełączniki segmentowe */
.seg { display: flex; padding: 4px; gap: 4px; background: #efe9de; border-radius: 999px; margin-bottom: 14px; }
.seg button, .seg label { flex: 1; padding: 8px 10px; border: 0; border-radius: 999px; background: transparent; font-size: .85rem; font-weight: 600; text-align: center; cursor: pointer; color: var(--muted); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg .active, .seg label:has(input:checked) { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* kreator */
.studio { display: grid; grid-template-columns: 300px minmax(0, 1fr) 360px; grid-template-areas: "left stage right"; gap: 0; min-height: calc(100vh - 60px); }
.panel { padding: 22px; background: var(--card); overflow-y: auto; }
.panel-left { grid-area: left; border-right: 1px solid var(--line); }
.panel-right { grid-area: right; border-left: 1px solid var(--line); }
.panel h3 { margin-top: 6px; }
.panel .group + .group { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.stage { grid-area: stage; display: flex; flex-direction: column; align-items: center; padding: 22px; background: #e9e4da; position: sticky; top: 0; height: 100vh; align-self: start; }
.product-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; justify-content: center; }
.product-tabs button { padding: 9px 16px; border: 1px solid transparent; border-radius: 999px; background: rgba(255,255,255,.6); font-weight: 600; font-size: .88rem; cursor: pointer; }
.product-tabs button.active { background: var(--navy); color: #fff; }
.preview-wrap { position: relative; flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; min-height: 0; }
.preview-wrap canvas { display: block; max-height: calc(100vh - 120px); max-width: 100%; width: auto; height: auto; box-shadow: 0 18px 40px rgba(15,28,53,.25), 0 2px 6px rgba(15,28,53,.15); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; pointer-events: none; }
.preview-shield { position: absolute; inset: 0; }
.preview-note { margin: 12px 0 0; font-size: .78rem; color: var(--muted); text-align: center; }

.choice-grid { display: grid; gap: 8px; }
.choice-grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.choice { position: relative; display: block; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; font-size: .85rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.choice b { display: block; font-size: .95rem; }
.choice small { color: var(--muted); }
.choice .price { float: right; font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px 8px; margin-bottom: 8px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 62px; font-size: .72rem; line-height: 1.2; text-align: center; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch i { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); box-shadow: inset 0 0 0 3px #fff; }
.swatch:has(input:checked) i { outline: 2px solid var(--navy); outline-offset: 2px; }
.buybox { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.buybox .total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.buybox .total strong { font-family: var(--serif); font-size: 1.8rem; }
.added { margin-top: 10px; padding: 10px 12px; border-radius: 9px; background: #edf5ef; font-size: .85rem; }

.place { position: relative; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.1); max-height: 260px; overflow-y: auto; }
.suggest li { padding: 9px 10px; border-radius: 7px; cursor: pointer; font-weight: 400; color: var(--ink); }
.suggest li:hover, .suggest li.active { background: #f3eee5; }
.suggest small { display: block; color: var(--muted); font-size: .75rem; }
.place-status { font-size: .8rem; color: var(--muted); margin: -6px 0 12px; }
details.manual { margin: -4px 0 12px; font-size: .85rem; }
details.manual summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }

.drop { display: block; padding: 18px; border: 2px dashed var(--line); border-radius: 12px; text-align: center; cursor: pointer; background: #fcfaf6; }
.drop:hover { border-color: var(--accent); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop span { display: block; font-weight: 600; }
.drop small { color: var(--muted); font-size: .78rem; }
.gpx-status { font-size: .85rem; margin: 10px 0 14px; }
.preset-list { display: grid; gap: 8px; margin-bottom: 14px; }
.preset-list button { text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.preset-list button.active { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.font-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; max-height: 300px; overflow-y: auto; padding-right: 2px; }
.font-choice { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; text-align: center; color: var(--ink); }
.font-choice input { position: absolute; opacity: 0; pointer-events: none; }
.font-choice span { font-size: 22px; line-height: 1.15; }
.font-choice small { font-size: .68rem; color: var(--muted); font-weight: 500; }
.font-choice:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.stat-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; margin-bottom: 6px; }
.stat-row input[type=text] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; width: 100%; }

@media (max-width: 1180px) {
  .studio { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "stage right" "left right"; }
  .panel-left { border-right: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .site-header { padding: 12px 16px; }
  .site-header nav { gap: 14px; }
  .site-header nav .hide-sm { display: none; }
  .studio { display: flex; flex-direction: column; }
  .panel-right { order: 1; }
  .panel-left { order: 2; }
  .stage { order: 0; align-self: stretch; position: sticky; top: 0; z-index: 10; height: auto; padding: 10px 16px 8px; box-shadow: 0 6px 14px rgba(0,0,0,.08); }
  .product-tabs { margin-bottom: 8px; }
  .product-tabs button { padding: 7px 12px; font-size: .8rem; }
  .preview-wrap canvas { max-height: 38vh; }
  .preview-note { display: none; }
  .panel { padding: 18px 16px; border: 0; }
  .panel-left { padding-bottom: 110px; }
  .buybox { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0,0,0,.08); }
  .buybox .total { margin-bottom: 6px; }
  .buybox .total strong { font-size: 1.4rem; }
  .font-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; max-height: 300px; overflow-y: auto; padding-right: 2px; }
.font-choice { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; text-align: center; color: var(--ink); }
.font-choice input { position: absolute; opacity: 0; pointer-events: none; }
.font-choice span { font-size: 22px; line-height: 1.15; }
.font-choice small { font-size: .68rem; color: var(--muted); font-weight: 500; }
.font-choice:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.stat-row { grid-template-columns: 130px 1fr; }
}

/* strony treści */
.page { max-width: 760px; margin: 0 auto; padding: 40px 16px; }
.page h2 { margin-top: 1.6em; }
.page p, .page li { color: #333a4a; }
.lead { font-size: 1.1rem; color: var(--muted); }
.hero { background: var(--navy); color: #f1e9d8; padding: 64px 16px 72px; text-align: center; }
.hero p { max-width: 560px; margin: 0 auto 26px; opacity: .85; font-size: 1.05rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; max-width: 1040px; margin: -40px auto 0; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 10px 30px rgba(15,28,53,.08); }
.card canvas { width: 100%; height: auto; border-radius: 4px; background: #e9e4da; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; }
.section { max-width: 1040px; margin: 64px auto 0; padding: 0 16px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; counter-reset: s; }
.steps div { padding: 18px; border-left: 2px solid var(--accent); }
.steps div::before { counter-increment: s; content: counter(s); font-family: var(--serif); font-size: 2rem; color: var(--accent); display: block; }
.price-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
.price-table th, .price-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.notice { padding: 14px 16px; border-radius: 10px; background: #f3eee5; font-size: .9rem; }

/* koszyk */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; max-width: 1100px; margin: 0 auto; padding: 32px 16px; }
.cart-item { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cart-item canvas { width: 96px; height: auto; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.cart-item .meta { font-size: .85rem; color: var(--muted); }
.cart-item .actions { display: flex; gap: 12px; margin-top: 6px; font-size: .85rem; }
.cart-item .actions button, .cart-item .actions a { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; }
.summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; align-self: start; }
.summary .line { display: flex; justify-content: space-between; margin: 6px 0; }
.summary .line.total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.honey { position: absolute; left: -9999px; }
@media (max-width: 860px) { .cart-layout { grid-template-columns: 1fr; } }
.bank { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.bank dt { font-size: .8rem; color: var(--muted); margin-top: 10px; }
.bank dd { margin: 2px 0 0; font-weight: 600; font-size: 1.05rem; word-break: break-all; }
