:root {
  --font-size-sm: 0.82rem;
  --font-size-base: 0.94rem;
  --font-size-lg: 1.12rem;
  --bg: #0a0a0c;
  --panel: rgba(23, 23, 26, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f1f1f3;
  --muted: rgba(214, 214, 220, 0.58);
  --yellow: #d9b756;
  --green: #68c286;
  --blue: #5f86d8;
  --red: #cc6a70;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  --transition: 180ms ease;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: Inter, Arial, "Helvetica Neue", Roboto, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

[v-cloak] {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell-body {
  overflow: hidden;
  background: var(--bg);
}

.shell-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.03), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.02), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(0, 0, 0, 0.12));
  pointer-events: none;
  z-index: 1;
}

.site-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.site-shell__frame,
.site-shell__scrim {
  position: fixed;
  inset: 0;
}

.site-shell__frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.site-shell__scrim {
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.04), rgba(8, 8, 10, 0.16)),
    radial-gradient(circle at 50% 14%, rgba(255, 255, 255, 0.025), transparent 32%);
  pointer-events: none;
  z-index: 2;
}

.site-shell__hud {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 20;
  width: min(1320px, calc(100vw - 32px));
  height: clamp(220px, 24vh, 280px);
  transform: translateX(-50%);
}

.hud-app {
  height: 100%;
  padding: 10px;
}

.hud-stage {
  position: relative;
  height: 100%;
  --hud-detail-width: clamp(320px, 33vw, 520px);
  --hud-inner-offset: 20px;
}

.surface-strong {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(18, 18, 21, 0.94);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--font-size-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(225, 225, 231, 0.48);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.84;
}

.eyebrow--question {
  color: rgba(217, 183, 86, 0.84);
}

.hud-window {
  position: relative;
  height: 100%;
  padding: 10px;
  border-radius: 24px;
  overflow: hidden;
}

