:root {
  --bg: #fff8d9;
  --ink: #161616;
  --muted: #4f4f4f;
  --brand: #ffcc00;
  --brand-soft: #ffe680;
  --brand-pale: #fff3bf;
  --brand-dark: #111111;
  --line: #e8ddab;
  --card: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #fffdf1 0%, #fff6ce 55%, #ffefad 100%);
}

.page {
  width: min(1140px, calc(100% - 24px));
  margin: 20px auto 36px;
}

.header {
  background: var(--card);
  border: 2px solid #1a1a1a;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { height: 58px; width: auto; display:block; }
.sub { margin: 0; color: var(--muted); font-weight: 600; }

.stack {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.top-config {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 0.58fr);
  gap: 18px;
  align-items: stretch;
}

.top-config-left {
  display: grid;
  gap: 10px;
  align-content: start;
}

.top-config-right h2 {
  margin-top: 0;
  margin-bottom: 10px;
}

.top-config-right {
  display: grid;
  grid-template-rows: 1fr;
  align-content: start;
}

.legend-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 388px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 10px 10px;
}

.legend-frame::before {
  content: "Schemat elementów";
  position: absolute;
  top: -11px;
  left: 12px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 700;
  padding: 0 6px;
}

.card {
  background: var(--card);
  border: 2px solid #1a1a1a;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 0 rgba(255, 204, 0, 0.35);
}

h1, h2 { margin: 0 0 14px; }
h1 { font-size: 24px; color: var(--brand-dark); }
h2 { font-size: 18px; color: var(--brand-dark); margin-top: 18px; }
.hint {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.hint.compact {
  margin: -6px 0 10px;
  font-size: 13px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

input, select, button {
  font: inherit;
}

input, select {
  min-height: 38px;
  border: 1px solid #b6b6b6;
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--ink);
  background: #fff;
}

input:focus, select:focus {
  outline: 2px solid #ffe072;
  border-color: #6f6f6f;
}

.transport-box {
  border: 1px dashed #c4d6e8;
  border-radius: 8px;
  padding: 10px 12px;
  align-self: end;
  min-height: 44px;
  display: grid;
  gap: 4px;
  font-size: 14px;
}

.btn {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 14px;
  color: #111;
  background: linear-gradient(135deg, #ffe15a, var(--brand));
  font-weight: 700;
  cursor: pointer;
}

.btn.secondary {
  margin-top: 10px;
  background: var(--brand-pale);
  color: #111;
  border: 1px solid #111;
}

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

.summary li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #f0e1a1;
  padding-bottom: 8px;
  font-size: 14px;
}

.summary li span:first-child { color: var(--muted); }
.summary li span:last-child { font-weight: 700; text-align: right; }

.total {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-top: 14px;
  border-top: 2px solid #efd77a;
  padding-top: 12px;
}

.totals-breakdown {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.totals-breakdown > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.totals-breakdown span {
  color: var(--muted);
}

.totals-breakdown strong {
  color: #111;
}

.total strong {
  font-size: 30px;
  line-height: 1;
  color: #111;
}

.disclaimer {
  display: block;
  margin-top: 12px;
  color: #6a7283;
  line-height: 1.45;
}

.contact, .info { margin-top: 16px; }

.agree {
  display: flex;
  grid-template-columns: none;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
}

.agree input {
  margin-top: 2px;
  min-height: 18px;
  width: 18px;
}

.message {
  margin-top: 12px;
  min-height: 22px;
  font-weight: 600;
}

.message.ok { color: #0d7c3f; }
.message.err { color: #bf2d38; }

.legend {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.quick-box {
  margin-top: 4px;
  border: 1px solid #e3c64a;
  background: #fff3bf;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quick-item {
  background: #fff;
  border: 1px solid #e7cc61;
  border-radius: 6px;
  padding: 8px;
  min-height: 58px;
  display: grid;
  align-content: center;
}

.quick-item small {
  color: #5c5c5c;
  font-size: 11px;
  line-height: 1.1;
}

.quick-item strong {
  font-size: 14px;
  margin-top: 4px;
  color: #111;
}

.mini-disclaimer {
  display: block;
  margin-top: 8px;
  color: #666;
  font-size: 11px;
  line-height: 1.35;
}

.accessories-card {
  padding: 14px 16px;
}
.accessories-card h2 {
  margin-top: 4px;
}

.accessory-grid {
  gap: 10px 12px;
}

.acc-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}

.acc-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 8px;
  align-items: center;
}

.acc-inline select {
  width: 100%;
  max-width: 280px;
}

.qty-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #d7c26a;
  background: #fff8da;
  border-radius: 8px;
  min-height: 38px;
  padding: 0 8px;
  font-weight: 700;
}

.qty-value {
  min-width: 72px;
  text-align: center;
  color: #111;
  font-size: 13px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #a88c21;
  border-radius: 6px;
  background: #ffde52;
  color: #111;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
}

.qty-btn:hover {
  background: #ffd32b;
}

.transport-msg {
  color: #bf2d38;
  font-weight: 600;
  font-size: 12px;
}

@media (max-width: 980px) {
  .top-config {
    grid-template-columns: 1fr;
  }
  .legend-frame {
    min-height: auto;
  }
  .legend {
    max-height: none;
  }
  .quick-box {
    grid-template-columns: 1fr;
  }
  .acc-row {
    grid-template-columns: 1fr;
  }
  .acc-inline { grid-template-columns: minmax(0, 1fr) 170px; }
}

@media (max-width: 560px) {
  .acc-inline { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .header { flex-direction: column; align-items: flex-start; gap: 8px; }
}
