:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #172033;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #0ea5e9;
  --accent-2: #0284c7;
}

* { box-sizing: border-box; }

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

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #16324a 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #1a2740 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.platform-bar,
.page-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.platform-bar a {
  color: #93c5fd;
  font-weight: 600;
  text-decoration: none;
}

.tool-name {
  font-weight: 700;
}

.platform-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.sub-status {
  font-size: 12px;
  color: var(--muted);
  max-width: 240px;
  line-height: 1.3;
}

.page-bar h1 {
  margin: 0;
  font-size: 1.15rem;
}

.page-bar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.page-bar .btn {
  margin-left: auto;
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
}

.dropzone {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 110px;
  padding: 14px;
  border: 1.5px dashed #475569;
  border-radius: 10px;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: #0f2338;
}

.dropzone strong { font-size: 14px; }
.dropzone span { font-size: 12px; color: var(--muted); }

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field select,
.field input[type="range"] {
  width: 100%;
}

.field select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: var(--text);
}

.field.check label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  margin: 0;
}

.btn {
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
}

.btn:hover { background: var(--accent-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary {
  background: #334155;
  color: var(--text);
  border: 1px solid #475569;
}
.btn.block { width: 100%; }

.hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(220px, 1fr) minmax(280px, 1.2fr);
  gap: 14px;
  min-height: 0;
}

.preview-wide {
  grid-column: 1 / -1;
}

.preview-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.preview-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.preview-body {
  flex: 1;
  min-height: 280px;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: auto;
  background:
    linear-gradient(45deg, #1a2333 25%, transparent 25%),
    linear-gradient(-45deg, #1a2333 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1a2333 75%),
    linear-gradient(-45deg, transparent 75%, #1a2333 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-color: #0b1220;
}

.preview-body img,
.preview-body svg {
  max-width: 100%;
  max-height: 100%;
  height: auto;
}

.svg-preview svg {
  background: transparent;
}

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

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