/* Подготовка запроса менеджеру.
   Один экран: заголовок по центру, четыре модели в ряд (на телефоне 2 × 2), подписи, одна кнопка.
   Кнопка: графит; после выбора по её контуру бежит тонкая рыжая дуга, без свечения и теней.
   Форма открывается поверх в компактном диалоге. */

section.close.g35-request {
  min-height: calc(100svh - var(--hdr));
  padding: 32px var(--m);
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  background: var(--page);
}
.g35-request .rq-h {
  margin: 0 0 clamp(28px, 5svh, 44px);
  font-size: clamp(50px, 5.3vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

/* ---------- the four models ---------- */
.rq-cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: clamp(24px, 4svh, 36px);
}
.rq-card {
  display: grid;
  justify-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rq-card:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 6px;
}
.rq-scene {
  display: block;
  width: 100%;
  height: clamp(170px, 28svh, 252px);
}
.rq-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  transform-origin: 50% 65%;
  will-change: transform;
  transition: opacity 0.45s ease;
}
/* until the models are built the cards keep their place, then fade in together */
.g35-request:not(.ready) .rq-scene canvas {
  opacity: 0;
}
.rq-cap {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  padding-top: 14px;
  font: 500 16px/1 var(--text);
  color: var(--muted);
  transition:
    color 0.3s,
    opacity 0.45s ease;
}
.rq-cap b {
  font: 800 24px/1 var(--num);
  letter-spacing: -0.03em;
  color: var(--ink);
  transition: color 0.3s;
}
.rq-tick {
  align-self: center;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--acc);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  transition: stroke-dashoffset 0.45s var(--ease) 0.1s;
}
.rq-card[aria-checked="true"] .rq-cap {
  color: var(--ink);
}
.rq-card[aria-checked="true"] .rq-cap b {
  color: var(--acc);
}
.rq-card[aria-checked="true"] .rq-tick {
  stroke-dashoffset: 0;
}
.rq-card.land .rq-cap b {
  animation: rq-land 0.55s var(--ease);
}
@keyframes rq-land {
  30% {
    transform: translateY(-4px);
  }
}
@media (hover: hover) {
  .rq-cards:has(.rq-card:hover) .rq-card:not(:hover) canvas {
    opacity: 0.5;
  }
  .rq-cards:has(.rq-card:hover) .rq-card:not(:hover) .rq-cap {
    opacity: 0.55;
  }
  .rq-card:hover .rq-cap {
    color: var(--ink);
  }
}
/* the button pressed before a choice: the models nod once, left to right */
.g35-request.nudge .rq-card {
  animation: rq-nod 0.5s var(--ease) both;
}
.g35-request.nudge .rq-card:nth-child(2) {
  animation-delay: 0.05s;
}
.g35-request.nudge .rq-card:nth-child(3) {
  animation-delay: 0.1s;
}
.g35-request.nudge .rq-card:nth-child(4) {
  animation-delay: 0.15s;
}
@keyframes rq-nod {
  40% {
    transform: translateY(-8px);
  }
}

/* ---------- the button ---------- */
.rq-act {
  position: relative;
  display: grid;
  justify-items: center;
}
.rq-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  min-width: 330px;
  min-height: 74px;
  padding: 0 13px 0 30px;
  border: 0;
  border-radius: var(--radius);
  background: var(--btn);
  color: var(--btn-ink);
  font: 600 18px/1 var(--text);
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.3s var(--ease),
    color 0.3s;
}
.rq-cta[aria-disabled="true"] {
  cursor: default;
  color: color-mix(in srgb, var(--btn-ink) 60%, var(--btn));
}
.rq-cta:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 5px;
}
.rq-cta-i {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: min(var(--radius), 50%);
  background: color-mix(in srgb, var(--btn-ink) 9%, transparent);
  transition:
    background-color 0.45s ease,
    color 0.3s;
}
.rq-cta-i svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.45s var(--ease);
}
.has-sel .rq-cta-i {
  background: var(--acc);
  color: #fff;
}

