:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #66737f;
  --line: #d9e0e7;
  --surface: #f7f9fb;
  --panel: #ffffff;
  --panel-strong: #eef3f8;
  --blue: #1463ff;
  --green: #11845b;
  --red: #ba2d2d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  border-radius: 6px;
}

button {
  border: 0;
  background: var(--blue);
  color: white;
  padding: 9px 12px;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease;
}

button:active,
button.is-working {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.94);
}

button.has-spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-spinner {
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  animation: sitehub-spin 760ms linear infinite;
}

@keyframes sitehub-spin {
  to {
    transform: rotate(360deg);
  }
}

a {
  color: var(--blue);
  text-decoration: none;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.topbar span {
  color: var(--muted);
  margin-left: 10px;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar a,
.topbar button {
  padding: 8px 10px;
}

.topbar a.active {
  background: #e9f0ff;
}

.topbar form {
  margin: 0;
}

.topbar form button {
  background: #eef2f5;
  color: var(--ink);
}

.layout {
  padding: 24px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
}

#launcher {
  scroll-margin-top: 16px;
}

.launcher-heading {
  align-items: center;
}

.launcher-heading button {
  width: fit-content;
  min-height: 38px;
  padding: 0 16px;
}

.apps-table input,
.apps-table select {
  width: 100%;
}

.apps-table .sort-input {
  width: 76px;
}

.apps-table .screenshot-cell {
  min-width: 150px;
}

.apps-table .screenshot-cell form {
  margin-top: 8px;
}

.apps-table .screenshot-status {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.screenshot-status[data-tone="queued"],
.screenshot-status[data-tone="running"] {
  color: #075985;
}

.screenshot-status[data-tone="success"] {
  color: #166534;
}

.screenshot-status[data-tone="warn"] {
  color: #a16207;
}

.screenshot-status[data-tone="error"] {
  color: #b91c1c;
}

.launcher-auth-control {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.launcher-auth-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--line);
}

.auth-pill.enabled {
  color: #0f5132;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.auth-clear-form button {
  min-height: 28px;
  padding: 0 9px;
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff5f5;
  font-size: 12px;
}

.apps-table .order-cell {
  min-width: 132px;
  white-space: nowrap;
}

.drag-handle[draggable="true"] {
  cursor: grab;
}

.launcher-row.is-dragging {
  opacity: 0.48;
  cursor: grabbing;
}

.launcher-row.is-dragging td {
  background: #eef6ff;
}

.launcher-row.is-dragging.launcher-item-row {
  background: #eef6ff;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #f7f9fb;
  font-weight: 800;
  letter-spacing: 0;
  user-select: none;
}

.order-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-right: 8px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e9f0ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.order-buttons {
  display: inline-flex;
  gap: 4px;
  margin: 0;
  vertical-align: middle;
}

.order-buttons button {
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
}

.order-buttons button:disabled {
  cursor: default;
  opacity: 0.35;
}

.apps-table .actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  white-space: nowrap;
}

.apps-table .actions form {
  margin: 0;
}

.apps-table .actions .danger-button {
  min-height: 32px;
  padding: 0 12px;
}

.autosave-status {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.autosave-status[data-tone="good"] {
  color: var(--green);
}

.autosave-status[data-tone="warn"] {
  color: #936b00;
}

.autosave-status[data-tone="bad"] {
  color: var(--red);
  font-weight: 700;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.status {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--muted);
}

.status.online {
  background: var(--green);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.actions form {
  margin: 0;
}

.danger-button {
  background: #2a1118;
  border-color: #7a3342;
  color: #ffb6c2;
}

.panel {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr 1.5fr 0.5fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.launcher-add-panel {
  display: grid;
  margin-bottom: 18px;
}

.launcher-add-panel[hidden] {
  display: none;
}

.launcher-add-panel h3 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 16px;
}

.launcher-add-panel {
  grid-template-columns: 1.1fr 0.7fr 1.6fr auto;
  align-items: end;
}

.launcher-add-panel label {
  display: grid;
  color: var(--muted);
}

.site-launcher-panel {
  margin-bottom: 18px;
}

.site-launcher-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.site-launcher-panel-head h2,
.site-launcher-panel-head p,
.launcher-current h3,
.launcher-add-control h3 {
  margin: 0;
}

.launcher-tools {
  display: grid;
  gap: 10px;
}

.launcher-display-panel,
.launcher-transfer-panel,
.launcher-add-control {
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.launcher-display-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.launcher-display-panel h3 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 16px;
}

.launcher-display-panel label {
  display: grid;
  color: var(--muted);
}

.launcher-transfer-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) auto minmax(320px, 1.4fr);
  align-items: start;
  margin-bottom: 18px;
}

