/* Alt er avgrenset til #rcg, så temaet og Elementor ikke overstyrer knapper og felt. */
#rcg {
  --rcg-red: #da291c;
  --rcg-red-dark: #b3200f;
  --rcg-ink: #24272b;
  --rcg-muted: #5e646b;
  --rcg-line: #d5d8dc;
  --rcg-paper: #ffffff;
  --rcg-steel: #eef0f2;
  display: grid;
  grid-template-columns: minmax(280px, 5fr) minmax(320px, 6fr);
  gap: 32px;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  color: var(--rcg-ink);
  font-size: 16px;
  line-height: 1.45;
  text-align: left;
}
#rcg *, #rcg *::before, #rcg *::after { box-sizing: border-box; }
#rcg [hidden] { display: none !important; }

#rcg .rcg-preview { position: sticky; top: 24px; min-width: 0; }
#rcg .rcg-stage { background: linear-gradient(180deg, #f6f7f8, #e3e6e9); border-radius: 14px; padding: 8px; }
#rcg canvas {
  display: block; width: 100%; height: auto; margin: 0 auto;
  cursor: default; border-radius: 8px; outline-offset: 3px;
  max-height: max(300px, calc(100vh - 520px)); aspect-ratio: 600 / 740; object-fit: contain;
}
#rcg canvas:focus-visible { outline: 3px solid var(--rcg-red); }
#rcg .rcg-disclaimer { margin: 10px 0 0; color: var(--rcg-ink); font-size: 14px; }
#rcg .rcg-hint { margin: 6px 0 10px; min-height: 2.9em; color: var(--rcg-muted); font-size: 14px; }
#rcg .rcg-hint.is-warning { color: var(--rcg-red-dark); font-weight: 600; }
#rcg .rcg-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; }

#rcg .rcg-cart { margin-top: 12px; border-top: 2px solid var(--rcg-ink); }
#rcg .rcg-cart summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; cursor: pointer; list-style: none; font-weight: 800;
}
#rcg .rcg-cart summary::-webkit-details-marker { display: none; }
#rcg .rcg-cart-title::before { content: "▸"; display: inline-block; margin-right: 6px; transition: transform .12s; }
#rcg .rcg-cart[open] .rcg-cart-title::before { transform: rotate(90deg); }
#rcg .rcg-cart summary:focus-visible { outline: 3px solid var(--rcg-red); outline-offset: 2px; }
#rcg .rcg-cart summary output { font-size: 18px; }
#rcg .rcg-cart[open] summary output { display: none; }
#rcg .rcg-cart-cup, #rcg .rcg-cart-empty { margin: 0 0 8px; color: var(--rcg-muted); font-size: 14px; }
#rcg .rcg-cart ul { list-style: none; margin: 0; padding: 0; max-height: 150px; overflow-y: auto; }
#rcg .rcg-cart li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px;
  margin: 0; padding: 6px 0; border-top: 1px solid var(--rcg-line);
}
#rcg .rcg-cart-name { min-width: 0; font-size: 14px; line-height: 1.25; }
#rcg .rcg-cart-name small { display: block; color: var(--rcg-muted); font-size: 12px; }
#rcg .rcg-cart-name > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rcg .rcg-cart-price { font-weight: 700; white-space: nowrap; }
#rcg .rcg-cart-total {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 6px; padding-top: 10px; border-top: 2px solid var(--rcg-ink);
}
#rcg .rcg-cart-total strong, #rcg .rcg-cart-total span { display: block; }
#rcg .rcg-cart-total span { color: var(--rcg-muted); font-size: 14px; }
#rcg .rcg-cart-total output { font-size: 32px; font-weight: 800; line-height: 1; white-space: nowrap; }

#rcg .rcg-icon {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; min-height: 0; margin: 0; padding: 0;
  background: transparent; color: var(--rcg-ink); border: 1px solid transparent; border-radius: 6px;
  font: inherit; font-size: 15px; line-height: 1; cursor: pointer;
}
#rcg .rcg-icon:hover:not(:disabled), #rcg .rcg-icon:focus { background: var(--rcg-steel); color: var(--rcg-ink); border-color: #8c9299; }
#rcg .rcg-icon:disabled { opacity: .3; cursor: default; }

#rcg .rcg-steps { min-width: 0; }
#rcg .rcg-step { padding: 0 0 28px; margin: 0 0 28px; border-bottom: 1px solid var(--rcg-line); }
#rcg .rcg-step h3 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 18px; padding: 0; color: var(--rcg-ink);
  font-size: 22px; font-weight: 800; line-height: 1.2;
}
#rcg .rcg-num {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--rcg-red); color: #fff; font-size: 16px;
}
#rcg fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
#rcg legend, #rcg .rcg-field > span { display: block; padding: 0; margin: 0 0 6px; font-size: 15px; font-weight: 600; }

