:root {
  color-scheme: dark;
  font-family: Inter, Arial, sans-serif;
  background: #070a0f;
  color: #f5f5f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.shell {
  display: grid;
  grid-template-columns: 360px minmax(320px, 1fr) 440px;
  min-height: 100vh;
}

.panel,
.editor,
.output {
  padding: 22px;
  background: #11161d;
  border-right: 1px solid #252d38;
}

.preview {
  display: grid;
  place-items: center;
  padding: 24px;
  background: #0a0d12;
}

.json-panel {
  margin-top: 18px;
}

.json-panel summary {
  cursor: pointer;
  color: #bac2cf;
  font-weight: 900;
}

.json-panel textarea {
  margin-top: 10px;
}

.output {
  grid-column: 1 / -1;
  border-top: 1px solid #252d38;
  border-right: 0;
}

h1,
h2 {
  margin: 0 0 18px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #bac2cf;
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #323b49;
  border-radius: 7px;
  background: #090d13;
  color: #fff;
  padding: 10px 12px;
  font: inherit;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

button {
  border: 0;
  border-radius: 7px;
  padding: 10px 13px;
  background: #cf236d;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.scan-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: #b9c0cc;
  font-size: 13px;
  line-height: 1.35;
}

.scan-status.is-error {
  color: #ff9aa9;
}

.scan-status.is-success {
  color: #8ee6b0;
}

.scan-warning {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(207, 35, 109, 0.36);
  border-radius: 7px;
  background: rgba(207, 35, 109, 0.1);
  color: #ffd3e4;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.page-list {
  margin: -6px 0 12px;
  color: #9aa4b2;
  font-size: 12px;
  line-height: 1.35;
}

.target-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.target-grid label {
  margin-bottom: 0;
}

.panel button {
  width: 100%;
  margin-top: 10px;
}

.history {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #252d38;
}

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

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

.history-head button {
  width: auto;
  margin: 0;
  background: #1a2330;
}

.history-picker {
  display: grid;
  gap: 8px;
}

.history-picker select {
  width: 100%;
  border: 1px solid #303947;
  border-radius: 7px;
  background: #0b1017;
  color: #fff;
  padding: 8px;
  font: inherit;
}

.history-picker option {
  padding: 5px 6px;
}

.history-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.history-actions button {
  margin-top: 0;
}

#deleteHistoryBtn {
  background: #321722;
  color: #ffd7df;
}

.image-box {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 780px);
  min-height: 70vh;
  border: 1px dashed #303947;
  border-radius: 8px;
  overflow: hidden;
  background: #11161d;
}

.image-box img {
  max-width: 100%;
  max-height: 82vh;
  display: none;
}

.image-box.has-image img {
  display: block;
}

.image-box.has-image #emptyPreview {
  display: none;
}

#emptyPreview {
  color: #758092;
  font-weight: 800;
}

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

.group {
  border: 1px solid #303947;
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 14px;
  background: #0b1017;
}

.group-title {
  width: 100%;
  margin-bottom: 10px;
  color: #cf236d;
  font-size: 20px;
  font-weight: 900;
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 110px;
  gap: 9px;
  padding: 10px 0;
  border-top: 1px solid #242b35;
}

.item textarea {
  grid-column: 1 / -1;
}

.note {
  grid-column: 1 / -1;
  color: #e686b1;
}

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

  .panel,
  .editor {
    border-right: 0;
    border-bottom: 1px solid #252d38;
  }
}