/* the arc: a crisp rust stroke on the exact outline, a softer trail behind it, a faint full track under both */
.rq-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.55s ease;
}
.has-sel .rq-track {
  opacity: 1;
}
.rq-track rect {
  fill: none;
  stroke: var(--acc);
  vector-effect: non-scaling-stroke;
}
.rq-track .t-base {
  stroke-width: 1;
  opacity: 0.16;
  transition: opacity 0.45s ease;
}
.rq-track .t-tail {
  stroke-width: 1.5;
  opacity: 0.32;
  stroke-dasharray: 34 66;
  animation: rq-trail 16s linear infinite paused;
}
.rq-track .t-head {
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 28 72;
  animation: rq-orbit 16s linear infinite paused;
  transition: stroke-width 0.45s ease;
}
.has-sel .rq-track rect {
  animation-play-state: running;
}
@keyframes rq-orbit {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -100;
  }
}
@keyframes rq-trail {
  from {
    stroke-dashoffset: 34;
  }
  to {
    stroke-dashoffset: -66;
  }
}
/* hover: the whole outline shows, the arc thickens a little, the arrow leans forward. No glow */
@media (hover: hover) {
  .has-sel .rq-cta:hover {
    transform: translateY(-2px);
  }
  .has-sel .rq-cta:hover .t-base {
    opacity: 0.55;
  }
  .has-sel .rq-cta:hover .t-head {
    stroke-width: 2.8;
  }
  .has-sel .rq-cta:hover .rq-cta-i svg {
    transform: translate(2px, -2px);
  }
}
.has-sel .rq-cta:focus-visible .t-base {
  opacity: 0.55;
}
.has-sel .rq-cta:active {
  transform: translateY(0) scale(0.985);
}
.rq-hint {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  margin: 0;
  font: 500 14px/1.2 var(--text);
  color: var(--muted);
}
.rq-hint.warn {
  color: var(--acc);
}

/* ---------- the dialog ---------- */
.rq-dlg {
  width: min(500px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100svh - 32px);
  padding: 0;
  border: 0;
  border-radius: min(var(--radius), 28px);
  background: var(--page);
  color: var(--ink);
  text-align: left;
  box-shadow:
    0 30px 70px -24px rgba(28, 29, 28, 0.5),
    0 2px 10px rgba(28, 29, 28, 0.08);
  overflow: auto;
  overscroll-behavior: contain;
}
.rq-dlg::backdrop {
  background: rgba(28, 29, 28, 0.42);
}
/* Chrome paints a backdrop-filtered header above the dialog's backdrop: the header goes flat while a dialog is open */
html:has(dialog[open]) .hdr {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--page);
}
/* collected: the object switch has done its job */
/* Object controls also return from the request summary to editing. */
.rq-dlg[open] {
  animation: rq-in 0.45s var(--ease);
}
.rq-dlg[open]::backdrop {
  animation: rq-fade 0.3s ease;
}
.rq-dlg.out {
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}
@keyframes rq-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
}
@keyframes rq-fade {
  from {
    opacity: 0;
  }
}

