/* Carat & Grace — ring builder. Figma 10:44 / 10:369 / 10:734. */
.cg-rb { padding-bottom: 96px; }

/* ---------------------------------------------------------------- step rail */
.cg-rbsteps { display: flex; align-items: center; gap: 0; padding-block: 22px; border-bottom: 1px solid var(--cg-line); }
.cg-rbstep { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.cg-rbstep__line { flex: 1 1 auto; height: 1px; background: var(--cg-line); margin-inline: 24px; max-width: 112px; }
.cg-rbstep__n { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--cg-line); border-radius: 99px; }
.cg-rbstep__num { font-style: normal; font-size: 13px; }
.cg-rbstep__tick { display: none; color: var(--cg-rose); }
.cg-rbstep__b { display: flex; flex-direction: column; gap: 3px; }
.cg-rbstep__b strong { font-weight: 400; font-size: 15px; }
.cg-rbstep__b em { font-style: normal; font-size: 12px; color: var(--cg-text-2); }
.cg-rbstep.is-now .cg-rbstep__n { border-color: var(--cg-text); background: var(--cg-onyx); color: var(--cg-inverse); }
.cg-rbstep.is-done .cg-rbstep__num { display: none; }
.cg-rbstep.is-done .cg-rbstep__tick { display: inline-flex; }
.cg-rbstep.is-done .cg-rbstep__n { border-color: var(--cg-rose); }

/* ---------------------------------------------------------------- titles + layout */
.cg-rb__title { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding-block: 56px 40px; }
.cg-rb__title .cg-body-l { max-width: 56ch; color: var(--cg-text-2); }
.cg-rb__chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding-bottom: 36px; }
.cg-rb__body { display: grid; grid-template-columns: 976fr 320fr; gap: 32px; align-items: start; }
.cg-rb__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 20px; }
.cg-rb__pick { margin-top: 12px; }
.cg-rb__side { position: sticky; top: calc(var(--cg-header-sticky-h) + 20px); }

/* ---------------------------------------------------------------- summary card */
.cg-rbsum { display: flex; flex-direction: column; gap: 0; padding: 28px; border: 1px solid var(--cg-line); background: var(--cg-white); }
.cg-rbsum__h { margin-bottom: 18px; }
.cg-rbsum__m { aspect-ratio: 264 / 240; margin-bottom: 18px; }
.cg-rbsum__row { display: flex; align-items: center; gap: 12px; padding: 18px 0; border-top: 1px solid var(--cg-line); }
.cg-rbsum__row b { flex: 1 1 auto; font-weight: 400; font-size: 13px; }
.cg-rbsum__row em { display: block; font-style: normal; font-size: 12px; color: var(--cg-text-2); }
.cg-rbsum__total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 18px; border-top: 1px solid var(--cg-line-strong); }
.cg-rbsum__total span { font-family: var(--cg-display); font-size: 28px; }

/* ---------------------------------------------------------------- diamond filters */
.cg-rb__filters { display: flex; flex-direction: column; gap: 26px; padding-bottom: 40px; }
.cg-rb__origin { display: flex; gap: 8px; justify-content: center; }
.cg-rb__shapes { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 8px; }
.cg-rb__ranges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.cg-rb__range { padding: 17px 19px; border: 1px solid var(--cg-line); }
.cg-rb__rhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.cg-rb__rtrack { position: relative; height: 16px; }
.cg-rb__rtrack::before { content: ''; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: var(--cg-line); }
.cg-rb__rtrack i { position: absolute; top: 7px; height: 2px; background: var(--cg-rose); }
.cg-rb__rtrack span { position: absolute; top: 0; width: 16px; height: 16px; border-radius: 99px; background: var(--cg-white); border: 1px solid var(--cg-line-strong); cursor: grab; }
.cg-rb__tool { display: flex; align-items: center; gap: 20px; }
.cg-rb__view { display: flex; gap: 6px; margin-left: auto; }

/* ---------------------------------------------------------------- review */
.cg-rb__review { display: grid; grid-template-columns: 680fr 584fr; gap: 64px; align-items: start; padding-top: 16px; }
.cg-rb__visual .cg-media { aspect-ratio: 680 / 720; }
.cg-rb__receipt { display: flex; flex-direction: column; gap: 22px; }

