:root {
  --bg: #0b0d12;
  --card: #121622;
  --text: #e8ebf2;
  --muted: #aab2c5;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #7aa2ff;
  --danger: #ff6b6b;
  --ok: #6bff9a;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    "Noto Sans",
    "Liberation Sans",
    sans-serif;
  background: radial-gradient(1200px 700px at 20% 0%, #121a2f, var(--bg));
  color: var(--text);
}

.app {
  max-width: 1050px;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(18, 22, 34, 0.8);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(8px);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.3px;
}

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

.label {
  font-size: 12px;
  color: var(--muted);
}

.input {
  width: 140px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  outline: none;
}

.input:focus {
  border-color: rgba(122, 162, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.15);
}

.main {
  margin-top: 14px;
}

.status {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 22, 34, 0.6);
  color: var(--muted);
}

.status.error {
  border-color: rgba(255, 107, 107, 0.35);
  color: #ffd6d6;
}

.workspace {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.taskNav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 22, 34, 0.55);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.pill.active {
  border-color: rgba(122, 162, 255, 0.55);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.12);
}

.taskCard {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(18, 22, 34, 0.75);
}

.taskTitle {
  margin: 0 0 10px 0;
  font-size: 18px;
}

.taskText {
  margin: 0 0 14px 0;
  color: var(--text);
  line-height: 1.45;
}

.exampleTitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.exampleBox {
  margin: 0 0 14px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  overflow: auto;
}

.textarea {
  width: 100%;
  resize: vertical;
  min-height: 180px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.4;
}

.textarea:focus {
  border-color: rgba(122, 162, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.15);
}

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

.btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 22, 34, 0.55);
  color: var(--text);
  cursor: pointer;
}

.btn:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.btn.primary {
  background: rgba(122, 162, 255, 0.18);
  border-color: rgba(122, 162, 255, 0.45);
}

.result {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
}

.result.ok {
  border-color: rgba(107, 255, 154, 0.35);
  color: #c9ffe0;
}

.hidden {
  display: none !important;
}

.result pre {
  margin: 10px 0 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  overflow: auto;
}

.result code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.results {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(18, 22, 34, 0.65);
}

.resultsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.resultsTitle {
  margin: 0;
  font-size: 16px;
}

.resultsTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: rgba(0, 0, 0, 0.15);
}

.resultsTable th,
.resultsTable td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
  white-space: nowrap;
}

.resultsTable th {
  position: sticky;
  top: 0;
  background: rgba(18, 22, 34, 0.9);
  color: var(--muted);
  font-weight: 600;
}

.resultsTable tr:last-child td {
  border-bottom: none;
}

.cellOk {
  color: #c9ffe0;
}

.cellBad {
  color: #ffd6d6;
}

.floatingBtn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(122, 162, 255, 0.45);
  background: rgba(122, 162, 255, 0.18);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.floatingBtn:hover {
  border-color: rgba(122, 162, 255, 0.7);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.overlay.hidden {
  display: none;
}

.overlayBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.overlayPanel {
  position: relative;
  width: min(1100px, 100%);
  max-height: min(80vh, 720px);
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(18, 22, 34, 0.92);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

/* чтобы таблица нормально скроллилась внутри панели */
.resultsTableWrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  flex: 1;
}

.submittedBanner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  background-color: #161b22; /* тёмный фон под цвет карточки */
  border: 1px dashed #30363d;   /* аккуратная пунктирная рамка */
  border-radius: 8px;
  color: #3fb950;             /* приятный зелёный цвет текста (или #8b949e для серого) */
  font-size: 1.1rem;
  font-weight: 500;
  margin-top: 12px;
}

.fileUploadArea {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 16px;
}

.fileName {
  font-size: 0.9rem;
  color: #8b949e;
  font-style: italic;
}

.dropZone {
  position: relative;
  width: 100%;
}

/* Стили оверлея, который появляется при наведении файла */
.dropOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(22, 27, 34, 0.9); /* Полупрозрачный темно-серый */
  border: 2px dashed #3fb950;               /* Аккуратная зеленая пунктирная рамка */
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3fb950;
  font-size: 1.1rem;
  font-weight: 600;
  pointer-events: none;                       /* Чтобы оверлей не мешал событиям */
  z-index: 10;
}
