:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e9edf2;
  --border: #dfe4ea;
  --border-strong: #c8d0da;
  --text: #16202b;
  --text-2: #5a6673;
  --text-3: #8b96a3;
  --accent: #3b5bdb;
  --accent-soft: #e8edfd;
  --accent-text: #2c46ad;
  --ok: #1f9254;
  --ok-soft: #e4f5eb;
  --warn: #b7791f;
  --warn-soft: #fdf3e2;
  --danger: #c53030;
  --danger-soft: #fdeaea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent-text);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 15px;
}

p {
  margin: 0;
}

/* ---------- shell ---------- */

.app-root {
  min-height: 100vh;
}

.shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__title {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 15px;
}

.brand__sub {
  color: var(--text-3);
  font-size: 12px;
}

.side-section__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 8px;
  font-weight: 600;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.step:hover:not(:disabled) {
  background: var(--surface-2);
}

.step[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.step:disabled {
  cursor: not-allowed;
  color: var(--text-3);
}

.step__num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-2);
}

.step[aria-current="true"] .step__num {
  background: var(--accent);
  color: #fff;
}

.step--done .step__num {
  background: var(--ok-soft);
  color: var(--ok);
}

.step__label {
  font-size: 13px;
  font-weight: 550;
}

.step__hint {
  grid-column: 2;
  font-size: 11px;
  color: var(--text-3);
}

.side-project {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-2);
}

.side-project__name {
  font-weight: 600;
  font-size: 13px;
}

.side-project__meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.sidebar__footer {
  margin-top: auto;
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 247, 249, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar__titles {
  min-width: 0;
}

.topbar__sub {
  color: var(--text-2);
  font-size: 12px;
  margin-top: 2px;
}

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.content {
  padding: 22px 24px 60px;
  min-width: 0;
}

.content--wide {
  padding: 18px 20px 40px;
}

/* ---------- primitives ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 550;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: #3450c8;
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn--danger {
  color: var(--danger);
  border-color: var(--border);
}

.btn--danger:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn--sm {
  padding: 5px 9px;
  font-size: 12px;
}

.btn--block {
  width: 100%;
  justify-content: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card__head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card__head .spacer {
  margin-left: auto;
}

.card__body {
  padding: 16px;
}

.card__body--tight {
  padding: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
}

.badge--accent {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.badge--ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge--warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 5px;
  color: var(--text-2);
}

.muted {
  color: var(--text-2);
}

.dim {
  color: var(--text-3);
}

.small {
  font-size: 12px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack--sm {
  gap: 8px;
}

.stack--lg {
  gap: 22px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  color: var(--text-2);
  background: var(--surface);
}

.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 13px;
}

.notice--warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.notice--danger {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.notice--ok {
  border-left-color: var(--ok);
  background: var(--ok-soft);
}

/* ---------- fields ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.field__hint {
  font-size: 12px;
  color: var(--text-3);
}

.field__impact {
  font-size: 12px;
  color: var(--warn);
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--surface);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

.textarea--lg {
  min-height: 120px;
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  background: var(--surface-2);
  color: var(--text-3);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.table-editor {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table-editor th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  padding: 4px 6px;
  font-weight: 600;
}

.table-editor td {
  padding: 3px 4px;
  vertical-align: top;
}

.table-editor .input {
  padding: 6px 8px;
  font-size: 13px;
}

.repeat-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.repeat-item__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}

/* ---------- projects ---------- */

.project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.project-card__title {
  font-weight: 650;
  font-size: 15px;
}

.project-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-2);
}

.progress {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ---------- type picker ---------- */

.family-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
}

.tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.type-card {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s, transform 0.08s, box-shadow 0.12s;
}

.type-card:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.type-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.type-card:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.type-card__title {
  font-weight: 650;
}

.type-card__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- brief ---------- */

.brief {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.brief__nav {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brief__nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  width: 100%;
}

.brief__nav-item:hover {
  background: var(--surface-2);
}

.brief__nav-item[aria-current="true"] {
  background: var(--surface-3);
  font-weight: 600;
}

.brief__nav-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.brief__aside {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gate-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  font-size: 12px;
  align-items: start;
}

.gate-item__mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  margin-top: 1px;
}

.gate-item--ok .gate-item__mark {
  background: var(--ok-soft);
  color: var(--ok);
}

.gate-item--miss .gate-item__mark {
  background: var(--danger-soft);
  color: var(--danger);
}

.qa-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-2);
}

.qa-item__q {
  font-weight: 600;
  font-size: 13px;
}

/* ---------- assembly ---------- */

.assembly {
  max-width: 620px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stage {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.stage--active {
  border-color: var(--border);
  background: var(--surface);
}

.stage--done {
  color: var(--text-2);
}

.stage__dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
}

.stage--active .stage__dot {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

.stage--done .stage__dot {
  border-color: var(--ok);
  background: var(--ok-soft);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- review ---------- */

.review {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px;
  align-items: start;
}

.review__aside {
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 90px);
}

.panel-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.panel-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.panel-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.panel-body {
  overflow-y: auto;
  max-height: calc(100vh - 210px);
}

.page-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.page-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--mono);
  white-space: nowrap;
}

