/* Archive-only layouts; color and typography come from the shared theme. */

.archive-lang-note {
  display: none;
  margin-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

[data-lang="ru"] .archive-lang-note {
  display: block;
}

.v1 {
  margin-top: 4.5rem;
  padding-top: 4rem;
  border-top: 1px solid var(--border);
}

.v1 .wrap {
  max-width: var(--max-content);
  margin: 0 auto;
}

.v1 h2 .num {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.v1 .lead {
  max-width: 64ch;
  font-family: var(--font-display);
  font-size: 1.16rem;
  line-height: 1.55;
  color: var(--text);
}

.v1 .archive-aside {
  margin-top: 1.25rem;
  color: var(--text-dim);
  font-style: italic;
}

.v1 .archive-aside--center {
  text-align: center;
}

.v1 .intro-grid,
.v1 .cat-grid,
.v1 .resources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.v1 .panel,
.v1 .cat,
.v1 .resource {
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-soft);
}

.v1 .panel .tag,
.v1 .cat .glyph {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-faint);
}

.v1 .panel.alt .tag {
  color: var(--accent-2);
  border-color: var(--border-hover);
  background: var(--ok-faint);
}

.v1 .panel h3,
.v1 .split h3 {
  margin: 0.65rem 0 0.4rem;
}

.v1 .panel small {
  color: var(--text-dim);
}

.v1 .split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.v1 .split > div {
  padding: 1.25rem;
}

.v1 .split > div + div {
  border-left: 1px solid var(--border);
}

.v1 .split h4 {
  margin-top: 0;
}