@media (max-width: 1023px) {
  .cg-rb__body, .cg-rb__review { grid-template-columns: 1fr; gap: 32px; }
  .cg-rb__side { position: static; }
  .cg-rb__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cg-rb__ranges { grid-template-columns: 1fr 1fr; }
  .cg-rb__shapes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .cg-rbsteps { gap: 0; padding-block: 14px; }
  .cg-rbstep__b { display: none; }
  .cg-rbstep.is-now .cg-rbstep__b { display: flex; }
  .cg-rbstep__line { margin-inline: 12px; max-width: 24px; }
  .cg-rb__title { padding-block: 32px 24px; text-align: left; align-items: flex-start; }
  .cg-rb__grid { grid-template-columns: 1fr 1fr; gap: 28px 10px; }
  .cg-rb__ranges { grid-template-columns: 1fr; gap: 12px; }
  .cg-rb__shapes { display: flex; overflow-x: auto; scrollbar-width: none; }
  .cg-rb__shapes::-webkit-scrollbar { display: none; }
  .cg-rb__shapes > * { flex: 0 0 auto; }
  .cg-rb__tool { flex-wrap: wrap; gap: 12px; }
}

/* ---------------------------------------------------------------- step 2: the filter panel */
.cg-rb__f { display: flex; flex-direction: column; gap: 12px; }
.cg-rb__flabel { color: var(--cg-text-2); }
.cg-rb__rin { display: flex; align-items: center; gap: 10px; }
.cg-rb__rin input {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-size: 14px;
  border: 1px solid var(--cg-line); background: var(--cg-white); color: var(--cg-text);
}
.cg-rb__rin input:focus-visible { outline: 2px solid var(--cg-accent); outline-offset: -1px; }
.cg-rb__quick { gap: 6px; }
.cg-rb__fancy { gap: 6px; }
.cg-rb__advb { align-self: flex-start; }
.cg-rb__adv { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px; background: var(--cg-porcelain); }
.cg-rb__sum { display: none; }
.cg-rb__sorts { display: flex; gap: 6px; flex-wrap: wrap; }
.cg-rb__tool { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.cg-rb__view { display: flex; gap: 0; }
.cg-rb__view .cg-chip { border-radius: 0; }

/* ---------------------------------------------------------------- the stones */
.cg-dsec { margin-bottom: 44px; }
.cg-dsec__h { display: block; margin-bottom: 16px; color: var(--cg-text-2); }
.cg-dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px 20px; }
.cg-dgrid--picks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
[data-cg-rb-results].is-loading { opacity: .5; }

.cg-dcard { position: relative; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.cg-dcard__m { background: var(--cg-image); }
.cg-dcard__m img { width: 100%; height: 100%; object-fit: cover; }
.cg-dcard:hover .cg-dcard__m img { opacity: .9; }
.cg-dcard__360 {
  position: absolute; top: 10px; right: 10px; padding: 4px 8px;
  background: var(--cg-white); color: var(--cg-text);
}
.cg-dcard__cert { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; }
.cg-dcard__s { color: var(--cg-text-2); }
.cg-dcard:focus-visible { outline: 2px solid var(--cg-accent); outline-offset: 3px; }

.cg-dlist { display: flex; flex-direction: column; }
.cg-drow {
  display: grid; align-items: center; gap: 12px; padding: 10px 8px;
  grid-template-columns: 64px 1fr 68px 60px 72px 72px 60px 1.3fr 96px 72px;
  border-bottom: 1px solid var(--cg-line); cursor: pointer; font-size: 14px;
}
.cg-drow:hover { background: var(--cg-porcelain); }
.cg-drow:focus-visible { outline: 2px solid var(--cg-accent); outline-offset: -2px; }
.cg-drow--head { cursor: default; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--cg-text-2); }
.cg-drow--head:hover { background: none; }
.cg-drow__m { position: relative; display: block; width: 56px; height: 56px; background: var(--cg-image); }
.cg-drow__m img { width: 100%; height: 100%; object-fit: cover; }
.cg-drow__360 { position: absolute; bottom: 0; right: 0; padding: 1px 3px; font-size: 9px; font-style: normal; background: var(--cg-white); }

/* ---------------------------------------------------------------- the overlays */
.cg-rbsm { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(22,17,26,.72); overflow-y: auto; }
.cg-rbsm__box { position: relative; width: min(880px, 100%); background: var(--cg-white); }
.cg-rbsm--wide .cg-rbsm__box { width: min(1080px, 100%); }
.cg-rbsm__x { position: absolute; top: 12px; right: 12px; z-index: 2; background: var(--cg-white); }
.cg-rbsm__in { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 28px; }
.cg-rbsm__m { background: var(--cg-image); }
.cg-rbsm__m img { width: 100%; height: 100%; object-fit: cover; }
.cg-rbsm__c { display: flex; flex-direction: column; gap: 18px; }
.cg-rbsm__c .cg-opt { gap: 10px; }

