/* style.css — единственный источник стилей (раньше дублировался инлайном в index.html) */
:root {
  --primary: #4a90e2;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #333333;
  --muted: #6b7280;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --radius: 8px;
  --transition: 0.3s;
}
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: Arial, sans-serif;
  color: var(--text);
}
body { min-height: 100vh; }

/* Раньше было height:100vh + align-items:center — контент выше экрана обрезался
   без возможности проскроллить. */
.wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
  gap: 0;
}
.container {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 800px;
  padding: 30px;
  animation: fadeIn 0.6s ease-out;
  position: relative;
}
h1 {
  margin-top: 0;
  font-size: 24px;
  text-align: center;
  animation: fadeInDown 0.6s ease-out;
}
label {
  font-weight: bold;
  display: block;
  margin-top: 16px;
}
textarea {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  transition: border-color var(--transition);
  font-family: monospace;
  font-size: 13px;
  resize: vertical;
}
textarea:focus {
  border-color: var(--primary);
  outline: none;
}

/* Блок галок */
.checks {
  margin: 16px 0 0;
  padding: 12px 16px 16px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
}
.checks legend {
  font-weight: bold;
  font-size: 13px;
  color: var(--muted);
  padding: 0 6px;
}
label.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: normal;
  margin-top: 10px;
  cursor: pointer;
  line-height: 1.4;
}
label.check:first-of-type { margin-top: 0; }
label.check input { margin-top: 2px; flex: none; }
code {
  background: #f0f2f5;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 12px;
}
.hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: normal;
  display: block;
}
label.check .hint { display: inline; }

.buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.buttons button {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
  padding: 10px 16px;
  font-size: 14px;
}
button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
button:hover {
  background: #357ab8;
  transform: translateY(-1px);
}
.copy-btn { background: #50c878; }
.copy-btn:hover { background: #3da95e; }
.clear-btn { background: #999; }
.clear-btn:hover { background: #777; }
.preview-btn { background: #f39c12; }
.preview-btn:hover { background: #d68910; }

.error {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--danger-bg);
  border: 1px solid #f5c6cb;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.4;
}
.output {
  margin-top: 20px;
  animation: fadeIn 0.6s ease-out;
}
hr {
  margin: 24px 0;
  border: none;
  border-top: 1px solid #eee;
}
progress {
  width: 100%;
  height: 16px;
  margin-top: 10px;
}
#batchStatus { margin-top: 8px; }
[hidden] { display: none !important; }

/* Панель предпросмотра */
#previewPane {
  width: 0;
  align-self: stretch;
  transition: width var(--transition);
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#previewPane.open {
  width: 340px;
  margin-left: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  font-weight: bold;
  color: var(--muted);
  flex: none;
}
.preview-close {
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 0 6px;
}
.preview-close:hover { background: transparent; color: var(--text); transform: none; }
#previewPane iframe {
  width: 100%;
  flex: 1;
  min-height: 400px;
  border: none;
}

@media (max-width: 900px) {
  .wrapper { flex-direction: column; align-items: stretch; }
  .container { max-width: none; padding: 20px; }
  #previewPane.open { width: auto; margin: 16px 0 0; min-height: 420px; }
  .buttons button { max-width: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