.rq-dlg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 0 24px;
}
/* the four numbers: switch the object without closing the form */
.rq-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: min(var(--radius), 14px);
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.rq-seg button {
  min-width: 44px;
  padding: 8px 11px;
  border: 0;
  border-radius: min(var(--radius), 11px);
  background: none;
  color: var(--muted);
  font: 700 15px/1 var(--num);
  letter-spacing: -0.02em;
  cursor: pointer;
  transition:
    background-color 0.25s,
    color 0.25s;
}
.rq-seg button:hover {
  color: var(--ink);
}
.rq-seg button[aria-checked="true"] {
  background: var(--card);
  color: var(--acc);
  box-shadow: 0 1px 2px rgba(28, 29, 28, 0.08);
}
.rq-seg button:focus-visible,
.rq-x:focus-visible,
.rq-tags button:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
.rq-x {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s;
}
.rq-x:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.rq-x svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.rq-form {
  display: grid;
  gap: 18px;
  padding: 18px 24px 24px;
}
.rq-form[hidden],
.rq-done[hidden] {
  display: none;
}
.rq-dlg-h {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 2px;
  font: 600 28px/1 var(--text);
  letter-spacing: -0.035em;
}
.rq-dlg-h b {
  font: 800 32px/1 var(--num);
  letter-spacing: -0.03em;
  color: var(--acc);
}
.rq-tags {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.rq-tags legend,
.rq-f > span {
  padding: 0;
  margin-bottom: 8px;
  font: 500 13px/1 var(--text);
  color: var(--muted);
}
.rq-tags div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rq-tags button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 0;
  border-radius: min(var(--radius), 12px);
  background: none;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: 500 15px/1 var(--text);
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}
.rq-tags button:hover {
  box-shadow: inset 0 0 0 1px var(--ink);
}
.rq-tags button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--page);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.rq-tags button::before {
  content: "";
  width: 0;
  height: 9px;
  margin-right: -6px;
  border: solid currentColor;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0;
  transition:
    width 0.25s var(--ease),
    margin 0.25s var(--ease),
    opacity 0.2s;
}
.rq-tags button[aria-pressed="true"]::before {
  width: 4px;
  margin-right: 2px;
  opacity: 1;
}
.rq-f {
  display: grid;
}
.rq-f textarea,
.rq-f input {
  display: block;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: min(var(--radius), 14px);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hair);
  color: var(--ink);
  font: 400 17px/1.4 var(--text);
  resize: none;
  caret-color: var(--acc);
  transition: box-shadow 0.25s;
}
.rq-f input {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.rq-f textarea:focus,
.rq-f input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.rq-f input[aria-invalid="true"] {
  box-shadow: inset 0 0 0 1.5px var(--acc);
}
.rq-f ::placeholder {
  color: var(--faint);
  opacity: 1;
}
.rq-err {
  margin: -8px 0 0;
  font: 500 14px/1.3 var(--text);
  color: var(--acc);
}
.rq-err:empty {
  display: none;
}
.rq-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 60px;
  padding: 0 8px 0 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--btn);
  color: var(--btn-ink);
  font: 600 17px/1 var(--text);
  cursor: pointer;
  transition: transform 0.25s var(--ease);
}
.rq-submit .rq-cta-i {
  width: 44px;
  height: 44px;
  background: var(--acc);
  color: #fff;
  position: relative;
}
.rq-submit:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
}
@media (hover: hover) {
  .rq-submit:hover .rq-cta-i svg {
    transform: translate(2px, -2px);
  }
}
.rq-submit:active {
  transform: scale(0.985);
}
.rq-submit.busy {
  cursor: progress;
}
.rq-submit.busy .rq-cta-i svg {
  opacity: 0;
}
.rq-submit.busy .rq-cta-i::after {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1.6px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: rq-spin 0.8s linear infinite;
}
@keyframes rq-spin {
  to {
    transform: rotate(360deg);
  }
}

