/* Финальный адаптивный слой гибридного интерфейса. */

main {
  display: flex;
  flex-direction: column;
}

.start-screen,
.plain-flow,
.directions,
.contact {
  width: 100%;
}

.start-screen {
  order: 0;
}

.plain-flow {
  order: 1;
}

.directions {
  order: 2;
}

.contact {
  order: 3;
}

.character-card {
  pointer-events: none;
}

.character-card button {
  pointer-events: auto;
}

.stage-halo,
.stage-network,
.lineup-heading,
.stage-caption {
  pointer-events: none;
}

.chu[data-lineup] {
  pointer-events: none;
  cursor: default;
  transform:
    translateX(calc(
      -50% + var(--stage-shift) + var(--line-x, 0px) + var(--cursor-drift, 0px)
    ))
    translateY(var(--line-y, 0px))
    translateZ(var(--line-depth, 0px))
    scale(var(--line-scale, .7)) !important;
  transition:
    transform .48s cubic-bezier(.18, .78, .1, 1),
    opacity .34s ease,
    filter .34s ease !important;
}

.conversation-head > div > p,
.lineup-heading p {
  color: #b8c0c3;
}

.stage-network {
  opacity: .38;
}

.result-promise span {
  color: #eef2ed;
}

body[data-phase="idle"] .status-rail {
  display: none;
}

body[data-phase="idle"] .conversation-layout {
  display: block;
}

.status-rail ol {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.chu-context-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 14px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: rgba(255, 255, 255, .025);
}

.chu-context-nav > div:first-child {
  min-width: 0;
}

.chu-context-nav small {
  display: block;
  margin-bottom: 4px;
  color: #8e989c;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.chu-context-nav p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
}

.chu-context-nav p span {
  color: #aeb6b9;
}

.chu-context-nav p b {
  color: #667176;
}

.chu-context-nav p strong {
  color: #f2f5ef;
}

.chu-context-nav > div:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chu-context-nav button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
  color: #dfe4df;
  font: inherit;
  font-size: 12px;
  font-weight: 820;
  cursor: pointer;
}

#backToHost {
  border-color: rgba(199, 255, 73, .25);
  color: #dfff99;
}

#resetSession {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
  color: #b8c0c3;
  text-decoration: none;
}

.character-card-toggle {
  position: absolute;
  z-index: 32;
  right: 14px;
  bottom: 14px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 12px;
  background: rgba(10, 14, 16, .82);
  color: #dce1dd;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  backdrop-filter: blur(18px);
}

.character-card-toggle span {
  margin-left: 7px;
  color: #9fa8ab;
  font-size: 16px;
}

.task-workflow {
  margin-top: 18px;
}