.page-tab[aria-selected="true"] {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.browser {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.browser__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.browser__dots {
  display: flex;
  gap: 5px;
}

.browser__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}

.browser__url {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site {
  background: #fff;
}

.blk {
  position: relative;
  border-bottom: 1px dashed var(--surface-3);
  padding: 26px 30px;
  cursor: pointer;
  transition: background 0.12s;
}

.blk:hover {
  background: #fafbfc;
}

.blk[aria-current="true"] {
  background: #f7f9ff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.blk__label {
  position: absolute;
  top: 6px;
  right: 8px;
  display: flex;
  gap: 5px;
  align-items: center;
  opacity: 0;
  transition: opacity 0.12s;
}

.blk:hover .blk__label,
.blk[aria-current="true"] .blk__label {
  opacity: 1;
}

.blk__hook {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.blk h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.blk--hero {
  padding: 44px 30px;
  background: linear-gradient(180deg, #f7f9ff, #ffffff);
}

.blk--hero h2 {
  font-size: 30px;
  max-width: 22ch;
}

.blk--hero .blk__sub {
  max-width: 52ch;
}

.blk__sub {
  color: var(--text-2);
  margin-bottom: 10px;
}

.blk__cta {
  display: inline-flex;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-weight: 600;
  font-size: 13px;
  margin-top: 6px;
}

.blk__bullets {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-2);
}

.blk__bullets li {
  margin-bottom: 4px;
}

.blk__items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.blk__item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  background: var(--surface);
}

.blk__item-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 3px;
}

.blk__item-text {
  font-size: 12px;
  color: var(--text-2);
}

.blk__kpis {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.blk__kpi-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.blk__kpi-label {
  font-size: 12px;
  color: var(--text-2);
}

.blk__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
}

.blk__table th,
.blk__table td {
  border: 1px solid var(--border);
  padding: 7px 9px;
  text-align: left;
}

.blk__table th {
  background: var(--surface-2);
  font-size: 12px;
}

.blk__qa {
  border-top: 1px solid var(--border);
  padding: 10px 0;
}

.blk__qa:last-child {
  border-bottom: 1px solid var(--border);
}

.blk__qa-q {
  font-weight: 600;
  font-size: 13px;
}

.blk__qa-a {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 3px;
}

.blk__form {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-width: 320px;
}

.blk__form-field {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  color: var(--text-3);
  font-size: 13px;
  background: var(--surface);
}

.blk__logos {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.blk__logo {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-3);
  background: var(--surface-2);
}

.blk--footer {
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
}

.blk__media {
  margin-top: 10px;
  height: 150px;
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(45deg, #eef1f5, #eef1f5 10px, #e6eaef 10px, #e6eaef 20px);
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-size: 12px;
}

/* ---------- chat ---------- */

.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.chat__focus {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--text-2);
}

.chat__log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 46vh;
  padding-right: 2px;
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 92%;
  font-size: 13px;
}

.msg--user {
  align-self: flex-end;
  align-items: flex-end;
}

.msg__bubble {
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: pre-wrap;
}

.msg--user .msg__bubble {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.msg--refusal .msg__bubble {
  background: var(--warn-soft);
  border-color: #f0dcb6;
}

.msg__meta {
  font-size: 10px;
  color: var(--text-3);
  display: flex;
  gap: 6px;
  align-items: center;
}

.chat__composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat__quick {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-2);
}

.chip:hover {
  background: var(--surface-2);
  color: var(--text);
}

.diff {
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.diff__side {
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  border: 1px solid var(--border);
}

.diff__side--before {
  background: var(--danger-soft);
  border-color: #f3cfcf;
  text-decoration: line-through;
  text-decoration-color: rgba(197, 48, 48, 0.4);
}

.diff__side--after {
  background: var(--ok-soft);
  border-color: #c6e6d4;
}

.diff__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 3px;
}

.variant {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gap-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
}

.hist-item {
  border-left: 2px solid var(--border-strong);
  padding: 4px 0 10px 12px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- publish ---------- */

.publish {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.published {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--ok-soft), var(--surface));
  border: 1px solid #c6e6d4;
}

.published__url {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
}

/* ---------- студия и медиа ---------- */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.media-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.media-card--selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.media-card__view {
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
  display: block;
}

.media-card__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.media-card__title {
  font-weight: 600;
  font-size: 13px;
}

.media-card__prompt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-thumb {
  background: repeating-linear-gradient(45deg, #eef1f5, #eef1f5 8px, #e6eaef 8px, #e6eaef 16px);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  display: block;
}

.media-thumb--empty {
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  padding: 10px;
}

.queue-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--surface);
}

