/* Нейросинт — фирменные шрифты (совпадают с основным сайтом) */
@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700&family=Source+Serif+4:opt@8..60&display=swap');

:root {
  /* Палитра Нейросинта: emerald primary, светлая тема */
  --brand: #0b9b73;
  --brand-d: #077e5c;
  --accent: #10b981;
  --accent-d: #059669;
  --ink: #18222e;
  --muted: #5b6675;
  --line: #dfe7e2;
  --bg: #f6f8f6;
  --card: #ffffff;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(11,155,115,.07), 0 8px 24px rgba(11,155,115,.06);
  --font-body: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Заголовки — фирменный serif */
.hero h1, .list-head h2, .import-panel__title,
main.wrap h1, .asm .list-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.01em;
}

/* Верхняя панель бренда — как шапка сайта */
.site-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246,248,246,.85);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-topbar__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
}
.site-brand__mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: grid; place-items: center;
  color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 18px;
  box-shadow: var(--shadow);
}
.site-nav {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.site-nav a {
  font-size: 13.5px; font-weight: 600; text-decoration: none;
  color: var(--muted); padding: 7px 12px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.site-nav a:hover { color: var(--brand); background: #e7f4ee; }
.site-nav a.is-active { color: var(--brand); background: #e7f4ee; }
@media (max-width: 560px) {
  .site-brand span.site-brand__name { display: none; }
  .site-nav a { padding: 6px 9px; }
}

.page { max-width: 1120px; margin: 0 auto; padding: 24px 20px 48px; }

/* Hero */
.hero { padding: 16px 4px 24px; }
.hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--brand);
  letter-spacing: -.02em;
}
.hero__sub { margin: 0; color: var(--muted); max-width: 640px; }

/* Переключатель стандарта */
.standard-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.standard-switch__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.seg {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}
.seg__btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 7px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg__btn:hover { color: var(--brand); }
.seg__btn.is-active {
  background: var(--brand);
  color: #fff;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

/* Fields */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--ink);
}
.hint-inline { font-weight: 400; color: var(--muted); font-size: 12px; }

input[type="text"], select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11,155,115,.15); /* emerald focus ring (rebrand) */
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.grid-2 .field, .grid-3 .field { margin-bottom: 0; }

/* Authors */
.authors { display: flex; flex-direction: column; gap: 8px; }
.author-row { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; }
.author-row input { margin: 0; }
.author-del {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 38px;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.author-del:hover { color: var(--danger); border-color: var(--danger); }

/* DOI */
.doi-field {
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
}
.doi-row { display: flex; gap: 8px; }
.doi-row input { flex: 1; }
.status { margin: 8px 0 0; font-size: 13px; }
.status--loading { color: var(--brand); }
.status--error, .status--notfound { color: var(--danger); }
.status--ok { color: var(--accent-d); }

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 9px;
  padding: 9px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-d); }
.btn--accent { background: var(--accent); color: #06351f; }
.btn--accent:hover { background: var(--accent-d); color: #fff; }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--link {
  background: none;
  border: none;
  color: var(--brand);
  padding: 4px 0;
  font-size: 13px;
}
.btn--link:hover { text-decoration: underline; }

.form-actions { display: flex; gap: 10px; margin-top: 18px; }

.hint--note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* List */
.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.list-head h2 { margin: 0; font-size: 18px; color: var(--brand); }
.list-actions { display: flex; gap: 8px; }

.ref-list { margin: 0; padding-left: 26px; }
.ref-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.ref-list li:last-child { border-bottom: none; }
.ref-text { display: block; }
.ref-tools { margin-top: 6px; display: flex; gap: 14px; }
.ref-tools button {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.ref-tools button:hover { color: var(--brand); }
.ref-tools button.del:hover { color: var(--danger); }

.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 24px 0; }

/* Импорт списка */
.import-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.import-panel__title {
  margin: 0 0 4px;
  font-size: 15px;
  color: var(--brand);
}
.import-panel .hint--note { margin: 0 0 10px; }
.import-text {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink);
  background: #fff;
  resize: vertical;
  min-height: 96px;
  transition: border-color .15s, box-shadow .15s;
}
.import-text:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11,155,115,.15); /* emerald focus ring (rebrand) */
}
.import-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.import-actions .status { margin: 0; }

/* CTA */
.cta {
  margin-top: 28px;
  background: linear-gradient(135deg, var(--brand), var(--brand-d));
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cta__text { margin: 0; font-size: 15px; font-weight: 500; max-width: 560px; }

/* Апселл «свободная форма → ИИ» в блоке импорта */
.ai-upsell {
  margin-top: 14px;
  padding: 14px 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.ai-upsell__text { margin: 0; font-size: 14px; color: var(--ink); line-height: 1.45; flex: 1 1 280px; }
.ai-upsell .btn { white-space: nowrap; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 50;
}

[data-show] { display: none; }
[data-show].is-visible { display: block; }
.grid-2[data-show].is-visible, .grid-3[data-show].is-visible { display: grid; }

/* Responsive */
@media (max-width: 840px) {
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .page { padding: 16px 14px 36px; }
  .hero h1 { font-size: 23px; }
  .grid-3 { grid-template-columns: 1fr; }
  .author-row { grid-template-columns: 1fr 1fr auto; }
  .cta { flex-direction: column; align-items: flex-start; }
  .seg { width: 100%; }
  .seg__btn { flex: 1; }
}
