#root {
  width: 100%;
  min-height: 100vh;
}

.auth-screen,
.locked-screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.locked-screen__card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.locked-screen__icon {
  margin-bottom: 10px;
  color: var(--primary);
  font-weight: 700;
  font-size: 20px;
}

.locked-screen__title {
  margin: 0 0 8px;
  font-size: 24px;
}

.locked-screen__text {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.content {
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: 24px 20px;
}

.content-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.content-tabs__btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.content-tabs__btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.screen {
  display: none;
}

.screen[aria-hidden="false"] {
  display: block;
}

.wizard {
  padding: 18px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

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

.input-preview-map-wrap {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fbfd;
  padding: 10px;
}

.input-preview-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.input-preview-map-tools {
  display: inline-flex;
  gap: 6px;
}

.map-tool-btn {
  border: 1px solid rgba(36, 125, 139, 0.35);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(36, 125, 139, 0.1);
  cursor: pointer;
}

.map-tool-btn:hover:not(:disabled) {
  background: rgba(36, 125, 139, 0.16);
}

.map-tool-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.map-tool-btn_active {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.map-tool-btn_ghost {
  border-color: var(--border);
  color: var(--text-muted);
  background: #fff;
}

.input-preview-map-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-preview-map {
  height: 250px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #dbeafe;
}

.input-preview-map--draw {
  cursor: crosshair;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.payload-mode {
  margin-top: 10px;
}

.payload-mode__label {
  margin-bottom: 8px;
}

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

.mode-chip {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  overflow: hidden;
}

.mode-chip span {
  display: block;
  padding: 6px 12px;
}

.mode-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-chip input:checked + span {
  background: var(--primary-light);
  color: var(--primary);
}

.payload-file-hint {
  margin: 6px 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.file-drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 98px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: #f8fbfd;
  padding: 14px 12px;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.file-drop-zone:hover {
  border-color: var(--primary);
  background: #eef7fb;
}

.file-drop-zone--drag,
.file-drop-zone--filled {
  border-color: var(--primary);
  background: #e8f3f9;
}

.file-drop-zone input[type="file"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.file-drop-zone__text {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.file-drop-zone__name {
  display: none;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  text-align: center;
  word-break: break-all;
}

.file-drop-zone__clear {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.file-drop-zone__clear:hover {
  background: #fef2f2;
  border-color: rgba(225, 29, 72, 0.35);
  color: #be123c;
}

.file-drop-zone__clear:focus-visible {
  outline: 2px solid rgba(14, 116, 144, 0.35);
  outline-offset: 2px;
}

.file-drop-zone--filled .file-drop-zone__text {
  display: none;
}

.file-drop-zone--filled .file-drop-zone__name {
  display: block;
}

.file-drop-zone--filled .file-drop-zone__clear {
  display: inline-flex;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin: 10px 0 6px;
}

.field-input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

.field-input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

.form-block {
  text-align: left;
  margin-top: 10px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary {
  margin-top: 10px;
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: #fff;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.card_light {
  margin-top: 12px;
  background: #fbfdff;
}

.card__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

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

.card__head .card__title {
  margin: 0;
}

.toggle-wrap {
  display: flex;
  flex-direction: column;
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}

.check-item input {
  margin-right: 0;
}

.pretty-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.pretty-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pretty-check__box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
  position: relative;
  flex: 0 0 auto;
}

.pretty-check input:checked + .pretty-check__box {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.pretty-check input:checked + .pretty-check__box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.pretty-check input:focus-visible + .pretty-check__box {
  outline: 2px solid rgba(14, 116, 144, 0.35);
  outline-offset: 2px;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.module-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.module-card--enabled {
  border-color: rgba(36, 125, 139, 0.35);
  box-shadow: 0 0 0 3px rgba(36, 125, 139, 0.08);
}

.module-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.module-card__toggle {
  min-width: 0;
}

.module-card__title {
  font-size: 14px;
  font-weight: 600;
}

.module-card__status {
  font-size: 12px;
  color: var(--text-muted);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.module-card__controls {
  margin-top: 8px;
  position: relative;
}

.module-layers__trigger {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.module-layers__trigger:hover:not(:disabled) {
  border-color: #cdd7e4;
}

.module-layers__trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f8fafc;
}

.module-layers__popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.16);
  padding: 8px;
  display: none;
}

.module-layers__popover.is-open {
  display: block;
}

.module-layers__search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text);
}

.module-layers__search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

.module-layers__actions {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.module-layers__action {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  background: #f8fafc;
  color: var(--text);
  cursor: pointer;
}

.module-layers__action:hover {
  border-color: #cdd7e4;
  background: #f1f5f9;
}

.module-layers__list {
  max-height: 210px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
}

.module-layer-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 4px;
  border-radius: 8px;
  cursor: pointer;
}

.module-layer-row:hover {
  background: #f8fbfd;
}

.module-layer-row .pretty-check__box {
  margin-top: 1px;
}

.module-layer-row__text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.module-card__chips {
  min-height: 24px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.module-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(36, 125, 139, 0.25);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--primary);
  background: rgba(36, 125, 139, 0.08);
}

.module-chip_muted {
  border-color: var(--border);
  color: var(--text-muted);
  background: #f8fafc;
}

.actions-row {
  margin-top: 12px;
}

.actions-row_inline {
  margin-top: 8px;
}

.requests-grid {
  display: grid;
  gap: 10px;
}

.request-card {
  position: relative;
  padding-right: 42px;
}

.request-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: #991b1b;
  background: #fff;
  cursor: pointer;
}

.card__meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.request-actions {
  margin-top: 8px;
}

.status-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.status-badge_queued {
  background: #e2e8f0;
  color: #334155;
}

.status-badge_running {
  background: rgba(34, 197, 94, 0.2);
  color: #15803d;
}

.status-badge_done {
  background: rgba(14, 165, 233, 0.2);
  color: #0369a1;
}

.status-badge_failed {
  background: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.modal__title {
  margin: 0 0 12px;
  font-size: 17px;
}

.modal-close-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}

.modal__message {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
  word-break: break-word;
}

.modal__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal__btn {
  width: auto;
  flex: 0 0 auto;
  min-width: 104px;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.modal__btn_ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.request-details__json {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  max-height: 380px;
  overflow: auto;
  font-size: 12px;
}

.request-details__result-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1f7f90 0%, #247d8b 55%, #2aa2b4 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(36, 125, 139, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.request-details__result-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(36, 125, 139, 0.28);
  filter: brightness(1.02);
}

.request-details__result-link:active {
  transform: translateY(0);
}

@media (max-width: 760px) {
  .content {
    padding: 16px 12px;
  }

  .grid-2,
  .grid-3,
  .modules-grid {
    grid-template-columns: 1fr;
  }
}
