:root {
  color-scheme: dark;
  --bg: #101418;
  --panel: #172026;
  --panel-strong: #202b32;
  --text: #eef4f5;
  --muted: #9fb0b5;
  --line: #314047;
  --accent: #1db9a6;
  --accent-strong: #26d4bd;
  --danger: #e85d75;
  --field: #0d1215;
}

* {
  box-sizing: border-box;
}

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

button,
input,
a.download-host-button {
  font: inherit;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #06100e;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

p {
  margin: 4px 0 0;
  color: var(--muted);
}

.connect-form,
.session-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgb(29 185 166 / 22%);
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
}

a.download-host-button {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent-strong);
  padding: 0 14px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}

a.download-host-button:hover {
  background: rgb(29 185 166 / 12%);
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

#connectButton {
  border-color: var(--accent);
  background: var(--accent);
  color: #041411;
  font-weight: 700;
}

.session-panel {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.session-panel > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.label {
  color: var(--muted);
}

.desktop-stage {
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr);
  min-width: 0;
  background: #0a0d0f;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #11181d;
  padding: 8px 14px;
  color: var(--muted);
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.toolbar-actions button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent-strong);
}

#screenCanvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #050708;
  outline: none;
}

#screenCanvas:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.danger {
  color: var(--danger);
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(360px, 1fr);
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