.launcher-transfer-panel.compact-transfer {
  grid-template-columns: auto auto minmax(180px, 260px) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.launcher-transfer-panel h3 {
  margin: 0;
  font-size: 16px;
}

.launcher-transfer-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.launcher-transfer-panel form {
  display: grid;
  gap: 10px;
}

.launcher-transfer-panel.compact-transfer form {
  display: contents;
}

.launcher-transfer-panel.compact-transfer label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.launcher-transfer-panel textarea {
  min-height: 42px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.launcher-transfer-panel.compact-transfer textarea {
  width: min(260px, 24vw);
  min-height: 38px;
  max-height: 80px;
}

.launcher-transfer-panel.compact-transfer button,
.launcher-transfer-panel.compact-transfer .secondary-link {
  width: fit-content;
  min-height: 38px;
}

.launcher-add-control {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.launcher-add-control button {
  width: fit-content;
  min-height: 38px;
  padding: 0 16px;
}

.launcher-add-panel-collapsible {
  max-height: 0;
  margin: 0;
  padding: 0 12px;
  overflow: hidden;
  opacity: 0;
  border: 1px solid transparent;
  background: var(--panel-strong);
  transform: translateY(-4px);
  transition: max-height 220ms ease, opacity 180ms ease, padding 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.launcher-add-panel-collapsible.is-open {
  max-height: 520px;
  padding: 12px;
  opacity: 1;
  border-color: var(--line);
  transform: translateY(0);
}

.site-launcher-panel .launcher-add-panel {
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(220px, 1.5fr) auto;
  gap: 10px;
  align-items: end;
}

.launcher-current {
  display: grid;
  gap: 10px;
}

.launcher-list {
  display: grid;
  gap: 8px;
}

.launcher-item-row {
  display: grid;
  grid-template-columns: 34px 126px minmax(220px, 1fr) minmax(190px, auto) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.launcher-select-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.launcher-title-input {
  min-height: 36px;
  font-weight: 650;
}

.launcher-item-row .screenshot-cell {
  min-width: 0;
  display: grid;
  gap: 6px;
  justify-items: start;
}

.launcher-screenshot-main {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.launcher-item-row .screenshot-status {
  color: var(--ink);
  font-size: 13px;
}

.launcher-item-row .actions {
  justify-content: flex-end;
}

.launcher-edit-panel {
  grid-column: 3 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) minmax(120px, 160px);
  gap: 10px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  border: 0 solid var(--line);
  background: #f8fafc;
  transition: max-height 180ms ease, opacity 160ms ease, padding 180ms ease, border-width 180ms ease;
}

.launcher-row.is-editing .launcher-edit-panel {
  max-height: 260px;
  opacity: 1;
  padding: 10px;
  border-width: 1px;
}

.launcher-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.launcher-bulk-actions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
}

.launcher-bulk-actions select {
  min-height: 36px;
}

.launcher-bulk-actions [hidden] {
  display: none;
}

.screenshot-progress {
  flex-basis: 100%;
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.screenshot-progress:empty {
  display: none;
}

.screenshot-progress[data-tone="info"] {
  color: #075985;
}

.screenshot-progress[data-tone="success"] {
  color: #166534;
}

.screenshot-progress[data-tone="warn"] {
  color: #a16207;
}

.screenshot-progress[data-tone="error"] {
  color: #b91c1c;
}

.launcher-edit-panel label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.launcher-edit-panel input,
.launcher-edit-panel select {
  width: 100%;
}

.launcher-edit-panel .wide {
  grid-column: 1 / -1;
}

.empty-state {
  padding: 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
}

.inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.inline-options label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-form {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.toolbar-form label {
  min-width: min(360px, 100%);
}

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

input,
select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: white;
  color: var(--ink);
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(2, 12, 28, 0.56) 0%, rgba(2, 12, 28, 0.36) 42%, rgba(2, 12, 28, 0.08) 100%),
    linear-gradient(180deg, rgba(2, 12, 28, 0.04) 0%, rgba(2, 12, 28, 0.32) 100%),
    url("/public/images/envis-console-login-bg.jpg") center / cover no-repeat;
}

.login::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(1, 8, 20, 0.08) 100%);
}

.login-environment-badge {
  position: absolute;
  top: clamp(20px, 4vw, 48px);
  left: clamp(20px, 4vw, 56px);
  z-index: 1;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(36px, 7vw, 104px);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: 0;
  text-shadow: 0 8px 34px rgba(0, 0, 0, 0.48);
}

.login-dev .login-environment-badge {
  color: #ffd25d;
}

.login form {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  position: relative;
  z-index: 1;
  justify-self: start;
  margin-left: clamp(0px, 6vw, 96px);
  margin-top: clamp(96px, 16vh, 180px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.18)),
    rgba(7, 18, 36, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(18px) saturate(130%);
  color: white;
}

.login h1 {
  margin: 0 0 4px;
  color: white;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.login label {
  color: rgba(255, 255, 255, 0.8);
}

.login input {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.login button {
  margin-top: 4px;
  background: linear-gradient(135deg, #1c7dff, #1553f0);
  box-shadow: 0 12px 30px rgba(20, 99, 255, 0.34);
}

@media (max-width: 720px) {
  .login {
    place-items: end center;
    padding: 20px;
  }

  .login-environment-badge {
    top: 22px;
    left: 20px;
    font-size: clamp(42px, 15vw, 76px);
  }

  .login form {
    justify-self: stretch;
    margin: 160px 0 0;
  }
}

.error {
  color: var(--red);
}

.notice {
  color: var(--green);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 12px;
  background: var(--blue);
  color: white;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 12px;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.diagnostic-grid article,
.settings-panel {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.diagnostic-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.diagnostic-grid strong {
  display: block;
  margin: 6px 0;
  font-size: 28px;
}

.diagnostic-grid .state-card.good {
  border-color: #9bd5c0;
  background: #f1fbf7;
}

.diagnostic-grid .state-card.warn {
  border-color: #f0d28c;
  background: #fff9e8;
}

.diagnostic-grid .state-card.bad {
  border-color: #e7aaa9;
  background: #fff4f3;
}

.diagnostic-grid small,
.settings-panel p {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 13px;
  background: #eef2f5;
  color: var(--muted);
}

.pill.good {
  background: #e5f7ef;
  color: var(--green);
}

.pill.warn {
  background: #fff4d7;
  color: #8a6200;
}

.pill.bad {
  background: #ffe8e8;
  color: var(--red);
}

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

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

.update-submit-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #b8d1ff;
  background: #edf4ff;
  color: #174ea6;
  border-radius: 6px;
  font-size: 14px;
}

.update-submit-status.is-error {
  border-color: #ffc9c9;
  background: #ffecec;
  color: var(--red);
}

.update-submit-status[hidden] {
  display: none;
}

.update-progress {
  position: relative;
  width: min(180px, 100%);
  height: 18px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #cfd9e5;
  border-radius: 999px;
  background: #eef3f8;
}

.update-progress > span {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f7dff, #64a7ff);
  transition: width 240ms ease;
}

.update-progress > small {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.update-progress[data-tone="good"] > span {
  background: linear-gradient(90deg, #15915f, #43bf86);
}

.update-progress[data-tone="bad"] > span {
  background: linear-gradient(90deg, #c33a3a, #e96f6f);
}

.table-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.table-inline-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.release-connection-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.release-connection-pills .pill {
  min-height: 24px;
  font-size: 12px;
}

td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.explicit-update-select {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.explicit-update-select select {
  width: min(260px, 100%);
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.release-ledger-list {
  display: grid;
  gap: 16px;
}

.release-ledger-group {
  display: grid;
  gap: 8px;
}

.release-ledger-subgroups {
  display: grid;
  gap: 14px;
}

.release-ledger-subgroup {
  display: grid;
  gap: 8px;
}

.release-ledger-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.release-ledger-head h3 {
  margin: 0;
}

.release-ledger-head h4 {
  margin: 0;
  font-size: 15px;
}

.release-ledger-head small,
.release-url-cell {
  color: var(--muted);
  font-size: 12px;
}

.release-url-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logs-table {
  table-layout: fixed;
  font-size: 13px;
}

.logs-table th:nth-child(1) {
  width: 132px;
}

.logs-table th:nth-child(2) {
  width: 72px;
}

.logs-table th:nth-child(3) {
  width: 108px;
}

.logs-table th:nth-child(4) {
  width: 128px;
}

.logs-table th,
.logs-table td {
  padding: 8px 10px;
}

.logs-table td {
  vertical-align: top;
}

.logs-table .pill {
  min-height: 22px;
  padding: 0 7px;
  font-size: 12px;
}

.log-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.log-category {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.log-device,
.log-message {
  overflow-wrap: anywhere;
}

.log-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin: -4px 0 14px;
}

.log-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.log-summary-grid article {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px;
}

.log-summary-grid span,
.log-summary-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.log-summary-grid strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 26px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.log-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.log-filterbar a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.log-filterbar a.active {
  border-color: var(--blue);
  background: #eaf2ff;
  color: var(--blue);
}

.log-filterbar span {
  font-size: 12px;
  color: inherit;
  opacity: 0.72;
}

.connection-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.account-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.account-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.account-card header,
.account-columns {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.account-card h2,
.account-card h3 {
  margin: 0 0 6px;
  letter-spacing: 0;
}

.account-card h3 {
  font-size: 14px;
  color: var(--muted);
}

.account-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-card li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.account-card li span,
.account-card li small {
  color: var(--muted);
}

.account-card li a,
.account-card li span:first-child {
  color: var(--ink);
  font-weight: 650;
}

.account-columns section {
  flex: 1 1 0;
}

.compact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 0;
}

.site-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.site-select-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
}

.site-select-card:hover,
.site-select-card:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(32, 120, 255, 0.12);
  outline: none;
}

.site-select-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.site-select-card h2 {
  margin: 0 0 6px;
  letter-spacing: 0;
}

.settings-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.settings-panel h2 {
  margin: 0;
  font-size: 18px;
}

.settings-panel h3 {
  margin: 4px 0 0;
  font-size: 15px;
}

.compact-table th,
.compact-table td {
  padding: 8px;
  font-size: 13px;
}

.compact-table small {
  color: var(--muted);
}

.settings-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.settings-panel label:has(input[type="text"]),
.settings-panel label:has(input[type="password"]),
.settings-panel label:has(input[type="number"]),
.settings-panel label:has(input[type="url"]),
.settings-panel label:has(select),
.settings-panel label:has(textarea),
.settings-panel label:has(input:not([type])) {
  display: grid;
  color: var(--muted);
}

.settings-panel input[type="radio"] {
  width: 18px;
  height: 18px;
}

.volume-slider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.volume-slider input[type="range"] {
  width: 100%;
  min-width: 0;
}

.volume-slider output {
  color: var(--ink);
  font-weight: 700;
  text-align: right;
}

.command-feedback {
  min-height: 20px;
  font-size: 13px;
  font-weight: 700;
}

.command-feedback[data-tone="info"] {
  color: var(--blue);
}

.command-feedback[data-tone="success"] {
  color: var(--green);
}

.command-feedback[data-tone="warn"] {
  color: #936000;
}

.command-feedback[data-tone="error"] {
  color: var(--red);
}

.current-screen-preview {
  margin: 12px 0 0;
}

.current-screen-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #111827;
}

.current-screen-preview figcaption,
.muted-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.metrics-panel {
  grid-column: 1 / -1;
}

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

.temperature-metric-grid {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 10px;
}

.metric-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

.metric-rangebar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 6px;
}

.metric-toolbar button,
.metric-rangebar a {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.metric-toolbar button[aria-selected="true"],
.metric-rangebar a.active {
  border-color: var(--blue);
  background: #eaf2ff;
  color: var(--blue);
}

.metric-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fbfcfe;
}

.metric-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric-card header strong {
  font-size: 14px;
}

.metric-card header span {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.metric-card[data-metric-group="temperature"] {
  display: none;
}

.metric-card[data-metric-group="temperature"][data-active="1"] {
  display: grid;
}

.metric-values {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card svg {
  width: 100%;
  height: 112px;
  overflow: visible;
}

.metric-card line {
  stroke: #d7e1eb;
  stroke-width: 1;
}

.metric-card path.metric-range {
  fill: rgba(47, 125, 255, 0.14);
  stroke: none;
}

.metric-card path.metric-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-card text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 112px;
  color: var(--muted);
  border: 1px dashed var(--line);
}

.large-code {
  font-size: 32px;
  color: var(--ink);
  letter-spacing: 0;
}

.large-code.compact {
  margin: 0;
  font-size: 24px;
}

.two-column > .qr-access-panel {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.qr-access-form {
  display: grid;
  gap: 12px;
}

.qr-access-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.qr-access-head h2,
.qr-access-head p,
.qr-access-group h3,
.remote-qr-card h3,
.remote-qr-card p,
.qr-rotate-form h3,
.qr-rotate-form p,
.qr-access-group p {
  margin: 0;
}

.qr-access-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.qr-access-summary span {
  white-space: nowrap;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

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

.qr-access-group {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.qr-access-group h3,
.remote-qr-card h3,
.qr-rotate-form h3 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.qr-access-group label {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.segmented-field > span {
  color: var(--muted);
  font-size: 13px;
}

.segmented-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented-options label {
  min-height: 42px;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.segmented-options label:has(input:checked) {
  border-color: #9bd5c0;
  background: #e7f8f2;
  color: var(--green);
}

.qr-access-group .qr-pin-field {
  display: grid;
}

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

.remote-qr-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.remote-qr-card img {
  width: 96px;
  height: 96px;
  padding: 6px;
  border: 1px solid var(--line);
  background: #fff;
}

.qr-access-actions {
  display: flex;
  justify-content: flex-start;
}

.qr-rotate-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.qr-rotate-form p {
  color: var(--muted);
}

.qr-rotate-form .danger-button {
  white-space: nowrap;
  border-color: #fecaca;
}

.section-head.compact {
  align-items: center;
  margin-top: 20px;
}

.section-head h2 {
  margin: 0 0 4px;
}

.site-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.site-logo-preview {
  position: relative;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  color: #101820;
  background: linear-gradient(135deg, var(--panel), var(--blue));
  font-size: 26px;
  font-weight: 900;
}

.site-logo-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.site-identity span,
.site-identity small {
  display: block;
  color: var(--muted);
}

.site-name-form {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.site-name-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 0;
  text-align: left;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: text;
}

.site-name-display:disabled {
  cursor: default;
}

.site-name-display[hidden] {
  display: none;
}

.site-name-display strong,
.site-identity strong {
  display: inline-block;
  margin: 2px 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.site-name-edit-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(35, 116, 225, 0.1);
  border: 1px solid rgba(35, 116, 225, 0.2);
  font-size: 16px;
  line-height: 1;
}

.site-name-display:hover .site-name-edit-icon,
.site-name-display:focus-visible .site-name-edit-icon {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.site-name-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-name-editor[hidden] {
  display: none;
}

.site-name-editor input {
  min-width: min(420px, 70vw);
}

.site-name-editor button {
  min-height: 36px;
  padding: 0 12px;
}

.logo-upload-button {
  width: fit-content;
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.logo-delete-button {
  width: fit-content;
  min-height: 32px;
  padding: 0 12px;
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff7f7;
  font-size: 13px;
}

.logo-delete-form {
  margin: 0;
}

.logo-modal[hidden] {
  display: none;
}

.logo-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.logo-modal-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.logo-modal-head h2 {
  margin: 0;
}

.logo-drop {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.logo-drop button {
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
}

.logo-drop p,
.logo-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.logo-crop-canvas {
  width: 260px;
  height: 260px;
  justify-self: center;
  touch-action: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  cursor: grab;
}

.logo-crop-canvas:active {
  cursor: grabbing;
}

.logo-zoom {
  display: grid;
  gap: 6px;
}

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding:
    max(10px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
  overflow: auto;
}

.gate-card {
  width: min(460px, 100%);
  max-height: calc(100dvh - 20px);
  display: grid;
  gap: 10px;
  box-sizing: border-box;
  padding: 16px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
}

.gate h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 6vw, 30px);
  line-height: 1.12;
}

.gate p {
  margin: 0;
}

.gate .eyebrow {
  font-size: 12px;
  letter-spacing: 0.04em;
}

.gate-actions {
  display: grid;
  gap: 10px;
}

.gate-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.gate-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-weight: 700;
}

.gate-form input {
  width: 100%;
  min-width: 0;
  text-align: center;
  font-size: 20px;
  letter-spacing: 0.08em;
}

.gate-form button,
.gate-account-link {
  min-height: 42px;
}

@media (max-width: 520px) {
  .gate-form {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 430px) and (orientation: landscape) {
  .gate {
    place-items: start center;
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .gate-card {
    width: min(620px, 100%);
    max-height: calc(100dvh - 16px);
    gap: 8px;
    padding: 12px;
  }

  .gate-card h1 {
    font-size: 22px;
  }

  .gate-actions {
    grid-template-columns: 1fr 1.2fr;
    align-items: end;
  }
}

.eyebrow {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.remote {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
  padding: 16px;
  background: #eef3f7;
}

.remote-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.launcher {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.app-card {
  min-height: 82px;
  display: grid;
  justify-items: start;
  align-content: center;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.app-card span {
  color: var(--muted);
}

.trackpad {
  min-height: 260px;
  display: grid;
  place-items: center;
  background: #172026;
  color: white;
  border-radius: 8px;
  user-select: none;
  touch-action: none;
}

.keyboard {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
}

html:has(.remote),
body:has(.remote) {
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  touch-action: none;
  background: #111827;
}

.remote {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100dvh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
  background: #111827;
  color: #f8fafc;
  overflow: hidden;
}

.remote[hidden],
.closed[hidden] {
  display: none;
}

.remote[data-view="launcher"] {
  grid-template-rows: auto auto 1fr;
}

.remote[data-view="launcher"] #pad,
.remote[data-view="launcher"] #inlinePanel,
.remote[data-view="launcher"] footer {
  display: none;
}

.remote header,
.remote footer {
  min-width: 0;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #162032;
  border-color: #2f3f55;
}

.remote header {
  border-bottom: 1px solid #2f3f55;
}

.remote header strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote footer {
  border-top: 1px solid #2f3f55;
  gap: 10px;
}

.remote .connection {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
  white-space: nowrap;
}

.remote .status,
.keyboard .status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-height: 28px;
  border-radius: 999px;
  margin: 0;
  padding: 0 9px;
  background: #253248;
  border: 1px solid #3c4d63;
  font-size: 13px;
  color: #9ee7d7;
  flex: 0 0 auto;
  text-align: right;
}

.remote .primary-status[data-tone="ok"] {
  background: #0f3f36;
  border-color: #2aa487;
  color: #b7fff0;
}

.remote .primary-status[data-tone="warn"] {
  background: #433719;
  border-color: #c9962d;
  color: #ffe6a8;
}

.remote .primary-status[data-tone="bad"] {
  background: #4b1f24;
  border-color: #d85b68;
  color: #ffd7dc;
}

.remote .primary-status[data-tone="checking"] {
  color: #cbd5e1;
}

.remote .network-status[data-mode="normal"] {
  color: #cbd5e1;
}

.remote .network-status[data-mode="light"] {
  background: #233653;
  border-color: #5d86c9;
  color: #cfe4ff;
}

.remote .network-status[data-mode="unstable"] {
  background: #433719;
  border-color: #c9962d;
  color: #ffe6a8;
}

.remote .network-status[data-mode="offline"] {
  background: #293241;
  border-color: #4b5563;
  color: #cbd5e1;
}

.remote .action-status {
  color: #cbd5e1;
}

.remote .close-session {
  flex: 0 0 auto;
  width: auto;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
  border-color: #54657a;
  background: #253248;
}

.remote button {
  position: relative;
  flex: 1;
  min-height: 58px;
  border: 1px solid #3c4d63;
  border-radius: 8px;
  background: #223047;
  color: white;
  box-shadow:
    0 5px 0 rgba(8, 12, 22, 0.68),
    0 14px 24px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 16px;
  touch-action: manipulation;
  transition: transform 70ms ease, background-color 120ms ease, border-color 120ms ease, box-shadow 70ms ease, filter 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

.remote button:active,
.remote button.is-pressed,
.remote footer button[aria-pressed="true"] {
  transform: translateY(4px) scale(0.982);
  background: #9ee7d7;
  border-color: #9ee7d7;
  color: #0f172a;
  filter: saturate(1.08);
  box-shadow:
    0 1px 0 rgba(8, 12, 22, 0.72),
    0 5px 10px rgba(0, 0, 0, 0.22),
    inset 0 2px 7px rgba(15, 23, 42, 0.24),
    0 0 0 4px rgba(158, 231, 215, 0.15);
}

.remote button:disabled,
.remote button[disabled] {
  transform: none;
  box-shadow: none;
}

.remote input {
  box-sizing: border-box;
  border: 1px solid #3c4d63;
  border-radius: 8px;
  padding: 0 12px;
  background: #0f172a;
  color: white;
  font-size: 16px;
}

.modebar {
  min-width: 0;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: #162032;
  border-bottom: 1px solid #2f3f55;
}

.modebar button {
  min-width: 0;
  min-height: 42px;
}

.modebar button[aria-pressed="true"],
.launcher-style-toggle button[aria-pressed="true"] {
  background: #9ee7d7;
  border-color: #9ee7d7;
  color: #0f172a;
}

.install-hint {
  position: absolute;
  z-index: 4;
  left: 10px;
  right: 10px;
  top: calc(108px + env(safe-area-inset-top));
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid #2f3f55;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

.install-hint.is-visible {
  display: flex;
}

.install-hint button {
  flex: 0 0 auto;
  min-height: 30px;
  width: 30px;
  padding: 0;
  border-radius: 999px;
  font-size: 16px;
}

#pad {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  color: #94a3b8;
  font-size: 15px;
  padding: 18px;
  text-align: center;
  background: #111827;
  border-radius: 0;
  user-select: none;
  touch-action: none;
}

#pad[data-mode="trackpad"]::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 12%;
  border-top: 1px solid #2f3f55;
  background: rgba(158, 231, 215, 0.045);
  pointer-events: none;
}

#pad[data-mode="trackpad"]::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  width: 12%;
  height: 100%;
  border-left: 1px solid #2f3f55;
  background: rgba(158, 231, 215, 0.06);
  pointer-events: none;
}

#trailCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#pad span {
  position: relative;
  z-index: 1;
}

.launcher-panel {
  box-sizing: border-box;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 18px;
  background: #101820;
  --launcher-cover-width: clamp(220px, 72vw, 320px);
}

.launcher-panel[hidden] {
  display: none;
}

.launcher-remote-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.launcher-remote-add input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid #3a4b61;
  border-radius: 8px;
  padding: 0 12px;
  color: #f8fafc;
  background: #172233;
  font-size: 14px;
}

.launcher-remote-add button {
  min-height: 38px;
  padding: 0 12px;
  border-color: #8fdccd;
  background: #9ee7d7;
  color: #101820;
  font-weight: 900;
}

.launcher-remote-add button:disabled {
  opacity: 0.62;
}

.launcher-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #101820 74%, rgba(16, 24, 32, 0));
}

.launcher-style-toggle,
.stylebar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.launcher-style-toggle button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}

.launcher-style-toggle .launcher-current-add {
  flex: 0 0 46px;
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 999px;
  border-color: #ff8a8a;
  background: #e84646;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 0 0 3px rgba(232, 70, 70, 0.16);
}

.launcher-style-toggle .launcher-current-add:disabled {
  opacity: 0.62;
}

.launcher-style-toggle .launcher-home-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  min-width: 42px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  line-height: 1;
  border-color: #54657a;
  background: #253248;
  color: #f8fafc;
}

.home-icon {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.launcher-style-toggle .kiosk-trackpad {
  flex: 1 1 150px;
  min-height: 38px;
  border-color: #8fdccd;
  background: #9ee7d7;
  color: #101820;
}

.remote-kiosk .modebar {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.remote-kiosk #mouseMode {
  display: none;
}

.remote-kiosk[data-view="launcher"] #pad,
.remote-kiosk[data-view="launcher"] #inlinePanel,
.remote-kiosk[data-view="launcher"] footer {
  display: none;
}

.remote-kiosk[data-view="pad"] #inlinePanel,
.remote-kiosk[data-view="pad"] footer {
  display: none;
}

.kiosk-pad-panel {
  position: sticky;
  top: 54px;
  z-index: 3;
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid #2f3f55;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.kiosk-pad-panel[hidden] {
  display: none;
}

.kiosk-pad {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  height: min(54vh, 480px);
  border: 1px solid #3c4d63;
  border-radius: 8px;
  color: #cbd5e1;
  background:
    linear-gradient(90deg, transparent 88%, rgba(158, 231, 215, 0.1) 88%),
    linear-gradient(0deg, transparent 84%, rgba(158, 231, 215, 0.08) 84%),
    #111827;
  text-align: center;
  touch-action: none;
  user-select: none;
}

.kiosk-pad span {
  max-width: min(420px, 82vw);
  font-size: 15px;
  line-height: 1.5;
}

.launcher-panel button {
  flex: none;
  min-height: 0;
  -webkit-appearance: none;
  appearance: none;
}

.launcher-feature {
  position: relative;
  display: grid;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  margin-bottom: 12px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent, #5f7f8f) 40%, #101820);
}

.launcher-feature-button {
  position: absolute;
  inset: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--accent, #5f7f8f) 40%, #101820);
}

.launcher-feature-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.launcher-feature-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.launcher-feature-button span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 56px;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.7);
}

.launcher-feature-img + span {
  display: none;
}

.launcher-feature-body {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  text-align: left;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

.launcher-feature-body span {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: #0f1724;
  background: #e8b945;
  font-size: 12px;
}

.launcher-feature-body .feature-title-button {
  display: block;
  width: 100%;
  margin: 10px 0 4px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: left;
}

.launcher-feature-body p {
  margin: 0;
  color: #dbe6ee;
  font-size: 14px;
}

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.launcher-card {
  display: grid;
  grid-template-rows: auto auto;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: #f8fafc;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #1d2838;
}

.launcher-card-shot {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #5f7f8f) 58%, #101820), #07111c);
}

.launcher-card-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.launcher-card-shot span,
.launcher-cover-frame span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 42px;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.7);
}

.launcher-card-shot img + span,
.launcher-cover-frame img + span {
  display: none;
}

.launcher-card-meta,
.launcher-cover-title {
  min-height: 64px;
  padding: 8px 10px;
}

.launcher-cover-title {
  display: grid;
  gap: 2px;
}

.launcher-title-button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f8fafc;
  background: transparent;
  border: 0;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
  text-align: left;
}

.launcher-card-meta small,
.launcher-cover-title small {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 2px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.launcher-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.launcher-phone-open,
.launcher-delete {
  display: inline-grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.launcher-phone-open {
  position: relative;
  color: #101820;
  background: #9ee7d7;
}

.launcher-phone-open span {
  position: relative;
  display: block;
  width: 12px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.launcher-phone-open span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.launcher-delete {
  color: #fecaca;
  background: rgba(185, 28, 28, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.36);
  font-size: 17px;
  line-height: 1;
}

.launcher-theater {
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}

.launcher-theater.is-dragging {
  scroll-snap-type: none;
}

.launcher-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 78vw);
  align-items: start;
  gap: 12px;
  scrollbar-width: none;
}

.launcher-strip::-webkit-scrollbar {
  display: none;
}

.launcher-cover {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  align-self: start;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: #f8fafc;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #1d2838;
  scroll-snap-align: center;
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 260px 230px;
}

.launcher-cover.is-active {
  outline: 2px solid #9ee7d7;
  outline-offset: -2px;
}

.launcher-feature.is-active,
.launcher-card.is-active {
  outline: 2px solid #9ee7d7;
  outline-offset: -2px;
}

.launcher-cover-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #5f7f8f) 58%, #101820), #07111c);
}

.launcher-cover-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.launcher-message {
  min-height: 18px;
  margin: 10px 2px 0;
  color: #9ee7d7;
  font-size: 13px;
  text-align: center;
}

.inline-panel {
  display: grid;
  gap: 8px;
  padding: 12px 16px;
  color: #94a3b8;
  text-align: center;
  background: #162032;
  border-top: 1px solid #2f3f55;
  touch-action: auto;
}

.inline-panel p {
  margin: 0;
  font-size: 13px;
}

.inline-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

#inlineInput {
  width: 100%;
  min-height: 52px;
  text-align: center;
}

.input-mode-toggle {
  flex: 0 0 auto;
  width: 58px;
  min-height: 52px;
  padding: 0;
  font-size: 13px;
}

.home-button {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  min-height: 52px;
  padding: 0;
  border-color: #54657a;
  color: #f8fafc;
  background: #253248;
  line-height: 1;
}

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

.keyboard-row button {
  min-height: 38px;
  padding: 0 8px;
  font-size: 12px;
}

.closed {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  box-sizing: border-box;
  text-align: center;
  color: #94a3b8;
  background: #111827;
}

.closed h1 {
  color: #f8fafc;
}

.program {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 24px;
  padding: clamp(24px, 6vw, 72px);
  color: #f8fafc;
  background:
    linear-gradient(120deg, rgba(20, 99, 255, 0.28), transparent 42%),
    linear-gradient(180deg, #101820, #162032);
}

.program-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding-bottom: 24px;
}

.program-kicker {
  margin: 0 0 12px;
  color: #9ee7d7;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.program h1 {
  margin: 0;
  font-size: clamp(48px, 11vw, 128px);
  line-height: 0.95;
}

.program-hero p {
  color: #cbd5e1;
}

.program time {
  flex: 0 0 auto;
  color: #9ee7d7;
  font-size: clamp(18px, 3vw, 34px);
  font-weight: 700;
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.program-grid article {
  min-height: 140px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.program-grid span,
.program-grid small {
  color: #9aa8b7;
}

.program-grid strong {
  font-size: clamp(28px, 5vw, 54px);
}

@media (max-width: 1080px) {
  .qr-access-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
    height: auto;
    gap: 12px;
  }

  .layout {
    padding: 14px;
    overflow-x: auto;
  }

  .panel,
  .launcher-add-panel,
  .launcher-display-panel,
  .launcher-transfer-panel,
  .keyboard {
    grid-template-columns: 1fr;
  }

  .launcher-transfer-panel.compact-transfer {
    grid-template-columns: 1fr;
  }

  .launcher-transfer-panel.compact-transfer form {
    display: grid;
    gap: 10px;
  }

  .launcher-transfer-panel.compact-transfer textarea {
    width: 100%;
  }

  .site-launcher-panel-head,
  .launcher-add-control {
    align-items: stretch;
    flex-direction: column;
  }

  .site-launcher-panel .launcher-add-panel,
  .launcher-item-row {
    grid-template-columns: 1fr;
  }

  .launcher-edit-panel {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .launcher-edit-panel .wide {
    grid-column: 1;
  }

  .launcher-item-row .screenshot-cell {
    min-width: 0;
  }

  .launcher-screenshot-main {
    flex-wrap: wrap;
  }

  .diagnostic-grid,
  .log-summary-grid,
  .two-column,
  .split-grid,
  .qr-access-grid,
  .remote-qr-grid,
  .remote-qr-card,
  .qr-rotate-form {
    grid-template-columns: 1fr;
  }

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

  .remote-qr-card img {
    justify-self: start;
  }

  .qr-access-head {
    display: grid;
  }

  .toolbar-form {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  html:has(.remote),
  body:has(.remote) {
    min-height: 100svh;
  }

  .remote {
    min-height: 100svh;
    height: 100svh;
    grid-template-rows: auto auto 1fr auto auto;
  }

  .remote[data-view="launcher"] {
    grid-template-rows: auto auto 1fr;
  }

  .remote header,
  .remote footer {
    padding: 7px 12px;
  }

  .remote header {
    gap: 10px;
  }

  .remote header strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }

  .remote .connection {
    gap: 5px;
  }

  .remote .status,
  .keyboard .status {
    font-size: 12px;
  }

  .remote .action-status {
    padding-left: 6px;
  }

  .remote .close-session {
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
  }

  .modebar {
    gap: 6px;
    padding: 6px 12px;
  }

  .modebar button {
    min-height: 34px;
    font-size: 14px;
  }

  .install-hint.is-visible {
    display: none;
  }

  #pad {
    padding: 10px;
    font-size: 13px;
  }

  .inline-panel {
    grid-template-columns: minmax(160px, 0.8fr) minmax(260px, 1.4fr) minmax(150px, 0.7fr);
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    text-align: left;
  }

  .inline-panel p {
    font-size: 12px;
    line-height: 1.25;
  }

  .inline-row {
    grid-template-columns: 1fr 48px 62px;
    gap: 6px;
  }

  #inlineInput,
  .input-mode-toggle,
  .home-button,
  .keyboard-row button {
    min-height: 38px;
    font-size: 13px;
  }

  .keyboard-row {
    gap: 6px;
  }

  .remote footer {
    gap: 8px;
  }

  .remote footer button {
    min-height: 38px;
    font-size: 14px;
  }

  .launcher-panel {
    padding: 8px 10px 10px;
    --launcher-cover-width: clamp(168px, 30vw, 230px);
  }

  .launcher-toolbar {
    margin-bottom: 6px;
  }

  .launcher-style-toggle button,
  .launcher-style-toggle .launcher-current-add,
  .launcher-style-toggle .launcher-home-button {
    min-height: 28px;
    font-size: 12px;
  }

  .launcher-style-toggle .launcher-current-add {
    flex-basis: 36px;
    width: 36px;
    min-width: 36px;
    min-height: 36px;
    font-size: 11px;
  }

  .launcher-style-toggle .launcher-home-button {
    min-width: 52px;
    padding: 0;
  }

  .home-icon {
    width: 19px;
    height: 19px;
  }

  .launcher-theater {
    padding: 2px 0 8px;
  }

  .launcher-strip {
    padding: 4px 11vw 12px;
  }

  .launcher-cover {
    grid-template-rows: auto auto;
    margin: 0 6px;
  }

  .launcher-cover-frame span {
    font-size: 42px;
  }

  .launcher-cover-reflection {
    height: 16px;
  }

  .launcher-cover-title {
    margin-top: 3px;
    min-height: 0;
  }

  .launcher-cover-title .launcher-title-button {
    font-size: 14px;
    line-height: 1.18;
  }

  .launcher-cover-title small {
    font-size: 11px;
  }

  .launcher-feature {
    min-height: 0;
  }

  .launcher-feature-body {
    padding: 12px;
    gap: 4px;
  }

  .launcher-feature-body .feature-title-button {
    font-size: 22px;
  }

  .launcher-feature-body p {
    font-size: 12px;
    line-height: 1.35;
  }

  .launcher-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }

  .launcher-card {
    grid-template-rows: auto auto;
    min-height: 0;
  }

  .launcher-card-meta {
    padding: 8px;
  }

  .launcher-card-meta .launcher-title-button {
    font-size: 13px;
  }

  .launcher-card-meta small {
    font-size: 11px;
  }

  .launcher-message {
    margin-top: 4px;
    font-size: 12px;
  }
}