#rcg .rcg-model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#rcg .rcg-model { position: relative; display: block; cursor: pointer; margin: 0; }
#rcg .rcg-model input, #rcg .rcg-swatch input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
#rcg .rcg-model > span { display: block; height: 100%; padding: 12px; border: 2px solid var(--rcg-line); border-radius: 10px; background: var(--rcg-paper); }
#rcg .rcg-model strong, #rcg .rcg-model small { display: block; }
#rcg .rcg-model small { color: var(--rcg-muted); font-size: 14px; }
#rcg .rcg-model input:checked + span { border-color: var(--rcg-red); box-shadow: inset 0 0 0 1px var(--rcg-red); }
#rcg .rcg-model input:focus-visible + span { outline: 3px solid var(--rcg-ink); outline-offset: 2px; }

#rcg .rcg-swatches { display: flex; flex-wrap: wrap; gap: 12px; }
#rcg .rcg-swatch { position: relative; display: block; width: 76px; margin: 0; text-align: center; cursor: pointer; }
#rcg .rcg-swatch span { display: block; width: 44px; height: 44px; margin: 0 auto 3px; border-radius: 50%; border: 1px solid rgba(0,0,0,.3); }
#rcg .rcg-swatch small { display: block; font-size: 13px; line-height: 1.2; color: var(--rcg-muted); }
#rcg .rcg-swatch span.is-metal { background-image: linear-gradient(105deg, rgba(0,0,0,.3), rgba(255,255,255,.55) 42%, rgba(0,0,0,.15) 62%, rgba(255,255,255,.3) 80%, rgba(0,0,0,.3)); }
#rcg .rcg-swatch input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--rcg-red); }
#rcg .rcg-swatch input:focus-visible + span { outline: 3px solid var(--rcg-ink); outline-offset: 5px; }

#rcg .rcg-field { display: block; margin: 0 0 14px; }
#rcg input[type="text"], #rcg input[type="tel"], #rcg textarea, #rcg select {
  display: block; width: 100%; min-height: 46px; margin: 0; padding: 10px 12px;
  background: var(--rcg-paper); color: var(--rcg-ink);
  border: 1px solid #8c9299; border-radius: 8px; font: inherit; font-size: 16px;
}
#rcg input[type="text"]:focus, #rcg input[type="tel"]:focus, #rcg textarea:focus, #rcg select:focus { border-color: var(--rcg-red); outline: 2px solid var(--rcg-red); outline-offset: 0; }

#rcg .rcg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 16px; border-bottom: 2px solid var(--rcg-line); }
#rcg .rcg-tabs button {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin: 0 0 -2px; padding: 8px 10px; min-height: 54px; background: transparent; color: var(--rcg-muted); text-align: left;
  border: 0; border-bottom: 3px solid transparent; border-radius: 0; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  white-space: normal; line-height: 1.25;
}
#rcg .rcg-tabs small { display: block; font-size: 13px; font-weight: 400; }
#rcg .rcg-tabs button:hover, #rcg .rcg-tabs button:focus { background: var(--rcg-steel); color: var(--rcg-ink); }
#rcg .rcg-tabs button[aria-selected="true"] { color: var(--rcg-ink); border-bottom-color: var(--rcg-red); }
#rcg .rcg-count {
  display: inline-grid; place-items: center; flex: none; min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: 15px; background: var(--rcg-ink); color: #fff; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums;
}

#rcg .rcg-add {
  display: block; width: 100%; min-height: 54px; margin: 0 0 14px; padding: 12px;
  background: var(--rcg-steel); color: var(--rcg-ink); border: 2px dashed #8c9299; border-radius: 10px;
  font: inherit; font-weight: 700; cursor: pointer;
}
#rcg .rcg-add:hover, #rcg .rcg-add:focus { background: var(--rcg-steel); color: var(--rcg-ink); border-color: var(--rcg-red); }

#rcg .rcg-layers { margin: 4px 0 18px; }
#rcg h4 { margin: 0 0 8px; padding: 0; color: var(--rcg-ink); font-size: 16px; font-weight: 800; line-height: 1.3; }
#rcg .rcg-layers ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rcg-line); border-radius: 8px; overflow: hidden; }
#rcg .rcg-layer { display: flex; align-items: center; gap: 2px; margin: 0; padding: 3px 6px 3px 3px; border-top: 1px solid var(--rcg-line); }
#rcg .rcg-layer:first-child { border-top: 0; }
#rcg .rcg-layer.is-selected { background: #fdecea; box-shadow: inset 4px 0 0 var(--rcg-red); }
#rcg .rcg-layer-pick {
  display: flex; align-items: center; flex: 1; gap: 10px; min-width: 0; min-height: 44px; margin: 0; padding: 3px 3px 3px 8px;
  background: transparent; color: var(--rcg-ink); border: 0; border-radius: 6px; font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer;
}
#rcg .rcg-layer-pick:hover, #rcg .rcg-layer-pick:focus { background: transparent; color: var(--rcg-ink); }
#rcg .rcg-layer-pick:focus-visible { outline: 2px solid var(--rcg-ink); }
#rcg .rcg-layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rcg .rcg-thumb { display: block; flex: none; width: 36px; height: 36px; background: #fff; border: 1px solid var(--rcg-line); border-radius: 4px; max-height: none; aspect-ratio: auto; cursor: pointer; }
#rcg .rcg-thumb-text { display: grid; place-items: center; font-family: Georgia, serif; font-size: 20px; font-weight: 700; }