.v1 .split ul {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.v1 .split li {
  position: relative;
  margin: 0;
  padding: 0.4rem 0 0.4rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.v1 .split li:last-child {
  border-bottom: 0;
}

.v1 .split li::before {
  content: '+';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

.v1 .syntax-row {
  margin: 0.25rem 0;
}

.v1 .split-note {
  margin-top: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
}

.v1 .layers {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.v1 .layer {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-hover);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.v1 .layer.world {
  border-left-color: var(--accent-2);
}

.v1 .layer.char {
  border-left-color: var(--accent);
}

.v1 .layer.user {
  border-left-color: var(--warn);
}

.v1 .layer .label,
.v1 .layer .priority {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.v1 .layer .label {
  color: var(--text);
}

.v1 .layer .desc {
  color: var(--text-secondary);
}

.v1 .layer .priority {
  text-align: right;
  color: var(--text-dim);
}

.v1 .cat .head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.v1 .cat .name {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
}

.v1 .cat p {
  margin: 0;
  font-size: 0.92rem;
}

.v1 .cat .ex {
  display: block;
  margin-top: 0.65rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--accent-line);
  font-size: 0.84rem;
  font-style: italic;
  color: var(--text-dim);
}

.v1 .platform-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0.7rem 0.85rem;
  border-left: 2px solid var(--accent-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--ok-faint);
}

.v1 .platform-note .pill,
.v1-note-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.v1 .platform-note .pill {
  color: var(--accent-2);
}

.v1 .platform-note .also {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.v1-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem;
  margin: 1rem 0 1.25rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--warn);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  background: var(--warn-faint);
}

.v1-note-tag {
  flex: 0 0 auto;
  color: var(--warn);
}

.v1-note-text {
  flex: 1 1 260px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.v1 .example {
  margin-top: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  background: var(--code-bg);
}

.v1 .example + .example {
  margin-top: 1rem;
}

.v1 .example .bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--code-border);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.v1 .example .body {
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--code-text);
}

.v1 .example .k {
  color: var(--accent);
}

.v1 .example .v {
  color: var(--text);
}

.v1 .example .c {
  color: var(--text-dim);
  font-style: italic;
}

.v1 .do-dont {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.v1 .do-dont .col {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-top: 2px solid var(--ok);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.v1 .do-dont .dont {
  border-top-color: var(--bad);
}

.v1 .do-dont .do-h {
  color: var(--ok);
}

.v1 .do-dont .dont-h {
  color: var(--bad);
}

.v1 .do-dont h4 {
  margin: 0 0 0.6rem;
}

.v1 .do-dont ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.v1 .do-dont li {
  position: relative;
  margin: 0;
  padding: 0.4rem 0 0.4rem 1.35rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.v1 .do-dont li:last-child {
  border-bottom: 0;
}

.v1 .do-dont li::before {
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
}

.v1 .do-dont .do li::before {
  content: '+';
  color: var(--ok);
}

.v1 .do-dont .dont li::before {
  content: '−';
  color: var(--bad);
}

.v1 .steps {
  counter-reset: archive-step;
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.v1 .step {
  counter-increment: archive-step;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.v1 .step::before {
  content: counter(archive-step, decimal-leading-zero);
  padding-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.v1 .step h3 {
  margin: 0 0 0.35rem;
  font-size: 1.12rem;
}

.v1 .step p {
  margin: 0;
  font-size: 0.92rem;
}

.v1 .step .why {
  margin-top: 0.45rem;
  color: var(--text-dim);
  font-style: italic;
}

.v1 .field-table {
  margin-top: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.v1 .field-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
}

.v1 .field-row:last-child {
  border-bottom: 0;
}

.v1 .field-row .name,
.v1 .field-row .desc {
  padding: 0.9rem 1rem;
}

.v1 .field-row .name {
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.v1 .field-row .name small {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-body);
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-dim);
}

.v1 .field-row .desc {
  color: var(--text-secondary);
}

.v1 .budget-wrap {
  margin-top: 1.5rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.v1 .budget-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.v1 .budget-bar {
  display: flex;
  min-height: 2.25rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.v1 .budget-bar > div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0.25rem;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
}

[data-theme="dark"] .v1 .budget-bar > div {
  color: #14130f;
}

.v1 .b-system { flex: 0 0 12%; background: var(--warn); }
.v1 .b-card { flex: 0 0 14%; background: var(--accent-hover); }
.v1 .b-lore { flex: 0 0 30%; background: var(--accent-2); }
.v1 .b-chat { flex: 0 0 38%; background: var(--text-dim); }
.v1 .b-reply { flex: 0 0 6%; background: var(--border-hover); color: transparent; }

.v1 .budget-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  margin-top: 1rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.v1 .budget-legend .item {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.v1 .budget-legend .swatch {
  flex: 0 0 0.7rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
}

.v1 .swatch--system { background: var(--warn); }
.v1 .swatch--card { background: var(--accent-hover); }
.v1 .swatch--lore { background: var(--accent-2); }
.v1 .swatch--chat { background: var(--text-dim); }
.v1 .swatch--reply { background: var(--border-hover); }

.v1 .budget-legend small {
  color: var(--text-dim);
}

.v1 .mistakes {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.v1 .mistake {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.v1 .mistake summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text);
}

.v1 .mistake summary::-webkit-details-marker {
  display: none;
}

.v1 .mistake summary::before {
  content: '+';
  flex: 0 0 auto;
  font-family: var(--font-mono);
  color: var(--accent);
}

.v1 .mistake[open] summary::before {
  content: '−';
}

.v1 .mistake .body {
  padding: 0 1rem 1rem;
  color: var(--text-secondary);
}

.v1 .mistake .fix {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-left: 2px solid var(--ok);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--ok-faint);
}

.v1 .resource {
  border-left: 3px solid var(--accent-2);
}

.v1 .resource.warm {
  border-left-color: var(--accent);
}

.v1 .resource h4 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}

.v1 .resource p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.v1 .resource a {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .v1 {
    margin-top: 3.5rem;
    padding-top: 3rem;
  }

  .v1 .intro-grid,
  .v1 .cat-grid,
  .v1 .resources,
  .v1 .split,
  .v1 .do-dont,
  .v1 .budget-legend {
    grid-template-columns: 1fr;
  }

  .v1 .split > div + div {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .v1 .layer {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .v1 .layer .priority {
    text-align: left;
  }

  .v1 .field-row {
    grid-template-columns: 1fr;
  }

  .v1 .field-row .name {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .v1 .budget-bar > div {
    font-size: 0;
  }
}

@media (max-width: 480px) {
  .v1 .panel,
  .v1 .cat,
  .v1 .resource,
  .v1 .split > div,
  .v1 .step,
  .v1 .budget-wrap {
    padding: 0.9rem;
  }

  .v1 .example .bar,
  .v1 .budget-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }
}
