:root {
  --bg: #0b1220;
  --bg-soft: #121c30;
  --card: rgba(20, 31, 51, 0.82);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e6edf7;
  --muted: #93a4bd;
  --accent: #38bdf8;
  --accent-2: #22d3ee;
  --good: #34d399;
  --bad: #fb7185;
  --warn: #fbbf24;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 600px at 15% -10%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(34, 211, 238, 0.12), transparent 55%),
    linear-gradient(180deg, #0b1220 0%, #0a101c 100%);
  min-height: 100vh;
}

.shell {
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 32px;
}

.header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.logo {
  flex: none;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-size: 18px;
  color: #04121f;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px rgba(34, 211, 238, 0.25);
}

.logo span {
  opacity: 0.6;
}

.header-text h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -0.02em;
}

.header-text p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.env {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  min-height: 30px;
}

.env-placeholder {
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
}

.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
}

.pill.bad::before {
  background: var(--bad);
  box-shadow: 0 0 10px rgba(251, 113, 133, 0.7);
}

.pill strong {
  color: var(--text);
  font-weight: 600;
}

.env-warning {
  flex-basis: 100%;
  color: var(--warn);
  font-size: 12.5px;
  line-height: 1.45;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px rgba(2, 8, 20, 0.45);
  margin-bottom: 18px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 44px 20px;
  border: 1.5px dashed rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
  text-align: center;
  background: rgba(15, 23, 42, 0.35);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
}

.dropzone.dragover {
  transform: scale(1.005);
}

.dz-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 3px 9px;
  border-radius: 7px;
  margin-bottom: 4px;
}

.dz-title {
  font-size: 17px;
  font-weight: 600;
}

.dz-hint {
  color: var(--muted);
  font-size: 13px;
}

.file-meta {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}

.file-meta .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta .size {
  color: var(--muted);
  flex: none;
}

.file-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.2);
  font-size: 13.5px;
}

.file-index {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.14);
}

.file-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  flex: none;
  color: var(--muted);
  font-size: 12.5px;
}

.file-remove {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease;
}

.file-remove:hover {
  color: var(--bad);
  border-color: rgba(251, 113, 133, 0.5);
}

.notice {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--warn);
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.option {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
  font-size: 13.5px;
}

.option-label {
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.option.checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.option.checkbox input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.option.checkbox small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.option.field {
  margin-top: 12px;
}

.option-hint {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.option select,
.option input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.7);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.option select:focus,
.option input[type="text"]:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
}

.sources {
  margin: 12px 0 4px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.source {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--border);
  font-size: 13px;
}

.source-name {
  flex: 1 1 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.source.failed {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.06);
}

.source-error {
  flex-basis: 100%;
  color: #fecdd3;
  font-size: 12px;
  line-height: 1.45;
}

.action-note {
  align-self: center;
  color: var(--muted);
  font-size: 12.5px;
}


.primary {
  width: 100%;
  margin-top: 16px;
  padding: 14px 18px;
  border: 0;
  border-radius: 12px;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  color: #04121f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 26px rgba(34, 211, 238, 0.28);
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

.primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.progress {
  margin-top: 16px;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
}

.progress .bar {
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.28), transparent);
  animation: slide 1.3s infinite;
}

.progress span {
  position: relative;
}

@keyframes slide {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}

.result h2 {
  margin: 0 0 8px;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.result .status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.result.good {
  border-color: rgba(52, 211, 153, 0.4);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.1), var(--card) 60%);
}

.result.good .status-dot {
  background: var(--good);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.8);
}

.result.bad {
  border-color: rgba(251, 113, 133, 0.4);
  background: linear-gradient(180deg, rgba(251, 113, 133, 0.1), var(--card) 60%);
}

.result.bad .status-dot {
  background: var(--bad);
  box-shadow: 0 0 14px rgba(251, 113, 133, 0.8);
}

.result.warn {
  border-color: rgba(251, 191, 36, 0.4);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.08), var(--card) 60%);
}

.result.warn .status-dot {
  background: var(--warn);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.8);
}

.result p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.5;
}

.result .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.stat {
  flex: 1 1 130px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
}

.stat .label {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 3px;
}

.stat .value {
  font-size: 17px;
  font-weight: 700;
}

.failures {
  margin: 16px 0 4px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.failures li {
  padding: 12px 14px;
  border-radius: 11px;
  background: rgba(251, 113, 133, 0.07);
  border: 1px solid rgba(251, 113, 133, 0.2);
  font-size: 13.5px;
  line-height: 1.45;
}

.failures .clause {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--bad);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

.failures .examples {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.error-text {
  white-space: pre-wrap;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 12.5px;
  background: rgba(2, 8, 20, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  color: #fecdd3;
  max-height: 260px;
  overflow: auto;
}

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

.button-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 11px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  color: #04121f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.button-link.secondary {
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--border);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 4px 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 620px) {
  .shell {
    width: calc(100% - 24px);
    padding-top: 24px;
  }

  .logo {
    width: 58px;
    height: 58px;
    font-size: 14px;
    border-radius: 16px;
  }

  .card {
    padding: 16px;
  }

  .dropzone {
    padding: 32px 14px;
  }

  .header-text p {
    font-size: 13px;
  }
}

.free-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--good);
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
}

.session-card {
  border-color: rgba(56, 189, 248, 0.28);
}

.session-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.session-head h2 {
  margin: 0;
  font-size: 16px;
}

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

.session-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.session-item {
  flex: 1 1 160px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--border);
}

.session-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.session-value,
.session-item code {
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13.5px;
  word-break: break-all;
}

.session-link {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.session-link input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.7);
  color: var(--muted);
  font-size: 12px;
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.secondary {
  padding: 9px 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.secondary:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: var(--accent);
}

.session-note,
.limit-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.limit-note {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.limit-note.exhausted {
  background: rgba(251, 191, 36, 0.07);
  border-color: rgba(251, 191, 36, 0.28);
  color: #fde68a;
}

.field-stack {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.field-stack label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.field-stack input {
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.7);
  color: var(--text);
  font-size: 14px;
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.field-stack input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
}

.error-box {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #fecdd3;
  font-size: 13px;
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.28);
}

.job-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.job-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--border);
  font-size: 13px;
}

.job-main {
  flex: 1 1 200px;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.job-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.job-item a.secondary {
  text-decoration: none;
}

.job-error {
  flex-basis: 100%;
  color: #fecdd3;
  font-size: 12px;
  line-height: 1.45;
}

.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  font-size: 13px;
}

.links-row a {
  color: var(--accent);
  text-decoration: none;
}

.links-row a:hover {
  text-decoration: underline;
}

@media (max-width: 620px) {
  .session-link {
    flex-wrap: wrap;
  }

  .session-link input {
    flex-basis: 100%;
  }
}