.cg-dd__m { display: flex; flex-direction: column; gap: 12px; }
.cg-dd__stage { aspect-ratio: 1 / 1; background: var(--cg-image); }
.cg-dd__stage img, .cg-dd__stage video, .cg-dd__stage iframe { width: 100%; height: 100%; border: 0; object-fit: cover; }
.cg-dd__th { display: flex; gap: 8px; flex-wrap: wrap; }
.cg-dd__t {
  padding: 8px 10px; min-height: 36px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--cg-line); background: var(--cg-white); color: var(--cg-text); cursor: pointer;
}
.cg-dd__t.is-on { border-color: var(--cg-accent); background: var(--cg-blush); }
.cg-dd__c { display: flex; flex-direction: column; gap: 16px; }
.cg-dd__c .cg-specs { margin-top: 6px; }

/* ---------------------------------------------------------------- step 3: the receipt */
.cg-rbr { display: flex; flex-direction: column; gap: 22px; }
.cg-rbr__row { display: flex; flex-direction: column; gap: 8px; padding-bottom: 20px; border-bottom: 1px solid var(--cg-line); }
.cg-rbr__a { display: flex; gap: 16px; }
.cg-rbr__ship { border-bottom: 0; }
.cg-rbr__tot { display: flex; align-items: baseline; justify-content: space-between; padding-block: 8px 4px; }
.cg-rbr__over { align-self: center; }
.cg-rbv { position: relative; }
/* the setting in the same 4:3 white box as the PDP (C3), the chosen diamond as a ROUND inset on it (F3) */
.cg-rbv__s { display: block; aspect-ratio: 4 / 3; background: var(--cg-white); }
.cg-rbv__s img { width: 100%; height: 100%; object-fit: contain; }
.cg-rbv__d img { width: 100%; height: 100%; object-fit: cover; }
.cg-rbv__d {
  position: absolute; right: 16px; bottom: 16px; width: 30%; aspect-ratio: 1 / 1; border-radius: 50%;
  border: 3px solid var(--cg-white); background: var(--cg-image); box-shadow: 0 6px 18px rgba(20, 17, 14, .12);
}
[data-cg-rb-grid].is-loading { opacity: .5; }

@media (max-width: 1023px) {
  .cg-dgrid, .cg-dgrid--picks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cg-rbsm__in { grid-template-columns: 1fr; }
  .cg-rb__adv { grid-template-columns: 1fr; }
  .cg-drow { grid-template-columns: 56px 1fr 60px 52px 64px 56px 1fr 88px; }
  .cg-drow > span:nth-child(6) { display: none; }
}
@media (max-width: 767px) {
  /* On a phone the open panel is replaced by what is SET, and the panel itself is one tap away.
     The demo's drag-only sliders are why its own 375px test came back with 0 stones. */
  .cg-rb__filters { gap: 18px; }
  .cg-rb__filters > .cg-rb__f, .cg-rb__filters > .cg-rb__advb, .cg-rb__filters > .cg-rb__adv { display: none; }
  .cg-rb__filters.is-open > .cg-rb__f,
  .cg-rb__filters.is-open > .cg-rb__advb { display: flex; }
  .cg-rb__sum { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--cg-line); }
  .cg-rb__sum li { display: flex; justify-content: space-between; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--cg-line); }
  .cg-dgrid, .cg-dgrid--picks { grid-template-columns: 1fr 1fr; gap: 20px 12px; }
  .cg-drow { grid-template-columns: 48px 1fr auto; row-gap: 2px; }
  .cg-drow > span:nth-child(3), .cg-drow > span:nth-child(4), .cg-drow > span:nth-child(5),
  .cg-drow > span:nth-child(6), .cg-drow > span:nth-child(7), .cg-drow > span:nth-child(8) { display: none; }
  .cg-drow--head { display: none; }
  .cg-rbsm { padding: 0; place-items: stretch; }
  .cg-rbsm__box { width: 100%; min-height: 100%; }
  .cg-rbsm__in { padding: 56px 16px 28px; }
}
/* step 3: the shared ".cg-rb__visual .cg-media { aspect-ratio: 680 / 720 }" outranks the one-class rules above, so the
   setting box (4:3, C3) and the round diamond inset (1:1, F3) are restated at the same weight, later */
.cg-rb__visual .cg-rbv__s { aspect-ratio: 4 / 3; }
.cg-rb__visual .cg-rbv__d { aspect-ratio: 1 / 1; z-index: 2; }   /* it comes BEFORE the setting in the markup, which painted over it */

