:root {
  color-scheme: dark;
  --bg: #090a0f;
  --panel: rgba(15, 15, 24, 0.84);
  --panel-deep: rgba(7, 7, 13, 0.92);
  --panel-soft: rgba(33, 30, 45, 0.82);
  --text: #f4f1fb;
  --muted: #c4bdcf;
  --line: #332b41;
  --line-bright: #7b63a2;
  --purple: #5a359b;
  --purple-light: #8658d8;
  --purple-dark: #24183e;
  --red: #c62c52;
  --red-deep: #610613;
  --green: #80d796;
  --amber: #d49b42;
  --danger: #ff778a;
  --shadow: rgba(0, 0, 0, 0.72);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #111319;
  color: var(--text);
  font: 14px/1.38 "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(13, 10, 20, 0.92), rgba(10, 10, 14, 0.7)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, transparent 0 42px, rgba(0, 0, 0, 0.26) 42px 43px);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 32px;
  border: 1px solid #211434;
  border-radius: 0;
  background: linear-gradient(180deg, #7245bd, var(--purple));
  color: var(--text);
  padding: 5px 13px;
  cursor: pointer;
  text-shadow: 0 1px 0 #000;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset -3px 0 0 rgba(0, 0, 0, 0.18),
    0 1px 0 #000;
}

button:hover:not(:disabled) {
  background: var(--purple-light);
  border-color: #9d75e3;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

button.primary {
  background: linear-gradient(180deg, #9c69ef, var(--purple-light));
  border-color: #9271cf;
  color: #fff;
  font-weight: 700;
}

.app-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 28px 10px;
  background: rgba(7, 7, 12, 0.84);
  border-bottom: 2px solid var(--red);
  box-shadow: 0 2px 0 #160008, 0 10px 22px rgba(0, 0, 0, 0.35);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: #f4edff;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 0 8px rgba(170, 136, 255, 0.62), 0 2px 0 #000;
}

.app-header p,
.panel-title p {
  margin-top: 5px;
  color: var(--muted);
}

.actions,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.actions {
  gap: 10px;
}

.tabs {
  position: relative;
  z-index: 1;
  padding: 0 28px 8px;
  background: rgba(7, 7, 12, 0.84);
  border-bottom: 1px solid rgba(198, 44, 82, 0.72);
}

.tabs button {
  min-width: 118px;
  border-color: #2a1944;
  border-left-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, #332050, var(--purple-dark));
  color: #d8d0e8;
}

.tabs button.active {
  background: var(--purple);
  border-top-color: #8c69ca;
  color: #fff;
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 250px minmax(440px, 1fr) minmax(340px, 0.82fr);
  gap: 14px;
  padding: 14px 28px 24px;
}

.sidebar,
.panel,
.output-panel {
  background: var(--panel);
  border: 1px solid var(--red);
  border-radius: 0;
  box-shadow:
    0 0 0 1px #120006,
    0 0 18px rgba(198, 44, 82, 0.18),
    inset 0 0 34px rgba(0, 0, 0, 0.42);
}

.sidebar {
  padding: 10px;
}

.sidebar section + section {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(189, 183, 202, 0.25);
}

.sidebar h2,
.panel-title h2 {
  color: #eeeaf8;
  font-size: 15px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sidebar h2 {
  margin-bottom: 10px;
}

.sidebar button,
.file-picker {
  width: 100%;
  margin-top: 8px;
}

.file-picker {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.file-picker input {
  width: 100%;
}

.panel,
.output-panel {
  min-height: 620px;
  padding: 10px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(189, 183, 202, 0.36);
}

.badge {
  border: 1px solid var(--line-bright);
  border-radius: 0;
  background: rgba(93, 59, 165, 0.35);
  color: #d7caff;
  padding: 4px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.fields {
  display: grid;
  gap: 1px;
  margin-top: 10px;
  background: rgba(198, 44, 82, 0.32);
  border: 1px solid rgba(198, 44, 82, 0.42);
}

.field {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 250px);
  gap: 16px;
  align-items: start;
  min-height: 48px;
  padding: 9px 10px;
  background: var(--panel-deep);
  border: 0;
  border-radius: 0;
}

.field label {
  color: #eeeaf8;
  font-size: 15px;
  font-weight: 500;
}

.field p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.guidance {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 6px 12px;
  margin-top: 8px;
}

.guidance p {
  margin: 0;
}

.guidance strong {
  color: #f1eaff;
  font-size: 11px;
  text-transform: uppercase;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 34px;
  color: #eeeaf8;
  align-self: start;
  margin-top: 26px;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--purple-light);
}

.text-input,
.text-area {
  width: 100%;
  min-height: 32px;
  border: 1px solid #5b5868;
  border-radius: 0;
  background: #11111a;
  color: var(--text);
  padding: 5px 8px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
  align-self: start;
  margin-top: 34px;
}

.text-input:focus,
.text-area:focus {
  outline: 1px solid var(--purple-light);
  border-color: var(--purple-light);
}

.text-area {
  min-height: 112px;
  resize: vertical;
  margin-top: 26px;
}

.group-note,
.empty-state,
.list-note {
  margin-top: 10px;
  padding: 9px;
  border: 1px solid rgba(189, 183, 202, 0.35);
  border-radius: 0;
  background: rgba(12, 12, 19, 0.78);
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.list-note p {
  margin-top: 6px;
  color: var(--muted);
}

.warnings {
  display: grid;
  gap: 8px;
}

.warning {
  padding: 7px;
  border-radius: 0;
  border: 1px solid var(--amber);
  background: rgba(55, 37, 18, 0.88);
  color: #ffe2bc;
}

.warning.high {
  border-color: var(--danger);
  background: rgba(73, 13, 24, 0.88);
  color: #ffd6dd;
}

.warning.info {
  border-color: var(--purple-light);
  background: rgba(35, 25, 61, 0.88);
  color: #ded2ff;
}

.warning.medium {
  border-color: var(--amber);
}

.warnings.empty {
  color: var(--muted);
}

pre {
  min-height: 520px;
  margin: 10px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid #5b5868;
  border-radius: 0;
  background: rgba(6, 6, 11, 0.94);
  color: #eeeaf8;
  padding: 10px;
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .panel,
  .output-panel {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
    padding-inline: 16px;
  }

  h1 {
    font-size: 26px;
  }

  .tabs,
  .layout {
    padding-inline: 16px;
  }

  .actions button,
  .tabs button {
    flex: 1 1 130px;
  }

  .field,
  .guidance {
    grid-template-columns: 1fr;
  }
}