.task-card,
.procurement-choice,
.budget-panel,
.tender-state {
  padding: clamp(16px, 2.3vw, 24px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(24, 31, 35, .94), rgba(9, 13, 16, .94));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

.task-card > header,
.procurement-choice > header,
.budget-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.task-card > header span,
.procurement-choice > header span,
.budget-panel > header span,
.tender-state > span {
  display: block;
  margin-bottom: 5px;
  color: #aeb6b9;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.task-card h2,
.procurement-choice h2,
.budget-panel h2,
.tender-state h2 {
  margin: 0;
  font-size: clamp(23px, 3vw, 32px);
  line-height: 1;
  letter-spacing: -.035em;
}

.task-card > header i {
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  color: #c5cbce;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.task-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 13px;
}

.task-card dl > div {
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 13px;
  background: rgba(255, 255, 255, .018);
}

.task-card dt {
  margin-bottom: 5px;
  color: #7f8a8e;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.task-card dd {
  margin: 0;
  color: #e3e7e3;
  font-size: 13px;
  line-height: 1.4;
}

.task-card > p,
.procurement-choice header p,
.budget-panel header p,
.tender-state > p {
  margin: 12px 0 0;
  color: #aeb6b9;
  font-size: 12px;
  line-height: 1.5;
}

.task-card footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.task-card footer button,
.reserve-budget {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.task-secondary {
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .035);
  color: #c4cbcd;
}

.task-primary,
.reserve-budget {
  border: 1px solid rgba(199, 255, 73, .7);
  background: var(--lime);
  color: #101608;
}

.procurement-choice > header,
.budget-panel > header {
  display: block;
}

.procurement-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.procurement-options button {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 18px;
  background: rgba(255, 255, 255, .025);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.procurement-options button:hover {
  border-color: rgba(199, 255, 73, .38);
  background: rgba(199, 255, 73, .035);
  transform: translateY(-2px);
}

.procurement-options i {
  margin-bottom: auto;
  color: #929da1;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.procurement-options strong {
  margin: 20px 0 6px;
  font-size: 18px;
}

.procurement-options span {
  color: #aeb6b9;
  font-size: 12px;
  line-height: 1.45;
}

.budget-entry {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
}

.workflow-back {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #aeb6b9;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.budget-entry label {
  color: #aeb6b9;
  font-size: 12px;
  font-weight: 800;
}

.budget-entry input {
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 13px;
  outline: 0;
  background: rgba(0, 0, 0, .22);
  color: #f1f4f0;
  font: inherit;
}

.budget-entry input:focus {
  border-color: rgba(199, 255, 73, .55);
}

.budget-entry button {
  min-height: 45px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 13px;
  background: rgba(255, 255, 255, .045);
  color: #e0e5e0;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.budget-result {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 13px;
  color: #c8cecf;
  font-size: 12px;
  line-height: 1.5;
}

.budget-result--valid {
  border-color: rgba(199, 255, 73, .35);
  background: rgba(199, 255, 73, .035);
  color: #dfffa0;
}

.budget-result--low,
.budget-result--high {
  border-color: rgba(255, 177, 92, .28);
  background: rgba(255, 157, 60, .035);
}

.reserve-budget {
  margin-top: 12px;
}

.budget-panel > small {
  display: block;
  margin-top: 12px;
  color: #7f898d;
  font-size: 10px;
  line-height: 1.5;
}

.tender-state ol {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.tender-state li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 12px;
  color: #c5cbcd;
  font-size: 12px;
}

.tender-state li i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7e898d;
}

@media (min-width: 941px) {
  .start-screen {
    grid-template-columns: minmax(610px, 1.24fr) minmax(455px, .76fr);
    align-items: start;
  }

  .chu-stage {
    order: 1;
    align-self: start;
  }

  .conversation-shell {
    order: 2;
  }

  .spoken-card::before {
    right: auto;
    left: -16px;
    border-right: 0;
    border-left: 1px solid rgba(255, 255, 255, .14);
  }
}

@media (max-width: 940px) {
  .conversation-shell {
    order: 1;
  }

  .chu-stage {
    order: 2;
    align-self: start;
    overflow: hidden;
  }
}

@media (min-width: 760px) and (max-width: 940px) {
  .start-screen {
    grid-template-columns: minmax(310px, .78fr) minmax(430px, 1.22fr);
    align-items: start;
    gap: 12px;
  }

  .chu-stage {
    order: 1;
    min-height: 650px;
  }

  .chu[data-lineup] {
    width: 86%;
  }

  .conversation-shell {
    order: 2;
  }

  .conversation-head h1 {
    font-size: clamp(39px, 5.2vw, 48px);
  }

  .chu-context-nav {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .chu-context-nav > div:last-child {
    width: 100%;
  }

  .chu-context-nav button {
    flex: 1;
  }

  .spoken-card::before {
    right: auto;
    left: -16px;
    border-right: 0;
    border-left: 1px solid rgba(255, 255, 255, .14);
  }
}

@media (max-width: 620px) {
  .chu-context-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .chu-context-nav > div:last-child {
    width: 100%;
  }

  .chu-context-nav button {
    flex: 1;
  }

  .task-card dl,
  .procurement-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-card footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-entry {
    grid-template-columns: minmax(0, 1fr);
  }

  .budget-entry label {
    margin-bottom: -3px;
  }

  .composer-box {
    grid-template-columns: minmax(0, 1fr);
  }

  .composer button {
    width: auto;
    min-width: 0;
  }

  .composer button span {
    display: inline;
  }

  .composer button b {
    font-size: 21px;
  }

  .status-rail ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .chu-stage {
    --stage-shift: 0px;
    min-height: 650px;
    height: auto;
  }

  .chu-stage:has(.character-card:not([hidden])) {
    min-height: 930px;
  }

  .chu-stage:has(.character-card.is-expanded) {
    min-height: 1050px;
  }

  .chu[data-lineup] {
    bottom: 72px;
    width: 82%;
    height: 72%;
  }

  .chu-stage:has(.character-card:not([hidden])) .chu[data-lineup] {
    bottom: 365px;
    height: 50%;
  }

  .character-card,
  .character-card.is-expanded {
    right: 10px;
    bottom: 58px;
    left: 10px;
    width: auto;
  }

  .lineup-controls {
    right: 50%;
    bottom: 7px;
    left: auto;
    transform: translateX(50%);
  }
}

/* Финальная косметика перед публикацией: цельные переносы и безопасные кнопки. */
.conversation-head h1,
.lineup-heading p,
.lineup-heading strong,
.task-workflow h2,
.task-workflow button,
.status-rail strong {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.task-workflow button,
.chu-context-nav button,
.composer button {
  min-width: 0;
}

@media (min-width: 941px) and (max-width: 1320px) {
  .chu-context-nav {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .chu-context-nav > div:last-child {
    width: 100%;
  }

  .chu-context-nav button {
    flex: 1;
  }
}

@media (min-width: 760px) and (max-width: 940px) {
  .lineup-heading {
    top: 18px;
    right: 16px;
    left: 16px;
    display: block;
    text-align: center;
  }

  .lineup-heading p {
    max-width: 255px;
    margin: 0 auto;
    font-size: 10px;
    line-height: 1.42;
    letter-spacing: .1em;
  }

  .lineup-heading strong {
    display: block;
    max-width: 250px;
    margin: 7px auto 0;
    font-size: 10px;
    line-height: 1.42;
    text-align: center;
  }
}

@media (max-width: 620px) {
  .conversation-head h1 {
    max-width: 100%;
    font-size: clamp(30px, 9vw, 34px);
    line-height: .98;
  }

  .task-card > header,
  .procurement-choice > header,
  .budget-panel > header {
    gap: 10px;
  }

  .task-card > header i {
    max-width: 46%;
    text-align: right;
  }

  .task-card footer button,
  .procurement-options button,
  .budget-entry button,
  .reserve-budget {
    line-height: 1.25;
  }
}
