/* runmap — clean modern studio UI. Self-contained: system sans only, no CDN.
   Soft depth, rounded surfaces, one orange accent, calm dark neutrals. */

:root {
  --bg: #0d0d10;
  --surface: #16161a;      /* window body */
  --panel: #1b1b21;        /* controls pane */
  --sunken: #101014;       /* inputs, preview stage */
  --hover: #232329;        /* button/hover fill */
  --accent: #ff5a1f;       /* runmap orange */
  --accent-hover: #ff7440;
  --accent-ink: #140d09;
  --ink: #ededf1;
  --muted: #8b8b95;
  --faint: #61616b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --radius: 16px;
  --radius-md: 11px;
  --radius-sm: 8px;
  --shadow-window: 0 30px 80px -24px rgba(0, 0, 0, 0.75), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-poster: 0 24px 60px -18px rgba(0, 0, 0, 0.8);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1100px 700px at 50% -12%, #1c1c24 0%, transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.desk {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

/* ---------- window ---------- */

.window {
  width: min(1560px, 96%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-window);
  overflow: hidden;
  animation: window-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes window-in {
  from { transform: translateY(16px) scale(0.995); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  user-select: none;
}
.title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--ink);
}
.title .mark { color: var(--accent); }
.titlebar .tag {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}

/* ---------- split panes ---------- */

.split { display: grid; grid-template-columns: 1fr 340px; }

.pane-image {
  position: relative;
  min-height: max(460px, 70vh);
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background:
    radial-gradient(600px 400px at 50% 40%, rgba(255, 255, 255, 0.02), transparent 70%),
    var(--sunken);
  overflow: hidden;
}
.pane-image.dragging { box-shadow: inset 0 0 0 2px var(--accent); }
.pane-image.dragging::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  pointer-events: none;
}

#preview {
  max-width: 100%;
  max-height: max(600px, 78vh);
  image-rendering: auto;
  border-radius: 4px;
  box-shadow: var(--shadow-poster);
}

.pane-tools { position: absolute; bottom: 16px; right: 16px; display: flex; gap: 8px; }

/* drop hint */
.drop-hint {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px;
  max-width: 380px;
}
.drop-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
  color: var(--accent);
  animation: float 3.2s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hint-title { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.hint-sub { font-size: 13px; color: var(--muted); }
.hint-note { font-size: 11.5px; color: var(--faint); line-height: 1.7; margin-top: 10px; }

/* ---------- controls ---------- */

.pane-controls {
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: var(--panel);
}
.control { display: flex; flex-direction: column; gap: 10px; }
.control-head { display: flex; justify-content: space-between; align-items: baseline; }
.control-head label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--muted);
}

/* text input */
.text-input {
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.text-input::placeholder { color: var(--faint); }
.text-input:hover { border-color: var(--line-strong); }
.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.18);
}

/* segmented buttons */
.segmented { display: flex; gap: 6px; }
.segmented.wrap { display: grid; grid-template-columns: repeat(3, 1fr); }
.segmented button {
  flex: 1;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 9px 6px;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--muted);
  min-width: 0;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.segmented button.on {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 700;
}
.segmented button:not(.on):not(:disabled):hover { background: var(--hover); color: var(--ink); border-color: var(--line-strong); }
.segmented button:disabled { opacity: 0.3; cursor: not-allowed; }

/* checkbox */
.check {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.check.unavailable { opacity: 0.35; cursor: not-allowed; }
.control-checks { display: flex; flex-direction: column; gap: 13px; }

/* palette swatches */
.palette { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.swatch {
  width: 22px; height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: copy; padding: 0;
  transition: transform 0.12s;
}
.swatch:hover { transform: scale(1.2); position: relative; z-index: 1; }

/* buttons */
.btn {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 10px 16px;
  background: var(--hover);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.08s, border-color 0.15s;
}
.btn:hover:not(:disabled) { background: #2c2c34; border-color: var(--line-strong); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-small { font-size: 11.5px; padding: 8px 13px; }
.btn-export {
  margin-top: auto;
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 8px 24px -10px rgba(255, 90, 31, 0.6);
}
.btn-export:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ---------- status bar ---------- */

.statusbar {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--line);
  padding: 11px 20px;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--muted);
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.015), transparent);
  min-height: 42px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.status-dot[data-mode="busy"] { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.status-dot[data-mode="ok"], .status-dot[data-mode="idle"] { background: var(--accent); }
.status-dot[data-mode="err"] { background: #ff3b30; }
@keyframes pulse { 50% { opacity: 0.35; } }

.status-right { margin-left: auto; color: var(--faint); }
.status-right a { color: var(--muted); text-decoration: none; transition: color 0.15s; }
.status-right a:hover { color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .desk { padding: 20px 12px; }
  .split { grid-template-columns: 1fr; }
  .pane-image { border-right: none; border-bottom: 1px solid var(--line); min-height: 360px; padding: 28px; }
  .statusbar { flex-wrap: wrap; }
}
