:root {
  color-scheme: dark;
  --bg: #101316;
  --panel: #171c20;
  --panel-2: #20272c;
  --text: #eef2f3;
  --muted: #9aa7ad;
  --line: #2f383d;
  --accent: #2fbf9f;
  --accent-2: #f3c75f;
  --danger: #e36565;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 980px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
.file-button,
.button-link {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

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

.primary {
  border-color: transparent;
  background: var(--accent);
  color: #071311;
  font-weight: 800;
}

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

.work {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.mode-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.mode-tabs button.active {
  border-color: var(--accent);
  background: #17332e;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.08;
}

h2 {
  margin-bottom: 6px;
  font-size: 17px;
}

.panel {
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.preview-wrap {
  display: grid;
  place-items: center;
  padding: 18px;
  background: #0c0f11;
}

#previewCanvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111619;
  cursor: grab;
}

#previewCanvas.dragging {
  cursor: grabbing;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.preview-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.panel-head p,
.hint {
  color: var(--muted);
  font-size: 13px;
}

.file-button input {
  display: none;
}

.file-list {
  display: grid;
  gap: 10px;
  min-height: 180px;
  max-height: calc(100vh - 360px);
  overflow: auto;
  padding: 18px;
}

.remove-note {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.remove-note strong {
  color: var(--accent-2);
}

.remove-note code {
  display: block;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0f11;
  color: var(--text);
  white-space: nowrap;
}

.file-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151a1e;
}

.result-item {
  align-items: start;
}

.result-preview {
  width: 220px;
  max-height: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0f11;
  object-fit: contain;
}

.progress {
  height: 8px;
  overflow: hidden;
  margin-top: 8px;
  border-radius: 999px;
  background: #293136;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.pill {
  border-radius: 999px;
  padding: 6px 8px;
  background: #263037;
  color: var(--accent-2);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.name,
.detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name {
  margin-bottom: 5px;
  font-weight: 800;
}

.detail {
  color: var(--muted);
  font-size: 12px;
}

.settings {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.settings-section,
.control-stack {
  display: grid;
  gap: 12px;
}

.segmented,
.position-grid {
  display: grid;
  gap: 8px;
}

.segmented {
  grid-template-columns: 1fr 1fr;
}

.position-grid {
  grid-template-columns: 1fr 1fr;
}

.position-grid button:nth-child(3) {
  grid-column: span 2;
}

.segmented button.active,
.position-grid button.active {
  border-color: var(--accent);
  background: #17332e;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #111619;
  color: var(--text);
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: center;
  text-transform: none;
}

.checkbox-row input {
  width: auto;
  min-height: auto;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

output {
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
}

.hidden {
  display: none;
}
