:root {
  color-scheme: dark;
  --page: #090c0e;
  --surface: #11161a;
  --surface-raised: #182027;
  --line: #33404a;
  --text: #edf3f6;
  --muted: #94a4af;
  --cyan: #56d6e8;
  --red: #ff5263;
  --green: #43d393;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  display: grid;
  place-items: start center;
  padding: 32px 16px;
}

button,
input,
select { font: inherit; }

.console {
  width: min(920px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.consoleHeader,
.sectionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.consoleHeader {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p { margin: 0; }

h1 { font-size: 25px; line-height: 1.15; }
h2 { font-size: 14px; }

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.statusLight {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px rgba(255, 82, 99, 0.65);
}

.connection[data-state="online"] .statusLight {
  background: var(--green);
  box-shadow: 0 0 12px rgba(67, 211, 147, 0.65);
}

.connection[data-state="waiting"] .statusLight {
  background: #f0bd52;
  box-shadow: 0 0 12px rgba(240, 189, 82, 0.55);
}

.authMessage {
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255, 82, 99, 0.5);
  background: rgba(105, 18, 29, 0.24);
  color: #ffb4bd;
  font-size: 13px;
}

.optionSection,
.uploadSection,
.activity { padding: 22px 24px 24px; }

.optionSection { border-bottom: 1px solid var(--line); }

.sectionHeader {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.optionGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.optionCell { position: relative; min-width: 0; }

.optionCell > button:first-child {
  width: 100%;
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.optionCell > button span,
.optionCell > button small { display: block; overflow-wrap: anywhere; }

.optionCell > button small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.optionCell > button:hover:not(:disabled) { border-color: var(--cyan); background: #1b2b32; }
.optionCell > button:active:not(:disabled) { transform: translateY(1px); }
.optionCell > button:disabled { cursor: not-allowed; opacity: 0.42; }
.optionCell > button[data-sent="true"] { border-color: var(--green); color: var(--green); }

.removeButton {
  width: 100%;
  margin-top: 4px;
  padding: 5px;
  border: 0;
  background: transparent;
  color: #d68a93;
  cursor: pointer;
  font-size: 11px;
}

.setupSection {
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 17, 0.56);
}

.setupSection > summary {
  padding: 17px 24px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style-position: inside;
}

.setupSection[open] > summary {
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.setupContent .uploadSection { border-bottom: 1px solid var(--line); }

.clearAllButton,
.uploadButton {
  min-height: 46px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
}

.clearAllButton {
  width: 100%;
  margin-top: 12px;
  border: 1px solid rgba(255, 82, 99, 0.72);
  background: rgba(105, 18, 29, 0.24);
  color: #ff8b98;
}

.clearAllButton:hover:not(:disabled) { border-color: var(--red); background: rgba(145, 24, 39, 0.34); color: #ffd7dc; }
.clearAllButton:disabled { cursor: not-allowed; opacity: 0.42; }

.uploadForm {
  display: grid;
  grid-template-columns: 1.5fr 1.2fr repeat(2, minmax(0, 0.7fr)) minmax(150px, 0.9fr);
  gap: 10px;
  align-items: end;
}

.uploadForm label { display: grid; gap: 6px; min-width: 0; }
.uploadForm label > span { color: var(--muted); font-size: 11px; }

.slotPicker {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.slotPicker legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}

.slotButtons {
  display: grid;
  grid-template-columns: repeat(4, minmax(44px, 1fr));
  gap: 7px;
}

.slotButtons button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0d1216;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.slotButtons button[aria-pressed="true"] {
  border-color: var(--cyan);
  background: #17333b;
  color: #c7f8ff;
}

.uploadForm input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0d1216;
  color: var(--text);
  padding: 8px 10px;
}

.uploadButton { border: 1px solid #3f9baa; background: #16323a; color: #aaf4ff; padding: 0 14px; }
.uploadButton:hover:not(:disabled) { background: #1c4651; }
.uploadButton:disabled { cursor: wait; opacity: 0.55; }
.uploadProgress { margin-top: 12px; color: var(--cyan); font-size: 12px; }

.clearButton { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.clearButton:hover { color: var(--text); }

.activity ol {
  min-height: 82px;
  max-height: 220px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.activity li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(51, 64, 74, 0.65);
  color: var(--muted);
  font-size: 13px;
}

.activity li strong { color: var(--text); }

@media (max-width: 820px) {
  .uploadForm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slotPicker,
  .fileField { grid-column: span 2; }
}

@media (max-width: 620px) {
  body { padding: 0; }
  .console { min-height: 100vh; border: 0; border-radius: 0; }
  .consoleHeader,
  .optionSection,
  .uploadSection,
  .activity { padding-right: 16px; padding-left: 16px; }
  .optionGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uploadForm { grid-template-columns: 1fr; }
  .slotPicker,
  .fileField { grid-column: auto; }
  .slotButtons { grid-template-columns: repeat(3, minmax(44px, 1fr)); }
  .sectionHeader { align-items: flex-start; flex-direction: column; gap: 5px; }
}