/* step 1 price chips wait (dimmed) until the list is 240 or fewer — the engine's ?filter window (ring builder §3) */
.cg-rb__chips--price { align-items: center; }
.cg-rb__chips--price .cg-chip.is-off { opacity: .45; cursor: not-allowed; }
/* the setting pop-up photo in the same 4:3 white box as the PDP (theme-changes-playbook C3) */
.cg-rbsm .cg-rbsm__m { aspect-ratio: 4 / 3; background: var(--cg-white); }
.cg-rbsm .cg-rbsm__m > img { object-fit: contain; }

/* ---------------------------------------------------------------- compact diamond filters (user, 2026-10-22: "taking much space")
   ≥ 768px: Carat · Colour · Clarity · Price side by side (4 across, 2 on tablets) instead of a full-width row each;
   each keeps ONE title (the outer one — the boxed repeat of it inside is gone) with its range readout beside it;
   shorter inputs and selects, smaller shape tiles, tighter gaps. Phones keep their summary rows (rules above). */
@media (min-width: 768px) {
  .cg-rb__filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; padding-bottom: 28px; }
  .cg-rb__filters > * { grid-column: 1 / -1; }
  .cg-rb__filters > .cg-rb__f { grid-column: auto; }
  .cg-rb__filters > .cg-rb__f:has(> .cg-rb__shapes) { grid-column: 1 / -1; }
  .cg-rb__filters > .cg-rb__f { gap: 8px; min-width: 0; }
  .cg-rb__origin { justify-content: flex-start; }
  /* shape tiles */
  .cg-rb__shapes { gap: 6px; }
  .cg-rb__shapes .cg-stile { padding: 9px 4px 8px; gap: 5px; min-height: 0; }
  .cg-rb__shapes .cg-stile svg, .cg-rb__shapes .cg-stile .cg-sh { width: 30px; height: 30px; }
  .cg-rb__shapes .cg-caption { font-size: 9.5px; letter-spacing: .08em; }
  /* one title per filter: the boxed inner copy is dropped, its readout stays (right of the title row) */
  .cg-rb__f > .cg-rb__range { padding: 0; border: 0; position: static; }
  .cg-rb__f > .cg-rb__range .cg-rb__rhead { margin: 0 0 6px; justify-content: flex-end; }
  .cg-rb__f > .cg-rb__range .cg-rb__rhead .cg-label { display: none; }
  .cg-rb__f > .cg-rb__range .cg-rb__rhead .cg-small { font-size: 12px; color: var(--cg-text-2); }
  .cg-rb__f > .cg-rb__range > .cg-caption { margin-top: 6px; font-size: 10px; line-height: 1.4; }
  .cg-rb__rin { gap: 8px; }
  .cg-rb__f .cg-rb__rin input, .cg-rb__f .cg-rb__rin .cg-select, .cg-rb__adv .cg-rb__rin .cg-select {
    min-height: 38px; height: 38px; padding-block: 6px; font-size: 13px;
  }
  .cg-rb__quick, .cg-rb__fancy { gap: 5px; }
  .cg-rb__quick .cg-chip, .cg-rb__fancy .cg-chip { padding-inline: 10px; }
  /* "More filters": four across, no boxes */
  .cg-rb__adv { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; padding: 18px 20px; }
  .cg-rb__adv .cg-rb__range { padding: 0; border: 0; }
  .cg-rb__adv .cg-rb__rhead { margin-bottom: 6px; }
}
@media (min-width: 1200px) {
  .cg-rb__filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cg-rb__adv { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* "See diamonds" / "See settings" (user, 2026-10-24): the filters wait for the button; the stones / settings dim while
   a choice is waiting, and the button lights up. Phone: the button stays at the foot of the screen, clear of the chat. */
.cg-rb__see { display: flex; justify-content: flex-end; }
.cg-rb__filters > .cg-rb__see { grid-column: 1 / -1; }
.cg-rb__see .cg-btn { min-width: 240px; }
.cg-rb__see .cg-btn.is-ready { background: var(--cg-rose); border-color: var(--cg-rose); box-shadow: 0 6px 18px rgba(183, 110, 121, .28); }
.cg-rb__see--set { padding-block: 4px 12px; }
.cg-rb-pending { opacity: .45; transition: opacity .2s ease; }
@media (max-width: 767px) {
  .cg-rb__see { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 5; justify-content: stretch; padding-right: 84px; }
  .cg-rb__see .cg-btn { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .cg-rb-pending { transition: none; } }

/* ---------------------------------------------------------------- QA, 19 Nov 2026 */

/* CAG-031 — the three-step rail is a row of fixed-width items with a 112px cap on each connector,
   so it filled only the left half of the page while everything under it is centred. Centred now;
   the connectors still stretch between the steps. */
.cg-rbsteps { justify-content: center; }
