body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

h1, h2 {
  margin-top: 0;
}

.upload-section, .history-section {
  background: #fff;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.form-row {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

label {
  font-weight: 500;
  margin-bottom: 4px;
}

input[type="file"],
textarea {
  font: inherit;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

button[type="submit"] {
  padding: 10px 16px;
  font: inherit;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
}

button[type="submit"]:hover {
  background: #1d4ed8;
}

.status {
  margin-top: 8px;
  font-size: 0.9rem;
}

.status.ok {
  color: #15803d;
}

.status.error {
  color: #b91c1c;
}

.status.pending {
  color: #92400e;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 6px;
  vertical-align: top;
}

th {
  text-align: left;
  background: #f9fafb;
  font-weight: 600;
}

tr:nth-child(even) td {
  background: #f9fafb;
}


/* ===== MODAL ===== */

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55); /* тёмный полупрозрачный фон */
}

.modal-dialog {
  position: relative;
  z-index: 1001;
  width: min(900px, 95vw);
  max-height: 90vh;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
  padding: 20px 24px 18px;
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: #4b5563;
}

.modal-close:hover {
  color: #111827;
}

.modal-meta {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.modal-audio {
  margin: 8px 0 12px;
}

.modal-audio audio {
  width: 100%;
}

.modal-text {
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
  margin-top: 8px;
  overflow: auto;
}

.modal-text h4 {
  margin: 0 0 6px;
}

.modal-text pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Более явное "кликабельно" для строк истории */
#entriesTable tbody tr {
  cursor: pointer;
}

#entriesTable tbody tr:hover td {
  background-color: #eef2ff;
}


.modal-text textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font: inherit;
  line-height: 1.4;
}

.modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-actions button {
  padding: 8px 14px;
  font: inherit;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #16a34a;
  color: #fff;
}

.modal-actions button:hover {
  background: #15803d;
}


.history-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.history-actions button {
  padding: 8px 14px;
  font: inherit;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #0f766e;
  color: #fff;
}

.history-actions button:hover {
  background: #115e59;
}

.modal-flags {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.modal-flags input[type="checkbox"] {
  margin-right: 4px;
}

.export-status {
  font-size: 0.85rem;
  color: #4b5563;
}

/* Подсветка строк */
#entriesTable tbody tr.exported td {
  background-color: #ecfdf5;
}

#entriesTable tbody tr.unverified td {
  opacity: 0.85;
}

/* уже были */
#entriesTable tbody tr {
  cursor: pointer;
}

#entriesTable tbody tr:hover td {
  background-color: #eef2ff;
}


.modal-raw-timecodes details {
  margin-top: 4px;
}

.modal-raw-timecodes pre {
  margin: 6px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  background: #f9fafb;
  border-radius: 6px;
  padding: 6px 8px;
  max-height: 260px;
  overflow: auto;
}