/* collected: a drawn tick, the summary, one button */
.rq-done {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 10px 24px 24px;
}
.rq-done-i {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: var(--acc);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rq-done-i circle,
.rq-done-i path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: rq-draw 0.6s var(--ease) forwards;
}
.rq-done-i path {
  animation-delay: 0.25s;
}
@keyframes rq-draw {
  to {
    stroke-dashoffset: 0;
  }
}
.rq-done-h {
  margin: 0;
  font: 600 28px/1 var(--text);
  letter-spacing: -0.035em;
  outline: none;
}
.rq-sum {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 20px;
  width: 100%;
  margin: 4px 0 6px;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
  font-size: 16px;
}
.rq-sum dt {
  color: var(--muted);
}
.rq-sum dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ---------- sizes ---------- */
@media (min-width: 701px) and (max-height: 700px) {
  section.close.g35-request {
    padding-top: 24px;
    padding-bottom: 24px;
  }
  .g35-request .rq-h {
    margin-bottom: 24px;
    font-size: clamp(46px, 5vw, 64px);
  }
  .rq-cards {
    margin-bottom: 24px;
  }
  .rq-scene {
    height: clamp(150px, 27svh, 200px);
  }
}
@media (max-width: 1000px) and (min-width: 701px) {
  .rq-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 24px;
  }
  .rq-scene {
    height: clamp(150px, 20svh, 220px);
  }
  .rq-cap {
    padding-top: 10px;
  }
}
@media (max-width: 700px) {
  section.close.g35-request {
    padding: 20px;
  }
  .g35-request .rq-h {
    margin-bottom: 20px;
    font-size: clamp(40px, 12vw, 48px);
  }
  .rq-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
  }
  .rq-scene {
    height: clamp(80px, 14svh, 126px);
  }
  .rq-cap {
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding-top: 8px;
    font-size: 14px;
  }
  .rq-cap b {
    font-size: 25px;
  }
  .rq-tick {
    display: none;
  }
  .rq-act {
    width: 100%;
  }
  .rq-cta {
    width: 100%;
    min-width: 0;
    min-height: 64px;
    gap: 18px;
    padding: 0 8px 0 22px;
    font-size: 17px;
  }
  .rq-cta .rq-cta-i {
    width: 46px;
    height: 46px;
  }
  /* the form becomes a sheet from the bottom edge */
  .rq-dlg {
    width: 100%;
    max-height: calc(100svh - 24px);
    margin: auto 0 0;
    border-radius: min(var(--radius), 24px) min(var(--radius), 24px) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .rq-dlg[open] {
    animation: rq-sheet 0.45s var(--ease);
  }
  .rq-dlg.out {
    transform: translateY(24px);
  }
  @keyframes rq-sheet {
    from {
      transform: translateY(100%);
    }
  }
  .rq-dlg-top {
    padding: 12px 12px 0 18px;
  }
  .rq-form {
    gap: 16px;
    padding: 14px 18px 18px;
  }
  .rq-done {
    padding: 8px 18px 18px;
  }
  .rq-dlg-h {
    font-size: 24px;
  }
  .rq-dlg-h b {
    font-size: 28px;
  }
  .rq-seg button {
    min-width: 0;
    padding: 8px 10px;
  }
}
@media (max-width: 700px) and (max-height: 700px) {
  section.close.g35-request {
    padding: 16px 20px;
  }
  .g35-request .rq-h {
    margin-bottom: 14px;
    font-size: 38px;
  }
  .rq-cards {
    margin-bottom: 16px;
  }
  .rq-scene {
    height: 80px;
  }
  .rq-cap {
    padding-top: 6px;
    gap: 2px;
  }
  .rq-cap b {
    font-size: 22px;
  }
  .rq-form {
    gap: 12px;
  }
  .rq-f textarea {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rq-scene canvas {
    transform: none !important;
    will-change: auto;
  }
  .rq-track .t-tail {
    display: none;
  }
  .rq-track .t-head {
    stroke-dasharray: none;
    animation: none;
    opacity: 0.8;
  }
  .rq-dlg[open],
  .rq-dlg[open]::backdrop,
  .rq-done-i circle,
  .rq-done-i path {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* the heading, the models and the button stand with equal air between them and at both edges */
section.close.g35-request {
  min-height: 100svh;
  scroll-margin-top: 0;
  align-content: space-evenly;
  row-gap: 0;
  padding-top: var(--hdr);
  padding-bottom: 0;
}
section.close.g35-request .rq-h,
section.close.g35-request .rq-cards {
  margin-bottom: 0;
}

.rq-copy-status {
  font: 400 15px/1.5 var(--text);
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
}
.rq-sum dd {
  overflow-wrap: anywhere;
}
.rq-done {
  min-width: 0;
}
.rq-seg {
  flex-wrap: wrap;
}

.rq-submit > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.rq-f {
  min-width: 0;
}
.rq-tags button {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.rq-dlg-h {
  flex-wrap: wrap;
}