#rcg .rcg-drop {
  position: relative; display: block; margin: 0 0 12px; padding: 22px 16px; text-align: center; cursor: pointer;
  background: var(--rcg-steel); border: 2px dashed #8c9299; border-radius: 10px;
}
#rcg .rcg-drop:hover, #rcg .rcg-drop.is-over, #rcg .rcg-drop:focus-within { border-color: var(--rcg-red); }
#rcg .rcg-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
#rcg .rcg-drop strong, #rcg .rcg-drop small { display: block; overflow-wrap: anywhere; }
#rcg .rcg-drop small { color: var(--rcg-muted); font-size: 14px; }

#rcg .rcg-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14px; color: var(--rcg-muted); }

#rcg .rcg-btn-quiet {
  min-height: 40px; margin: 0; padding: 8px 14px; background: var(--rcg-paper); color: var(--rcg-ink);
  border: 1px solid #8c9299; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer;
}
#rcg .rcg-btn-quiet:hover, #rcg .rcg-btn-quiet:focus { background: var(--rcg-steel); color: var(--rcg-ink); border-color: var(--rcg-ink); }

#rcg .rcg-controls { display: grid; gap: 12px; }
#rcg .rcg-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 15px; font-weight: 400; cursor: pointer; }
#rcg .rcg-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--rcg-red); }
#rcg .rcg-consent { margin: 0 0 14px; font-size: 14px; }
#rcg .rcg-range { display: block; margin: 0; }
#rcg .rcg-range > span { display: flex; justify-content: space-between; font-size: 15px; font-weight: 600; }
#rcg .rcg-range output { font-weight: 400; color: var(--rcg-muted); }
#rcg .rcg-range input { display: block; width: 100%; height: 30px; margin: 0; padding: 0; accent-color: var(--rcg-red); }

#rcg .rcg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#rcg .rcg-status { margin: 0 0 12px; font-weight: 600; color: var(--rcg-red-dark); }
#rcg .rcg-status:empty { display: none; }
#rcg .rcg-submit {
  display: block; width: 100%; min-height: 54px; margin: 0; padding: 12px 18px;
  background: var(--rcg-red); color: #fff; border: 0; border-radius: 10px;
  font: inherit; font-size: 18px; font-weight: 800; cursor: pointer;
}
#rcg .rcg-submit:hover, #rcg .rcg-submit:focus { background: var(--rcg-red-dark); color: #fff; }
#rcg .rcg-submit:focus-visible { outline: 3px solid var(--rcg-ink); outline-offset: 2px; }
#rcg .rcg-submit[disabled] { opacity: .65; cursor: progress; }
#rcg .rcg-success { padding: 18px; border-left: 5px solid #1d7a3e; background: #edf7f0; outline: 0; }
#rcg .rcg-success h4 { margin: 0 0 6px; color: var(--rcg-ink); font-size: 20px; }
#rcg .rcg-success p { margin: 0; }
#rcg .rcg-note { margin: 0; color: var(--rcg-muted); font-size: 14px; }

@media (max-width: 820px) {
  #rcg { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  /* Koppen blir stående synlig mens kunden justerer på mobil. */
  #rcg .rcg-preview { position: sticky; top: 0; z-index: 20; padding: 6px 0 8px; background: var(--rcg-paper); box-shadow: 0 6px 8px -8px rgba(0,0,0,.5); }
  #rcg.is-typing .rcg-preview { position: static; box-shadow: none; }
  #rcg canvas { max-height: 32vh; }
  #rcg .rcg-stage { padding: 2px; }
  #rcg .rcg-disclaimer { margin: 6px 0 0; font-size: 13px; line-height: 1.3; }
  #rcg .rcg-hint { min-height: 0; margin: 4px 0 6px; font-size: 13px; }
  #rcg .rcg-preview-actions { flex-wrap: nowrap; }
  #rcg .rcg-preview-actions .rcg-btn-quiet { flex: 1; min-height: 36px; padding: 6px 8px; font-size: 13px; }
  #rcg .rcg-cart { margin-top: 6px; border-top-width: 1px; }
  #rcg .rcg-cart summary { padding: 6px 0 2px; }
  #rcg .rcg-cart ul { max-height: 22vh; }
  #rcg .rcg-cart-total output { font-size: 22px; }
  #rcg .rcg-cart-total span { display: none; }
}