.hud-layout {
  display: grid;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 10px;
  border-radius: 18px;
  background: rgba(24, 24, 27, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.layout-v10 {
  grid-template-columns: max-content minmax(0, 1fr) var(--hud-detail-width);
  grid-template-areas: "tabs steps detail";
}

.step-content-cluster,
.tabs-card,
.steps-card {
  min-width: 0;
  min-height: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.step-content-cluster {
  position: absolute;
  top: var(--hud-inner-offset);
  right: var(--hud-inner-offset);
  bottom: var(--hud-inner-offset);
  z-index: 3;
  width: var(--hud-detail-width);
  max-height: none;
  padding: 6px;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(42, 35, 20, 0.94), rgba(24, 21, 14, 0.96)),
    rgba(255, 255, 255, 0.03);
  border-color: rgba(217, 183, 86, 0.18);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: question-screen-rise 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.step-content-card {
  min-height: 0;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  background: rgba(217, 183, 86, 0.08);
  border: 1px solid rgba(217, 183, 86, 0.18);
  overflow: hidden;
}

.step-content-card--error {
  background: rgba(204, 106, 112, 0.1);
  border-color: rgba(204, 106, 112, 0.26);
}

.step-content-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.step-content-meta {
  min-width: 0;
}

.step-content-title {
  margin-top: 4px;
  font-size: var(--font-size-lg);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.step-content-subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: rgba(244, 227, 171, 0.64);
  font-size: var(--font-size-sm);
}

.step-state-button,
.inline-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(217, 183, 86, 0.2);
  background: rgba(217, 183, 86, 0.12);
  color: #f4e3ab;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.button-icon {
  flex: 0 0 auto;
}

.step-state-button {
  min-height: 30px;
  gap: 6px;
  padding: 0 10px;
  font-size: var(--font-size-sm);
}

.step-state-button:hover,
.inline-button:hover,
.step-state-button:focus-visible,
.inline-button:focus-visible {
  background: rgba(217, 183, 86, 0.2);
  border-color: rgba(217, 183, 86, 0.34);
  outline: none;
}

.step-state-button--confirm,
.inline-button--confirm {
  background: rgba(104, 194, 134, 0.1);
  border-color: rgba(104, 194, 134, 0.2);
  color: #c1eecf;
}

.step-state-button--confirm:hover,
.step-state-button--confirm:focus-visible,
.inline-button--confirm:hover,
.inline-button--confirm:focus-visible {
  background: rgba(104, 194, 134, 0.16);
  border-color: rgba(104, 194, 134, 0.32);
}

.step-state-button--danger,
.inline-button--danger {
  background: rgba(204, 106, 112, 0.12);
  border-color: rgba(204, 106, 112, 0.22);
  color: #ffd4d8;
}

.step-state-button--danger:hover,
.step-state-button--danger:focus-visible,
.inline-button--danger:hover,
.inline-button--danger:focus-visible {
  background: rgba(204, 106, 112, 0.2);
  border-color: rgba(204, 106, 112, 0.34);
}

.step-state-button--archive,
.inline-button--archive {
  background: rgba(214, 214, 220, 0.08);
  border-color: rgba(214, 214, 220, 0.14);
  color: rgba(235, 235, 240, 0.84);
}

.step-state-button--archive:hover,
.step-state-button--archive:focus-visible,
.inline-button--archive:hover,
.inline-button--archive:focus-visible {
  background: rgba(214, 214, 220, 0.14);
  border-color: rgba(214, 214, 220, 0.22);
}

.step-state-button--delete,
.inline-button--delete {
  background: rgba(129, 87, 194, 0.14);
  border-color: rgba(129, 87, 194, 0.24);
  color: #d8c8ff;
}

.step-state-button--delete:hover,
.step-state-button--delete:focus-visible,
.inline-button--delete:hover,
.inline-button--delete:focus-visible {
  background: rgba(129, 87, 194, 0.22);
  border-color: rgba(129, 87, 194, 0.34);
}

.step-content-body {
  min-height: 0;
}

.step-content-body--scroll {
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 183, 86, 0.42) transparent;
}

.step-content-body--scroll::-webkit-scrollbar {
  width: 8px;
}

.step-content-body--scroll::-webkit-scrollbar-thumb {
  background: rgba(217, 183, 86, 0.32);
  border-radius: 999px;
}

.step-content-copy {
  color: rgba(231, 220, 189, 0.64);
  font-size: var(--font-size-base);
  line-height: 1.45;
}

.step-content-copy--block {
  margin: 0 0 10px;
}

.step-content-copy--muted {
  color: var(--muted);
}

.step-content-choices {
  display: flex;
  gap: 6px;
  overflow: auto hidden;
  scrollbar-width: none;
}

.step-content-choices::-webkit-scrollbar {
  display: none;
}

.step-content-choices--wrap {
  flex-wrap: wrap;
  overflow: visible;
}

.choice-chip {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(217, 183, 86, 0.2);
  background: rgba(217, 183, 86, 0.12);
  color: #f4e3ab;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.choice-chip:hover,
.choice-chip:focus-visible {
  background: rgba(217, 183, 86, 0.2);
  border-color: rgba(217, 183, 86, 0.34);
  outline: none;
}

.choice-chip.active {
  background: rgba(104, 194, 134, 0.18);
  border-color: rgba(104, 194, 134, 0.3);
  color: #c1eecf;
}

.choice-chip--disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.choice-chip__label {
  font-weight: 600;
}

.choice-chip__description {
  color: rgba(231, 220, 189, 0.68);
  font-size: 0.78rem;
  line-height: 1.35;
}

.step-content-copy--context {
  margin-top: -4px;
  margin-bottom: 12px;
  color: #c1eecf;
  font-weight: 600;
}

.step-content-copy--muted {
  margin-top: -4px;
  margin-bottom: 12px;
  color: rgba(231, 220, 189, 0.56);
}

.rich-copy h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.rich-copy p,
.rich-copy ul {
  margin: 0 0 10px;
  color: rgba(231, 220, 189, 0.72);
  line-height: 1.45;
}

.rich-copy ul {
  padding-left: 18px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.step-textarea,
.field-input,
.upload-box {
  width: 100%;
}

.step-textarea,
.field-input {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 12, 0.36);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.step-textarea,
.field-input--textarea {
  min-height: 104px;
  resize: vertical;
}

.step-textarea:focus,
.field-input:focus {
  outline: none;
  border-color: rgba(95, 134, 216, 0.38);
  box-shadow: 0 0 0 3px rgba(95, 134, 216, 0.16);
  background: rgba(10, 10, 12, 0.5);
}

.step-form {
  display: grid;
  gap: 10px;
}

.field-block {
  display: grid;
  gap: 6px;
}

.field-label {
  font-size: var(--font-size-sm);
  color: rgba(244, 227, 171, 0.76);
}

.upload-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border-radius: 12px;
  border: 1px dashed rgba(217, 183, 86, 0.28);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  cursor: pointer;
}

.upload-box__label {
  color: rgba(244, 227, 171, 0.84);
}

.upload-box__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.file-meta strong {
  font-size: var(--font-size-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta span,
.step-message {
  color: var(--muted);
  font-size: var(--font-size-sm);
}

.step-message {
  margin: 0;
}

.steps-card {
  grid-area: steps;
  padding: 6px;
  display: grid;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
}

.steps-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px;
  gap: 6px;
  height: 100%;
  min-height: 0;
}

.steps-viewport {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: none;
}

.steps-viewport::-webkit-scrollbar {
  display: none;
}

.steps-scroller {
  position: relative;
  height: 100%;
  border-radius: 999px;
  background: rgba(95, 134, 216, 0.08);
  overflow: hidden;
}

.steps-scroller::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(95, 134, 216, 0.16);
}

.steps-thumb {
  position: absolute;
  left: 1px;
  width: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(95, 134, 216, 0.94), rgba(95, 134, 216, 0.36));
  box-shadow: 0 0 14px rgba(95, 134, 216, 0.28);
  opacity: 0;
}

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

.step-item {
  min-height: 36px;
  padding: 4px 6px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.step-item.active {
  border-color: rgba(217, 183, 86, 0.28);
  box-shadow: inset 0 0 0 1px rgba(217, 183, 86, 0.16);
}

.step-item.viewed {
  background: rgba(217, 183, 86, 0.05);
  border-color: rgba(217, 183, 86, 0.12);
}

.step-item.in-progress {
  background: rgba(95, 134, 216, 0.1);
  border-color: rgba(95, 134, 216, 0.22);
}

.step-item.completed {
  background: rgba(104, 194, 134, 0.08);
  border-color: rgba(104, 194, 134, 0.18);
}

.step-item.archived {
  background: rgba(214, 214, 220, 0.06);
  border-color: rgba(214, 214, 220, 0.14);
}

.step-toggle {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.step-toggle:hover,
.step-toggle:focus-visible {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
  box-shadow: 0 0 0 3px rgba(95, 134, 216, 0.14);
}

.step-toggle__mark {
  width: 8px;
  height: 5px;
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
  transition: opacity var(--transition), border-color var(--transition);
}

.step-item.completed .step-toggle,
.step-item.archived .step-toggle {
  background: rgba(104, 194, 134, 0.16);
  border-color: rgba(104, 194, 134, 0.34);
}

.step-item.archived .step-toggle {
  background: rgba(214, 214, 220, 0.12);
  border-color: rgba(214, 214, 220, 0.24);
}

.step-item.completed .step-toggle__mark,
.step-item.archived .step-toggle__mark {
  opacity: 1;
}

.step-item.completed .step-toggle__mark {
  border-left-color: #c1eecf;
  border-bottom-color: #c1eecf;
}

.step-item.archived .step-toggle__mark {
  border-left-color: rgba(225, 225, 231, 0.76);
  border-bottom-color: rgba(225, 225, 231, 0.76);
}

.step-copy {
  appearance: none;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.step-number {
  color: rgba(214, 214, 220, 0.38);
  font-size: var(--font-size-sm);
}

.step-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-base);
  letter-spacing: -0.01em;
}

.step-progress-icon {
  flex: 0 0 auto;
  font-size: 0.82rem;
  line-height: 1;
}

.step-item.viewed .step-title {
  color: rgba(244, 227, 171, 0.82);
}

.step-item.in-progress .step-title,
.step-item.in-progress .step-progress-icon {
  color: #cdd9ff;
}

.step-item.completed .step-title {
  color: rgba(193, 238, 207, 0.78);
}

.step-item.archived .step-title {
  color: rgba(214, 214, 220, 0.62);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(214, 214, 220, 0.5);
}

.step-item.completed .step-number {
  color: rgba(193, 238, 207, 0.62);
}

.step-item.archived .step-number {
  color: rgba(214, 214, 220, 0.46);
}

.list-panel {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  align-content: start;
}

.line-card {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.line-card strong {
  font-size: var(--font-size-base);
  color: rgba(238, 242, 248, 0.76);
}

.line-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(214, 214, 220, 0.5);
  font-size: var(--font-size-base);
}

.tabs-card {
  grid-area: tabs;
  width: max-content;
  min-width: 140px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
}

.tab-button.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tab-content {
  display: block;
  min-width: 0;
  flex: 1;
}

.tab-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-value {
  margin-left: 2px;
  opacity: 0.6;
  font-size: 11px;
  font-weight: 400;
}

.tab-icon {
  flex: 0 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.circle-progress {
  --p: 0%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: conic-gradient(currentColor var(--p), rgba(255, 255, 255, 0.1) 0);
  -webkit-mask: radial-gradient(transparent 5px, #000 5.5px);
  mask: radial-gradient(transparent 6px, #000 6.5px);
}

@keyframes question-screen-rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .site-shell__hud {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
    height: 260px;
    transform: none;
  }

  .hud-stage {
    --hud-detail-width: min(100%, 460px);
    --hud-inner-offset: 0px;
  }

  .hud-app {
    padding: 0;
  }

  .hud-window {
    padding: 10px;
    border-radius: 18px;
  }

  .layout-v10 {
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas: "tabs steps";
  }

  .step-content-cluster {
    left: 0;
    top: auto;
    right: auto;
    bottom: calc(100% + 8px);
    width: min(100%, 460px);
    max-height: min(52vh, 420px);
  }
}

@media (max-width: 720px) {
  .layout-v10 {
    grid-template-columns: 1fr;
    grid-template-areas:
      "steps"
      "tabs";
  }

  .tabs-card {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    overflow: auto hidden;
  }

  .tab-button {
    flex: 1 0 140px;
  }

  .line-card,
  .step-copy {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .step-content-cluster {
    width: 100%;
    bottom: calc(100% + 10px);
  }

  .step-content-top {
    flex-direction: column;
  }

  .step-state-button {
    width: 100%;
  }
}