.queue-item--blocked {
  background: var(--warn-soft);
  border-color: #f0dcb6;
}

.queue-item .spacer {
  margin-left: auto;
}

.direction {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  cursor: pointer;
  width: 100%;
}

.direction[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.direction__swatch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 6px;
  overflow: hidden;
  height: 34px;
}

.direction__swatch span {
  display: block;
}

.direction__name {
  display: block;
  font-weight: 600;
  font-size: 13px;
}

.direction__meta {
  display: block;
  font-size: 11px;
  color: var(--text-3);
}

.skill,
details.skill {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--surface);
}

.skill summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill[open] summary {
  margin-bottom: 8px;
}

.skill-row {
  border-bottom: 1px solid var(--border);
  padding-bottom: 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.skill-row:last-of-type {
  border-bottom: 0;
}

.skill-row .spacer {
  margin-left: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.mono-cell {
  font-family: var(--mono);
  font-size: 11px;
}

.job {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
}

.job--failed {
  background: var(--danger-soft);
  border-color: #f3cfcf;
}

.job__label {
  font-size: 13px;
  font-weight: 550;
}

.code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0;
  white-space: pre-wrap;
  max-height: 260px;
  overflow: auto;
}

.zoom {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 26, 0.72);
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 28px;
}

.zoom__inner {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: min(1100px, 92vw);
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow);
}

.zoom__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--surface);
}

.zoom__image {
  display: block;
  max-width: 100%;
}

/* ---------- html-превью ---------- */

.preview-shell {
  background: var(--surface-2);
  display: grid;
  place-items: start center;
  padding: 0;
}

.preview-frame {
  width: 100%;
  height: 620px;
  border: 0;
  display: block;
  background: #fff;
}

.preview-shell--mobile {
  padding: 16px 0;
}

.preview-shell--mobile .preview-frame {
  width: 390px;
  height: 640px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
}

/* ---------- слои ---------- */

.overlay {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  line-height: 0;
}

.overlay__image {
  width: 100%;
  display: block;
}

.overlay__box {
  position: absolute;
  border: 1.5px dashed rgba(59, 91, 219, 0.85);
  background: rgba(59, 91, 219, 0.08);
}

.overlay__box--baseCover {
  border-color: rgba(139, 150, 163, 0.7);
  background: transparent;
}

.overlay__box--liveText {
  border-color: rgba(31, 146, 84, 0.9);
  background: rgba(31, 146, 84, 0.1);
}

.overlay__box--nativeShape {
  border-color: rgba(59, 91, 219, 0.9);
  background: rgba(59, 91, 219, 0.14);
}

.overlay__box--imageCrop {
  border-color: rgba(183, 121, 31, 0.9);
  background: rgba(183, 121, 31, 0.1);
}

.overlay__tag {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-100%);
  font-family: var(--mono);
  font-size: 9px;
  background: rgba(22, 32, 43, 0.85);
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.5;
  white-space: nowrap;
}

.layer-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
}

.layer-item .spacer {
  margin-left: auto;
}

/* ---------- toast ---------- */

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 13px;
  max-width: 340px;
  animation: toast-in 0.18s ease;
}

.toast--warn {
  background: #8a5a12;
}

.toast--danger {
  background: #9b2c2c;
}

.toast--ok {
  background: #166534;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.busy-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%;
  animation: busy 1s linear infinite;
  z-index: 200;
}

@keyframes busy {
  from {
    background-position: -40% 0;
  }
  to {
    background-position: 140% 0;
  }
}

@media (max-width: 1240px) {
  .brief {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .brief__nav {
    display: none;
  }

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

  .review__aside {
    position: static;
    max-height: none;
  }

  .panel-body {
    max-height: none;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

  .brief__aside {
    position: static;
  }
}

/* Онбординг-тур (Intro.js): кнопка «?» и тема тултипа под токены прототипа. */
.btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
}

.help-btn {
  border-color: var(--border-strong);
  color: var(--text-2);
  flex: none;
}

.help-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent);
}

.introjs-tooltip.tour-tip {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--font);
  color: var(--text);
  min-width: 280px;
  max-width: 360px;
}

.tour-tip .introjs-tooltiptext {
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.55;
}

.tour-tip .introjs-tooltiptext code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 5px;
}

.tour-tip .introjs-tooltipbuttons {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
}

.tour-tip .introjs-button {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  text-shadow: none;
  font-weight: 550;
  padding: 6px 12px;
}

.tour-tip .introjs-button:hover {
  background: var(--surface-2);
}

.tour-tip .introjs-nextbutton {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tour-tip .introjs-nextbutton:hover {
  background: #3450c8;
  color: #fff;
}

.tour-tip .introjs-skipbutton {
  color: var(--text-3);
}

.tour-tip .introjs-bullets ul li a.active {
  background: var(--accent);
}

.tour-highlight {
  border-radius: var(--radius-sm);
}
